{% extends 'D2FedexBundle::base.html.twig' %} {% block head_script_extra %} {% endblock head_script_extra %} {% block page_header %} {% 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"} %}
Back
Partner Manager: FEDEX Period: {{ months[month] }}/{{ year }}
{% endblock page_header %} {% block content %} {#
#} {# FILTER SECTION #}
{% for k, v in app.request.query %} {% if k|lower not in ['search', 'page', 'month', 'year'] %} {% endif %} {% endfor %}
Archive

{# STATS SECTION #}
{% for invoice_stat in partner_invoice_data %} {% if (invoice_stat['waybill_totals']['total']|round(2) != invoice_stat['inc_vat']|round(2)) %} {% set waybill_color = '#F2DEDE' %} {% set invoice_color = '#F2DEDE' %} {% else %} {% set waybill_color = '#FFFFFF' %} {% set invoice_color = '#FFFFFF' %} {% endif %} {% if invoice_stat['statement_current'] is not null %} {% if ((invoice_stat['waybill_totals']['total'] - invoice_stat['credit_totals']['total'])|round(2) != invoice_stat['statement_current']|round(2)) %} {% set waybill_color = '#F2DEDE' %} {% set statement_color = '#F2DEDE' %} {% else %} {% set waybill_color = '#FFFFFF' %} {% set statement_color = '#FFFFFF' %} {% endif %} {% if ((invoice_stat['inc_vat'] - invoice_stat['credit_totals']['total'])|round(2) != invoice_stat['statement_current']|round(2)) %} {% set invoice_color = '#F2DEDE' %} {% set statement_color = '#F2DEDE' %} {% else %} {% set invoice_color = '#FFFFFF' %} {% set statement_color = '#FFFFFF' %} {% endif %} {% endif %} {% if invoice_stat['statement_current'] is null %} {% else %} {% endif %} {% endfor %}
Invoice Summary
PartnerAccountWaybillsInvoiceCreditsStatement
Sub TotalVatTotal Sub TotalVatTotal Sub TotalVatTotal Current
{{ invoice_stat['partner_name'] }} {{ invoice_stat['ma_account_name'] }} {{ invoice_stat['waybill_totals']['sub_total']|number_format(2, '.', ' ') }} {{ invoice_stat['waybill_totals']['vat']|number_format(2, '.', ' ') }} {{ invoice_stat['waybill_totals']['total']|number_format(2, '.', ' ') }} {{ invoice_stat['ex_vat']|number_format(2, '.', ' ') }} {{ invoice_stat['vat']|number_format(2, '.', ' ') }} {{ invoice_stat['inc_vat']|number_format(2, '.', ' ') }} {{ invoice_stat['credit_totals']['sub_total']|number_format(2, '.', ' ') }} {{ invoice_stat['credit_totals']['vat']|number_format(2, '.', ' ') }} {{ invoice_stat['credit_totals']['total']|number_format(2, '.', ' ') }}NO STATEMENT{{ invoice_stat['statement_current']|number_format(2, '.', ' ') }}
{% if mis_alloced_waybills|length > 0 %} {% for ma_wabill in mis_alloced_waybills %} {% endfor %}
Possible Incorrect Assignments
CustomerMA AccountInvoiceSoundexWaybillSenderReceiver
{{ ma_wabill['customer'] }} {{ ma_wabill['ma_account'] }} {{ ma_wabill['inv_file'] }} {{ ma_wabill['soundex'] }} {{ ma_wabill['waybill'] }} {{ ma_wabill['sender'] }} {{ ma_wabill['receiver'] }}
{% endif %} {% if calc_rules_exceptions|length > 0 %} {% for calc_rule in calc_rules_exceptions %} {% endfor %}
Unbillable Waybills
PartnerCustomerInvoiceWaybillOriginDest
{{ calc_rule['partner'] }} {{ calc_rule['customer'] }} {{ calc_rule['invoice'] }} {{ calc_rule['waybill'] }} {{ calc_rule['origin'] }} {{ calc_rule['dest'] }}
{% endif %} {% if esculations|length > 0 %} {% for esculation in esculations %} {% if esculation['level'] == 0 %} {% set esc_level = 'LOW' %} {% elseif esculation['level'] == 1 %} {% set esc_level = 'MEDIUM' %} {% else %} {% set esc_level = 'HIGH' %} {% endif %} {% endfor %}
Waybill Esculations
WaybillLevelCommentCredit NoteCredit RequestQuotation
{{ esculation['waybill'] }} {{ esculation_options[esculation['level']] }} {{ esculation['esculation'] }} {% if esculation_options[esculation['level']] == 'CREDIT NOTE' %} {% set alloc = d2_partner_get_waybill_credit_alloc( partner_id, esculation['id'] ) %} {% if alloc is not null %} {% if alloc.creditNote is not null %} {{ alloc.creditNote.getCreditNoteNumber() }} {% else %} NO CREDIT NOTE FOUND {% endif %} {% else %} NO CREDIT ALLOCATION FOUND {% endif %} {% endif %} {% if esculation_options[esculation['level']] == 'CREDITS REQUEST' %} {% set request = d2_partner_get_waybill_credit_request( partner_id, esculation['id'] ) %} {% if request is not null %} {{ request.getDocNo() }} {% else %} NO CREDIT REQUEST FOUND {% endif %} {% endif %} {% if esculation_options[esculation['level']] == 'BILL CHARGE' or esculation_options[esculation['level']] == 'QUOTED' %} {% set quotation = d2_partner_get_waybill_quote( partner_id, esculation['id'] ) %} {% if quotation is not null %} {{ quotation.getDocNo() }} {% else %} NO QUOTE FOUND {% endif %} {% endif %}
{% endif %} {% if quoted|length > 0 %} {% for wbitem in quoted %} {% endfor %}
Waybill Quotations
CustomerWaybillAmountQuotationInfoAmountMarkup
{{ wbitem['customer']|trim }} {{ wbitem['waybill'] }} {{ wbitem['waybill_amount']|number_format(2, '.', ' ') }} {{ wbitem['quote_num'] }} {{ wbitem['quote_info']|trim }} {{ wbitem['quote_amount']|number_format(2, '.', ' ') }} {{ (((wbitem['quote_amount'] - wbitem['waybill_amount'])/wbitem['waybill_amount']) * 100)|number_format(2, '.', ' ') }}%
{% endif %}
{# INVOICE SECTION #}
{% if is_granted('ROLE_ADMIN_WAYBILL_FILE_CREATE') %} Upload Invoice File {% endif %} {% if is_granted('ROLE_ADMIN_WAYBILL_CREATE') %} {# Add Waybill #} {% endif %} {% if is_granted('ROLE_ADMIN_WAYBILL_VIEW') and invoice_file_list|length != 0 %} View Waybills {% else %} {% endif %}

{% if app.request.get('page') is not null %} {% set current_page = app.request.get('page') %} {% else %} {% set current_page = 1 %} {% endif %} {% if invoice_file_list|length != 0 %} {% for entity in invoice_file_list %} {% if loop.first %}
{% endif %}
{% if is_granted('ROLE_ADMIN_WAYBILL_FILE_MANAGE') %} {% if entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_IMPORTED') or entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_PAUSED') %} {% elseif entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_PROCESSING') or entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_RELEASED')%} {% endif %} {% endif %} {% if entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_PROCESSED') or entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_CHECKED') %} {% if is_granted('ROLE_ADMIN_WAYBILL_VIEW') %} {% endif %} {% if is_granted('ROLE_ADMIN_WAYBILL_FILE_MANAGE') and entity.getLocked != true %} {% endif %} {% if is_granted('ROLE_ADMIN_WAYBILL_FILE_CREATE') and entity.getLocked != true %} {% endif %} {% elseif entity.getProcessStatus == constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_INVOICED') %} {% if is_granted('ROLE_ADMIN_WAYBILL_VIEW') %} {% endif %} {# {% elseif entity.getProcessStatus == constant('D2\\UTIBundle\\Entity\\InvoiceFile::TYPE_PS_ERROR') %} {% if is_granted('ROLE_ADMIN_WAYBILL_FILE_CREATE') %} {% endif %} #} {% endif %} {% if is_granted('ROLE_ADMIN_WAYBILL_FILE_DELETE') and entity.getLocked != true and entity.getProcessStatus != constant('D2\\FedexBundle\\Entity\\InvoiceFile::TYPE_PS_INVOICED') %} × {% endif %}
{% set file_type = d2_file_type(entity.origPath) %} {% if file_type == 'csv' %} document {% elseif file_type == 'speadsheet' %} document {% elseif file_type == 'unknown' %} document {% endif %} {% if entity.pdfInvoice %} PDF Invoice {% endif %} {% set task_cnt = d2_partner_get_task_cnt(entity.periodMonth, entity.periodYear, 'WAYBILL_INVOICE', entity.partner.id, entity.maAccount.id, entity.id) %} {% set note_cnt = d2_partner_get_note_cnt(entity.periodMonth, entity.periodYear, 'WAYBILL_INVOICE', entity.partner.id, entity.maAccount.id, entity.id) %} {% if task_cnt['open_task_cnt'] > 0 %} {% elseif task_cnt['closed_task_cnt'] > 0 %} {% else %} {% endif %} {% if note_cnt > 0 %} {% else %} {% endif %}
{% if entity.pdfInvoice %} {% endif %} {% endif %}
Status:{{ process_status_opts[entity.getProcessStatus] }} {% if entity.getLocked == true %} lock {% else %} unlock {% endif %}
Filename:{{ entity.origPath|trim|slice(0, 25) }} {% if entity.getLocked != true %}{% endif %}
Account:{% if entity.maAccount is not null %}{{ entity.maAccount.maAccountName }}{% endif %} {% if entity.getLocked != true %}{% endif %}
Invoice:{{ entity.pdfInvoice.invoiceNumber }} {% if entity.getLocked != true %}
Owner:{% if entity.getUser %}{{ entity.getUser.getUsername|trim }} {% else %} Unknown {% endif %}
Created:{{ entity.date|date("Y/m/d g:ia") }}
{% set import_status = d2_fedex_invoice_file_import_status(entity.id) %} {% set check_status = d2_fedex_invoice_file_check_status(entity.id) %} {% if import_status == true or check_status == true %}
{% else %} {% endif %}
{% if not loop.first and loop.index%3 == 0 %}
{% endif %} {% endfor %}
{% set export_status = d2_partner_export_status(partner_id, 'WAYBILL') %} {% if export_status == true %} {% endif %} {% endif %}
{# CREDIT NOTES #}
{% if is_granted('ROLE_ADMIN_PARTNER_MANAGE') %} Upload PDF Credit Note {% endif %}

{% if credit_note_file_list|length != 0 %} {% for entity in credit_note_file_list %} {% if loop.first %}
{% endif %}
{% if is_granted('ROLE_ADMIN_PARTNER_MANAGE') %} {% if entity.locked == false %}{% endif %} {% if entity.locked == false %}{% endif %} {% if entity.locked == false %}{% endif %} {% if entity.locked == false %}×{% endif %} {% endif %}
PDF Statement {% set task_cnt = d2_partner_get_task_cnt(entity.periodMonth, entity.periodYear, 'CREDIT_NOTE', entity.partner.id, entity.maAccount.id, entity.id) %} {% set note_cnt = d2_partner_get_note_cnt(entity.periodMonth, entity.periodYear, 'CREDIT_NOTE', entity.partner.id, entity.maAccount.id, entity.id) %} {% if task_cnt['open_task_cnt'] > 0 %} {% elseif task_cnt['closed_task_cnt'] > 0 %} {% else %} {% endif %} {% if note_cnt > 0 %} {% else %} {% endif %}
{% for allocation in entity.getAllocations %} {% if allocation.pdfInvoice is not null %} {% endif %} {% elseif allocation.fedexWaybill is not null %} {% endif %} {% endif %} {% endfor %}
Credit:{{ entity.creditNoteNumber }}
Invoice:{{ allocation.pdfInvoice.invoiceNumber }} {% if entity.locked == false %}
Waybill:{{ allocation.fedexWaybill.waybill }} {% if entity.locked == false %}
Owner:{% if entity.getUser %}{{ entity.getUser.getUsername|trim }} {% else %} Unknown {% endif %}
Created:{{ entity.date|date("Y/m/d g:ia") }}
Account:{{ entity.getMaAccount.getMaAccountName }}
{% if not loop.first and loop.index%3 == 0 %}
{% endif %} {% endfor %}
{% endif %}
{# STATEMENTS #}
{% if is_granted('ROLE_ADMIN_PARTNER_MANAGE') %} Upload PDF Statement {% endif %}

{% if statement_file_list|length != 0 %} {% for entity in statement_file_list %} {% if loop.first %}
{% endif %}
{% if is_granted('ROLE_ADMIN_PARTNER_MANAGE') %} × {% endif %}
PDF Statement {% set task_cnt = d2_partner_get_task_cnt(entity.periodMonth, entity.periodYear, 'STATEMENT', entity.partner.id, entity.maAccount.id, entity.id) %} {% set note_cnt = d2_partner_get_note_cnt(entity.periodMonth, entity.periodYear, 'STATEMENT', entity.partner.id, entity.maAccount.id, entity.id) %} {% if task_cnt['open_task_cnt'] > 0 %} {% elseif task_cnt['closed_task_cnt'] > 0 %} {% else %} {% endif %} {% if note_cnt > 0 %} {% else %} {% endif %}
{% for invoice in entity.getPdfInvoices %} {% endfor %} {% for credit_note in entity.getPdfCreditNotes %} {% endfor %}
Owner:{% if entity.getUser %}{{ entity.getUser.getUsername|trim }} {% else %} Unknown {% endif %}
Created:{{ entity.date|date("Y/m/d g:ia") }}
Account:{{ entity.getMaAccount.getMaAccountName }}
Statement:{{ entity.origPath|trim|slice(0, 28) }}
Invoice:{{ invoice.invoiceNumber }}
Credit:{{ credit_note.creditNoteNumber }}
{% if not loop.first and loop.index%3 == 0 %}
{% endif %} {% endfor %}
{% endif %}
{% endblock content %}