The items.fine is a trick of our historical syntax. We need to provide a way to access this value from the a notice template using the TT syntax.
[% checkout.overdue_fine.amount | $Price %] feels like the 'right' syntax for this to me.. problem is, half the relations don't exist yet to do that.. and worse still we've not got the constraints either.
[% checkout.overdue_fine.amount | $Price %] would work for me - I imagine overdue_fine could be used to pull other values from the account line?
Created attachment 172277 [details] [review] Bug 17976: Update test to include fines This patch updates the existing test to include checking the alternative to items.fine syntax. We could use the account_lines relation, however that would include other charges linked to the checkout, for example rental charges. I opt to add a new accessor to give us more options and refine to just overdue fines.
Created attachment 172278 [details] [review] Bug 17976: Add overdue_fines accessor to Koha::Checkout This patch adds a new filtered relation accessor to the Koha::Checkout object to return just overdue fine type account lines related to the checkout. Whilst this is easy to chain in code, it's not available via TT and so this accessor is useful for the notices case.
Unit test inbound
Created attachment 172283 [details] [review] Bug 17976: Unit tests Add unit tests for the newly introduced overdue fines relation accessor.
This is mostly behind the scenes stuff.. i.e the test plan is to run the included unit tests. The real benefit will be for bug 36109 where I intend to add a new sample notice for ODUE
Created attachment 172304 [details] [review] Bug 17976: Update test to include fines This patch updates the existing test to include checking the alternative to items.fine syntax. We could use the account_lines relation, however that would include other charges linked to the checkout, for example rental charges. I opt to add a new accessor to give us more options and refine to just overdue fines. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 172305 [details] [review] Bug 17976: Add overdue_fines accessor to Koha::Checkout This patch adds a new filtered relation accessor to the Koha::Checkout object to return just overdue fine type account lines related to the checkout. Whilst this is easy to chain in code, it's not available via TT and so this accessor is useful for the notices case. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 172306 [details] [review] Bug 17976: Unit tests Add unit tests for the newly introduced overdue fines relation accessor. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
This is great, thanks Martin!
Created attachment 172328 [details] [review] Bug 17976: Update test to include fines This patch updates the existing test to include checking the alternative to items.fine syntax. We could use the account_lines relation, however that would include other charges linked to the checkout, for example rental charges. I opt to add a new accessor to give us more options and refine to just overdue fines. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 172329 [details] [review] Bug 17976: Add overdue_fines accessor to Koha::Checkout This patch adds a new filtered relation accessor to the Koha::Checkout object to return just overdue fine type account lines related to the checkout. Whilst this is easy to chain in code, it's not available via TT and so this accessor is useful for the notices case. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 172330 [details] [review] Bug 17976: Unit tests Add unit tests for the newly introduced overdue fines relation accessor. Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 172331 [details] [review] Bug 17976: (QA follow-up) Tidy code Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
PQA but blocked by 22421