fix(shayegan): send the customer detail code on account create

Hesabgar fails when it must invent the account number. Send the subsidiary code plus the customer id as AccountNumber.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-02 10:57:57 +03:30
co-authored by Cursor
parent c96e5820fe
commit 1cd6c61e0f
3 changed files with 45 additions and 0 deletions
@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
/**
* سه سطح: کل 121، معین 12101، تفصیلی = معین + کد کاربری (12101530).
* مقدار 1210101 اشتباه بود و به 12101 برمی‌گردد. مقدار دیگر دست نمی‌خورد.
*/
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('settings')) {
return;
}
$row = DB::table('settings')->where('key', 'shayegan_moin_customer')->first();
if (! $row) {
return;
}
$current = trim((string) ($row->value ?? ''));
$update = [
'description' => 'معین Account/Put. کل ۱۲۱ داخل همین کد است. شماره تفصیلی = این مقدار + کد کاربری. مثال: 12101 و مشتری 530 → 12101530.',
'updated_at' => now(),
];
if ($current === '' || $current === '1210101') {
$update['value'] = '12101';
}
DB::table('settings')->where('key', 'shayegan_moin_customer')->update($update);
}
public function down(): void
{
}
};