almost finish buy part
This commit is contained in:
parent
c9d17afeab
commit
387cd11935
|
@ -4,19 +4,25 @@ namespace App\Controller;
|
|||
|
||||
use App\Service\Log;
|
||||
use App\Service\Access;
|
||||
use App\Service\JsonResp;
|
||||
use App\Service\Explore;
|
||||
use App\Entity\Commodity;
|
||||
use App\Service\Provider;
|
||||
use App\Service\Extractor;
|
||||
use App\Entity\HesabdariDoc;
|
||||
use App\Entity\PersonType;
|
||||
use App\Entity\HesabdariRow;
|
||||
use App\Entity\HesabdariTable;
|
||||
use App\Entity\InvoiceType;
|
||||
use App\Entity\Person;
|
||||
use App\Entity\StoreroomTicket;
|
||||
use App\Service\Explore as ServiceExplore;
|
||||
use App\Service\Printers;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Explore;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
|
||||
class BuyController extends AbstractController
|
||||
{
|
||||
#[Route('/api/buy/edit/can/{code}', name: 'app_buy_can_edit')]
|
||||
|
@ -57,7 +63,7 @@ class BuyController extends AbstractController
|
|||
if(!$doc)
|
||||
throw $this->createNotFoundException();
|
||||
|
||||
return $this->json(ServiceExplore::ExploreBuyDoc($doc));
|
||||
return $this->json(Explore::ExploreBuyDoc($doc));
|
||||
}
|
||||
|
||||
#[Route('/api/buy/get/invoices/list', name: 'app_buy_get_invoices_list')]
|
||||
|
@ -71,6 +77,317 @@ class BuyController extends AbstractController
|
|||
'year'=>$acc['year'],
|
||||
'type'=>'buy'
|
||||
]);
|
||||
return $this->json(ServiceExplore::ExploreBuyDocsList($invoices));
|
||||
return $this->json(Explore::ExploreBuyDocsList($invoices));
|
||||
}
|
||||
|
||||
#[Route('/api/buy/mod', name: 'app_buy_mod')]
|
||||
public function app_buy_mod(Provider $provider, Extractor $extractor, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
if (!array_key_exists('update', $params)) {
|
||||
return $this->json($extractor->paramsNotSend());
|
||||
}
|
||||
if ($params['update'] != '') {
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'year' => $acc['year'],
|
||||
'code' => $params['update']
|
||||
]);
|
||||
if (!$doc) return $this->json($extractor->notFound());
|
||||
|
||||
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||
'doc' => $doc
|
||||
]);
|
||||
foreach ($rows as $row)
|
||||
$entityManager->remove($row);
|
||||
} else {
|
||||
$doc = new HesabdariDoc();
|
||||
$doc->setBid($acc['bid']);
|
||||
$doc->setYear($acc['year']);
|
||||
$doc->setDateSubmit(time());
|
||||
$doc->setType('buy');
|
||||
$doc->setSubmitter($this->getUser());
|
||||
$doc->setMoney($acc['bid']->getMoney());
|
||||
$doc->setCode($provider->getAccountingCode($acc['bid'], 'accounting'));
|
||||
}
|
||||
if($params['transferCost'] != 0){
|
||||
$hesabdariRow = new HesabdariRow();
|
||||
$hesabdariRow->setDes('حمل و نقل کالا');
|
||||
$hesabdariRow->setBid($acc['bid']);
|
||||
$hesabdariRow->setYear($acc['year']);
|
||||
$hesabdariRow->setDoc($doc);
|
||||
$hesabdariRow->setBd($params['transferCost']);
|
||||
$hesabdariRow->setBs(0);
|
||||
$ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([
|
||||
'code' => '90' // transfer cost income
|
||||
]);
|
||||
$hesabdariRow->setRef($ref);
|
||||
$entityManager->persist($hesabdariRow);
|
||||
}
|
||||
if($params['discountAll'] != 0){
|
||||
$hesabdariRow = new HesabdariRow();
|
||||
$hesabdariRow->setDes('تخفیف فاکتور');
|
||||
$hesabdariRow->setBid($acc['bid']);
|
||||
$hesabdariRow->setYear($acc['year']);
|
||||
$hesabdariRow->setDoc($doc);
|
||||
$hesabdariRow->setBd(0);
|
||||
$hesabdariRow->setBs($params['discountAll']);
|
||||
$ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([
|
||||
'code' => '104' // سایر هزینه های پخش و خرید
|
||||
]);
|
||||
$hesabdariRow->setRef($ref);
|
||||
$entityManager->persist($hesabdariRow);
|
||||
}
|
||||
$doc->setDes($params['des']);
|
||||
$doc->setDate($params['date']);
|
||||
$sumTax = 0;
|
||||
$sumTotal = 0;
|
||||
foreach ($params['rows'] as $row) {
|
||||
$sumTax += $row['tax'];
|
||||
$sumTotal += $row['sumWithoutTax'];
|
||||
$hesabdariRow = new HesabdariRow();
|
||||
$hesabdariRow->setDes($row['des']);
|
||||
$hesabdariRow->setBid($acc['bid']);
|
||||
$hesabdariRow->setYear($acc['year']);
|
||||
$hesabdariRow->setDoc($doc);
|
||||
$hesabdariRow->setBd($row['sumWithoutTax'] + $row['tax']);
|
||||
$hesabdariRow->setBs(0);
|
||||
$hesabdariRow->setDiscount($row['discount']);
|
||||
$hesabdariRow->setTax($row['tax']);
|
||||
$ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([
|
||||
'code' => '120' // buy commodity
|
||||
]);
|
||||
$hesabdariRow->setRef($ref);
|
||||
$row['count'] = str_replace(',', '', $row['count']);
|
||||
$commodity = $entityManager->getRepository(Commodity::class)->findOneBy([
|
||||
'id' => $row['commodity']['id'],
|
||||
'bid' => $acc['bid']
|
||||
]);
|
||||
if (!$commodity)
|
||||
return $this->json($extractor->paramsNotSend());
|
||||
$hesabdariRow->setCommodity($commodity);
|
||||
$hesabdariRow->setCommdityCount($row['count']);
|
||||
$entityManager->persist($hesabdariRow);
|
||||
}
|
||||
//set amount of document
|
||||
$doc->setAmount($sumTax + $sumTotal - $params['discountAll'] + $params['transferCost']);
|
||||
//set person seller
|
||||
$hesabdariRow = new HesabdariRow();
|
||||
$hesabdariRow->setDes('فاکتور خرید');
|
||||
$hesabdariRow->setBid($acc['bid']);
|
||||
$hesabdariRow->setYear($acc['year']);
|
||||
$hesabdariRow->setDoc($doc);
|
||||
$hesabdariRow->setBd(0);
|
||||
$hesabdariRow->setBs($sumTax + $sumTotal + $params['transferCost'] - $params['discountAll']);
|
||||
$ref = $entityManager->getRepository(HesabdariTable::class)->findOneBy([
|
||||
'code' => '3' // persons
|
||||
]);
|
||||
$hesabdariRow->setRef($ref);
|
||||
$person = $entityManager->getRepository(Person::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $params['seller']['code']
|
||||
]);
|
||||
if (!$person)
|
||||
return $this->json($extractor->paramsNotSend());
|
||||
$hesabdariRow->setPerson($person);
|
||||
$entityManager->persist($hesabdariRow);
|
||||
|
||||
//set tax info
|
||||
|
||||
$entityManager->persist($doc);
|
||||
$entityManager->flush();
|
||||
$log->insert(
|
||||
'حسابداری',
|
||||
'سند حسابداری شماره ' . $doc->getCode() . ' ثبت / ویرایش شد.',
|
||||
$this->getUser(),
|
||||
$request->headers->get('activeBid'),
|
||||
$doc
|
||||
);
|
||||
return $this->json($extractor->operationSuccess());
|
||||
}
|
||||
|
||||
#[Route('/api/buy/label/change', name: 'app_buy_label_change')]
|
||||
public function app_buy_label_change(Request $request, Access $access, Extractor $extractor, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
if ($params['label'] != 'clear') {
|
||||
$label = $entityManager->getRepository(InvoiceType::class)->findOneBy([
|
||||
'code' => $params['label']['code'],
|
||||
'type' => 'buy'
|
||||
]);
|
||||
if (!$label) return $this->json($extractor->notFound());
|
||||
}
|
||||
foreach ($params['items'] as $item) {
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'year' => $acc['year'],
|
||||
'code' => $item['code']
|
||||
]);
|
||||
if (!$doc) return $this->json($extractor->notFound());
|
||||
if ($params['label'] != 'clear') {
|
||||
$doc->setInvoiceLabel($label);
|
||||
$entityManager->persist($doc);
|
||||
$log->insert(
|
||||
'حسابداری',
|
||||
' تغییر برچسب فاکتور شماره ' . $doc->getCode() . ' به ' . $label->getLabel(),
|
||||
$this->getUser(),
|
||||
$acc['bid']->getId(),
|
||||
$doc
|
||||
);
|
||||
} else {
|
||||
$doc->setInvoiceLabel(null);
|
||||
$entityManager->persist($doc);
|
||||
$log->insert(
|
||||
'حسابداری',
|
||||
' حذف برچسب فاکتور شماره ' . $doc->getCode(),
|
||||
$this->getUser(),
|
||||
$acc['bid']->getId(),
|
||||
$doc
|
||||
);
|
||||
}
|
||||
}
|
||||
$entityManager->flush();
|
||||
return $this->json($extractor->operationSuccess());
|
||||
}
|
||||
|
||||
#[Route('/api/buy/docs/search', name: 'app_buy_docs_search')]
|
||||
public function app_buy_docs_search(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
$data = $entityManager->getRepository(HesabdariDoc::class)->findBy([
|
||||
'bid' => $acc['bid'],
|
||||
'year' => $acc['year'],
|
||||
'type' => 'buy'
|
||||
], [
|
||||
'id' => 'DESC'
|
||||
]);
|
||||
|
||||
$dataTemp = [];
|
||||
foreach ($data as $item) {
|
||||
$temp = [
|
||||
'id' => $item->getId(),
|
||||
'dateSubmit' => $item->getDateSubmit(),
|
||||
'date' => $item->getDate(),
|
||||
'type' => $item->getType(),
|
||||
'code' => $item->getCode(),
|
||||
'des' => $item->getDes(),
|
||||
'amount' => $item->getAmount(),
|
||||
'submitter' => $item->getSubmitter()->getFullName(),
|
||||
];
|
||||
$mainRow = $entityManager->getRepository(HesabdariRow::class)->getNotEqual($item, 'person');
|
||||
$temp['person'] = '';
|
||||
if ($mainRow)
|
||||
$temp['person'] = Explore::ExplorePerson($mainRow->getPerson());
|
||||
|
||||
$temp['label'] = null;
|
||||
if ($item->getInvoiceLabel()) {
|
||||
$temp['label'] = [
|
||||
'code' => $item->getInvoiceLabel()->getCode(),
|
||||
'label' => $item->getInvoiceLabel()->getLabel()
|
||||
];
|
||||
}
|
||||
|
||||
$temp['relatedDocsCount'] = count($item->getRelatedDocs());
|
||||
$pays = 0;
|
||||
foreach ($item->getRelatedDocs() as $relatedDoc) {
|
||||
$pays += $relatedDoc->getAmount();
|
||||
}
|
||||
$temp['relatedDocsPays'] = $pays;
|
||||
|
||||
foreach ($item->getHesabdariRows() as $item) {
|
||||
if ($item->getRef()->getCode() == '104') {
|
||||
$temp['discountAll'] = $item->getBd();
|
||||
} elseif ($item->getRef()->getCode() == '90') {
|
||||
$temp['transferCost'] = $item->getBs();
|
||||
}
|
||||
}
|
||||
if(!array_key_exists('discountAll',$temp)) $temp['discountAll'] = 0;
|
||||
if(!array_key_exists('transferCost',$temp)) $temp['transferCost'] = 0;
|
||||
$dataTemp[] = $temp;
|
||||
}
|
||||
return $this->json($dataTemp);
|
||||
}
|
||||
|
||||
#[Route('/api/buy/print/invoice', name: 'app_buy_print_invoice')]
|
||||
public function app_buy_print_invoice(Printers $printers, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$params = [];
|
||||
if ($content = $request->getContent()) {
|
||||
$params = json_decode($content, true);
|
||||
}
|
||||
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc) throw $this->createAccessDeniedException();
|
||||
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $params['code']
|
||||
]);
|
||||
if (!$doc) throw $this->createNotFoundException();
|
||||
$person = null;
|
||||
$discount = 0;
|
||||
$transfer = 0;
|
||||
foreach ($doc->getHesabdariRows() as $item) {
|
||||
if ($item->getPerson()) {
|
||||
$person = $item->getPerson();
|
||||
} elseif ($item->getRef()->getCode() == 104) {
|
||||
$discount = $item->getBs();
|
||||
} elseif ($item->getRef()->getCode() == 90) {
|
||||
$transfer = $item->getBd();
|
||||
}
|
||||
}
|
||||
$pdfPid = 0;
|
||||
if ($params['pdf']) {
|
||||
$pdfPid = $provider->createPrint(
|
||||
$acc['bid'],
|
||||
$this->getUser(),
|
||||
$this->renderView('pdf/printers/buy.html.twig', [
|
||||
'bid' => $acc['bid'],
|
||||
'doc' => $doc,
|
||||
'rows' => $doc->getHesabdariRows(),
|
||||
'person' => $person,
|
||||
'printInvoice' => $params['printers'],
|
||||
'discount' => $discount,
|
||||
'transfer' => $transfer
|
||||
]),
|
||||
false
|
||||
);
|
||||
}
|
||||
if ($params['printers'] == true) {
|
||||
$pid = $provider->createPrint(
|
||||
$acc['bid'],
|
||||
$this->getUser(),
|
||||
$this->renderView('pdf/posPrinters/justBuy.html.twig', [
|
||||
'bid' => $acc['bid'],
|
||||
'doc' => $doc,
|
||||
'rows' => $doc->getHesabdariRows(),
|
||||
]),
|
||||
false
|
||||
);
|
||||
$printers->addFile($pid, $acc, "fastBuyInvoice");
|
||||
}
|
||||
return $this->json(['id' => $pdfPid]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ class PlugRepserviceController extends AbstractController
|
|||
|
||||
$orders = $entityManagerInterface->getRepository(PlugRepserviceOrder::class)->findBy([
|
||||
'bid' => $acc['bid']
|
||||
],['code'=>'DESC']);
|
||||
],['date'=>'DESC']);
|
||||
return $this->json($this->ExploreOrders($orders));
|
||||
}
|
||||
|
||||
|
|
|
@ -75,14 +75,18 @@ class Explore
|
|||
{
|
||||
$result = self::ExploreHesabdariDoc($hesabdariDoc);
|
||||
$person = [];
|
||||
$commodities = [];
|
||||
foreach ($hesabdariDoc->getHesabdariRows() as $item) {
|
||||
if ($item->getPerson()) {
|
||||
$person = self::ExplorePerson($item->getPerson());
|
||||
} elseif ($item->getCommodity()) {
|
||||
$commodities[] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount(), $item->getDes());
|
||||
}
|
||||
elseif($item->getRef()->getCode() == '104'){
|
||||
$result['discountAll'] = $item->getBs();
|
||||
} elseif ($item->getRef()->getCode() == '90') {
|
||||
$result['transferCost'] = $item->getBd();
|
||||
}
|
||||
}
|
||||
if (!array_key_exists('discountAll', $result)) $result['discountAll'] = 0;
|
||||
if (!array_key_exists('transferCost', $result)) $result['transferCost'] = 0;
|
||||
$result['person'] = $person;
|
||||
return $result;
|
||||
}
|
||||
|
|
186
hesabixCore/templates/pdf/posPrinters/justBuy.html.twig
Normal file
186
hesabixCore/templates/pdf/posPrinters/justBuy.html.twig
Normal file
|
@ -0,0 +1,186 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fa" direction="rtl">
|
||||
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
margin: 5px;
|
||||
padding: 0;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr {
|
||||
width: 100%;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black !important;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#logo {
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
-webkit-align-content: center;
|
||||
align-content: center;
|
||||
padding: 5px;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
header {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
-webkit-align-content: center;
|
||||
align-content: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.items thead {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.center-align {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bill-details td {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.receipt {
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
.items .heading {
|
||||
font-size: 12.5px;
|
||||
text-transform: uppercase;
|
||||
border-top: 1px solid black;
|
||||
margin-bottom: 4px;
|
||||
border-bottom: 1px solid black;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.items thead tr th:first-child,
|
||||
.items tbody tr td:first-child {
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.items td {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.price::after {
|
||||
content: "";
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.sum-up {
|
||||
text-align: right !important;
|
||||
}
|
||||
.total {
|
||||
font-size: 13px;
|
||||
border-top: 1px dashed black !important;
|
||||
border-bottom: 1px dashed black !important;
|
||||
}
|
||||
.total.text,
|
||||
.total.price {
|
||||
text-align: right;
|
||||
}
|
||||
.total.price::after {
|
||||
content: " ریال ";
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid black !important;
|
||||
}
|
||||
|
||||
p {
|
||||
padding: 1px;
|
||||
margin: 0;
|
||||
}
|
||||
section,
|
||||
footer {
|
||||
font-size: 12px;
|
||||
}
|
||||
tbody,
|
||||
thead,
|
||||
th,
|
||||
td,
|
||||
tr {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="direction:rtl; text-align:right; width:100%">
|
||||
<header>
|
||||
<p style="text-align:center;">{{ bid.name }}</p>
|
||||
</header>
|
||||
<table class="bill-details">
|
||||
<tbody style="text-align:right">
|
||||
<tr>
|
||||
<td style="text-align:right">تاریخ :
|
||||
<span>{{doc.date}}</span>
|
||||
</td>
|
||||
<td style="text-align:right">شماره :
|
||||
<span>#
|
||||
{{doc.code | number_format}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="center-align" colspan="2">
|
||||
<span class="receipt">رسید خرید</span>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="items">
|
||||
<thead style="background:gray;text-color:white;">
|
||||
<tr>
|
||||
<th class="heading name">کالا</th>
|
||||
<th class="heading qty">تعداد</th>
|
||||
<th class="heading rate">فی</th>
|
||||
<th class="heading amount">جمع</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
{% if row.commodity != null %}
|
||||
<tr>
|
||||
<td>{{row.commodity.name}}</td>
|
||||
<td>{{row.commdityCount}}</td>
|
||||
<td class="price">{{(row.bs / row.commdityCount) | number_format}}</td>
|
||||
<td class="price">{{row.bs | number_format}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<th colspan="3" class="total text">جمع فاکتور</th>
|
||||
<th class="total price">{{doc.amount | number_format}}</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<section style="margin-bottom:10px;margin-top:10px;text-align:center;">
|
||||
<b style="text-align:center">
|
||||
از خرید شما متشکریم
|
||||
</b>
|
||||
</section>
|
||||
<footer style="text-align:center">
|
||||
<p>{{ bid.address }}</p>
|
||||
<p>{{ bid.tel }}</p>
|
||||
<p>hesabix.ir</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
270
hesabixCore/templates/pdf/printers/buy.html.twig
Normal file
270
hesabixCore/templates/pdf/printers/buy.html.twig
Normal file
|
@ -0,0 +1,270 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fa" direction="rtl"></html>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<head>
|
||||
<style>
|
||||
@page {
|
||||
margin: 3%;
|
||||
margin-header: 0;
|
||||
margin-footer: 0;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
.text-white {
|
||||
color: white;
|
||||
}
|
||||
.stimol td,
|
||||
.stimol th {
|
||||
border: 1px solid black;
|
||||
}
|
||||
.item {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="direction:rtl; width:100%">
|
||||
<div class="block-content pt-1 pb-3 d-none d-sm-block">
|
||||
<div class="c-print container-xl">
|
||||
<div class="tg-wrap" style="width:100%; border:1px solid black;border-radius: 8px;">
|
||||
<table class="rounded" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width:20%">
|
||||
<img src="{{ "/api/avatar/get/file/" ~ bid.avatar}}" width="65"/>
|
||||
</td>
|
||||
<td style="width:60%; text-align:center">
|
||||
<h3 class="">فاکتور خرید کالا و خدمات</h3>
|
||||
</td>
|
||||
<td style="width:20%">
|
||||
<h4>
|
||||
<b>تاریخ:</b>
|
||||
{{ doc.date }}</h4>
|
||||
<br/>
|
||||
<h4>
|
||||
<b>شماره:</b>
|
||||
{{ doc.code }}</h4>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:100%; border:1px solid black;border-radius: 8px;margin-top:5px;text-align:center;">
|
||||
<div class="tg-wrap" style="width:100%;border-radius: 8px 8px 0px 0px;text-align:center;background-color:gray">
|
||||
<b style="color:white;">خریدار</b>
|
||||
</div>
|
||||
<table style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="text-align:center;">
|
||||
<td class="">
|
||||
<p>
|
||||
<b>نام:
|
||||
</b>
|
||||
{{ bid.legalName }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>شماره ثبت / شناسه ملی:
|
||||
</b>
|
||||
{{ bid.shomaresabt }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>شماره اقتصادی:
|
||||
</b>
|
||||
{{ bid.codeeghtesadi }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>تلفن / نمابر:</b>
|
||||
{{ bid.tel }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="" colspan="1">
|
||||
<p>
|
||||
<b>کد پستی:</b>
|
||||
{{ bid.postalcode }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="" colspan="3">
|
||||
<p>
|
||||
<b>آدرس:
|
||||
</b>
|
||||
استان
|
||||
{{ bid.ostan }}، شهر
|
||||
{{ bid.shahrestan }}،
|
||||
{{ bid.address }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:100%; border:1px solid black;border-radius: 8px;margin-top:5px;text-align:center;">
|
||||
<div class="tg-wrap" style="width:100%;border-radius: 8px 8px 0px 0px;text-align:center;background-color:gray">
|
||||
<b style="color:white;">فروشنده</b>
|
||||
</div>
|
||||
<table style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="text-align:center;">
|
||||
<td class="">
|
||||
<p>
|
||||
<b>نام:
|
||||
</b>
|
||||
{{ person.nikename }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>شماره ثبت / شناسه ملی:
|
||||
</b>
|
||||
{{ person.codeeghtesadi }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>شماره اقتصادی:
|
||||
</b>
|
||||
{{ person.codeeghtesadi }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="center">
|
||||
<p>
|
||||
<b>تلفن / نمابر:</b>
|
||||
{{ person.tel }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="" colspan="1">
|
||||
<p>
|
||||
<b>کد پستی:</b>
|
||||
{{ person.postalcode }}
|
||||
</p>
|
||||
</td>
|
||||
<td class="" colspan="3">
|
||||
<p>
|
||||
<b>آدرس:
|
||||
</b>
|
||||
استان
|
||||
{{ person.ostan }}، شهر
|
||||
{{ person.shahr }}،
|
||||
{{ person.address }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:100%;margin-top:5px;text-align:center;">
|
||||
<table style="width:100%;">
|
||||
<thead>
|
||||
<tr class="stimol" style="background-color:gray;">
|
||||
<th class="text-white" style="width:80px">ردیف</th>
|
||||
<th class="text-white">کالا/خدمات</th>
|
||||
<th class="text-white">شرح</th>
|
||||
<th class="text-white">تعداد / مقدار</th>
|
||||
<th class="text-white">مبلغ واحد</th>
|
||||
<th class="text-white">تخفیف</th>
|
||||
<th class="text-white">مالیات</th>
|
||||
<th class="text-white">مبلغ کل</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set taxAll = 0 %}
|
||||
{% set rowIndex = 0 %}
|
||||
{% for item in rows%}
|
||||
{% if item.commodity %}
|
||||
{% set taxAll = taxAll + item.tax %}
|
||||
{% set rowIndex = rowIndex + 1 %}
|
||||
<tr class="stimol">
|
||||
<td class="center item">{{rowIndex}}</td>
|
||||
<td class="center item">
|
||||
{{ item.commodity.code }}
|
||||
-
|
||||
{{ item.commodity.name }}</td>
|
||||
<td class="center item">{{ item.des }}</td>
|
||||
<td class="center item">
|
||||
{{ item.commdityCount | number_format }}
|
||||
{{ item.commodity.unit.name }}
|
||||
</td>
|
||||
<td class="center item">{{ ((item.bd - item.tax + item.discount) / item.commdityCount) | number_format }}</td>
|
||||
<td class="center item">{{ item.discount | number_format }}</td>
|
||||
<td class="center item">{{ item.tax | number_format}}</td>
|
||||
<td class="center item">{{ item.bd| number_format }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:100%;margin-top:0px;text-align:center;">
|
||||
<table style="width:100%;">
|
||||
<tbody>
|
||||
<tr class="stimol">
|
||||
<td class="item">
|
||||
<h4>
|
||||
تخفیف:
|
||||
{{discount | number_format}}
|
||||
</h4>
|
||||
</td>
|
||||
<td class="item">
|
||||
<h4>
|
||||
مالیات:
|
||||
{{taxAll | number_format}}
|
||||
</h4>
|
||||
</td>
|
||||
<td class="item">
|
||||
<h4>
|
||||
حمل و نقل:
|
||||
{{transfer | number_format}}
|
||||
</h4>
|
||||
</td>
|
||||
<td class="item">
|
||||
<h4>
|
||||
جمع کل:
|
||||
{{doc.amount | number_format}}
|
||||
</h4>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="stimol">
|
||||
<td class="item" colspan="4">
|
||||
<h4>
|
||||
توضیحات:
|
||||
{{doc.des}}
|
||||
</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width:100%;margin-top:20px;text-align:center;">
|
||||
<table style="width:100%;">
|
||||
<tbody>
|
||||
<tr class="">
|
||||
<td class="center" style="height:90px">
|
||||
<h4>
|
||||
مهر و امضا خریدار
|
||||
</h4>
|
||||
</td>
|
||||
<td class="center" style="height:90px">
|
||||
<h4>
|
||||
مهر و امضا فروشنده:
|
||||
</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body></div></body></html>
|
||||
|
Loading…
Reference in a new issue