Compare commits
No commits in common. "2dde89e03ce573726d31bddd1394e6500022f4d3" and "28ad56d972703aa380d1d6eb2c5a341108ea49de" have entirely different histories.
2dde89e03c
...
28ad56d972
|
@ -7,7 +7,6 @@ use App\Entity\HesabdariRow;
|
||||||
use App\Entity\HesabdariTable;
|
use App\Entity\HesabdariTable;
|
||||||
use App\Service\Access;
|
use App\Service\Access;
|
||||||
use App\Service\Extractor;
|
use App\Service\Extractor;
|
||||||
use App\Service\Provider;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
@ -20,14 +19,12 @@ class HesabdariDocController extends AbstractController
|
||||||
private $em;
|
private $em;
|
||||||
private $access;
|
private $access;
|
||||||
private $extractor;
|
private $extractor;
|
||||||
private $provider;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, Access $access, Extractor $extractor, Provider $provider)
|
public function __construct(EntityManagerInterface $em, Access $access, Extractor $extractor)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->access = $access;
|
$this->access = $access;
|
||||||
$this->extractor = $extractor;
|
$this->extractor = $extractor;
|
||||||
$this->provider = $provider;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/hesabdari/tables', name: 'get_hesabdari_tables', methods: ['GET'])]
|
#[Route('/hesabdari/tables', name: 'get_hesabdari_tables', methods: ['GET'])]
|
||||||
|
@ -106,7 +103,7 @@ class HesabdariDocController extends AbstractController
|
||||||
$doc->setDate($data['date']);
|
$doc->setDate($data['date']);
|
||||||
$doc->setDateSubmit((string) time());
|
$doc->setDateSubmit((string) time());
|
||||||
$doc->setType('doc');
|
$doc->setType('doc');
|
||||||
$doc->setCode($this->provider->getAccountingCode($accessData['bid'], 'accounting'));
|
$doc->setCode($this->generateDocCode($accessData['bid']));
|
||||||
|
|
||||||
$totalBd = 0;
|
$totalBd = 0;
|
||||||
$totalBs = 0;
|
$totalBs = 0;
|
||||||
|
@ -193,5 +190,13 @@ class HesabdariDocController extends AbstractController
|
||||||
return new JsonResponse($this->extractor->operationSuccess(['id' => $doc->getId()], 'سند با موفقیت ویرایش شد'));
|
return new JsonResponse($this->extractor->operationSuccess(['id' => $doc->getId()], 'سند با موفقیت ویرایش شد'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function generateDocCode($business): string
|
||||||
|
{
|
||||||
|
$lastDoc = $this->em->getRepository(HesabdariDoc::class)->findOneBy(
|
||||||
|
['bid' => $business],
|
||||||
|
['code' => 'DESC']
|
||||||
|
);
|
||||||
|
$newCode = $lastDoc ? ((int) $lastDoc->getCode() + 1) : 1;
|
||||||
|
return (string) $newCode;
|
||||||
|
}
|
||||||
}
|
}
|
0
webUI/src/views/acc/rfsell/list.vue
Normal file → Executable file
0
webUI/src/views/acc/rfsell/list.vue
Normal file → Executable file
Loading…
Reference in a new issue