diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index e4b9a266198..9e9740e6a9f 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -426,7 +426,9 @@ class Proposals extends DolibarrApi isset($request_data->date_end) ? $request_data->date_end : $propalline->date_end, isset($request_data->array_options) ? $request_data->array_options : $propalline->array_options, isset($request_data->fk_unit) ? $request_data->fk_unit : $propalline->fk_unit, - isset($request_data->multicurrency_subprice) ? $request_data->multicurrency_subprice : $propalline->subprice + isset($request_data->multicurrency_subprice) ? $request_data->multicurrency_subprice : $propalline->subprice, + 0, + isset($request_data->rang) ? $request_data->rang : $propalline->rang ); if ($updateRes > 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 65a2e60777f..ef1433866e9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -788,7 +788,7 @@ class Propal extends CommonObject * @param int $notrigger disable line update trigger * @return int 0 if OK, <0 if KO */ - public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) + public function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $rang=0) { global $mysoc, $langs; @@ -874,6 +874,7 @@ class Propal extends CommonObject $line->oldline = $staticline; $this->line = $line; $this->line->context = $this->context; + $this->line->rang = $rang; // Reorder if fk_parent_line change if (!empty($fk_parent_line) && !empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) { diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index b550139cd94..959ec58f9ad 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -429,7 +429,8 @@ class Orders extends DolibarrApi $request_data->fk_unit, $request_data->multicurrency_subprice, 0, - $request_data->ref_ext + $request_data->ref_ext, + $request_data->rang ); if ($updateRes > 0) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f02e74687af..9611b4d9602 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3048,7 +3048,7 @@ class Commande extends CommonOrder * @param string $ref_ext external reference * @return int < 0 if KO, > 0 if OK */ - public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '') + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang=0) { global $conf, $mysoc, $langs, $user; @@ -3173,6 +3173,7 @@ class Commande extends CommonOrder $line->oldline = $staticline; $this->line = $line; $this->line->context = $this->context; + $this->line->rang = $rang; // Reorder if fk_parent_line change if (!empty($fk_parent_line) && !empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) { diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index df1bf36b723..a4308b89abc 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -638,7 +638,8 @@ class SupplierInvoices extends DolibarrApi $request_data->array_options, $request_data->fk_unit, $request_data->multicurrency_subprice, - $request_data->ref_supplier + $request_data->ref_supplier, + $request_data->rang ); if ($updateRes > 0) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 66c441841d1..30defa4eea8 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2054,7 +2054,7 @@ class FactureFournisseur extends CommonInvoice * @param string $ref_supplier Supplier ref * @return int <0 if KO, >0 if OK */ - public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1 = 0, $txlocaltax2 = 0, $qty = 1, $idproduct = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $remise_percent = 0, $notrigger = false, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '') + public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1 = 0, $txlocaltax2 = 0, $qty = 1, $idproduct = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $remise_percent = 0, $notrigger = false, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '', $rang=0) { global $mysoc, $langs; @@ -2172,6 +2172,7 @@ class FactureFournisseur extends CommonInvoice $line->product_type = $product_type; $line->info_bits = $info_bits; $line->fk_unit = $fk_unit; + $line->rang = $rang; if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options @@ -3428,6 +3429,9 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", product_type = ".((int) $this->product_type); $sql .= ", info_bits = ".((int) $this->info_bits); $sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null'); + if (!empty($this->rang)) { + $sql .= ", rang=".((int) $this->rang); + } // Multicurrency $sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice)."";