syntax was seomthing like ```<#assign linesSort...
# advancedpdf
a
syntax was seomthing like
Copy code
<#assign linesSortedByDate = {}/>
<#list record.item as line>
<#if line.billeddate?has_content>
	<#assign billDate = line.billeddate>
	<#assign emp = line.employeefullname>
<#else>
	<#assign emp = "">
</#if>
<#assign memo = line.description + line.memo  + line.categorydisp>
<#assign rate = line.rate>
<#assign key = "a" + billDate?string["yyyy"]+billDate?string["MM"]+billDate?string["dd"] + emp + rate + memo>
<#if linesSortedByDate[key]??>
						<#assign linesSortedByDate = linesSortedByDate + { key: { "item": line.item, "billeddate": billDate, "employeefullname": emp, "description": line.description, "rate": line.rate, "quantity": linesSortedByDate[key]["quantity"] + line.quantity, "amount": linesSortedByDate[key]["amount"] + line.amount, "itemtype": line.itemtype, "memo": memo}}>
					<#else>
						<#assign linesSortedByDate = linesSortedByDate + { key: { "item": line.item, "billeddate": billDate, "employeefullname": emp, "description": line.description, "rate": line.rate, "quantity": line.quantity, "amount": line.amount, "itemtype": line.itemtype, "memo": memo }}>
					</#if>
<!-- later -->
<#list linesByDateKeys as key>
					<#assign item = linesSortedByDate[key]/>
i removed some stuff to anonymize it so apologies if some of the syntax is off, but hopefully you get the idea
a
thanks! i wound up getting basically to the same point with mine before coming back here and seeing your response, just working through annoying unexpected errors now
but everything seems to be working in theory
the summarized hash approach is better anyway than my idea of sequence-of-hashes
I got it figured out - @amy your code sample was hugely helpful yesterday, thank you again for sharing this.
👍 1
I also came across this which is basically the same approach, in case anyone is interested: https://followingnetsuite.com/2018/12/14/advanced-templates-freemarker-lists-hashes/ Not sure if Kevin is here at all but this was a great article