Merge pull request #9237 from CelineDesign/develop
NEW #9236 Allow to import expedtion lines via API
This commit is contained in:
commit
3039e0e5ef
@ -192,13 +192,13 @@ class Shipments extends DolibarrApi
|
|||||||
foreach($request_data as $field => $value) {
|
foreach($request_data as $field => $value) {
|
||||||
$this->shipment->$field = $value;
|
$this->shipment->$field = $value;
|
||||||
}
|
}
|
||||||
/*if (isset($request_data["lines"])) {
|
if (isset($request_data["lines"])) {
|
||||||
$lines = array();
|
$lines = array();
|
||||||
foreach ($request_data["lines"] as $line) {
|
foreach ($request_data["lines"] as $line) {
|
||||||
array_push($lines, (object) $line);
|
array_push($lines, (object) $line);
|
||||||
}
|
}
|
||||||
$this->shipment->lines = $lines;
|
$this->shipment->lines = $lines;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if ($this->shipment->create(DolibarrApiAccess::$user) < 0) {
|
if ($this->shipment->create(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(500, "Error creating shipment", array_merge(array($this->shipment->error), $this->shipment->errors));
|
throw new RestException(500, "Error creating shipment", array_merge(array($this->shipment->error), $this->shipment->errors));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user