Fix CI-PULL-REQUEST / pre-commit / pre-commit (pull_request)

This commit is contained in:
Kamel Khelifa 2025-02-25 15:55:58 +01:00
parent 4d2ad0aadf
commit aaae4e7bc6
3 changed files with 16 additions and 16 deletions

View file

@ -143,11 +143,11 @@ class ProductCustomerPrice extends CommonObject
*/
public $remise_percent;
/**
* @var string
* @var string|int
*/
public $date_begin = '';
/**
* @var string
* @var string|int
*/
public $date_end = '';
@ -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=".(isset($this->remise_percent) ? price2num($this->remise_percent) : "null").",";
$sql .= " remise_percent=".(!empty($this->remise_percent) ? "'".price2num($this->remise_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).",";
@ -1252,7 +1252,7 @@ class PriceByCustomerLine extends CommonObjectLine
*/
public $localtax2_tx;
/**
* @var float
* @var float|string|''
*/
public $remise_percent;
/**

View file

@ -755,8 +755,8 @@ if (empty($reshook)) {
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
$prodcustprice->price_label = GETPOST("price_label", 'alpha');
$prodcustprice->remise_percent = price2num(GETPOST("remise_percent"));
$prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), '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
$extralabels = $extrafields->fetch_name_optionals_label("product_customer_price");
$extrafield_values = $extrafields->getOptionalsFromPost("product_customer_price");
@ -910,8 +910,8 @@ if (empty($reshook)) {
$prodcustprice->price_base_type = GETPOST("price_base_type", 'alpha');
$prodcustprice->price_label = GETPOST("price_label", 'alpha');
$prodcustprice->remise_percent = price2num(GETPOST("remise_percent"));
$prodcustprice->date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), '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
$extralabels = $extrafields->fetch_name_optionals_label("product_customer_price");
$extrafield_values = $extrafields->getOptionalsFromPost("product_customer_price");
@ -2049,13 +2049,13 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
print '<td><input name="ref_customer" size="12"></td></tr>';
// Applied Prices From
$date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$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;
print '<tr><td>'.$langs->trans("AppliedPricesFrom").'</td><td>';
print $form->selectDate(!empty($date_begin) ? $date_begin : dol_now(), "date_begin", 0, 0, 1, "date_begin");
print '</td></tr>';
// Applied Prices To
$date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
$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
print '<tr><td>'.$langs->trans("AppliedPricesTo").'</td><td>';
print $form->selectDate($date_end, "date_end", 0, 0, 1, "date_end");
print '</td></tr>';

View file

@ -116,8 +116,8 @@ if (empty($reshook)) {
$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->date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), '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
$tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)'
@ -217,8 +217,8 @@ if (empty($reshook)) {
$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->date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$prodcustprice->date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), '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
$result = $prodcustprice->update($user, 0, $update_child_soc);
if ($result > 0) {
@ -383,13 +383,13 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT
print '<td><input name="ref_customer" size="12"></td></tr>';
// Applied Prices From
$date_begin = dol_mktime(0, 0, 0, GETPOST('date_beginmonth', 'int'), GETPOST('date_beginday', 'int'), GETPOST('date_beginyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server;
$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;
print '<tr><td>'.$langs->trans("AppliedPricesFrom").'</td><td>';
print $form->selectDate(!empty($date_begin) ? $date_begin : dol_now(), "date_begin", 0, 0, 1, "date_begin");
print '</td></tr>';
// Applied Prices To
$date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
$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
print '<tr><td>'.$langs->trans("AppliedPricesTo").'</td><td>';
print $form->selectDate($date_end, "date_end", 0, 0, 1, "date_end");
print '</td></tr>';