diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ab667686493..58850dc9ca8 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1549,7 +1549,7 @@ class Propal extends CommonObject if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { $tva_tx .= ' (' . $custprice_line->default_vat_code . ')'; } - $remise_percent = $custprice_line->remise_percent; + $remise_percent = $custprice_line->discount_percent; break; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b7efd69ea7c..e7670d09d31 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2995,8 +2995,8 @@ class Form //Price by customer if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { $sql .= ', pcp.rowid as idprodcustprice, pcp.price as custprice, pcp.price_ttc as custprice_ttc,'; - $sql .= ' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx, pcp.default_vat_code as custdefault_vat_code, pcp.ref_customer as custref, pcp.remise_percent as custremise_percent'; - $selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref, custremise_percent"; + $sql .= ' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx, pcp.default_vat_code as custdefault_vat_code, pcp.ref_customer as custref, pcp.remise_percent as custdiscount_percent'; + $selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref, custdiscount_percent"; } // Units if (getDolGlobalInt('PRODUCT_USE_UNITS')) { @@ -3601,7 +3601,7 @@ class Form $outpricebasetype = $objp->custprice_base_type; $outtva_tx = $objp->custtva_tx; $outdefault_vat_code = $objp->custdefault_vat_code; - $outdiscount = $objp->custremise_percent; + $outdiscount = $objp->custdiscount_percent; } } diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index cad7f5490de..418e1eb3741 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -387,7 +387,7 @@ class modProduct extends DolibarrModules 'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC", 'pr.tva_tx' => 'PriceVATRate', 'pr.default_vat_code' => 'PriceVATCode', - 'pr.remise_percent' => 'Discount', + 'pr.discount_percent' => 'Discount', 'pr.datec' => 'DateCreation'); if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR'; @@ -402,7 +402,7 @@ class modProduct extends DolibarrModules 'pr.price_min' => "product", 'pr.price_min_ttc' => "product", 'pr.tva_tx' => 'product', 'pr.default_vat_code' => 'product', - 'pr.remise_percent' => 'product', + 'pr.discount_percent' => 'product', 'pr.recuperableonly' => 'product', 'pr.datec' => "product"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 4335b25638a..7303794e127 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -334,7 +334,7 @@ class modService extends DolibarrModules 'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC", 'pr.tva_tx' => 'PriceVATRate', 'pr.default_vat_code' => 'PriceVATCode', - 'pr.remise_percent' => 'Discount', + 'pr.discount_percent' => 'Discount', 'pr.datec' => 'DateCreation'); if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR'; @@ -348,7 +348,7 @@ class modService extends DolibarrModules 'pr.price_min' => "product", 'pr.price_min_ttc' => "product", 'pr.tva_tx' => 'product', 'pr.default_vat_code' => 'product', - 'pr.remise_percent' => 'product', + 'pr.discount_percent' => 'product', 'pr.recuperableonly' => 'product', 'pr.datec' => "product"); $this->export_sql_start[$r] = 'SELECT DISTINCT '; diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 71caa109c1e..85e9a6fcfc5 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -230,7 +230,7 @@ if ($action == 'fetch' && !empty($id)) { $outtva_tx_formated = price($custprice_line->tva_tx); $outtva_tx = price2num($custprice_line->tva_tx); $outdefault_vat_code = $custprice_line->default_vat_code; - $outdiscount = $custprice_line->remise_percent; + $outdiscount = $custprice_line->discount_percent; break; } } diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 412e4c8121e..c0c02e12879 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -47,7 +47,7 @@ class ProductCustomerPrice extends CommonObject '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'), - 'remise_percent' => array('type' => 'decimal(20,6)', 'label' => 'Discount', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => -1, 'comment' => 'Discount'), + 'discount_percent' => array('type' => 'decimal(20,6)', 'label' => 'Discount', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'notnull' => -1, 'comment' => 'Discount'), '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'), ); @@ -141,7 +141,7 @@ class ProductCustomerPrice extends CommonObject /** * @var float|string|'' */ - public $remise_percent; + public $discount_percent; /** * @var string|int */ @@ -226,8 +226,8 @@ class ProductCustomerPrice extends CommonObject if (isset($this->localtax2_tx)) { $this->localtax2_tx = trim($this->localtax2_tx); } - if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) { - $this->remise_percent = 0; + if (empty($this->discount_percent) || !is_numeric($this->discount_percent)) { + $this->discount_percent = 0; } if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; @@ -295,7 +295,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax1_tx,"; $sql .= "localtax2_type,"; $sql .= "localtax2_tx,"; - $sql .= "remise_percent,"; + $sql .= "discount_percent,"; $sql .= "date_begin,"; $sql .= "date_end,"; $sql .= "fk_user,"; @@ -319,7 +319,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " ".(!isset($this->localtax1_tx) ? 'NULL' : (empty($this->localtax1_tx) ? 0 : $this->localtax1_tx)).","; $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 .= " ".(empty($this->remise_percent) ? '0' : "'".$this->db->escape(price2num($this->remise_percent))."'").","; + $sql .= " ".(empty($this->discount_percent) ? '0' : "'".$this->db->escape(price2num($this->discount_percent))."'").","; $sql .= " '".$this->db->idate(empty($this->date_begin) ? $now : $this->date_begin)."',"; $sql .= " ".(empty($this->date_end) ? 'NULL' : "'".$this->db->idate($this->date_end)."'").","; $sql .= " ".((int) $user->id).","; @@ -396,7 +396,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.recuperableonly,"; $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; - $sql .= " t.remise_percent,"; + $sql .= " t.discount_percent,"; $sql .= " t.date_begin,"; $sql .= " t.date_end,"; $sql .= " t.fk_user,"; @@ -429,7 +429,7 @@ class ProductCustomerPrice extends CommonObject $this->recuperableonly = $obj->recuperableonly; $this->localtax1_tx = $obj->localtax1_tx; $this->localtax2_tx = $obj->localtax2_tx; - $this->remise_percent = $obj->remise_percent; + $this->discount_percent = $obj->discount_percent; $this->date_begin = $this->db->jdate($obj->date_begin); $this->date_end = $this->db->jdate($obj->date_end); $this->fk_user = $obj->fk_user; @@ -490,7 +490,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax2_tx,"; $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; - $sql .= " t.remise_percent,"; + $sql .= " t.discount_percent,"; $sql .= " t.date_begin,"; $sql .= " t.date_end,"; $sql .= " t.fk_user,"; @@ -516,7 +516,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " AND ".$this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'"; } elseif ($key == 'prod.ref' || $key == 'prod.label') { $sql .= " AND ".$this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'"; - } elseif ($key == 't.price' || $key == 't.price_ttc' || $key == 't.remise_percent') { + } elseif ($key == 't.price' || $key == 't.price_ttc' || $key == 't.discount_percent') { $sql .= " AND ".$this->db->sanitize($key)." = ".((float) price2num($value)); } else { $sql .= " AND ".$this->db->sanitize($key)." = ".((int) $value); @@ -570,7 +570,7 @@ class ProductCustomerPrice extends CommonObject $line->localtax2_tx = $obj->localtax2_tx; $line->localtax1_type = $obj->localtax1_type; $line->localtax2_type = $obj->localtax2_type; - $line->remise_percent = $obj->remise_percent; + $line->discount_percent = $obj->discount_percent; $line->date_begin = $this->db->jdate($obj->date_begin); $line->date_end = $this->db->jdate($obj->date_end); $line->fk_user = $obj->fk_user; @@ -626,7 +626,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.recuperableonly,"; $sql .= " t.localtax1_tx,"; $sql .= " t.localtax2_tx,"; - $sql .= " t.remise_percent,"; + $sql .= " t.discount_percent,"; $sql .= " t.date_begin,"; $sql .= " t.date_end,"; $sql .= " t.fk_user,"; @@ -685,7 +685,7 @@ class ProductCustomerPrice extends CommonObject $line->recuperableonly = $obj->recuperableonly; $line->localtax1_tx = $obj->localtax1_tx; $line->localtax2_tx = $obj->localtax2_tx; - $line->remise_percent = $obj->remise_percent; + $line->discount_percent = $obj->discount_percent; $line->date_begin = $this->db->jdate($obj->date_begin); $line->date_end = $this->db->jdate($obj->date_end); $line->fk_user = $obj->fk_user; @@ -759,8 +759,8 @@ class ProductCustomerPrice extends CommonObject if (isset($this->localtax2_tx)) { $this->localtax2_tx = trim((string) $this->localtax2_tx); } - if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) { - $this->remise_percent = 0; + if (empty($this->discount_percent) || !is_numeric($this->discount_percent)) { + $this->discount_percent = 0; } if (isset($this->fk_user)) { $this->fk_user = (int) $this->fk_user; @@ -828,7 +828,7 @@ class ProductCustomerPrice extends CommonObject $sql .= "localtax2_tx,"; $sql .= "localtax1_type,"; $sql .= "localtax2_type,"; - $sql .= "remise_percent,"; + $sql .= "discount_percent,"; $sql .= "date_begin,"; $sql .= "date_end,"; $sql .= "fk_user,"; @@ -855,7 +855,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " t.localtax2_tx,"; $sql .= " t.localtax1_type,"; $sql .= " t.localtax2_type,"; - $sql .= " t.remise_percent,"; + $sql .= " t.discount_percent,"; $sql .= " t.date_begin,"; $sql .= " t.date_end,"; $sql .= " t.fk_user,"; @@ -896,7 +896,7 @@ class ProductCustomerPrice extends CommonObject $sql .= " localtax2_tx=".(isset($this->localtax2_tx) ? (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx) : "null").","; $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 .= " remise_percent=".(!empty($this->remise_percent) ? "'".price2num($this->remise_percent)."'" : "0").","; + $sql .= " discount_percent=".(!empty($this->discount_percent) ? "'".price2num($this->discount_percent)."'" : "0").","; $sql .= " date_begin='".$this->db->idate(!empty($this->date_begin) ? $this->date_begin : $now)."',"; $sql .= " date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").","; $sql .= " fk_user=".((int) $user->id).","; @@ -996,7 +996,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpriceupd->tva_tx = $this->tva_tx; $prodsocpriceupd->recuperableonly = $this->recuperableonly; $prodsocpriceupd->price_label = $this->price_label; - $prodsocpriceupd->remise_percent = $this->remise_percent; + $prodsocpriceupd->discount_percent = $this->discount_percent; $prodsocpriceupd->date_begin = $this->date_begin; $prodsocpriceupd->date_end = $this->date_end; @@ -1018,7 +1018,7 @@ class ProductCustomerPrice extends CommonObject $prodsocpricenew->tva_tx = $this->tva_tx; $prodsocpricenew->recuperableonly = $this->recuperableonly; $prodsocpricenew->price_label = $this->price_label; - $prodsocpricenew->remise_percent = $this->remise_percent; + $prodsocpricenew->discount_percent = $this->discount_percent; $prodsocpricenew->date_begin = $this->date_begin; $prodsocpricenew->date_end = $this->date_end; @@ -1165,7 +1165,7 @@ class ProductCustomerPrice extends CommonObject $this->recuperableonly = ''; $this->localtax1_tx = ''; $this->localtax2_tx = ''; - $this->remise_percent = ''; + $this->discount_percent = ''; $this->date_begin = ''; $this->date_end = ''; $this->fk_user = 0; @@ -1254,7 +1254,7 @@ class PriceByCustomerLine extends CommonObjectLine /** * @var float|string|'' */ - public $remise_percent; + public $discount_percent; /** * @var string|int */ diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a107e7fe8e0..185d7a7ecee 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -754,7 +754,7 @@ if (empty($reshook)) { $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); $prodcustprice->price_label = GETPOST("price_label", 'alpha'); - $prodcustprice->remise_percent = price2num(GETPOST("remise_percent")); + $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server @@ -909,7 +909,7 @@ if (empty($reshook)) { $prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU'); $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); $prodcustprice->price_label = GETPOST("price_label", 'alpha'); - $prodcustprice->remise_percent = price2num(GETPOST("remise_percent")); + $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server @@ -2109,9 +2109,9 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''; // Discount - $remise_percent = price2num(GETPOST("remise_percent")); + $discount_percent = price2num(GETPOST("discount_percent")); print ''.$langs->trans("Discount").''; - print ''; + print ''; print ''; // Extrafields @@ -2245,7 +2245,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT // Discount print ''.$langs->trans("Discount").''; - print ''; + print ''; print ''; // Extrafields @@ -2434,7 +2434,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; print ''.$line->price_label.''; - print ''.price($line->remise_percent).''; + print ''.price($line->discount_percent).''; // User $userstatic = new User($db); @@ -2693,7 +2693,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; print ''.$line->price_label.''; - print ''.price($line->remise_percent).''; + print ''.price($line->discount_percent).''; // Extrafields $extrafields->fetch_name_optionals_label("product_customer_price"); diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 1b5ef669f89..c285185523c 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -115,7 +115,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->remise_percent = price2num(GETPOST("remise_percent")); + $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server @@ -216,7 +216,7 @@ if (empty($reshook)) { $prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha'); $prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx")); $prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0); - $prodcustprice->remise_percent = price2num(GETPOST("remise_percent")); + $prodcustprice->discount_percent = price2num(GETPOST("discount_percent")); $prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOSTINT('date_beginmonth'), GETPOSTINT('date_beginday'), GETPOSTINT('date_beginyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server; $prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server @@ -424,9 +424,9 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''; // Discount - $remise_percent = price2num(GETPOST("remise_percent")); + $discount_percent = price2num(GETPOST("discount_percent")); print ''.$langs->trans("Discount").''; - print ''; + print ''; print ''; // Update all child soc @@ -543,7 +543,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT // Discount print ''.$langs->trans("Discount").''; - print ''; + print ''; print ''; // Extrafields @@ -681,7 +681,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''.price($line->price_ttc).""; print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; - print ''.price($line->remise_percent).''; + print ''.price($line->discount_percent).''; // User print ''; @@ -873,7 +873,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print ''.price($line->price_min).''; print ''.price($line->price_min_ttc).''; print ''.$line->price_label.''; - print ''.price($line->remise_percent).''; + print ''.price($line->discount_percent).''; // User print ''; print $userstatic->getNomUrl(-1);