Fixed Monthly Billing

{% set total_cnt = 0 %} {% set total_ex_vat = 0 %} {% set total_vat = 0 %} {% set total_inc_vat = 0 %} {% for bill in fixed_billing %} {% set total_cnt = total_cnt + bill.getItemCount %} {% set total_ex_vat = total_ex_vat + (bill.getItemPrice * bill.getItemCount) %} {% if bill.getSalesItem.getNoTax %} {% set total_vat = total_vat + 0 %} {% set total_inc_vat = total_inc_vat + (bill.getItemPrice * bill.getItemCount) %} {% else %} {% set total_vat = total_vat + (bill.getItemPrice * bill.getItemCount)* vat_amount/100 %} {% set total_inc_vat = total_inc_vat + (bill.getItemPrice * bill.getItemCount)* (1 + (vat_amount/100)) %} {% endif %} {% endfor %}
Sales Item Description Quantity MA ex Vat Vat MA inc Vat
{{ bill.getSalesItem.getSalesCode }} {{ bill.getDescription }} {{ bill.getItemCount }} R {{ (bill.getItemPrice * bill.getItemCount)|number_format(2, '.', ' ') }} {% if bill.getSalesItem.getNoTax %} R 0.00 {% else %} R {{ ((bill.getItemPrice * bill.getItemCount)*vat_amount/100)|number_format(2, '.', ' ') }} {% endif %} {% if bill.getSalesItem.getNoTax %} R {{ (bill.getItemPrice * bill.getItemCount)|number_format(2, '.', ' ') }} {% else %} R {{ (bill.getItemPrice * bill.getItemCount * (1 + (vat_amount/100)))|number_format(2, '.', ' ') }} {% endif %}
{{ total_cnt }} R {{ total_ex_vat|number_format(2, '.', ' ') }} R {{ total_vat|number_format(2, '.', ' ') }} R {{ total_inc_vat|number_format(2, '.', ' ') }}

Early Invoiced

{% set total_cnt = 0 %} {% set total_kgs = 0 %} {% set total_orig = 0 %} {% set total_markup = 0 %} {% set total_profit = 0 %} {% for res in early_invoiced_results %} {% set total_cnt = total_cnt + res['waybill_cnt'] %} {% set total_kgs = total_kgs + res['kgs_shipped'] %} {% set total_orig = total_orig + res['orig_total'] %} {% set total_markup = total_markup + res['markup_total'] %} {% set total_profit = total_profit + (res['markup_total'] - res['orig_total']) %} {% endfor %}
Sales Item Waybill Cnt Kgs Shipped Orig ex Vat MA ex Vat Profit ex Vat
{{ res['sales_item'] }} {{ res['waybill_cnt'] }} {{ res['kgs_shipped'] }} R {{ res['orig_total']|number_format(2, '.', ' ') }} R {{ res['markup_total']|number_format(2, '.', ' ') }} R {{ (res['markup_total'] - res['orig_total'])|number_format(2, '.', ' ') }}
{{ total_cnt }} {{ total_kgs }} R {{ total_orig |number_format(2, '.', ' ')}} R {{ total_markup|number_format(2, '.', ' ') }} R {{ total_profit|number_format(2, '.', ' ') }}

Billing Run

{% set total_cnt = 0 %} {% set total_kgs = 0 %} {% set total_orig = 0 %} {% set total_markup = 0 %} {% set total_profit = 0 %} {% for res in test_results %} {% set total_cnt = total_cnt + res['waybill_cnt'] %} {% set total_kgs = total_kgs + res['kgs_shipped'] %} {% set total_orig = total_orig + res['orig_total'] %} {% set total_markup = total_markup + res['markup_total'] %} {% set total_profit = total_profit + (res['markup_total'] - res['orig_total']) %} {% endfor %}
Sales Item Waybill Cnt Kgs Shipped Orig ex Vat MA ex Vat Profit ex Vat
{{ res['sales_item'] }} {{ res['waybill_cnt'] }} {{ res['kgs_shipped'] }} R {{ res['orig_total']|number_format(2, '.', ' ') }} R {{ res['markup_total']|number_format(2, '.', ' ') }} R {{ (res['markup_total'] - res['orig_total'])|number_format(2, '.', ' ') }}
{{ total_cnt }} {{ total_kgs }} R {{ total_orig |number_format(2, '.', ' ')}} R {{ total_markup|number_format(2, '.', ' ') }} R {{ total_profit|number_format(2, '.', ' ') }}
{% if total_markup != 0 %}

Gross Profit Margin: {{ ((total_profit/total_markup)*100)|number_format(2, '.', ' ') }} %

{% else %}

Gross Profit Margin: CALC ERROR

{% endif %}