mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
[minor] merged with master branch
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -15,8 +15,9 @@ erpnext.toolbar.setup = function() {
|
||||
$user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
|
||||
<i class="icon-fixed-width icon-quote-left"></i> '+wn._('Forum')+'</a></li>');
|
||||
|
||||
if(wn.boot.expires_on) {
|
||||
$user.append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
|
||||
if(wn.boot.expires_on || wn.boot.commercial_support) {
|
||||
$user.append('<li>\
|
||||
<a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
|
||||
<i class="icon-fixed-width icon-comments"></i> '+wn._('Live Chat')+'</a></li>');
|
||||
}
|
||||
|
||||
|
||||
@@ -338,8 +338,19 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
|
||||
var headings = $.map([wn._("Item Name")].concat($.map(tax_accounts, function(head) { return head[1]; })),
|
||||
function(head) { return '<th style="min-width: 100px;">' + (head || "") + "</th>" }).join("\n");
|
||||
|
||||
var distinct_item_names = [];
|
||||
var distinct_items = [];
|
||||
$.each(this.get_item_doclist(), function(i, item) {
|
||||
if(distinct_item_names.indexOf(item.item_code || item.item_name)===-1) {
|
||||
distinct_item_names.push(item.item_code || item.item_name);
|
||||
distinct_items.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
var rows = $.map(this.get_item_doclist(), function(item) {
|
||||
console.log(distinct_items);
|
||||
|
||||
var rows = $.map(distinct_items, function(item) {
|
||||
var item_tax_record = item_tax[item.item_code || item.item_name];
|
||||
if(!item_tax_record) { return null; }
|
||||
return repl("<tr><td>%(item_name)s</td>%(taxes)s</tr>", {
|
||||
|
||||
@@ -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 +" )")
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function remove_script_and_style(txt) {
|
||||
return (!txt || (txt.indexOf("<script>")===-1 && txt.indexOf("<style>")===-1)) ? txt :
|
||||
$("<div></div>").html(txt).find("script,noscript,style,title,meta").remove().end().html();
|
||||
}
|
||||
|
||||
function is_html(txt) {
|
||||
if(txt.indexOf("<br>")==-1 && txt.indexOf("<p")==-1
|
||||
&& txt.indexOf("<img")==-1 && txt.indexOf("<div")==-1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function ask_to_login() {
|
||||
if(!full_name) {
|
||||
if(localStorage) {
|
||||
localStorage.setItem("last_visited", window.location.href.split("/").slice(-1)[0]);
|
||||
}
|
||||
window.location.href = "login";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user