|
Partner |
Generated |
Imported |
Partner |
Invoice File |
Not Proc |
Proced |
Rules |
Imported |
Amt (excl) |
Amt (excl) |
Profit (excl) |
Margin |
Amt (excl) |
Profit (excl) |
Margin |
|
{% for stat in proc_master %}
{% if stat['customer_id'] == customer.getId %}
{% set overall_not_processed_cnt = overall_not_processed_cnt + stat['not_processed_cnt'] %}
{% set overall_imported_cnt = overall_imported_cnt + stat['billing_import_cnt'] %}
{% set overall_processed_cnt = overall_processed_cnt + stat['processed_cnt'] %}
{% set total_not_processed_cnt = total_not_processed_cnt + stat['not_processed_cnt'] %}
{% set total_processed_cnt = total_processed_cnt + stat['processed_cnt'] %}
{% set total_coverage = total_coverage + stat['coverage_cnt'] %}
{% set total_report_coverage = total_report_coverage + stat['report_coverage_cnt'] %}
{% set total_bulk_edit_coverage = total_bulk_edit_coverage + stat['bulk_edit_coverage_cnt'] %}
{% set overall_coverage = overall_coverage + stat['coverage_cnt'] %}
{% set cust_not_processed_cnt = cust_not_processed_cnt + stat['not_processed_cnt'] %}
{% set cust_processed_cnt = cust_processed_cnt + stat['processed_cnt'] %}
{% set cust_coverage = cust_coverage + stat['coverage_cnt'] %}
{% set cust_imported = cust_imported + stat['billing_import_cnt'] %}
{% set cust_partner_amount = cust_partner_amount + stat['total_ex_vat'] %}
{% set imported_cust_partner_amount = imported_cust_partner_amount + stat['imported_ex_vat'] %}
{% set final_cust_amount = final_cust_amount + stat['final_ex_vat'] %}
{% set cust_ma_amount = cust_ma_amount + stat['adj_total_ex_vat'] %}
{% set cust_bm_amount = cust_bm_amount + stat['bm_ex_vat'] %}
{% if stat['are_unassigned'] == true %}
{% set are_unassigned = true %}
{% endif %}
{% if stat['are_alerted'] == true %}
{% set are_alerted = true %}
{% endif %}
{% if stat['is_rule_covered'] == false %}
{% set is_rule_covered = false %}
{% endif %}
{% set coverage_color = '#F5F5F5' %}
{% set coverage_ok = true %}
{% if (stat['not_processed_cnt'] + stat['processed_cnt']) != stat['coverage_cnt'] %}
{% set coverage_color = '#F2DEDE' %}
{% set coverage_ok = false %}
{% endif %}
|
{% if stat['invoice_file_status'] == constant('D2\\RTTBundle\\Entity\\InvoiceFile::TYPE_PS_CHECKED') or stat['invoice_file_status'] == constant('D2\\RTTBundle\\Entity\\InvoiceFile::TYPE_PS_INVOICED') %}
{{ stat['invoice_file_name'] }} |
{% else %}
{{ stat['invoice_file_name'] }} |
{% endif %}
{{ stat['not_processed_cnt'] }} |
{{ stat['processed_cnt'] }} |
{% if coverage_ok %}{{ stat['coverage_cnt'] }}{% else %}{{ stat['coverage_cnt'] }}{% endif %} |
{{ stat['billing_import_cnt'] }} |
{% if stat['not_processed_cnt'] != 0 %}
|
|
|
|
|
|
|
{% else %}
{% set overall_partner_amount = overall_partner_amount + stat['total_ex_vat'] %}
{% set imported_overall_partner_amount = imported_overall_partner_amount + stat['imported_ex_vat'] %}
{% set overall_ma_amount = overall_ma_amount + stat['adj_total_ex_vat'] %}
{% set overall_bm_amount = overall_bm_amount + stat['bm_ex_vat'] %}
{% set overall_final_amount = overall_final_amount + stat['final_ex_vat'] %}
{% set any_stats_processed = true %}
R {{ stat['total_ex_vat']|number_format(2, '.', ' ') }}
|
R {{ stat['adj_total_ex_vat']|number_format(2, '.', ' ') }}
|
{% if stat['adj_total_ex_vat'] != 0 %}
R {{(stat['adj_total_ex_vat'] - stat['total_ex_vat'])|number_format(2, '.', ' ') }}
{% else %}
R 0.00
{% endif %}
|
{% if stat['adj_total_ex_vat'] != 0 %}
{{ (((stat['adj_total_ex_vat'] - stat['total_ex_vat'])/stat['adj_total_ex_vat'])*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
R {{ stat['bm_ex_vat']|number_format(2, '.', ' ') }}
|
{% if stat['bm_ex_vat'] != 0 %}
R {{(stat['bm_ex_vat'] - stat['imported_ex_vat'])|number_format(2, '.', ' ') }}
{% else %}
R 0.00
{% endif %}
|
{% if stat['bm_ex_vat'] != 0 %}
{{ (((stat['bm_ex_vat'] - stat['imported_ex_vat'])/stat['bm_ex_vat'])*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
{% endif %}
View
|
{% endif %}
{% endfor %}
{% if credits_breakdown[customer.id] is defined %}
{% set cust_partner_amount = cust_partner_amount - credits_breakdown[customer.id]['orig_total'] %}
{% set cust_ma_amount = cust_ma_amount - credits_breakdown[customer.id]['markup_total'] %}
{% set overall_partner_amount = overall_partner_amount - credits_breakdown[customer.id]['orig_total'] %}
{% set overall_ma_amount = overall_ma_amount - credits_breakdown[customer.id]['markup_total'] %}
{% set imported_overall_partner_amount = imported_overall_partner_amount - credits_breakdown[customer.id]['imported_ex_vat'] %}
{% set imported_cust_partner_amount = imported_cust_partner_amount - credits_breakdown[customer.id]['imported_ex_vat'] %}
{% set final_cust_amount = final_cust_amount - credits_breakdown[customer.id]['final_ex_vat'] %}
{% set cust_bm_amount = cust_bm_amount - credits_breakdown[customer.id]['bm_total'] %}
{% set overall_bm_amount = overall_bm_amount - credits_breakdown[customer.id]['bm_total'] %}
{% set overall_final_amount = overall_final_amount - credits_breakdown[customer.id]['final_ex_vat'] %}
{% set any_stats_processed = true %}
All Partners |
OOP CREDITS |
|
|
|
|
R {{ (0 - (credits_breakdown[customer.id]['orig_total']))|number_format(2, '.', ' ') }} |
R {{ (0 - (credits_breakdown[customer.id]['markup_total']))|number_format(2, '.', ' ') }} |
R {{ (0 - (credits_breakdown[customer.id]['markup_total'] - credits_breakdown[customer.id]['orig_total']))|number_format(2, '.', ' ') }} |
{% if credits_breakdown[customer.id]['markup_total'] != 0 %}
{{ (0 - (((credits_breakdown[customer.id]['markup_total'] - credits_breakdown[customer.id]['orig_total'])/credits_breakdown[customer.id]['markup_total'])*100))|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
R {{ (0 - (credits_breakdown[customer.id]['bm_total']))|number_format(2, '.', ' ') }} |
R {{ (0 - (credits_breakdown[customer.id]['bm_total'] - credits_breakdown[customer.id]['imported_ex_vat']))|number_format(2, '.', ' ') }} |
{% if credits_breakdown[customer.id]['bm_total'] != 0 %}
{{ (0 - (((credits_breakdown[customer.id]['bm_total'] - credits_breakdown[customer.id]['imported_ex_vat'])/credits_breakdown[customer.id]['bm_total'])*100))|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
View
|
{% endif %}
{% if general_invoice_breakdown[customer.id] is defined %}
{% set cust_partner_amount = cust_partner_amount + general_invoice_breakdown[customer.id]['orig_total'] %}
{% set cust_ma_amount = cust_ma_amount + general_invoice_breakdown[customer.id]['markup_total'] %}
{% set overall_partner_amount = overall_partner_amount + general_invoice_breakdown[customer.id]['orig_total'] %}
{% set overall_ma_amount = overall_ma_amount + general_invoice_breakdown[customer.id]['markup_total'] %}
{% set imported_overall_partner_amount = imported_overall_partner_amount + general_invoice_breakdown[customer.id]['imported_ex_vat'] %}
{% set imported_cust_partner_amount = imported_cust_partner_amount + general_invoice_breakdown[customer.id]['imported_ex_vat'] %}
{% set final_cust_amount = final_cust_amount + general_invoice_breakdown[customer.id]['final_ex_vat'] %}
{% set cust_bm_amount = cust_bm_amount + general_invoice_breakdown[customer.id]['bm_total'] %}
{% set overall_bm_amount = overall_bm_amount + general_invoice_breakdown[customer.id]['bm_total'] %}
{% set overall_final_amount = overall_final_amount + general_invoice_breakdown[customer.id]['final_ex_vat'] %}
{% set any_stats_processed = true %}
All Partners |
GENERAL INVOICES |
|
|
|
|
R {{ (general_invoice_breakdown[customer.id]['orig_total'])|number_format(2, '.', ' ') }} |
R {{ (general_invoice_breakdown[customer.id]['markup_total'])|number_format(2, '.', ' ') }} |
R {{ (general_invoice_breakdown[customer.id]['markup_total'] - general_invoice_breakdown[customer.id]['orig_total'])|number_format(2, '.', ' ') }} |
{% if general_invoice_breakdown[customer.id]['markup_total'] != 0 %}
{{ (((general_invoice_breakdown[customer.id]['markup_total'] - general_invoice_breakdown[customer.id]['orig_total'])/general_invoice_breakdown[customer.id]['markup_total'])*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
R {{ (general_invoice_breakdown[customer.id]['bm_total'])|number_format(2, '.', ' ') }} |
R {{ (general_invoice_breakdown[customer.id]['bm_total'] - general_invoice_breakdown[customer.id]['imported_ex_vat'])|number_format(2, '.', ' ') }} |
{% if general_invoice_breakdown[customer.id]['bm_total'] != 0 %}
{{ (((general_invoice_breakdown[customer.id]['bm_total'] - general_invoice_breakdown[customer.id]['imported_ex_vat'])/general_invoice_breakdown[customer.id]['bm_total'])*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
View
|
{% endif %}
{% if cust_processed_cnt != 0 %}
|
|
{{ cust_not_processed_cnt }} |
{{ cust_processed_cnt }} |
{{ cust_coverage }} |
{{ cust_imported }} |
R {{ cust_partner_amount|number_format(2, '.', ' ') }} |
R {{ cust_ma_amount|number_format(2, '.', ' ') }} |
R {{ (cust_ma_amount - cust_partner_amount)|number_format(2, '.', ' ') }} |
{% if cust_ma_amount != 0 %}
{{ (((cust_ma_amount - cust_partner_amount)/cust_ma_amount)*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
R {{ cust_bm_amount|number_format(2, '.', ' ') }} |
R {% if cust_bm_amount != 0 %}{{ (cust_bm_amount - imported_cust_partner_amount)|number_format(2, '.', ' ') }} {% else %} 0.00 {% endif %} |
{% if cust_bm_amount != 0 %}
{{ (((cust_bm_amount - imported_cust_partner_amount)/cust_bm_amount)*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
|
|
TOTAL: |
R {{ final_cust_amount|number_format(2, '.', ' ') }} |
R {% if final_cust_amount != 0 %}{{ (final_cust_amount - cust_partner_amount)|number_format(2, '.', ' ') }} {% else %} 0.00 {% endif %} |
{% if final_cust_amount != 0 %}
{{ (((final_cust_amount - cust_partner_amount)/final_cust_amount)*100)|number_format(2, '.', ' ') }}
{% else %}
0.00
{% endif %}
|
|
{% endif %}
{% if backgnd_proc_arr[customer.id]['gen'] == true or backgnd_proc_arr[customer.id]['report'] == true or backgnd_proc_arr[customer.id]['clear'] == true or backgnd_proc_arr[customer.id]['export'] == true %}
{% endif %}
{% set invoice_id = d2_customer_billed(customer.id, year, month) %}
{% set must_credit_note = d2_customer_must_credit_note(customer.id, year, month) %}
{% set credit_note_id = d2_customer_credit_note(customer.id, year, month) %}
{# WHEN WAYBILLS TO BILL #}
{% if cust_coverage != 0 %}
{# WHEN CREDIT NOTE / GENERAL INVOICE ONLY - NO WAYBILLS TO BILL #}
{% elseif must_credit_note == true or general_invoice_breakdown[customer.id] is defined %}
{% if (invoice_id == false or (must_credit_note == true and credit_note_id == false)) %}
{% if ok_to_edit %}
{% endif %}
{% if cust_arr[customer.id]['report_status'] == true %}
{#