Total Sales Amount 1000
User Paid Amount 500
Currently System allow user to Submit
for Point of Sales, we should not allow user to made credit sales
POS didn’t allow user to settle outstanding payment
after fixing the code, it was working well
apps/erpnext/erpnext/selling/page/point_of_sale/pos_payment.js
this.$component.on('click', '.submit-order-btn', () => {
const doc = this.events.get_frm().doc;
const paid_amount = doc.paid_amount;
const items = doc.items;
const out_stand = doc.outstanding_amount
if (paid_amount == 0 || !items.length) {
const message = items.length ? ("You cannot submit the order without payment.") : ("You cannot submit empty order.");
frappe.show_alert({ message, indicator: "orange" });
frappe.utils.play_sound("error");
return;
}
if (out_stand > 0){
const message = __("You cannot submit the order with Outstanding payment.")
frappe.show_alert({ message, indicator: "red" });
frappe.utils.play_sound("error");
return;
}
this.events.submit_invoice();
});
Module
selling
Version
ERPNext: v15.27.1 (version-15)
Frappe Framework: v15.29.1 (version-15)
Frappe HR: v15.22.1 (version-15)
Payments: v0.0.1 (version-15)
Webshop: v0.0.1 (version-15)
Installation method
FrappeCloud
Relevant log output / Stack trace / Full Error Message.
Information about bug
Total Sales Amount 1000 User Paid Amount 500 Currently System allow user to Submit for Point of Sales, we should not allow user to made credit sales POS didn’t allow user to settle outstanding payment
after fixing the code, it was working well apps/erpnext/erpnext/selling/page/point_of_sale/pos_payment.js this.$component.on('click', '.submit-order-btn', () => { const doc = this.events.get_frm().doc; const paid_amount = doc.paid_amount; const items = doc.items; const out_stand = doc.outstanding_amount if (paid_amount == 0 || !items.length) { const message = items.length ? ("You cannot submit the order without payment.") : ("You cannot submit empty order."); frappe.show_alert({ message, indicator: "orange" }); frappe.utils.play_sound("error"); return; } if (out_stand > 0){ const message = __("You cannot submit the order with Outstanding payment.") frappe.show_alert({ message, indicator: "red" }); frappe.utils.play_sound("error"); return; }
Module
selling
Version
ERPNext: v15.27.1 (version-15)
Frappe Framework: v15.29.1 (version-15)
Frappe HR: v15.22.1 (version-15)
Payments: v0.0.1 (version-15)
Webshop: v0.0.1 (version-15)
Installation method
FrappeCloud
Relevant log output / Stack trace / Full Error Message.
No response