feat(UAE VAT 201): claimable to recoverable

This commit is contained in:
Mohammad Hasnain 2020-10-19 17:58:50 +05:30
parent b9dc13294d
commit 32eb9a7893
2 changed files with 7 additions and 7 deletions

View File

@ -38,13 +38,13 @@ def make_custom_fields():
dict(fieldname='supplier_name_in_arabic', label='Supplier Name in Arabic',
fieldtype='Read Only', insert_after='supplier_name',
fetch_from='supplier.supplier_name_in_arabic', print_hide=1),
dict(fieldname='claimable_standard_rated_expenses', label='Claimable Standard Rated Expenses (AED)',
dict(fieldname='recoverable_standard_rated_expenses', label='Recoverable Standard Rated Expenses (AED)',
insert_after='permit_no', fieldtype='Currency', print_hide=1, default='0',
depends_on="eval:doc.reverse_charge=='N'",),
dict(fieldname='reverse_charge', label='Reverse Charge Applicable',
fieldtype='Select', insert_after='claimable_standard_rated_expenses', print_hide=1,
fieldtype='Select', insert_after='recoverable_standard_rated_expenses', print_hide=1,
options='Y\nN', default='N'),
dict(fieldname='claimable_reverse_charge', label='Claimable Reverse Charge (Percentage)',
dict(fieldname='recoverable_reverse_charge', label='Recoverable Reverse Charge (Percentage)',
insert_after='reverse_charge', fieldtype='Percent', print_hide=1,
depends_on="eval:doc.reverse_charge=='Y'", default='100.000'),
]
@ -57,7 +57,7 @@ def make_custom_fields():
fieldtype='Read Only', insert_after='customer_name',
fetch_from='customer.customer_name_in_arabic', print_hide=1),
dict(fieldname='emirate', label='Emirate', insert_after='customer_address',
fieldtype='Read Only', fetch_from='customer_address.emirates'),
fieldtype='Read Only', fetch_from='customer_address.emirate'),
dict(fieldname='tourist_tax_return', label='Tax Refund provided to Tourists (AED)',
insert_after='permit_no', fieldtype='Currency', print_hide=1, default='0'),
]
@ -102,7 +102,7 @@ def make_custom_fields():
fieldtype='Data', insert_after='supplier_name'),
],
'Address': [
dict(fieldname='emirates', label='Emirates', fieldtype='Select', insert_after='state',
dict(fieldname='emirate', label='Emirate', fieldtype='Select', insert_after='state',
options='Abu Dhabi\nAjman\nDubai\nFujairah\nRas Al Khaimah\nSharjah\nUmm Al Quwain')
],
'Purchase Invoice': purchase_invoice_fields + invoice_fields,

View File

@ -147,5 +147,5 @@ def validate_returns(doc, method):
country = frappe.get_cached_value('Company', doc.company, 'country')
if country != 'United Arab Emirates':
return
if doc.reverse_charge == 'Y' and flt(doc.claimable_standard_rated_expenses) != 0:
frappe.throw(_("Claimable Standard Rated expenses should not be set when Reverse Charge Applicable is Y"))
if doc.reverse_charge == 'Y' and flt(doc.recoverable_standard_rated_expenses) != 0:
frappe.throw(_("Recoverable Standard Rated expenses should not be set when Reverse Charge Applicable is Y"))