Jump to content

Supply order decimals


Recommended Posts

When I print a supply order PDF it doesn't show 2 decimals all the time,

32,23 --> 32,23
16,50 --> 16,5
9,00 --> 9

When I click on the details of the order all prices are shown with 2 decimals.

No problem when I print a customer invoice.
 

Link to comment
Share on other sites

I figured it out:

Version 1.5.6, file: supply_order.tpl

Replace:
{* for each product ordered *}
            {foreach $supply_order_details as $supply_order_detail}
            <tr>
                <td style="text-align: left; padding-left: 1px;">{$supply_order_detail->supplier_reference}</td>
                <td style="text-align: left; padding-left: 1px;">{$supply_order_detail->name}</td>
                <td style="text-align: center; padding-right: 1px;">{$supply_order_detail->quantity_expected}</td>
                <td style="text-align: right; padding-right: 1px;">{$currency->prefix} {$supply_order_detail->unit_price_te} {$currency->suffix}</td>
                <td style="text-align: right; padding-right: 1px;">{$currency->prefix} {$supply_order_detail->price_with_discount_te} {$currency->suffix}</td>
            </tr>
            {/foreach}

By this:
{* for each product ordered *}
            
            {foreach $supply_order_details as $supply_order_detail}

            {$price_te = $supply_order_detail->unit_price_te}
            {$price_te_twodigits = $price_te|string_format:"%.2f"}
            
            {$disc_te = $supply_order_detail->price_with_discount_te}
            {$disc_te_twodigits = $disc_te|string_format:"%.2f"}

            <tr>
                <td style="text-align: left; padding-left: 1px;">{$supply_order_detail->supplier_reference}</td>
                <td style="text-align: left; padding-left: 1px;">{$supply_order_detail->name}</td>
                <td style="text-align: center; padding-right: 1px;">{$supply_order_detail->quantity_expected}</td>
                <td style="text-align: right; padding-right: 1px;">{$currency->prefix} {$price_te_twodigits} {$currency->suffix}</td>
                <td style="text-align: right; padding-right: 1px;">{$currency->prefix} {$disc_te_twodigits} {$currency->suffix}</td>
            </tr>
            {/foreach}



 

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...