revert pargar

This commit is contained in:
2026-07-18 12:37:29 +03:30
parent 8b01679378
commit 4c7e4fdfde
@@ -173,9 +173,13 @@ class PargarInboundController extends Controller
$documents = $orders->map(function (Order $order) {
$customer = Customer::find((int) ($order->customer_id ?? 0));
// direction اپ: 1=خرید مشتری، 2=فروش مشتری
// OrderType پرگار از دید فروشگاه است: خرید مشتری = فروش فروشگاه (-1)، فروش مشتری = خرید فروشگاه (1)
$isCustomerBuy = (int) ($order->direction ?? 1) === 1;
return [
'OrderId' => (string) $order->id,
'OrderType' => (int) ($order->direction ?? 1) === 1 ? 1 : -1,
'OrderType' => $isCustomerBuy ? -1 : 1,
'PriceType' => 1,
'CustomerAccountId' => (int) ($customer->pargar_account_id ?? 0),
'ItemId' => 11,