fix: not able to reconcile expired batches (#44012)

(cherry picked from commit 8805e74784)
This commit is contained in:
rohitwaghchaure
2024-11-12 15:48:28 +05:30
committed by Mergify
parent 73661ac633
commit 4ba07a40eb
7 changed files with 40 additions and 5 deletions

View File

@@ -462,6 +462,8 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
is_inward = true;
}
let include_expired_batches = me.include_expired_batches();
return {
query: "erpnext.controllers.queries.get_batch_no",
filters: {
@@ -469,6 +471,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
warehouse:
this.item.s_warehouse || this.item.t_warehouse || this.item.warehouse,
is_inward: is_inward,
include_expired_batches: include_expired_batches,
},
};
},
@@ -497,6 +500,14 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
return fields;
}
include_expired_batches() {
return (
this.frm.doc.doctype === "Stock Reconciliation" ||
(this.frm.doc.doctype === "Stock Entry" &&
["Material Receipt", "Material Transfer", "Material Issue"].includes(this.frm.doc.purpose))
);
}
get_auto_data() {
let { qty, based_on } = this.dialog.get_values();