fix(shayegan): send the account number as customer id plus moin
Hesabgar kept generating a number when UpdateKind was 3. Insert with account type 1 and send 53012101. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -121,19 +121,19 @@ class ShayeganSyncService
|
||||
$name = 'مشتری ' . $customer->id;
|
||||
}
|
||||
|
||||
// کل ۱۲۱ داخل معین است. تفصیلی = معین + کد کاربری. مثال: 12101 و مشتری 530 → 12101530
|
||||
$requestedAccountNumber = $moinRaw . ((string) (int) $customer->id);
|
||||
// تفصیلی = کد کاربری + معین. مثال: مشتری 530 و معین 12101 → 53012101
|
||||
$requestedAccountNumber = ((string) (int) $customer->id) . $moinRaw;
|
||||
|
||||
$guid = (string) Str::uuid();
|
||||
$put = [[
|
||||
'MoinNumber' => $moinNumber,
|
||||
'AccountNumber' => $requestedAccountNumber,
|
||||
'AccountTypeId' => null,
|
||||
'AccountTypeId' => 1,
|
||||
'AccountName' => mb_substr($name, 0, 200),
|
||||
'Mobile' => trim((string) ($customer->mobile ?? '')) ?: null,
|
||||
'mellicode' => trim((string) ($customer->n_code ?? '')) ?: null,
|
||||
'GuId' => $guid,
|
||||
'UpdateKind' => 3,
|
||||
'UpdateKind' => 0,
|
||||
]];
|
||||
|
||||
$result = $this->client->put('Account/Put', $put);
|
||||
|
||||
Reference in New Issue
Block a user