Bugzilla – Attachment 111730 Details for
Bug 26175
Remove warn if undefined barcode in misc/export_records.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26175: (QA follow-up) Add tests for previous cashups
Bug-26175-QA-follow-up-Add-tests-for-previous-cash.patch (text/plain), 3.25 KB, created by
Martin Renvoize (ashimema)
on 2020-10-15 13:15:08 UTC
(
hide
)
Description:
Bug 26175: (QA follow-up) Add tests for previous cashups
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-10-15 13:15:08 UTC
Size:
3.25 KB
patch
obsolete
>From 0886093af2baa0cedc8c0c069ff3fd66416926e1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 15 Oct 2020 14:05:45 +0100 >Subject: [PATCH] Bug 26175: (QA follow-up) Add tests for previous cashups > >--- > t/db_dependent/Koha/Cash/Register/Action.t | 65 +++++++++++++++++++++- > 1 file changed, 64 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Cash/Register/Action.t b/t/db_dependent/Koha/Cash/Register/Action.t >index 9fc08e808e..0d9c70e76c 100755 >--- a/t/db_dependent/Koha/Cash/Register/Action.t >+++ b/t/db_dependent/Koha/Cash/Register/Action.t >@@ -81,7 +81,7 @@ subtest 'register' => sub { > }; > > subtest 'cashup_summary' => sub { >- plan tests => 8; >+ plan tests => 14; > > $schema->storage->txn_begin; > >@@ -281,6 +281,69 @@ subtest 'cashup_summary' => sub { > is_deeply( $summary->{outgoing}, $expected_outgoing, > "outgoing arrayref is correct" ); > >+ # Backdate cashup1 so we can add a new cashup to check 'previous' >+ $cashup1->timestamp(\'NOW() - INTERVAL 2 MINUTE')->store(); >+ $cashup1->discard_changes; >+ >+ # Transaction 4 >+ my $debt4 = $builder->build_object( >+ { >+ class => 'Koha::Account::Lines', >+ value => { >+ register_id => undef, >+ amount => '2.75', >+ amountoutstanding => '0.00', >+ credit_type_code => undef, >+ debit_type_code => 'OVERDUE', >+ date => \'NOW() - INTERVAL 1 MINUTE' >+ }, >+ } >+ ); >+ my $income3 = $builder->build_object( >+ { >+ class => 'Koha::Account::Lines', >+ value => { >+ register_id => $register->id, >+ amount => '-2.75', >+ amountoutstanding => '0.00', >+ credit_type_code => 'PAYMENT', >+ debit_type_code => undef, >+ date => \'NOW() - INTERVAL 1 MINUTE' >+ }, >+ } >+ ); >+ $builder->build_object( >+ { >+ class => 'Koha::Account::Offsets', >+ value => { >+ credit_id => $income3->accountlines_id, >+ debit_id => $debt4->accountlines_id, >+ amount => '2.75', >+ type => 'Payment' >+ }, >+ } >+ ); >+ >+ my $cashup2 = >+ $register->add_cashup( { manager_id => $manager->id, amount => '2.75' } ); >+ >+ $summary = $cashup2->cashup_summary; >+ >+ is( $summary->{from_date}, $cashup1->timestamp, >+ "from_date returns the timestamp of the previous cashup action" ); >+ is( $summary->{to_date}, $cashup2->timestamp, >+ "to_date equals cashup timestamp" ); >+ is( ref( $summary->{income_transactions} ), >+ 'Koha::Account::Lines', >+ "income_transactions contains Koha::Account::Lines" ); >+ is( $summary->{income_transactions}->count, >+ 1, "income_transactions contains 2 transactions" ); >+ is( ref( $summary->{outgoing_transactions} ), >+ 'Koha::Account::Lines', >+ "outgoing_transactions contains Koha::Account::Lines" ); >+ is( $summary->{outgoing_transactions}->count, >+ 0, "outgoing_transactions contains 1 transaction" ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26175
:
107947
|
108054
|
108190
|
111730