Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-11-10 20:14:08 +01:00
commit 00e3627dd2

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> /* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -79,14 +80,14 @@ if (!empty($action) && $action == 'fetch' && !empty($id))
$found = false; $found = false;
$price_level = 1; $price_level = 1;
if ($socid > 0 && !empty($conf->global->PRODUIT_MULTIPRICES)) { if ($socid > 0 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
$thirdpartytemp = new Societe($db); $thirdpartytemp = new Societe($db);
$thirdpartytemp->fetch($socid); $thirdpartytemp->fetch($socid);
$price_level = $thirdpartytemp->price_level; $price_level = $thirdpartytemp->price_level;
} }
// Price by qty // Price by qty
if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))) // If we need a particular price related to qty if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) // If we need a particular price related to qty
{ {
$sql = "SELECT price, unitprice, quantity, remise_percent"; $sql = "SELECT price, unitprice, quantity, remise_percent";
$sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty "; $sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty ";
@ -108,7 +109,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id))
} }
// Multiprice // Multiprice
if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES))) // If we need a particular price level (from 1 to 6) if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) // If we need a particular price level (from 1 to 6)
{ {
$sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql = "SELECT price, price_ttc, price_base_type, tva_tx";
$sql .= " FROM ".MAIN_DB_PREFIX."product_price "; $sql .= " FROM ".MAIN_DB_PREFIX."product_price ";