feat: Normal rounding for GST Taxes (#24488)

* feat: Normal rounding for GST Taxes

* fix: Add test case

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Deepesh Garg
2021-02-19 14:30:23 +05:30
committed by GitHub
parent 811ff5c397
commit 6a5ef261f2
7 changed files with 198 additions and 232 deletions

View File

@@ -772,3 +772,24 @@ def make_regional_gl_entries(gl_entries, doc):
)
return gl_entries
@frappe.whitelist()
def get_regional_round_off_accounts(company, account_list):
country = frappe.get_cached_value('Company', company, 'country')
if country != 'India':
return
if isinstance(account_list, string_types):
account_list = json.loads(account_list)
if not frappe.db.get_single_value('GST Settings', 'round_off_gst_values'):
return
gst_accounts = get_gst_accounts(company)
gst_account_list = gst_accounts.get('cgst_account') + gst_accounts.get('sgst_account') \
+ gst_accounts.get('igst_account')
account_list.extend(gst_account_list)
return account_list