[Bug 29139] New: Paying gives ISE if UseEmailReceipts is enabled
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Bug ID: 29139 Summary: Paying gives ISE if UseEmailReceipts is enabled Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org To reproduce: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 4 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 -- 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=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com | |, liz@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- 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=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28883 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125463&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125463|0 |1 is obsolete| | --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125464 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125464&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Should have been caught by tests... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_21_05_candidate QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com Depends on| |27636 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Looks like it's in stable. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27636 [Bug 27636] Replace Koha::Account::pay with a simpler method -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125464|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125474 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125474&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125475&action=edit Bug 29139: Fix incorrect relation call The bug here was worse than originally thought. We were calling the wrong relation too.. we should probably add some exceptions to catch this, it confuses me every single time! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Tomas told me he's working on tests already.. to save duplication of work I'll wait to see what he produces and take a look at those, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125476&action=edit Bug 29139: Add exceptions to relation accessors We already had exceptions on the many-to-many links, but we didn't have them for the middle table. The underlying dbic relations make it clear which id's are being used for linking. A 'credit' has 'credit_offsets', a 'debit' has 'debit_offsets'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14825 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14825 [Bug 14825] Accounts Rewrite Omnibus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125474|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125475|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125476|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125504&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125505 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125505&action=edit Bug 29139: Fix incorrect relation call The bug here was worse than originally thought. We were calling the wrong relation too.. we should probably add some exceptions to catch this, it confuses me every single time! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125506 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125506&action=edit Bug 29139: Add exceptions to relation accessors We already had exceptions on the many-to-many links, but we didn't have them for the middle table. The underlying dbic relations make it clear which id's are being used for linking. A 'credit' has 'credit_offsets', a 'debit' has 'debit_offsets'. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125507&action=edit Bug 29139: Add regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125508 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125508&action=edit Bug 29139: Only pass the offsets for lines the credit was applied to On writing the regression tests, I noticed the CREATE offset was added to the template. The idea behind passing the offsets is that we can print information about the lines that got the credit applied. Having the CREATE offset is meaningless, and (worse) would require users to add logic to skip it. And all the payment information is already passed in the 'credit' variable anyway. This patch filters the credit_offsets by type, leaving the APPLY ones only. To test: 1. Apply up to the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: 3 offsets, including the CREATE one, boo! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! Only the two APPLY offsets are returned! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125504|0 |1 is obsolete| | --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125509 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125509&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125505|0 |1 is obsolete| | --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125510 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125510&action=edit Bug 29139: Fix incorrect relation call The bug here was worse than originally thought. We were calling the wrong relation too.. we should probably add some exceptions to catch this, it confuses me every single time! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125506|0 |1 is obsolete| | --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125511&action=edit Bug 29139: Add exceptions to relation accessors We already had exceptions on the many-to-many links, but we didn't have them for the middle table. The underlying dbic relations make it clear which id's are being used for linking. A 'credit' has 'credit_offsets', a 'debit' has 'debit_offsets'. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125507|0 |1 is obsolete| | --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125512&action=edit Bug 29139: Add regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125508|0 |1 is obsolete| | --- Comment #18 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125513&action=edit Bug 29139: Only pass the offsets for lines the credit was applied to On writing the regression tests, I noticed the CREATE offset was added to the template. The idea behind passing the offsets is that we can print information about the lines that got the credit applied. Having the CREATE offset is meaningless, and (worse) would require users to add logic to skip it. And all the payment information is already passed in the 'credit' variable anyway. This patch filters the credit_offsets by type, leaving the APPLY ones only. To test: 1. Apply up to the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: 3 offsets, including the CREATE one, boo! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! Only the two APPLY offsets are returned! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125509|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125592 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125592&action=edit Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125510|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125593&action=edit Bug 29139: Fix incorrect relation call The bug here was worse than originally thought. We were calling the wrong relation too.. we should probably add some exceptions to catch this, it confuses me every single time! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125511|0 |1 is obsolete| | --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125594 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125594&action=edit Bug 29139: Add exceptions to relation accessors We already had exceptions on the many-to-many links, but we didn't have them for the middle table. The underlying dbic relations make it clear which id's are being used for linking. A 'credit' has 'credit_offsets', a 'debit' has 'debit_offsets'. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125512|0 |1 is obsolete| | --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125595 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125595&action=edit Bug 29139: Add regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125513|0 |1 is obsolete| | --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125596 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125596&action=edit Bug 29139: Only pass the offsets for lines the credit was applied to On writing the regression tests, I noticed the CREATE offset was added to the template. The idea behind passing the offsets is that we can print information about the lines that got the credit applied. Having the CREATE offset is meaningless, and (worse) would require users to add logic to skip it. And all the payment information is already passed in the 'credit' variable anyway. This patch filters the credit_offsets by type, leaving the APPLY ones only. To test: 1. Apply up to the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: 3 offsets, including the CREATE one, boo! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! Only the two APPLY offsets are returned! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Final QA run done over the whole patchset... nice work everyone. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_05_candidate |rel_21_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #25 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Bug 29139 depends on bug 27636, which changed state. Bug 27636 Summary: Replace Koha::Account::pay with a simpler method https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27636 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #26 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125844&action=edit [21.05.x] Bug 29139: $line->debit_offsets doesn't honor list context Being based on _new_from_dbic (discussion on bug 28883), makes the assignment incorrect: my @account_offsets = $payment->debit_offsets; This patch explicitly makes the resultset be assigned as a list by calling *as_list*. To test: 1. Have UseEmailReceipts disabled 2. Have a patron with a debt of 6 3. Make a payment of 2 => SUCCESS: All good 4. Enable UseEmailReceipts 5. Repeat 3 => FAIL: You get something like: ERROR PROCESSING TEMPLATE: undef error - The method Koha::Account::Offsets->debit is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Objects.pm line 595 Koha::Objects::AUTOLOAD('Koha::Account::Offsets=HASH(0x561cbe2ac930)') called at input text line 6 eval {...} at input text line 6 eval {...} at input text line 23 6. Apply this patch 7. Repeat 3 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #27 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125845&action=edit [21.05.x] Bug 29139: Fix incorrect relation call The bug here was worse than originally thought. We were calling the wrong relation too.. we should probably add some exceptions to catch this, it confuses me every single time! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #28 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125846&action=edit [21.05.x] Bug 29139: Add exceptions to relation accessors We already had exceptions on the many-to-many links, but we didn't have them for the middle table. The underlying dbic relations make it clear which id's are being used for linking. A 'credit' has 'credit_offsets', a 'debit' has 'debit_offsets'. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #29 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125847&action=edit [21.05.x] Bug 29139: Add regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 --- Comment #30 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 125848 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125848&action=edit [21.05.x] Bug 29139: Only pass the offsets for lines the credit was applied to On writing the regression tests, I noticed the CREATE offset was added to the template. The idea behind passing the offsets is that we can print information about the lines that got the credit applied. Having the CREATE offset is meaningless, and (worse) would require users to add logic to skip it. And all the payment information is already passed in the 'credit' variable anyway. This patch filters the credit_offsets by type, leaving the APPLY ones only. To test: 1. Apply up to the regression tests 2. Run: $ kshell k$ prove t/db_dependent/Koha/Account.t => FAIL: 3 offsets, including the CREATE one, boo! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! Only the two APPLY offsets are returned! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com Version(s)|21.11.00 |21.11.00,21.05.05 released in| | --- Comment #31 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29139 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #32 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on bug 27636 not in 20.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org