mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
[validation] over billing against DN/PR
This commit is contained in:
@@ -28,6 +28,25 @@ class TestDeliveryNote(unittest.TestCase):
|
||||
pr.run_method("calculate_taxes_and_totals")
|
||||
pr.insert()
|
||||
pr.submit()
|
||||
|
||||
def test_over_billing_against_dn(self):
|
||||
from stock.doctype.delivery_note.delivery_note import make_sales_invoice
|
||||
|
||||
dn = webnotes.bean(copy=test_records[0]).insert()
|
||||
|
||||
self.assertRaises(webnotes.ValidationError, make_sales_invoice,
|
||||
dn.doc.name)
|
||||
|
||||
dn = webnotes.bean("Delivery Note", dn.doc.name)
|
||||
dn.submit()
|
||||
si = make_sales_invoice(dn.doc.name)
|
||||
|
||||
self.assertEquals(len(si), len(dn.doclist))
|
||||
|
||||
# modify export_amount
|
||||
si[1].export_rate = 200
|
||||
self.assertRaises(webnotes.ValidationError, webnotes.bean(si).submit)
|
||||
|
||||
|
||||
def test_delivery_note_no_gl_entry(self):
|
||||
webnotes.conn.sql("""delete from `tabBin`""")
|
||||
|
||||
@@ -22,7 +22,7 @@ import webnotes.defaults
|
||||
from webnotes.utils import cint
|
||||
|
||||
class TestPurchaseReceipt(unittest.TestCase):
|
||||
def test_make_purchase_invocie(self):
|
||||
def test_make_purchase_invoice(self):
|
||||
from stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice
|
||||
|
||||
pr = webnotes.bean(copy=test_records[0]).insert()
|
||||
@@ -37,6 +37,10 @@ class TestPurchaseReceipt(unittest.TestCase):
|
||||
self.assertEquals(pi[0]["doctype"], "Purchase Invoice")
|
||||
self.assertEquals(len(pi), len(pr.doclist))
|
||||
|
||||
# modify import_rate
|
||||
pi[1].import_rate = 200
|
||||
self.assertRaises(webnotes.ValidationError, webnotes.bean(pi).submit)
|
||||
|
||||
def test_purchase_receipt_no_gl_entry(self):
|
||||
pr = webnotes.bean(copy=test_records[0])
|
||||
pr.run_method("calculate_taxes_and_totals")
|
||||
|
||||
Reference in New Issue
Block a user