mirror of
https://github.com/internetee/registry.git
synced 2025-07-13 14:35:05 +02:00
Fix test
This commit is contained in:
parent
41c2e2d5e4
commit
b6fd215d29
2 changed files with 10 additions and 3 deletions
|
@ -109,4 +109,11 @@ class Invoice < ActiveRecord::Base
|
|||
def sum
|
||||
sum_without_vat + vat
|
||||
end
|
||||
|
||||
class << self
|
||||
def cancel_overdue_invoices
|
||||
cr_at = Time.zone.now - Setting.days_to_keep_overdue_invoices_active.days
|
||||
self.class.where('due_date < ? AND created_at < ?', Time.zone.now, cr_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,18 +41,18 @@ describe BankStatement do
|
|||
|
||||
it 'should bind transactions with invoices' do
|
||||
r = Fabricate(:registrar_with_no_account_activities, reference_no: 'RF7086666663')
|
||||
r.issue_prepayment_invoice(200, 'add some money')
|
||||
invoice = r.issue_prepayment_invoice(200, 'add some money')
|
||||
|
||||
bs = Fabricate(:bank_statement, bank_transactions: [
|
||||
Fabricate(:bank_transaction, {
|
||||
sum: 240.0, # with vat
|
||||
reference_no: 'RF7086666663',
|
||||
description: 'Invoice no. 1'
|
||||
description: "Invoice no. #{invoice.number}"
|
||||
}),
|
||||
Fabricate(:bank_transaction, {
|
||||
sum: 240.0,
|
||||
reference_no: 'RF7086666663',
|
||||
description: 'Invoice no. 1'
|
||||
description: "Invoice no. #{invoice.number}"
|
||||
})
|
||||
])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue