Bugzilla – Attachment 193141 Details for
Bug 40445
Point of Sale reconciliation input during daily summaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40445: (follow-up) Set amountoutstanding for CASHUP_SURPLUS and CASHUP_DEFICIT accountlines
9471014.patch (text/plain), 6.64 KB, created by
Martin Renvoize (ashimema)
on 2026-02-13 17:21:48 UTC
(
hide
)
Description:
Bug 40445: (follow-up) Set amountoutstanding for CASHUP_SURPLUS and CASHUP_DEFICIT accountlines
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-13 17:21:48 UTC
Size:
6.64 KB
patch
obsolete
>From 94710144cd4c6d83c0948faa2850019aaaa346ec Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 13 Feb 2026 17:14:17 +0000 >Subject: [PATCH] Bug 40445: (follow-up) Set amountoutstanding for > CASHUP_SURPLUS and CASHUP_DEFICIT accountlines > >CASHUP_SURPLUS and CASHUP_DEFICIT accountlines represent immediate >reconciliation adjustments that should be considered settled at the >time of creation. These records should have amountoutstanding set to 0 >to indicate they are fully reconciled. > >This patch adds amountoutstanding => 0 when creating both types of >reconciliation accountlines and updates the tests to verify this >behavior. > >Test plan: >1. prove t/db_dependent/Koha/Cash/Register.t >2. Verify all tests pass, specifically the new tests for amountoutstanding > >Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk> >--- > Koha/Cash/Register.pm | 38 +++++++++++++++-------------- > t/db_dependent/Koha/Cash/Register.t | 14 ++++++----- > 2 files changed, 28 insertions(+), 24 deletions(-) > >diff --git a/Koha/Cash/Register.pm b/Koha/Cash/Register.pm >index db37537196a..611347e8568 100644 >--- a/Koha/Cash/Register.pm >+++ b/Koha/Cash/Register.pm >@@ -448,15 +448,16 @@ sub add_cashup { > # Surplus: more cash found than expected (credits are negative amounts) > my $surplus = Koha::Account::Line->new( > { >- date => $reconciliation_date, >- amount => -abs($difference), # Credits are negative >- credit_type_code => 'CASHUP_SURPLUS', >- manager_id => $manager_id, >- interface => 'intranet', >- branchcode => $self->branch, >- register_id => $self->id, >- payment_type => 'CASH', >- note => $reconciliation_note >+ date => $reconciliation_date, >+ amount => -abs($difference), # Credits are negative >+ amountoutstanding => 0, >+ credit_type_code => 'CASHUP_SURPLUS', >+ manager_id => $manager_id, >+ interface => 'intranet', >+ branchcode => $self->branch, >+ register_id => $self->id, >+ payment_type => 'CASH', >+ note => $reconciliation_note > } > )->store(); > >@@ -474,15 +475,16 @@ sub add_cashup { > # Deficit: less cash found than expected > my $deficit = Koha::Account::Line->new( > { >- date => $reconciliation_date, >- amount => abs($difference), >- debit_type_code => 'CASHUP_DEFICIT', >- manager_id => $manager_id, >- interface => 'intranet', >- branchcode => $self->branch, >- register_id => $self->id, >- payment_type => 'CASH', >- note => $reconciliation_note >+ date => $reconciliation_date, >+ amount => abs($difference), >+ amountoutstanding => 0, >+ debit_type_code => 'CASHUP_DEFICIT', >+ manager_id => $manager_id, >+ interface => 'intranet', >+ branchcode => $self->branch, >+ register_id => $self->id, >+ payment_type => 'CASH', >+ note => $reconciliation_note > } > )->store(); > my $account_offset = Koha::Account::Offset->new( >diff --git a/t/db_dependent/Koha/Cash/Register.t b/t/db_dependent/Koha/Cash/Register.t >index 43c23a682a2..6157b1791f5 100755 >--- a/t/db_dependent/Koha/Cash/Register.t >+++ b/t/db_dependent/Koha/Cash/Register.t >@@ -423,7 +423,7 @@ subtest 'cashup_reconciliation' => sub { > }; > > subtest 'surplus_cashup' => sub { >- plan tests => 9; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -472,8 +472,9 @@ subtest 'cashup_reconciliation' => sub { > sprintf( '%.0f', $surplus_line->amount ), sprintf( '%.0f', -$surplus ), > 'Surplus amount is correct (negative for credit)' > ); >- is( $surplus_line->branchcode, $register2->branch, 'Surplus branchcode matches register branch' ); >- is( $surplus_line->payment_type, 'CASH', 'Surplus payment_type is set to CASH' ); >+ is( $surplus_line->branchcode, $register2->branch, 'Surplus branchcode matches register branch' ); >+ is( $surplus_line->payment_type, 'CASH', 'Surplus payment_type is set to CASH' ); >+ is( sprintf( '%.0f', $surplus_line->amountoutstanding ), '0', 'Surplus amountoutstanding is set to 0' ); > > # Note should be undef for surplus without user note > is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); >@@ -522,7 +523,7 @@ subtest 'cashup_reconciliation' => sub { > }; > > subtest 'deficit_cashup' => sub { >- plan tests => 9; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -571,8 +572,9 @@ subtest 'cashup_reconciliation' => sub { > sprintf( '%.0f', $deficit_line->amount ), sprintf( '%.0f', $deficit ), > 'Deficit amount is correct (positive for debit)' > ); >- is( $deficit_line->branchcode, $register3->branch, 'Deficit branchcode matches register branch' ); >- is( $deficit_line->payment_type, 'CASH', 'Deficit payment_type is set to CASH' ); >+ is( $deficit_line->branchcode, $register3->branch, 'Deficit branchcode matches register branch' ); >+ is( $deficit_line->payment_type, 'CASH', 'Deficit payment_type is set to CASH' ); >+ is( sprintf( '%.0f', $deficit_line->amountoutstanding ), '0', 'Deficit amountoutstanding is set to 0' ); > > # Note should be undef for deficit without user note > is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); >-- >2.53.0 >
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 40445
:
185289
|
185290
|
185291
|
185292
|
185809
|
186636
|
186637
|
186638
|
186639
|
186640
|
186641
|
186642
|
186643
|
189333
|
189334
|
189335
|
189336
|
189337
|
189338
|
189339
|
189340
|
189341
|
189353
|
189354
|
189355
|
189356
|
189357
|
189358
|
189359
|
189360
|
189361
|
189362
|
189363
|
189364
|
189410
|
189411
|
189412
|
189413
|
189414
|
189415
|
189420
|
189421
|
189422
|
189423
|
189424
|
189425
|
189426
|
189427
|
189428
|
189429
|
189430
|
189476
|
189477
|
189478
|
189479
|
189480
|
189481
|
189482
|
190361
|
190362
|
190363
|
190364
|
190365
|
190366
|
190367
|
190368
|
190369
|
190370
|
190371
|
190372
|
190373
|
190374
|
190375
|
190376
|
190379
|
190380
|
190388
|
190389
|
190404
|
190405
|
190406
|
190407
|
190408
|
190409
|
190410
|
190411
|
190412
|
190413
|
190414
|
190415
|
191273
|
191274
|
191275
|
191276
|
191277
|
191278
|
191279
|
191280
|
191281
|
191282
|
191283
|
191284
|
191285
|
191286
|
191287
|
191288
|
193123
|
193124
|
193125
|
193126
|
193127
|
193128
|
193129
|
193130
|
193131
|
193132
|
193133
|
193134
|
193135
|
193136
|
193137
|
193138
|
193139
|
193140
|
193141
|
193180
|
193181
|
193182
|
193183