Current Module

This commit is contained in:
2026-07-10 11:56:56 +02:00
parent 1c52d03cbf
commit 74583d512c
67 changed files with 8964 additions and 0 deletions
@@ -0,0 +1,72 @@
<?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 Order extends OrderCore
{
public function setInvoice($use_existing_payment = false)
{
if (!$this->hasInvoice()) {
parent::setInvoice($use_existing_payment);
DocumentReferences::storeReference('invoice', $this->id);
}
}
public function setDelivery()
{
$order_invoice_collection = $this->getInvoicesCollection();
foreach ($order_invoice_collection as $order_invoice) {
if ($order_invoice->delivery_number) {
continue;
}
DocumentReferences::storeReference('delivery_slip', $this->id, $order_invoice->id);
}
parent::setDelivery();
}
public static function generateReference()
{
return DocumentReferences::storeReference('order');
}
public function hasBeenDelivered()
{
if (version_compare(_PS_VERSION_, '1.7.7', '>=')) {
if (Context::getContext()->controller->controller_name == 'Admin') {
return false;
}
parent::hasBeenDelivered();
} else {
if (Tools::getIsset('action'))
if (Tools::getValue('action') == 'editProductOnOrder' || Tools::getValue('action') == 'deleteProductLine')
return false;
return parent::hasBeenDelivered();
}
}
public function hasBeenShipped()
{
if (version_compare(_PS_VERSION_, '1.7.7', '>=')) {
if (Context::getContext()->controller->controller_name == 'Admin') {
return false;
}
return parent::hasBeenShipped();
} else {
if (Tools::getIsset('action'))
if (Tools::getValue('action') == 'addProductOnOrder')
return false;
return parent::hasBeenShipped();
}
}
}
@@ -0,0 +1,26 @@
<?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
{
public function getInvoiceNumberFormatted($id_lang, $id_shop = null, $oldFormat = false)
{
$invoiceNumber = DocumentReferences::getReference($this->id, 'invoice')['reference'];
if ($oldFormat || $invoiceNumber == NULL) {
return parent::getInvoiceNumberFormatted($id_lang, $id_shop);
}
return $invoiceNumber;
}
}
@@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;