Bug 28732 - Order and claim emails don't work well with repeatable information
Summary: Order and claim emails don't work well with repeatable information
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: 20.05
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-21 16:20 UTC by Katrin Fischer
Modified: 2021-07-21 16:20 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2021-07-21 16:20:23 UTC
There is an issue with how the repeatable part of the notice is figured out. This sets some strict limits to how you can write the notice template. It appears that the repeat will happen from first to the last placeholder from an acq table used in the notice. The <order> tags don't appear to be used at all.

Test plan: 
- Create a basket with more than one order line
- Set up a notice called ACQORDER for sending order emails (templats below)
- Make sure the vendor has an email set and all checkboxes in the contact are checked
- Make sure your system can send emails
- Click button "send order e-mail" on the basket summary page


------------------------------------------------

ACQORDER TEMPLATE 1:

[%- USE Price -%]
Dear...<br>
<br>
<order><b>Title:</b> <<biblio.title>><br /><b>Author:</b> <<biblio.author>><br /><b>Edition:</b> <<biblioitems.editionstatement>><br /><b>Year:</b> <<biblio.copyrightdate>><br /><b>ISBN:</b> <<biblioitems.isbn>><br /><b>Units:</b> <<aqorders.quantity>><br /><b>Price:</b> [% <<aqorders.listprice>> | $Price %] EUR<br><br></order>

<br><br>
Thank you!


RESULT: Dear and Thank you only appear once. OK.

Dear...

Title: ...
Author: ...
Edition: 1. Auflage, Originalausgabe
Year: 
ISBN: 9783839225837
Units: 1
Price: 13.99 EUR 

Title: ...
Author: 
Edition: 
Year: 2020
ISBN: 
Units: 1
Price: 13.00 EUR 

Thank you! 


------------------------------------------------

ACQORDER TEMPLATE 2: Only addition/change is the second line.

[%- USE Price -%]
<h2>Order: <<aqbasket.basketname>></h2>
Dear...<br>
<br>
<order><b>Title:</b> <<biblio.title>><br /><b>Author:</b> <<biblio.author>><br /><b>Edition:</b> <<biblioitems.editionstatement>><br /><b>Year:</b> <<biblio.copyrightdate>><br /><b>ISBN:</b> <<biblioitems.isbn>><br /><b>Units:</b> <<aqorders.quantity>><br /><b>Price:</b> [% <<aqorders.listprice>> | $Price %] EUR<br><br></order>
</hr>

<br><br>
Thank you!


RESULT: Order:... and Dear... lines are repeated. For information from the basket this doesn't make sense. If you add a field from the branches table, this doesn't appear to cause any additional repeats.

Order: 28.4.2021
Dear...

Title: ...
Author: ...
Edition: 1. Auflage, Originalausgabe
Year: 
ISBN: 9783839225837
Units: 1
Price: 13.99 EUR 
Order: 28.4.2021
Dear...

Title: ...
Author: 
Edition: 
Year: 2020
ISBN: 
Units: 1
Price: 13.00 EUR 

Thank you!