{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()}
{if $Address} {$Address->getDisplay()} {else} {$viewData['customer_name']} {/if}
{if $this->getSalesOrder()->isDraft()}

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

{else}

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

{/if} {if !empty($viewData['customer'])} {/if} {if !empty($viewData['editor_name'])} {/if} {if $this->getSalesOrder()->getData('offerId')} {/if}
{locale group="quiqqer/erp-accounting-templates" var="body.id"} {$this->getId()}
{locale group="quiqqer/erp-accounting-templates" var="body.date"} {$viewData['date']}
{locale group="quiqqer/erp-accounting-templates" var="body.customerId"} {$viewData['customer']['no']}
{locale group="quiqqer/erp-accounting-templates" var="body.editor"} {$viewData['editor_name']}
{locale group="quiqqer/erp-accounting-templates" var="offer.body.id"} {$this->getSalesOrder()->getData('offerId')}
{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="SalesOrder.body.delivery_address_like_customer_address"} {/if}
{/if}
{template_event name="quiqqer::erpAccountingTemplate::header::end" entityType=$entityType}