fix: GL Entries for receiving non CWIP assets using Purchase Receipt (#37660)

* fix: GL Entries for receiving non CWIP assets using Purchase Receipt

* fix: rearrange functions

* chore: rearrange functions

* chore: rearrange functions

* fix: Purchase Invoice GL entires for assets

* test: cwip accounting unit tests

* chore: Attribute error

* chore: Purchase Invoice tests

* chore: Missing asset account

* chore: Missing asset account

* chore: update tests

* fix: Internal transfer GL Entries

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* chore: make `Reserve Stock` checkbox visible in SO

* refactor: rename field `Auto Reserve Stock for Sales Order`

* feat: add fields to hold SO and SO Item ref in PR Item

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* refactor: Remove expense included in valuation accounts

* chore: Add back default in transit warehousefield

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
Deepesh Garg
2023-10-25 09:12:27 +05:30
committed by GitHub
parent 72d32a4901
commit 80774e2da1
16 changed files with 367 additions and 652 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),
)