FIX creation of the shipment if order contains services
This commit is contained in:
parent
0aa7e7df88
commit
70a18bc15a
@ -370,13 +370,15 @@ class Expedition extends CommonObject
|
||||
// Insert of lines
|
||||
$num = count($this->lines);
|
||||
for ($i = 0; $i < $num; $i++) {
|
||||
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
||||
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
||||
$error++;
|
||||
}
|
||||
} else { // with batch management
|
||||
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
|
||||
$error++;
|
||||
if (empty($this->lines[$i]->product_type) || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
||||
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
||||
$error++;
|
||||
}
|
||||
} else { // with batch management
|
||||
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -916,6 +918,7 @@ class Expedition extends CommonObject
|
||||
|
||||
// Copy the rang of the order line to the expedition line
|
||||
$line->rang = $orderline->rang;
|
||||
$line->product_type = $orderline->product_type;
|
||||
|
||||
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
||||
$fk_product = $orderline->fk_product;
|
||||
@ -968,6 +971,8 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
$this->lines[$num] = $line;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -2602,6 +2607,12 @@ class ExpeditionLigne extends CommonObjectLine
|
||||
*/
|
||||
public $product_desc;
|
||||
|
||||
/**
|
||||
* Type of the product. 0 for product, 1 for service
|
||||
* @var int
|
||||
*/
|
||||
public $product_type = 0;
|
||||
|
||||
/**
|
||||
* @var int rang of line
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user