mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
fix create purchase order for 1688 processor
This commit is contained in:
@@ -54,6 +54,7 @@ class CreatePurchaseOrderFor1688OrderProcessor
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('PO-');
|
||||
|
||||
$documents = $booking->documents()->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get();
|
||||
$products = [];
|
||||
foreach($documents as $document) {
|
||||
foreach ($document->files as $file) {
|
||||
try {
|
||||
@@ -64,6 +65,8 @@ class CreatePurchaseOrderFor1688OrderProcessor
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($products)) return false;
|
||||
|
||||
$total = collect($products)->sum(function($product){
|
||||
return $product['quantity'] * floatval(str_replace(',', '', $product['unit_price']));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user