Bug 38934

Summary: for ACCOUNT_CREDIT and ACCOUNT_CREDIT notices the debit and credit fields are not selectable in fields list
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: NoticesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Mathieu Saby 2025-01-21 09:32:13 UTC
For ACCOUNT_CREDIT and ACCOUNT_CREDIT notices you need to use "debit" and "credit" fields (debit.description, etc). But in the list of fields on the left ("Message body"), you don't currently have the ability to select those fields
Comment 1 Katrin Fischer 2025-01-21 12:13:54 UTC
The list on the side only works for Non-TT, I feel this is a WONTFIX as we are moving towards deprecating "hungry alligators" and adding TT to the notices editor in some way.
Comment 2 Mathieu Saby 2025-01-21 16:06:25 UTC
Oh I did not know it was only usable with hungry alligators.
But then, how do you know the complete list of usable fields when you write a notice with TT ?
Comment 3 Katrin Fischer 2025-01-22 10:57:33 UTC
(In reply to Mathieu Saby from comment #2)
> Oh I did not know it was only usable with hungry alligators.
> But then, how do you know the complete list of usable fields when you write
> a notice with TT ?

If you add fields form the list they will appear like << borrowers.surname >> in the notice. But for TT you'd need [% borrower.surname %] for example. 

Also, you can "pull in" a lot of information via the object methods and chaining, so the list would not be as fixed as it is now (which is super nice, but makes it much harder to document and implement a nice editor)

Documentation is not quite where it should be. What we got:

- bug 15278
- bug 15279 
- bug 34472

(also have a look at the linked bugs)

In the wiki these are helpful:
https://wiki.koha-community.org/wiki/Notices_with_Template_Toolkit

Especially the table at the bottom. But if you see borrower in the list, it doesn't mean you can't get other information through that borrower object - so there is much more available than is visible on first glance. You could for example get the information about the patron's homebranch, their checkouts, their current fees etc.
Comment 4 Mathieu Saby 2025-01-22 11:28:14 UTC
When all the standard notice templates are "translated" into TT syntax, will the "alligator" syntax be deprecated from Koha?
Comment 5 Mathieu Saby 2025-01-22 11:28:58 UTC
Oh it is Bug 15279  ;-)
Comment 6 Katrin Fischer 2025-01-22 14:27:42 UTC
(In reply to Mathieu Saby from comment #5)
> Oh it is Bug 15279  ;-)

Not officially yet, but we are moving that direction.