forked from Wavyzz/dolibarr
Merge branch 'develop' into NEW_deposit_payment_terms
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -271,6 +272,11 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
public $expeditions;
|
||||
|
||||
/**
|
||||
* @var string payment url
|
||||
*/
|
||||
public $online_payment_url;
|
||||
|
||||
|
||||
/**
|
||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
@@ -1671,6 +1677,11 @@ class Commande extends CommonOrder
|
||||
// Reorder if child line
|
||||
if (!empty($fk_parent_line)) {
|
||||
$this->line_order(true, 'DESC');
|
||||
} elseif ($ranktouse > 0 && $ranktouse <= count($this->lines)) { // Update all rank of all other lines
|
||||
$linecount = count($this->lines);
|
||||
for ($ii = $ranktouse; $ii <= $linecount; $ii++) {
|
||||
$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Mise a jour informations denormalisees au niveau de la commande meme
|
||||
@@ -2041,8 +2052,9 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx, l.ref_ext,';
|
||||
@@ -4044,6 +4056,23 @@ class Commande extends CommonOrder
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to replace a product id with another one.
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $origin_id Old product id
|
||||
* @param int $dest_id New product id
|
||||
* @return bool
|
||||
*/
|
||||
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
|
||||
{
|
||||
$tables = array(
|
||||
'commandedet',
|
||||
);
|
||||
|
||||
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the customer order delayed?
|
||||
*
|
||||
@@ -4642,7 +4671,7 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEORDER_UPDATE', $user);
|
||||
$result = $this->call_trigger('LINEORDER_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user