mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Add autocheck by reference number in field or in description
(parsed by regexp, first 7-digit number) See #1415
This commit is contained in:
parent
3dcc476114
commit
effedcf585
5 changed files with 30 additions and 22 deletions
|
@ -6,9 +6,20 @@ class BankTransactionTest < ActiveSupport::TestCase
|
|||
@invoice = invoices(:one)
|
||||
end
|
||||
|
||||
def test_matches_against_invoice_number_and_reference_number
|
||||
create_payable_invoice(number: '2222', total: 10, reference_no: '1111')
|
||||
transaction = BankTransaction.new(description: 'invoice #2222', sum: 10, reference_no: '1111')
|
||||
def test_matches_against_invoice_nubmber_and_reference_number
|
||||
create_payable_invoice(number: '2222', total: 10, reference_no: '1234567')
|
||||
transaction = BankTransaction.new(description: 'invoice #2222', sum: 10, reference_no: '1234567')
|
||||
|
||||
assert_difference 'AccountActivity.count' do
|
||||
transaction.autobind_invoice
|
||||
end
|
||||
end
|
||||
|
||||
def test_matches_against_invoice_nubmber_and_reference_number_in_description
|
||||
create_payable_invoice(number: '2222', total: 10, reference_no: '1234567')
|
||||
transaction = BankTransaction.new(description: 'invoice #2222',
|
||||
sum: 10,
|
||||
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
||||
|
||||
assert_difference 'AccountActivity.count' do
|
||||
transaction.autobind_invoice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue