Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Model/Request/ShipmentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public function prepareShipmentRequestBody()
$requestBodyObj->shipment_order_sub_type = $this->shipment_order_sub_type;
$requestBodyObj->end_customer = $this->end_customer;
$requestBodyObj->shipment_order_volume_array = $this->shipment_order_volume_array;
foreach($requestBodyObj->shipment_order_volume_array as $volume){
if(!isset($volume->shipment_order_volume_invoice->invoice_number)){
unset($volume->shipment_order_volume_invoice);
}
}
$requestBodyObj->shipped_date = $this->shipped_date;
$requestBodyObj->created = $this->created;
//$requestBodyObj->origin_warehouse_code = $this->origin_warehouse_code;
Expand Down Expand Up @@ -142,7 +147,12 @@ public function sendShipmentRequest($requestBody, $collectionData)
$this->message = $messages;

$_collectionFactory = $this->_shipment->load($collectionData['id'], "id");
$_collectionFactory->setIntelipostStatus('error');
if(($result->messages[0])->key != 'shipmentOrder.save.already.existing.order.number'){
$_collectionFactory->setIntelipostStatus('error');
} else {
$_collectionFactory->setIntelipostStatus('created');
$_collectionFactory->setIntelipostMessage('Ok.');
}
$_collectionFactory->setIntelipostMessage(str_replace('</br>', '', $this->message));
$_collectionFactory->save();
}
Expand Down