|
@@ -367,13 +367,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++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -913,6 +915,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;
|
|
@@ -965,6 +968,8 @@ class Expedition extends CommonObject
|
|
|
}
|
|
|
|
|
|
$this->lines[$num] = $line;
|
|
|
+
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
@@ -2611,6 +2616,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
|
|
|
*/
|