forked from Wavyzz/dolibarr
Corrections
This commit is contained in:
@@ -1549,7 +1549,7 @@ class Propal extends CommonObject
|
|||||||
if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
|
if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
|
||||||
$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
|
$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
|
||||||
}
|
}
|
||||||
$remise_percent = $custprice_line->remise_percent;
|
$remise_percent = $custprice_line->discount_percent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2995,8 +2995,8 @@ class Form
|
|||||||
//Price by customer
|
//Price by customer
|
||||||
if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
|
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.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';
|
$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, custremise_percent";
|
$selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref, custdiscount_percent";
|
||||||
}
|
}
|
||||||
// Units
|
// Units
|
||||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||||
@@ -3601,7 +3601,7 @@ class Form
|
|||||||
$outpricebasetype = $objp->custprice_base_type;
|
$outpricebasetype = $objp->custprice_base_type;
|
||||||
$outtva_tx = $objp->custtva_tx;
|
$outtva_tx = $objp->custtva_tx;
|
||||||
$outdefault_vat_code = $objp->custdefault_vat_code;
|
$outdefault_vat_code = $objp->custdefault_vat_code;
|
||||||
$outdiscount = $objp->custremise_percent;
|
$outdiscount = $objp->custdiscount_percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ class modProduct extends DolibarrModules
|
|||||||
'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC",
|
'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC",
|
||||||
'pr.tva_tx' => 'PriceVATRate',
|
'pr.tva_tx' => 'PriceVATRate',
|
||||||
'pr.default_vat_code' => 'PriceVATCode',
|
'pr.default_vat_code' => 'PriceVATCode',
|
||||||
'pr.remise_percent' => 'Discount',
|
'pr.discount_percent' => 'Discount',
|
||||||
'pr.datec' => 'DateCreation');
|
'pr.datec' => 'DateCreation');
|
||||||
if (is_object($mysoc) && $usenpr) {
|
if (is_object($mysoc) && $usenpr) {
|
||||||
$this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR';
|
$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.price_min' => "product", 'pr.price_min_ttc' => "product",
|
||||||
'pr.tva_tx' => 'product',
|
'pr.tva_tx' => 'product',
|
||||||
'pr.default_vat_code' => 'product',
|
'pr.default_vat_code' => 'product',
|
||||||
'pr.remise_percent' => 'product',
|
'pr.discount_percent' => 'product',
|
||||||
'pr.recuperableonly' => 'product',
|
'pr.recuperableonly' => 'product',
|
||||||
'pr.datec' => "product");
|
'pr.datec' => "product");
|
||||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ class modService extends DolibarrModules
|
|||||||
'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC",
|
'pr.price_min' => "MinPriceUnitPriceHT", 'pr.price_min_ttc' => "MinPriceUnitPriceTTC",
|
||||||
'pr.tva_tx' => 'PriceVATRate',
|
'pr.tva_tx' => 'PriceVATRate',
|
||||||
'pr.default_vat_code' => 'PriceVATCode',
|
'pr.default_vat_code' => 'PriceVATCode',
|
||||||
'pr.remise_percent' => 'Discount',
|
'pr.discount_percent' => 'Discount',
|
||||||
'pr.datec' => 'DateCreation');
|
'pr.datec' => 'DateCreation');
|
||||||
if (is_object($mysoc) && $usenpr) {
|
if (is_object($mysoc) && $usenpr) {
|
||||||
$this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR';
|
$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.price_min' => "product", 'pr.price_min_ttc' => "product",
|
||||||
'pr.tva_tx' => 'product',
|
'pr.tva_tx' => 'product',
|
||||||
'pr.default_vat_code' => 'product',
|
'pr.default_vat_code' => 'product',
|
||||||
'pr.remise_percent' => 'product',
|
'pr.discount_percent' => 'product',
|
||||||
'pr.recuperableonly' => 'product',
|
'pr.recuperableonly' => 'product',
|
||||||
'pr.datec' => "product");
|
'pr.datec' => "product");
|
||||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ if ($action == 'fetch' && !empty($id)) {
|
|||||||
$outtva_tx_formated = price($custprice_line->tva_tx);
|
$outtva_tx_formated = price($custprice_line->tva_tx);
|
||||||
$outtva_tx = price2num($custprice_line->tva_tx);
|
$outtva_tx = price2num($custprice_line->tva_tx);
|
||||||
$outdefault_vat_code = $custprice_line->default_vat_code;
|
$outdefault_vat_code = $custprice_line->default_vat_code;
|
||||||
$outdiscount = $custprice_line->remise_percent;
|
$outdiscount = $custprice_line->discount_percent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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' => 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_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'),
|
'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'),
|
'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|''
|
* @var float|string|''
|
||||||
*/
|
*/
|
||||||
public $remise_percent;
|
public $discount_percent;
|
||||||
/**
|
/**
|
||||||
* @var string|int
|
* @var string|int
|
||||||
*/
|
*/
|
||||||
@@ -226,8 +226,8 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
if (isset($this->localtax2_tx)) {
|
if (isset($this->localtax2_tx)) {
|
||||||
$this->localtax2_tx = trim($this->localtax2_tx);
|
$this->localtax2_tx = trim($this->localtax2_tx);
|
||||||
}
|
}
|
||||||
if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) {
|
if (empty($this->discount_percent) || !is_numeric($this->discount_percent)) {
|
||||||
$this->remise_percent = 0;
|
$this->discount_percent = 0;
|
||||||
}
|
}
|
||||||
if (isset($this->fk_user)) {
|
if (isset($this->fk_user)) {
|
||||||
$this->fk_user = (int) $this->fk_user;
|
$this->fk_user = (int) $this->fk_user;
|
||||||
@@ -295,7 +295,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= "localtax1_tx,";
|
$sql .= "localtax1_tx,";
|
||||||
$sql .= "localtax2_type,";
|
$sql .= "localtax2_type,";
|
||||||
$sql .= "localtax2_tx,";
|
$sql .= "localtax2_tx,";
|
||||||
$sql .= "remise_percent,";
|
$sql .= "discount_percent,";
|
||||||
$sql .= "date_begin,";
|
$sql .= "date_begin,";
|
||||||
$sql .= "date_end,";
|
$sql .= "date_end,";
|
||||||
$sql .= "fk_user,";
|
$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 .= " ".(!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 .= " ".(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 .= " ".(!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 .= " '".$this->db->idate(empty($this->date_begin) ? $now : $this->date_begin)."',";
|
||||||
$sql .= " ".(empty($this->date_end) ? 'NULL' : "'".$this->db->idate($this->date_end)."'").",";
|
$sql .= " ".(empty($this->date_end) ? 'NULL' : "'".$this->db->idate($this->date_end)."'").",";
|
||||||
$sql .= " ".((int) $user->id).",";
|
$sql .= " ".((int) $user->id).",";
|
||||||
@@ -396,7 +396,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= " t.recuperableonly,";
|
$sql .= " t.recuperableonly,";
|
||||||
$sql .= " t.localtax1_tx,";
|
$sql .= " t.localtax1_tx,";
|
||||||
$sql .= " t.localtax2_tx,";
|
$sql .= " t.localtax2_tx,";
|
||||||
$sql .= " t.remise_percent,";
|
$sql .= " t.discount_percent,";
|
||||||
$sql .= " t.date_begin,";
|
$sql .= " t.date_begin,";
|
||||||
$sql .= " t.date_end,";
|
$sql .= " t.date_end,";
|
||||||
$sql .= " t.fk_user,";
|
$sql .= " t.fk_user,";
|
||||||
@@ -429,7 +429,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$this->recuperableonly = $obj->recuperableonly;
|
$this->recuperableonly = $obj->recuperableonly;
|
||||||
$this->localtax1_tx = $obj->localtax1_tx;
|
$this->localtax1_tx = $obj->localtax1_tx;
|
||||||
$this->localtax2_tx = $obj->localtax2_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_begin = $this->db->jdate($obj->date_begin);
|
||||||
$this->date_end = $this->db->jdate($obj->date_end);
|
$this->date_end = $this->db->jdate($obj->date_end);
|
||||||
$this->fk_user = $obj->fk_user;
|
$this->fk_user = $obj->fk_user;
|
||||||
@@ -490,7 +490,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= " t.localtax2_tx,";
|
$sql .= " t.localtax2_tx,";
|
||||||
$sql .= " t.localtax1_type,";
|
$sql .= " t.localtax1_type,";
|
||||||
$sql .= " t.localtax2_type,";
|
$sql .= " t.localtax2_type,";
|
||||||
$sql .= " t.remise_percent,";
|
$sql .= " t.discount_percent,";
|
||||||
$sql .= " t.date_begin,";
|
$sql .= " t.date_begin,";
|
||||||
$sql .= " t.date_end,";
|
$sql .= " t.date_end,";
|
||||||
$sql .= " t.fk_user,";
|
$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))."%'";
|
$sql .= " AND ".$this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
|
||||||
} elseif ($key == 'prod.ref' || $key == 'prod.label') {
|
} elseif ($key == 'prod.ref' || $key == 'prod.label') {
|
||||||
$sql .= " AND ".$this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
|
$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));
|
$sql .= " AND ".$this->db->sanitize($key)." = ".((float) price2num($value));
|
||||||
} else {
|
} else {
|
||||||
$sql .= " AND ".$this->db->sanitize($key)." = ".((int) $value);
|
$sql .= " AND ".$this->db->sanitize($key)." = ".((int) $value);
|
||||||
@@ -570,7 +570,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$line->localtax2_tx = $obj->localtax2_tx;
|
$line->localtax2_tx = $obj->localtax2_tx;
|
||||||
$line->localtax1_type = $obj->localtax1_type;
|
$line->localtax1_type = $obj->localtax1_type;
|
||||||
$line->localtax2_type = $obj->localtax2_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_begin = $this->db->jdate($obj->date_begin);
|
||||||
$line->date_end = $this->db->jdate($obj->date_end);
|
$line->date_end = $this->db->jdate($obj->date_end);
|
||||||
$line->fk_user = $obj->fk_user;
|
$line->fk_user = $obj->fk_user;
|
||||||
@@ -626,7 +626,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= " t.recuperableonly,";
|
$sql .= " t.recuperableonly,";
|
||||||
$sql .= " t.localtax1_tx,";
|
$sql .= " t.localtax1_tx,";
|
||||||
$sql .= " t.localtax2_tx,";
|
$sql .= " t.localtax2_tx,";
|
||||||
$sql .= " t.remise_percent,";
|
$sql .= " t.discount_percent,";
|
||||||
$sql .= " t.date_begin,";
|
$sql .= " t.date_begin,";
|
||||||
$sql .= " t.date_end,";
|
$sql .= " t.date_end,";
|
||||||
$sql .= " t.fk_user,";
|
$sql .= " t.fk_user,";
|
||||||
@@ -685,7 +685,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$line->recuperableonly = $obj->recuperableonly;
|
$line->recuperableonly = $obj->recuperableonly;
|
||||||
$line->localtax1_tx = $obj->localtax1_tx;
|
$line->localtax1_tx = $obj->localtax1_tx;
|
||||||
$line->localtax2_tx = $obj->localtax2_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_begin = $this->db->jdate($obj->date_begin);
|
||||||
$line->date_end = $this->db->jdate($obj->date_end);
|
$line->date_end = $this->db->jdate($obj->date_end);
|
||||||
$line->fk_user = $obj->fk_user;
|
$line->fk_user = $obj->fk_user;
|
||||||
@@ -759,8 +759,8 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
if (isset($this->localtax2_tx)) {
|
if (isset($this->localtax2_tx)) {
|
||||||
$this->localtax2_tx = trim((string) $this->localtax2_tx);
|
$this->localtax2_tx = trim((string) $this->localtax2_tx);
|
||||||
}
|
}
|
||||||
if (empty($this->remise_percent) || !is_numeric($this->remise_percent)) {
|
if (empty($this->discount_percent) || !is_numeric($this->discount_percent)) {
|
||||||
$this->remise_percent = 0;
|
$this->discount_percent = 0;
|
||||||
}
|
}
|
||||||
if (isset($this->fk_user)) {
|
if (isset($this->fk_user)) {
|
||||||
$this->fk_user = (int) $this->fk_user;
|
$this->fk_user = (int) $this->fk_user;
|
||||||
@@ -828,7 +828,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= "localtax2_tx,";
|
$sql .= "localtax2_tx,";
|
||||||
$sql .= "localtax1_type,";
|
$sql .= "localtax1_type,";
|
||||||
$sql .= "localtax2_type,";
|
$sql .= "localtax2_type,";
|
||||||
$sql .= "remise_percent,";
|
$sql .= "discount_percent,";
|
||||||
$sql .= "date_begin,";
|
$sql .= "date_begin,";
|
||||||
$sql .= "date_end,";
|
$sql .= "date_end,";
|
||||||
$sql .= "fk_user,";
|
$sql .= "fk_user,";
|
||||||
@@ -855,7 +855,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$sql .= " t.localtax2_tx,";
|
$sql .= " t.localtax2_tx,";
|
||||||
$sql .= " t.localtax1_type,";
|
$sql .= " t.localtax1_type,";
|
||||||
$sql .= " t.localtax2_type,";
|
$sql .= " t.localtax2_type,";
|
||||||
$sql .= " t.remise_percent,";
|
$sql .= " t.discount_percent,";
|
||||||
$sql .= " t.date_begin,";
|
$sql .= " t.date_begin,";
|
||||||
$sql .= " t.date_end,";
|
$sql .= " t.date_end,";
|
||||||
$sql .= " t.fk_user,";
|
$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 .= " 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 .= " 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 .= " 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_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 .= " date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").",";
|
||||||
$sql .= " fk_user=".((int) $user->id).",";
|
$sql .= " fk_user=".((int) $user->id).",";
|
||||||
@@ -996,7 +996,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$prodsocpriceupd->tva_tx = $this->tva_tx;
|
$prodsocpriceupd->tva_tx = $this->tva_tx;
|
||||||
$prodsocpriceupd->recuperableonly = $this->recuperableonly;
|
$prodsocpriceupd->recuperableonly = $this->recuperableonly;
|
||||||
$prodsocpriceupd->price_label = $this->price_label;
|
$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_begin = $this->date_begin;
|
||||||
$prodsocpriceupd->date_end = $this->date_end;
|
$prodsocpriceupd->date_end = $this->date_end;
|
||||||
|
|
||||||
@@ -1018,7 +1018,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$prodsocpricenew->tva_tx = $this->tva_tx;
|
$prodsocpricenew->tva_tx = $this->tva_tx;
|
||||||
$prodsocpricenew->recuperableonly = $this->recuperableonly;
|
$prodsocpricenew->recuperableonly = $this->recuperableonly;
|
||||||
$prodsocpricenew->price_label = $this->price_label;
|
$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_begin = $this->date_begin;
|
||||||
$prodsocpricenew->date_end = $this->date_end;
|
$prodsocpricenew->date_end = $this->date_end;
|
||||||
|
|
||||||
@@ -1165,7 +1165,7 @@ class ProductCustomerPrice extends CommonObject
|
|||||||
$this->recuperableonly = '';
|
$this->recuperableonly = '';
|
||||||
$this->localtax1_tx = '';
|
$this->localtax1_tx = '';
|
||||||
$this->localtax2_tx = '';
|
$this->localtax2_tx = '';
|
||||||
$this->remise_percent = '';
|
$this->discount_percent = '';
|
||||||
$this->date_begin = '';
|
$this->date_begin = '';
|
||||||
$this->date_end = '';
|
$this->date_end = '';
|
||||||
$this->fk_user = 0;
|
$this->fk_user = 0;
|
||||||
@@ -1254,7 +1254,7 @@ class PriceByCustomerLine extends CommonObjectLine
|
|||||||
/**
|
/**
|
||||||
* @var float|string|''
|
* @var float|string|''
|
||||||
*/
|
*/
|
||||||
public $remise_percent;
|
public $discount_percent;
|
||||||
/**
|
/**
|
||||||
* @var string|int
|
* @var string|int
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -754,7 +754,7 @@ if (empty($reshook)) {
|
|||||||
$prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU');
|
$prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU');
|
||||||
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
|
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
|
||||||
$prodcustprice->price_label = GETPOST("price_label", '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_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
|
$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_min = price2num(GETPOST("price_min"), 'MU');
|
||||||
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
|
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
|
||||||
$prodcustprice->price_label = GETPOST("price_label", '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_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
|
$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 '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Discount
|
// Discount
|
||||||
$remise_percent = price2num(GETPOST("remise_percent"));
|
$discount_percent = price2num(GETPOST("discount_percent"));
|
||||||
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
||||||
print '<input name="remise_percent" size="10" value="'.price($remise_percent).'">';
|
print '<input name="discount_percent" size="10" value="'.price($discount_percent).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
@@ -2245,7 +2245,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
|
|
||||||
// Discount
|
// Discount
|
||||||
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
||||||
print '<input name="remise_percent" size="10" value="'.price($prodcustprice->remise_percent).'">';
|
print '<input name="discount_percent" size="10" value="'.price($prodcustprice->discount_percent).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
@@ -2434,7 +2434,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
print '<td class="right">'.price($line->price_min).'</td>';
|
print '<td class="right">'.price($line->price_min).'</td>';
|
||||||
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
||||||
print '<td class="right">'.$line->price_label.'</td>';
|
print '<td class="right">'.$line->price_label.'</td>';
|
||||||
print '<td class="right">'.price($line->remise_percent).'</td>';
|
print '<td class="right">'.price($line->discount_percent).'</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
@@ -2693,7 +2693,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
print '<td class="right">'.price($line->price_min).'</td>';
|
print '<td class="right">'.price($line->price_min).'</td>';
|
||||||
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
||||||
print '<td class="right">'.$line->price_label.'</td>';
|
print '<td class="right">'.$line->price_label.'</td>';
|
||||||
print '<td class="right">'.price($line->remise_percent).'</td>';
|
print '<td class="right">'.price($line->discount_percent).'</td>';
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extrafields->fetch_name_optionals_label("product_customer_price");
|
$extrafields->fetch_name_optionals_label("product_customer_price");
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ if (empty($reshook)) {
|
|||||||
$prodcustprice->price = price2num(GETPOST("price"), 'MU');
|
$prodcustprice->price = price2num(GETPOST("price"), 'MU');
|
||||||
$prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU');
|
$prodcustprice->price_min = price2num(GETPOST("price_min"), 'MU');
|
||||||
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
|
$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_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
|
$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->price_base_type = GETPOST("price_base_type", 'alpha');
|
||||||
$prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx"));
|
$prodcustprice->tva_tx = str_replace('*', '', GETPOST("tva_tx"));
|
||||||
$prodcustprice->recuperableonly = (preg_match('/\*/', GETPOST("tva_tx")) ? 1 : 0);
|
$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_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
|
$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 '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Discount
|
// Discount
|
||||||
$remise_percent = price2num(GETPOST("remise_percent"));
|
$discount_percent = price2num(GETPOST("discount_percent"));
|
||||||
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
||||||
print '<input name="remise_percent" size="10" value="'.price($remise_percent).'">';
|
print '<input name="discount_percent" size="10" value="'.price($discount_percent).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Update all child soc
|
// Update all child soc
|
||||||
@@ -543,7 +543,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
|
|
||||||
// Discount
|
// Discount
|
||||||
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
print '<tr><td>'.$langs->trans("Discount").'</td><td>';
|
||||||
print '<input name="remise_percent" size="10" value="'.price($prodcustprice->remise_percent).'">';
|
print '<input name="discount_percent" size="10" value="'.price($prodcustprice->discount_percent).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
@@ -681,7 +681,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
print '<td class="right">'.price($line->price_ttc)."</td>";
|
print '<td class="right">'.price($line->price_ttc)."</td>";
|
||||||
print '<td class="right">'.price($line->price_min).'</td>';
|
print '<td class="right">'.price($line->price_min).'</td>';
|
||||||
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
print '<td class="right">'.price($line->price_min_ttc).'</td>';
|
||||||
print '<td class="right">'.price($line->remise_percent).'</td>';
|
print '<td class="right">'.price($line->discount_percent).'</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
@@ -873,7 +873,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
|
|||||||
print '<td class="left">'.price($line->price_min).'</td>';
|
print '<td class="left">'.price($line->price_min).'</td>';
|
||||||
print '<td class="left">'.price($line->price_min_ttc).'</td>';
|
print '<td class="left">'.price($line->price_min_ttc).'</td>';
|
||||||
print '<td class="left">'.$line->price_label.'</td>';
|
print '<td class="left">'.$line->price_label.'</td>';
|
||||||
print '<td class="left">'.price($line->remise_percent).'</td>';
|
print '<td class="left">'.price($line->discount_percent).'</td>';
|
||||||
// User
|
// User
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print $userstatic->getNomUrl(-1);
|
print $userstatic->getNomUrl(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user