mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Merge branch 'develop' into drop-shipping
This commit is contained in:
@@ -719,25 +719,12 @@ def update_grand_total_for_rcm(doc, method):
|
|||||||
if country != 'India':
|
if country != 'India':
|
||||||
return
|
return
|
||||||
|
|
||||||
if not doc.total_taxes_and_charges:
|
gst_tax, base_gst_tax = get_gst_tax_amount(doc)
|
||||||
|
|
||||||
|
if not base_gst_tax:
|
||||||
return
|
return
|
||||||
|
|
||||||
if doc.reverse_charge == 'Y':
|
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') \
|
|
||||||
+ gst_accounts.get('igst_account')
|
|
||||||
|
|
||||||
base_gst_tax = 0
|
|
||||||
gst_tax = 0
|
|
||||||
|
|
||||||
for tax in doc.get('taxes'):
|
|
||||||
if tax.category not in ("Total", "Valuation and Total"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if flt(tax.base_tax_amount_after_discount_amount) and tax.account_head in gst_account_list:
|
|
||||||
base_gst_tax += tax.base_tax_amount_after_discount_amount
|
|
||||||
gst_tax += tax.tax_amount_after_discount_amount
|
|
||||||
|
|
||||||
doc.taxes_and_charges_added -= gst_tax
|
doc.taxes_and_charges_added -= gst_tax
|
||||||
doc.total_taxes_and_charges -= gst_tax
|
doc.total_taxes_and_charges -= gst_tax
|
||||||
doc.base_taxes_and_charges_added -= base_gst_tax
|
doc.base_taxes_and_charges_added -= base_gst_tax
|
||||||
@@ -771,6 +758,11 @@ def make_regional_gl_entries(gl_entries, doc):
|
|||||||
if country != 'India':
|
if country != 'India':
|
||||||
return gl_entries
|
return gl_entries
|
||||||
|
|
||||||
|
gst_tax, base_gst_tax = get_gst_tax_amount(doc)
|
||||||
|
|
||||||
|
if not base_gst_tax:
|
||||||
|
return gl_entries
|
||||||
|
|
||||||
if doc.reverse_charge == 'Y':
|
if doc.reverse_charge == 'Y':
|
||||||
gst_accounts = get_gst_accounts(doc.company)
|
gst_accounts = get_gst_accounts(doc.company)
|
||||||
gst_account_list = gst_accounts.get('cgst_account') + gst_accounts.get('sgst_account') \
|
gst_account_list = gst_accounts.get('cgst_account') + gst_accounts.get('sgst_account') \
|
||||||
@@ -799,23 +791,20 @@ def make_regional_gl_entries(gl_entries, doc):
|
|||||||
|
|
||||||
return gl_entries
|
return gl_entries
|
||||||
|
|
||||||
@frappe.whitelist()
|
def get_gst_tax_amount(doc):
|
||||||
def get_regional_round_off_accounts(company, account_list):
|
gst_accounts = get_gst_accounts(doc.company)
|
||||||
country = frappe.get_cached_value('Company', company, 'country')
|
gst_account_list = gst_accounts.get('cgst_account', []) + gst_accounts.get('sgst_account', []) \
|
||||||
|
+ gst_accounts.get('igst_account', [])
|
||||||
|
|
||||||
if country != 'India':
|
base_gst_tax = 0
|
||||||
return
|
gst_tax = 0
|
||||||
|
|
||||||
if isinstance(account_list, string_types):
|
for tax in doc.get('taxes'):
|
||||||
account_list = json.loads(account_list)
|
if tax.category not in ("Total", "Valuation and Total"):
|
||||||
|
continue
|
||||||
|
|
||||||
if not frappe.db.get_single_value('GST Settings', 'round_off_gst_values'):
|
if flt(tax.base_tax_amount_after_discount_amount) and tax.account_head in gst_account_list:
|
||||||
return
|
base_gst_tax += tax.base_tax_amount_after_discount_amount
|
||||||
|
gst_tax += tax.tax_amount_after_discount_amount
|
||||||
|
|
||||||
gst_accounts = get_gst_accounts(company)
|
return gst_tax, base_gst_tax
|
||||||
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
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
"is_tree": 1,
|
"is_tree": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"max_attachments": 3,
|
"max_attachments": 3,
|
||||||
"modified": "2021-02-08 17:02:44.951572",
|
"modified": "2021-02-18 13:40:30.049650",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Item Group",
|
"name": "Item Group",
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
"export": 1,
|
"export": 1,
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Customer",
|
"role": "All",
|
||||||
"select": 1,
|
"select": 1,
|
||||||
"share": 1
|
"share": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1066,7 +1066,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2021-02-18 14:00:19.668049",
|
"modified": "2021-03-15 13:41:04.108932",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
@@ -1118,6 +1118,15 @@
|
|||||||
{
|
{
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"role": "Manufacturing User"
|
"role": "Manufacturing User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"print": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "All",
|
||||||
|
"select": 1,
|
||||||
|
"share": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user