@@ -, +, @@ --- C4/Accounts.pm | 12 ++- .../prog/en/modules/members/paycollect.tt | 88 ++++++++++++++++---- members/paycollect.pl | 34 ++++++-- 3 files changed, 104 insertions(+), 30 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -696,11 +696,12 @@ sub makepartialpayment { } # create new line + my $payment = 0 - $amount; my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, ' . 'description, accounttype, amountoutstanding, itemnumber, manager_id, note) ' . ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?, ?)'; - $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, + $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $payment, "Payment, thanks - $user", 'Pay', $data->{'itemnumber'}, $manager_id, $payment_note); UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno ); @@ -710,7 +711,7 @@ sub makepartialpayment { action => 'create_payment', borrowernumber => $user, accountno => $nextaccntno, - amount => 0 - $amount, + amount => $payment, accounttype => 'Pay', itemnumber => $data->{'itemnumber'}, accountlines_paid => [ $data->{'accountlines_id'} ], @@ -772,14 +773,15 @@ sub WriteOffFee { "; $sth = $dbh->prepare( $query ); my $acct = getnextacctno($borrowernumber); - $sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id, $payment_note ); + my $payment = 0 - $amount; + $sth->execute( $borrowernumber, $acct, $itemnum, $payment, $manager_id, $payment_note ); if ( C4::Context->preference("FinesLog") ) { logaction("FINES", 'CREATE',$borrowernumber,Dumper({ action => 'create_writeoff', borrowernumber => $borrowernumber, accountno => $acct, - amount => 0 - $amount, + amount => $payment, accounttype => 'W', itemnumber => $itemnum, accountlines_paid => [ $accountlines_id ], @@ -787,7 +789,7 @@ sub WriteOffFee { })); } - UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber ); + UpdateStats( $branch, 'writeoff', $payment, q{}, q{}, q{}, $borrowernumber ); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -3,13 +3,6 @@ [% INCLUDE 'doc-head-close.inc' %] - @@ -91,14 +88,32 @@ function moneyFormat(textObj) {