revert pargar
This commit is contained in:
@@ -173,9 +173,13 @@ class PargarInboundController extends Controller
|
|||||||
$documents = $orders->map(function (Order $order) {
|
$documents = $orders->map(function (Order $order) {
|
||||||
$customer = Customer::find((int) ($order->customer_id ?? 0));
|
$customer = Customer::find((int) ($order->customer_id ?? 0));
|
||||||
|
|
||||||
|
// direction اپ: 1=خرید مشتری، 2=فروش مشتری
|
||||||
|
// OrderType پرگار از دید فروشگاه است: خرید مشتری = فروش فروشگاه (-1)، فروش مشتری = خرید فروشگاه (1)
|
||||||
|
$isCustomerBuy = (int) ($order->direction ?? 1) === 1;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'OrderId' => (string) $order->id,
|
'OrderId' => (string) $order->id,
|
||||||
'OrderType' => (int) ($order->direction ?? 1) === 1 ? 1 : -1,
|
'OrderType' => $isCustomerBuy ? -1 : 1,
|
||||||
'PriceType' => 1,
|
'PriceType' => 1,
|
||||||
'CustomerAccountId' => (int) ($customer->pargar_account_id ?? 0),
|
'CustomerAccountId' => (int) ($customer->pargar_account_id ?? 0),
|
||||||
'ItemId' => 11,
|
'ItemId' => 11,
|
||||||
|
|||||||
Reference in New Issue
Block a user