NEW : update rank line is possible on API for orders propal and supplier invoice

This commit is contained in:
Gauthier PC portable 024 2022-05-11 14:26:21 +02:00
parent 8ef75ecc7c
commit b053dee279
6 changed files with 16 additions and 6 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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)."";