Hello, In my shop order reference consists of only numbers, and I need that order invoice number would be totaly same as order reference number. I found where invoice number generating, but it's complicated to replace it with other value.
Here what I have in OrderInvoice.php file:
public function getInvoiceNumberFormatted($id_lang, $id_shop = null)
{
$invoice_formatted_number = Hook::exec('actionInvoiceNumberFormatted', array(
get_class($this) => $this,
'id_lang' => (int)$id_lang,
'id_shop' => (int)$id_shop,
'number' => (int)$this->number
));
if (!empty($invoice_formatted_number)) {
return $invoice_formatted_number;
}
$format = '%1$s%2$06d';
if (Configuration::get('PS_INVOICE_USE_YEAR')) {
$format = Configuration::get('PS_INVOICE_YEAR_POS') ? '%1$s%3$s/%2$06d' : '%1$s%2$06d/%3$s';
}
return sprintf($format, Configuration::get('PS_INVOICE_PREFIX', (int)$id_lang, null, (int)$id_shop), $this->number, date('Y', strtotime($this->date_add)));
}
Thanks.