handled some bugs and adde some feature for banner

This commit is contained in:
2026-07-19 15:53:05 +03:30
parent fc9de5198c
commit 160d6bd923
10 changed files with 158 additions and 36 deletions
+17
View File
@@ -254,4 +254,21 @@ class Customer extends Authenticatable implements JWTSubject
}
}
/** کد معتبر حسابداری (پرگار/ته‌حساب) — خالی و 0 و -1 نامعتبرند */
public static function isValidAccountingCode(mixed $value): bool
{
if ($value === null) {
return false;
}
$code = trim((string) $value);
return $code !== '' && ! in_array($code, ['0', '-1'], true);
}
public function hasValidPargarAccountId(): bool
{
return self::isValidAccountingCode($this->pargar_account_id);
}
}