Skip to content

Commit

Permalink
fix(POS): 100 % Discount on Point of Sales (#37411)
Browse files Browse the repository at this point in the history
fix: Allow 100% discount in POS
  • Loading branch information
niraj2477 authored Nov 12, 2023
1 parent 8634abc commit 6f6d5cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions erpnext/selling/page/point_of_sale/pos_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,14 @@ erpnext.PointOfSale.Controller = class {
if (!item_code)
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 };

if (serial_no) {
Expand Down
2 changes: 1 addition & 1 deletion erpnext/selling/page/point_of_sale/pos_payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ erpnext.PointOfSale.Payment = class {
const paid_amount = doc.paid_amount;
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.");
frappe.show_alert({ message, indicator: "orange" });
frappe.utils.play_sound("error");
Expand Down

0 comments on commit 6f6d5cb

Please sign in to comment.