fix(POS): 100 % Discount on Point of Sales (#37411)

fix: Allow 100% discount in POS
This commit is contained in:
Niraj Gautam 2023-11-12 11:52:35 +05:30 committed by GitHub
parent 8634abc021
commit 6f6d5cb4cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -548,6 +548,14 @@ erpnext.PointOfSale.Controller = class {
if (!item_code) if (!item_code)
return; return;
if (rate == undefined || rate == 0) {
frappe.show_alert({
message: __('Price is not set for the item.'),
indicator: 'orange'
});
frappe.utils.play_sound("error");
return;
}
const new_item = { item_code, batch_no, rate, uom, [field]: value }; const new_item = { item_code, batch_no, rate, uom, [field]: value };
if (serial_no) { if (serial_no) {

View File

@ -203,7 +203,7 @@ erpnext.PointOfSale.Payment = class {
const paid_amount = doc.paid_amount; const paid_amount = doc.paid_amount;
const items = doc.items; const items = doc.items;
if (paid_amount == 0 || !items.length) { if (!items.length || (paid_amount == 0 && doc.additional_discount_percentage != 100)) {
const message = items.length ? __("You cannot submit the order without payment.") : __("You cannot submit empty order."); const message = items.length ? __("You cannot submit the order without payment.") : __("You cannot submit empty order.");
frappe.show_alert({ message, indicator: "orange" }); frappe.show_alert({ message, indicator: "orange" });
frappe.utils.play_sound("error"); frappe.utils.play_sound("error");