fix(POS): 100 % Discount on Point of Sales (#37411)
fix: Allow 100% discount in POS
This commit is contained in:
parent
8634abc021
commit
6f6d5cb4cf
@ -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) {
|
||||||
|
@ -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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user