diff --git a/posnext/fixtures/custom_field.json b/posnext/fixtures/custom_field.json index 6b3c9e1..b8ae7ff 100644 --- a/posnext/fixtures/custom_field.json +++ b/posnext/fixtures/custom_field.json @@ -40,7 +40,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -97,7 +96,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -154,7 +152,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -211,7 +208,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -268,7 +264,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -325,7 +320,6 @@ "non_negative": 0, "options": "POS Profile", "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -382,7 +376,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -439,7 +432,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -496,7 +488,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -553,7 +544,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -610,7 +600,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -667,7 +656,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -724,7 +712,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -781,7 +768,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -838,7 +824,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -895,7 +880,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -952,7 +936,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -983,7 +966,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_uom_in_cart", + "fieldname": "show_batch_in_cart", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -998,18 +981,17 @@ "insert_after": "custom_edit_rate_and_uom", "is_system_generated": 0, "is_virtual": 0, - "label": "Show UOM in Cart", + "label": "Show Batch No", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-08 22:09:04.484772", + "modified": "2025-03-28 12:03:58.035560", "module": "Posnext", - "name": "POS Profile-custom_show_uom_in_cart", + "name": "POS Profile-custom_show_batch_no", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1040,7 +1022,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_incoming_rate", + "fieldname": "custom_show_uom_in_cart", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -1052,21 +1034,20 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_uom_in_cart", + "insert_after": "custom_edit_rate_and_uom", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Incoming Rate", + "label": "Show UOM in Cart", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-04 00:05:16.953710", + "modified": "2024-12-08 22:09:04.484772", "module": "Posnext", - "name": "POS Profile-custom_show_incoming_rate", + "name": "POS Profile-custom_show_uom_in_cart", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1097,7 +1078,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_logical_rack_in_cart", + "fieldname": "custom_show_incoming_rate", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -1109,21 +1090,20 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_incoming_rate", + "insert_after": "show_branch", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Logical Rack in Cart", + "label": "Show Incoming Rate", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-07 00:03:43.974745", + "modified": "2024-12-04 00:05:16.953710", "module": "Posnext", - "name": "POS Profile-custom_show_logical_rack_in_cart", + "name": "POS Profile-custom_show_incoming_rate", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1180,7 +1160,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1204,14 +1183,14 @@ "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": "eval: doc.custom_edit_rate_and_uom", + "depends_on": "eval: doc.custom_edit_rate_and_uom;", "description": null, "docstatus": 0, "doctype": "Custom Field", "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_use_discount_percentage", + "fieldname": "custom_show_logical_rack_in_cart", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -1223,21 +1202,20 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_logical_rack_in_cart", + "insert_after": "custom_show_incoming_rate", "is_system_generated": 0, "is_virtual": 0, - "label": "Use Discount Percentage", + "label": "Show Logical Rack in Cart", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-11-15 06:30:05.707381", + "modified": "2024-12-07 00:03:43.974745", "module": "Posnext", - "name": "POS Profile-custom_use_discount_percentage", + "name": "POS Profile-custom_show_logical_rack_in_cart", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1294,7 +1272,62 @@ "non_negative": 0, "options": "Alternative Items", "permlevel": 0, - "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval: doc.custom_edit_rate_and_uom", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "POS Profile", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_use_discount_percentage", + "fieldtype": "Check", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_show_logical_rack_in_cart", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Use Discount Percentage", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-11-15 06:30:05.707381", + "module": "Posnext", + "name": "POS Profile-custom_use_discount_percentage", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1351,7 +1384,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1408,7 +1440,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1465,7 +1496,6 @@ "non_negative": 0, "options": "POS Profile Whatsapp Field Names", "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1522,7 +1552,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1579,7 +1608,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1636,7 +1664,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1693,7 +1720,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1750,7 +1776,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1807,7 +1832,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1864,7 +1888,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -1892,11 +1915,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_credit_sales", - "fieldtype": "Check", + "fieldname": "custom_valuation_rate", + "fieldtype": "Currency", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -1907,26 +1930,25 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_additional_note", + "insert_after": "item_tax_template", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Credit Sales", + "label": "Valuation Rate", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-11-01 05:25:31.674539", + "modified": "2024-12-04 23:51:32.067475", "module": "Posnext", - "name": "POS Profile-custom_show_credit_sales", + "name": "Sales Invoice Item-custom_valuation_rate", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -1949,11 +1971,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_valuation_rate", - "fieldtype": "Currency", + "fieldname": "custom_show_credit_sales", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -1964,26 +1986,25 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "item_tax_template", + "insert_after": "custom_show_additional_note", "is_system_generated": 0, "is_virtual": 0, - "label": "Valuation Rate", + "label": "Show Credit Sales", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-04 23:51:32.067475", + "modified": "2024-11-01 05:25:31.674539", "module": "Posnext", - "name": "Sales Invoice Item-custom_valuation_rate", + "name": "POS Profile-custom_show_credit_sales", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -2006,11 +2027,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_alternative_item_for_pos_search", - "fieldtype": "Check", + "fieldname": "custom_item_uoms", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2021,26 +2042,25 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_credit_sales", + "insert_after": "custom_valuation_rate", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Alternative Item for POS Search", + "label": "Item UOMs", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-11-01 05:25:31.924813", + "modified": "2024-12-05 21:30:02.846405", "module": "Posnext", - "name": "POS Profile-custom_show_alternative_item_for_pos_search", + "name": "Sales Invoice Item-custom_item_uoms", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -2063,11 +2083,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_item_uoms", - "fieldtype": "Data", + "fieldname": "custom_show_alternative_item_for_pos_search", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2078,26 +2098,25 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_valuation_rate", + "insert_after": "custom_show_credit_sales", "is_system_generated": 0, "is_virtual": 0, - "label": "Item UOMs", + "label": "Show Alternative Item for POS Search", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-05 21:30:02.846405", + "modified": "2024-11-01 05:25:31.924813", "module": "Posnext", - "name": "Sales Invoice Item-custom_item_uoms", + "name": "POS Profile-custom_show_alternative_item_for_pos_search", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -2120,11 +2139,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_show_save_as_draft", - "fieldtype": "Check", + "fieldname": "custom_logical_rack", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2135,21 +2154,20 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_show_alternative_item_for_pos_search", + "insert_after": "custom_item_uoms", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Save as Draft", + "label": "Logical Rack", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-08-16 07:44:20.763682", + "modified": "2024-12-07 00:03:31.531532", "module": "Posnext", - "name": "POS Profile-custom_show_save_as_draft", + "name": "Sales Invoice Item-custom_logical_rack", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2177,11 +2195,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "custom_logical_rack", - "fieldtype": "Data", + "fieldname": "custom_show_save_as_draft", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2192,21 +2210,20 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_item_uoms", + "insert_after": "custom_show_alternative_item_for_pos_search", "is_system_generated": 0, "is_virtual": 0, - "label": "Logical Rack", + "label": "Show Save as Draft", "length": 0, "link_filters": null, "mandatory_depends_on": null, - "modified": "2024-12-07 00:03:31.531532", + "modified": "2024-08-16 07:44:20.763682", "module": "Posnext", - "name": "Sales Invoice Item-custom_logical_rack", + "name": "POS Profile-custom_show_save_as_draft", "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2263,7 +2280,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2320,7 +2336,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2377,7 +2392,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2434,7 +2448,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2491,7 +2504,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2548,7 +2560,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2605,7 +2616,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2662,7 +2672,6 @@ "non_negative": 0, "options": "\nList\nCard", "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2719,7 +2728,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2776,7 +2784,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, @@ -2833,7 +2840,6 @@ "non_negative": 0, "options": null, "permlevel": 0, - "placeholder": null, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, diff --git a/posnext/public/js/pos_item_cart.js b/posnext/public/js/pos_item_cart.js index f323a4e..8d402b4 100644 --- a/posnext/public/js/pos_item_cart.js +++ b/posnext/public/js/pos_item_cart.js @@ -978,7 +978,7 @@ this.highlight_checkout_btn(true); item_html += `
` } - item_html += `
+ item_html += `
${item_data.item_name}
${get_description_html()} diff --git a/posnext/public/js/pos_past_order_summary.js b/posnext/public/js/pos_past_order_summary.js index 52078ab..ec71778 100644 --- a/posnext/public/js/pos_past_order_summary.js +++ b/posnext/public/js/pos_past_order_summary.js @@ -370,7 +370,11 @@ posnext.PointOfSale.PastOrderSummary = class { const condition_btns_map = this.get_condition_btn_map(after_submission); this.add_summary_btns(condition_btns_map); - this.$summary_wrapper.css("width",after_submission ? "35%" : "60%") + this.$summary_wrapper.css("width",after_submission ? "35%" : "60%"); + + if (after_submission) { + this.print_receipt_on_order_complete(); + } } attach_document_info(doc) { @@ -439,4 +443,22 @@ posnext.PointOfSale.PastOrderSummary = class { show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none'); } + + async print_receipt_on_order_complete() { + + const profile_name = this.pos_profile?.name || this.pos_profile; + + const { message } = await frappe.db.get_value( + "POS Profile", + profile_name, + ["print_receipt_on_order_complete", "print_format"] + ); + + if (message?.print_receipt_on_order_complete) { + setTimeout(() => this.print_receipt(), 300); + } + +} + + };