/
GST_Sales_Invoice.txt
438 lines (372 loc) · 17.7 KB
/
GST_Sales_Invoice.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<div class = "letter head">
<table border =0>
<tbody>
<tr>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "120">
<img src = "/files/companylogo.png" width = "100" height = "70">
</td>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "650">
<div class = "text-center"><font size = "2"><b> GST TAX INVOICE</b></font>
</div>
<div class = "text-center">
<font size = "1"><b>(Form GST INV -1 (See Rule...)</b></font>
</div>
<div class = "text-center">
<font size = "3"><b>Company Name</b></font>
</div>
<div class = "text-center">
<font size = "1"><b> Company Address</b></font>
</div>
<div class = "text-center">
<font size = "1"><b>Company Details</b><font><br><br>
</div>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "150">
<div class = "text-right">
<font size = "1">(Original for Buyer)</font>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="Header">
<table border =0>
<tbody>
<tr>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "160">
<div> <font size = "1">GSTIN </font> </div>
<div><font size = "1">State</font></div>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "200">
<div > <font size = "1"><b>: {{ doc.company_gstin }}</b></font> </div>
<div><font size = "1"><b>: Karnataka</b></font></div>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "160">
<div><font size = "1">Serial No of Invoice</font></div>
<div><font size = "1">Date of Invoice</font></div>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" colspan=1 width = "200">
<div><font size = "1"><b>: {{ doc.name }}</b></font></div>
<div><font size = "1"><b>: {{ doc.get_formatted("posting_date") }}</b></font></div>
</tr>
</tbody>
</table>
</div>
<hr>
<div class="seller-info new-seller-info">
<table border =0>
<tbody>
<tr>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<div> <font size = "2"><b>Billto Address: </font></b> </div><br>
<div> <font size = "1"><b>Customer Name </b></font> </div>
<div><font size = "1"><b>Address </b></font></div><br>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<br><br><div><b><font size = "2"> {{ doc.customer_name }}</font></b> </div>
<div> <font size = "1"> {{ doc.address_display }} </font></div>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<div> <font size = "2"><b>Ship To Address: </b></font> </div> <br>
<div> <font size = "1"><b>Customer Name </b></font> </div>
<div><font size = "1"><b>Address </b></font></div><br>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<br><br><div><b><font size = "2"> {{ doc.shipping_address_name }}</font></b> </div>
<div> <font size = "1"> {{ doc.shipping_address }} </font></div>
</td>
</tr>
<tr>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div><b>State</b> </div>
<div><b>GSTIN </b> </div><br>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div>{{ doc.billto_state }}</div>
<div>{{ doc.billto_gstin }}</div><br>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div><b>State</b> </div>
<div><b>Customer GSTIN </b> </div><br>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div>{{ doc.customer_state }}</div>
<div>{{ doc.customer_gstin }}</div><br>
</font>
</td>
</tr>
<tr>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div><b>Mobile No </b> </div>
<div><b>PO No </b> </div>
<div><b>PO Date </b> </div><br><br>
<div><b>Date Time of Invoice </b> </div>
<div><b>Date Time of Removal of Goods</b> </div>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div> {{ doc.contact_mobile }}</div>
<div>{{ doc.po_no }}</div>
<div> {{ doc.get_formatted("po_date")}}</div><br><br>
<div> {{ doc.get_formatted("date_time_of_invoice")}}</div>
<div>{{ doc.get_formatted("date_time_of_removal_of_goods")}}</div>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div><b>Date </b> </div>
<div><b>Payment Due Date </b> </div>
<div><b>PAN No </b> </div>
<div><b>Vendor Code </b> </div><br>
<div><b>Authenticated by </b></div>
<div>for <b>Company Name</b> </div><br><br>
<div><b>Authorized Signatory</b> </div><br>
</font>
</td>
<td style=" padding: 0px 6px 0px 6px !important;" width = "200">
<font size = "1">
<div>{{ doc.get_formatted("posting_date") }}</div>
<div>{{ doc.get_formatted("due_date") }}</div>
<div>{{ doc.pan_number }}</div>
<div>{{ doc.vendor_code }}</div><br><br><br><br><br><br><br>
</font>
</td>
</tr>
</tbody>
</table>
</div>
<table border = 2; width = "750">
<tbody>
<tr>
<th><font size = "1">Sr</font></th>
<th><font size = "1">Description</font></th>
<th><font size = "1">Tariff/HSN</font></th>
<th class="text-right"><font size = "1">Quantity</font></th>
<th class="text-right"><font size = "1">Rate</font></th>
<th class="text-right"><font size = "1">Amount</font></th>
<th class="text-right"><font size = "1">CGST Rate</font></th>
<th class="text-right"><font size = "1">CGST Amount</font></th>
<th class="text-right"><font size = "1">SGST Rate</font></th>
<th class="text-right"><font size = "1">SGST Amount</font></th>
<th class="text-right"><font size = "1">IGST Rate</font></th>
<th class="text-right"><font size = "1">IGST Amount</font></th>
</font>
</tr>
{% set cgst_rate = [] -%}
{% set sgst_rate = [] -%}
{% set igst_rate = [] -%}
{% set cgst_account_head = [] -%}
{% set sgst_account_head = [] -%}
{% set igst_account_head = [] -%}
{% set tot_cgst_amount = [] %}
{% set tot_sgst_amount = [] %}
{% set grand_total = {"qty":0.0, "amount":0.0, "cgst_amt":0.0, "sgst_amt":0.0, "igst_amt":0.0} %}
{%- for row in doc.taxes -%}
{% if 'CGST' in row.account_head -%}
{% set _ = cgst_account_head.append(row.account_head) %}
{% set _ = cgst_rate.append(row.rate) %}
{%- endif -%}
{% if 'SGST' in row.account_head -%}
{% set _ = sgst_account_head.append(row.account_head) %}
{% set _ = sgst_rate.append(row.rate) %}
{%- endif -%}
{% if 'IGST' in row.account_head -%}
{% set _ = igst_account_head.append(row.account_head) %}
{% set _ = igst_rate.append(row.rate) %}
{%- endif -%}
{%- endfor -%}
{%- for row in doc.items -%}
<tr>
{% set cgst_amt = [] -%}
{% set sgst_amt = [] -%}
{% set igst_amt = [] -%}
{% set it_cgst_rate = [] -%}
{% set it_sgst_rate = [] -%}
{% set it_igst_rate = [] -%}
{% set rate_found_item = 0 -%}
{%- set item_record = frappe.get_doc("Item", row.item_code) -%}
{% for item_tax in item_record.taxes %}
{% if item_tax.tax_type == igst_account_head[0] %}
{% set _ = it_igst_rate.append(item_tax.tax_rate) %}
{% set _ = igst_amt.append(row.amount * it_igst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% if item_tax.tax_type == sgst_account_head[0] %}
{% set _ = it_sgst_rate.append(item_tax.tax_rate) %}
{% set _ = sgst_amt.append(row.amount * it_sgst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% if item_tax.tax_type == cgst_account_head[0] %}
{% set _ = it_cgst_rate.append(item_tax.tax_rate) %}
{% set _ = cgst_amt.append(row.amount * it_cgst_rate[0] / 100) -%}
{% set rate_found_item = 1 -%}
{% endif %}
{% endfor %}
{% if rate_found_item == 0 %}
{% if cgst_rate[0] -%}
{% set _ = cgst_amt.append((row.amount * cgst_rate[0])/100) -%}
{% set _= it_cgst_rate.append(cgst_rate[0]) -%}
{% set rate_found_inv = 1 -%}
{%- endif -%}
{% if sgst_rate[0] -%}
{% set _ = sgst_amt.append((row.amount * sgst_rate[0])/100) -%}
{% set _= it_sgst_rate.append(sgst_rate[0]) -%}
{%- endif -%}
{% if igst_rate[0] -%}
{% set _ = igst_amt.append((row.amount * igst_rate[0])/100) -%}
{% set _= it_igst_rate.append(igst_rate[0]) -%}
{% set rate_found_inv = 1 -%}
{%- endif -%}
{% endif %}
{% if not it_cgst_rate[0] %}
{% set _ = it_cgst_rate.append(0) %}
{% set _ = cgst_amt.append(0) %}
{% endif %}
{% if not it_sgst_rate[0] %}
{% set _ = it_sgst_rate.append(0) %}
{% set _ = sgst_amt.append(0) %}
{% endif %}
{% if not it_igst_rate[0] %}
{% set _ = it_igst_rate.append(0) %}
{% set _ = igst_amt.append(0) %}
{% endif %}
{% set temp_cgst_amt = grand_total["cgst_amt"] + cgst_amt[0] %}
{% set temp_sgst_amt = grand_total["sgst_amt"] + sgst_amt[0] %}
{% set temp_igst_amt = grand_total["igst_amt"] + igst_amt[0] %}
{% set temp_qty = grand_total["qty"] + row.qty %}
{% set temp_amount = grand_total["amount"] + row.amount %}
{% set check = grand_total.update({"qty": temp_qty, "amount": temp_amount, "cgst_amt":temp_cgst_amt, "sgst_amt":temp_sgst_amt, "igst_amt":temp_igst_amt}) %}
<td style="width: 5%;"><font size = "1">{{ row.idx }}</font></td>
<td style="width: 15%;"><font size = "1">
{% if row.item_code != row.item_name -%}
<b>{{ row.item_code}}</b><br>
{%- endif %}
{{ row.item_name }}
</font></td>
<td style="width: 10%;"><font size = "1">{{ row.gst_hsn_code }}</font></td>
<td style="width: 10%; text-align: left;"><font size = "1">{{ row.uom or row.stock_uom }}            {{ row.qty }} </font></td>
<td style="width: 5%; text-align: right;"><font size = "1">{{
row.get_formatted("rate", doc) }}</font></td>
<td style="width: 10%; text-align: right;"><font size = "1">{{
row.get_formatted("amount", doc) }}</font></td>
<td style="width: 4%; text-align: right;"><font size = "1">{{
it_cgst_rate[0] }}%</font></td>
<td style="width: 10%; text-align: right;"><font size = "1">{{
"₹ {:,.2f}".format(cgst_amt[0]) }}</font></td>
<td style="width: 4%; text-align: right;"><font size = "1">{{
it_sgst_rate[0] }}%</font></td>
<td style="width: 10%; text-align: right;"><font size = "1">{{
"₹ {:,.2f}".format(sgst_amt[0]) }}</font></td>
<td style="width: 4%; text-align: right;"><font size = "1">{{
it_igst_rate[0] }}%</font></td>
<td style="width: 10%; text-align: right;"><font size = "1">{{
"₹ {:,.2f}".format(igst_amt[0]) }}</font></td>
</tr>
{%- endfor -%}
<tr>
<td style="width: 5%;"><font size = "1"></font></td>
<td style="width: 15%;"><font size = "1"><b>
Total
</b></font></td>
<td style="width: 10%;"><font size = "1"></font></td>
<td style="width: 10%; text-align: left;"><font size = "1"><b> {{ grand_total["qty"] }} </b></font></td>
<td style="width: 5%; text-align: right;"><font size = "1"></font></td>
<td style="width: 10%; text-align: right;"><font size = "1"><b>{{
"₹ {:,.2f}".format(grand_total["amount"]) }}</b></font></td>
<td style="width: 4%; text-align: right;"><font size = "1"><font></td>
<td style="width: 10%; text-align: right;"><font size = "1"><b>{{
"₹ {:,.2f}".format(grand_total["cgst_amt"]) }}</b></font></td>
<td style="width: 4%; text-align: right;"><font size = "1"></font></td>
<td style="width: 10%; text-align: right;"><font size = "1"><b>{{
"₹ {:,.2f}".format(grand_total["sgst_amt"]) }}</b></font></td>
<td style="width: 4%; text-align: right;"><font size = "1"></font></td>
<td style="width: 10%; text-align: right;"><font size = "1"><b>{{
"₹ {:,.2f}".format(grand_total["igst_amt"]) }}</b></font></td>
</tr>
</tbody>
</table>
<table class="noborder">
<tbody>
<tr>
<td class="text-right" width = "600"><font size = "1">
<b>{{ ("Total") }}</b>
</font></td>
<td class="text-right" width= "200"><font size = "1">
{{ doc.get_formatted("net_total") }}
</font></td>
</tr>
{%- for row in doc.taxes -%}
{%- if not row.included_in_print_rate -%}
<tr>
<td class="text-right" width = "600"><font size = "1">
<b>{{ row.description }}</b>
</font></td>
<td class="text-right" width= "200"><font size = "1">
{{ row.get_formatted("tax_amount", doc) }}
</font></td>
</tr>
{%- endif -%}
{%- endfor -%}
{%- if doc.discount_amount -%}
<tr>
<td class="text-right" width = "600"><font size = "1">
{{ ("Discount") }}
</font></td>
<td class="text-right" width = "200"><font size = "1">
{{ doc.get_formatted("discount_amount") }}
</font></td>
</tr>
{%- endif -%}
<tr>
<td class="text-right" width = "600"><font size = "1">
<b>{{ ("Grand Total") }}</b>
</font></td>
<td class="text-right" width = "200"><font size = "1">
{{ doc.get_formatted("grand_total") }}
</font></td>
</tr>
<tr>
<td class="text-right" width = "600"><font size = "1">
<b>{{ ("Rounded Total") }}</b>
</font></td>
<td class="text-right" width = "200"><font size = "1">
{{ doc.get_formatted("rounded_total") }}
</font></td>
</tr>
<tr>
<td class="text-right" width = "1000"><font size = "1">
<b>{{ ("In Words :") }}</b>
{{ doc.in_words }} <br>
</font></td>
</tr>
<tr>
<td class="text-right" width = "600"><font size = "1">
<b>Whether the tax is payable on Reverse charge? <b></font>
</td>
<td class="text-right" width = "200"><font size = "1">
{%- if doc.reverse_tax -%}
Yes
{%- else -%}
No
{%- endif %}
</font>
</td>
</tr>
</tbody>
</table>
<hr>
<p>{{ doc.terms or "" }}</p>
<p> Declaration: We declare that this invoice shows the actual price of the goods described and that all particulars are true and correct. <br> <br></p>
</p>Excise Declaration: We declare to the best of our knowledge and belief that the particulars stated herein are true and correct and that there is no consideration accruing to us directly or indirectly in any manner other than the amounts indicated herein.</p>
<div class="col-md-9 text-right"><font size = "1">for <b>Company Name</b> </font></div><br><br><br>
<div class="col-md-9 text-right"><font size = "1"><b>Authorized Signatory</b></font></div>