mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
replace Presenter#invoice_date with a delagator
This commit is contained in:
@@ -4,8 +4,8 @@ class Invoice
|
||||
class DataPresenter
|
||||
attr_reader :invoice
|
||||
|
||||
delegate :data, :date, to: :invoice
|
||||
delegate :number, to: :invoice, prefix: true
|
||||
delegate :data, to: :invoice
|
||||
delegate :number, :date, to: :invoice, prefix: true
|
||||
|
||||
FINALIZED_NON_SUCCESSFUL_STATES = %w(canceled returned).freeze
|
||||
|
||||
@@ -83,10 +83,6 @@ class Invoice
|
||||
all_eligible_adjustments.select { |a| a.originator_type == 'Spree::TaxRate' }
|
||||
end
|
||||
|
||||
def invoice_date
|
||||
date
|
||||
end
|
||||
|
||||
def paid?
|
||||
data[:payment_state] == 'paid' || data[:payment_state] == 'credit_owed'
|
||||
end
|
||||
|
||||
@@ -31,6 +31,7 @@ describe '
|
||||
login_as_admin
|
||||
visit spree.edit_admin_order_path(order)
|
||||
end
|
||||
|
||||
describe 'creating invoices' do
|
||||
context 'when the order has no invoices' do
|
||||
it 'creates an invoice for the order' do
|
||||
|
||||
Reference in New Issue
Block a user