mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 04:15:10 +00:00
test: add pending quantity check for invoice creation
This commit is contained in:
@@ -2568,6 +2568,31 @@ class TestSalesOrder(AccountsTestMixin, IntegrationTestCase):
|
||||
po.submit()
|
||||
self.assertEqual(po.taxes[0].tax_amount, 2)
|
||||
|
||||
def test_pending_quantity_after_update_item_during_invoice_creation(self):
|
||||
so = make_sales_order(qty=30, rate=100)
|
||||
|
||||
si1 = make_sales_invoice(so.name)
|
||||
si1.update_stock = 1
|
||||
si1.get("items")[0].qty = 10
|
||||
si1.insert()
|
||||
si1.submit()
|
||||
|
||||
first_item_of_so = so.get("items")[0]
|
||||
trans_item = json.dumps(
|
||||
[
|
||||
{
|
||||
"item_code": first_item_of_so.item_code,
|
||||
"rate": 1000,
|
||||
"qty": first_item_of_so.qty,
|
||||
"docname": first_item_of_so.name,
|
||||
},
|
||||
]
|
||||
)
|
||||
update_child_qty_rate("Sales Order", trans_item, so.name)
|
||||
|
||||
si2 = make_sales_invoice(so.name)
|
||||
self.assertEqual(si2.items[0].qty, 20)
|
||||
|
||||
|
||||
def automatically_fetch_payment_terms(enable=1):
|
||||
accounts_settings = frappe.get_doc("Accounts Settings")
|
||||
|
||||
Reference in New Issue
Block a user