You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to add this information as final note of the creditmemo, adding a little bit of code to:
function _insertNote
in
/app/code/community/FireGento/Pdf/Model/Engine/Abstract.php
if ($mode == 'creditmemo') {
$i = 0;
if ($order->hasInvoices()) {
$invIncrementIDs = '';
foreach ($order->getInvoiceCollection() as $inv) {
$i++;
$invIncrementIDs = Mage::helper('firegento_pdf')->__('Ref. ') . $inv->getIncrementId() . " "
. Mage::helper('firegento_pdf')->__('issued on ') . date('d-m-Y', strtotime($inv->getCreatedAt()))
. ' ';
}
if ($i === 1) {
$note = Mage::helper('firegento_pdf')->__('This credit memo refers to the following invoice: ')
. $invIncrementIDs;
}
if ($i > 1) {
$note = Mage::helper('firegento_pdf')->__('This credit memo refers to the following invoices: ')
. $invIncrementIDs;
}
if (!empty($note)) {
$tmpNotes = explode("\n", $note);
$notes = array_merge($notes, $tmpNotes);
}
}
}
// Draw notes on PDF.
The problem is that Magento allows several invoices for one order and, in my mind, a creditmemo is not explicitly related to one of them but only related to the order. Most of the time, only one invoice will appear on the note I propose but sometime it could happen to have more. So, my solution covers the case (with plural in the text to add to FireGento_Pdf.csv) but it's not lawfully perfect. I think it's better than nothing. (In some langages, plural and singular text forms have more differencies than in english).
German law requires the invoice number and invoice date on the creditmemo it's based on.
See here
I will PR this with other things.
The text was updated successfully, but these errors were encountered: