{% set invoice_deductions = 0 %} {% set months = {1:"Jan", 2:"Feb", 3:"Mar", 4:"Apr", 5:"May", 6:"Jun", 7:"Jul", 8:"Aug", 9:"Sep", 10:"Oct", 11:"Nov", 12:"Dec"} %} {% if entity.getAdjSalesItem is null and entity.invoiceAllocations|length == 0 %} {% else %} {% if entity.getAdjSalesItem is not null %} {% endif %} {% endif %} {% if entity.invoiceAllocations|length > 0 %} {% endif %}
Partner {% if entity.getPartner %}{{ entity.getPartner.getCompanyName }}{%endif%}
Account {% if entity.getMaAccount %}{{ entity.getMaAccount.getMaAccountName }}{%endif%}
Company {% if entity.getCompany %}{{ entity.getCompany.getCompanyName }}{%endif%}
Statement File {% if entity.pdfStatement %} {{ entity.pdfStatement.getOrigPath|trim }} {% endif %}
Invoice Date {% if entity.getInvoiceDate %}{{ entity.getInvoiceDate|date("Y/m/d") }}{%endif%}
Period {{ months[entity.periodMonth] }} {{ entity.periodYear }}
Invoice Number {{ entity.getInvoiceNumber|trim }}
PDF File {{ entity.getOrigPath|trim }}
Amount ex VAT {{ entity.getAmountExVat|number_format(2, '.', ' ') }}
VAT {{ entity.getVat|number_format(2, '.', ' ') }}
Amount inc VAT {{ entity.getAmountIncVat|number_format(2, '.', ' ') }}
Waybills inc VAT {{ waybill_total|number_format(2, '.', ' ') }}
Billing Desc {{ entity.getDescription }}
Internal Desc {{ entity.getInternalDescription }}
Sales Item {% if entity.getAdjSalesItem %}{{ entity.getAdjSalesItem.getSalesCode }}{%endif%}
Amount ex VAT {{ entity.getAmountExVat|number_format(2, '.', ' ') }} MA Amount ex VAT {{ entity.getAdjAmountExVat|number_format(2, '.', ' ') }}
VAT {{ entity.getVat|number_format(2, '.', ' ') }} MA VAT {{ entity.getAdjVat|number_format(2, '.', ' ') }}
Amount inc VAT {{ entity.getAmountIncVat|number_format(2, '.', ' ') }} MA Amount inc VAT {{ entity.getAdjAmountIncVat|number_format(2, '.', ' ') }}
Invoice Items {% for item in entity.invoiceAllocations %}
Customer {% if item.getCustomer %}{{ item.getCustomer.getCompanyName }}{%endif%}
Billing Desc {{ item.getDescription }}
Internal Desc {{ item.getInternalDescription }}
Sales Item {% if item.getAdjSalesItem %}{{ item.getAdjSalesItem.getSalesCode }}{%endif%}
Amount ex VAT {{ item.getAmountExVat|number_format(2, '.', ' ') }} MA Amount ex VAT {{ item.getAdjAmountExVat|number_format(2, '.', ' ') }}
VAT {{ item.getVat|number_format(2, '.', ' ') }} MA VAT {{ item.getAdjVat|number_format(2, '.', ' ') }}
Amount inc VAT {{ item.getAmountIncVat|number_format(2, '.', ' ') }} MA Amount inc VAT {{ item.getAdjAmountIncVat|number_format(2, '.', ' ') }}
{% endfor %}
Invoice Credit Allocations {% if invoice_credit_allocations|length > 0 %} {% for alloc in invoice_credit_allocations %} {% set invoice_deductions = invoice_deductions + alloc.amountIncVat %}
Credit Note{{ alloc.creditNote.creditNoteNumber }}
Credit Date{% if alloc.creditNote.creditNoteDate %}{{ alloc.creditNote.creditNoteDate|date("Y/m/d") }}{%endif%}
Amount (excl){{ alloc.amountExVat|number_format(2, '.', ' ') }}
Amount (vat){{ alloc.vat|number_format(2, '.', ' ') }}
Amount (incl){{ alloc.amountIncVat|number_format(2, '.', ' ') }}
{% endfor %} {% endif %}
Waybill Credit Allocations {% if waybill_credit_allocations|length > 0 %} {% for alloc in waybill_credit_allocations %} {% set invoice_deductions = invoice_deductions + alloc.amountIncVat %}
Credit Note{{ alloc.creditNote.creditNoteNumber }}
Credit Date{% if alloc.creditNote.creditNoteDate %}{{ alloc.creditNote.creditNoteDate|date("Y/m/d") }}{%endif%}
Waybill {% if alloc.rttWaybill is not null %} {{ alloc.rttWaybill.consignmentId|trim }} {% elseif alloc.courieritWaybill is not null %} {{ alloc.courieritWaybill.waybillNumber|trim }} {% elseif alloc.ewcWaybill is not null %} {{ alloc.ewcWaybill.waybill|trim }} {% elseif alloc.kingsWaybill is not null %} {{ alloc.kingsWaybill.waybill|trim }} {% elseif alloc.cargoworksWaybill is not null %} {{ alloc.cargoworksWaybill.waybill|trim }} {% elseif alloc.churchillsWaybill is not null %} {{ alloc.churchillsWaybill.waybill|trim }} {% elseif alloc.expresswaysWaybill is not null %} {{ alloc.expresswaysWaybill.waybill|trim }} {% elseif alloc.utiWaybill is not null %} {{ alloc.utiWaybill.shipmentNumber|trim }} {% elseif alloc.skynetWaybill is not null %} {{ alloc.skynetWaybill.waybill|trim }} {% elseif alloc.gavicWaybill is not null %} {{ alloc.gavicWaybill.waybill|trim }} {% elseif alloc.fpDuToitWaybill is not null %} {{ alloc.fpDuToitWaybill.waybill|trim }} {% elseif alloc.celticFreightWaybill is not null %} {{ alloc.celticFreightWaybill.waybill|trim }} {% elseif alloc.bbTransportWaybill is not null %} {{ alloc.bbTransportWaybill.waybill|trim }} {% elseif alloc.transWorldWaybill is not null %} {{ alloc.transWorldWaybill.waybill|trim }} {% elseif alloc.camposWaybill is not null %} {{ alloc.camposWaybill.waybill|trim }} {% elseif alloc.aramexWaybill is not null %} {{ alloc.aramexWaybill.waybill|trim }} {% elseif alloc.abafaziWaybill is not null %} {{ alloc.abafaziWaybill.waybill|trim }} {% elseif alloc.fedexWaybill is not null %} {{ alloc.fedexWaybill.waybill|trim }} {% elseif alloc.emitWaybill is not null %} {{ alloc.emitWaybill.waybill|trim }} {% elseif alloc.rowelWaybill is not null %} {{ alloc.rowelWaybill.waybill|trim }} {% elseif alloc.inMotionWaybill is not null %} {{ alloc.inMotionWaybill.waybill|trim }} {% elseif alloc.adhocWaybillWaybill is not null %} {{ alloc.adhocWaybillWaybill.waybill|trim }} {% elseif alloc.rbAndSonWaybill is not null %} {{ alloc.rbAndSonWaybill.waybill|trim }} {% elseif alloc.utiReversal is not null %} {{ alloc.utiReversal.shipmentNumber|trim }} {% elseif alloc.skynetReversal is not null %} {{ alloc.skynetReversal.waybill|trim }} {% else %} UNKNOWN ALLOCATION {% endif %}
Amount (excl){{ alloc.amountExVat|number_format(2, '.', ' ') }}
Amount (vat){{ alloc.vat|number_format(2, '.', ' ') }}
Amount (incl){{ alloc.amountIncVat|number_format(2, '.', ' ') }}
{% endfor %} {% endif %}
Payment Allocations {% if allocations|length > 0 %} {% for alloc in allocations %} {% set invoice_deductions = invoice_deductions + alloc.getAmount %}
Payment{{ alloc.getPartnerPayment.getReference }}
Payment Date{% if alloc.getPartnerPayment.getPaymentDate %}{{ alloc.getPartnerPayment.getPaymentDate|date("Y/m/d") }}{%endif%}
PDF File{{ alloc.getPartnerPayment.getOrigPath|trim }}
Allocated Amount{{ alloc.getAmount|number_format(2, '.', ' ') }}
{% endfor %} {% endif %}
Invoice Outstanding {{ (entity.getAmountIncVat - invoice_deductions)|number_format(2, '.', ' ') }}