Merge pull request #21958 from dolibit-ut/patch-469

Update price.php
This commit is contained in:
Laurent Destailleur 2022-08-30 00:55:19 +02:00 committed by GitHub
commit 7354818aca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,8 @@
* \brief Page to show product prices by customer * \brief Page to show product prices by customer
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -38,13 +40,17 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$prodcustprice = new Productcustomerprice($db); $prodcustprice = new Productcustomerprice($db);
} }
// Load translation files required by the page
$langs->loadLangs(array("products", "companies", "bills")); $langs->loadLangs(array("products", "companies", "bills"));
$action = GETPOST('action', 'aZ09');
$search_prod = GETPOST('search_prod', 'alpha'); // Get parameters
$cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09');
$search_label = GETPOST('search_label', 'alpha'); $search_prod = GETPOST('search_prod', 'alpha');
$search_price = GETPOST('search_price'); $cancel = GETPOST('cancel', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_price = GETPOST('search_price');
$search_price_ttc = GETPOST('search_price_ttc'); $search_price_ttc = GETPOST('search_price_ttc');
// Security check // Security check
@ -54,6 +60,7 @@ if ($user->socid) {
} }
$result = restrictedArea($user, 'societe', $socid, '&societe'); $result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize objects
$object = new Societe($db); $object = new Societe($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context