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
@santhida
in
apps/erpnext/erpnext/selling/page/point_of_sale/pos_payment.js
at line 204
add code like this
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();
});
show like this
1 Like
thank you
1 Like
I’m facing another issue
after giving discount, next slip still show discount %
can you help me this one?
discount only reset when I reload the screen or change discount %
POS Discount.mp4
@santhida
this will only set discount to 0 for new invoice not refresh that field
apps/erpnext/erpnext/selling/page/point_of_sale/pos_controller.js
make_sales_invoice_frm() {
const doctype = 'POS Invoice';
return new Promise(resolve => {
if (this.frm) {
this.frm = this.get_new_frm(this.frm);
this.frm.doc.items = [];
this.frm.doc.is_pos = 1;
this.frm.doc.additional_discount_percentage = 0;
resolve();
} else {
frappe.model.with_doctype(doctype, () => {
this.frm = this.get_new_frm();
this.frm.doc.items = [];
this.frm.doc.is_pos = 1;
this.frm.doc.additional_discount_percentage = 0;
resolve();
});
}
});
}
thank you
you are very helpful