progress in package manager and bug fix in captcha generator
This commit is contained in:
parent
21a5c35b0a
commit
0af7edac97
|
@ -18,6 +18,7 @@ use App\Entity\PlugNoghreOrder;
|
|||
use App\Entity\Salary;
|
||||
use App\Entity\StoreroomTicket;
|
||||
use App\Service\Access;
|
||||
use App\Service\AccountingPermissionService;
|
||||
use App\Service\Explore;
|
||||
use App\Service\Jdate;
|
||||
use App\Service\JsonResp;
|
||||
|
@ -271,7 +272,7 @@ class HesabdariController extends AbstractController
|
|||
* @throws \ReflectionException
|
||||
*/
|
||||
#[Route('/api/accounting/insert', name: 'app_accounting_insert')]
|
||||
public function app_accounting_insert(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, Jdate $jdate): JsonResponse
|
||||
public function app_accounting_insert(AccountingPermissionService $accountingPermissionService, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, Jdate $jdate): JsonResponse
|
||||
{
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
|
@ -279,6 +280,7 @@ class HesabdariController extends AbstractController
|
|||
}
|
||||
if (!array_key_exists('type', $params))
|
||||
$this->createNotFoundException();
|
||||
|
||||
$roll = '';
|
||||
if ($params['type'] == 'person_receive' || $params['type'] == 'person_send')
|
||||
$roll = 'person';
|
||||
|
@ -295,6 +297,13 @@ class HesabdariController extends AbstractController
|
|||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$pkgcntr = $accountingPermissionService->canRegisterAccountingDoc($acc['bid']);
|
||||
if ($pkgcntr['code'] == 4) {
|
||||
return $this->json([
|
||||
'result' => 4,
|
||||
'msg' => $pkgcntr['message']
|
||||
]);
|
||||
}
|
||||
if (!array_key_exists('rows', $params) || count($params['rows']) < 2)
|
||||
throw $this->createNotFoundException('rows is to short');
|
||||
if (!array_key_exists('date', $params) || !array_key_exists('des', $params))
|
||||
|
|
|
@ -20,7 +20,7 @@ class AccountingPermissionService
|
|||
private function getAccountingDocPrice(): int
|
||||
{
|
||||
$rootSystem = 'system_settings';
|
||||
return (int) $this->registryMGR->get($rootSystem, 'accountingDocPrice');
|
||||
return (int) $this->registryMGR->get($rootSystem, 'accounting_doc_price');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,6 @@ class AccountingPermissionService
|
|||
// ۳. چک کردن اعتبار موجود (smsCharge) و کسر هزینه
|
||||
$accountingDocPrice = $this->getAccountingDocPrice();
|
||||
$smsCharge = (int) $business->getSmsCharge();
|
||||
|
||||
if ($smsCharge >= $accountingDocPrice) {
|
||||
// کسر هزینه از اعتبار
|
||||
$business->setSmsCharge((string) ($smsCharge - $accountingDocPrice));
|
||||
|
|
|
@ -76,6 +76,7 @@ class CaptchaService
|
|||
$response->headers->set('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
|
||||
$response->headers->set('Pragma', 'no-cache');
|
||||
$response->headers->set('Expires', '0');
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function isCaptchaRequired(string $attemptKey): bool
|
||||
|
|
Loading…
Reference in a new issue