Skip to content

Commit

Permalink
fix: actual qty in sales order (#42248)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Jul 9, 2024
1 parent 623b4c2 commit 1186ee1
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 1186ee1

Please sign in to comment.