rails up to 7.0and ruby to 2.7.2
mv lib to app/lib due to upgrade removing concerns from autoload path resolve zeitwerk issues make foodsoft run for dev on rails 7 and ruby 2.7 fix mail file permission bug fix database_config fix articles controller test ActiveModell::Error bump Gemfile.lock
This commit is contained in:
parent
d7591d46b9
commit
fb8ccfea4a
53 changed files with 583 additions and 594 deletions
39
app/lib/invoices_csv.rb
Normal file
39
app/lib/invoices_csv.rb
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
require 'csv'
|
||||
|
||||
class InvoicesCsv < RenderCsv
|
||||
include ApplicationHelper
|
||||
|
||||
def header
|
||||
[
|
||||
Invoice.human_attribute_name(:created_at),
|
||||
Invoice.human_attribute_name(:created_by),
|
||||
Invoice.human_attribute_name(:date),
|
||||
Invoice.human_attribute_name(:supplier),
|
||||
Invoice.human_attribute_name(:number),
|
||||
Invoice.human_attribute_name(:amount),
|
||||
Invoice.human_attribute_name(:total),
|
||||
Invoice.human_attribute_name(:deposit),
|
||||
Invoice.human_attribute_name(:deposit_credit),
|
||||
Invoice.human_attribute_name(:paid_on),
|
||||
Invoice.human_attribute_name(:note)
|
||||
]
|
||||
end
|
||||
|
||||
def data
|
||||
@object.each do |t|
|
||||
yield [
|
||||
t.created_at,
|
||||
show_user(t.created_by),
|
||||
t.date,
|
||||
t.supplier.name,
|
||||
t.number,
|
||||
t.amount,
|
||||
t.expected_amount,
|
||||
t.deposit,
|
||||
t.deposit_credit,
|
||||
t.paid_on,
|
||||
t.note
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue