mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 23:13:59 +00:00
convert 1688 purchase orders to po
This commit is contained in:
+7
-4
@@ -403,11 +403,14 @@ Route::get('/1688/fix', function(){
|
||||
array_pop($products);
|
||||
foreach ($products as $product){
|
||||
$product = preg_split('/[\t]/',$product);
|
||||
$type = count($product) === 10 ? 2 : 1;
|
||||
|
||||
$adjuster = (count($product) - 7);
|
||||
$descriptionIndex = 3 + $adjuster;
|
||||
|
||||
$bookings[$document->owner->marking] = [
|
||||
'description' => str_replace("\n","",$product[$type === 2 ? 6 : 3]),
|
||||
'quantity' => (int) str_replace("\n","",$product[$type === 2 ? 8 : 5]),
|
||||
'unit_price' => (float) str_replace("\n","",$product[$type === 2 ? 9 : 6])
|
||||
'description' => str_replace("\n","",$product[$descriptionIndex]),
|
||||
'quantity' => (int) str_replace("\n","",$product[$descriptionIndex + 2]),
|
||||
'unit_price' => (float) str_replace("\n","",$product[$descriptionIndex + 3])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user