@@ -316,11 +316,11 @@
function updateChangeValues() {
var change = $('#change')[0];
var zero_formatted = "[% 0 | $Price %]";
- change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100;
+ change.innerHTML = Math.round(($('#tendered')[0].value - $('#paid')[0].value) * 100) / 100;
if (change.innerHTML <= 0) {
var paid = $('#paid')[0];
moneyFormat(paid);
- $('#collected').rules( "add", { min: Number(paid.value) });
+ $('#tendered').rules( "add", { min: Number(paid.value) });
change.innerHTML = zero_formatted;
$(':input[name="change"]').val(zero_formatted);
} else {
@@ -456,7 +456,7 @@
// Change calculation and modal
var change = $('#change')[0];
- $("#paid, #collected").on("change",function() {
+ $("#paid, #tendered").on("change",function() {
moneyFormat( this );
if (change != undefined) {
updateChangeValues();
@@ -474,7 +474,7 @@
paid: {
required: true
},
- collected: {
+ tendered: {
required: true
},
payment_type: {
@@ -518,7 +518,7 @@
[% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
$("#printReceipt").click(function() {
- var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&collected=[% collected | uri %]&change=[% change | uri %]', '_blank');
+ var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&tendered=[% tendered | uri %]&change=[% change | uri %]', '_blank');
win.focus();
});
$("#printReceipt").click();
diff --git a/members/paycollect.pl b/members/paycollect.pl
index 6b93d1cff4..f73477b4ff 100755
--- a/members/paycollect.pl
+++ b/members/paycollect.pl
@@ -72,8 +72,8 @@ my $user = $input->remote_user;
my $library_id = C4::Context->userenv->{'branch'};
my $total_due = $account->outstanding_debits->total_outstanding;
-my $total_paid = $input->param('paid');
-my $total_collected = $input->param('collected');
+my $total_paid = $input->param('paid');
+my $total_tendered = $input->param('tendered');
my $selected_lines = $input->param('selected'); # comes from pay.pl
my $pay_individual = $input->param('pay_individual');
@@ -151,7 +151,10 @@ if ( $total_paid and $total_paid ne '0.00' ) {
error_over => 1,
total_due => $total_due
);
- } elsif ( $total_collected < $total_paid && !( $op eq 'cud-writeoff_individual' || $type eq 'WRITEOFF' ) ) {
+ } elsif ( defined $total_tendered
+ && $total_tendered < $total_paid
+ && !( $op eq 'cud-writeoff_individual' || $type eq 'WRITEOFF' ) )
+ {
$template->param(
error_under => 1,
total_paid => $total_paid
diff --git a/pos/pay.pl b/pos/pay.pl
index 390b48696b..193c51af1b 100755
--- a/pos/pay.pl
+++ b/pos/pay.pl
@@ -80,7 +80,7 @@ if ( $op eq 'cud-pay' ) {
$template->param(
payment_id => $payment->accountlines_id,
- collected => scalar $input->param('collected'),
+ tendered => scalar $input->param('tendered'),
change => scalar $input->param('change')
);
}
@@ -89,7 +89,7 @@ if ( $op eq 'cud-pay' ) {
if ( $op eq 'cud-send' ) {
my $payment_id = $input->param('payment_id');
my $change = $input->param('change');
- my $collected = $input->param('collected');
+ my $tendered = $input->param('tendered');
my $toaddr = $input->param('toaddr');
# Create our letter from the template
@@ -102,8 +102,8 @@ if ( $op eq 'cud-send' ) {
credits => $payment_id,
},
substitute => {
- collected => $collected,
- change => $change
+ tendered => $tendered,
+ change => $change
}
);
@@ -123,7 +123,7 @@ if ( $op eq 'cud-send' ) {
# Set variables for template to allow printing still
$template->param(
payment_id => $payment_id,
- collected => $collected,
+ tendered => $tendered,
change => $change
);
}
diff --git a/pos/printreceipt.pl b/pos/printreceipt.pl
index e615bfbd8e..524754edf1 100755
--- a/pos/printreceipt.pl
+++ b/pos/printreceipt.pl
@@ -62,8 +62,8 @@ my $letter = C4::Letters::GetPreparedLetter(
borrowers => $patron ? $patron->borrowernumber : undef
},
substitute => {
- collected => scalar $input->param('collected'),
- change => scalar $input->param('change')
+ tendered => scalar $input->param('tendered'),
+ change => scalar $input->param('change')
}
);