Jump to content

How to: Sort by location in Deliveri slip template?


Recommended Posts

Hi guys!


 


My intention is to show the Location column in Delivery Slipsbut I need to sort all content of PDF by the location code.


 


This code has 3 characters, 1st numeric,2nd alphabetic and 3rd numeric (example: 1A3). 


 


Could you help me with the expression that I need to sort that location column by that kind of code?


 


 


Example of use:



Location (column)

1A2
1A4
1B3
2A1
..
..

My code from "Delivery slips" Template is:



<div class="clear zero">
<table class="w100 items">
<thead>
<tr>
<th>{l s='Location' mod='m4pdf'}</th>
<th>{l s='Description' mod='m4pdf'}</th>
<th>{l s='Reference' mod='m4pdf'}</th>
<th>{l s='Qty' mod='m4pdf'}</th>
</tr>
</thead>
{foreach from=$order[orders].order_detail|@sortby:"warehouse_product_location.location" item=order_detail}
<tr>
<td class="align-center" style="font-size: 15px"><strong>{$order[orders].order_detail[detail].warehouse_product_location.location|escape:'htmlall':'UTF-8'}</strong></td>
<td>{$order[orders].order_detail[detail].product_name|escape:'htmlall':'UTF-8'}</td>
<td>{if $order[orders].order_detail[detail].product_reference != ''}{$order[orders].order_detail[detail].product_reference|escape:'htmlall':'UTF-8'}{else}---{/if}</td>
<td class="align-center" style="font-size: 15px"><strong>{$order[orders].order_detail[detail].product_quantity}</strong></td>
</tr>
{foreachelse}
<tr>
<td colspan=3>{l s='no order details' mod='m4pdf'}</td>
</tr>
{/foreach}
</table>

</div>

<div class="cell align-right clear" style="left: 0mm; right: 0mm; bottom: 2mm; ">
<barcode code="{$order[orders].invoice_number|string_format:"%06d"}" type="C128A" class="barcode" />
</div> 

A lot of thanks in advance!!  :)


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...