mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
fix(pos): cannot change paid amount in pos payments (#30661)
This commit is contained in:
@@ -721,11 +721,14 @@ erpnext.PointOfSale.Controller = class {
|
|||||||
|
|
||||||
async save_and_checkout() {
|
async save_and_checkout() {
|
||||||
if (this.frm.is_dirty()) {
|
if (this.frm.is_dirty()) {
|
||||||
|
let save_error = false;
|
||||||
|
await this.frm.save(null, null, null, () => save_error = true);
|
||||||
// only move to payment section if save is successful
|
// only move to payment section if save is successful
|
||||||
frappe.route_hooks.after_save = () => this.payment.checkout();
|
!save_error && this.payment.checkout();
|
||||||
return this.frm.save(
|
// show checkout button on error
|
||||||
null, null, null, () => this.cart.toggle_checkout_btn(true) // show checkout button on error
|
save_error && setTimeout(() => {
|
||||||
);
|
this.cart.toggle_checkout_btn(true);
|
||||||
|
}, 300); // wait for save to finish
|
||||||
} else {
|
} else {
|
||||||
this.payment.checkout();
|
this.payment.checkout();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user