Skip to content

Commit 87656e0

Browse files
committed
Merge upstream Pull Request from:-
software-to-hardware#10
2 parents ab14a08 + f23cdc3 commit 87656e0

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed

uk_vat/fixtures/custom_field.json

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
"collapsible": 0,
295295
"collapsible_depends_on": null,
296296
"columns": 0,
297-
"default": null,
297+
"default": true,
298298
"depends_on": null,
299299
"description": null,
300300
"docstatus": 0,
@@ -350,7 +350,7 @@
350350
"dt": "Item Tax Template",
351351
"fetch_from": null,
352352
"fetch_if_empty": 0,
353-
"fieldname": "vat_rules",
353+
"fieldname": "vat_country",
354354
"fieldtype": "Select",
355355
"hidden": 0,
356356
"ignore_user_permissions": 0,
@@ -359,13 +359,61 @@
359359
"in_list_view": 0,
360360
"in_standard_filter": 0,
361361
"insert_after": "vat_is_in_vat_return",
362+
"label": "VAT Country",
363+
"length": 0,
364+
"mandatory_depends_on": null,
365+
"modified": "2020-07-07 00:37:54.183648",
366+
"name": "Item Tax Template-vat_country",
367+
"no_copy": 0,
368+
"options": "UK",
369+
"parent": null,
370+
"parentfield": null,
371+
"parenttype": null,
372+
"permlevel": 0,
373+
"precision": "",
374+
"print_hide": 0,
375+
"print_hide_if_no_value": 0,
376+
"print_width": null,
377+
"read_only": 0,
378+
"read_only_depends_on": null,
379+
"report_hide": 0,
380+
"reqd": 0,
381+
"search_index": 0,
382+
"translatable": 1,
383+
"unique": 0,
384+
"width": null
385+
},
386+
{
387+
"allow_in_quick_entry": 0,
388+
"allow_on_submit": 0,
389+
"bold": 0,
390+
"collapsible": 0,
391+
"collapsible_depends_on": null,
392+
"columns": 0,
393+
"default": null,
394+
"depends_on": null,
395+
"description": null,
396+
"docstatus": 0,
397+
"doctype": "Custom Field",
398+
"dt": "Item Tax Template",
399+
"fetch_from": null,
400+
"fetch_if_empty": 0,
401+
"fieldname": "vat_rules",
402+
"fieldtype": "Select",
403+
"hidden": 0,
404+
"ignore_user_permissions": 0,
405+
"ignore_xss_filter": 0,
406+
"in_global_search": 0,
407+
"in_list_view": 0,
408+
"in_standard_filter": 0,
409+
"insert_after": "vat_country",
362410
"label": "VAT Rules",
363411
"length": 0,
364412
"mandatory_depends_on": null,
365413
"modified": "2020-04-10 16:48:54.187648",
366414
"name": "Item Tax Template-vat_rules",
367415
"no_copy": 0,
368-
"options": "UK\nEU\nRest of World",
416+
"options": "Domestic\nEU\nRest of World",
369417
"parent": null,
370418
"parentfield": null,
371419
"parenttype": null,

uk_vat/uk_vat_return/doctype/uk_vat_return/uk_vat_return.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_transactions(company, invoice_type, period_start_date, period_end_date):
6565
select invoice.name as name, ii.item_name, ii.item_code, ii.idx,
6666
ii.base_amount, ii.item_tax_template,
6767
tt.vat_rate, tt.vat_is_reverse_charge, tt.vat_transaction_type,
68-
tt.vat_rules from
68+
tt.vat_rules, tt.vat_country from
6969
`tab{invoice_type} Invoice` invoice
7070
inner join `tab{invoice_type} Invoice Item` ii on
7171
ii.parent = invoice.name
@@ -75,7 +75,8 @@ def get_transactions(company, invoice_type, period_start_date, period_end_date):
7575
invoice.docstatus = 1 and
7676
invoice.posting_date >= %s and
7777
invoice.posting_date <= %s and
78-
tt.vat_is_in_vat_return = 1
78+
tt.vat_is_in_vat_return = 1 and
79+
tt.vat_country = 'UK'
7980
""".format(invoice_type=invoice_type),
8081
(period_start_date, period_end_date), as_dict=True)
8182

@@ -139,7 +140,7 @@ def increment(item, field_list):
139140
repr(sale["vat_transaction_type"]))
140141

141142
# UK trade
142-
elif sale["vat_rules"]=="UK":
143+
elif sale["vat_rules"]=="Domestic":
143144

144145
# Boxes 1 and 6
145146
increment(sale, ("vatDueSales","totalValueSalesExVAT"))
@@ -188,7 +189,7 @@ def increment(item, field_list):
188189
repr(purchase["vat_transaction_type"]))
189190

190191
# UK trade
191-
elif purchase["vat_rules"]=="UK":
192+
elif purchase["vat_rules"]=="Domestic":
192193

193194
if purchase["vat_is_reverse_charge"]:
194195

0 commit comments

Comments
 (0)