work on storeroom plugin

This commit is contained in:
Hesabix 2023-10-29 10:32:43 -04:00
parent 5ba18fd1c2
commit 9ac9018aaa
31 changed files with 1380 additions and 253 deletions

View file

@ -31,7 +31,7 @@ use Symfony\Component\Security\Http\Attribute\CurrentUser;
class BusinessController extends AbstractController
{
#[Route('/api/business/list', name: 'api_bussiness_list')]
public function api_bussiness_list(#[CurrentUser] ?User $user,EntityManagerInterface $entityManager): Response
public function api_bussiness_list(#[CurrentUser] ?User $user,EntityManagerInterface $entityManager,Provider $provider): Response
{
$buss = $entityManager->getRepository(Permission::class)->findBy(['user'=>$user]);
$response = [];
@ -43,7 +43,6 @@ class BusinessController extends AbstractController
$temp['legal_name'] = $bus->getBid()->getLegalName();
$response[] = $temp;
}
return $this->json($response);
}

View file

@ -253,55 +253,4 @@ class AppController extends AbstractController
'content'=>$content
]);
}
/**
* @Route("/app/support/list", name="app_front_support_list")
*/
public function app_front_support_list(EntityManagerInterface $entityManager): Response
{
return $this->render('/app/support/list.html.twig',[
'items'=>$entityManager->getRepository(Support::class)->findBy([
'main' => 0
],[
'id'=>'DESC'
])
]);
}
/**
* @Route("/app/support/view/{id}", name="app_front_support_view")
*/
public function app_front_support_view(string $id,SMS $SMS,Request $request,EntityManagerInterface $entityManager): Response
{
$item = $entityManager->getRepository(Support::class)->find($id);
if(!$item) $this->createNotFoundException();
$support = new Support();
$form = $this->createForm(SupportType::class,$support,[]);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$support->setDateSubmit(time());
$support->setTitle('0');
$support->setState('0');
$support->setMain($item->getId());
$support->setSubmitter($this->getUser());
$entityManager->persist($support);
$entityManager->flush();
$item->setState('پاسخ داده شده');
$entityManager->persist($support);
$entityManager->flush();
//send sms to customer
if($item->getSubmitter()->getMobile())
$SMS->send([$item->getId()],'162251',$item->getSubmitter()->getMobile());
}
return $this->render('/app/support/view.html.twig',[
'item'=>$item,
'replays'=>$entityManager->getRepository(Support::class)->findBy([
'main'=>$item->getId()
]),
'form'=>$form->createView()
]);
}
}

View file

@ -37,7 +37,7 @@ class BlogController extends AbstractController
public function general_blog_post(Request $request,EntityManagerInterface $entityManager, String $url): Response
{
$item = $entityManager->getRepository(BlogPost::class)->findOneBy(['url'=>$url]);
if(!$item) $this->createNotFoundException();
if(!$item) throw $this->createNotFoundException();
$comment = new BlogComment();
$form = $this->createForm(CommentType::class,$comment);
@ -127,7 +127,7 @@ class BlogController extends AbstractController
$item->setImg($newFilename);
}
$item->setDateSubmit(time());
$url = str_replace(' ','_',$item->getTitle());
$url = str_replace(' ','-',$item->getTitle());
$check = $entityManager->getRepository(BlogPost::class)->findOneBy(['url'=>$url]);
$item->setUrl($url);
if($check){

View file

@ -102,9 +102,12 @@ class UiGeneralController extends AbstractController
#[Route('/sitemap.xml', name: 'general_sitemap')]
public function general_sitemap(EntityManagerInterface $entityManager): Response
{
$response = new Response('',200,['Content-Type'=>'text/xml']);
return $this->render('general/sitemap.html.twig',[
]);
'timeNow'=>$dateTime = date('c', time()),
'blogs'=>$entityManager->getRepository(BlogPost::class)->findAll(),
'docs'=>$entityManager->getRepository(APIDocument::class)->findAll()
],$response);
}
#[Route('/test', name: 'general_test')]
public function general_test(Provider $provider,pdfMGR $pdfMGR,EntityManagerInterface $entityManager): Response

View file

@ -55,6 +55,12 @@ class GeneralController extends AbstractController
{
return $this->json($entityManager->getRepository(Statment::class)->findBy([],['id'=>'DESC']));
}
#[Route('/api/general/get/time', name: 'general_get_time')]
public function general_get_time(Jdate $jdate): JsonResponse
{
return $this->json(['timeNow'=>$jdate->jdate('Y/n/d',time())]);
}
#[Route('/front/print/{id}', name: 'app_front_print')]
public function app_front_print(Provider $provider,EntityManagerInterface $entityManager,pdfMGR $pdfMGR,String $id)
{

View file

@ -9,6 +9,7 @@ use App\Entity\HesabdariDoc;
use App\Entity\HesabdariRow;
use App\Entity\HesabdariTable;
use App\Entity\Money;
use App\Entity\PayInfoTemp;
use App\Entity\Person;
use App\Entity\PlugNoghreOrder;
use App\Entity\Salary;
@ -386,7 +387,7 @@ class HesabdariController extends AbstractController
}
#[Route('/api/accounting/remove', name: 'app_accounting_remove_doc')]
public function app_accounting_remove_doc(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
public function app_accounting_remove_doc(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$params = [];
if ($content = $request->getContent()) {
@ -395,7 +396,8 @@ class HesabdariController extends AbstractController
if(! array_key_exists('code',$params))
$this->createNotFoundException();
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
'code'=>$params['code']
'code'=>$params['code'],
'bid'=>$request->headers->get('activeBid')
]);
if(!$doc) throw $this->createNotFoundException();
$roll = '';
@ -416,6 +418,15 @@ class HesabdariController extends AbstractController
if($order)
$entityManager->remove($order);
}
//check wallet online transactions
$tempPays = $entityManager->getRepository(PayInfoTemp::class)->findOneBy(['doc'=>$doc]);
if($tempPays){
//doc has transaction
return $this->json([
'result'=>2,
'message'=>'سند به دلیل داشتن تراکنش پرداخت آنلاین قابل حذف نیست.'
]);
}
foreach ($rows as $row)
$entityManager->remove($row);
foreach ($doc->getRelatedDocs() as $relatedDoc){
@ -430,7 +441,6 @@ class HesabdariController extends AbstractController
$entityManager->remove($doc);
$entityManager->flush();
$log->insert('حسابداری','سند حسابداری شماره ' . $doc->getCode() . ' حذف شد.',$this->getUser(),$request->headers->get('activeBid'));
return $this->json(['result'=>1]);
}

View file

@ -2,11 +2,18 @@
namespace App\Controller;
use App\Entity\HesabdariDoc;
use App\Entity\HesabdariRow;
use App\Entity\Person;
use App\Entity\Storeroom;
use App\Entity\StoreroomItem;
use App\Entity\StoreroomTicket;
use App\Entity\StoreroomTransferType;
use App\Service\Access;
use App\Service\Log;
use App\Service\Provider;
use Doctrine\ORM\EntityManagerInterface;
use ReflectionException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
@ -76,7 +83,7 @@ class StoreroomController extends AbstractController
}
/**
* @throws \ReflectionException
* @throws ReflectionException
*/
#[Route('/api/storeroom/info/{code}', name: 'app_storeroom_info')]
public function app_storeroom_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
@ -91,4 +98,206 @@ class StoreroomController extends AbstractController
return $this->json($provider->Entity2Array($data,0));
}
#[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
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$buys = $entityManager->getRepository(HesabdariDoc::class)->findBy([
'bid'=>$acc['bid'],
'type'=>'buy'
]);
foreach ($buys as $buy)
$buy->setDes('فاکتور خرید شماره # ' . $buy->getCode());
$sells = $entityManager->getRepository(HesabdariDoc::class)->findBy([
'bid'=>$acc['bid'],
'type'=>'sell'
]);
foreach ($sells as $sell)
$sell->setDes('فاکتور فروش شماره # ' . $sell->getCode());
return $this->json([
'buys'=> $provider->ArrayEntity2Array($buys,0),
'sells'=> $provider->ArrayEntity2Array($sells,0)
]);
}
/**
* @throws ReflectionException
*/
#[Route('/api/storeroom/doc/get/info/{id}', name: 'app_storeroom_get_doc_info')]
public function app_storeroom_get_doc_info(String $id,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
'bid'=>$acc['bid'],
'code'=>$id
]);
if(!$doc)
throw $this->createNotFoundException('سند یافت نشد.');
if($doc->getType() == 'buy')
$doc->setDes('فاکتور خرید شماره #' . $doc->getCode());
elseif($doc->getType() == 'sell')
$doc->setDes('فاکتور فروش شماره #' . $doc->getCode());
//find person
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
'doc'=>$doc
]);
$person = null;
$commodities = [];
foreach ($rows as $row){
if($row->getPerson()){
$person = $row->getPerson();
break;
}
elseif ($row->getCommodity()){
if(!$row->getCommodity()->isKhadamat())
$commodities[] = $row;
}
}
foreach ($commodities as $commodity){
$commodity->getCommodity()->setUnit($commodity->getCommodity()->getUnit()->getName());
}
$res = $provider->Entity2Array($doc,0);
$res['person'] = $provider->Entity2Array($person,0);
$res['person']['des'] =' # ' . $person->getCode() . ' ' . $person->getNikename();
$res['commodities'] = $provider->ArrayEntity2Array($commodities,1,['doc','bid','year']);
return $this->json($res);
}
#[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
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
return $this->json($entityManager->getRepository(StoreroomTransferType::class)->findAll());
}
#[Route('/api/storeroom/ticket/insert', name: 'app_storeroom_ticket_insert')]
public function app_storeroom_ticket_insert(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
//check parameters exist
if((!array_key_exists('ticket',$params)) || (!array_key_exists('items',$params)) || (!array_key_exists('doc',$params)))
$this->createNotFoundException();
//going to save
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
'id'=>$params['doc']['id'],
'bid'=>$acc['bid']
]);
if(!$doc)
throw $this->createNotFoundException('سند یافت نشد');
if($doc->getBid()->getId() != $acc['bid']->getId())
throw $this->createAccessDeniedException('دسترسی به این سند را ندارید.');
//find transfer type
if(!array_key_exists('transferType',$params['ticket']))
throw $this->createNotFoundException('نوع انتقال یافت نشد');
$transferType = $entityManager->getRepository(StoreroomTransferType::class)->find($params['ticket']['transferType']['id']);
if(!$transferType)
throw $this->createNotFoundException('نوع انتقال یافت نشد');
//find storeroom
if(!array_key_exists('store',$params['ticket']))
throw $this->createNotFoundException('انبار یافت نشد');
$storeroom = $entityManager->getRepository(Storeroom::class)->find($params['ticket']['store']['id']);
if(!$storeroom)
throw $this->createNotFoundException('انبار یافت نشد');
elseif ($storeroom->getBid()->getId() != $acc['bid']->getId())
throw $this->createAccessDeniedException('دسترسی به این انبار ممکن نیست!');
//find person
if(!array_key_exists('person',$params['ticket']))
throw $this->createNotFoundException('طرف حساب یافت نشد');
$person = $entityManager->getRepository(Person::class)->find($params['ticket']['person']['id']);
if(!$person)
throw $this->createNotFoundException('طرف حساب یافت نشد');
elseif ($person->getBid()->getId() != $acc['bid']->getId())
throw $this->createAccessDeniedException('دسترسی به این طرف حساب ممکن نیست!');
$ticket = new StoreroomTicket();
$ticket->setSubmitter($this->getUser());
$ticket->setDate($params['ticket']['date']);
$ticket->setBid($acc['bid']);
$ticket->setDateSubmit(time());
$ticket->setDoc($doc);
$ticket->setTransfer($params['ticket']['transfer']);
$ticket->setYear($acc['year']);
$ticket->setCode($provider->getAccountingCode($acc['bid'],'storeroom'));
$ticket->setReceiver($params['ticket']['receiver']);
$ticket->setTransferType($transferType);
$ticket->setReferral($params['ticket']['referral']);
$ticket->setStoreroom($storeroom);
$ticket->setPerson($person);
$ticket->setType($params['ticket']['type']);
$ticket->setTypeString($params['ticket']['typeString']);
$ticket->setDes($params['ticket']['des']);
$entityManager->persist($ticket);
//$entityManager->flush();
//going to save rows
$docRows = $entityManager->getRepository(HesabdariRow::class)->findBy([
'doc'=>$doc
]);
foreach ($params['items'] as $item){
$row = $entityManager->getRepository(HesabdariRow::class)->findOneBy([
'bid'=>$acc['bid'],
'doc'=>$doc,
'id'=>$item['id'],
]);
if(!$row)
throw $this->createNotFoundException('کالا یافت نشد!');
if(!$row->getCommodity())
throw $this->createNotFoundException('کالا یافت نشد!');
//check row count not upper ticket count
if($row->getCommdityCount() < $item['ticketCount'])
throw $this->createNotFoundException('تعداد کالای اضافه شده بیشتر از تعداد کالا در فاکتور است.');
$ticketItem = new StoreroomItem();
$ticketItem->setBid($acc['bid']);
$ticketItem->setStoreroom($storeroom);
$ticketItem->setTicket($ticket);
$ticketItem->setCount($item['ticketCount']);
$ticketItem->setReferal($item['referral']);
$ticketItem->setDes($item['des']);
$ticketItem->setCommodity($row->getCommodity());
$ticketItem->setType($item['type']);
$entityManager->persist($ticketItem);
}
$entityManager->flush();
//save logs
$log->insert('انبارداری','حواله انبار با شماره '. $ticket->getCode() . ' اضافه / ویرایش شد.',$this->getUser(),$acc['bid']);
return $this->json([
'result'=>0
]);
}
#[Route('/api/storeroom/tickets/list/{type}', name: 'app_storeroom_tickets_list')]
public function app_storeroom_tickets_list(String $type,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$tickets = $entityManager->getRepository(StoreroomTicket::class)->findBy([
'bid'=>$acc['bid'],
'year'=>$acc['year'],
'type'=>$type
]);
return $this->json($provider->ArrayEntity2ArrayJustIncludes($tickets,[
'getDes',
'getCode',
'getDate',
'getPerson',
'getNikename',
'getDoc',
'getTypeString'
],1));
}
}

View file

@ -25,7 +25,62 @@ class SupportController extends AbstractController
}
return $this->json($provider->ArrayEntity2Array($items,1));
}
#[Route('/api/admin/support/view/{id}', name: 'app_admin_support_view')]
public function app_admin_support_view(Jdate $jdate, EntityManagerInterface $entityManager,string $id = ''): JsonResponse
{
$item = $entityManager->getRepository(Support::class)->find($id);
if(!$item) throw $this->createNotFoundException();
$replays = $entityManager->getRepository(Support::class)->findBy(['main'=>$item->getId()]);
foreach ($replays as $replay){
$replay->setDateSubmit($jdate->jdate('Y/n/d H:i',$replay->getDateSubmit()));
$replay->setTitle($replay->getSubmitter()->getFullname());
if($replay->getSubmitter() == $this->getUser())
$replay->setState(1);
else
$replay->setState(0);
}
$item->setDateSubmit($jdate->jdate('Y/n/d H:i',$item->getDateSubmit()));
return $this->json([
'item'=> $item,
'replays'=> $replays
]);
}
#[Route('/api/admin/support/mod/{id}', name: 'app_admin_support_mod')]
public function app_admin_support_mod(SMS $SMS,Request $request, EntityManagerInterface $entityManager,string $id = ''): JsonResponse
{
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
$item = $entityManager->getRepository(Support::class)->find($id);
if(!$item) $this->createNotFoundException();
if(array_key_exists('body',$params)){
$support = new Support();
$support->setDateSubmit(time());
$support->setTitle('0');
$support->setBody($params['body']);
$support->setState('0');
$support->setMain($item->getId());
$support->setSubmitter($this->getUser());
$entityManager->persist($support);
$entityManager->flush();
$item->setState('پاسخ داده شده');
$entityManager->persist($support);
$entityManager->flush();
//send sms to customer
if($item->getSubmitter()->getMobile())
$SMS->send([$item->getId()],'162251',$item->getSubmitter()->getMobile());
return $this->json([
'error'=> 0,
'message'=> 'successful'
]);
}
return $this->json([
'error'=> 999,
'message'=> 'تمام موارد لازم را وارد کنید.'
]);
}
#[Route('/api/support/list', name: 'app_support_list')]
public function app_support_list(Jdate $jdate,EntityManagerInterface $entityManager): JsonResponse
{

View file

@ -20,6 +20,9 @@ class APIDocument
#[ORM\Column(type: Types::TEXT)]
private ?string $body = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $dateSubmit = null;
public function getId(): ?int
{
return $this->id;
@ -48,4 +51,16 @@ class APIDocument
return $this;
}
public function getDateSubmit(): ?string
{
return $this->dateSubmit;
}
public function setDateSubmit(?string $dateSubmit): static
{
$this->dateSubmit = $dateSubmit;
return $this;
}
}

View file

@ -176,6 +176,17 @@ class Business
#[Ignore]
private ?bool $walletEnable = null;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: StoreroomTicket::class, orphanRemoval: true)]
#[Ignore]
private Collection $storeroomTickets;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: StoreroomItem::class, orphanRemoval: true)]
#[Ignore]
private Collection $storeroomItems;
#[ORM\Column(length: 255, nullable: true)]
private ?string $storeroomCode = '1000';
public function __construct()
{
$this->logs = new ArrayCollection();
@ -195,6 +206,8 @@ class Business
$this->commodityDrops = new ArrayCollection();
$this->storerooms = new ArrayCollection();
$this->walletTransactions = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
$this->storeroomItems = new ArrayCollection();
}
public function getId(): ?int
@ -1119,4 +1132,76 @@ class Business
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setBid($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getBid() === $this) {
$storeroomTicket->setBid(null);
}
}
return $this;
}
/**
* @return Collection<int, StoreroomItem>
*/
public function getStoreroomItems(): Collection
{
return $this->storeroomItems;
}
public function addStoreroomItem(StoreroomItem $storeroomItem): static
{
if (!$this->storeroomItems->contains($storeroomItem)) {
$this->storeroomItems->add($storeroomItem);
$storeroomItem->setBid($this);
}
return $this;
}
public function removeStoreroomItem(StoreroomItem $storeroomItem): static
{
if ($this->storeroomItems->removeElement($storeroomItem)) {
// set the owning side to null (unless already changed)
if ($storeroomItem->getBid() === $this) {
$storeroomItem->setBid(null);
}
}
return $this;
}
public function getStoreroomCode(): ?string
{
return $this->storeroomCode;
}
public function setStoreroomCode(?string $storeroomCode): static
{
$this->storeroomCode = $storeroomCode;
return $this;
}
}

View file

@ -54,12 +54,16 @@ class Commodity
#[ORM\ManyToOne(inversedBy: 'commodities')]
private ?CommodityCat $cat = null;
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: StoreroomItem::class, orphanRemoval: true)]
private Collection $storeroomItems;
public function __construct()
{
$this->setPriceBuy(0);
$this->setPriceSell(0);
$this->hesabdariRows = new ArrayCollection();
$this->commodityDropLinks = new ArrayCollection();
$this->storeroomItems = new ArrayCollection();
}
public function getId(): ?int
@ -234,4 +238,34 @@ class Commodity
return $this;
}
/**
* @return Collection<int, StoreroomItem>
*/
public function getStoreroomItems(): Collection
{
return $this->storeroomItems;
}
public function addStoreroomItem(StoreroomItem $storeroomItem): static
{
if (!$this->storeroomItems->contains($storeroomItem)) {
$this->storeroomItems->add($storeroomItem);
$storeroomItem->setCommodity($this);
}
return $this;
}
public function removeStoreroomItem(StoreroomItem $storeroomItem): static
{
if ($this->storeroomItems->removeElement($storeroomItem)) {
// set the owning side to null (unless already changed)
if ($storeroomItem->getCommodity() === $this) {
$storeroomItem->setCommodity(null);
}
}
return $this;
}
}

View file

@ -85,11 +85,15 @@ class HesabdariDoc
#[ORM\Column(length: 255, nullable: true)]
private ?string $status = null;
#[ORM\OneToMany(mappedBy: 'doc', targetEntity: StoreroomTicket::class)]
private Collection $storeroomTickets;
public function __construct()
{
$this->hesabdariRows = new ArrayCollection();
$this->plugNoghreOrders = new ArrayCollection();
$this->relatedDocs = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
}
public function getId(): ?int
@ -372,4 +376,34 @@ class HesabdariDoc
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setDoc($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getDoc() === $this) {
$storeroomTicket->setDoc(null);
}
}
return $this;
}
}

View file

@ -103,11 +103,16 @@ class Person
#[ORM\Column(length: 255, nullable: true)]
private ?string $fax = null;
#[Ignore]
#[ORM\OneToMany(mappedBy: 'Person', targetEntity: StoreroomTicket::class)]
private Collection $storeroomTickets;
public function __construct()
{
$this->hesabdariRows = new ArrayCollection();
$this->plugNoghreOrders = new ArrayCollection();
$this->ordersFromCustomer = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
}
public function getId(): ?int
@ -492,4 +497,34 @@ class Person
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setPerson($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getPerson() === $this) {
$storeroomTicket->setPerson(null);
}
}
return $this;
}
}

View file

@ -3,6 +3,8 @@
namespace App\Entity;
use App\Repository\StoreroomRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StoreroomRepository::class)]
@ -32,6 +34,18 @@ class Storeroom
#[ORM\Column(nullable: true)]
private ?bool $active = null;
#[ORM\OneToMany(mappedBy: 'Storeroom', targetEntity: StoreroomItem::class, orphanRemoval: true)]
private Collection $storeroomItems;
#[ORM\OneToMany(mappedBy: 'storeroom', targetEntity: StoreroomTicket::class, orphanRemoval: true)]
private Collection $storeroomTickets;
public function __construct()
{
$this->storeroomItems = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
@ -108,4 +122,64 @@ class Storeroom
return $this;
}
/**
* @return Collection<int, StoreroomItem>
*/
public function getStoreroomItems(): Collection
{
return $this->storeroomItems;
}
public function addStoreroomItem(StoreroomItem $storeroomItem): static
{
if (!$this->storeroomItems->contains($storeroomItem)) {
$this->storeroomItems->add($storeroomItem);
$storeroomItem->setStoreroom($this);
}
return $this;
}
public function removeStoreroomItem(StoreroomItem $storeroomItem): static
{
if ($this->storeroomItems->removeElement($storeroomItem)) {
// set the owning side to null (unless already changed)
if ($storeroomItem->getStoreroom() === $this) {
$storeroomItem->setStoreroom(null);
}
}
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setStoreroom($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getStoreroom() === $this) {
$storeroomTicket->setStoreroom(null);
}
}
return $this;
}
}

View file

@ -0,0 +1,144 @@
<?php
namespace App\Entity;
use App\Repository\StoreroomItemRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StoreroomItemRepository::class)]
class StoreroomItem
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'storeroomItems')]
#[ORM\JoinColumn(nullable: false)]
private ?StoreroomTicket $ticket = null;
#[ORM\ManyToOne(inversedBy: 'storeroomItems')]
#[ORM\JoinColumn(nullable: false)]
private ?Commodity $commodity = null;
#[ORM\Column(length: 255)]
private ?string $type = null;
#[ORM\Column(length: 255)]
private ?string $count = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $des = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $referal = null;
#[ORM\ManyToOne(inversedBy: 'storeroomItems')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\ManyToOne(inversedBy: 'storeroomItems')]
#[ORM\JoinColumn(nullable: false)]
private ?Storeroom $Storeroom = null;
public function getId(): ?int
{
return $this->id;
}
public function getTicket(): ?StoreroomTicket
{
return $this->ticket;
}
public function setTicket(?StoreroomTicket $ticket): static
{
$this->ticket = $ticket;
return $this;
}
public function getCommodity(): ?Commodity
{
return $this->commodity;
}
public function setCommodity(?Commodity $commodity): static
{
$this->commodity = $commodity;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
public function getCount(): ?string
{
return $this->count;
}
public function setCount(string $count): static
{
$this->count = $count;
return $this;
}
public function getDes(): ?string
{
return $this->des;
}
public function setDes(?string $des): static
{
$this->des = $des;
return $this;
}
public function getReferal(): ?string
{
return $this->referal;
}
public function setReferal(?string $referal): static
{
$this->referal = $referal;
return $this;
}
public function getBid(): ?Business
{
return $this->bid;
}
public function setBid(?Business $bid): static
{
$this->bid = $bid;
return $this;
}
public function getStoreroom(): ?Storeroom
{
return $this->Storeroom;
}
public function setStoreroom(?Storeroom $Storeroom): static
{
$this->Storeroom = $Storeroom;
return $this;
}
}

View file

@ -0,0 +1,305 @@
<?php
namespace App\Entity;
use App\Repository\StoreroomTicketRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StoreroomTicketRepository::class)]
class StoreroomTicket
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
#[ORM\JoinColumn(nullable: false)]
private ?User $submitter = null;
#[ORM\Column(length: 255)]
private ?string $date = null;
#[ORM\Column(length: 255)]
private ?string $dateSubmit = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $transfer = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $receiver = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column(length: 255)]
private ?string $type = null;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
private ?Person $Person = null;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
private ?HesabdariDoc $doc = null;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
#[ORM\JoinColumn(nullable: false)]
private ?Year $year = null;
#[ORM\OneToMany(mappedBy: 'ticket', targetEntity: StoreroomItem::class, orphanRemoval: true)]
private Collection $storeroomItems;
#[ORM\ManyToOne(inversedBy: 'storeroomTickets')]
#[ORM\JoinColumn(nullable: false)]
private ?Storeroom $storeroom = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?StoreroomTransferType $transferType = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $referral = null;
#[ORM\Column(length: 255)]
private ?string $typeString = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $des = null;
public function __construct()
{
$this->storeroomItems = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getBid(): ?Business
{
return $this->bid;
}
public function setBid(?Business $bid): static
{
$this->bid = $bid;
return $this;
}
public function getSubmitter(): ?User
{
return $this->submitter;
}
public function setSubmitter(?User $submitter): static
{
$this->submitter = $submitter;
return $this;
}
public function getDate(): ?string
{
return $this->date;
}
public function setDate(string $date): static
{
$this->date = $date;
return $this;
}
public function getDateSubmit(): ?string
{
return $this->dateSubmit;
}
public function setDateSubmit(string $dateSubmit): static
{
$this->dateSubmit = $dateSubmit;
return $this;
}
public function getTransfer(): ?string
{
return $this->transfer;
}
public function setTransfer(?string $transfer): static
{
$this->transfer = $transfer;
return $this;
}
public function getReceiver(): ?string
{
return $this->receiver;
}
public function setReceiver(?string $receiver): static
{
$this->receiver = $receiver;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): static
{
$this->code = $code;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
public function getPerson(): ?Person
{
return $this->Person;
}
public function setPerson(?Person $Person): static
{
$this->Person = $Person;
return $this;
}
public function getDoc(): ?HesabdariDoc
{
return $this->doc;
}
public function setDoc(?HesabdariDoc $doc): static
{
$this->doc = $doc;
return $this;
}
public function getYear(): ?Year
{
return $this->year;
}
public function setYear(?Year $year): static
{
$this->year = $year;
return $this;
}
/**
* @return Collection<int, StoreroomItem>
*/
public function getStoreroomItems(): Collection
{
return $this->storeroomItems;
}
public function addStoreroomItem(StoreroomItem $storeroomItem): static
{
if (!$this->storeroomItems->contains($storeroomItem)) {
$this->storeroomItems->add($storeroomItem);
$storeroomItem->setTicket($this);
}
return $this;
}
public function removeStoreroomItem(StoreroomItem $storeroomItem): static
{
if ($this->storeroomItems->removeElement($storeroomItem)) {
// set the owning side to null (unless already changed)
if ($storeroomItem->getTicket() === $this) {
$storeroomItem->setTicket(null);
}
}
return $this;
}
public function getStoreroom(): ?Storeroom
{
return $this->storeroom;
}
public function setStoreroom(?Storeroom $storeroom): static
{
$this->storeroom = $storeroom;
return $this;
}
public function getTransferType(): ?StoreroomTransferType
{
return $this->transferType;
}
public function setTransferType(?StoreroomTransferType $transferType): static
{
$this->transferType = $transferType;
return $this;
}
public function getReferral(): ?string
{
return $this->referral;
}
public function setReferral(?string $referral): static
{
$this->referral = $referral;
return $this;
}
public function getTypeString(): ?string
{
return $this->typeString;
}
public function setTypeString(string $typeString): static
{
$this->typeString = $typeString;
return $this;
}
public function getDes(): ?string
{
return $this->des;
}
public function setDes(?string $des): static
{
$this->des = $des;
return $this;
}
}

View file

@ -0,0 +1,35 @@
<?php
namespace App\Entity;
use App\Repository\StoreroomTransferTypeRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StoreroomTransferTypeRepository::class)]
class StoreroomTransferType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
}

View file

@ -89,6 +89,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: WalletTransaction::class)]
private Collection $walletTransactions;
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: StoreroomTicket::class, orphanRemoval: true)]
private Collection $storeroomTickets;
public function __construct()
{
$this->userTokens = new ArrayCollection();
@ -105,6 +108,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->emailHistories = new ArrayCollection();
$this->sMSPays = new ArrayCollection();
$this->walletTransactions = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
}
public function getId(): ?int
@ -668,4 +672,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setSubmitter($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getSubmitter() === $this) {
$storeroomTicket->setSubmitter(null);
}
}
return $this;
}
}

View file

@ -44,10 +44,15 @@ class Year
#[Ignore]
private Collection $hesabdariRows;
#[ORM\OneToMany(mappedBy: 'year', targetEntity: StoreroomTicket::class, orphanRemoval: true)]
#[Ignore]
private Collection $storeroomTickets;
public function __construct()
{
$this->hesabdariDocs = new ArrayCollection();
$this->hesabdariRows = new ArrayCollection();
$this->storeroomTickets = new ArrayCollection();
}
public function getId(): ?int
@ -186,4 +191,34 @@ class Year
return $this;
}
/**
* @return Collection<int, StoreroomTicket>
*/
public function getStoreroomTickets(): Collection
{
return $this->storeroomTickets;
}
public function addStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if (!$this->storeroomTickets->contains($storeroomTicket)) {
$this->storeroomTickets->add($storeroomTicket);
$storeroomTicket->setYear($this);
}
return $this;
}
public function removeStoreroomTicket(StoreroomTicket $storeroomTicket): static
{
if ($this->storeroomTickets->removeElement($storeroomTicket)) {
// set the owning side to null (unless already changed)
if ($storeroomTicket->getYear() === $this) {
$storeroomTicket->setYear(null);
}
}
return $this;
}
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\StoreroomItem;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<StoreroomItem>
*
* @method StoreroomItem|null find($id, $lockMode = null, $lockVersion = null)
* @method StoreroomItem|null findOneBy(array $criteria, array $orderBy = null)
* @method StoreroomItem[] findAll()
* @method StoreroomItem[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class StoreroomItemRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, StoreroomItem::class);
}
// /**
// * @return StoreroomItem[] Returns an array of StoreroomItem objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?StoreroomItem
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\StoreroomTicket;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<StoreroomTicket>
*
* @method StoreroomTicket|null find($id, $lockMode = null, $lockVersion = null)
* @method StoreroomTicket|null findOneBy(array $criteria, array $orderBy = null)
* @method StoreroomTicket[] findAll()
* @method StoreroomTicket[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class StoreroomTicketRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, StoreroomTicket::class);
}
// /**
// * @return StoreroomTicket[] Returns an array of StoreroomTicket objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?StoreroomTicket
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\StoreroomTransferType;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<StoreroomTransferType>
*
* @method StoreroomTransferType|null find($id, $lockMode = null, $lockVersion = null)
* @method StoreroomTransferType|null findOneBy(array $criteria, array $orderBy = null)
* @method StoreroomTransferType[] findAll()
* @method StoreroomTransferType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class StoreroomTransferTypeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, StoreroomTransferType::class);
}
// /**
// * @return StoreroomTransferType[] Returns an array of StoreroomTransferType objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?StoreroomTransferType
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -8,7 +8,10 @@ use App\Entity\PrinterQueue;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use PhpOffice\PhpSpreadsheet\Writer\Exception;
use ReflectionClass;
use ReflectionException;
use ReflectionFunction;
use ReflectionMethod;
use Symfony\Component\HttpFoundation\Request;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
@ -88,7 +91,7 @@ class Provider
}
/**
* @throws \ReflectionException
* @throws ReflectionException
*/
public function Entity2Array($entity, int $deep = 1, array $ignores = []): null|array{
if(is_null($entity)) return [];
@ -104,14 +107,13 @@ class Provider
$getMethods[] = trim(trim($method));
}
}
//var_dump($getMethods);
foreach ($getMethods as $method){
if(!is_int(array_search(lcfirst(trim(str_replace(['get','is'], '', $method))), $ignores))) {
if (method_exists($entity, $method)) {
$method = trim(trim($method));
$canProced = true;
$reflection = new \ReflectionMethod($entity, $method);
if ($reflection->isPublic() && !str_starts_with('\\0', $method)) {
if ($reflection->isPublic() && $method != 'get' && !str_starts_with('\\0', $method)) {
$value = $entity->$method();
} else
$canProced = false;
@ -120,7 +122,7 @@ class Provider
$result[lcfirst(str_replace(['get','is'], '', $method))] = $value;
} else {
if ($deep != 0) {
$result[lcfirst(str_replace(['get','is'], '', $method))] = $this->Entity2Array($value, $deep - 1);
$result[lcfirst(str_replace(['get','is'], '', $method))] = $this->Entity2Array($value, $deep - 1,$ignores);
}
}
}
@ -176,4 +178,38 @@ class Provider
private function RandomString($length = 32) {
return substr(str_shuffle(str_repeat($x='23456789ABCDEFGHJKLMNPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length);
}
/**
* @throws ReflectionException
*/
public function Entity2ArrayJustIncludes($entity, array $includes, int $deep = 1): null|array{
if(is_null($entity)) return [];
$result = [];
foreach ($includes as $method){
if (method_exists($entity, $method)) {
$method = trim(trim($method));
$value = $entity->$method();
if (!is_object($value)) {
$result[lcfirst(str_replace(['get','is'], '', $method))] = $value;
} else {
if ($deep != 0) {
$result[lcfirst(str_replace(['get','is'], '', $method))] = $this->Entity2ArrayJustIncludes($value,$includes, $deep - 1);
}
}
}
}
return $result;
}
/**
* @throws ReflectionException
*/
public function ArrayEntity2ArrayJustIncludes(array $entity, array $includes, int $deep = 1): null|array{
if(count($entity) == 0) return [];
$result = [];
foreach ($entity as $item){
$result[] = $this->Entity2ArrayJustIncludes($item,$includes,$deep);
}
return $result;
}
}

View file

@ -100,12 +100,6 @@
<span class="nav-main-link-name"> راهنمای استفاده </span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/app/support/list">
<i class="nav-main-link-icon fa fa-book"></i>
<span class="nav-main-link-name"> پشتیبانی </span>
</a>
</li>
<li class="nav-main-item">
<a class="nav-main-link" href="/app/blog/posts/list">
<i class="nav-main-link-icon fa fa-book"></i>

View file

@ -1,57 +0,0 @@
{% extends "app/base.html.twig" %}
{% block title %}لیست درخواست‌ها{% endblock %}
{% block body %}
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">
<i class="fa fa-list"></i>
{{ block('title') }}
</h3>
<div class="block-options">
<div class="block-options-item">
<a href="/app/guide/new" class="btn btn-success">جدید</a>
</div>
</div>
</div>
<div class="block-content table-responsive">
<table class="table table-hover table-vcenter table-sm text-center">
<thead>
<tr>
<th class="text-center" style="width: 50px;">#</th>
<th>کاربر</th>
<th>عنوان</th>
<th>تاریخ</th>
<th>وضعیت</th>
<th class="text-center" style="width: 100px;">عملیات</th>
</tr>
</thead>
<tbody>
{% for index,item in items %}
<tr>
<th class="text-center" scope="row">{{ index + 1}}</th>
<td class="fw-semibold">
{{ item.submitter.fullname }}
</td>
<td class="fw-semibold">
{{ item.title }}
</td>
<td>
{{ Jdate.jdate('Y/n/d H:i',item.dateSubmit) }}
</td>
<td class="fw-semibold">
{{ item.state }}
</td>
<td class="text-center">
<div class="btn-group">
<a href="{{ path('app_front_support_view',{'id':item.id}) }}" class="btn btn-sm btn-alt-secondary" aria-label=" حذف ">
<i class="fa fa-eye"></i>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View file

@ -1,41 +0,0 @@
{% extends "app/base.html.twig" %}
{% block title %}مشاهده درخواست{% endblock %}
{% block body %}
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">
<i class="fa fa-list"></i>
{{ block('title') }}
</h3>
<div class="block-options">
<div class="block-options-item">
<a href="/app/support/list" class="btn btn-success">بازگشت</a>
</div>
</div>
</div>
<div class="block-content">
<div class="alert alert-success">
<p class="alert-heading">{{ item.title }}</p>
<hr>
<p>
<b>{{ item.submitter.fullname }}:</b>
{{ item.body }}
</p>
</div>
{% for replay in replays %}
<div class="alert alert-success">
<p>
<b>{{ replay.submitter.fullname }}:</b>
{{ replay.body }}</p>
</div>
{% endfor %}
{{ form_start(form) }}
{{ form_row(form.body,{'body':{'class':'mb-2'}}) }}
<div class="mb-4">
{{ form_widget(form.submit) }}
<a href="/app/support/list" class="btn btn-primary">بازگشت</a>
</div>
{{ form_end(form) }}
</div>
</div>
{% endblock %}

View file

@ -1,11 +1,12 @@
<!DOCTYPE html>
<html dir="rtl">
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<meta lang="fa">
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
<meta content="حسابیکس اولین نرم افزار حسابداری ابری متن باز و کاملا رایگان است که توسط گروهی از توسعه دهندگان منتشر و به روز می شود.برای استفاده از حسابیکس هیچ هزینه ای دریافت نمی شود.حسابیکس بر بستر وب بوده و برای استفاده از آن لزومی به نصب نرم افزار و ... نمی باشد و تنها از طریق وب و بر روی موبایل،تبلت و رایانه به صورت همیشگی در دسترس است." name="description"/>
<meta content="حسابیکس نرم افزار حسابداری ابری متن باز و کاملا رایگان است که بر بستر ابر ارائه می‌شود.حسابیکس بر بستر وب بوده و برای استفاده از آن لزومی به نصب نرم افزار و ... نمی باشد و تنها از طریق وب و بر روی موبایل،تبلت و رایانه به صورت همیشگی در دسترس است." name="description"/>
<meta content="Babak Alizadeh" name="author"/>
<meta content="توسعه فناوری سرکش" name="publisher"/>
<meta name="keywords" content="hesabix,hesabix.ir,accounting,pshfd;s,اثسشذهط,حسابداری,حسابداری آنلاین,حسابداری رایگان,حسابداری ابری,حسابداری تحت وب,نرم افزار حسابداری,بهترین نرم افزار حسابداری آنلاین">
<title>حسابیکس - {% block title %}{% endblock %}</title>
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
@ -243,7 +244,7 @@
<script src="https://www.zarinpal.com/webservice/TrustCode" type="text/javascript"></script>
</div>
<div class="col">
<img src="/img/enamad-logo.png" class="img-thumbnail" style="max-height: 120px;">
<img alt="نماد اعتماد الکترونیکی" src="/img/enamad-logo.png" class="img-thumbnail" style="max-height: 120px;">
</div>
</div>
</div>

View file

@ -4,9 +4,9 @@
<div class="px-4 py-3 text-center rounded-4 bg-light">
<div class="row">
<div class="col-sm-12 col-md-6">
<h2 class="fw-bold text-primary-darker">
<img class="" src="/img/logo-blue.png" alt="" width="72" height="72">
حسابداری آنلاین حسابیکس</h2>
<h1 class="fw-bold text-primary-darker">
<img class="" src="/img/logo-blue.png" alt="حسابیکس لوگو" width="72" height="72">
حسابداری آنلاین حسابیکس</h1>
<p class="lead mb-4">
برای کار با حسابیکس فقط به یک دستگاه متصل به اینترنت نیاز دارید، فرقی نمی‌کند که این دستگاه تبلت یا موبایل باشد یا اینکه رایانه و لپ تاپ.
نیاز نیست که هیچگونه نرم افزاری را نصب کنید. کافیست در سایت ثبت نام کرده و بلافاصله کسب و کار خود را مدیریت کنید.
@ -31,7 +31,7 @@
</div>
<div class="col-sm-12 col-md-6">
<img class="img-fluid img-thumbnail" src="/img/cover.jpg" />
<img alt="پیش نمایش حسابیکس" class="img-fluid img-thumbnail" src="/img/cover.jpg" />
</div>
</div>
</div>

View file

@ -1,138 +1,122 @@
<urlset>
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://hesabix.ir/</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>1.0</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://hesabix.ir/front/faq</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.6</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/blog/home</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.6</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/about</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/contact</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/terms</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/privacy</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/open-source</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>2023-10-20T11:24:11+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/general</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/api</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.6</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/update-list</loc>
<lastmod>2023-08-08T00:41:19+01:00</lastmod>
<priority>0.8</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/person</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/commodity</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/banks</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/buy</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/sell</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/reports</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/guide/settings</loc>
<lastmod>2023-08-08T00:41:21+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>
https://hesabix.ir/front/blog/post/%D8%A8%D9%87_%D8%B1%D9%88%D8%B2_%D8%B1%D8%B3%D8%A7%D9%86%DB%8C
</loc>
<lastmod>2023-08-08T00:41:22+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>
https://hesabix.ir/front/blog/post/%D8%A8%D9%87_%D8%B1%D9%88%D8%B2_%D8%B1%D8%B3%D8%A7%D9%86%DB%8C2
</loc>
<lastmod>2023-08-08T00:41:22+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>
https://hesabix.ir/front/blog/post/%D8%A7%D9%85%DA%A9%D8%A7%D9%86%D8%A7%D8%AA_%D8%AC%D8%AF%DB%8C%D8%AF
</loc>
<lastmod>2023-08-08T00:41:22+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/api/2</loc>
<lastmod>2023-08-08T00:41:25+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/api/3</loc>
<lastmod>2023-08-08T00:41:25+01:00</lastmod>
<priority>0.4</priority>
</url>
<url>
<loc>https://hesabix.ir/front/help/api/4</loc>
<lastmod>2023-08-08T00:41:25+01:00</lastmod>
<priority>0.4</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
<url>
<loc>https://hesabix.ir/login</loc>
<lastmod>2023-08-08T00:41:27+01:00</lastmod>
<priority>1.0</priority>
<lastmod>{{ timeNow }}</lastmod>
<priority>0.64</priority>
</url>
{% for blog in blogs %}
<url>
<loc>{{ absolute_url(path('general_blog_post',{'url':blog.url})) }}</loc>
<lastmod>{{ blog.dateSubmit | date('c') }}</lastmod>
<priority>0.80</priority>
</url>
{% endfor %}
{% for doc in docs %}
<url>
<loc>{{ absolute_url(path('general_help_api',{'id':doc.id})) }}</loc>
<lastmod>{% if doc.dateSubmit is null %}{{ timeNow }}{% else %}{{ doc.dateSubmit | date('c') }}{% endif %}</lastmod>
<priority>0.80</priority>
</url>
{% endfor %}
</urlset>

View file

@ -24,6 +24,8 @@ DirectoryIndex index.php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper

3
public_html/robots.txt Normal file
View file

@ -0,0 +1,3 @@
User-agent: *
Disallow:
Disallow: /cgi-bin/