diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 90708a27b9c..e686109871f 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -428,8 +428,6 @@ if (empty($reshook)) {
$object->deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); // deprecated
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->socid = GETPOST('socid', 'int');
$object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
@@ -439,6 +437,7 @@ if (empty($reshook)) {
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml');
$object->statut = Propal::STATUS_DRAFT;
+ $object->status = Propal::STATUS_DRAFT;
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
} else {
@@ -1608,10 +1607,10 @@ if (empty($reshook)) {
} elseif ($action == 'setconditions' && $usercancreate) {
// Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
- } elseif ($action == 'setremisepercent' && $usercancreate) {
- $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
- } elseif ($action == 'setremiseabsolue' && $usercancreate) {
- $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
+ //} elseif ($action == 'setremisepercent' && $usercancreate) {
+ // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
+ //} elseif ($action == 'setremiseabsolue' && $usercancreate) {
+ // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment choice
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
@@ -1782,8 +1781,6 @@ if ($action == 'create') {
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
- $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); // deprecated
- $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
// Replicate extrafields
@@ -2070,8 +2067,8 @@ if ($action == 'create') {
// TODO for compatibility
if ($origin == 'contrat') {
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
- $objectsrc->remise_absolue = $remise_absolue; // deprecated
- $objectsrc->remise_percent = $remise_percent;
+ //$objectsrc->remise_absolue = $remise_absolue; // deprecated
+ //$objectsrc->remise_percent = $remise_percent;
$objectsrc->update_price(1, 'auto', 1);
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 74afddfb44d..5092e53a6e9 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -225,20 +225,6 @@ class Propal extends CommonObject
public $deposit_percent;
- /**
- * @deprecated
- */
- public $remise_percent;
-
- /**
- * @deprecated
- */
- public $remise;
- /**
- * @deprecated
- */
- public $remise_absolue;
-
/**
* @var int ID
* @deprecated
@@ -353,9 +339,6 @@ class Propal extends CommonObject
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user cloture', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'price' =>array('type'=>'double', 'label'=>'Price', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
- //'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
- //'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
- //'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
'total_tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
@@ -1145,9 +1128,6 @@ class Propal extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propal (";
$sql .= "fk_soc";
$sql .= ", price";
- $sql .= ", remise"; // deprecated
- $sql .= ", remise_percent"; // deprecated
- $sql .= ", remise_absolue"; // deprecated
$sql .= ", total_tva";
$sql .= ", total_ttc";
$sql .= ", datep";
@@ -1180,9 +1160,6 @@ class Propal extends CommonObject
$sql .= " VALUES (";
$sql .= $this->socid;
$sql .= ", 0";
- $sql .= ", ".((float) $this->remise); // deprecated
- $sql .= ", ".($this->remise_percent ? ((float) $this->remise_percent) : 'NULL'); // deprecated
- $sql .= ", ".($this->remise_absolue ? ((float) $this->remise_absolue) : 'NULL'); // deprecated
$sql .= ", 0";
$sql .= ", 0";
$sql .= ", '".$this->db->idate($this->date)."'";
@@ -1588,7 +1565,7 @@ class Propal extends CommonObject
*/
public function fetch($rowid, $ref = '', $ref_ext = '', $forceentity = 0)
{
- $sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
+ $sql = "SELECT p.rowid, p.ref, p.entity, p.fk_soc";
$sql .= ", p.total_ttc, p.total_tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.datec";
$sql .= ", p.date_signature as dates";
@@ -1651,9 +1628,6 @@ class Propal extends CommonObject
$this->ref_customer = $obj->ref_client;
$this->ref_ext = $obj->ref_ext;
- $this->remise = $obj->remise; // TODO deprecated
- $this->remise_percent = $obj->remise_percent; // TODO deprecated
- $this->remise_absolue = $obj->remise_absolue; // TODO deprecated
$this->total = $obj->total_ttc; // TODO deprecated
$this->total_ttc = $obj->total_ttc;
$this->total_ht = $obj->total_ht;
@@ -2563,6 +2537,7 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
*/
+ /*
public function set_remise_absolue($user, $remise, $notrigger = 0)
{
// phpcs:enable
@@ -2616,7 +2591,7 @@ class Propal extends CommonObject
return -1;
}
-
+ */
/**
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index 4da58a6bd91..b1253b3e672 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -224,7 +224,6 @@ if ($socid > 0) {
$resql = $db->query($sql);
if ($resql) {
print '
';
- $tag = !$tag;
print '';
print '| '.$langs->trans("Date").' | ';
print ''.$langs->trans("CustomerRelativeDiscountShort").' | ';
@@ -245,7 +244,7 @@ if ($socid > 0) {
$i++;
}
} else {
- print '
| '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
$db->free($resql);
print "
";
@@ -275,7 +274,6 @@ if ($socid > 0) {
$resql = $db->query($sql);
if ($resql) {
print '';
- $tag = !$tag;
print '';
print '| '.$langs->trans("Date").' | ';
print ''.$langs->trans("CustomerRelativeDiscountShort").' | ';
@@ -296,7 +294,7 @@ if ($socid > 0) {
$i++;
}
} else {
- print '
| '.$langs->trans("None").' |
';
+ print '| '.$langs->trans("None").' |
';
}
$db->free($resql);
print "
";
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 7ab04fc4fe7..5b3449ea5df 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -630,10 +630,10 @@ if (empty($reshook)) {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- } elseif ($action == 'setremisepercent' && $usercancreate) {
- $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
- } elseif ($action == 'setremiseabsolue' && $usercancreate) {
- $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
+ //} elseif ($action == 'setremisepercent' && $usercancreate) {
+ // $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
+ //} elseif ($action == 'setremiseabsolue' && $usercancreate) {
+ // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') {
// Define vat_rate
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
@@ -757,6 +757,8 @@ if (empty($reshook)) {
$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
$price_base_type = (GETPOST('price_base_type', 'alpha') ?GETPOST('price_base_type', 'alpha') : 'HT');
+ $price_min = $price_min_ttc = 0;
+
// Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit
// Ecrase $base_price_type par celui du produit
@@ -1653,7 +1655,7 @@ if ($action == 'create' && $usercancreate) {
$res = $soc->fetch($socid);
}
- $remise_absolue = 0;
+ //$remise_absolue = 0;
$currency_code = $conf->currency;
@@ -1727,8 +1729,8 @@ if ($action == 'create' && $usercancreate) {
$shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0));
$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
- $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
- $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
+ //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
+ //$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ? -1 : '';
$date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
@@ -1757,8 +1759,8 @@ if ($action == 'create' && $usercancreate) {
$shipping_method_id = $soc->shipping_method_id;
$warehouse_id = $soc->fk_warehouse;
$demand_reason_id = $soc->demand_reason_id;
- $remise_percent = $soc->remise_percent;
- $remise_absolue = 0;
+ //$remise_percent = $soc->remise_percent;
+ //$remise_absolue = 0;
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : '';
if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
@@ -2039,8 +2041,8 @@ if ($action == 'create' && $usercancreate) {
// TODO for compatibility
if ($origin == 'contrat') {
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
- $objectsrc->remise_absolue = $remise_absolue;
- $objectsrc->remise_percent = $remise_percent;
+ //$objectsrc->remise_absolue = $remise_absolue;
+ //$objectsrc->remise_percent = $remise_percent;
$objectsrc->update_price(1);
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index de0abc819de..5decf2e70d5 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -328,10 +328,6 @@ class Commande extends CommonOrder
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
- //'amount_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
- //'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
- 'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
- //'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
'total_tva' =>array('type'=>'double(24,8)', 'label'=>'VAT', 'enabled'=>1, 'visible'=>-1, 'position'=>125, 'isameasure'=>1),
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LocalTax1', 'enabled'=>1, 'visible'=>-1, 'position'=>130, 'isameasure'=>1),
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1),
@@ -340,7 +336,6 @@ class Commande extends CommonOrder
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>150),
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>160),
- //'facture' =>array('type'=>'tinyint(4)', 'label'=>'ParentInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>165),
'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>170),
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
@@ -955,7 +950,6 @@ class Commande extends CommonOrder
$sql .= ", model_pdf, fk_cond_reglement, deposit_percent, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
$sql .= ", fk_shipping_method";
$sql .= ", fk_warehouse";
- $sql .= ", remise_absolue, remise_percent";
$sql .= ", fk_incoterms, location_incoterms";
$sql .= ", entity, module_source, pos_source";
$sql .= ", fk_multicurrency";
@@ -981,8 +975,6 @@ class Commande extends CommonOrder
$sql .= ", ".($this->fk_delivery_address > 0 ? ((int) $this->fk_delivery_address) : 'NULL');
$sql .= ", ".(!empty($this->shipping_method_id) && $this->shipping_method_id > 0 ? ((int) $this->shipping_method_id) : 'NULL');
$sql .= ", ".(!empty($this->warehouse_id) && $this->warehouse_id > 0 ? ((int) $this->warehouse_id) : 'NULL');
- $sql .= ", ".($this->remise_absolue > 0 ? $this->db->escape($this->remise_absolue) : 'NULL');
- $sql .= ", ".($this->remise_percent > 0 ? $this->db->escape($this->remise_percent) : 0); // TODO deprecated
$sql .= ", ".(int) $this->fk_incoterms;
$sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ", ".setEntity($this);
@@ -1863,7 +1855,7 @@ class Commande extends CommonOrder
$sql .= ', c.date_livraison as delivery_date';
$sql .= ', c.fk_shipping_method';
$sql .= ', c.fk_warehouse';
- $sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
+ $sql .= ', c.fk_projet as fk_project, c.source, c.facture as billed';
$sql .= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams';
$sql .= ', c.fk_incoterms, c.location_incoterms';
$sql .= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc";
@@ -1930,9 +1922,6 @@ class Commande extends CommonOrder
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_validation = $this->db->jdate($obj->date_valid);
$this->date_modification = $this->db->jdate($obj->tms);
- $this->remise = $obj->remise;
- $this->remise_percent = $obj->remise_percent; // TODO deprecated
- $this->remise_absolue = $obj->remise_absolue;
$this->source = $obj->source;
$this->billed = $obj->billed;
$this->note = $obj->note_private; // deprecated
@@ -2528,6 +2517,7 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK
*/
+ /*
public function set_remise_absolue($user, $remise, $notrigger = 0)
{
// phpcs:enable
@@ -2583,7 +2573,7 @@ class Commande extends CommonOrder
return 0;
}
-
+ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index da0730be401..32dd9d686df 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -615,6 +615,7 @@ if (empty($reshook)) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
+ $object->fetch_thirdparty();
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
@@ -1046,8 +1047,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1107,8 +1108,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = 0; // No payment term for a credit note
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1331,8 +1332,8 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1418,8 +1419,8 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1963,8 +1964,8 @@ if (empty($reshook)) {
$object->fk_project = GETPOST('projectid', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
- $object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_account = GETPOST('fk_account', 'int');
@@ -3069,7 +3070,7 @@ if ($action == 'create') {
$fk_account = 0;
// Load objectsrc
- $remise_absolue = 0;
+ //$remise_absolue = 0;
if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
@@ -3148,8 +3149,8 @@ if ($action == 'create') {
$cond_reglement_id = (!empty($expesrc->cond_reglement_id) ? $expesrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 1));
$mode_reglement_id = (!empty($expesrc->mode_reglement_id) ? $expesrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
$fk_account = (!empty($expesrc->fk_account) ? $expesrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
- $remise_percent = (!empty($expesrc->remise_percent) ? $expesrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
- $remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
+ //$remise_percent = (!empty($expesrc->remise_percent) ? $expesrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
+ //$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
if (isModEnabled('multicurrency')) {
$currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
@@ -3163,8 +3164,8 @@ if ($action == 'create') {
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
$fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
- $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
- $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
+ //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
+ //$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
if (isModEnabled('multicurrency')) {
if (!empty($objectsrc->multicurrency_code)) {
@@ -3184,8 +3185,8 @@ if ($action == 'create') {
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$fk_account = $soc->fk_account;
- $remise_percent = $soc->remise_percent;
- $remise_absolue = 0;
+ //$remise_percent = $soc->remise_percent;
+ //$remise_absolue = 0;
$dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice); // Do not set 0 here (0 for a date is 1970)
if (isModEnabled('multicurrency') && !empty($soc->multicurrency_code)) {
@@ -3968,8 +3969,8 @@ if ($action == 'create') {
// TODO for compatibility
if ($origin == 'contrat') {
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
- $objectsrc->remise_absolue = $remise_absolue;
- $objectsrc->remise_percent = $remise_percent;
+ //$objectsrc->remise_absolue = $remise_absolue;
+ //$objectsrc->remise_percent = $remise_percent;
$objectsrc->update_price(1, 'auto', 1);
}
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index ad9b55d328d..ffbec6a7ad9 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -89,9 +89,9 @@ class FactureRec extends CommonInvoice
public $socid;
public $number;
public $date;
- public $remise;
- public $remise_absolue;
- public $remise_percent;
+ //public $remise;
+ //public $remise_absolue;
+ //public $remise_percent;
/**
* @deprecated
@@ -171,10 +171,6 @@ class FactureRec extends CommonInvoice
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>20, 'index'=>1),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>25),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
- //'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35),
- 'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
- //'remise_percent' =>array('type'=>'double', 'label'=>'Remise percent', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
- //'remise_absolue' =>array('type'=>'double', 'label'=>'Remise absolue', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
'total_tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>55, 'isameasure'=>1),
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'isameasure'=>1),
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'isameasure'=>1),
@@ -276,7 +272,7 @@ class FactureRec extends CommonInvoice
$sql .= ", entity";
$sql .= ", datec";
$sql .= ", amount";
- $sql .= ", remise";
+ //$sql .= ", remise";
$sql .= ", note_private";
$sql .= ", note_public";
$sql .= ", modelpdf";
@@ -304,7 +300,7 @@ class FactureRec extends CommonInvoice
$sql .= ", ".((int) $conf->entity);
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", ".(!empty($facsrc->total_ttc) ? ((float) $facsrc->total_ttc) : '0');
- $sql .= ", ".(!empty($facsrc->remise_absolue) ? ((float) $this->remise_absolue) : '0');
+ //$sql .= ", ".(!empty($facsrc->remise_absolue) ? ((float) $this->remise_absolue) : '0');
$sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL");
$sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL");
$sql .= ", ".(!empty($this->model_pdf) ? ("'".$this->db->escape($this->model_pdf)."'") : "NULL");
@@ -545,7 +541,6 @@ class FactureRec extends CommonInvoice
dol_syslog('FactureRec::fetch', LOG_DEBUG);
$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc, f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc';
- $sql .= ', f.remise_percent, f.remise_absolue, f.remise';
$sql .= ', f.date_lim_reglement as dlr';
$sql .= ', f.note_private, f.note_public, f.fk_user_author';
$sql .= ', f.modelpdf as model_pdf';
@@ -584,9 +579,6 @@ class FactureRec extends CommonInvoice
$this->title = $obj->title;
$this->ref = $obj->title;
$this->suspended = $obj->suspended;
- $this->remise_percent = $obj->remise_percent;
- $this->remise_absolue = $obj->remise_absolue;
- $this->remise = $obj->remise;
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 6f6eca7702c..60139479720 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -164,14 +164,12 @@ class Facture extends CommonInvoice
*/
public $ref_customer;
- // Warning: Do not set default value into property defintion. it must stay null.
- // For example to avoid to have substition done when object is generic and not yet defined.
- public $remise_absolue;
+ //public $remise_absolue;
/**
* @deprecated
*/
- public $remise_percent;
+ //public $remise_percent;
public $total_ht;
public $total_tva;
@@ -311,7 +309,7 @@ class Facture extends CommonInvoice
'paye' =>array('type'=>'smallint(6)', 'label'=>'InvoicePaidCompletely', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80),
//'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
//'remise_percent' =>array('type'=>'double', 'label'=>'RelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
- 'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>91),
+ //'remise_absolue' =>array('type'=>'double', 'label'=>'CustomerRelativeDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>91),
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
'close_code' =>array('type'=>'varchar(16)', 'label'=>'EarlyClosingReason', 'enabled'=>1, 'visible'=>-1, 'position'=>92),
'close_note' =>array('type'=>'varchar(128)', 'label'=>'EarlyClosingComment', 'enabled'=>1, 'visible'=>-1, 'position'=>93),
@@ -550,8 +548,8 @@ class Facture extends CommonInvoice
$this->total_ttc = $_facrec->total_ttc;
// Fields always coming from template
- $this->remise_absolue = $_facrec->remise_absolue;
- $this->remise_percent = $_facrec->remise_percent; // TODO deprecated
+ //$this->remise_absolue = $_facrec->remise_absolue;
+ //$this->remise_percent = $_facrec->remise_percent; // TODO deprecated
$this->fk_incoterms = $_facrec->fk_incoterms;
$this->location_incoterms = $_facrec->location_incoterms;
@@ -653,8 +651,6 @@ class Facture extends CommonInvoice
$sql .= ", subtype";
$sql .= ", fk_soc";
$sql .= ", datec";
- $sql .= ", remise_absolue";
- $sql .= ", remise_percent"; // TODO deprecated
$sql .= ", datef";
$sql .= ", date_pointoftax";
$sql .= ", note_private";
@@ -680,8 +676,6 @@ class Facture extends CommonInvoice
$sql .= ", ".($this->subtype ? "'".$this->db->escape($this->subtype)."'" : "null");
$sql .= ", ".((int) $socid);
$sql .= ", '".$this->db->idate($now)."'";
- $sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL');
- $sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); // TODO deprecated
$sql .= ", '".$this->db->idate($this->date)."'";
$sql .= ", ".(empty($this->date_pointoftax) ? "null" : "'".$this->db->idate($this->date_pointoftax)."'");
$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
@@ -1157,8 +1151,8 @@ class Facture extends CommonInvoice
$facture->fk_project = $this->fk_project;
$facture->cond_reglement_id = $this->cond_reglement_id;
$facture->mode_reglement_id = $this->mode_reglement_id;
- $facture->remise_absolue = $this->remise_absolue;
- $facture->remise_percent = $this->remise_percent; // TODO deprecated
+ //$facture->remise_absolue = $this->remise_absolue;
+ //$facture->remise_percent = $this->remise_percent; // TODO deprecated
$facture->origin = $this->origin;
$facture->origin_id = $this->origin_id;
@@ -2121,7 +2115,6 @@ class Facture extends CommonInvoice
$sql = 'SELECT f.rowid, f.entity, f.ref, f.ref_client, f.ref_ext, f.type, f.subtype, f.fk_soc';
$sql .= ', f.total_tva, f.localtax1, f.localtax2, f.total_ht, f.total_ttc, f.revenuestamp';
- $sql .= ', f.remise_percent, f.remise_absolue, f.remise';
$sql .= ', f.datef as df, f.date_pointoftax';
$sql .= ', f.date_lim_reglement as dlr';
$sql .= ', f.datec as datec';
@@ -2177,8 +2170,6 @@ class Facture extends CommonInvoice
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_modification = $this->db->jdate($obj->datem);
$this->datem = $this->db->jdate($obj->datem);
- $this->remise_percent = $obj->remise_percent; // TODO deprecated
- $this->remise_absolue = $obj->remise_absolue;
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
@@ -2510,8 +2501,6 @@ class Facture extends CommonInvoice
$sql .= " date_pointoftax=".(strval($this->date_pointoftax) != '' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null').",";
$sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').",";
$sql .= " paye=".(isset($this->paye) ? $this->db->escape($this->paye) : 0).",";
- $sql .= " remise_percent=".(isset($this->remise_percent) ? $this->db->escape($this->remise_percent) : "null").","; // TODO deprecated
- $sql .= " remise_absolue=".(isset($this->remise_absolue) ? $this->db->escape($this->remise_absolue) : "null").",";
$sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").",";
$sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").",";
$sql .= " total_tva=".(isset($this->total_tva) ? $this->total_tva : "null").",";
@@ -4482,6 +4471,7 @@ class Facture extends CommonInvoice
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK
*/
+ /*
public function set_remise_absolue($user, $remise, $notrigger = 0)
{
// phpcs:enable
@@ -4538,6 +4528,7 @@ class Facture extends CommonInvoice
return 0;
}
+ */
/**
* Return next reference of customer invoice not already used (or last reference)
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index f6c8832b701..f4ed780b624 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -246,9 +246,6 @@ class modFacture extends DolibarrModules
'f.datef' => 'DateInvoice',
'f.date_valid' => 'Validation Date',
'f.paye' => 'InvoicePaid',
- 'f.remise_percent' => 'RemisePercent',
- 'f.remise_absolue' => 'RemiseAbsolue',
- 'f.remise' => 'Remise',
'f.total_tva' => 'TotalVAT',
'f.total_ht' => 'TotalHT',
'f.total_ttc' => 'TotalTTC',
@@ -299,9 +296,6 @@ class modFacture extends DolibarrModules
'f.datef' => '2021-11-24',
'f.date_valid' => '2021-11-24',
'f.paye' => '1',
- 'f.remise_percent' => '0',
- 'f.remise_absolue' => '0',
- 'f.remise' => '0',
'f.total_tva' => '21',
'f.total_ht' => '100',
'f.total_ttc' => '121',
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index abb0756692e..4dd2e0a19fd 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1632,8 +1632,8 @@ if ($action == 'create') {
$availability_id = (!empty($objectsrc->availability_id) ? $objectsrc->availability_id : (!empty($soc->availability_id) ? $soc->availability_id : 0));
$shipping_method_id = (!empty($objectsrc->shipping_method_id) ? $objectsrc->shipping_method_id : (!empty($soc->shipping_method_id) ? $soc->shipping_method_id : 0));
$demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0));
- $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
- $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
+ //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
+ //$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '';
$datedelivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 878fd85e91b..0629fe282d8 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -975,8 +975,8 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
+ //$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -2090,8 +2090,8 @@ if ($action == 'create') {
$cond_reglement_id = 0;
$mode_reglement_id = 0;
$fk_account = 0;
- $remise_percent = 0;
- $remise_absolue = 0;
+ //$remise_percent = 0;
+ //$remise_absolue = 0;
$transport_mode_id = 0;
// set from object source
@@ -2104,12 +2104,6 @@ if ($action == 'create') {
if (!empty($objectsrc->fk_account)) {
$fk_account = $objectsrc->fk_account;
}
- if (!empty($objectsrc->remise_percent)) {
- $remise_percent = $objectsrc->remise_percent;
- }
- if (!empty($objectsrc->remise_absolue)) {
- $remise_absolue = $objectsrc->remise_absolue;
- }
if (!empty($objectsrc->transport_mode_id)) {
$transport_mode_id = $objectsrc->transport_mode_id;
}
@@ -2117,8 +2111,6 @@ if ($action == 'create') {
if (empty($cond_reglement_id)
|| empty($mode_reglement_id)
|| empty($fk_account)
- || empty($remise_percent)
- || empty($remise_absolue)
|| empty($transport_mode_id)
) {
if ($origin == 'reception') {
@@ -2138,12 +2130,6 @@ if ($action == 'create') {
if (empty($fk_account) && !empty($supplierOrder->fk_account)) {
$fk_account = $supplierOrder->fk_account;
}
- if (empty($remise_percent) && !empty($supplierOrder->remise_percent)) {
- $remise_percent = $supplierOrder->remise_percent;
- }
- if (empty($remise_absolue) && !empty($supplierOrder->remise_absolue)) {
- $remise_absolue = $supplierOrder->remise_absolue;
- }
if (empty($transport_mode_id) && !empty($supplierOrder->transport_mode_id)) {
$transport_mode_id = $supplierOrder->transport_mode_id;
}
@@ -2161,12 +2147,6 @@ if ($action == 'create') {
if (empty($fk_account) && !empty($soc->fk_account)) {
$fk_account = $soc->fk_account;
}
- if (empty($remise_percent) && !empty($soc->remise_supplier_percent)) {
- $remise_percent = $soc->remise_supplier_percent;
- }
- if (empty($remise_absolue) && !empty($soc->remise_absolue)) {
- $remise_absolue = $soc->remise_absolue;
- }
if (empty($transport_mode_id) && !empty($soc->transport_mode_id)) {
$transport_mode_id = $soc->transport_mode_id;
}
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index 8fc8b742dea..ca1584fe1ed 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -256,8 +256,6 @@ if (empty($reshook)) {
$cond_reglement_id = 0;
$mode_reglement_id = 0;
$fk_account = 0;
- $remise_percent = 0;
- $remise_absolue = 0;
$transport_mode_id = 0;
if (!empty($rcp->cond_reglement_id)) {
$cond_reglement_id = $rcp->cond_reglement_id;
@@ -268,12 +266,6 @@ if (empty($reshook)) {
if (!empty($rcp->fk_account)) {
$fk_account = $rcp->fk_account;
}
- if (!empty($rcp->remise_percent)) {
- $remise_percent = $rcp->remise_percent;
- }
- if (!empty($rcp->remise_absolue)) {
- $remise_absolue = $rcp->remise_absolue;
- }
if (!empty($rcp->transport_mode_id)) {
$transport_mode_id = $rcp->transport_mode_id;
}
@@ -281,8 +273,6 @@ if (empty($reshook)) {
if (empty($cond_reglement_id)
|| empty($mode_reglement_id)
|| empty($fk_account)
- || empty($remise_percent)
- || empty($remise_absolue)
|| empty($transport_mode_id)
) {
if (!isset($rcp->supplier_order)) {
@@ -301,12 +291,6 @@ if (empty($reshook)) {
if (empty($fk_account) && !empty($supplierOrder->fk_account)) {
$fk_account = $supplierOrder->fk_account;
}
- if (empty($remise_percent) && !empty($supplierOrder->remise_percent)) {
- $remise_percent = $supplierOrder->remise_percent;
- }
- if (empty($remise_absolue) && !empty($supplierOrder->remise_absolue)) {
- $remise_absolue = $supplierOrder->remise_absolue;
- }
if (empty($transport_mode_id) && !empty($supplierOrder->transport_mode_id)) {
$transport_mode_id = $supplierOrder->transport_mode_id;
}
@@ -324,12 +308,6 @@ if (empty($reshook)) {
if (empty($fk_account) && !empty($soc->fk_account)) {
$fk_account = $soc->fk_account;
}
- if (empty($remise_percent) && !empty($soc->remise_supplier_percent)) {
- $remise_percent = $soc->remise_supplier_percent;
- }
- if (empty($remise_absolue) && !empty($soc->remise_absolue)) {
- $remise_absolue = $soc->remise_absolue;
- }
if (empty($transport_mode_id) && !empty($soc->transport_mode_id)) {
$transport_mode_id = $soc->transport_mode_id;
}
@@ -342,8 +320,6 @@ if (empty($reshook)) {
$objecttmp->cond_reglement_id = $cond_reglement_id;
$objecttmp->mode_reglement_id = $mode_reglement_id;
$objecttmp->fk_account = $fk_account;
- $objecttmp->remise_percent = $remise_percent;
- $objecttmp->remise_absolue = $remise_absolue;
$objecttmp->transport_mode_id = $transport_mode_id;
// if the VAT reverse-charge is activated by default in supplier card to resume the information
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 3c631cfe18c..1bdbacf434e 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -286,8 +286,6 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->socid = GETPOST('socid');
$object->fk_project = GETPOST('projectid', 'int');
$object->model_pdf = GETPOST('model');
@@ -1119,10 +1117,10 @@ if (empty($reshook)) {
} elseif ($action == 'setconditions' && $usercancreate) {
// Terms of payments
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
- } elseif ($action == 'setremisepercent' && $usercancreate) {
- $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
- } elseif ($action == 'setremiseabsolue' && $usercancreate) {
- $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
+ //} elseif ($action == 'setremisepercent' && $usercancreate) {
+ // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
+ //} elseif ($action == 'setremiseabsolue' && $usercancreate) {
+ // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment mode
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
@@ -1222,8 +1220,6 @@ if ($action == 'create') {
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); // TODO maybe add default value option
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
- $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0));
- $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
// Replicate extrafields
$objectsrc->fetch_optionals();
@@ -1404,8 +1400,8 @@ if ($action == 'create') {
// TODO for compatibility
if ($origin == 'contrat') {
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
- $objectsrc->remise_absolue = $remise_absolue;
- $objectsrc->remise_percent = $remise_percent;
+ //$objectsrc->remise_absolue = $remise_absolue;
+ //$objectsrc->remise_percent = $remise_percent;
$objectsrc->update_price(1, 'auto', 1);
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 48648c6b0e3..8e85a0b7122 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -164,9 +164,6 @@ class SupplierProposal extends CommonObject
public $cond_reglement_code;
public $mode_reglement_code;
- public $remise = 0;
- public $remise_percent = 0;
- public $remise_absolue = 0;
public $extraparams = array();
public $lines = array();
@@ -913,9 +910,6 @@ class SupplierProposal extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."supplier_proposal (";
$sql .= "fk_soc";
$sql .= ", price";
- $sql .= ", remise";
- $sql .= ", remise_percent";
- $sql .= ", remise_absolue";
$sql .= ", total_tva";
$sql .= ", total_ttc";
$sql .= ", datec";
@@ -938,9 +932,6 @@ class SupplierProposal extends CommonObject
$sql .= " VALUES (";
$sql .= ((int) $this->socid);
$sql .= ", 0";
- $sql .= ", ".((double) $this->remise);
- $sql .= ", ".($this->remise_percent ? ((double) $this->remise_percent) : 'null');
- $sql .= ", ".($this->remise_absolue ? ((double) $this->remise_absolue) : 'null');
$sql .= ", 0";
$sql .= ", 0";
$sql .= ", '".$this->db->idate($now)."'";
@@ -1196,7 +1187,7 @@ class SupplierProposal extends CommonObject
{
global $conf;
- $sql = "SELECT p.rowid, p.entity, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
+ $sql = "SELECT p.rowid, p.entity, p.ref, p.fk_soc";
$sql .= ", p.total_ttc, p.total_tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.datec";
$sql .= ", p.date_valid as datev";
@@ -1234,9 +1225,6 @@ class SupplierProposal extends CommonObject
$this->entity = $obj->entity;
$this->ref = $obj->ref;
- $this->remise = $obj->remise;
- $this->remise_percent = $obj->remise_percent;
- $this->remise_absolue = $obj->remise_absolue;
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
@@ -1577,6 +1565,7 @@ class SupplierProposal extends CommonObject
* @param double $remise Amount discount
* @return int <0 if ko, >0 if ok
*/
+ /*
public function set_remise_absolue($user, $remise)
{
// phpcs:enable
@@ -1602,7 +1591,7 @@ class SupplierProposal extends CommonObject
}
return 0;
}
-
+ */
/**
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 937dad8e9e7..0e4ace2c14c 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -321,8 +321,8 @@ if (empty($reshook)) {
$creditnote->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
$creditnote->type = Facture::TYPE_CREDIT_NOTE;
$creditnote->fk_facture_source = $placeid;
- $creditnote->remise_absolue = $invoice->remise_absolue;
- $creditnote->remise_percent = $invoice->remise_percent;
+ //$creditnote->remise_absolue = $invoice->remise_absolue;
+ //$creditnote->remise_percent = $invoice->remise_percent;
$creditnote->create($user);
foreach ($invoice->lines as $line) {
diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php
index 3a848c250a6..b6ded243233 100644
--- a/htdocs/webservices/server_order.php
+++ b/htdocs/webservices/server_order.php
@@ -214,9 +214,6 @@ $order_fields = array(
'date_creation' => array('name'=>'date_creation', 'type'=>'xsd:dateTime'),
'date_validation' => array('name'=>'date_validation', 'type'=>'xsd:dateTime'),
'date_modification' => array('name'=>'date_modification', 'type'=>'xsd:dateTime'),
- 'remise' => array('name'=>'remise', 'type'=>'xsd:string'),
- 'remise_percent' => array('name'=>'remise_percent', 'type'=>'xsd:string'),
- 'remise_absolue' => array('name'=>'remise_absolue', 'type'=>'xsd:string'),
'source' => array('name'=>'source', 'type'=>'xsd:string'),
'note_private' => array('name'=>'note_private', 'type'=>'xsd:string'),
'note_public' => array('name'=>'note_public', 'type'=>'xsd:string'),
@@ -471,10 +468,6 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '')
'date_validation' => $order->date_validation ?dol_print_date($order->date_creation, 'dayhourrfc') : '',
'date_modification' => $order->date_modification ?dol_print_date($order->date_modification, 'dayhourrfc') : '',
- 'remise' => $order->remise,
- 'remise_percent' => $order->remise_percent,
- 'remise_absolue' => $order->remise_absolue,
-
'source' => $order->source,
'billed' => $order->billed,
'note_private' => $order->note_private,
@@ -622,10 +615,6 @@ function getOrdersForThirdParty($authentication, $idthirdparty)
'date' => $order->date_commande ?dol_print_date($order->date_commande, 'dayrfc') : '',
- 'remise' => $order->remise,
- 'remise_percent' => $order->remise_percent,
- 'remise_absolue' => $order->remise_absolue,
-
'source' => $order->source,
'billed' => $order->billed,
'note_private' => $order->note_private,