refactor: Remove expense included in valuation accounts (#37632)

* refactor: Remove expense included in valuation accounts

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests
This commit is contained in:
Deepesh Garg
2023-10-23 18:23:45 +05:30
committed by GitHub
parent 2b64e1ca8b
commit 3bfb7b79f2
11 changed files with 17 additions and 248 deletions

View File

@@ -1,42 +0,0 @@
import frappe
def execute():
frappe.reload_doctype("Landed Cost Taxes and Charges")
company_account_map = frappe._dict(
frappe.db.sql(
"""
SELECT name, expenses_included_in_valuation from `tabCompany`
"""
)
)
for company, account in company_account_map.items():
frappe.db.sql(
"""
UPDATE
`tabLanded Cost Taxes and Charges` t, `tabLanded Cost Voucher` l
SET
t.expense_account = %s
WHERE
l.docstatus = 1
AND l.company = %s
AND t.parent = l.name
""",
(account, company),
)
frappe.db.sql(
"""
UPDATE
`tabLanded Cost Taxes and Charges` t, `tabStock Entry` s
SET
t.expense_account = %s
WHERE
s.docstatus = 1
AND s.company = %s
AND t.parent = s.name
""",
(account, company),
)