[Bug 44047] New: add_debit's cash register check reads payment_type, which a debit never has
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44047 Bug ID: 44047 Summary: add_debit's cash register check reads payment_type, which a debit never has Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Koha::Account->add_debit requires a cash register when UseCashRegisters is on: && ( $params->{transaction_type} eq 'CASH' || $params->{payment_type} eq 'SIP00' ) add_debit takes transaction_type, not payment_type (that is add_credit's parameter), so the SIP00 half compares undef: it never matches, and it warns "Use of uninitialized value in string eq" whenever transaction_type is not CASH. A SIP00 payout is therefore recorded with no cash register, while add_credit refuses the same payment type without one. To see it: UseCashRegisters on, call add_debit with transaction_type => 'SIP00' and no cash_register: no RegisterRequired exception, and an uninitialized-value warning. Same code on main and 26.05. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44047 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 211194 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211194&action=edit Bug 44047: add_debit: check transaction_type, not payment_type, for SIP00 Bug 44047: add_debit: check transaction_type, not payment_type, for SIP00 Koha::Account->add_debit requires a cash register for CASH and SIP00 when UseCashRegisters is on, but compared $params->{payment_type} with SIP00. add_debit takes transaction_type (payment_type is add_credit's parameter), so a SIP00 debit was stored without a register and every non-CASH call warned "Use of uninitialized value in string eq". Test plan: 1. prove t/db_dependent/Koha/Account.t Without the patch the new subtest fails: no RegisterRequired for a SIP00 debit without a cash register, and the uninitialized-value warning. 2. With the patch the whole file passes. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44047 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org