fix(pos): multiple pos fixes and additions (#24227)
* fix: make custom fields in pos invoice similar to sales invoice
* feat: allow/disallow rate & discount change
* fix: any pos profile can be selected while creating pos opening
* fix: cannot add item to cart
* fix: validate phone payment only if payment request exists
* fix: replace pos payment method patch
* chore: rearrange item & customer group filter
* fix: allow/disallow invoice level discount
* fix: updating qty of item with uom having space char
* fix: move configuration checbox to config section
* fix: invalid item rate trigger
* fix: cannot remove item from draft invoices
* fix: customer currency not set in pos invoice
* fix: duplicate item error message
* fix: sales uom not fetched in pos invoice
* fix: cannot add taxes to pos invoice for uae region
* fix: cannot merge pos invoice into credit note
* fix: tax calculation while merging pos invoices
* feat: delete draft orders from order list
* fix: merging of pos invoice with pricing rules
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 9d9d1b3..2f4eb81 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -302,6 +302,7 @@
args["doctype"] = self.doctype
args["name"] = self.name
args["child_docname"] = item.name
+ args["ignore_pricing_rule"] = self.ignore_pricing_rule if hasattr(self, 'ignore_pricing_rule') else 0
if not args.get("transaction_date"):
args["transaction_date"] = args.get("posting_date")
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index a048d6e..0e1829a 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -262,6 +262,7 @@
if doc.get("is_return"):
if doc.doctype == 'Sales Invoice' or doc.doctype == 'POS Invoice':
+ doc.consolidated_invoice = ""
doc.set('payments', [])
for data in source.payments:
paid_amount = 0.00
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index e085048..a774a95 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -469,13 +469,19 @@
non_stock_items = [d.item_code, d.description]
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 1:
+ duplicate_items_msg = _("Item {0} entered multiple times.").format(frappe.bold(d.item_code))
+ duplicate_items_msg += "<br><br>"
+ duplicate_items_msg += _("Please enable {} in {} to allow same item in multiple rows").format(
+ frappe.bold("Allow Item to Be Added Multiple Times in a Transaction"),
+ get_link_to_form("Selling Settings", "Selling Settings")
+ )
if stock_items in check_list:
- frappe.throw(_("Note: Item {0} entered multiple times").format(d.item_code))
+ frappe.throw(duplicate_items_msg)
else:
check_list.append(stock_items)
else:
if non_stock_items in chk_dupl_itm:
- frappe.throw(_("Note: Item {0} entered multiple times").format(d.item_code))
+ frappe.throw(duplicate_items_msg)
else:
chk_dupl_itm.append(non_stock_items)
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 76309f8..fd744a7 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -107,7 +107,7 @@
elif item.discount_amount and item.pricing_rules:
item.rate = item.price_list_rate - item.discount_amount
- if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
+ if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item', 'POS Invoice Item']:
item.rate_with_margin, item.base_rate_with_margin = self.calculate_margin(item)
if flt(item.rate_with_margin) > 0:
item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))