{template_event name="quiqqer::erpAccountingTemplate::header::begin" entityType=$entityType}
{assign var=Logo value=\QUI\ERP\Defaults::getLogo()}
{locale group="quiqqer/erp-accounting-templates" var="header" shopownerAdressShort=QUI\ERP\Defaults::getShortAddress()}

{locale group="quiqqer/erp-accounting-templates" var="header.PurchasingProcess.supplier"}

{if $Address} {$Address->getDisplay()} {else} {$Supplier->getName()} {/if}
{if $this->isDraft()}

{locale group="quiqqer/erp-accounting-templates" var="header.PurchasingProcess.title_draft"}

{else}

{locale group="quiqqer/erp-accounting-templates" var="header.PurchasingProcess.title"}

{/if} {if $this->getAttribute('supplier_invoice_no')} {/if} {if $Customer} {if $Customer->getCustomerNo()} {else} {/if} {/if} {if $Editor && $Editor->getName() !== ''} {/if} {if method_exists($this, 'getInvoice') && $this->getInvoice() && method_exists($this->getInvoice(), 'getData') && $this->getInvoice()->getData('contract') } {assign var=contract value=$this->getInvoice()->getData('contract')} {/if} {if $this->getPurchasingProcess()->getData('salesOrder')} {assign var=salesOrder value=$this->getPurchasingProcess()->getData('salesOrder')} {/if}
{locale group="quiqqer/erp-accounting-templates" var="body.id"} {$this->getId()}
{locale group="quiqqer/erp-accounting-templates" var="body.supplier_invoice_no"} {$this->getAttribute('supplier_invoice_no')}
{locale group="quiqqer/erp-accounting-templates" var="body.date"} {$dateFormatted}
{locale group="quiqqer/erp-accounting-templates" var="header.PurchasingProcess.supplierId"}{$Customer->getCustomerNo()}{$Customer->getId()}
{locale group="quiqqer/erp-accounting-templates" var="body.editor"} {$Editor->getName()}
{locale group="quiqqer/erp-accounting-templates" var="body.contract.id"} {erpGetPrefixedNumber assign=prefixedNumber var=$contract.hash} {$prefixedNumber}
{locale group="quiqqer/erp-accounting-templates" var="body.salesOrder.id"} {$salesOrder.id_str}
{if isset($useShipping) && $useShipping}
{locale group="quiqqer/erp-accounting-templates" var="body.deliveryAddress"}:
{if $DeliveryAddress && $DeliveryAddress->getText() !== ''} {$DeliveryAddress->getText()} {else} {locale group="quiqqer/erp-accounting-templates" var="body.deliveryAddress_like_invoiceAddress"} {/if}
{/if}
{template_event name="quiqqer::erpAccountingTemplate::header::end" entityType=$entityType}