[-] BO: get the invoice prefix from the right shop
This commit is contained in:
@@ -616,7 +616,7 @@ abstract class PaymentModuleCore extends Module
|
||||
{
|
||||
$pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $this->context->smarty);
|
||||
$file_attachement['content'] = $pdf->render(false);
|
||||
$file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang).sprintf('%06d', $order->invoice_number).'.pdf';
|
||||
$file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf';
|
||||
$file_attachement['mime'] = 'application/pdf';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -654,9 +654,9 @@ class OrderInvoiceCore extends ObjectModel
|
||||
* @param int $id_lang for invoice_prefix
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumberFormatted($id_lang)
|
||||
public function getInvoiceNumberFormatted($id_lang, $id_shop = null)
|
||||
{
|
||||
return '#'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $this->number);
|
||||
return '#'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, $id_shop).sprintf('%06d', $this->number);
|
||||
}
|
||||
|
||||
public function saveCarrierTaxCalculator(array $taxes_amount)
|
||||
|
||||
@@ -42,7 +42,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
$this->date = Tools::displayDate($order_invoice->date_add, (int)$this->order->id_lang);
|
||||
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $order_invoice->number);
|
||||
$this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number);
|
||||
// footer informations
|
||||
$this->shop = new Shop((int)$this->order->id_shop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user