start working on pre invoices
This commit is contained in:
parent
a106075b25
commit
f85d73e195
|
@ -147,6 +147,37 @@ class AdminController extends AbstractController
|
|||
return $this->json($resp);
|
||||
}
|
||||
|
||||
#[Route('/api/admin/business/count', name: 'admin_business_count')]
|
||||
public function admin_business_count(Jdate $jdate, #[CurrentUser] ?User $user, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->json($entityManager->getRepository(Business::class)->countAll());
|
||||
}
|
||||
|
||||
#[Route('/api/admin/business/search', name: 'admin_business_list_search')]
|
||||
public function admin_business_list_search(Jdate $jdate, #[CurrentUser] ?User $user, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager, Request $request): Response
|
||||
{
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
$items = $entityManager->getRepository(Business::class)->findByPage($params['options']['page'],$params['options']['rowsPerPage'],$params['search']);
|
||||
$resp = [];
|
||||
foreach ($items as $item) {
|
||||
$temp = [];
|
||||
$temp['id'] = $item->getId();
|
||||
$temp['name'] = $item->getName();
|
||||
$temp['owner'] = $item->getOwner()->getFullName();
|
||||
$temp['ownerMobile'] = $item->getOwner()->getMobile();
|
||||
$temp['dateRegister'] = $jdate->jdate('Y/n/d', $item->getDateSubmit());
|
||||
$temp['commodityCount'] = count($entityManager->getRepository(Commodity::class)->findBy(['bid' => $item]));
|
||||
$temp['personsCount'] = count($entityManager->getRepository(Person::class)->findBy(['bid' => $item]));
|
||||
$temp['hesabdariDocsCount'] = count($entityManager->getRepository(HesabdariDoc::class)->findBy(['bid' => $item]));
|
||||
$temp['StoreroomDocsCount'] = count($entityManager->getRepository(StoreroomTicket::class)->findBy(['bid' => $item]));
|
||||
$resp[] = $temp;
|
||||
}
|
||||
return $this->json($resp);
|
||||
}
|
||||
|
||||
#[Route('/api/admin/settings/sms/info', name: 'admin_settings_sms_info')]
|
||||
public function admin_settings_sms_info(Jdate $jdate, #[CurrentUser] ?User $user, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager, Request $request): Response
|
||||
{
|
||||
|
|
18
hesabixCore/src/Controller/PreinvoiceController.php
Normal file
18
hesabixCore/src/Controller/PreinvoiceController.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class PreinvoiceController extends AbstractController
|
||||
{
|
||||
#[Route('/preinvoice', name: 'app_preinvoice')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('preinvoice/index.html.twig', [
|
||||
'controller_name' => 'PreinvoiceController',
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -39,20 +39,34 @@ class BusinessRepository extends ServiceEntityRepository
|
|||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Business[] Returns an array of Business objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('b')
|
||||
// ->andWhere('b.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('b.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
/**
|
||||
* @return Business[] Returns an array of Business objects
|
||||
*/
|
||||
public function findByPage($page = 0, $take = 25, $search = ''): array
|
||||
{
|
||||
$query = $this->createQueryBuilder('b')
|
||||
->setFirstResult($page * $take)
|
||||
->orderBy('b.id', 'DESC')
|
||||
->setMaxResults($take);
|
||||
|
||||
if ($search != '') {
|
||||
$query->andWhere("b.name LIKE :search")
|
||||
->setParameter('search', '%' . $search . '%');
|
||||
}
|
||||
return $query->getQuery()->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return integer Returns an integer of Business objects
|
||||
*/
|
||||
public function countAll(): int
|
||||
{
|
||||
return $this->createQueryBuilder('b')
|
||||
->select('count(b.id)')
|
||||
->getQuery()
|
||||
->getSingleScalarResult()
|
||||
;
|
||||
}
|
||||
|
||||
// public function findOneBySomeField($value): ?Business
|
||||
// {
|
||||
|
@ -64,7 +78,8 @@ class BusinessRepository extends ServiceEntityRepository
|
|||
// ;
|
||||
// }
|
||||
|
||||
public function findLast(){
|
||||
public function findLast()
|
||||
{
|
||||
$res = $this->createQueryBuilder('p')
|
||||
->orderBy('p.id', 'ASC')
|
||||
->getQuery()
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
مشاهده لیست دستگاه های تعمیری
|
||||
</li>
|
||||
<li>
|
||||
درج سریال/پلاک دستگاه های تعمیری درقبض پذیرش
|
||||
درج س{{doc.money.shortName}}/پلاک دستگاه های تعمیری درقبض پذیرش
|
||||
</li>
|
||||
<li>
|
||||
ارسال پیامک خودکار هنگام تغییر وضعیت دستگاه به آماده تحویل
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
content: " {{doc.money.shortName}} ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
|
|
20
hesabixCore/templates/preinvoice/index.html.twig
Normal file
20
hesabixCore/templates/preinvoice/index.html.twig
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello PreinvoiceController!{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<h1>Hello {{ controller_name }}! ✅</h1>
|
||||
|
||||
This friendly message is coming from:
|
||||
<ul>
|
||||
<li>Your controller at <code>/var/www/next.hesabix.ir/hesabixCore/src/Controller/PreinvoiceController.php</code></li>
|
||||
<li>Your template at <code>/var/www/next.hesabix.ir/hesabixCore/templates/preinvoice/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -31,18 +31,19 @@
|
|||
{{doc.code}}
|
||||
</span>
|
||||
</h3>
|
||||
<div class="block-options">
|
||||
<div
|
||||
class="block-options">
|
||||
<!-- Print Page functionality is initialized dmPrint() -->
|
||||
<a class="btn btn-sm btn-alt-secondary me-3" type="button" target="_blank" href="{{path('shortlinks_pdf',{bid:bid.id,link:link})}}">
|
||||
<i class="si si-printer me-1"></i>
|
||||
چاپ فاکتور
|
||||
</a>
|
||||
{% if (totalPays < doc.amount) and bid.walletEnable %}
|
||||
{% if (totalPays < doc.amount) and bid.walletEnable and doc.money.name == 'IRR' %}
|
||||
<a href="{{ path('pay_sell',{'id':doc.id}) }}" class="btn btn-sm btn-success">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
پرداخت آنلاین مبلغ
|
||||
{{ (doc.amount - totalPays) | number_format }}
|
||||
ریال
|
||||
{{doc.money.shortName}}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -65,7 +66,8 @@
|
|||
<p class="mb-0">پرداخت فاکتور ناموفق بود. برای پرداخت مجدد میتوانید دوباره سعی نمایید.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="p-sm-2 p-xl-1">
|
||||
<div
|
||||
class="p-sm-2 p-xl-1">
|
||||
<!-- Invoice Info -->
|
||||
<div
|
||||
class="row mb-5">
|
||||
|
@ -213,9 +215,11 @@
|
|||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
{% if item.type == 'walletPay' %}
|
||||
<td class="text-success"><i class="fa fa-wallet"></i>پرداخت آنلاین</td>
|
||||
<td class="text-success">
|
||||
<i class="fa fa-wallet"></i>پرداخت آنلاین</td>
|
||||
{% else %}
|
||||
<td class="text-primary"><i class="fa fa-file"></i>سند حسابداری</td>
|
||||
<td class="text-primary">
|
||||
<i class="fa fa-file"></i>سند حسابداری</td>
|
||||
{% endif %}
|
||||
<td>{{ item.date}}</td>
|
||||
<td>{{ item.amount | number_format }}</td>
|
||||
|
@ -226,7 +230,7 @@
|
|||
<tr class="">
|
||||
<td class="fw-bold text-uppercase text-end bg-body-light" colspan="5">جمع کل</td>
|
||||
<td class="fw-bold text-end bg-body-light">{{ totalPays | number_format }}
|
||||
ریال
|
||||
{{doc.money.shortName}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue