Skip to content
Code-Schnipsel Gruppen Projekte
Commit b9abf214 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

feat: separate extra text for cancellation invoices

Übergeordneter adab6127
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -1279,6 +1279,10 @@
<de><![CDATA[Gutschrift zu Rechnung #[id] vom [date]]]></de>
<en><![CDATA[Credit Note to invoice #[id] from [date]]]></en>
</locale>
<locale name="message.invoice.cancellationInvoice.additionalInvoiceText" html="true">
<de><![CDATA[Storno-Rechnung zu Rechnung #[id] vom [date]]]></de>
<en><![CDATA[Cancelletion invoice to invoice #[id] from [date]]]></en>
</locale>
<locale name="message.add.history.sent.to">
<de><![CDATA[Rechnung wurde versendet an [recipient]]]></de>
<en><![CDATA[Invoice was sent to [recipient]]]></en>
......
......@@ -533,6 +533,42 @@ public function reversal($reason, $PermissionUser = null)
);
$CreditNote->setInvoiceType(Handler::TYPE_INVOICE_REVERSAL);
// Cancellation invoice extra text
$localeCode = QUI::getLocale()->getLocalesByLang(
QUI::getLocale()->getCurrent()
);
$Formatter = new \IntlDateFormatter(
$localeCode[0],
\IntlDateFormatter::SHORT,
\IntlDateFormatter::NONE
);
$currentDate = $this->getAttribute('date');
if (!$currentDate) {
$currentDate = \time();
} else {
$currentDate = \strtotime($currentDate);
}
$message = $this->getCustomer()->getLocale()->get(
'quiqqer/invoice',
'message.invoice.cancellationInvoice.additionalInvoiceText',
[
'id' => $this->getId(),
'date' => $Formatter->format($currentDate)
]
);
if (empty($message)) {
$message = '';
}
// saving copy
$CreditNote->setAttribute('additional_invoice_text', $message);
$CreditNote->save(QUI::getUsers()->getSystemUser());
try {
......@@ -794,7 +830,7 @@ public function createCreditNote($PermissionUser = null, $globalProcessId = fals
$currentDate = \strtotime($currentDate);
}
$message = QUI::getLocale()->get(
$message = $this->getCustomer()->getLocale()->get(
'quiqqer/invoice',
'message.invoice.creditNote.additionalInvoiceText',
[
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren