From f1c1c4a59355366ee36e99b14fe709126f80deb1 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Fri, 6 Dec 2024 21:01:03 +0000 Subject: [PATCH] some bug fix and add fastsell print options --- .../src/Controller/CommodityController.php | 1 + .../src/Controller/PrintersController.php | 10 ++++- hesabixCore/src/Entity/PrintOptions.php | 45 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/hesabixCore/src/Controller/CommodityController.php b/hesabixCore/src/Controller/CommodityController.php index 5ebb531..2ea9fa1 100644 --- a/hesabixCore/src/Controller/CommodityController.php +++ b/hesabixCore/src/Controller/CommodityController.php @@ -129,6 +129,7 @@ class CommodityController extends AbstractController 'name' => $item->getUnit()->getName(), 'floatNumber' => $item->getUnit()->getFloatNumber(), ]; + $temp['barcodes'] = $item->getBarcodes(); //calculate count if ($item->isKhadamat()) { $temp['count'] = 0; diff --git a/hesabixCore/src/Controller/PrintersController.php b/hesabixCore/src/Controller/PrintersController.php index fbfa861..f5a6bf7 100644 --- a/hesabixCore/src/Controller/PrintersController.php +++ b/hesabixCore/src/Controller/PrintersController.php @@ -86,6 +86,10 @@ class PrintersController extends AbstractController $temp['rfsell']['pays'] = $settings->isRfsellPays(); $temp['rfsell']['paper'] = $settings->getRfsellPaper(); + $temp['fastsell']['cashdeskTicket'] = $settings->isFastsellCashdeskTicket(); + $temp['fastsell']['invoice'] = $settings->isFastsellInvoice(); + $temp['fastsell']['pdf'] = $settings->isFastsellPdf(); + $temp['repservice']['noteString'] = $settings->getRepserviceNoteString(); $temp['repservice']['paper'] = $settings->getRepServicePaper(); if(!$temp['rfsell']['paper']) { $temp['rfsell']['paper'] = 'A4-L'; } @@ -151,6 +155,10 @@ class PrintersController extends AbstractController $settings->setRepserviceNoteString($params['repservice']['noteString']); $settings->setRepServicePaper($params['repservice']['paper']); + $settings->setFastsellCashdeskTicket($params['fastsell']['cashdeskTicket']); + $settings->setFastsellInvoice($params['fastsell']['invoice']); + $settings->setFastsellPdf($params['fastsell']['pdf']); + $entityManager->persist($settings); $entityManager->flush(); $log->insert('تنظیمات چاپ', 'تنظیمات چاپ به روز رسانی شد.', $this->getUser(), $acc['bid']->getId()); @@ -221,7 +229,7 @@ class PrintersController extends AbstractController #[Route('/api/print/last', name: 'app_print_last')] public function app_print_last(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): Response { - $acc = $access->hasRole('owner'); + $acc = $access->hasRole('join'); if (!$acc) throw $this->createAccessDeniedException(); $printer = $entityManager->getRepository(Printer::class)->findBy([ diff --git a/hesabixCore/src/Entity/PrintOptions.php b/hesabixCore/src/Entity/PrintOptions.php index 0e076bc..27f4db4 100644 --- a/hesabixCore/src/Entity/PrintOptions.php +++ b/hesabixCore/src/Entity/PrintOptions.php @@ -111,6 +111,15 @@ class PrintOptions #[ORM\Column(length: 255, nullable: true)] private ?string $repservicePaper = null; + #[ORM\Column(nullable: true)] + private ?bool $fastsellInvoice = null; + + #[ORM\Column(nullable: true)] + private ?bool $fastsellPdf = null; + + #[ORM\Column(nullable: true)] + private ?bool $fastsellCashdeskTicket = null; + public function getId(): ?int { return $this->id; @@ -499,4 +508,40 @@ class PrintOptions return $this; } + + public function isFastsellInvoice(): ?bool + { + return $this->fastsellInvoice; + } + + public function setFastsellInvoice(?bool $fastsellInvoice): static + { + $this->fastsellInvoice = $fastsellInvoice; + + return $this; + } + + public function isFastsellPdf(): ?bool + { + return $this->fastsellPdf; + } + + public function setFastsellPdf(?bool $fastsellPdf): static + { + $this->fastsellPdf = $fastsellPdf; + + return $this; + } + + public function isFastsellCashdeskTicket(): ?bool + { + return $this->fastsellCashdeskTicket; + } + + public function setFastsellCashdeskTicket(?bool $fastsellCashdeskTicket): static + { + $this->fastsellCashdeskTicket = $fastsellCashdeskTicket; + + return $this; + } }