diff --git a/Koha/Cash/Register/Cashup.pm b/Koha/Cash/Register/Cashup.pm index 7e6ba1ac64..0742cffeaa 100644 --- a/Koha/Cash/Register/Cashup.pm +++ b/Koha/Cash/Register/Cashup.pm @@ -184,7 +184,11 @@ sub summary { my $typed_income = $income_transactions->total( { payment_type => $type->authorised_value } ); my $typed_payout = $payout_transactions->total( { payment_type => $type->authorised_value } ); my $typed_total = ( $typed_income + $typed_payout ); - push @total_grouped, { payment_type => $type->lib, total => $typed_total }; + + # Flip sign to match the convention used for `total` above: + # positive = net amount collected (i.e. removed from register at cashup), + # negative = net amount paid out (i.e. needed to be added to register). + push @total_grouped, { payment_type => $type->lib, total => $typed_total * -1 }; } # Check for reconciliation lines separately (for footer display only) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js index ba236ee67c..a79a394d47 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js @@ -142,7 +142,7 @@ $(document).ready(function () { "
" ); - // 2. Cash collected (amount recorded as removed from register) + // 2. Cash removed from register (positive = collected and removed at cashup) var cashCollected = null; for (type of data.summary.total_grouped) { if ( @@ -155,9 +155,9 @@ $(document).ready(function () { } if (cashCollected !== null) { var cashLabel = - cashCollected < 0 - ? __("Cash added to register") - : __("Cash collected"); + cashCollected >= 0 + ? __("Cash removed from register") + : __("Cash added to register"); tfoot.append( "" + @@ -176,13 +176,13 @@ $(document).ready(function () { type.payment_type !== "CASH" ) { var paymentTypeLabel = - type.total < 0 - ? __x("{payment_type} to add", { + type.total >= 0 + ? __x("{payment_type} collected", { payment_type: escape_str( type.payment_type ), }) - : __x("{payment_type} collected", { + : __x("{payment_type} to add", { payment_type: escape_str( type.payment_type ),