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

This commit is contained in:
ldestailleur
2025-09-26 01:16:30 +02:00
4 changed files with 14 additions and 7 deletions

View File

@@ -1291,7 +1291,8 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($level = 1; $level <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $level++) {
$maxlevel = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($level = 1; $level <= $maxlevel; $level++) {
if ($object->price_base_type == 'TTC') {
$newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100;
$minprice = $object->multiprices_min_ttc[$level];

View File

@@ -2672,7 +2672,8 @@ class Product extends CommonObject
// Load multiprices array
if (getDolGlobalString('PRODUIT_MULTIPRICES') && empty($ignore_price_load)) { // prices per segment
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $produit_multiprices_limit; $i++) {
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly";
$sql .= " FROM ".$this->db->prefix()."product_price";
@@ -2782,7 +2783,8 @@ class Product extends CommonObject
return -1;
}
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') && empty($ignore_price_load)) { // prices per customer and quantity
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $produit_multiprices_limit; $i++) {
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly";
$sql .= " FROM ".$this->db->prefix()."product_price";

View File

@@ -526,7 +526,8 @@ class ProductCombination
// MultiPrix
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $produit_multiprices_limit; $i++) {
if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) {
$new_type = empty($parent->multiprices_base_type[$i]) ? 'HT' : $parent->multiprices_base_type[$i];
$new_min_price = $parent->multiprices_min[$i];
@@ -835,7 +836,8 @@ class ProductCombination
// Init price level
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$produit_multiprices_limit = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $produit_multiprices_limit; $i++) {
$productCombinationLevel = new ProductCombinationLevel($this->db);
$productCombinationLevel->fk_product_attribute_combination = $newcomb->id;
$productCombinationLevel->fk_price_level = $i;

View File

@@ -295,7 +295,8 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST(
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
$prodcomb->combination_price_levels = array();
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$maxi = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $maxi; $i++) {
$productCombinationLevel = new ProductCombinationLevel($db);
$productCombinationLevel->fk_product_attribute_combination = $prodcomb->id;
$productCombinationLevel->fk_price_level = $i;
@@ -725,7 +726,8 @@ if (!empty($id) || !empty($ref)) {
} else {
$prodcomb->fetchCombinationPriceLevels();
for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) {
$maxi = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 1; $i <= $maxi; $i++) {
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
$text = $langs->trans('ImpactOnPriceLevel', $i).' - '.getDolGlobalString($keyforlabel);
print '<tr>';