diff --git a/erpnext/accounts/gl_snapshots/pr_basic.json b/erpnext/accounts/gl_snapshots/pr_basic.json new file mode 100644 index 00000000000..8a7f7d0824d --- /dev/null +++ b/erpnext/accounts/gl_snapshots/pr_basic.json @@ -0,0 +1,30 @@ +[ + { + "account": "Stock In Hand - TCP1", + "account_currency": "INR", + "against": "Stock Received But Not Billed - TCP1", + "cost_center": "Main - TCP1", + "credit": 0.0, + "credit_in_account_currency": 0.0, + "debit": 500.0, + "debit_in_account_currency": 500.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + }, + { + "account": "Stock Received But Not Billed - TCP1", + "account_currency": "INR", + "against": "Stock In Hand - TCP1", + "cost_center": "Main - TCP1", + "credit": 500.0, + "credit_in_account_currency": 500.0, + "debit": 0.0, + "debit_in_account_currency": 0.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + } +] diff --git a/erpnext/accounts/gl_snapshots/pr_return.json b/erpnext/accounts/gl_snapshots/pr_return.json new file mode 100644 index 00000000000..32715c31173 --- /dev/null +++ b/erpnext/accounts/gl_snapshots/pr_return.json @@ -0,0 +1,30 @@ +[ + { + "account": "Stock In Hand - TCP1", + "account_currency": "INR", + "against": "Stock Received But Not Billed - TCP1", + "cost_center": "Main - TCP1", + "credit": 500.0, + "credit_in_account_currency": 500.0, + "debit": 0.0, + "debit_in_account_currency": 0.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + }, + { + "account": "Stock Received But Not Billed - TCP1", + "account_currency": "INR", + "against": "Stock In Hand - TCP1", + "cost_center": "Main - TCP1", + "credit": 0.0, + "credit_in_account_currency": 0.0, + "debit": 500.0, + "debit_in_account_currency": 500.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + } +] diff --git a/erpnext/accounts/gl_snapshots/pr_with_taxes.json b/erpnext/accounts/gl_snapshots/pr_with_taxes.json new file mode 100644 index 00000000000..38ed6a59549 --- /dev/null +++ b/erpnext/accounts/gl_snapshots/pr_with_taxes.json @@ -0,0 +1,58 @@ +[ + { + "account": "Stock In Hand - TCP1", + "account_currency": "INR", + "against": "Stock Received But Not Billed - TCP1", + "cost_center": "Main - TCP1", + "credit": 0.0, + "credit_in_account_currency": 0.0, + "debit": 750.0, + "debit_in_account_currency": 750.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + }, + { + "account": "Stock Received But Not Billed - TCP1", + "account_currency": "INR", + "against": "Stock In Hand - TCP1", + "cost_center": "Main - TCP1", + "credit": 500.0, + "credit_in_account_currency": 500.0, + "debit": 0.0, + "debit_in_account_currency": 0.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + }, + { + "account": "_Test Account Customs Duty - TCP1", + "account_currency": "INR", + "against": "Stock In Hand - TCP1", + "cost_center": "Main - TCP1", + "credit": 150.0, + "credit_in_account_currency": 150.0, + "debit": 0.0, + "debit_in_account_currency": 0.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + }, + { + "account": "_Test Account Shipping Charges - TCP1", + "account_currency": "INR", + "against": "Stock In Hand - TCP1", + "cost_center": "Main - TCP1", + "credit": 100.0, + "credit_in_account_currency": 100.0, + "debit": 0.0, + "debit_in_account_currency": 0.0, + "is_opening": "No", + "party": null, + "party_type": null, + "posting_date": "2024-01-15" + } +] diff --git a/erpnext/accounts/gl_snapshots/se_material_issue.json b/erpnext/accounts/gl_snapshots/se_material_issue.json index b177281c902..705b5255ee3 100644 --- a/erpnext/accounts/gl_snapshots/se_material_issue.json +++ b/erpnext/accounts/gl_snapshots/se_material_issue.json @@ -6,8 +6,8 @@ "cost_center": "Main - TCP1", "credit": 0.0, "credit_in_account_currency": 0.0, - "debit": 500.0, - "debit_in_account_currency": 500.0, + "debit": 750.0, + "debit_in_account_currency": 750.0, "is_opening": "No", "party": null, "party_type": null, @@ -18,8 +18,8 @@ "account_currency": "INR", "against": "Stock Adjustment - TCP1", "cost_center": "Main - TCP1", - "credit": 500.0, - "credit_in_account_currency": 500.0, + "credit": 750.0, + "credit_in_account_currency": 750.0, "debit": 0.0, "debit_in_account_currency": 0.0, "is_opening": "No", diff --git a/erpnext/accounts/test_gl_characterization.py b/erpnext/accounts/test_gl_characterization.py index 8ada6082db9..4cfc9a7f803 100644 --- a/erpnext/accounts/test_gl_characterization.py +++ b/erpnext/accounts/test_gl_characterization.py @@ -26,6 +26,7 @@ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_sales_return from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice from erpnext.accounts.gl_snapshot import assert_gl_snapshot +from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry POSTING_DATE = "2024-01-15" @@ -441,6 +442,44 @@ class TestGLCharacterization(IntegrationTestCase): sr.submit() assert_gl_snapshot(self, "sr_basic", "Stock Reconciliation", sr.name) + def test_pr_basic(self): + pr = make_purchase_receipt( + company=DN_COMPANY, + warehouse=DN_WAREHOUSE, + posting_date=POSTING_DATE, + qty=5, + rate=100, + ) + assert_gl_snapshot(self, "pr_basic", "Purchase Receipt", pr.name) + + def test_pr_with_taxes(self): + pr = make_purchase_receipt( + company=DN_COMPANY, + warehouse=DN_WAREHOUSE, + posting_date=POSTING_DATE, + qty=5, + rate=100, + get_taxes_and_charges=True, + ) + assert_gl_snapshot(self, "pr_with_taxes", "Purchase Receipt", pr.name) + + def test_pr_return(self): + original = make_purchase_receipt( + company=DN_COMPANY, + warehouse=DN_WAREHOUSE, + posting_date=POSTING_DATE, + qty=5, + rate=100, + ) + from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_return + + ret = make_purchase_return(original.name) + ret.posting_date = POSTING_DATE + ret.set_posting_time = 1 + ret.insert() + ret.submit() + assert_gl_snapshot(self, "pr_return", "Purchase Receipt", ret.name) + def _make_dated_delivery_note(**args) -> frappe.Document: """Minimal Delivery Note on a fixed posting date using the perpetual-inventory