Bugzilla – Attachment 111731 Details for
Bug 26172
Add a cashup summary view (with option to print)
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.30 KB, created by
Martin Renvoize (ashimema)
on 2020-10-15 13:15:41 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:41 UTC
Size:
3.30 KB
patch
obsolete
>From 8097d4e222d4d6f8986a7a1049be1a2fb58d8704 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 > >https://bugs.koha-community.org/show_bug.cgi?id=26172 >--- > 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 26172
:
108093
|
108095
|
108523
|
108817
|
108818
|
108822
|
108825
|
108826
|
108827
|
111162
|
111163
|
111164
|
111598
|
111599
|
111600
|
111601
|
111629
|
111630
|
111631
|
111632
|
111633
|
111634
|
111668
|
111683
|
111691
|
111692
|
111731
|
111732
|
112907
|
112908
|
112909