add storeroom to project
This commit is contained in:
parent
9ac9018aaa
commit
3a43694864
21
.idea/inspectionProfiles/Project_Default.xml
Normal file
21
.idea/inspectionProfiles/Project_Default.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="7">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
<item index="3" class="java.lang.String" itemvalue="noscript" />
|
||||
<item index="4" class="java.lang.String" itemvalue="embed" />
|
||||
<item index="5" class="java.lang.String" itemvalue="script" />
|
||||
<item index="6" class="java.lang.String" itemvalue="h1" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
36
hesabixCore/composer.lock
generated
36
hesabixCore/composer.lock
generated
|
@ -2101,16 +2101,16 @@
|
|||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "3.4.0",
|
||||
"version": "3.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "e2392369686d420ca32df3803de28b5d6f76867d"
|
||||
"reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d",
|
||||
"reference": "e2392369686d420ca32df3803de28b5d6f76867d",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448",
|
||||
"reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2186,7 +2186,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Seldaek/monolog/issues",
|
||||
"source": "https://github.com/Seldaek/monolog/tree/3.4.0"
|
||||
"source": "https://github.com/Seldaek/monolog/tree/3.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -2198,7 +2198,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-06-21T08:46:11+00:00"
|
||||
"time": "2023-10-27T15:32:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/mpdf",
|
||||
|
@ -4827,16 +4827,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/flex",
|
||||
"version": "v2.3.3",
|
||||
"version": "v2.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/flex.git",
|
||||
"reference": "9c402af768c6c9f8126a9ffa192ecf7c16581e35"
|
||||
"reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/flex/zipball/9c402af768c6c9f8126a9ffa192ecf7c16581e35",
|
||||
"reference": "9c402af768c6c9f8126a9ffa192ecf7c16581e35",
|
||||
"url": "https://api.github.com/repos/symfony/flex/zipball/ae6dea68771c5fca9d172e0c0910bdd06199f6f4",
|
||||
"reference": "ae6dea68771c5fca9d172e0c0910bdd06199f6f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4872,7 +4872,7 @@
|
|||
"description": "Composer plugin for Symfony",
|
||||
"support": {
|
||||
"issues": "https://github.com/symfony/flex/issues",
|
||||
"source": "https://github.com/symfony/flex/tree/v2.3.3"
|
||||
"source": "https://github.com/symfony/flex/tree/v2.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4888,7 +4888,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-04T09:02:35+00:00"
|
||||
"time": "2023-10-30T18:35:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/form",
|
||||
|
@ -10696,16 +10696,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/phpunit-bridge",
|
||||
"version": "v6.3.2",
|
||||
"version": "v6.3.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/phpunit-bridge.git",
|
||||
"reference": "e020e1efbd1b42cb670fcd7d19a25abbddba035d"
|
||||
"reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/e020e1efbd1b42cb670fcd7d19a25abbddba035d",
|
||||
"reference": "e020e1efbd1b42cb670fcd7d19a25abbddba035d",
|
||||
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d",
|
||||
"reference": "c6f1df6a76c2c12bd14a0a5bf7c556dd935efe1d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -10757,7 +10757,7 @@
|
|||
"description": "Provides utilities for PHPUnit, especially user deprecation notices management",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.2"
|
||||
"source": "https://github.com/symfony/phpunit-bridge/tree/v6.3.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -10773,7 +10773,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-12T16:00:22+00:00"
|
||||
"time": "2023-10-12T15:02:41+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/web-profiler-bundle",
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Service\Provider;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
|
@ -13,7 +17,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
class AdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route('/api/admin/sync/database', name: 'app_admin_sync_database')]
|
||||
public function app_admin_sync_database(KernelInterface $kernel): JsonResponse
|
||||
|
@ -40,7 +44,7 @@ class AdminController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route('/api/admin/has/role/{role}', name: 'app_admin_has_role')]
|
||||
public function app_admin_has_role($role): JsonResponse
|
||||
|
@ -55,4 +59,16 @@ class AdminController extends AbstractController
|
|||
'result' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
#[Route('/api/admin/users/list', name: 'app_admin_users_list')]
|
||||
public function app_admin_users_list(Provider $provider,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$users = $entityManager->getRepository(User::class)->findAll();
|
||||
return $this->json($provider->ArrayEntity2ArrayJustIncludes($users,[
|
||||
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ class BlogController extends AbstractController
|
|||
public function app_admin_posts_get(Jdate $jdate, Provider $provider,Request $request,SerializerInterface $serializer, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
|
||||
$items = $entityManager->getRepository(BlogPost::class)->findAll();
|
||||
$items = array_reverse($entityManager->getRepository(BlogPost::class)->findAll());
|
||||
$response = [];
|
||||
foreach ($items as $item){
|
||||
$temp = [];
|
||||
|
@ -237,6 +237,9 @@ class BlogController extends AbstractController
|
|||
$temp['submitter'] = $item->getSubmitter()->getFullName();
|
||||
$temp['views'] = $item->getViews();
|
||||
$temp['url'] = $item->getUrl();
|
||||
$temp['cat'] = $item->getCat()->getLabel();
|
||||
$temp['dateSubmit'] = $jdate->jdate('Y/n/d H:i',$item->getDateSubmit());
|
||||
$temp['submitter'] = $item->getSubmitter()->getFullName();
|
||||
$response[] = $temp;
|
||||
}
|
||||
return $this->json($response);
|
||||
|
|
|
@ -318,7 +318,8 @@ class BusinessController extends AbstractController
|
|||
return $this->json(['result'=>-1]);
|
||||
}
|
||||
$perm = $entityManager->getRepository(Permission::class)->findOneBy([
|
||||
'user'=>$user
|
||||
'user'=>$user,
|
||||
'bid'=>$business
|
||||
]);
|
||||
if($perm && ! $perm->isOwner()){
|
||||
$entityManager->remove($perm);
|
||||
|
|
|
@ -44,6 +44,11 @@ class CommodityController extends AbstractController
|
|||
$temp['khadamat'] = false;
|
||||
if($item->isKhadamat())
|
||||
$temp['khadamat'] = true;
|
||||
|
||||
$temp['commodityCountCheck'] = $item->isCommodityCountCheck();
|
||||
$temp['minOrderCount'] = $item->getMinOrderCount();
|
||||
$temp['dayLoading'] = $item->getDayLoading();
|
||||
$temp['orderPoint'] = $item->getOrderPoint();
|
||||
$res[] = $temp;
|
||||
}
|
||||
return $this->json($res);
|
||||
|
@ -78,7 +83,9 @@ class CommodityController extends AbstractController
|
|||
'code'=>$code
|
||||
]);
|
||||
$data->setUnit($data->getUnit()->getName());
|
||||
return $this->json($provider->Entity2Array($data,0));
|
||||
$res = $provider->Entity2ArrayJustIncludes($data,['isCommodityCountCheck','getName','getUnit','getPriceBuy','getPriceSell','getCat','getOrderPoint','getdes','getId','getDayLoading','isKhadamat','getCode','getMinOrderCount','getLabel'],1);
|
||||
$res['cat'] = $data->getCat()->getId();
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
#[Route('/api/commodity/mod/{code}', name: 'app_commodity_mod')]
|
||||
|
@ -124,6 +131,12 @@ class CommodityController extends AbstractController
|
|||
$data->setDes($params['des']);
|
||||
$data->setPriceSell($params['priceSell']);
|
||||
$data->setPriceBuy($params['priceBuy']);
|
||||
if(array_key_exists('commodityCountCheck',$params)){
|
||||
$data->setCommodityCountCheck($params['commodityCountCheck']);
|
||||
}
|
||||
$data->setMinOrderCount($params['minOrderCount']);
|
||||
$data->setDayLoading($params['dayLoading']);
|
||||
$data->setOrderPoint($params['orderPoint']);
|
||||
//set cat
|
||||
if(array_key_exists('cat',$params)){
|
||||
if($params['cat'] != null){
|
||||
|
|
|
@ -148,4 +148,27 @@ class UserController extends AbstractController
|
|||
return $this->redirectToRoute('app_register');
|
||||
}
|
||||
|
||||
#[Route('/login/by/token', name: 'app_login_by_token')]
|
||||
public function app_login_by_token(Request $request): Response
|
||||
{
|
||||
|
||||
// log the user in on the current firewall
|
||||
$security->login($user);
|
||||
|
||||
// if the firewall has more than one authenticator, you must pass it explicitly
|
||||
// by using the name of built-in authenticators...
|
||||
$security->login($user, 'form_login');
|
||||
// ...or the service id of custom authenticators
|
||||
$security->login($user, ExampleAuthenticator::class);
|
||||
|
||||
// you can also log in on a different firewall
|
||||
$security->login($user, 'form_login', 'other_firewall');
|
||||
|
||||
// use the redirection logic applied to regular login
|
||||
$redirectResponse = $security->login($user);
|
||||
return $redirectResponse;
|
||||
|
||||
// or use a custom redirection logic (e.g. redirect users to their account page)
|
||||
// return new RedirectResponse('...');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ use App\Entity\PayInfoTemp;
|
|||
use App\Entity\Person;
|
||||
use App\Entity\PlugNoghreOrder;
|
||||
use App\Entity\Salary;
|
||||
use App\Entity\StoreroomTicket;
|
||||
use App\Service\Access;
|
||||
use App\Service\Jdate;
|
||||
use App\Service\Log;
|
||||
|
@ -427,6 +428,10 @@ class HesabdariController extends AbstractController
|
|||
'message'=>'سند به دلیل داشتن تراکنش پرداخت آنلاین قابل حذف نیست.'
|
||||
]);
|
||||
}
|
||||
//check storeroom tickets
|
||||
$tickets = $entityManager->getRepository(StoreroomTicket::class)->findBy(['doc'=>$doc]);
|
||||
foreach ($tickets as $ticket)
|
||||
$entityManager->remove($ticket);
|
||||
foreach ($rows as $row)
|
||||
$entityManager->remove($row);
|
||||
foreach ($doc->getRelatedDocs() as $relatedDoc){
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Commodity;
|
||||
use App\Entity\HesabdariDoc;
|
||||
use App\Entity\HesabdariRow;
|
||||
use App\Entity\Person;
|
||||
|
@ -22,15 +23,21 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class StoreroomController extends AbstractController
|
||||
{
|
||||
#[Route('/api/storeroom/list', name: 'app_storeroom_list')]
|
||||
public function app_storeroom_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
#[Route('/api/storeroom/list/{type}', name: 'app_storeroom_list')]
|
||||
public function app_storeroom_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,String $type='active'): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('store');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$items = $entityManager->getRepository(Storeroom::class)->findBy([
|
||||
'bid'=>$acc['bid']
|
||||
]);
|
||||
if($type == 'active')
|
||||
$items = $entityManager->getRepository(Storeroom::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'active'=>true
|
||||
]);
|
||||
else
|
||||
$items = $entityManager->getRepository(Storeroom::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
]);
|
||||
|
||||
return $this->json($provider->ArrayEntity2Array($items,0));
|
||||
}
|
||||
|
@ -98,6 +105,9 @@ class StoreroomController extends AbstractController
|
|||
return $this->json($provider->Entity2Array($data,0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
#[Route('/api/storeroom/docs/get', name: 'app_storeroom_get_docs')]
|
||||
public function app_storeroom_get_docs(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
|
@ -108,20 +118,68 @@ class StoreroomController extends AbstractController
|
|||
'bid'=>$acc['bid'],
|
||||
'type'=>'buy'
|
||||
]);
|
||||
foreach ($buys as $buy)
|
||||
$buy->setDes('فاکتور خرید شماره # ' . $buy->getCode());
|
||||
$buysForExport =[];
|
||||
foreach ($buys as $buy){
|
||||
$temp = $provider->Entity2Array($buy,0);
|
||||
$person = $this->getPerson($buy);
|
||||
$temp['person'] = $provider->Entity2ArrayJustIncludes($person,['getCode','getNikename','getDes']);
|
||||
$temp['person']['des'] =' # ' . $person->getCode() . ' ' . $person->getNikename();
|
||||
$temp['commodities'] = $this->getCommodities($buy,$provider);
|
||||
//check storeroom exist
|
||||
$this->calcStoreRemaining($temp,$buy,$entityManager);
|
||||
$temp['des'] = 'فاکتور خرید شماره # ' . $buy->getCode();
|
||||
if(array_key_exists('storeroomComplete',$temp))
|
||||
if(!$temp['storeroomComplete']){
|
||||
$buysForExport[] = $temp;
|
||||
}
|
||||
}
|
||||
|
||||
$sells = $entityManager->getRepository(HesabdariDoc::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'type'=>'sell'
|
||||
]);
|
||||
foreach ($sells as $sell)
|
||||
$sell->setDes('فاکتور فروش شماره # ' . $sell->getCode());
|
||||
$sellsForExport =[];
|
||||
foreach ($sells as $sell){
|
||||
$temp = $provider->Entity2Array($sell,0);
|
||||
$person = $this->getPerson($sell);
|
||||
$temp['person'] = $provider->Entity2ArrayJustIncludes($person,['getCode','getNikename','getDes']);
|
||||
$temp['person']['des'] =' # ' . $person->getCode() . ' ' . $person->getNikename();
|
||||
$temp['commodities'] = $this->getCommodities($sell,$provider);
|
||||
//check storeroom exist
|
||||
$this->calcStoreRemaining($temp,$sell,$entityManager);
|
||||
$temp['des'] = 'فاکتور فروش شماره # ' . $sell->getCode();
|
||||
if(array_key_exists('storeroomComplete',$temp))
|
||||
if(!$temp['storeroomComplete']){
|
||||
$sellsForExport[] = $temp;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->json([
|
||||
'buys'=> $provider->ArrayEntity2Array($buys,0),
|
||||
'sells'=> $provider->ArrayEntity2Array($sells,0)
|
||||
'buys'=> $buysForExport,
|
||||
'sells'=> $sellsForExport
|
||||
]);
|
||||
}
|
||||
|
||||
private function getPerson(HesabdariDoc $doc): Person | bool{
|
||||
foreach ($doc->getHesabdariRows() as $row){
|
||||
if($row->getPerson())
|
||||
return $row->getPerson();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getCommodities(HesabdariDoc $doc,Provider $provider): array{
|
||||
$res = [];
|
||||
foreach ($doc->getHesabdariRows() as $row){
|
||||
if($row->getCommodity()){
|
||||
$arrayRow = $provider->Entity2ArrayJustIncludes($row->getCommodity(),['getCode','getName']);
|
||||
$arrayRow['commdityCount'] = $row->getCommdityCount();
|
||||
$res[] = $arrayRow;
|
||||
}
|
||||
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
|
@ -165,9 +223,62 @@ class StoreroomController extends AbstractController
|
|||
$res['person'] = $provider->Entity2Array($person,0);
|
||||
$res['person']['des'] =' # ' . $person->getCode() . ' ' . $person->getNikename();
|
||||
$res['commodities'] = $provider->ArrayEntity2Array($commodities,1,['doc','bid','year']);
|
||||
//calculate rows data
|
||||
$this->calcStoreRemaining($res,$doc,$entityManager);
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
private function calcStoreRemaining(array &$ref,HesabdariDoc $doc,EntityManagerInterface $entityManager){
|
||||
$tickets = $entityManager->getRepository(StoreroomTicket::class)->findBy(['doc'=>$doc]);
|
||||
|
||||
if(count($tickets) == 0){
|
||||
$ref['storeroomComplete'] = false;
|
||||
foreach ($ref['commodities'] as $key => $commodity){
|
||||
$ref['commodities'][$key]['countBefore'] = 0;
|
||||
$ref['commodities'][$key]['hesabdariCount'] = $commodity['commdityCount'];
|
||||
$ref['commodities'][$key]['remain'] = $ref['commodities'][$key]['hesabdariCount'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
$ref['storeroomComplete'] = true;
|
||||
foreach ($tickets as $ticket){
|
||||
$rows = $entityManager->getRepository(StoreroomItem::class)->findBy(['ticket'=>$ticket]);
|
||||
foreach ($rows as $key => $row){
|
||||
$comRows = $entityManager->getRepository(HesabdariRow::class)->findBy(['doc'=>$doc]);
|
||||
foreach ($comRows as $comRow){
|
||||
if($comRow->getCommodity()){
|
||||
if($comRow->getCommodity() === $row->getCommodity()){
|
||||
if(array_key_exists('countBefore',$ref['commodities'][$key])){
|
||||
$ref['commodities'][$key]['countBefore'] += $row->getCount();
|
||||
$ref['commodities'][$key]['hesabdariCount'] = $comRow->getCommdityCount();
|
||||
}
|
||||
else{
|
||||
$ref['commodities'][$key]['countBefore'] = $row->getCount();
|
||||
$ref['commodities'][$key]['hesabdariCount'] = $comRow->getCommdityCount();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$ref['commodities'][$key]['remain'] = $ref['commodities'][$key]['hesabdariCount'] - $ref['commodities'][$key]['countBefore'];
|
||||
$ref['commodities'][$key]['commodityComplete'] = true;
|
||||
if($ref['commodities'][$key]['remain'] != 0){
|
||||
$ref['commodities'][$key]['commodityComplete'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($tickets as $ticket){
|
||||
$rows = $entityManager->getRepository(StoreroomItem::class)->findBy(['ticket'=>$ticket]);
|
||||
$ref['storeroomComplete'] = true;
|
||||
foreach ($rows as $key => $row){
|
||||
if(!$ref['commodities'][$key]['commodityComplete']){
|
||||
$ref['storeroomComplete'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#[Route('/api/storeroom/transfertype/list', name: 'app_storeroom_get_transfertype_list')]
|
||||
public function app_storeroom_get_transfertype_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
|
@ -298,6 +409,92 @@ class StoreroomController extends AbstractController
|
|||
'getNikename',
|
||||
'getDoc',
|
||||
'getTypeString'
|
||||
],1));
|
||||
]));
|
||||
}
|
||||
|
||||
#[Route('/api/storeroom/tickets/info/{code}', name: 'app_storeroom_ticket_view')]
|
||||
public function app_storeroom_ticket_view(String $code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('store');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$ticket = $entityManager->getRepository(StoreroomTicket::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'code'=>$code
|
||||
]);
|
||||
if(!$ticket)
|
||||
throw $this->createNotFoundException('حواله یافت نشد.');
|
||||
//get items
|
||||
$items = $entityManager->getRepository(StoreroomItem::class)->findBy(['ticket'=>$ticket]);
|
||||
$res = [];
|
||||
$res['ticket']=$provider->Entity2ArrayJustIncludes($ticket,['getStoreroom','getManager','getDate','getSubmitDate','getDes','getReceiver','getTransfer','getCode','getType','getReferral','getTypeString'],2);
|
||||
$res['transferType']=$provider->Entity2ArrayJustIncludes($ticket->getTransferType(),['getName'],0);
|
||||
$res['person']=$provider->Entity2ArrayJustIncludes($ticket->getPerson(),['getKeshvar','getOstan','getShahr','getAddress','getNikename','getCodeeghtesadi','getPostalcode','getName','getTel','getSabt'],0);
|
||||
//get rows
|
||||
$rows = $entityManager->getRepository(StoreroomItem::class)->findBy(['ticket'=>$ticket]);
|
||||
$res['commodities'] = $provider->ArrayEntity2ArrayJustIncludes($rows,['getId','getDes','getCode','getName','getCommodity','getUnit','getCount'],2);
|
||||
|
||||
//calculate rows data
|
||||
$this->calcStoreRemaining($res,$ticket->getDoc(),$entityManager);
|
||||
return $this->json($res);
|
||||
}
|
||||
#[Route('/api/storeroom/commodity/list/{sid}', name: 'app_storeroom_commodity_list')]
|
||||
public function app_storeroom_commodity_list(String $sid,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('store');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$store = $entityManager->getRepository(Storeroom::class)->find($sid);
|
||||
if(!$store)
|
||||
throw $this->createNotFoundException('انبار یافت نشد');
|
||||
if($store->getBid() != $acc['bid'])
|
||||
throw $this->createAccessDeniedException('شما دسترسی به این انبار را ندارید.');
|
||||
|
||||
$rows = $entityManager->getRepository(StoreroomItem::class)->findBy([
|
||||
'Storeroom'=>$store
|
||||
]);
|
||||
$commodities = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'khadamat'=>false
|
||||
]);
|
||||
$items = [];
|
||||
foreach ($commodities as $commodity){
|
||||
$temp =[];
|
||||
$temp['commodity']=$provider->Entity2ArrayJustIncludes($commodity,['getUnit','getCode','getName','getCat','getOrderPoint']);
|
||||
$temp['input'] = 0;
|
||||
$temp['output'] = 0;
|
||||
foreach ($rows as $row){
|
||||
if($row->getCommodity()->getId() == $commodity->getId()){
|
||||
if($row->getType() == 'output')
|
||||
$temp['output'] += $row->getCount();
|
||||
elseif($row->getType() == 'input')
|
||||
$temp['input'] += $row->getCount();
|
||||
}
|
||||
}
|
||||
$temp['existCount'] = $temp['input'] - $temp['output'];
|
||||
$items[] = $temp;
|
||||
}
|
||||
return $this->json($items);
|
||||
}
|
||||
|
||||
#[Route('/api/storeroom/ticket/remove/{id}', name: 'app_storeroom_ticket_remove')]
|
||||
public function app_storeroom_ticket_remove(String $id,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('store');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$ticket = $entityManager->getRepository(StoreroomTicket::class)->findOneBy(['code'=>$id]);
|
||||
if(!$ticket)
|
||||
throw $this->createNotFoundException('حواله یافت نشد');
|
||||
$items = $entityManager->getRepository(StoreroomItem::class)->findBy(['ticket'=>$ticket]);
|
||||
foreach ($items as $item)
|
||||
$entityManager->remove($item);
|
||||
$entityManager->remove($ticket);
|
||||
$entityManager->flush();
|
||||
//save logs
|
||||
$log->insert('انبارداری','حواله انبار با شماره '. $ticket->getCode() . ' حذف شد.',$this->getUser(),$acc['bid']);
|
||||
return $this->json([
|
||||
'result'=>0
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,9 @@ class BlogPost
|
|||
#[ORM\OneToMany(mappedBy: 'post', targetEntity: BlogComment::class, orphanRemoval: true)]
|
||||
private Collection $blogComments;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $keywords = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->blogComments = new ArrayCollection();
|
||||
|
@ -195,4 +198,16 @@ class BlogPost
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getKeywords(): ?string
|
||||
{
|
||||
return $this->keywords;
|
||||
}
|
||||
|
||||
public function setKeywords(?string $keywords): static
|
||||
{
|
||||
$this->keywords = $keywords;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,16 +47,29 @@ class Commodity
|
|||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $khadamat = null;
|
||||
|
||||
#[Ignore]
|
||||
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: CommodityDropLink::class, orphanRemoval: true)]
|
||||
private Collection $commodityDropLinks;
|
||||
|
||||
#[Ignore]
|
||||
#[ORM\ManyToOne(inversedBy: 'commodities')]
|
||||
private ?CommodityCat $cat = null;
|
||||
|
||||
#[Ignore]
|
||||
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: StoreroomItem::class, orphanRemoval: true)]
|
||||
private Collection $storeroomItems;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $orderPoint = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $commodityCountCheck = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $minOrderCount = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $dayLoading = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setPriceBuy(0);
|
||||
|
@ -268,4 +281,52 @@ class Commodity
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOrderPoint(): ?string
|
||||
{
|
||||
return $this->orderPoint;
|
||||
}
|
||||
|
||||
public function setOrderPoint(?string $orderPoint): static
|
||||
{
|
||||
$this->orderPoint = $orderPoint;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isCommodityCountCheck(): ?bool
|
||||
{
|
||||
return $this->commodityCountCheck;
|
||||
}
|
||||
|
||||
public function setCommodityCountCheck(?bool $commodityCountCheck): static
|
||||
{
|
||||
$this->commodityCountCheck = $commodityCountCheck;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMinOrderCount(): ?string
|
||||
{
|
||||
return $this->minOrderCount;
|
||||
}
|
||||
|
||||
public function setMinOrderCount(?string $minOrderCount): static
|
||||
{
|
||||
$this->minOrderCount = $minOrderCount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDayLoading(): ?string
|
||||
{
|
||||
return $this->dayLoading;
|
||||
}
|
||||
|
||||
public function setDayLoading(?string $dayLoading): static
|
||||
{
|
||||
$this->dayLoading = $dayLoading;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,8 +86,12 @@ class HesabdariDoc
|
|||
private ?string $status = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'doc', targetEntity: StoreroomTicket::class)]
|
||||
#[Ignore]
|
||||
private Collection $storeroomTickets;
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY, nullable: true)]
|
||||
private ?array $tempStatus = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->hesabdariRows = new ArrayCollection();
|
||||
|
@ -406,4 +410,16 @@ class HesabdariDoc
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTempStatus(): ?array
|
||||
{
|
||||
return $this->tempStatus;
|
||||
}
|
||||
|
||||
public function setTempStatus(?array $tempStatus): static
|
||||
{
|
||||
$this->tempStatus = $tempStatus;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,9 @@ class HesabdariRow
|
|||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $plugin = null;
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY, nullable: true)]
|
||||
private ?array $tempData = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -281,4 +284,16 @@ class HesabdariRow
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTempData(): ?array
|
||||
{
|
||||
return $this->tempData;
|
||||
}
|
||||
|
||||
public function setTempData(?array $tempData): static
|
||||
{
|
||||
$this->tempData = $tempData;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -8,48 +8,101 @@
|
|||
<div class="pb-3">
|
||||
<h3>سوالات متداول</h3>
|
||||
<div class="text-09">
|
||||
<div class="text-bold text-primary">
|
||||
<h2 class="text-bold text-primary">
|
||||
ابر چیست؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
ابر زیرساختی مجازی از منابع محاسباتی و ذخیرهسازی داده است که از طریق اینترنت به کاربران ارائه میشود. این منابع میتوانند شامل سرورها، فضای ذخیرهسازی داده، شبکه و تجهیزات مجازیسازی باشند.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
نرم افزار حسابداری ابری چیست؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
نرم افزار حسابداری ابری که به آن نرم افزار حسابداری آنلاین هم میگویند، نرم افزاری است که به شما کمک میکند دفاتر حسابداری خود را آنلاین ثبت و نگهداری کنید. نرم افزار حسابداری ابری مانند حسابیکس به جای اینکه روی رایانه رومیزی یا سرورهای سازمان (در محل مشتری) نصب شود، در فضای ابری قرار دارد. همین ویژگی باعث میشود تا به دادههای مالی و امکانات سیستم از هر دستگاه آنلاینی در هر زمانی و مکانی دسترسی داشته باشید.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
آیا امکان قطع شدن حسابیکس وجود دارد؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
24 ساعته و با ضریب دسترسی بالای 99 درصد، دسترسی به حسابیکس وجود دارد.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
آیا حسابیکس آنلاین است یا نیاز به دانلود و نصب نرم افزار است؟
|
||||
</div>
|
||||
<div class="prices-faq-answer text-secondary">
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
شما نیاز به دانلود و نصب هیچ نرم افزاری ندارید. حسابیکس کاملاً آنلاین است
|
||||
و شما پس از ثبت نام می توانید وارد حساب کاربری خود شده و حسابداری خود را شروع کنید.
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<div class="text-bold text-primary">
|
||||
آیا می توانم اکانت خود را به طرح های بالاتر ارتقا دهم؟
|
||||
</div>
|
||||
<div class="prices-faq-answer text-secondary">
|
||||
استفاده از کلیه امکانات حسابیکس رایگان است و درآمد ما از طریق نمایش تبلیغات تامین میشود.
|
||||
ولی، شما می توانید هر زمان که مایل بودید طرح خود را ارتقا دهید و تبلیغات را از پنل خود پنهان کنید.
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<div class="text-bold text-primary">
|
||||
<h2 class="text-bold text-primary">
|
||||
آیا برای اپ موبایل هزینه جداگانه ای باید بپردازم؟
|
||||
</div>
|
||||
<div class="prices-faq-answer text-secondary">
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
خیر، اپ موبایل حسابیکس رایگان بوده و شما با همان اکانت خود
|
||||
که در وب سایت وارد می شوید می توانید وارد اپ موبایل هم شوید
|
||||
و نیازی به پرداخت هزینه جداگانه نیست.
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<div class="text-bold text-primary">
|
||||
<h2 class="text-bold text-primary">
|
||||
چقدر طول میکشد تا به حسابیکس مسلط شویم؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
فقط کافی است کار با حسابیکس را آغاز کنید. متوجه میشوید که تجربه کاربری نرمافزار طوری است که با حداقل زمان به نرمافزار مسلط شوید.همچنین میتوانید از بخش دانشنامه به مطالب و ویدئوهای آموزشی دسترسی داشته باشید.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
آیا برای کار با حسابیکس نیاز به دانش حسابداری است؟
|
||||
</div>
|
||||
<div class="prices-faq-answer text-secondary">
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
خیر، حسابیکس بگونه ای طراحی شده که تقریبا همه کارهای لازم بصورت اتوماتیک انجام می شوند.
|
||||
به عنوان مثال با ثبت فاکتور فروش، سند حسابداری مربوطه بصورت اتوماتیک ثبت می شود، همینطور در مورد
|
||||
سایر عملیات های حسابداری مثل دریافت، پرداخت، ضایعات و ...
|
||||
<br>
|
||||
اگر چه حسابداران و افرادی که دانش حسابداری دارند نیز می توانند بخوبی با حسابیکس کار کنند
|
||||
و از مزایای دانش خود بهره ببرند.
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
نسخه پشتیبان در این نرمافزار چگونه تهیه میشود؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
حسابیکس، خودکار و روزانه، از اطلاعات شما نسخه پشتیبان تهیه میکند؛ بنابراین نگرانی بابت از بین رفتن اطلاعات وجود ندارد.بعلاوه بصورت خودکار هر روز از داده های کاربران نسخه پشتیبان تهیه و تمامی داده ها بصورت رمزنگاری شده روی فضای ابری نگهداری می شوند.همچنین کاربران می توانند نسخه مستقیم پایگاه داده را با تماس با بخش پشتیبانی دریافت کنند.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
آینده نرمافزارهای حسابداری ابری چیست؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
به نظر میرسد با امکانات متمایز این تکنولوژی، در آینده نزدیک نرمافزارهای سنتی حذف شوند و با نرمافزارهای ابری جایگزین شوند. حدود 70% کسبوکارهای کوچک و متوسط در دنیا نرمافزار حسابداری ابری را به نرمافزار حسابداری سنتی ترجیح میدهند. این روند در ایران در حال شکلگیری است.
|
||||
</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="text-09">
|
||||
<h2 class="text-bold text-primary">
|
||||
اگر اینترنت قطع شود امکان کار با حسابیکس وجود دارد؟
|
||||
</h2>
|
||||
<p class="prices-faq-answer text-secondary">
|
||||
برای استفاده از نرم افزارهای ابری شما باید به شبکه اینترنت دسترسی داشته باشید. به دلیل استفاده حسابیکس از سرورهای داخل ایران، با قطع شدن اینترنت بین المللی امکان دسترسی به دیتا برای کاربران حسابیکس وجود دارد و با محدودیتی مواجه نخواهند شد.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% block title %}حامیان مالی{% endblock %}
|
||||
{% block body %}
|
||||
<div class="content">
|
||||
<div class="py-5 py-md-7 text-center">
|
||||
<div class="py-3 text-center">
|
||||
<h2 class="fw-bold mb-3">
|
||||
حسابیکس با
|
||||
<i class="fa fa-fw fa-heart text-danger"></i>
|
||||
|
@ -17,4 +17,21 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 py-2 text-center">
|
||||
<h1>حامیان حسابیکس</h1>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4">
|
||||
<div class="card" style="width: 18rem;">
|
||||
<img src="{{ asset('/banners/raddata.png') }}" class="card-img-top" alt="راددیتا">
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">مرکز ارتباطات راد دیتا</h5>
|
||||
<p class="card-text">پیشرو در ارائه خدمات فنی مهندسی و سرویس های مرکز داده در ایران و خارج با بالاترین کیفیت و قیمت مناسب</p>
|
||||
<a href="https://raddata.ir" target="_blank" class="btn btn-primary">وب سایت</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
BIN
public_html/banners/raddata.png
Normal file
BIN
public_html/banners/raddata.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
BIN
public_html/img/raddata.png
Normal file
BIN
public_html/img/raddata.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Loading…
Reference in a new issue