start working on cheques part
This commit is contained in:
parent
c6fb18001f
commit
ebca717c49
|
@ -213,6 +213,7 @@ class BusinessController extends AbstractController
|
|||
$perms->setSell(true);
|
||||
$perms->setCost(true);
|
||||
$perms->setIncome(true);
|
||||
$perms->setCheque(true);
|
||||
$perms->setReport(true);
|
||||
$perms->setAccounting(true);
|
||||
$perms->setLog(true);
|
||||
|
@ -382,6 +383,7 @@ class BusinessController extends AbstractController
|
|||
'settings'=>true,
|
||||
'persons'=>true,
|
||||
'commodity'=>true,
|
||||
'cheque'=>true,
|
||||
'getpay'=>true,
|
||||
'store'=>true,
|
||||
'bank'=>true,
|
||||
|
@ -423,6 +425,7 @@ class BusinessController extends AbstractController
|
|||
'cost'=>$perm->isCost(),
|
||||
'income'=>$perm->isIncome(),
|
||||
'buy'=>$perm->isBuy(),
|
||||
'cheque'=>$perm->isCheque(),
|
||||
'sell'=>$perm->isSell(),
|
||||
'accounting'=>$perm->isAccounting(),
|
||||
'report'=>$perm->isReport(),
|
||||
|
@ -489,6 +492,7 @@ class BusinessController extends AbstractController
|
|||
$perm->setStore($params['store']);
|
||||
$perm->setCost($params['cost']);
|
||||
$perm->setIncome($params['income']);
|
||||
$perm->setCheque($params['cheque']);
|
||||
$perm->setAccounting($params['accounting']);
|
||||
$perm->setReport($params['report']);
|
||||
$perm->setPermission($params['permission']);
|
||||
|
|
|
@ -58,4 +58,18 @@ class BuyController extends AbstractController
|
|||
|
||||
return $this->json(ServiceExplore::ExploreBuyDoc($doc));
|
||||
}
|
||||
|
||||
#[Route('/api/buy/get/invoices/list', name: 'app_buy_get_invoices_list')]
|
||||
public function app_buy_get_invoices_list(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager, string $code): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('buy');
|
||||
if(!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$invoices = $entityManager->getRepository(HesabdariDoc::class)->findBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'year'=>$acc['year'],
|
||||
'type'=>'buy'
|
||||
]);
|
||||
return $this->json(ServiceExplore::ExploreBuyDocsList($invoices));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,8 +178,10 @@ class HesabdariController extends AbstractController
|
|||
elseif($params['type'] == 'cost') $roll='cost';
|
||||
elseif($params['type'] == 'income') $roll='income';
|
||||
elseif($params['type'] == 'buy') $roll='buy';
|
||||
elseif($params['type'] == 'buy_rfb') $roll='buy';
|
||||
elseif($params['type'] == 'transfer') $roll='transfer';
|
||||
elseif($params['type'] == 'sell') $roll='sell';
|
||||
elseif($params['type'] == 'sell_rbs') $roll='buy';
|
||||
elseif($params['type'] == 'all') $roll='accounting';
|
||||
else
|
||||
$this->createNotFoundException();
|
||||
|
@ -216,7 +218,7 @@ class HesabdariController extends AbstractController
|
|||
'amount'=>$item->getAmount(),
|
||||
'submitter'=> $item->getSubmitter()->getFullName(),
|
||||
];
|
||||
if($params['type'] == 'buy' || $params['type'] == 'sell'){
|
||||
if($params['type'] == 'sell_rbs' || $params['type'] == 'buy_rfb' || $params['type'] == 'buy' || $params['type'] == 'sell'){
|
||||
$mainRow = $entityManager->getRepository(HesabdariRow::class)->getNotEqual($item,'person');
|
||||
$temp['person'] = '';
|
||||
if($mainRow)
|
||||
|
|
|
@ -102,6 +102,9 @@ class Permission
|
|||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $archiveView = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $cheque = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -454,4 +457,16 @@ class Permission
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isCheque(): ?bool
|
||||
{
|
||||
return $this->cheque;
|
||||
}
|
||||
|
||||
public function setCheque(?bool $cheque): static
|
||||
{
|
||||
$this->cheque = $cheque;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,4 +193,16 @@ class Explore{
|
|||
];
|
||||
}
|
||||
|
||||
public static function ExploreBuyDocsList(array $items){
|
||||
$result = [];
|
||||
foreach($items as $item){
|
||||
$result[] = [
|
||||
'id'=>$item->getId(),
|
||||
'date'=>$item->getDate(),
|
||||
'des'=>$item->getDes(),
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue