mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
chore: fix conflicts
Removed test for purchase expense account and repost GL entries.
This commit is contained in:
@@ -4448,125 +4448,6 @@ class TestPurchaseReceipt(FrappeTestCase):
|
|||||||
|
|
||||||
self.assertEqual(srbnb_cost, 1000)
|
self.assertEqual(srbnb_cost, 1000)
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
def test_purchase_expense_account(self):
|
|
||||||
item = "Test Item with Purchase Expense Account"
|
|
||||||
make_item(item, {"is_stock_item": 1})
|
|
||||||
company = "_Test Company with perpetual inventory"
|
|
||||||
|
|
||||||
expense_account = "_Test Account Purchase Expense - TCP1"
|
|
||||||
expense_contra_account = "_Test Account Purchase Contra Expense - TCP1"
|
|
||||||
if not frappe.db.exists("Account", expense_account):
|
|
||||||
frappe.get_doc(
|
|
||||||
{
|
|
||||||
"doctype": "Account",
|
|
||||||
"account_name": "_Test Account Purchase Expense",
|
|
||||||
"parent_account": "Stock Expenses - TCP1",
|
|
||||||
"company": company,
|
|
||||||
"is_group": 0,
|
|
||||||
"root_type": "Expense",
|
|
||||||
}
|
|
||||||
).insert()
|
|
||||||
|
|
||||||
if not frappe.db.exists("Account", expense_contra_account):
|
|
||||||
frappe.get_doc(
|
|
||||||
{
|
|
||||||
"doctype": "Account",
|
|
||||||
"account_name": "_Test Account Purchase Contra Expense",
|
|
||||||
"parent_account": "Stock Expenses - TCP1",
|
|
||||||
"company": company,
|
|
||||||
"is_group": 0,
|
|
||||||
"root_type": "Expense",
|
|
||||||
}
|
|
||||||
).insert()
|
|
||||||
|
|
||||||
item_doc = frappe.get_doc("Item", item)
|
|
||||||
item_doc.append(
|
|
||||||
"item_defaults",
|
|
||||||
{
|
|
||||||
"company": company,
|
|
||||||
"default_warehouse": "Stores - TCP1",
|
|
||||||
"purchase_expense_account": expense_account,
|
|
||||||
"purchase_expense_contra_account": expense_contra_account,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
item_doc.save()
|
|
||||||
|
|
||||||
pr = make_purchase_receipt(
|
|
||||||
item_code=item,
|
|
||||||
qty=10,
|
|
||||||
rate=100,
|
|
||||||
company=company,
|
|
||||||
warehouse="Stores - TCP1",
|
|
||||||
)
|
|
||||||
|
|
||||||
gl_entries = get_gl_entries(pr.doctype, pr.name)
|
|
||||||
accounts = [d.account for d in gl_entries]
|
|
||||||
self.assertTrue(expense_account in accounts)
|
|
||||||
self.assertTrue(expense_contra_account in accounts)
|
|
||||||
|
|
||||||
for row in gl_entries:
|
|
||||||
if row.account == expense_account:
|
|
||||||
self.assertEqual(row.debit, 1000)
|
|
||||||
if row.account == expense_contra_account:
|
|
||||||
self.assertEqual(row.credit, 1000)
|
|
||||||
|
|
||||||
def test_repost_gl_entries(self):
|
|
||||||
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
|
|
||||||
|
|
||||||
item = "Test Item for Repost GL Entries"
|
|
||||||
make_item(item, {"is_stock_item": 1})
|
|
||||||
company = "_Test Company with perpetual inventory"
|
|
||||||
|
|
||||||
account = "Reposting Adjustment - TCP1"
|
|
||||||
if not frappe.db.exists("Account", account):
|
|
||||||
frappe.get_doc(
|
|
||||||
{
|
|
||||||
"doctype": "Account",
|
|
||||||
"account_name": "Reposting Adjustment",
|
|
||||||
"parent_account": "Stock Expenses - TCP1",
|
|
||||||
"company": company,
|
|
||||||
"is_group": 0,
|
|
||||||
"account_type": "Expense Account",
|
|
||||||
}
|
|
||||||
).insert()
|
|
||||||
|
|
||||||
se = make_stock_entry(
|
|
||||||
item_code=item,
|
|
||||||
qty=10,
|
|
||||||
rate=100,
|
|
||||||
company=company,
|
|
||||||
target="Stores - TCP1",
|
|
||||||
)
|
|
||||||
|
|
||||||
gl_entries = get_gl_entries(se.doctype, se.name)
|
|
||||||
for row in gl_entries:
|
|
||||||
self.assertTrue(row.account in ["Stock In Hand - TCP1", "Stock Adjustment - TCP1"])
|
|
||||||
|
|
||||||
se.items[0].db_set("expense_account", account)
|
|
||||||
se.reload()
|
|
||||||
|
|
||||||
repost_doc = frappe.get_doc(
|
|
||||||
{
|
|
||||||
"doctype": "Repost Item Valuation",
|
|
||||||
"based_on": "Transaction",
|
|
||||||
"voucher_type": se.doctype,
|
|
||||||
"voucher_no": se.name,
|
|
||||||
"posting_date": se.posting_date,
|
|
||||||
"posting_time": se.posting_time,
|
|
||||||
"company": se.company,
|
|
||||||
"repost_only_accounting_ledgers": 1,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
repost_doc.submit()
|
|
||||||
|
|
||||||
gl_entries = get_gl_entries(se.doctype, se.name)
|
|
||||||
for row in gl_entries:
|
|
||||||
self.assertTrue(row.account in ["Stock In Hand - TCP1", account])
|
|
||||||
|
|
||||||
def test_lcv_for_repack_entry(self):
|
def test_lcv_for_repack_entry(self):
|
||||||
from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import (
|
from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import (
|
||||||
create_landed_cost_voucher,
|
create_landed_cost_voucher,
|
||||||
@@ -4648,7 +4529,6 @@ class TestPurchaseReceipt(FrappeTestCase):
|
|||||||
|
|
||||||
self.assertEqual(sles, [1500.0, 1500.0])
|
self.assertEqual(sles, [1500.0, 1500.0])
|
||||||
|
|
||||||
>>>>>>> ccbbc60585 (fix: LCV is not changing the valuation of the repacked item)
|
|
||||||
|
|
||||||
def prepare_data_for_internal_transfer():
|
def prepare_data_for_internal_transfer():
|
||||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_internal_supplier
|
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_internal_supplier
|
||||||
|
|||||||
Reference in New Issue
Block a user