Error fixed in stock ledger netry batch related

This commit is contained in:
Nabin Hait 2012-04-24 10:38:37 +05:30
parent 8f9a953931
commit 4c9525139d

View File

@ -35,11 +35,12 @@ class DocType:
def actual_amt_check(self):
if self.doc.batch_no:
batch_bal = flt(sql("select sum(actual_qty) from `tabStock Ledger Entry` where warehouse = '%s' and item_code = '%s' and batch_no = '%s'"%(self.doc.warehouse,self.doc.item_code,self.doc.batch_no))[0][0])
self.doc.fields.update({'batch_bal': batch_bal})
if (batch_bal + self.doc.actual_qty) < 0:
msgprint("""Not enough quantity (requested: %(actual_qty)s, current: %(batch_bal)s in Batch
<b>%(batch_no)s</b> for Item <b>%(item_code)s</b> at Warehouse<b>%(warehouse)s</b>
as on %(posting_date)s %(posting_time)s""" % self.doc.fields.update({'batch_bal': batch_bal}), raise_exception = 1)
as on %(posting_date)s %(posting_time)s""" % self.doc.fields, raise_exception = 1)
# mandatory