35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Module allow edit existing orders and set rules for automatically generating numbers for orders and other documents
|
|
*
|
|
* @author Keshva <keshvathakur47@gmail.com>
|
|
* @copyright 2021 Keshva
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_'))
|
|
exit;
|
|
|
|
require_once(_PS_MODULE_DIR_.'modrefchange/classes/DocumentReferences.php');
|
|
|
|
class OrderInvoice extends OrderInvoiceCore
|
|
{
|
|
private static function loadDocumentReferences()
|
|
{
|
|
if (!class_exists('DocumentReferences')) {
|
|
require_once(_PS_MODULE_DIR_.'modrefchange/classes/DocumentReferences.php');
|
|
}
|
|
}
|
|
|
|
public function getInvoiceNumberFormatted($id_lang, $id_shop = null, $oldFormat = false)
|
|
{
|
|
self::loadDocumentReferences();
|
|
$reference = DocumentReferences::getReference($this->id, 'invoice');
|
|
$invoiceNumber = $reference ? $reference['reference'] : null;
|
|
if ($oldFormat || $invoiceNumber == NULL) {
|
|
return parent::getInvoiceNumberFormatted($id_lang, $id_shop);
|
|
}
|
|
return $invoiceNumber;
|
|
}
|
|
}
|