fix profit value after each order
This commit is contained in:
@@ -176,6 +176,7 @@ class PargarInboundController extends Controller
|
||||
// direction اپ: 1=خرید مشتری، 2=فروش مشتری
|
||||
// OrderType پرگار از دید فروشگاه است: خرید مشتری = فروش فروشگاه (-1)، فروش مشتری = خرید فروشگاه (1)
|
||||
$isCustomerBuy = (int) ($order->direction ?? 1) === 1;
|
||||
$customerDirection = (int) ($order->direction ?? 0);
|
||||
|
||||
return [
|
||||
'OrderId' => (string) $order->id,
|
||||
@@ -192,7 +193,7 @@ class PargarInboundController extends Controller
|
||||
'Weight' => (float) ($order->amount ?? 0),
|
||||
'Price' => (float) ($order->total_price ?? 0),
|
||||
'Carat' => 750,
|
||||
'Description' => (string) ($order->description ?? ''),
|
||||
'Description' => self::accountingShopTradeDesc($customerDirection, $this->isCartOrder($order)),
|
||||
];
|
||||
})->values();
|
||||
|
||||
@@ -481,7 +482,7 @@ class PargarInboundController extends Controller
|
||||
}
|
||||
|
||||
return PargarSyncLog::where('order_id', $order->id)
|
||||
->where('desc', 'سبد خرید')
|
||||
->whereIn('desc', ['سبد خرید', 'فروش سبد به مشتری'])
|
||||
->exists();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user