Bugzilla – Attachment 193139 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 branchcode for CASHUP_SURPLUS and CASHUP_DEFICIT accountlines
84e2d7f.patch (text/plain), 4.33 KB, created by
Martin Renvoize (ashimema)
on 2026-02-13 17:21:45 UTC
(
hide
)
Description:
Bug 40445: (follow-up) Set branchcode for CASHUP_SURPLUS and CASHUP_DEFICIT accountlines
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-13 17:21:45 UTC
Size:
4.33 KB
patch
obsolete
>From 84e2d7fe98aaab47a7c5e0d44fddf94e3ca6b78f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 13 Feb 2026 17:12:02 +0000 >Subject: [PATCH] Bug 40445: (follow-up) Set branchcode for CASHUP_SURPLUS and > CASHUP_DEFICIT accountlines > >When creating CASHUP_SURPLUS and CASHUP_DEFICIT accountlines during >cashup reconciliation, the branchcode was not being set. This resulted >in accountlines with NULL branchcode values, which violates the >expectation that all accountlines should have an associated branch. > >This patch: >- Sets branchcode from the cash register's branch for both CASHUP_SURPLUS > and CASHUP_DEFICIT accountlines >- Adds test coverage to verify branchcode is correctly set > >Test plan: >1. Apply patch >2. Run prove t/db_dependent/Koha/Cash/Register.t >3. Verify all tests pass, including new branchcode checks >4. In the staff interface, perform a cashup with a surplus or deficit >5. Verify the created accountline has the correct branchcode matching > the cash register's branch > >Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk> >--- > Koha/Cash/Register.pm | 2 ++ > t/db_dependent/Koha/Cash/Register.t | 8 +++++--- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/Koha/Cash/Register.pm b/Koha/Cash/Register.pm >index aa9168b541e..1a02f23aa9b 100644 >--- a/Koha/Cash/Register.pm >+++ b/Koha/Cash/Register.pm >@@ -453,6 +453,7 @@ sub add_cashup { > credit_type_code => 'CASHUP_SURPLUS', > manager_id => $manager_id, > interface => 'intranet', >+ branchcode => $self->branch, > register_id => $self->id, > note => $reconciliation_note > } >@@ -477,6 +478,7 @@ sub add_cashup { > debit_type_code => 'CASHUP_DEFICIT', > manager_id => $manager_id, > interface => 'intranet', >+ branchcode => $self->branch, > register_id => $self->id, > note => $reconciliation_note > } >diff --git a/t/db_dependent/Koha/Cash/Register.t b/t/db_dependent/Koha/Cash/Register.t >index 99684617a6e..1cb83f7e3f3 100755 >--- a/t/db_dependent/Koha/Cash/Register.t >+++ b/t/db_dependent/Koha/Cash/Register.t >@@ -417,7 +417,7 @@ subtest 'cashup_reconciliation' => sub { > }; > > subtest 'surplus_cashup' => sub { >- plan tests => 7; >+ plan tests => 8; > > $schema->storage->txn_begin; > >@@ -466,6 +466,7 @@ 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' ); > > # Note should be undef for surplus without user note > is( $surplus_line->note, undef, 'No note for surplus without user reconciliation note' ); >@@ -514,7 +515,7 @@ subtest 'cashup_reconciliation' => sub { > }; > > subtest 'deficit_cashup' => sub { >- plan tests => 7; >+ plan tests => 8; > > $schema->storage->txn_begin; > >@@ -563,6 +564,7 @@ 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' ); > > # Note should be undef for deficit without user note > is( $deficit_line->note, undef, 'No note for deficit without user reconciliation note' ); >@@ -894,7 +896,7 @@ subtest 'two_phase_cashup_workflow' => sub { > > # Test 9: outstanding_accountlines now includes new transaction > $outstanding = $register->outstanding_accountlines; >- is( $outstanding->count, 1, 'outstanding_accountlines includes transaction after completion' ); >+ is( $outstanding->count, 1, 'outstanding_accountlines includes transaction after completion' ); > is( $outstanding->total, -8.00, 'outstanding_accountlines total is correct after completion' ); > > $schema->storage->txn_rollback; >-- >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