Skip to content

Commit

Permalink
test: create si with sr in net weight - TC_S_141
Browse files Browse the repository at this point in the history
  • Loading branch information
Barathpalanisamy committed Jan 28, 2025
1 parent 17cafaa commit 2a613df
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5700,6 +5700,35 @@ def test_si_with_sr_calculate_with_net_total_TC_S_140(self):
self.assertEqual(si.total_taxes_and_charges, 200)
self.assertEqual(si.grand_total, 1200)

def test_si_with_sr_calculate_with_net_weight_TC_S_141(self):
from erpnext.accounts.doctype.shipping_rule.test_shipping_rule import create_shipping_rule
from erpnext.accounts.doctype.payment_entry.test_payment_entry import make_test_item


shipping_rule = create_shipping_rule(
shipping_rule_type="Selling",
shipping_rule_name="Shipping Rule - Test Net Weight",
args={"calculate_based_on": "Net Weight"}
)
self.assertEqual(shipping_rule.docstatus, 1)

item=make_test_item("_Test Item 1")
item.weight_per_unit =250
item.weight_uom ="Nos"
item.save
make_stock_entry(item_code="_Test Item 1", qty=10, rate=500, target="_Test Warehouse - _TC")
si = create_sales_invoice(item=item.name, qty=5,rate=200, do_not_submit=True)

si.shipping_rule = shipping_rule.name
si.items[0].weight_per_unit = 250
si.items[0].weight_uom = 'Nos'
si.save()
si.submit()

self.assertEqual(si.net_total, 1000)
self.assertEqual(si.total_taxes_and_charges, 200)
self.assertEqual(si.grand_total, 1200)

def test_fetch_payment_terms_from_order_TC_ACC_129(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import (
make_test_item
Expand Down

0 comments on commit 2a613df

Please sign in to comment.