progress in print queue and some bug fixes

This commit is contained in:
Hesabix 2025-01-29 12:05:10 +00:00
parent c0119d4c72
commit 0ccdf63b84
26 changed files with 3284 additions and 45 deletions

View file

@ -18,6 +18,7 @@
"gregwar/captcha-bundle": "^2.2", "gregwar/captcha-bundle": "^2.2",
"melipayamak/php": "1.0.0", "melipayamak/php": "1.0.0",
"mpdf/mpdf": "^8.2", "mpdf/mpdf": "^8.2",
"nelmio/api-doc-bundle": "^4.34",
"nelmio/cors-bundle": "^2.4", "nelmio/cors-bundle": "^2.4",
"phpdocumentor/reflection-docblock": "^5.3", "phpdocumentor/reflection-docblock": "^5.3",
"phpoffice/phpspreadsheet": "^1.29", "phpoffice/phpspreadsheet": "^1.29",

View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0db24777fc7551965de7a3d68fdc1eb1", "content-hash": "0000709f0d53a720475e13fa5dae69ab",
"packages": [ "packages": [
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
@ -2447,6 +2447,128 @@
], ],
"time": "2024-06-12T14:39:25+00:00" "time": "2024-06-12T14:39:25+00:00"
}, },
{
"name": "nelmio/api-doc-bundle",
"version": "v4.34.0",
"source": {
"type": "git",
"url": "https://github.com/nelmio/NelmioApiDocBundle.git",
"reference": "ff9139576376695d2c3febc23a5e7eab91866d83"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/ff9139576376695d2c3febc23a5e7eab91866d83",
"reference": "ff9139576376695d2c3febc23a5e7eab91866d83",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.4",
"phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0",
"phpdocumentor/type-resolver": "^1.8.2",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"psr/container": "^1.0 || ^2.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/config": "^5.4 || ^6.4 || ^7.1",
"symfony/console": "^5.4 || ^6.4 || ^7.1",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.1",
"symfony/deprecation-contracts": "^2.1 || ^3",
"symfony/framework-bundle": "^5.4.24 || ^6.4 || ^7.1",
"symfony/http-foundation": "^5.4 || ^6.4 || ^7.1",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.1",
"symfony/options-resolver": "^5.4 || ^6.4 || ^7.1",
"symfony/property-info": "^5.4.10 || ^6.4 || ^7.1",
"symfony/routing": "^5.4 || ^6.4 || ^7.1",
"zircote/swagger-php": "^4.6.1"
},
"conflict": {
"zircote/swagger-php": "4.8.7"
},
"require-dev": {
"api-platform/core": "^2.7.0 || ^3",
"composer/package-versions-deprecated": "1.11.99.1",
"doctrine/annotations": "^2.0",
"friendsofphp/php-cs-fixer": "^3.52",
"friendsofsymfony/rest-bundle": "^2.8 || ^3.0",
"jms/serializer": "^1.14 || ^3.0",
"jms/serializer-bundle": "^2.3 || ^3.0 || ^4.0 || ^5.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^9.6 || ^10.5",
"symfony/asset": "^5.4 || ^6.4 || ^7.1",
"symfony/browser-kit": "^5.4 || ^6.4 || ^7.1",
"symfony/cache": "^5.4 || ^6.4 || ^7.1",
"symfony/dom-crawler": "^5.4 || ^6.4 || ^7.1",
"symfony/expression-language": "^5.4 || ^6.4 || ^7.1",
"symfony/form": "^5.4 || ^6.4 || ^7.1",
"symfony/phpunit-bridge": "^6.4",
"symfony/property-access": "^5.4 || ^6.4 || ^7.1",
"symfony/security-csrf": "^5.4 || ^6.4 || ^7.1",
"symfony/serializer": "^5.4 || ^6.4 || ^7.1",
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.1",
"symfony/templating": "^5.4 || ^6.4 || ^7.1",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.1",
"symfony/uid": "^5.4 || ^6.4 || ^7.1",
"symfony/validator": "^5.4 || ^6.4 || ^7.1",
"willdurand/hateoas-bundle": "^1.0 || ^2.0"
},
"suggest": {
"api-platform/core": "For using an API oriented framework.",
"doctrine/annotations": "For using doctrine annotations",
"friendsofsymfony/rest-bundle": "For using the parameters annotations.",
"jms/serializer-bundle": "For describing your models.",
"symfony/asset": "For using the Swagger UI.",
"symfony/cache": "For using a PSR-6 compatible cache implementation with the API doc generator.",
"symfony/form": "For describing your form type models.",
"symfony/monolog-bundle": "For using a PSR-3 compatible logger implementation with the API PHP describer.",
"symfony/security-csrf": "For using csrf protection tokens in forms.",
"symfony/serializer": "For describing your models.",
"symfony/twig-bundle": "For using the Swagger UI.",
"symfony/validator": "For describing the validation constraints in your models.",
"willdurand/hateoas-bundle": "For extracting HATEOAS metadata."
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": {
"psr-4": {
"Nelmio\\ApiDocBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://github.com/nelmio/NelmioApiDocBundle/contributors"
}
],
"description": "Generates documentation for your REST API from annotations and attributes",
"keywords": [
"api",
"doc",
"documentation",
"rest"
],
"support": {
"issues": "https://github.com/nelmio/NelmioApiDocBundle/issues",
"source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.34.0"
},
"funding": [
{
"url": "https://github.com/DjordyKoert",
"type": "github"
}
],
"time": "2025-01-08T11:43:02+00:00"
},
{ {
"name": "nelmio/cors-bundle", "name": "nelmio/cors-bundle",
"version": "2.5.0", "version": "2.5.0",
@ -8990,6 +9112,87 @@
"source": "https://github.com/webmozarts/assert/tree/1.11.0" "source": "https://github.com/webmozarts/assert/tree/1.11.0"
}, },
"time": "2022-06-03T18:03:27+00:00" "time": "2022-06-03T18:03:27+00:00"
},
{
"name": "zircote/swagger-php",
"version": "4.11.1",
"source": {
"type": "git",
"url": "https://github.com/zircote/swagger-php.git",
"reference": "7df10e8ec47db07c031db317a25bef962b4e5de1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zircote/swagger-php/zipball/7df10e8ec47db07c031db317a25bef962b4e5de1",
"reference": "7df10e8ec47db07c031db317a25bef962b4e5de1",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.2",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"symfony/deprecation-contracts": "^2 || ^3",
"symfony/finder": ">=2.2",
"symfony/yaml": ">=3.3"
},
"require-dev": {
"composer/package-versions-deprecated": "^1.11",
"doctrine/annotations": "^1.7 || ^2.0",
"friendsofphp/php-cs-fixer": "^2.17 || 3.62.0",
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": ">=8",
"vimeo/psalm": "^4.23"
},
"suggest": {
"doctrine/annotations": "^1.7 || ^2.0"
},
"bin": [
"bin/openapi"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
}
},
"autoload": {
"psr-4": {
"OpenApi\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Robert Allen",
"email": "zircote@gmail.com"
},
{
"name": "Bob Fanger",
"email": "bfanger@gmail.com",
"homepage": "https://bfanger.nl"
},
{
"name": "Martin Rademacher",
"email": "mano@radebatz.net",
"homepage": "https://radebatz.net"
}
],
"description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations",
"homepage": "https://github.com/zircote/swagger-php/",
"keywords": [
"api",
"json",
"rest",
"service discovery"
],
"support": {
"issues": "https://github.com/zircote/swagger-php/issues",
"source": "https://github.com/zircote/swagger-php/tree/4.11.1"
},
"time": "2024-10-15T19:20:02+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [

View file

@ -15,4 +15,5 @@ return [
Gregwar\CaptchaBundle\GregwarCaptchaBundle::class => ['all' => true], Gregwar\CaptchaBundle\GregwarCaptchaBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true], FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
]; ];

View file

@ -0,0 +1,9 @@
nelmio_api_doc:
documentation:
info:
title: Hesabix API document
description: Hesabix is first open source cloud base accounting platform
version: 0.43.2.1
areas: # to filter documented areas
path_patterns:
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc

View file

@ -0,0 +1,12 @@
# Expose your documentation as JSON swagger compliant
app.swagger:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
## Requires the Asset component and the Twig bundle
## $ composer require twig asset
#app.swagger_ui:
# path: /api/doc
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

View file

@ -3,11 +3,13 @@
namespace App\Controller; namespace App\Controller;
use App\Entity\Printer; use App\Entity\Printer;
use App\Entity\PrinterQueue;
use App\Entity\PrintItem; use App\Entity\PrintItem;
use App\Entity\PrintOptions; use App\Entity\PrintOptions;
use App\Service\Access; use App\Service\Access;
use App\Service\Explore; use App\Service\Explore;
use App\Service\Extractor; use App\Service\Extractor;
use App\Service\Jdate;
use App\Service\Log; use App\Service\Log;
use App\Service\Provider; use App\Service\Provider;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -55,7 +57,9 @@ class PrintersController extends AbstractController
$temp['sell']['noteString'] = $settings->getSellNoteString(); $temp['sell']['noteString'] = $settings->getSellNoteString();
$temp['sell']['pays'] = $settings->isSellPays(); $temp['sell']['pays'] = $settings->isSellPays();
$temp['sell']['paper'] = $settings->getSellPaper(); $temp['sell']['paper'] = $settings->getSellPaper();
if(!$temp['sell']['paper']) { $temp['sell']['paper'] = 'A4-L'; } if (!$temp['sell']['paper']) {
$temp['sell']['paper'] = 'A4-L';
}
$temp['buy']['id'] = $settings->getId(); $temp['buy']['id'] = $settings->getId();
$temp['buy']['bidInfo'] = $settings->isBuyBidInfo(); $temp['buy']['bidInfo'] = $settings->isBuyBidInfo();
@ -65,7 +69,9 @@ class PrintersController extends AbstractController
$temp['buy']['noteString'] = $settings->getBuyNoteString(); $temp['buy']['noteString'] = $settings->getBuyNoteString();
$temp['buy']['pays'] = $settings->isBuyPays(); $temp['buy']['pays'] = $settings->isBuyPays();
$temp['buy']['paper'] = $settings->getBuyPaper(); $temp['buy']['paper'] = $settings->getBuyPaper();
if(!$temp['buy']['paper']) { $temp['buy']['paper'] = 'A4-L'; } if (!$temp['buy']['paper']) {
$temp['buy']['paper'] = 'A4-L';
}
$temp['rfbuy']['id'] = $settings->getId(); $temp['rfbuy']['id'] = $settings->getId();
$temp['rfbuy']['bidInfo'] = $settings->isRfbuyBidInfo(); $temp['rfbuy']['bidInfo'] = $settings->isRfbuyBidInfo();
@ -75,7 +81,9 @@ class PrintersController extends AbstractController
$temp['rfbuy']['noteString'] = $settings->getRfbuyNoteString(); $temp['rfbuy']['noteString'] = $settings->getRfbuyNoteString();
$temp['rfbuy']['pays'] = $settings->isRfbuyPays(); $temp['rfbuy']['pays'] = $settings->isRfbuyPays();
$temp['rfbuy']['paper'] = $settings->getRfbuyPaper(); $temp['rfbuy']['paper'] = $settings->getRfbuyPaper();
if(!$temp['rfbuy']['paper']) { $temp['rfbuy']['paper'] = 'A4-L'; } if (!$temp['rfbuy']['paper']) {
$temp['rfbuy']['paper'] = 'A4-L';
}
$temp['rfsell']['id'] = $settings->getId(); $temp['rfsell']['id'] = $settings->getId();
$temp['rfsell']['bidInfo'] = $settings->isRfsellBidInfo(); $temp['rfsell']['bidInfo'] = $settings->isRfsellBidInfo();
@ -92,7 +100,9 @@ class PrintersController extends AbstractController
$temp['repservice']['noteString'] = $settings->getRepserviceNoteString(); $temp['repservice']['noteString'] = $settings->getRepserviceNoteString();
$temp['repservice']['paper'] = $settings->getRepServicePaper(); $temp['repservice']['paper'] = $settings->getRepServicePaper();
if(!$temp['rfsell']['paper']) { $temp['rfsell']['paper'] = 'A4-L'; } if (!$temp['rfsell']['paper']) {
$temp['rfsell']['paper'] = 'A4-L';
}
return $this->json($temp); return $this->json($temp);
} }
@ -124,8 +134,7 @@ class PrintersController extends AbstractController
$settings->setSellPaper($params['sell']['paper']); $settings->setSellPaper($params['sell']['paper']);
if ($params['buy']['bidInfo'] == null) { if ($params['buy']['bidInfo'] == null) {
$settings->setBuyBidInfo(false); $settings->setBuyBidInfo(false);
} } else {
else{
$settings->setBuyBidInfo(true); $settings->setBuyBidInfo(true);
} }
@ -240,10 +249,75 @@ class PrintersController extends AbstractController
'printer' => $printer, 'printer' => $printer,
'printed' => false 'printed' => false
]); ]);
if(count($items) == 0) return new Response(''); if (count($items) == 0)
return new Response('');
$items[count($items) - 1]->setPrinted(true); $items[count($items) - 1]->setPrinted(true);
$entityManager->persist($items[count($items) - 1]); $entityManager->persist($items[count($items) - 1]);
$entityManager->flush(); $entityManager->flush();
return new Response($items[count($items) - 1]->getType() . ',' . $items[count($items) - 1]->getFile()); return new Response($items[count($items) - 1]->getType() . ',' . $items[count($items) - 1]->getFile());
} }
#[Route('/api/printers/exist/{code}', name: 'app_printers_exist')]
public function app_printers_exist(Extractor $extractor, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
$acc = $access->hasRole('join');
if (!$acc)
throw $this->createAccessDeniedException();
$printer = $entityManager->getRepository(Printer::class)->findOneBy(['bid' => $acc['bid'], 'id' => $code]);
if ($printer)
return $this->json($extractor->operationSuccess());
return $this->json($extractor->operationFail());
}
#[Route('/api/printers/queue/{code}', name: 'app_printers_queue')]
public function app_printers_queue(Jdate $jdate, Extractor $extractor, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
$acc = $access->hasRole('join');
if (!$acc)
throw $this->createAccessDeniedException();
$queue = $entityManager->getRepository(PrinterQueue::class)->findBy(['bid' => $acc['bid']]);
$resp = [];
foreach ($queue as $item) {
$resp[] = [
'id' => $item->getId(),
'submitter' => $item->getSubmitter()->getFullName(),
'code' => $item->getPid(),
'dateSubmit' => $jdate->jdate('Y/n/d H:i', $item->getDateSubmit())
];
}
return $this->json($extractor->operationSuccess($resp));
}
#[Route('/api/printers/queue_doc_delete/{code}', name: 'app_printers_queuequeue_doc_delete')]
public function app_printers_queuequeue_doc_delete(Jdate $jdate, Extractor $extractor, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
$acc = $access->hasRole('join');
if (!$acc)
throw $this->createAccessDeniedException();
$item = $entityManager->getRepository(PrinterQueue::class)->findOneBy(['bid' => $acc['bid'], 'pid' => $code]);
if (!$item)
throw $this->createNotFoundException();
$log->insert('تنظیمات چاپ', ' برگه پرینت ابری با کد' . $item->getId() . ' حذف شد.', $this->getUser(), $acc['bid']->getId());
$entityManager->remove($item);
$entityManager->flush();
return $this->json($extractor->operationSuccess());
}
#[Route('/api/printers/queue_doc_delete_all', name: 'app_printers_queuequeue_doc_delete_all')]
public function app_printers_queuequeue_doc_delete_all(Jdate $jdate, Extractor $extractor, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('join');
if (!$acc)
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(PrinterQueue::class)->findBy(['bid' => $acc['bid']]);
foreach ($items as $item) {
$entityManager->remove($item);
}
$log->insert('تنظیمات چاپ', 'لیست چاپگرهای ابری پاک شد.', $this->getUser(), $acc['bid']->getId());
return $this->json($extractor->operationSuccess());
}
} }

View file

@ -2,6 +2,7 @@
namespace App\Controller; namespace App\Controller;
use OpenApi\Annotations as OA;
use App\Entity\BankAccount; use App\Entity\BankAccount;
use App\Entity\Cashdesk; use App\Entity\Cashdesk;
use App\Entity\Commodity; use App\Entity\Commodity;
@ -344,6 +345,7 @@ class ReportController extends AbstractController
$temp = [ $temp = [
'id' => $item->getId(), 'id' => $item->getId(),
'account' => $item->getName(), 'account' => $item->getName(),
'type' => $item->getType(),
'code' => $item->getCode(), 'code' => $item->getCode(),
]; ];
$childs = $entityManagerInterface->getRepository(HesabdariTable::class)->findBy([ $childs = $entityManagerInterface->getRepository(HesabdariTable::class)->findBy([
@ -353,7 +355,7 @@ class ReportController extends AbstractController
if (count($childs) > 0 || $item->getType() != 'calc') { if (count($childs) > 0 || $item->getType() != 'calc') {
$temp['hasChild'] = true; $temp['hasChild'] = true;
} }
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType())); $temp = array_merge($temp, $this->getBalaceTree($acc, $item));
$response[] = $temp; $response[] = $temp;
} }
} elseif ($rootNode->getType() == 'bank') { } elseif ($rootNode->getType() == 'bank') {
@ -361,6 +363,7 @@ class ReportController extends AbstractController
$temp = [ $temp = [
'id' => $item->getId(), 'id' => $item->getId(),
'account' => $item->getName(), 'account' => $item->getName(),
'type' => 'bank',
'code' => $item->getCode(), 'code' => $item->getCode(),
]; ];
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType())); $temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType()));
@ -372,6 +375,7 @@ class ReportController extends AbstractController
$temp = [ $temp = [
'id' => $item->getId(), 'id' => $item->getId(),
'account' => $item->getName(), 'account' => $item->getName(),
'type' => 'cashdesk',
'code' => $item->getCode(), 'code' => $item->getCode(),
]; ];
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType())); $temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType()));
@ -383,6 +387,7 @@ class ReportController extends AbstractController
$temp = [ $temp = [
'id' => $item->getId(), 'id' => $item->getId(),
'account' => $item->getName(), 'account' => $item->getName(),
'type' => 'salary',
'code' => $item->getCode(), 'code' => $item->getCode(),
]; ];
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType())); $temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType()));
@ -394,6 +399,19 @@ class ReportController extends AbstractController
$temp = [ $temp = [
'id' => $item->getId(), 'id' => $item->getId(),
'account' => $item->getNikename(), 'account' => $item->getNikename(),
'type' => 'person',
'code' => $item->getCode(),
];
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType()));
$temp['hasChild'] = false;
$response[] = $temp;
}
} elseif ($rootNode->getType() == 'commodity') {
foreach ($tableItems as $item) {
$temp = [
'id' => $item->getId(),
'account' => $item->getName(),
'type' => 'commodity',
'code' => $item->getCode(), 'code' => $item->getCode(),
]; ];
$temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType())); $temp = array_merge($temp, $this->getBalance($acc, $item->getCode(), $rootNode->getType()));
@ -445,18 +463,17 @@ class ReportController extends AbstractController
$bd = 0; $bd = 0;
foreach ($faltItemsArray as $item) { foreach ($faltItemsArray as $item) {
if ($item['type'] == 'calc') { if ($item['type'] == 'commodity') {
$items = $this->em->getRepository(HesabdariRow::class)->findBy([ $items = $this->em->getRepository(HesabdariRow::class)->findBy([
'money' => $acc['money'], 'money' => $acc['money'],
'bid' => $acc['bid'], 'bid' => $acc['bid'],
'hesabdariTable' => $item['id'] 'commodity' => $item['id']
]); ]);
foreach ($items as $objItem) { foreach ($items as $objItem) {
$bs += $objItem->getBs(); $bs += $objItem->getBs();
$bd += $objItem->getBd(); $bd += $objItem->getBd();
} }
} } elseif ($item['type'] == 'person') {
elseif ($item['type'] == 'person') {
$items = $this->em->getRepository(HesabdariRow::class)->findBy([ $items = $this->em->getRepository(HesabdariRow::class)->findBy([
'money' => $acc['money'], 'money' => $acc['money'],
'bid' => $acc['bid'], 'bid' => $acc['bid'],
@ -466,8 +483,7 @@ class ReportController extends AbstractController
$bs += $objItem->getBs(); $bs += $objItem->getBs();
$bd += $objItem->getBd(); $bd += $objItem->getBd();
} }
} } elseif ($item['type'] == 'cashdesk') {
elseif ($item['type'] == 'cashdesk') {
$items = $this->em->getRepository(HesabdariRow::class)->findBy([ $items = $this->em->getRepository(HesabdariRow::class)->findBy([
'money' => $acc['money'], 'money' => $acc['money'],
'bid' => $acc['bid'], 'bid' => $acc['bid'],
@ -477,8 +493,7 @@ class ReportController extends AbstractController
$bs += $objItem->getBs(); $bs += $objItem->getBs();
$bd += $objItem->getBd(); $bd += $objItem->getBd();
} }
} } elseif ($item['type'] == 'salary') {
elseif ($item['type'] == 'salary') {
$items = $this->em->getRepository(HesabdariRow::class)->findBy([ $items = $this->em->getRepository(HesabdariRow::class)->findBy([
'money' => $acc['money'], 'money' => $acc['money'],
'bid' => $acc['bid'], 'bid' => $acc['bid'],
@ -542,4 +557,179 @@ class ReportController extends AbstractController
} }
return $res; return $res;
} }
private function getBalaceTree(array $acc, HesabdariTable $table): array
{
$res = [
'bal_bd' => 0,
'bal_bs' => 0,
'his_bd' => 0,
'his_bs' => 0,
];
if ($this->hasChild($table)) {
foreach ($this->getChilds($table) as $child) {
if ($this->hasChild($child)) {
$temp = $this->getBalaceTree($acc, $child);
$res['his_bd'] += $temp['his_bd'];
$res['his_bs'] += $temp['his_bs'];
} else {
$temp = $this->calcBalance($acc, $child);
$res['his_bd'] += $temp['his_bd'];
$res['his_bs'] += $temp['his_bs'];
}
}
} else {
$temp = $this->calcBalance($acc, $table);
$res['his_bd'] += $temp['his_bd'];
$res['his_bs'] += $temp['his_bs'];
}
if ($res['his_bd'] > $res['his_bs']) {
$res['bal_bd'] = $res['his_bd'] - $res['his_bs'];
$res['bal_bs'] = 0;
} else {
$res['bal_bs'] = $res['his_bs'] - $res['his_bd'];
$res['bal_bd'] = 0;
}
return $res;
}
private function calcBalance(array $acc, HesabdariTable $table): array
{
$res = [
'his_bd' => 0,
'his_bs' => 0,
];
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'ref' => $table
], $acc['money']);
foreach ($items as $objItem) {
$res['his_bs'] += $objItem->getBs();
$res['his_bd'] += $objItem->getBd();
}
return $res;
}
private function hasChild(HesabdariTable $table): bool
{
if ($this->em->getRepository(HesabdariTable::class)->findOneBy(['upper' => $table]))
return true;
return false;
}
private function getChilds(HesabdariTable $table): array
{
return $this->em->getRepository(HesabdariTable::class)->findBy(['upper' => $table]);
}
#[Route('/api/report/acc/get_details', name: 'app_report_acc_get_details')]
public function app_report_acc_get_details(Provider $provider, Jdate $jdate, Access $access, Request $request, EntityManagerInterface $entityManagerInterface): JsonResponse
{
$acc = $access->hasRole('report');
if (!$acc) {
throw $this->createAccessDeniedException();
}
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if (!array_key_exists('node', $params))
throw $this->createNotFoundException();
if ($params['type'] == 'calc') {
$rootNode = $entityManagerInterface->getRepository(HesabdariTable::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
} elseif ($params['type'] == 'bank') {
$rootNode = $entityManagerInterface->getRepository(BankAccount::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
} elseif ($params['type'] == 'cashdesk') {
$rootNode = $entityManagerInterface->getRepository(Cashdesk::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
} elseif ($params['type'] == 'salary') {
$rootNode = $entityManagerInterface->getRepository(Salary::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
} elseif ($params['type'] == 'person') {
$rootNode = $entityManagerInterface->getRepository(Person::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
} elseif ($params['type'] == 'commodity') {
$rootNode = $entityManagerInterface->getRepository(Commodity::class)->find($params['node']);
if (!$rootNode)
throw $this->createNotFoundException();
}
$items = $this->tree2flat($rootNode, $acc);
return $this->json(Explore::ExploreHesabdariRows($items));
}
private function tree2flat(Person|HesabdariTable|BankAccount|Cashdesk $item, array $acc): array
{
$res = [];
if ($this->getEntityName($item) == 'App\Entity\HesabdariTable') {
if ($this->hasChild($item)) {
$temp = [];
foreach ($this->getChilds($item) as $child) {
$temp = array_merge($temp, $this->getTree($child));
}
$res = array_merge($res, $temp);
} else {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'ref' => $item
], $acc['money']);
$res = array_merge($res, $items);
}
} elseif ($this->getEntityName($item) == 'App\Entity\BankAccount') {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'bank' => $item
], $acc['money']);
$res = array_merge($res, $items);
} elseif ($this->getEntityName($item) == 'App\Entity\Cashdesk') {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'bank' => $item
], $acc['money']);
$res = array_merge($res, $items);
} elseif ($this->getEntityName($item) == 'App\Entity\Salary') {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'salary' => $item
], $acc['money']);
$res = array_merge($res, $items);
} elseif ($this->getEntityName($item) == 'App\Entity\Person') {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'person' => $item
], $acc['money']);
$res = array_merge($res, $items);
} elseif ($this->getEntityName($item) == 'App\Entity\Commodity') {
$items = $this->em->getRepository(HesabdariRow::class)->findByJoinMoney([
'bid' => $acc['bid'],
'commodity' => $item,
], $acc['money']);
$res = array_merge($res, $items);
}
return $res;
}
/**
* Returns Doctrine entity name
*
* @param mixed $entity
*
* @return string
* @throws \Exception
*/
private function getEntityName($entity): string
{
$entityName = $this->em->getMetadataFactory()->getMetadataFor(get_class($entity))->getName();
return $entityName;
}
} }

View file

@ -62,6 +62,17 @@ class UserController extends AbstractController
$translatorInterface->trans('login_fail'), $translatorInterface->trans('login_fail'),
)); ));
} }
if ($user->isActive() == false) {
return $this->json($extractor->operationFail(
'حساب کاربری شما فعال نیست. لطفا با پشتیبانی تماس بگیرید'
,
506,
[
'user' => $user->getUserIdentifier(),
'active' => $user->isActive(),
]
));
}
$token = new UserToken(); $token = new UserToken();
$token->setUser($user); $token->setUser($user);
$token->setToken($this->RandomString(254)); $token->setToken($this->RandomString(254));
@ -71,7 +82,8 @@ class UserController extends AbstractController
return $this->json($extractor->operationSuccess([ return $this->json($extractor->operationSuccess([
'user' => $user->getUserIdentifier(), 'user' => $user->getUserIdentifier(),
'token' => $token->getToken(), 'token' => $token->getToken(),
'tokenID' => $token->getTokenID() 'tokenID' => $token->getTokenID(),
'active' => $user->isActive(),
])); ]));
} else { } else {
if (null === $user) { if (null === $user) {
@ -88,7 +100,8 @@ class UserController extends AbstractController
return $this->json([ return $this->json([
'user' => $user->getUserIdentifier(), 'user' => $user->getUserIdentifier(),
'token' => $token->getToken(), 'token' => $token->getToken(),
'tokenID' => $token->getTokenID() 'tokenID' => $token->getTokenID(),
'active' => $user->isActive(),
]); ]);
} }

View file

@ -4,6 +4,7 @@ namespace App\Repository;
use App\Entity\Commodity; use App\Entity\Commodity;
use App\Entity\HesabdariRow; use App\Entity\HesabdariRow;
use App\Entity\Money;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NonUniqueResultException;
use Doctrine\Persistence\ManagerRegistry; use Doctrine\Persistence\ManagerRegistry;
@ -55,4 +56,18 @@ class HesabdariRowRepository extends ServiceEntityRepository
->getQuery() ->getQuery()
->getOneOrNullResult(); ->getOneOrNullResult();
} }
public function findByJoinMoney(array $params, Money $money): array
{
$query = $this->createQueryBuilder('t')
->select('t')
->innerJoin('t.doc', 'd')
->where('d.money = :money')
->setParameter('money', $money);
foreach ($params as $key => $value) {
$query->andWhere('t.' . $key . '= :' . $key);
$query->setParameter($key, $value);
}
return $query->getQuery()->getResult();
}
} }

View file

@ -160,8 +160,10 @@ class Explore
} }
public static function ExploreHesabdariRow(HesabdariRow $row) public static function ExploreHesabdariRow(HesabdariRow $row)
{ {
$jdate = new Jdate();
$temp = [ $temp = [
'id' => $row->getId(), 'id' => $row->getId(),
'doc_code' => $row->getDoc()->getCode(),
'bid' => self::ExploreBid($row->getBid()), 'bid' => self::ExploreBid($row->getBid()),
'year' => self::ExploreYear($row->getYear()), 'year' => self::ExploreYear($row->getYear()),
'ref' => self::ExploreHesabdariTable($row->getRef()), 'ref' => self::ExploreHesabdariTable($row->getRef()),
@ -172,6 +174,8 @@ class Explore
'bs' => $row->getBs(), 'bs' => $row->getBs(),
'bd' => $row->getBd(), 'bd' => $row->getBd(),
'des' => $row->getDes(), 'des' => $row->getDes(),
'date' => $row->getDoc()->getDate(),
'dateSubmit' => $jdate->jdate('Y/n/d', $row->getDoc()->getDateSubmit()),
'plugin' => $row->getPlugin(), 'plugin' => $row->getPlugin(),
'commodity_count' => $row->getCommdityCount(), 'commodity_count' => $row->getCommdityCount(),
'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()), 'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()),
@ -574,15 +578,24 @@ class Explore
'persons' => $item->isPersons(), 'persons' => $item->isPersons(),
'notif' => $item->isNotif(), 'notif' => $item->isNotif(),
]; ];
if($result['banks'] === null) $result['banks'] = true; if ($result['banks'] === null)
if($result['buys'] === null) $result['buys'] = true; $result['banks'] = true;
if($result['sells'] === null) $result['sells'] = true; if ($result['buys'] === null)
if($result['wallet'] === null) $result['wallet'] = true; $result['buys'] = true;
if($result['acc_docs'] === null) $result['acc_docs'] = true; if ($result['sells'] === null)
if($result['accounting_total'] ===null) $result['accounting_total'] = true; $result['sells'] = true;
if($result['commodities'] === null) $result['commodities'] = true; if ($result['wallet'] === null)
if($result['persons'] === null) $result['persons'] = true; $result['wallet'] = true;
if($result['notif'] === null) $result['notif'] = true; if ($result['acc_docs'] === null)
$result['acc_docs'] = true;
if ($result['accounting_total'] === null)
$result['accounting_total'] = true;
if ($result['commodities'] === null)
$result['commodities'] = true;
if ($result['persons'] === null)
$result['persons'] = true;
if ($result['notif'] === null)
$result['notif'] = true;
return $result; return $result;
} }

View file

@ -50,6 +50,19 @@
"gregwar/captcha-bundle": { "gregwar/captcha-bundle": {
"version": "v2.2.0" "version": "v2.2.0"
}, },
"nelmio/api-doc-bundle": {
"version": "4.34",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "3.0",
"ref": "c8e0c38e1a280ab9e37587a8fa32b251d5bc1c94"
},
"files": [
"config/packages/nelmio_api_doc.yaml",
"config/routes/nelmio_api_doc.yaml"
]
},
"nelmio/cors-bundle": { "nelmio/cors-bundle": {
"version": "2.4", "version": "2.4",
"recipe": { "recipe": {

View file

@ -0,0 +1,155 @@
<!DOCTYPE html PUBLIC "-//W3C//DTDXHTML1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<style>
type="text/css"
body,
html {
direction: rtl;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
text-size-adjust: none;
width: 100% !important;
}
table td,
table {}
#outlook a {
padding: 0;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.ExternalClass {
width: 100%;
}
@media only screen and(max-width: 480px) {
table,
table tr td,
table td {
width: 100% !important;
}
img {
width: inherit;
}
.layer_2 {
max-width: 100% !important;
}
.edsocialfollowcontainer table {
max-width: 25% !important;
}
.edsocialfollowcontainer table td {
padding: 10px !important;
}
}
</style>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
</head>
<body style="padding:0; margin: 0;">
<table align="center" style="width: 100%; height: 100%; background-color: #efefef;">
<tbody>
<tr>
<td valign="top" id="dbody" data-version="2.31" style="padding-top: 50px; padding-bottom: 50px; background-color: #efefef; width: 100%;">
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<table class="layer_1" align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; width: 100%; box-sizing: border-box; margin: 0px auto;"> <tbody>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edimg" valign="top" style="padding: 0px; box-sizing: border-box; text-align: center;">
<img style="border-width: 0px; border-style: none; max-width: 600px; width: 100%;" alt="Image" src="https://api.elasticemail.com/userfile/a18de9fc-4724-42f2-b203-4992ceddc1de/violetinvitation_top.jpg" width="600">
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edtext" valign="top" style="padding: 20px; color: #5f5f5f; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; text-align: right; direction: rtl; box-sizing: border-box;">
<div class="style1" style="text-align: center; color: #000000; font-size: 28px; font-family: Helvetica, Arial, sans-serif;">
<strong>
<span style="color: #5f497a;">حسابیکس
</span>
<br>
</strong>
</div>
<span style="line-height: 2.25em;">
<span style="font-size: 18px;">
<p style="margin: 0px; padding: 0px;">
<br>
</p>
<div style="text-align: center;">
کد بازیابی کلمه عبور شما به شرح زیر می باشد.
<br>
در صورتی که شما درخواست بازیابی گذرواژه خود را نداشته اید این پیام را نادیده بگیرید.
</div>
</span>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table border="0" cellspacing="0" cellpadding="0" class="edcontent" style="border-collapse: collapse;width:100%">
<tbody>
<tr>
<td valign="top" class="edbutton" style="padding: 20px;">
<table cellspacing="0" cellpadding="0" style="text-align: center; margin: 0px auto;" align="center">
<tbody>
<tr>
<td align="center" style="background: #ff0334; border-radius: 4px; padding: 12px;">
<a href="#" target="_blank" style="font-weight: bold; color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;">
<span style="color: #ffffff;">{{ code }}</span>
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,155 @@
<!DOCTYPE html PUBLIC "-//W3C//DTDXHTML1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<style>
type="text/css"
body,
html {
direction: rtl;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
text-size-adjust: none;
width: 100% !important;
}
table td,
table {}
#outlook a {
padding: 0;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.ExternalClass {
width: 100%;
}
@media only screen and(max-width: 480px) {
table,
table tr td,
table td {
width: 100% !important;
}
img {
width: inherit;
}
.layer_2 {
max-width: 100% !important;
}
.edsocialfollowcontainer table {
max-width: 25% !important;
}
.edsocialfollowcontainer table td {
padding: 10px !important;
}
}
</style>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
</head>
<body style="padding:0; margin: 0;">
<table align="center" style="width: 100%; height: 100%; background-color: #efefef;">
<tbody>
<tr>
<td valign="top" id="dbody" data-version="2.31" style="padding-top: 50px; padding-bottom: 50px; background-color: #efefef; width: 100%;">
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<table class="layer_1" align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; width: 100%; box-sizing: border-box; margin: 0px auto;"> <tbody>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edimg" valign="top" style="padding: 0px; box-sizing: border-box; text-align: center;">
<img style="border-width: 0px; border-style: none; max-width: 600px; width: 100%;" alt="Image" src="https://api.elasticemail.com/userfile/a18de9fc-4724-42f2-b203-4992ceddc1de/violetinvitation_top.jpg" width="600">
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edtext" valign="top" style="padding: 20px; color: #5f5f5f; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; text-align: right; direction: rtl; box-sizing: border-box;">
<div class="style1" style="text-align: center; color: #000000; font-size: 28px; font-family: Helvetica, Arial, sans-serif;">
<strong>
<span style="color: #5f497a;">حسابیکس
</span>
<br>
</strong>
</div>
<span style="line-height: 2.25em;">
<span style="font-size: 18px;">
<p style="margin: 0px; padding: 0px;">
<br>
</p>
<div style="text-align: center;">
به حسابیکس خوش آمدید. کد فعال سازی شما به شرح ذیل می باشد.
<br>
در صورت مواجعه با مشکل در فعال سازی حساب کاربری خود با پشتیبانی حسابیکس تماس بگیرید.
</div>
</span>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table border="0" cellspacing="0" cellpadding="0" class="edcontent" style="border-collapse: collapse;width:100%">
<tbody>
<tr>
<td valign="top" class="edbutton" style="padding: 20px;">
<table cellspacing="0" cellpadding="0" style="text-align: center; margin: 0px auto;" align="center">
<tbody>
<tr>
<td align="center" style="background: #ff0334; border-radius: 4px; padding: 12px;">
<a href="#" target="_blank" style="font-weight: bold; color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;">
<span style="color: #ffffff;">{{ code }}</span>
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,153 @@
<!DOCTYPE html PUBLIC "-//W3C//DTDXHTML1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<style>
type="text/css"
body,
html {
direction: rtl;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
text-size-adjust: none;
width: 100% !important;
}
table td,
table {}
#outlook a {
padding: 0;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.ExternalClass {
width: 100%;
}
@media only screen and(max-width: 480px) {
table,
table tr td,
table td {
width: 100% !important;
}
img {
width: inherit;
}
.layer_2 {
max-width: 100% !important;
}
.edsocialfollowcontainer table {
max-width: 25% !important;
}
.edsocialfollowcontainer table td {
padding: 10px !important;
}
}
</style>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
</head>
<body style="padding:0; margin: 0;">
<table align="center" style="width: 100%; height: 100%; background-color: #efefef;">
<tbody>
<tr>
<td valign="top" id="dbody" data-version="2.31" style="padding-top: 50px; padding-bottom: 50px; background-color: #efefef; width: 100%;">
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<table class="layer_1" align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; width: 100%; box-sizing: border-box; margin: 0px auto;"> <tbody>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edimg" valign="top" style="padding: 0px; box-sizing: border-box; text-align: center;">
<img style="border-width: 0px; border-style: none; max-width: 600px; width: 100%;" alt="Image" src="https://api.elasticemail.com/userfile/a18de9fc-4724-42f2-b203-4992ceddc1de/violetinvitation_top.jpg" width="600">
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="edtext" valign="top" style="padding: 20px; color: #5f5f5f; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; text-align: right; direction: rtl; box-sizing: border-box;">
<div class="style1" style="text-align: center; color: #000000; font-size: 28px; font-family: Helvetica, Arial, sans-serif;">
<strong>
<span style="color: #5f497a;">حسابیکس
</span>
<br>
</strong>
</div>
<span style="line-height: 2.25em;">
<span style="font-size: 18px;">
<p style="margin: 0px; padding: 0px;">
<br>
</p>
<div style="text-align: center;">
کلمه عبور ورود به حسابیکس به درخواست شما تغییر یافت . جهت ورود از کلمه عبور زیر استفاده نمایید.
</div>
</span>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
<tr>
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;"> <table border="0" cellspacing="0" cellpadding="0" class="edcontent" style="border-collapse: collapse;width:100%">
<tbody>
<tr>
<td valign="top" class="edbutton" style="padding: 20px;">
<table cellspacing="0" cellpadding="0" style="text-align: center; margin: 0px auto;" align="center">
<tbody>
<tr>
<td align="center" style="background: #ff0334; border-radius: 4px; padding: 12px;">
<a href="#" target="_blank" style="font-weight: bold; color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;">
<span style="color: #ffffff;">{{ code }}</span>
</a>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,14 @@
<?php
namespace App\Tests;
class CommodityTest extends ApiTestCase
{
public function testSomething(): void
{
$response = static::createClient()->request('GET', '/');
$this->assertResponseIsSuccessful();
$this->assertJsonContains(['@id' => '/']);
}
}

View file

@ -0,0 +1,7 @@
'use strict';
function loadRedocly(userOptions = {}) {
const data = JSON.parse(document.getElementById('swagger-data').innerText);
Redoc.init(data.spec, userOptions, document.getElementById('swagger-ui'));
}

View file

@ -0,0 +1,78 @@
// This file is part of the API Platform project.
//
// (c) Kévin Dunglas <dunglas@gmail.com>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
function loadSwaggerUI(userOptions = {}) {
const data = JSON.parse(document.getElementById('swagger-data').innerText);
const defaultOptions = {
spec: data.spec,
dom_id: '#swagger-ui',
validatorUrl: null,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: 'StandaloneLayout'
};
const options = Object.assign({}, defaultOptions, userOptions);
const ui = SwaggerUIBundle(options);
const storageKey = 'nelmio_api_auth';
function getAuthorizationsFromStorage() {
if (sessionStorage.getItem(storageKey)) {
try {
return JSON.parse(sessionStorage.getItem(storageKey));
} catch (ignored) {
// catch any errors here so it does not stop script execution
}
}
return {};
}
// if we have auth in storage use it
try {
const currentAuthorizations = getAuthorizationsFromStorage();
Object.keys(currentAuthorizations).forEach(k => ui.authActions.authorize({[k]: currentAuthorizations[k]}));
} catch (ignored) {
// catch any errors here so it does not stop script execution
}
// hook into authorize to store the auth in local storage when user performs authorization
const currentAuthorize = ui.authActions.authorize;
ui.authActions.authorize = function (payload) {
try {
sessionStorage.setItem(storageKey, JSON.stringify(Object.assign(
getAuthorizationsFromStorage(),
payload
)));
} catch (ignored) {
// catch any errors here so it does not stop script execution
}
return currentAuthorize(payload);
};
// hook into logout to clear auth from storage if user logs out
const currentLogout = ui.authActions.logout;
ui.authActions.logout = function (payload) {
try {
let currentAuth = getAuthorizationsFromStorage();
payload.forEach(k => delete currentAuth[k]);
sessionStorage.setItem(storageKey, JSON.stringify(currentAuth));
} catch (ignored) {
// catch any errors here so it does not stop script execution
}
return currentLogout(payload);
};
window.ui = ui;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,297 @@
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
body {
margin:70px 0 0;
background: #f0f0f0;
}
/** HEADER **/
header:before {
content:"";
background-color:#27848E;
height:70px;
width:100%;
text-align:center;
position:fixed;
top:0;
z-index:100;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
header #logo {
position:fixed;
top : 35px;
right:40px;
z-index:102;
transform:translateY(-50%);
}
header #logo img {
height:48px;
background-color:rgba(40, 134, 144, 0.4)
}
/** INCREASE WRAPPER BLOC PADDING **/
#swagger-ui.api-platform .wrapper {
padding:0px 60px;
}
/** INFORMATIONS BLOC **/
#swagger-ui.api-platform .information-container.wrapper {
margin:0;
padding:10px 0 0;
width:100%;
max-width:100%;
background-color:white;
border-bottom:1px solid #ccc;
margin-bottom:30px;
}
#swagger-ui.api-platform .info .title {
color:#3caab5;
}
#swagger-ui.api-platform .info {
width: 100%;
max-width: 1460px;
padding: 0px 50px;
margin: 0px auto;
}
/** METHODS BLOCS **/
#swagger-ui.api-platform .opblock.opblock-get .opblock-summary-method {
background-color:#3CAAB5;
}
#swagger-ui.api-platform .opblock.opblock-put .opblock-summary-method {
background-color:#E6C229;
}
#swagger-ui.api-platform .opblock.opblock-post .opblock-summary-method {
background-color:#78BC61;
}
#swagger-ui.api-platform .opblock.opblock-delete .opblock-summary-method {
background-color:#ED6A5A;
}
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-summary-method {
background-color:#ebebeb;
}
#swagger-ui.api-platform .opblock.opblock-get .opblock-summary {
border-color:#3CAAB5;
}
#swagger-ui.api-platform .opblock.opblock-put .opblock-summary {
border-color:#E6C229;
}
#swagger-ui.api-platform .opblock.opblock-post .opblock-summary {
border-color:#78BC61;
}
#swagger-ui.api-platform .opblock.opblock-delete .opblock-summary {
border-color:#ED6A5A;
}
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-summary {
border-color:#ebebeb;
}
#swagger-ui.api-platform .opblock-summary-method {
border-radius:0;
padding:10px;
}
#swagger-ui.api-platform .opblock-summary {
padding:0;
}
#swagger-ui.api-platform .opblock-tag {
padding:5px 0;
margin:0 0 10px;
}
#swagger-ui.api-platform .opblock-tag:hover {
background-color:rgba(0,0,0,.1);
transform:scale(1.01);
}
#swagger-ui.api-platform .opblock-section-header, #swagger-ui.api-platform .opblock.opblock-get .opblock-section-header {
background-color:rgba(60,170,181,0.1);
box-shadow:none;
}
#swagger-ui.api-platform .opblock.opblock-post .opblock-section-header {
background-color:rgba(120,188,97,0.1);
}
#swagger-ui.api-platform .opblock.opblock-put .opblock-section-header {
background-color:rgba(230, 194, 41, 0.1);
}
#swagger-ui.api-platform .opblock.opblock-delete .opblock-section-header {
background-color:rgba(237,106,90,0.1);
}
#swagger-ui.api-platform .opblock.opblock-deprecated .opblock-section-header {
background-color:rgba(235,235,235,0.1);
}
#swagger-ui.api-platform .opblock {
border-radius:0;
background-color:white;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
margin:0 0 10px;
padding:0;
border:none!important;
}
#swagger-ui .topbar {
display: none;
}
/** FORMATS **/
#formats {
text-align:right;
font-family: sans-serif;
width: 100%;
max-width: 1460px;
padding: 0px 60px;
margin:0 auto;
}
/** BUTTONS **/
#swagger-ui.api-platform .btn.execute {
background-color:#3CAAB5;
border-color:#3CAAB5;
animation:none;
transition:all ease 0.3s;
}
#swagger-ui.api-platform .btn.execute:hover {
background-color:#288690;
border-color:#288690;
}
#swagger-ui.api-platform .execute-wrapper {
text-align:center;
}
#swagger-ui.api-platform .execute-wrapper .btn {
width:auto;
padding:10px 40px;
}
#swagger-ui.api-platform .btn-group {
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
#swagger-ui.api-platform .btn-group .btn {
padding:10px 40px;
}
#swagger-ui.api-platform .btn {
transition:all ease 0.2s;
box-shadow:none;
background-color: #f7f7f7
}
#swagger-ui.api-platform .btn:hover {
background-color:rgba(65,68,78,0.1);
border-color:transparent;
}
#swagger-ui.api-platform .btn.cancel:hover {
background-color:rgba(237,106,90,0.1);
}
#swagger-ui.api-platform .btn.authorize:hover {
background-color:rgba(120,188,97,0.1);
}
#swagger-ui.api-platform select {
box-shadow:none;
cursor:pointer;
}
/** FIX TABS SEPARATOR **/
#swagger-ui.api-platform .tab li:first-of-type:after {
content : none;
}
#swagger-ui.api-platform .tab li {
padding:0px 5px;
border-right:1px solid rgba(0,0,0,.2);
}
#swagger-ui.api-platform .tab li:last-of-type {
border-right:none;
}
/** REMOVE HIGHLIGHTS FOCUS INPUTS **/
#swagger-ui.api-platform input:focus,
#swagger-ui.api-platform select:focus,
#swagger-ui.api-platform textarea:focus,
#swagger-ui.api-platform button:focus {
outline: none;
}
/** REMOVE TITILIUM FONT **/
.swagger-ui .opblock-tag,
.swagger-ui .opblock .opblock-section-header label,
.swagger-ui .opblock .opblock-section-header h4,
.swagger-ui .opblock .opblock-summary-method,
.swagger-ui .tab li,
.swagger-ui .scheme-container .schemes>label,
.swagger-ui .loading-container .loading:after,
.swagger-ui .btn,
.swagger-ui .btn.cancel,
.swagger-ui select,
.swagger-ui label,
.swagger-ui .dialog-ux .modal-ux-content h4,
.swagger-ui .dialog-ux .modal-ux-header h3,
.swagger-ui section.models h4,
.swagger-ui section.models h5,
.swagger-ui .model-title,
.swagger-ui .parameter__name,
.swagger-ui .topbar a,
.swagger-ui .topbar .download-url-wrapper .download-url-button,
.swagger-ui .info .title small pre,
.swagger-ui .scopes h2,
.swagger-ui .errors-wrapper hgroup h4 {
font-family: sans-serif !important;
}
#swagger-ui-logos {
position: absolute;
width:0;
height:0;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long