[fix] Batch selected in the sales transaction for non batch item (#11713)
This commit is contained in:
parent
82ef26b327
commit
15f8fe0179
@ -355,7 +355,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
*/
|
*/
|
||||||
set_batch_number: function(cdt, cdn) {
|
set_batch_number: function(cdt, cdn) {
|
||||||
const doc = frappe.get_doc(cdt, cdn);
|
const doc = frappe.get_doc(cdt, cdn);
|
||||||
if(doc) {
|
if (doc && doc.has_batch_no) {
|
||||||
this._set_batch_number(doc);
|
this._set_batch_number(doc);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -149,7 +149,7 @@ def get_batches(item_code, warehouse, qty=1, throw=False):
|
|||||||
'select batch_id, sum(actual_qty) as qty from `tabBatch` join `tabStock Ledger Entry` '
|
'select batch_id, sum(actual_qty) as qty from `tabBatch` join `tabStock Ledger Entry` '
|
||||||
'on `tabBatch`.batch_id = `tabStock Ledger Entry`.batch_no '
|
'on `tabBatch`.batch_id = `tabStock Ledger Entry`.batch_no '
|
||||||
'where `tabStock Ledger Entry`.item_code = %s and `tabStock Ledger Entry`.warehouse = %s '
|
'where `tabStock Ledger Entry`.item_code = %s and `tabStock Ledger Entry`.warehouse = %s '
|
||||||
'and `tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL '
|
'and (`tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL)'
|
||||||
'group by batch_id '
|
'group by batch_id '
|
||||||
'order by `tabBatch`.expiry_date DESC, `tabBatch`.creation ASC',
|
'order by `tabBatch`.expiry_date DESC, `tabBatch`.creation ASC',
|
||||||
(item_code, warehouse),
|
(item_code, warehouse),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user