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 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit9d8be887d0) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commitc3c889e7f4) Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
parent
f92913f8c9
commit
94cc4b1ea7
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue