diff --git a/webUI/src/components/InvoiceElements.vue b/webUI/src/components/InvoiceElements.vue
new file mode 100644
index 0000000..647b9b7
--- /dev/null
+++ b/webUI/src/components/InvoiceElements.vue
@@ -0,0 +1,418 @@
+
+ صورتحساب فروش کالا و خدمات
+
+
+
+
+
+
+
+ ردیف
+ کالا/خدمات
+ شرح
+ تعداد
+ فی واحد
+ تخفیف
+ مالیات
+ مبلغ کل
+
+
+
+ {{ index + 1 }}
+ {{ item.name }}
+ {{ item.description }}
+ {{ item.quantity }}
+ {{ formatNumber(item.unitPrice) }}
+ {{ item.discount }}%
+ {{ formatNumber(item.tax) }}
+ {{ formatNumber(item.total) }}
+
شماره: {{ doc.code }} | تاریخ: {{ doc.date }}
+ +کالا | تعداد | قیمت |
---|---|---|
{{ item.commodity.name }} | +{{ item.commodityCount }} | +{{ item.bs | number_format(0, '.', ',') }} | +
جمع کل: {{ doc.amount | number_format(0, '.', ',') }}
+برای ویرایش، روی یک المان کلیک کنید
+{{ template.description }}
+{{ template.description }}
+{{ template.description }}
+{{ template.description }}
+در این بخش میتوانید با استفاده از زبان قالببندی Twig و HTML/CSS، قالب فاکتور سفارشی خود را طراحی کنید. - برای جلوگیری از مشکلات امنیتی، رندر کدها در Sandbox انجام میشود؛ بنابراین تنها بخشی از امکانات Twig مجاز است. + برای جلوگیری از مشکلات امنیتی، رندر کدها در Sandbox انجام میشود؛ بنابراین تنها بخشی از امکانات + Twig مجاز است.
business.name
, business.tel
, business.mobile
, business.address
business.name
, business.tel
, business.mobile
,
+ business.address
+ business.shenasemeli
, business.codeeghtesadi
doc.code
, doc.date
doc.taxPercent
, doc.discountPercent
, doc.discountType
doc.taxPercent
, doc.discountPercent
,
+ doc.discountType
+ person.name
, person.mobile
, person.tel
, person.address
person.name
, person.mobile
, person.tel
,
+ person.address
+ row.commodity.name
, row.commodity.code
(ممکن است commodity
تهی باشد)row.commodity.name
, row.commodity.code
(ممکن است
+ commodity
+ تهی باشد)row.commodityCount
(و برای سازگاری قدیمی: row.commdityCount
)row.des
, row.bs
, row.bd
(در خرید/برگشت از خرید)، row.tax
, row.discount
row.showPercentDiscount
, row.discountPercent
row.des
, row.bs
, row.bd
(در خرید/برگشت از خرید)،
+ row.tax
, row.discount
+ row.showPercentDiscount
, row.discountPercent
+ {% if person %}
-<p>مشتری: {{ person.name | escape }}</p>
-{% endif %}
+ <p>مشتری: {{ person.name | escape }}</p>
+ {% endif %}
-<table width="100%" cellspacing="0" cellpadding="6" border="1">
- <thead>
- <tr>
- <th>#</th>
- <th>کالا</th>
- <th>تعداد</th>
- <th>فی توضیح</th>
- <th>مالیات</th>
- <th>تخفیف</th>
- </tr>
- </thead>
- <tbody>
- {% for item in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ item.commodity.name ?? '-' }}</td>
- <td>{{ item.commodityCount }}</td>
- <td>{{ item.des | escape }}</td>
- <td>{{ item.tax | number_format(0, '.', ',') }}</td>
- <td>
- {% if item.showPercentDiscount %}
- {{ item.discountPercent }}%
- {% else %}
- {{ item.discount | number_format(0, '.', ',') }}
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
-</table>
-
+ <table width="100%" cellspacing="0" cellpadding="6"
+ border="1">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>کالا</th>
+ <th>تعداد</th>
+ <th>فی توضیح</th>
+ <th>مالیات</th>
+ <th>تخفیف</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ item.commodity.name ?? '-' }}</td>
+ <td>{{ item.commodityCount }}</td>
+ <td>{{ item.des | escape }}</td>
+ <td>{{ item.tax | number_format(0, '.', ',') }}</td>
+ <td>
+ {% if item.showPercentDiscount %}
+ {{ item.discountPercent }}%
+ {% else %}
+ {{ item.discount | number_format(0, '.', ',') }}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
<div class="invoice-template">
- <h2 style="text-align:center">{{ business.name }}</h2>
- <div>شماره فاکتور: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
- {% if person %}<div>مشتری: {{ person.name }} | موبایل: {{ person.mobile }}</div>{% endif %}
+ <h2 style="text-align:center">{{ business.name }}</h2>
+ <div>شماره فاکتور: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
+ {% if person %}<div>مشتری: {{ person.name }} | موبایل: {{ person.mobile }}</div>{% endif %}
- <table width="100%" cellspacing="0" cellpadding="6" border="1" style="margin-top:10px">
- <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
- <tbody>
- {% for r in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ r.commodity.name ?? '-' }}</td>
- <td>{{ r.commodityCount }}</td>
- <td>{{ r.des }}</td>
- <td>{{ r.tax | number_format(0, '.', ',') }}</td>
- <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount | number_format(0, '.', ',') }}{% endif %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ <table width="100%" cellspacing="0" cellpadding="6"
+ border="1" style="margin-top:10px">
+ <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
+ <tbody>
+ {% for r in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ r.commodity.name ?? '-' }}</td>
+ <td>{{ r.commodityCount }}</td>
+ <td>{{ r.des }}</td>
+ <td>{{ r.tax | number_format(0, '.', ',') }}</td>
+ <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount |
+ number_format(0, '.', ',') }}{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
- <div style="margin-top:10px;text-align:right">
- {% if discount %}<div>جمع تخفیف: {{ discount | number_format(0, '.', ',') }}</div>{% endif %}
- {% if transfer %}<div>هزینه ارسال/انتقال: {{ transfer | number_format(0, '.', ',') }}</div>{% endif %}
- </div>
+ <div style="margin-top:10px;text-align:right">
+ {% if discount %}<div>جمع تخفیف: {{ discount | number_format(0, '.', ',') }}</div>{% endif
+ %}
+ {% if transfer %}<div>هزینه ارسال/انتقال: {{ transfer | number_format(0, '.', ',')
+ }}</div>{% endif %}
+ </div>
- {% if note %}
- <div style="margin-top:12px;border-top:1px dashed #ccc;padding-top:8px">{{ note | escape }}</div>
- {% endif %}
-</div>
-
+ {% if note %}
+ <div style="margin-top:12px;border-top:1px dashed #ccc;padding-top:8px">{{ note | escape
+ }}</div>
+ {% endif %}
+ </div>
+
در خرید/برگشت از خرید، مقادیر ردیفها شامل bs
و bd
نیز هستند.
{% for r in rows %}
- <div>{{ loop.index }}. {{ r.commodity.name ?? '-' }} | تعداد: {{ r.commodityCount }} | شرح: {{ r.des }} | بدهکار: {{ r.bd }} | بستانکار: {{ r.bs }}</div>
-{% endfor %}
-
+ <div>{{ loop.index }}. {{ r.commodity.name ?? '-' }} | تعداد: {{ r.commodityCount }} | شرح: {{
+ r.des }} | بدهکار: {{ r.bd }} | بستانکار: {{ r.bs }}</div>
+ {% endfor %}
+
commodityCount
استفاده کنید.person
تهی نباشد: {% if person %} ... {% endif %}
commodityCount
استفاده کنید.
+ person
تهی نباشد: {% if person %} ... {%
+ endif %}
<div class="invoice-template">
- <h3 style="text-align:center">{{ business.name }}</h3>
- <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
- {% if person %}<div>مشتری: {{ person.name }}</div>{% endif %}
- <table width="100%" border="1" cellspacing="0" cellpadding="6" style="margin-top:8px">
- <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
- <tbody>
- {% for r in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ r.commodity.name ?? '-' }}</td>
- <td>{{ r.commodityCount }}</td>
- <td>{{ r.des }}</td>
- <td>{{ r.tax | number_format(0, '.', ',') }}</td>
- <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount | number_format(0, '.', ',') }}{% endif %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% if note %}<div style="margin-top:8px">{{ note | escape }}</div>{% endif %}
-</div>
+ <h3 style="text-align:center">{{ business.name }}</h3>
+ <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
+ {% if person %}<div>مشتری: {{ person.name }}</div>{% endif %}
+ <table width="100%" border="1" cellspacing="0"
+ cellpadding="6" style="margin-top:8px">
+ <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
+ <tbody>
+ {% for r in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ r.commodity.name ?? '-' }}</td>
+ <td>{{ r.commodityCount }}</td>
+ <td>{{ r.des }}</td>
+ <td>{{ r.tax | number_format(0, '.', ',') }}</td>
+ <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount |
+ number_format(0, '.', ',') }}{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% if note %}<div style="margin-top:8px">{{ note | escape }}</div>{% endif %}
+ </div>
<div class="invoice-template">
- <h3 style="text-align:center">{{ business.name }}</h3>
- <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
- {% if person %}<div>فروشنده: {{ person.name }}</div>{% endif %}
- <table width="100%" border="1" cellspacing="0" cellpadding="6" style="margin-top:8px">
- <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>بدهکار</th><th>بستانکار</th></tr></thead>
- <tbody>
- {% for r in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ r.commodity.name ?? '-' }}</td>
- <td>{{ r.commodityCount }}</td>
- <td>{{ r.des }}</td>
- <td>{{ r.bd | number_format(0, '.', ',') }}</td>
- <td>{{ r.bs | number_format(0, '.', ',') }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
-</div>
+ <h3 style="text-align:center">{{ business.name }}</h3>
+ <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
+ {% if person %}<div>فروشنده: {{ person.name }}</div>{% endif %}
+ <table width="100%" border="1" cellspacing="0"
+ cellpadding="6" style="margin-top:8px">
+ <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>بدهکار</th><th>بستانکار</th></tr></thead>
+ <tbody>
+ {% for r in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ r.commodity.name ?? '-' }}</td>
+ <td>{{ r.commodityCount }}</td>
+ <td>{{ r.des }}</td>
+ <td>{{ r.bd | number_format(0, '.', ',') }}</td>
+ <td>{{ r.bs | number_format(0, '.', ',') }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
<div class="invoice-template">
- <h3 style="text-align:center">{{ business.name }}</h3>
- <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
- <table width="100%" border="1" cellspacing="0" cellpadding="6" style="margin-top:8px">
- <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>بدهکار</th><th>بستانکار</th></tr></thead>
- <tbody>
- {% for r in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ r.commodity.name ?? '-' }}</td>
- <td>{{ r.commodityCount }}</td>
- <td>{{ r.des }}</td>
- <td>{{ r.bd | number_format(0, '.', ',') }}</td>
- <td>{{ r.bs | number_format(0, '.', ',') }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
-</div>
+ <h3 style="text-align:center">{{ business.name }}</h3>
+ <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
+ <table width="100%" border="1" cellspacing="0"
+ cellpadding="6" style="margin-top:8px">
+ <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>بدهکار</th><th>بستانکار</th></tr></thead>
+ <tbody>
+ {% for r in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ r.commodity.name ?? '-' }}</td>
+ <td>{{ r.commodityCount }}</td>
+ <td>{{ r.des }}</td>
+ <td>{{ r.bd | number_format(0, '.', ',') }}</td>
+ <td>{{ r.bs | number_format(0, '.', ',') }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
<div class="invoice-template">
- <h3 style="text-align:center">{{ business.name }}</h3>
- <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
- <table width="100%" border="1" cellspacing="0" cellpadding="6" style="margin-top:8px">
- <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
- <tbody>
- {% for r in rows %}
- <tr>
- <td>{{ loop.index }}</td>
- <td>{{ r.commodity.name ?? '-' }}</td>
- <td>{{ r.commodityCount }}</td>
- <td>{{ r.des }}</td>
- <td>{{ r.tax | number_format(0, '.', ',') }}</td>
- <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount | number_format(0, '.', ',') }}{% endif %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
-</div>
+ <h3 style="text-align:center">{{ business.name }}</h3>
+ <div>کد: {{ doc.code }} | تاریخ: {{ doc.date }}</div>
+ <table width="100%" border="1" cellspacing="0"
+ cellpadding="6" style="margin-top:8px">
+ <thead><tr><th>#</th><th>کالا</th><th>تعداد</th><th>شرح</th><th>مالیات</th><th>تخفیف</th></tr></thead>
+ <tbody>
+ {% for r in rows %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ r.commodity.name ?? '-' }}</td>
+ <td>{{ r.commodityCount }}</td>
+ <td>{{ r.des }}</td>
+ <td>{{ r.tax | number_format(0, '.', ',') }}</td>
+ <td>{% if r.showPercentDiscount %}{{ r.discountPercent }}%{% else %}{{ r.discount |
+ number_format(0, '.', ',') }}{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
@@ -448,16 +512,45 @@