mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-24 12:36:37 +00:00
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
This commit is contained in:
@@ -302,6 +302,7 @@ class AccountsController(TransactionBase):
|
||||
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")
|
||||
|
||||
@@ -262,6 +262,7 @@ def make_return_doc(doctype, source_name, target_doc=None):
|
||||
|
||||
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
|
||||
|
||||
@@ -469,13 +469,19 @@ class SellingController(StockController):
|
||||
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)
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class calculate_taxes_and_totals(object):
|
||||
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"))
|
||||
|
||||
Reference in New Issue
Block a user