forked from morrning/hesabixCore
374 lines
12 KiB
Twig
374 lines
12 KiB
Twig
<!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>
|
|
.center {
|
|
text-align: center ;
|
|
}
|
|
.text-white {
|
|
color: white ;
|
|
}
|
|
.stimol td,
|
|
.stimol th {
|
|
border: 1px solid black ;
|
|
}
|
|
.item {
|
|
height: 30px ;
|
|
font-size: 11px ;
|
|
}
|
|
h3 {
|
|
font-size: 14px ;
|
|
}
|
|
h4 {
|
|
font-size: 12px ;
|
|
}
|
|
p {
|
|
font-size: 11px ;
|
|
}
|
|
</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%">
|
|
{% if printOptions.invoiceIndex %}
|
|
<img src="{{ url('front_avatar_file_get', {id: bid.id},)}}" width="65"/>
|
|
{% endif %}
|
|
</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>
|
|
{% if printOptions.bidInfo %}
|
|
|
|
<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>
|
|
{% if bid.legalName is not empty %}{{ bid.legalName }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>
|
|
شناسه ملی:
|
|
</b>
|
|
{% if bid.shenasemeli is not empty %}{{ bid.shenasemeli }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>شماره ثبت:
|
|
</b>
|
|
{% if bid.shomaresabt is not empty %}{{ bid.shomaresabt }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>شماره اقتصادی:
|
|
</b>
|
|
{% if bid.codeeghtesadi is not empty %}{{ bid.codeeghtesadi }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>تلفن / نمابر:</b>
|
|
{% if bid.tel is not empty %}{{ bid.tel }}{% endif %}
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="" colspan="1">
|
|
<p>
|
|
<b>کد پستی:</b>
|
|
{% if bid.postalcode is not empty %}{{ bid.postalcode }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="" colspan="3">
|
|
<p>
|
|
<b>آدرس:
|
|
</b>
|
|
{% if bid.ostan is not empty %}استان {{ bid.ostan }}{% endif %}{% if bid.shahrestan is not empty %}، شهر {{ bid.shahrestan }}{% endif %}{% if bid.address is not empty %}، {{ bid.address }}{% endif %}
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<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>
|
|
{% if person.prelabel is not null %}{{ person.prelabel.label }}{% endif %}
|
|
{% if person.nikename is not empty %}{{ person.nikename }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b> شناسه ملی:
|
|
</b>
|
|
{% if person.shenasemeli is not empty %}{{ person.shenasemeli }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>شماره ثبت:
|
|
</b>
|
|
{% if person.sabt is not empty %}{{ person.sabt }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>شماره اقتصادی:
|
|
</b>
|
|
{% if person.codeeghtesadi is not empty %}{{ person.codeeghtesadi }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="center">
|
|
<p>
|
|
<b>تلفن / نمابر:</b>
|
|
{% if person.tel is not empty %}{{ person.tel }}{% endif %}
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="" colspan="1">
|
|
<p>
|
|
<b>کد پستی:</b>
|
|
{% if person.postalcode is not empty %}{{ person.postalcode }}{% endif %}
|
|
</p>
|
|
</td>
|
|
<td class="" colspan="3">
|
|
<p>
|
|
<b>آدرس:
|
|
</b>
|
|
{% if person.ostan is not empty %}استان {{ person.ostan }}{% endif %}{% if person.shahr is not empty %}، شهر {{ person.shahr }}{% endif %}{% if person.address is not empty %}، {{ person.address }}{% endif %}
|
|
</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>
|
|
{% if printOptions.discountInfo %}
|
|
<th class="text-white">تخفیف</th>
|
|
<th class="text-white">قبل تخفیف</th>
|
|
{% endif %}
|
|
{% if printOptions.taxInfo %}
|
|
<th class="text-white">مالیات</th>
|
|
{% endif %}
|
|
<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.commodityCount }}
|
|
{{ item.commodity.unit.name }}
|
|
</td>
|
|
<td class="center item">
|
|
{% if item.commodityCount > 0 %}
|
|
{% if item.showPercentDiscount %}
|
|
{% set discountDivisor = 1 - (item.discountPercent / 100) %}
|
|
{% if discountDivisor <= 0 %}
|
|
{% set originalPrice = item.bs %}
|
|
{% else %}
|
|
{% set originalPrice = item.bs / discountDivisor %}
|
|
{% endif %}
|
|
{% set unitPrice = originalPrice / item.commodityCount %}
|
|
{% else %}
|
|
{% set originalPrice = item.bs + item.discount %}
|
|
{% set unitPrice = originalPrice / item.commodityCount %}
|
|
{% endif %}
|
|
{{ unitPrice|round|number_format }} {{ doc.money.shortName }}
|
|
{% else %}
|
|
0 {{ doc.money.shortName }}
|
|
{% endif %}
|
|
</td>
|
|
{% if printOptions.discountInfo %}
|
|
<td class="center item">
|
|
{% if item.showPercentDiscount %}
|
|
{{ item.discountPercent }}%
|
|
({{ (item.bs * item.commodityCount * item.discountPercent / 100)|round|number_format }} {{ doc.money.shortName }})
|
|
{% else %}
|
|
{{ item.discount|number_format }} {{ doc.money.shortName }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="center item">
|
|
{% if item.showPercentDiscount %}
|
|
{% set discountDivisor = 1 - (item.discountPercent / 100) %}
|
|
{% if discountDivisor <= 0 %}
|
|
{% set originalPrice = item.bs %}
|
|
{% else %}
|
|
{% set originalPrice = item.bs / discountDivisor %}
|
|
{% endif %}
|
|
{{ originalPrice|round|number_format }} {{ doc.money.shortName }}
|
|
{% else %}
|
|
{{ (item.bs + item.discount)|number_format }} {{ doc.money.shortName }}
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
{% if printOptions.taxInfo %}
|
|
<td class="center item">{{ item.tax | number_format}} {{ doc.money.shortName }}</td>
|
|
{% endif %}
|
|
<td class="center item">{{ item.bs| number_format }} {{ doc.money.shortName }}</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" style="width:70%;padding:1%">
|
|
<h4>
|
|
توضیحات:
|
|
{{doc.des}}
|
|
<br>
|
|
{% if (doc.relatedDocs | length != 0) and (printOptions.pays == true) %}
|
|
<h4 class="">
|
|
پرداختها:
|
|
</h4>
|
|
<ul class="">
|
|
{% for item in doc.relatedDocs%}
|
|
<li class="">
|
|
{{item.date}} - {{ item.amount | number_format }} - {{ item.des }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
{% if printOptions.note == true %}
|
|
<h4 class="">
|
|
یادداشت:
|
|
</h4>
|
|
<ul class="">
|
|
<li class="">
|
|
{{note | raw}}
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
{ # فیلد جدید وضعیت حساب مشتری #}
|
|
{% if accountStatus is defined %}
|
|
<h4 class="">
|
|
وضعیت حساب مشتری با احتساب این فاکتور:
|
|
{{ accountStatus.value | number_format}}
|
|
{{ doc.money.shortName }}
|
|
{{ accountStatus.label }}
|
|
|
|
</h4>
|
|
|
|
{% endif %}
|
|
</div>
|
|
</h4>
|
|
</td>
|
|
<td class="item" style="width:15%;padding:1%">
|
|
<h4>
|
|
تخفیف:
|
|
{{discount | number_format}} {{ doc.money.shortName }}
|
|
</h4>
|
|
<h4>
|
|
مالیات:
|
|
{{taxAll | number_format}} {{ doc.money.shortName }}
|
|
</h4>
|
|
<h4>
|
|
حمل و نقل:
|
|
{{transfer | number_format}} {{ doc.money.shortName }}
|
|
</h4>
|
|
{% if doc.amount != (doc.amount + discount) %}
|
|
<h4>
|
|
جمع بدون تخفیف:
|
|
{{ (doc.amount + discount) | number_format}} {{ doc.money.shortName }}
|
|
</h4>
|
|
{% endif %}
|
|
<h4>
|
|
جمع کل:
|
|
{{ doc.amount | number_format }} {{ doc.money.shortName }}
|
|
</h4>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div style="width:40%;margin-top:0px;text-align:center;float:left;">
|
|
<table style="width:100%;">
|
|
<tbody>
|
|
<tr class="">
|
|
<td class="center" style="height:90px">
|
|
<h4>
|
|
مهر و امضا خریدار
|
|
</h4>
|
|
</td>
|
|
<td class="center" style="height:90px">
|
|
<h4>
|
|
مهر و امضا فروشنده:
|
|
</h4>
|
|
<br>
|
|
{% if printOptions.businessStamp %}
|
|
<img src="{{ url('front_seal_file_get', {id: bid.id},)}}" width="160"/>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</body></div></body></html>
|