handled some bugs and adde some feature for banner
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user