Bugzilla – Attachment 110182 Details for
Bug 26469
Register_id saves incorrect value in accountlines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26269: Fix variable name mismatch for cash_register in paycollect
Bug-26269-Fix-variable-name-mismatch-for-cashregis.patch (text/plain), 5.17 KB, created by
ByWater Sandboxes
on 2020-09-16 12:06:22 UTC
(
hide
)
Description:
Bug 26269: Fix variable name mismatch for cash_register in paycollect
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-09-16 12:06:22 UTC
Size:
5.17 KB
patch
obsolete
>From b114d529e471c19ee83efda269687bdd9ff2710f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 16 Sep 2020 11:02:22 +0100 >Subject: [PATCH] Bug 26269: Fix variable name mismatch for cash_register in > paycollect > >It appears that through various rebases the variable names in the form >and the controller script have become mismatched. This patch corrects >the situation and clarifies their intended use. > >Test plan: >1/ Turn on cash registers in sysprefs >2/ Define at least 2 cash registers in Admin >3/ Create a manual invoice on a patron >4/ Pay off half of your fee, selecting the first register >5/ Pay off the remaining fee, selecting the second register >6/ Query accountlines.register_id for your two payments >8/ Confirm the two accountlines.register_id's do not match (thus the >passed variable was used) > >https://bugs.koha-community.org/show_bug.cgi?id=26469 > >Signed-off-by: Jessie Zairo <jzairo@bywatersolutions.com> >--- > .../prog/en/modules/members/paycollect.tt | 4 ++-- > members/paycollect.pl | 20 ++++++++++---------- > 2 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index f1daae3fa2..3facc29b24 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -154,7 +154,7 @@ > <label for="cash_register">Cash register: </label> > <select name="cash_register" id="cash_register"> > [% FOREACH register IN registers %] >- [% IF register.id == registerid %] >+ [% IF register.id == default_register %] > <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option> > [% ELSE %] > <option value="[% register.id | html %]">[% register.name | html %]</option> >@@ -290,7 +290,7 @@ > <label for="cash_register">Cash register: </label> > <select name="cash_register" id="cash_register"> > [% FOREACH register IN registers %] >- [% IF register.id == registerid %] >+ [% IF register.id == default_register %] > <option value="[% register.id | html %]" selected="selected">[% register.name | html %]</option> > [% ELSE %] > <option value="[% register.id | html %]">[% register.name | html %]</option> >diff --git a/members/paycollect.pl b/members/paycollect.pl >index 3f5bb3c357..471559202e 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -77,9 +77,9 @@ my $payment_note = uri_unescape scalar $input->param('payment_note'); > my $payment_type = scalar $input->param('payment_type'); > my $accountlines_id; > >-my $registerid; >+my $cash_register_id; > if ( C4::Context->preference('UseCashRegisters') ) { >- $registerid = $input->param('registerid'); >+ $cash_register_id = $input->param('cash_register'); > my $registers = Koha::Cash::Registers->search( > { branch => $library_id, archived => 0 }, > { order_by => { '-asc' => 'name' } } >@@ -90,16 +90,16 @@ if ( C4::Context->preference('UseCashRegisters') ) { > } > else { > >- if ( !$registerid ) { >+ if ( !$cash_register_id ) { > my $default_register = Koha::Cash::Registers->find( > { branch => $library_id, branch_default => 1 } ); >- $registerid = $default_register->id if $default_register; >+ $cash_register_id = $default_register->id if $default_register; > } >- $registerid = $registers->next->id if !$registerid; >+ $cash_register_id = $registers->next->id if !$cash_register_id; > > $template->param( >- registerid => $registerid, >- registers => $registers, >+ default_register => $cash_register_id, >+ registers => $registers, > ); > } > } >@@ -196,7 +196,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { > note => $payment_note, > interface => C4::Context->interface, > payment_type => $payment_type, >- cash_register => $registerid >+ cash_register => $cash_register_id > } > ); > $payment_id = $pay_result->{payment_id}; >@@ -221,7 +221,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { > note => $note, > interface => C4::Context->interface, > payment_type => $payment_type, >- cash_register => $registerid >+ cash_register => $cash_register_id > } > ); > } >@@ -237,7 +237,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { > payment_type => $payment_type, > interface => C4::Context->interface, > payment_type => $payment_type, >- cash_register => $registerid >+ cash_register => $cash_register_id > } > ); > } >-- >2.11.0
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 26469
:
110160
|
110173
|
110182
|
110230