added pargar
This commit is contained in:
@@ -685,4 +685,36 @@ class ConfigService
|
||||
throw new UnprocessableEntityHttpException($this->productTradingClosedMessage($product));
|
||||
}
|
||||
}
|
||||
|
||||
public const ACCOUNTING_NONE = 'none';
|
||||
public const ACCOUNTING_TAHESAB = 'tahesab';
|
||||
public const ACCOUNTING_PARGAR = 'pargar';
|
||||
|
||||
/** none | tahesab | pargar — از setting accounting_provider */
|
||||
public function accountingProvider(): string
|
||||
{
|
||||
$provider = strtolower(trim($this->getString('accounting_provider', '')));
|
||||
if (in_array($provider, [self::ACCOUNTING_NONE, self::ACCOUNTING_TAHESAB, self::ACCOUNTING_PARGAR], true)) {
|
||||
return $provider;
|
||||
}
|
||||
|
||||
if ($this->getString('send_to_pargar', 'false') === 'true') {
|
||||
return self::ACCOUNTING_PARGAR;
|
||||
}
|
||||
if ($this->getString('send_to_tahesab', 'false') === 'true') {
|
||||
return self::ACCOUNTING_TAHESAB;
|
||||
}
|
||||
|
||||
return self::ACCOUNTING_NONE;
|
||||
}
|
||||
|
||||
public function isTahesabAccounting(): bool
|
||||
{
|
||||
return $this->accountingProvider() === self::ACCOUNTING_TAHESAB;
|
||||
}
|
||||
|
||||
public function isPargarAccounting(): bool
|
||||
{
|
||||
return $this->accountingProvider() === self::ACCOUNTING_PARGAR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user