chore(UAE VAT 21): rename report

This commit is contained in:
Mohammad Hasnain
2020-10-14 12:21:36 +05:30
parent abf628c95d
commit dfc3993cec
8 changed files with 14 additions and 18 deletions

View File

@@ -38,11 +38,11 @@ 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='standard_rated_expenses', label='Standard Rated Expenses (AED)',
dict(fieldname='claimable_standard_rated_expenses', label='Claimable 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='standard_rated_expenses', print_hide=1,
fieldtype='Select', insert_after='claimable_standard_rated_expenses', print_hide=1,
options='Y\nN', default='N'),
dict(fieldname='claimable_reverse_charge', label='Claimable Reverse Charge (Percentage)',
insert_after='reverse_charge', fieldtype='Percent', print_hide=1,
@@ -132,11 +132,11 @@ def add_print_formats():
name in('Simplified Tax Invoice', 'Detailed Tax Invoice', 'Tax Invoice') """)
def add_custom_roles_for_reports():
"""Add Access Control to UAE VAT 21."""
if not frappe.db.get_value('Custom Role', dict(report='UAE VAT 21')):
"""Add Access Control to UAE VAT 201."""
if not frappe.db.get_value('Custom Role', dict(report='UAE VAT 201')):
frappe.get_doc(dict(
doctype='Custom Role',
report='UAE VAT 21',
report='UAE VAT 201',
roles= [
dict(role='Accounts User'),
dict(role='Accounts Manager'),

View File

@@ -145,11 +145,7 @@ def make_regional_gl_entries(gl_entries, doc):
def validate_returns(doc, method):
"""Standard Rated expenses should not be set when Reverse Charge Applicable is set."""
country = frappe.get_cached_value('Company', doc.company, 'country')
print("-"*50)
print(doc.reverse_charge)
print(flt(doc.standard_rated_expenses))
if country != 'United Arab Emirates':
return
if doc.reverse_charge == 'Y' and flt(doc.standard_rated_expenses) != 0:
frappe.throw(_("Standard Rated expenses should not be set when Reverse Charge Applicable is Y"))
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"))