Bugzilla – Attachment 136477 Details for
Bug 31036
Cash management doesn't take SIP00 (Cash via SIP2) transactions into account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31036: Treat SIP00 that same as CASH
Bug-31036-Treat-SIP00-that-same-as-CASH.patch (text/plain), 8.48 KB, created by
Martin Renvoize (ashimema)
on 2022-06-24 08:31:26 UTC
(
hide
)
Description:
Bug 31036: Treat SIP00 that same as CASH
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-24 08:31:26 UTC
Size:
8.48 KB
patch
obsolete
>From 1a91490f40ca638be03a7ad7a868482dc079ae07 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Jun 2022 09:20:52 +0100 >Subject: [PATCH] Bug 31036: Treat SIP00 that same as CASH > >SIP00 is the code for CASH transactions that have taken place on a SIP >client. Cash management treats CASH type transactions as a special case >for banking and register requirements. This patch brings SIP00 in line >with the CASH handling code of cash management. > >Test plan >1) Enable cash management with 'EnablePointOfSale' >2) Enable cash registers with 'UseCashRegisters' >3) Add a cash register via 'Administration > Cash registers' >4) Make some payments against the ash register in the staff client >5) Attempt to make a payment via a SIP client without having associated > a cash register to the SIP account config >5a) This should now fail >6) Attach the cash register to the SIP account used above >6a) Payment should now work again on SIP transactions >7) Look at the cash register details page for the cash register >7a) 'Bankale' should now include cash from both SIP and Staff client >sales >--- > Koha/Account.pm | 8 ++++---- > Koha/Account/Line.pm | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt | 8 ++++---- > koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt | 6 +++--- > 4 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index c7cf9e58db..ad5d5c6040 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -209,7 +209,7 @@ sub add_credit { > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") > && defined($payment_type) >- && ( $payment_type eq 'CASH' ) >+ && ( $payment_type eq 'CASH' || $payment_type eq 'SIP00' ) > && !defined($cash_register) ); > > my $line; >@@ -338,7 +338,7 @@ sub payin_amount { > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") > && defined( $params->{payment_type} ) >- && ( $params->{payment_type} eq 'CASH' ) >+ && ( $params->{payment_type} eq 'CASH' || $params->{payment_type} eq 'SIP00' ) > && !defined($params->{cash_register}) ); > > # amount should always be passed as a positive value >@@ -436,7 +436,7 @@ sub add_debit { > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") > && defined( $params->{transaction_type} ) >- && ( $params->{transaction_type} eq 'CASH' ) >+ && ( $params->{transaction_type} eq 'CASH' || $params->{payment_type} eq 'SIP00' ) > && !defined( $params->{cash_register} ) ); > > # amount should always be a positive value >@@ -570,7 +570,7 @@ sub payout_amount { > # Check for mandatory register > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") >- && ( $params->{payout_type} eq 'CASH' ) >+ && ( $params->{payout_type} eq 'CASH' || $params->{payout_type} eq 'SIP00' ) > && !defined($params->{cash_register}) ); > > # Amount should always be passed as a positive value >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index af93725d60..ceb73e7c3e 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -758,7 +758,7 @@ sub payout { > Koha::Exceptions::Account::RegisterRequired->throw() > if ( C4::Context->preference("UseCashRegisters") > && defined( $params->{payout_type} ) >- && ( $params->{payout_type} eq 'CASH' ) >+ && ( $params->{payout_type} eq 'CASH' || $params->{payout_type} eq 'SIP00' ) > && !defined( $params->{cash_register} ) ); > > my $payout; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >index b5604d8f97..ea11cfaf42 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -76,9 +76,9 @@ > <li>Last cashup: [% register.last_cashup.timestamp | $KohaDates with_hours => 1 %] (<a data-toggle="modal" data-cashup="[% register.last_cashup.id | html %]" data-register="[% register.description | html %]" href="#cashupSummaryModal" class="button">Summary</a>)</li> > [% END %] > <li>Float: [% register.starting_float | $Price %]</li> >- <li>Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => 'CASH') * -1 | $Price %])</li> >- <li>Total outgoing (cash): [% accountlines.debits_total * -1 | $Price %] ([% accountlines.debits_total( payment_type => 'CASH') * -1 | $Price %])</li> >- <li>Total bankable: [% accountlines.total( payment_type => 'CASH') * -1 | $Price %]</li> >+ <li>Total income (cash): [% accountlines.credits_total * -1 | $Price %] ([% accountlines.credits_total(payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li> >+ <li>Total outgoing (cash): [% accountlines.debits_total * -1 | $Price %] ([% accountlines.debits_total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %])</li> >+ <li>Total bankable: [% accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %]</li> > </ul> > > [% IF register.last_cashup %] >@@ -278,7 +278,7 @@ > <h4 class="modal-title" id="confirmCashupLabel">Confirm cashup of <em>[% register.description | html %]</em></h4> > </div> > <div class="modal-body"> >- Please confirm that you have removed [% accountlines.total( payment_type => 'CASH') * -1 | $Price %] from the cash register and left a float of [% register.starting_float | $Price %]. >+ Please confirm that you have removed [% accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 | $Price %] from the cash register and left a float of [% register.starting_float | $Price %]. > </div> <!-- /.modal-body --> > <div class="modal-footer"> > <a href="/cgi-bin/koha/pos/register.pl?op=cashup" class="btn btn-default" id="pos_cashup_confirm">Confirm</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >index 4a15758d6a..00f1f780c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >@@ -96,20 +96,20 @@ > </td> > <td>[% register.starting_float | $Price %]</td> > <td> >- [% SET rbankable = ( register.outstanding_accountlines.total( payment_type => 'CASH') * -1 ) %] >+ [% SET rbankable = ( register.outstanding_accountlines.total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] > [% SET bankable = bankable + rbankable %] > [% rbankable | $Price %] > </td> > <td> > [% SET rctotal = ( register.outstanding_accountlines.credits_total * -1 ) %] >- [% SET rcctotal = ( register.outstanding_accountlines.credits_total( payment_type => 'CASH') * -1 ) %] >+ [% SET rcctotal = ( register.outstanding_accountlines.credits_total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] > [% rctotal | $Price %] ([% rcctotal | $Price %]) > [% SET ctotal = ctotal + rctotal %] > [% SET cctotal = cctotal + rcctotal %] > </td> > <td> > [% SET rdtotal = ( register.outstanding_accountlines.debits_total * -1 ) %] >- [% SET rcdtotal = ( register.outstanding_accountlines.debits_total( payment_type => 'CASH') * -1 ) %] >+ [% SET rcdtotal = ( register.outstanding_accountlines.debits_total( payment_type => [ 'CASH', 'SIP00' ]) * -1 ) %] > [% rdtotal | $Price %] ([% rcdtotal | $Price %]) > [% SET dtotal = dtotal + rdtotal %] > [% SET cdtotal = cdtotal + rcdtotal %] >-- >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 31036
:
136476
|
136477
|
137431
|
137757
|
137762
|
137763