I'm having a hard time customizing an Advance PDF ...
# general
k
I'm having a hard time customizing an Advance PDF Template for an Invoice. On the Invoice, we have a column called Item and another called Size. Our items look like this as an example: "AA1000-100-L" where the L means Large. In the Size column I made it where it'll just show this L and it's sourcing it from the item after the "-" at the end. Here's the issue I'm having: We need the Item column to have the items show numerically ascending, which I have done and works fine. But, we also need the size column to be from Small (S) all the way to XXXL which I can't get both of these sorts to work at the same time. Anyone have any ideas? I have this as my numerical ascending for the item: <#list record.item?sort_by('custcol_sku') as item> And I have this to get the size abbreviation for the Size column: <td colspan="3" align="right">${item.custcol_sku?keep_after_last('-')}</td>
s
My recollection is that you can only sort by one key, so you have two options: create a formula field on the transaction line that combines the elements you want to sort by, and concatenates them together in the sort order you want. I have done this and it works well. you then just sort by the formula column. alternatively, you might be able to iterate through the list in Freemarker, adding a key to each item. Then sort by the newly added key. I think this will work in theory, but have not tried it. The item list may or may not be editable