src/Invoice/Completor.php
protected function invoiceTemplate()
    {
        $invoiceSettings = $this->config->getInvoiceSettings();

        // Acumulus invoice template to use.
        $settingToUse = isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus])
                        && $this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus] == Api::PaymentStatus_Paid
                        // 0 (= empty) = use same invoice template as for non paid invoices.
                        && $invoiceSettings['defaultInvoicePaidTemplate'] != 0
            ? 'defaultInvoicePaidTemplate'
            : 'defaultInvoiceTemplate';
        $this->addDefault($this->invoice[Tag::Customer][Tag::Invoice], Tag::Template, $invoiceSettings[$settingToUse]);
    }
protected function invoiceTemplate()
    {
        $invoiceSettings = $this->config->getInvoiceSettings();

        // Acumulus invoice template to use.
        $settingToUse = isset($this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus])
                        && $this->invoice[Tag::Customer][Tag::Invoice][Tag::PaymentStatus] == Api::PaymentStatus_Paid
                        // 0 (= empty) = use same invoice template as for non paid invoices.
                        && $invoiceSettings['defaultInvoicePaidTemplate'] != 0
            ? 'defaultInvoicePaidTemplate'
            : 'defaultInvoiceTemplate';
        $this->addDefault($this->invoice[Tag::Customer][Tag::Invoice], Tag::Template, $invoiceSettings[$settingToUse]);
    }
protected function invoiceTemplate ( ) { $ invoiceSettings = $ this -> config -> getInvoiceSettings ( ) ; // Acumulus invoice template to use. $ settingToUse = isset ( $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Tag :: PaymentStatus ] ) && $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] [ Tag :: PaymentStatus ] == Api :: PaymentStatus_Paid // 0 (= empty) = use same invoice template as for non paid invoices. && $ invoiceSettings [ 'defaultInvoicePaidTemplate' ] != 0 ? 'defaultInvoicePaidTemplate' : 'defaultInvoiceTemplate' ; $ this -> addDefault ( $ this -> invoice [ Tag :: Customer ] [ Tag :: Invoice ] , Tag :: Template , $ invoiceSettings [ $ settingToUse ] ) ; }
Fills the invoice template to use when sending an invoice from Acumulus.

As getting the payment status right is notoriously hard, we fill this
value only here in the completor phase to give users the chance to change
the payment status in the acumulus invoice created event.
Fills the invoice template to use when sending an invoice from Acumulus .