fix: Unable to submit reverse charge invoice

This commit is contained in:
Deepesh Garg 2020-08-20 16:31:38 +05:30
parent 019d4debb2
commit afd2dd3570

View File

@ -726,9 +726,6 @@ def make_regional_gl_entries(gl_entries, doc):
if country != 'India':
return gl_entries
if not doc.total_taxes_and_charges:
return gl_entries
if doc.reverse_charge == 'Y':
gst_accounts = get_gst_accounts(doc.company)
gst_account_list = gst_accounts.get('cgst_account') + gst_accounts.get('sgst_account') \
@ -738,6 +735,7 @@ def make_regional_gl_entries(gl_entries, doc):
if tax.category not in ("Total", "Valuation and Total"):
continue
dr_or_cr = "credit" if tax.add_deduct_tax == "Add" else "debit"
if flt(tax.base_tax_amount_after_discount_amount) and tax.account_head in gst_account_list:
account_currency = get_account_currency(tax.account_head)
@ -747,8 +745,8 @@ def make_regional_gl_entries(gl_entries, doc):
"cost_center": tax.cost_center,
"posting_date": doc.posting_date,
"against": doc.supplier,
"credit": tax.base_tax_amount_after_discount_amount,
"credits_in_account_currency": tax.base_tax_amount_after_discount_amount \
dr_or_cr: tax.base_tax_amount_after_discount_amount,
dr_or_cr + "_in_account_currency": tax.base_tax_amount_after_discount_amount \
if account_currency==doc.company_currency \
else tax.tax_amount_after_discount_amount
}, account_currency, item=tax)