From 255af0fb3320b0f004219cab9ead3dfba1d3d60d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 1 Mar 2024 12:37:56 +0100 Subject: [PATCH 1/3] feat: add price label UI #28544 --- htdocs/product/class/product.class.php | 20 ++++++- .../class/productcustomerprice.class.php | 23 ++++++++ htdocs/product/price.php | 55 ++++++++++++++++++- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1cfc859b2b9..0cd4a63b0f6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -178,6 +178,7 @@ class Product extends CommonObject * @var string */ public $price_base_type; + public $price_label; //! Arrays for multiprices public $multiprices = array(); @@ -674,6 +675,7 @@ class Product extends CommonObject $this->price = (float) price2num($this->price); $this->price_min_ttc = (float) price2num($this->price_min_ttc); $this->price_min = (float) price2num($this->price_min); + $this->price_label = trim($this->price_label); if (empty($this->tva_tx)) { $this->tva_tx = 0; } @@ -816,6 +818,7 @@ class Product extends CommonObject $sql .= ", price"; $sql .= ", price_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", tobuy"; $sql .= ", tosell"; if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { @@ -843,6 +846,7 @@ class Product extends CommonObject $sql .= ", ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); $sql .= ", ".((int) $user->id); $sql .= ", ".((int) $this->type); + $sql .= ", ".(!empty($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null"); $sql .= ", ".price2num($price_ht, 'MT'); $sql .= ", ".price2num($price_ttc, 'MT'); $sql .= ", '".$this->db->escape($this->price_base_type)."'"; @@ -1954,9 +1958,9 @@ class Product extends CommonObject } // Add new price - $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; + $sql = "INSERT INTO ".$this->db->prefix()."product_price(price_level,date_price, fk_product, fk_user_author, price_label, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) "; - $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; + $sql .= " VALUES(".($level ? ((int) $level) : 1).", '".$this->db->idate($now)."', ".((int) $this->id).", ".((int) $user->id).", ".(empty($this->price_label)?"null":"'".$this->db->escape($this->price_label)."'").", ".((float) price2num($this->price)).", ".((float) price2num($this->price_ttc)).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".((float) price2num($this->tva_tx)).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; $sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".((int) $conf->entity).",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null'); $sql .= ")"; @@ -2301,10 +2305,11 @@ class Product extends CommonObject * @param int $ignore_autogen Used to avoid infinite loops * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). * @param string $newdefaultvatcode Default vat code + * @param string $price_label Price Label * @param int $notrigger Disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $notrigger = 0) + public function updatePrice($newprice, $newpricebase, $user, $newvat = '', $newminprice = 0, $level = 0, $newnpr = 0, $newpbq = 0, $ignore_autogen = 0, $localtaxes_array = array(), $newdefaultvatcode = '', $price_label = '', $notrigger = 0) { global $conf, $langs; @@ -2431,6 +2436,7 @@ class Product extends CommonObject $sql .= " localtax1_type = ".($localtaxtype1 != '' ? "'".$this->db->escape($localtaxtype1)."'" : "'0'").","; $sql .= " localtax2_type = ".($localtaxtype2 != '' ? "'".$this->db->escape($localtaxtype2)."'" : "'0'").","; $sql .= " default_vat_code = ".($newdefaultvatcode ? "'".$this->db->escape($newdefaultvatcode)."'" : "null").","; + $sql .= " price_label = ".(!empty($price_label) ? "'".$this->db->escape($price_label)."'" : "null").","; $sql .= " tva_tx = ".(float) price2num($newvat).","; $sql .= " recuperableonly = '".$this->db->escape($newnpr)."'"; $sql .= " WHERE rowid = ".((int) $id); @@ -2448,6 +2454,7 @@ class Product extends CommonObject $this->multiprices_recuperableonly[$level] = $newnpr; $this->price = $price; + $this->price_label = $price_label; $this->price_ttc = $price_ttc; $this->price_min = $price_min; $this->price_min_ttc = $price_min_ttc; @@ -2455,6 +2462,7 @@ class Product extends CommonObject $this->default_vat_code = $newdefaultvatcode; $this->tva_tx = $newvat; $this->tva_npr = $newnpr; + //Local taxes $this->localtax1_tx = $localtax1; $this->localtax2_tx = $localtax2; @@ -2572,6 +2580,7 @@ class Product extends CommonObject } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf,"; + $sql .= " p.price_label,"; if ($separatedStock) { $sql .= " SUM(sp.reel) as stock"; } else { @@ -2615,6 +2624,7 @@ class Product extends CommonObject } $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,"; $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf"; + $sql .= " ,p.price_label"; if (!$separatedStock) { $sql .= ", p.stock"; } @@ -2638,6 +2648,7 @@ class Product extends CommonObject $this->note = $obj->note_private; // deprecated $this->type = $obj->fk_product_type; + $this->price_label = $obj->price_label; $this->status = $obj->tosell; $this->status_buy = $obj->tobuy; $this->status_batch = $obj->tobatch; @@ -2734,6 +2745,7 @@ class Product extends CommonObject for ($i = 1; $i <= $conf->global->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 .= " ,price_label"; $sql .= " FROM ".$this->db->prefix()."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; $sql .= " AND price_level=".((int) $i); @@ -4802,6 +4814,7 @@ class Product extends CommonObject $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; @@ -4829,6 +4842,7 @@ class Product extends CommonObject $sql .= ", price_min"; $sql .= ", price_min_ttc"; $sql .= ", price_base_type"; + $sql .= ", price_label"; $sql .= ", default_vat_code"; $sql .= ", tva_tx"; $sql .= ", recuperableonly"; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 2c63a76b059..025e7c9ca8e 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -42,6 +42,7 @@ class ProductCustomerPrice extends CommonObject 'price_ttc' => array('type' => 'decimal(20,6)', 'label' => 'TTC', 'enabled' => 1, 'visible' => 1, 'position' => 8, 'notnull' => -1, 'comment' => 'Price TTC'), 'price_min' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceHT', 'enabled' => 1, 'visible' => 1, 'position' => 9, 'notnull' => -1, 'comment' => 'Minimum Price'), 'price_min_ttc' => array('type' => 'decimal(20,6)', 'label' => 'MinPriceTTC', 'enabled' => 1, 'visible' => 1, 'position' => 10, 'notnull' => -1, 'comment' => 'Minimum Price TTC'), + 'price_label' => array('type' => 'varchar(255)', 'label' => 'PriceLabel', 'enabled' => 1, 'visible' => 1, 'position' => 20, 'notnull' => -1, 'comment' => 'Price Label'), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>1, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), ); @@ -89,6 +90,7 @@ class ProductCustomerPrice extends CommonObject public $localtax1_tx; public $localtax2_type; public $localtax2_tx; + public $price_label; /** * @var int User ID @@ -168,6 +170,9 @@ class ProductCustomerPrice extends CommonObject if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -226,6 +231,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax2_type,"; $sql .= "localtax2_tx,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") VALUES ("; $sql .= " ".((int) $conf->entity).","; @@ -246,6 +252,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " ".(empty($this->localtax2_type) ? "'0'" : "'".$this->db->escape($this->localtax2_type)."'").","; $sql .= " ".(!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)).","; $sql .= " ".((int) $user->id).","; + $sql .= " ".(!isset($this->price_label) ? 'NULL' : "'".$this->db->escape($this->price_label)."'").","; $sql .= " ".(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'"); $sql .= ")"; @@ -319,6 +326,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; $sql .= " WHERE t.rowid = ".((int) $id); @@ -348,6 +356,7 @@ class ProductCustomerPrice extends CommonObject $this->localtax1_tx = $obj->localtax1_tx; $this->localtax2_tx = $obj->localtax2_tx; $this->fk_user = $obj->fk_user; + $this->price_label = $obj->price_label; $this->import_key = $obj->import_key; $this->db->free($resql); @@ -405,6 +414,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -467,6 +477,7 @@ class ProductCustomerPrice extends CommonObject $line->localtax1_type = $obj->localtax1_type; $line->localtax2_type = $obj->localtax2_type; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -519,6 +530,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key,"; $sql .= " soc.nom as socname,"; $sql .= " prod.ref as prodref"; @@ -574,6 +586,7 @@ class ProductCustomerPrice extends CommonObject $line->localtax1_tx = $obj->localtax1_tx; $line->localtax2_tx = $obj->localtax2_tx; $line->fk_user = $obj->fk_user; + $line->price_label = $obj->price_label; $line->import_key = $obj->import_key; $line->socname = $obj->socname; $line->prodref = $obj->prodref; @@ -646,6 +659,9 @@ class ProductCustomerPrice extends CommonObject if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; } + if (isset($this->price_label)) { + $this->price_label = trim($this->price_label); + } if (isset($this->import_key)) { $this->import_key = trim($this->import_key); } @@ -706,6 +722,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax1_type,"; $sql .= "localtax2_type,"; $sql .= "fk_user,"; + $sql .= "price_label,"; $sql .= "import_key"; $sql .= ") "; @@ -729,6 +746,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; $sql .= " t.fk_user,"; + $sql .= " t.price_label,"; $sql .= " t.import_key"; $sql .= " FROM ".$this->db->prefix()."product_customer_price as t"; @@ -764,6 +782,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " localtax1_type=".(!empty($this->localtax1_type) ? "'".$this->db->escape($this->localtax1_type)."'" : "'0'").","; $sql .= " localtax2_type=".(!empty($this->localtax2_type) ? "'".$this->db->escape($this->localtax2_type)."'" : "'0'").","; $sql .= " fk_user=".$user->id.","; + $sql .= " price_label=".(isset($this->price_label) ? "'".$this->db->escape($this->price_label)."'" : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= " WHERE rowid=".((int) $this->id); @@ -860,6 +879,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpriceupd->price_base_type = $this->price_base_type; $prodsocpriceupd->tva_tx = $this->tva_tx; $prodsocpriceupd->recuperableonly = $this->recuperableonly; + $prodsocpriceupd->price_label = $this->price_label; $resultupd = $prodsocpriceupd->update($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -878,6 +898,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpricenew->price_base_type = $this->price_base_type; $prodsocpricenew->tva_tx = $this->tva_tx; $prodsocpricenew->recuperableonly = $this->recuperableonly; + $prodsocpricenew->price_label = $this->price_label; $resultupd = $prodsocpricenew->create($user, 0, $forceupdateaffiliate); if ($resultupd < 0) { @@ -1023,6 +1044,7 @@ class ProductCustomerPrice extends CommonObject $this->localtax1_tx = ''; $this->localtax2_tx = ''; $this->fk_user = 0; + $this->price_label = ''; $this->import_key = ''; } } @@ -1075,6 +1097,7 @@ class PriceByCustomerLine * @var int User ID */ public $fk_user; + public $price_label; public $import_key; public $socname; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index ee636b4efcb..e915e3aa46a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -123,6 +123,8 @@ if (empty($reshook)) { if (($action == 'update_vat') && !$cancel && ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'))) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); + // We must define tva_tx, npr and local taxes $tva_tx = $tva_tx_txt; $reg = array(); @@ -190,6 +192,7 @@ if (empty($reshook)) { $object->localtax2_tx = $localtax2; $object->localtax1_type = $localtax1_type; $object->localtax2_type = $localtax2_type; + $object->price_label = $price_label; $db->begin(); @@ -216,7 +219,7 @@ if (empty($reshook)) { //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them. $level = $i; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -238,7 +241,7 @@ if (empty($reshook)) { //$localtaxarray=array('0'=>$localtax1_type,'1'=>$localtax1,'2'=>$localtax2_type,'3'=>$localtax2); $localtaxarray = array(); // We do not store localtaxes into product, we will use instead the "vat code" to retrieve them when required. $level = 0; - $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode); + $ret = $object->updatePrice($oldprice, $oldpricebasetype, $user, $tva_tx, $oldminprice, $level, $oldnpr, 0, 0, $localtaxarray, $vatratecode, $price_label); if ($ret < 0) { $error++; @@ -382,6 +385,7 @@ if (empty($reshook)) { $newprice_min = price2num(GETPOST('price_min', 'alpha'), '', 2); $newpricebase = GETPOST('price_base_type', 'alpha'); $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' + $price_label = GETPOST('price_label', 'alpha'); $tva_tx = $tva_tx_txt; $vatratecode = ''; @@ -447,6 +451,7 @@ if (empty($reshook)) { $pricestoupdate[0] = array( 'price' => $newprice, + 'price_label' => $price_label, 'price_min' => $newprice_min, 'price_base_type' => $newpricebase, 'default_vat_code' => $vatratecode, @@ -478,7 +483,7 @@ if (empty($reshook)) { // If price has changed, we update it if (!array_key_exists($key, $object->multiprices) || $object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type'] || $object->multiprices_tva_tx[$key] != $newvattx) { - $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); + $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code'], $val['price_label']); } else { $res = 0; } @@ -638,6 +643,7 @@ if (empty($reshook)) { $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx", 'alpha'); @@ -761,6 +767,7 @@ if (empty($reshook)) { $prodcustprice->price = price2num(GETPOST("price"), 'MU'); $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); + $prodcustprice->price_label = GETPOST("price_label", 'alpha'); $tva_tx_txt = GETPOST("tva_tx"); @@ -1234,7 +1241,11 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUS print ' - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . ''; } } + print ''; + // Price Label + print ''.$langs->trans("PriceLabel").''; + print $object->price_label; print ''; // Price by quantity @@ -1521,6 +1532,14 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''; print ''; + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -1661,6 +1680,7 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau $sql = "SELECT p.rowid, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.recuperableonly, p.localtax1_tx, p.localtax1_type, p.localtax2_tx, p.localtax2_type,"; $sql .= " p.price_level, p.price_min, p.price_min_ttc,p.price_by_qty,"; $sql .= " p.date_price as dp, p.fk_price_expression, u.rowid as user_id, u.login"; + $sql .= " ,p.price_label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price as p,"; $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE fk_product = ".((int) $object->id); @@ -1867,6 +1887,11 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau } print ''; + // Price Label + print ''; + print $objp->price_label; + print ''; + // User print ''; if ($objp->user_id > 0) { @@ -1876,6 +1901,7 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau } print ''; + // Action if ($user->hasRight('produit', 'supprimer')) { $candelete = 0; @@ -2012,6 +2038,14 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''; + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + print ''; print ''; @@ -2099,6 +2133,16 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''; + + + // Price Label + print ''; + print $langs->trans('PriceLabel'); + print ''; + print ''; + print ''; + print ''; + print ''; @@ -2161,6 +2205,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''.$langs->trans("MinPrice").' '.$langs->trans("HT").''; print ''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''; + print ''.$langs->trans("PriceLabel").''; print ''.$langs->trans("ChangedBy").''; print ' '; print ''; @@ -2225,6 +2270,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; + print ''.$line->price_label.''; // User $userstatic = new User($db); @@ -2297,6 +2343,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { } print ''.$langs->trans("MinPrice").' '.$langs->trans("HT").''; print ''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''; + print ''.$langs->trans("PriceLabel").''; print ''.$langs->trans("ChangedBy").''; print ''; print ''; @@ -2356,6 +2403,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''.price($object->price_min).''; print ''.price($object->price_min_ttc).''; + print ''.$object->price_label.''; print ''; print ''; if ($user->hasRight('produit', 'supprimer') || $user->hasRight('service', 'supprimer')) { @@ -2434,6 +2482,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; + print ''.$line->price_label.''; // User $userstatic = new User($db); From 5cdf7c73b1ee38c836a30e6ec12be06ce7b95b1d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Mar 2024 09:22:46 +0100 Subject: [PATCH 2/3] NEW: Label on Price fix:#28544 --- htdocs/product/price.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 8c0acb88b58..40bbfdecd51 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1760,6 +1760,7 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau } print ''.$langs->trans("MinPrice").' '.$langs->trans("HT").''; print ''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''; + print ''.$langs->trans("Label").''; print ''.$langs->trans("ChangedBy").''; if ($user->hasRight('produit', 'supprimer')) { print ' '; @@ -2318,7 +2319,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { print ''."\n"; if (count($prodcustprice->lines) > 0 || $search_soc) { - $colspan = 9; + $colspan = 10; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { $colspan++; } From 09e75b6c901608dd5bf93848e654fdb39d194524 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Mar 2024 09:24:45 +0100 Subject: [PATCH 3/3] NEW: Label on Price fix:#28544 --- htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 93bf150de17..dbdc58acdcb 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -437,3 +437,4 @@ AllowStockMovementVariantParent=Also records stock movements on parent products AllowStockMovementVariantParentHelp=By default, a parent of a variant is a virtual product, so no stock is managed for it. By enabling this option, a stock will be managed for parent products and each time a stock quantity is modified for a variant product, the same quantity will be modified for the parent product. You should not need this option, except if you are using variant to manage the same product than parent (but with different descriptions, prices...) ConfirmSetToDraftInventory=Are you sure you want to go back to Draft status?
The quantities currently set in the inventory will be reset. WarningLineProductNotToSell=Product or service "%s" is not to sell and was cloned +PriceLabel=Price label diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index b794cbde418..a939cc392ba 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -436,3 +436,4 @@ WarningConvertFromBatchToSerial=Si vous disposez actuellement d'une quantité su AllowStockMovementVariantParent=Enregistre également les mouvements de stock sur les produits parent des produits variants AllowStockMovementVariantParentHelp=Par défaut, un parent d'une variante est un produit virtuel, donc aucun stock n'est géré pour celui-ci. En activant cette option, un stock sera géré pour les produits parents et à chaque fois qu'une quantité de stock est modifiée pour une variante de produit, la même quantité sera modifiée pour le produit parent. Vous ne devriez pas avoir besoin de cette option, sauf si vous utilisez une variante pour gérer le même produit que le parent (mais avec des descriptions, des prix différents...) ConfirmSetToDraftInventory=Êtes-vous sûr de vouloir revenir à l'état de brouillon ?
Les quantités actuellement définies dans l'inventaire seront réinitialisées. +PriceLabel=Libellé du prix