Skip to content

Commit

Permalink
fix: actual qty in sales order (backport #42248) (#42256)
Browse files Browse the repository at this point in the history
fix: actual qty in sales order (#42248)

(cherry picked from commit 1186ee1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure committed Jul 9, 2024
1 parent 3cc59e4 commit 4866958
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions erpnext/public/js/utils/sales_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,28 @@ erpnext.sales_common = {
if (doc.docstatus === 0 && doc.is_return && !doc.return_against) {
frappe.model.set_value(cdt, cdn, "incoming_rate", 0.0);
}

this.set_actual_qty(doc, cdt, cdn);
}

set_actual_qty(doc, cdt, cdn) {
let row = locals[cdt][cdn];
let sales_doctypes = ["Sales Invoice", "Delivery Note", "Sales Order"];

if (row.item_code && row.warehouse && sales_doctypes.includes(doc.doctype)) {
frappe.call({
method: "erpnext.stock.get_item_details.get_bin_details",
args: {
item_code: row.item_code,
warehouse: row.warehouse,
},
callback(r) {
if (r.message) {
frappe.model.set_value(cdt, cdn, "actual_qty", r.message.actual_qty);
}
},
});
}
}

toggle_editable_price_list_rate() {
Expand Down

0 comments on commit 4866958

Please sign in to comment.