diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js index 1bd6de10303..b5a781cd090 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/accounts/doctype/sales_invoice/pos.js @@ -395,7 +395,7 @@ erpnext.POS = Class.extend({ }); dialog.show(); - dialog.get_input("total_amount").attr("disabled", "disabled"); + dialog.get_input("total_amount").prop("disabled", true); dialog.fields_dict.pay.input.onclick = function() { cur_frm.set_value("mode_of_payment", dialog.get_values().mode_of_payment); diff --git a/config.json b/config.json index ef5a1644008..e0f98d8daaa 100644 --- a/config.json +++ b/config.json @@ -101,13 +101,51 @@ }, "order": { "no_cache": true, - "template": "app/website/templates/pages/order", - "args_method": "selling.doctype.sales_order.sales_order.get_website_args" + "template": "app/website/templates/pages/sale", + "args_method": "website.helpers.transaction.get_order_args", + "portal": { + "doctype": "Sales Order", + "conditions": { + "docstatus": 1 + } + } }, "orders": { "no_cache": true, - "template": "app/website/templates/pages/orders", - "args_method": "selling.doctype.sales_order.sales_order.get_currency_and_number_format" + "template": "app/website/templates/pages/sales_transactions", + "args_method": "website.helpers.transaction.order_list_args" + }, + "invoice": { + "no_cache": true, + "template": "app/website/templates/pages/sale", + "args_method": "website.helpers.transaction.get_invoice_args", + "portal": { + "doctype": "Sales Invoice", + "conditions": { + "docstatus": 1 + } + } + }, + "invoices": { + "no_cache": true, + "template": "app/website/templates/pages/sales_transactions", + "args_method": "website.helpers.transaction.invoice_list_args" + }, + "shipment": { + "no_cache": true, + "template": "app/website/templates/pages/sale", + "args_method": "website.helpers.transaction.get_shipment_args", + "portal": { + "doctype": "Delivery Note", + "conditions": { + "docstatus": 1 + } + } + }, + "shipments": { + "no_cache": true, + "template": "app/website/templates/pages/sales_transactions", + "args_method": "website.helpers.transaction.shipment_list_args" }, "product_search": { "template": "app/website/templates/pages/product_search" @@ -115,10 +153,14 @@ "ticket": { "no_cache": true, "template": "app/website/templates/pages/ticket", - "args_method": "support.doctype.support_ticket.support_ticket.get_website_args" + "args_method": "support.doctype.support_ticket.support_ticket.get_website_args", + "portal": { + "doctype": "Support Ticket" + } }, "tickets": { - "template": "app/website/templates/pages/tickets" + "template": "app/website/templates/pages/tickets", + "args_method": "website.helpers.transaction.ticket_list_args" }, "address": { "no_cache": true, diff --git a/public/build.json b/public/build.json index 24abde20b2b..b8d7dd44525 100644 --- a/public/build.json +++ b/public/build.json @@ -7,8 +7,7 @@ "app/public/js/startup.css" ], "public/js/all-web.min.js": [ - "app/public/js/website_utils.js", - "lib/public/js/wn/misc/number_format.js" + "app/public/js/website_utils.js" ], "public/js/all-app.min.js": [ "app/public/js/startup.js", diff --git a/public/js/website_utils.js b/public/js/website_utils.js index 95cae1bbc61..9b7832678a5 100644 --- a/public/js/website_utils.js +++ b/public/js/website_utils.js @@ -1,9 +1,8 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. // License: GNU General Public License v3. See license.txt - -var erpnext = {}; -var wn = {}; +if(!window.erpnext) erpnext = {}; +if(!window.wn) wn = {}; // Add / update a new Lead / Communication // subject, sender, description @@ -18,7 +17,7 @@ erpnext.send_message = function(opts) { wn.call = function(opts) { if(opts.btn) { - $(opts.btn).attr("disabled", "disabled"); + $(opts.btn).prop("disabled", true); } if(opts.msg) { @@ -51,7 +50,7 @@ wn.call = function(opts) { dataType: "json", success: function(data) { if(opts.btn) { - $(opts.btn).attr("disabled", false); + $(opts.btn).prop("disabled", false); } if(data.exc) { if(opts.btn) { @@ -200,7 +199,7 @@ $.extend(wn.cart, { update_cart: function(opts) { if(!full_name) { if(localStorage) { - localStorage.setItem("last_visited", window.location.pathname.slice(1)); + localStorage.setItem("last_visited", window.location.href.split("/").slice(-1)[0]); localStorage.setItem("pending_add_to_cart", opts.item_code); } window.location.href = "login"; @@ -229,4 +228,26 @@ $.extend(wn.cart, { if(cart_count) $(".cart-count").html("( "+ cart_count +" )") } -}); \ No newline at end of file +}); + +function remove_script_and_style(txt) { + return (!txt || (txt.indexOf(" -