some bug fix and add fastsell print options

This commit is contained in:
Hesabix 2024-12-06 21:01:03 +00:00
parent e8f6c05159
commit f1c1c4a593
3 changed files with 55 additions and 1 deletions

View file

@ -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;

View file

@ -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([

View file

@ -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;
}
}