fixes in stock entry
This commit is contained in:
parent
dad280ed8e
commit
e5f1152c01
@ -182,7 +182,7 @@ class DocType(TransactionBase):
|
|||||||
if self.doc.purpose == "Sales Return" and \
|
if self.doc.purpose == "Sales Return" and \
|
||||||
(self.doc.delivery_note_no or self.doc.sales_invoice_no):
|
(self.doc.delivery_note_no or self.doc.sales_invoice_no):
|
||||||
sle = webnotes.conn.sql("""select name, posting_date, posting_time,
|
sle = webnotes.conn.sql("""select name, posting_date, posting_time,
|
||||||
actual_qty, stock_value from `tabStock Ledger Entry`
|
actual_qty, stock_value, warehouse from `tabStock Ledger Entry`
|
||||||
where voucher_type = %s and voucher_no = %s and
|
where voucher_type = %s and voucher_no = %s and
|
||||||
item_code = %s and ifnull(is_cancelled, 'No') = 'No' limit 1""",
|
item_code = %s and ifnull(is_cancelled, 'No') = 'No' limit 1""",
|
||||||
((self.doc.delivery_note_no and "Delivery Note" or "Sales Invoice"),
|
((self.doc.delivery_note_no and "Delivery Note" or "Sales Invoice"),
|
||||||
@ -191,7 +191,8 @@ class DocType(TransactionBase):
|
|||||||
args.update({
|
args.update({
|
||||||
"posting_date": sle[0].posting_date,
|
"posting_date": sle[0].posting_date,
|
||||||
"posting_time": sle[0].posting_time,
|
"posting_time": sle[0].posting_time,
|
||||||
"sle": sle[0].name
|
"sle": sle[0].name,
|
||||||
|
"warehouse": sle[0].warehouse,
|
||||||
})
|
})
|
||||||
previous_sle = get_previous_sle(args)
|
previous_sle = get_previous_sle(args)
|
||||||
incoming_rate = (flt(sle[0].stock_value) - flt(previous_sle.get("stock_value"))) / \
|
incoming_rate = (flt(sle[0].stock_value) - flt(previous_sle.get("stock_value"))) / \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user