[fix] [minor] show stock ledger, general ledger, fixes post changes in script manager trigger [issue] webnotes/wnframework#228
This commit is contained in:
parent
7180eb6f20
commit
a648f46d4e
@ -18,10 +18,20 @@ wn.provide("erpnext.accounts");
|
|||||||
|
|
||||||
erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
|
erpnext.accounts.JournalVoucher = wn.ui.form.Controller.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
this.load_defaults(this.frm.doc);
|
this.load_defaults();
|
||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
load_defaults: function() {
|
||||||
|
if(this.frm.doc.__islocal && this.frm.doc.company) {
|
||||||
|
wn.model.set_default_values(this.frm.doc);
|
||||||
|
$.each(wn.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, {parentfield: "entries"}),
|
||||||
|
function(i, jvd) { wn.model.set_default_values(jvd); });
|
||||||
|
|
||||||
|
this.frm.doc.posting_date = get_today();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setup_queries: function() {
|
setup_queries: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
@ -82,23 +92,6 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.load_defaults = function(doc) {
|
|
||||||
if(!cur_frm.doc.__islocal || !cur_frm.doc.company) { return; }
|
|
||||||
|
|
||||||
doc = locals[doc.doctype][doc.name];
|
|
||||||
var fields_to_refresh = wn.model.set_default_values(doc);
|
|
||||||
if(fields_to_refresh) { refresh_many(fields_to_refresh); }
|
|
||||||
|
|
||||||
fields_to_refresh = null;
|
|
||||||
var children = getchildren('Journal Voucher Detail', doc.name, 'entries');
|
|
||||||
if(!children) { return; }
|
|
||||||
for(var i=0; i<children.length; i++) {
|
|
||||||
wn.model.set_default_values(children[i]);
|
|
||||||
}
|
|
||||||
refresh_field('entries');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
|
cur_frm.cscript.is_opening = function(doc, cdt, cdn) {
|
||||||
hide_field('aging_date');
|
hide_field('aging_date');
|
||||||
if (doc.is_opening == 'Yes') unhide_field('aging_date');
|
if (doc.is_opening == 'Yes') unhide_field('aging_date');
|
||||||
|
|||||||
@ -133,6 +133,8 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
},
|
},
|
||||||
|
|
||||||
is_pos: function() {
|
is_pos: function() {
|
||||||
|
cur_frm.cscript.hide_fields(this.frm.doc);
|
||||||
|
|
||||||
if(cint(this.frm.doc.is_pos)) {
|
if(cint(this.frm.doc.is_pos)) {
|
||||||
if(!this.frm.doc.company) {
|
if(!this.frm.doc.company) {
|
||||||
this.frm.set_value("is_pos", 0);
|
this.frm.set_value("is_pos", 0);
|
||||||
@ -145,9 +147,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO toggle display of fields
|
|
||||||
cur_frm.cscript.hide_fields(this.frm.doc);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
debit_to: function() {
|
debit_to: function() {
|
||||||
@ -191,8 +190,7 @@ $.extend(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_
|
|||||||
// Hide Fields
|
// Hide Fields
|
||||||
// ------------
|
// ------------
|
||||||
cur_frm.cscript.hide_fields = function(doc) {
|
cur_frm.cscript.hide_fields = function(doc) {
|
||||||
par_flds = ['project_name', 'due_date', 'is_opening', 'conversion_rate',
|
par_flds = ['project_name', 'due_date', 'is_opening', 'source', 'total_advance', 'gross_profit',
|
||||||
'source', 'total_advance', 'gross_profit',
|
|
||||||
'gross_profit_percent', 'get_advances_received',
|
'gross_profit_percent', 'get_advances_received',
|
||||||
'advance_adjustment_details', 'sales_partner', 'commission_rate',
|
'advance_adjustment_details', 'sales_partner', 'commission_rate',
|
||||||
'total_commission', 'advances'];
|
'total_commission', 'advances'];
|
||||||
|
|||||||
@ -63,6 +63,12 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
|||||||
cur_frm.set_value("approval_status", "Draft");
|
cur_frm.set_value("approval_status", "Draft");
|
||||||
cur_frm.cscript.clear_sanctioned(doc);
|
cur_frm.cscript.clear_sanctioned(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
||||||
|
return{
|
||||||
|
query:"controllers.queries.employee_query"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cur_frm.call({
|
return cur_frm.call({
|
||||||
method:"hr.utils.get_expense_approver_list",
|
method:"hr.utils.get_expense_approver_list",
|
||||||
@ -70,12 +76,6 @@ cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
|||||||
cur_frm.set_df_property("exp_approver", "options", r.message);
|
cur_frm.set_df_property("exp_approver", "options", r.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
|
||||||
return{
|
|
||||||
query:"controllers.queries.employee_query"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.clear_sanctioned = function(doc) {
|
cur_frm.cscript.clear_sanctioned = function(doc) {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ $.extend(erpnext.complete_setup, {
|
|||||||
$('header').toggle(false); // hide toolbar
|
$('header').toggle(false); // hide toolbar
|
||||||
}
|
}
|
||||||
|
|
||||||
return wn.call({
|
wn.call({
|
||||||
method:"webnotes.country_info.get_country_timezone_info",
|
method:"webnotes.country_info.get_country_timezone_info",
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
erpnext.country_info = data.message.country_info;
|
erpnext.country_info = data.message.country_info;
|
||||||
|
|||||||
@ -19,22 +19,26 @@ wn.provide("erpnext.stock");
|
|||||||
erpnext.stock.StockController = wn.ui.form.Controller.extend({
|
erpnext.stock.StockController = wn.ui.form.Controller.extend({
|
||||||
show_stock_ledger: function() {
|
show_stock_ledger: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
this.frm.add_custom_button("Stock Ledger", function() {
|
if(this.frm.doc.docstatus===1) {
|
||||||
wn.route_options = {
|
this.frm.add_custom_button("Stock Ledger", function() {
|
||||||
voucher_no: me.frm.doc.name,
|
wn.route_options = {
|
||||||
from_date: cur_frm.doc.posting_date,
|
voucher_no: me.frm.doc.name,
|
||||||
to_date: cur_frm.doc.posting_date
|
from_date: me.frm.doc.posting_date,
|
||||||
};
|
to_date: me.frm.doc.posting_date
|
||||||
wn.set_route('stock-ledger');
|
};
|
||||||
}, "icon-bar-chart");
|
wn.set_route('stock-ledger');
|
||||||
|
}, "icon-bar-chart");
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
show_general_ledger: function() {
|
show_general_ledger: function() {
|
||||||
if(doc.docstatus==1) {
|
var me = this;
|
||||||
|
if(this.frm.doc.docstatus===1 && cint(wn.defaults.get_default("auto_inventory_accounting"))) {
|
||||||
cur_frm.add_custom_button('Accounting Ledger', function() {
|
cur_frm.add_custom_button('Accounting Ledger', function() {
|
||||||
wn.route_options = {
|
wn.route_options = {
|
||||||
"voucher_no": doc.name,
|
"voucher_no": me.frm.doc.name,
|
||||||
"from_date": doc.posting_date,
|
"from_date": me.frm.doc.posting_date,
|
||||||
"to_date": doc.posting_date,
|
"to_date": me.frm.doc.posting_date,
|
||||||
};
|
};
|
||||||
wn.set_route("general-ledger");
|
wn.set_route("general-ledger");
|
||||||
});
|
});
|
||||||
|
|||||||
@ -15,8 +15,9 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
wn.provide("erpnext");
|
wn.provide("erpnext");
|
||||||
|
wn.require("app/js/controllers/stock_controller.js");
|
||||||
|
|
||||||
erpnext.TransactionController = wn.ui.form.Controller.extend({
|
erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||||
onload: function() {
|
onload: function() {
|
||||||
if(this.frm.doc.__islocal) {
|
if(this.frm.doc.__islocal) {
|
||||||
var me = this,
|
var me = this,
|
||||||
|
|||||||
@ -86,15 +86,15 @@ erpnext.selling.Opportunity = wn.ui.form.Controller.extend({
|
|||||||
customer: function() {
|
customer: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
if(this.frm.doc.customer) {
|
if(this.frm.doc.customer) {
|
||||||
return this.frm.call({
|
|
||||||
doc: this.frm.doc,
|
|
||||||
method: "set_customer_defaults",
|
|
||||||
});
|
|
||||||
|
|
||||||
// TODO shift this to depends_on
|
// TODO shift this to depends_on
|
||||||
unhide_field(['customer_address', 'contact_person', 'customer_name',
|
unhide_field(['customer_address', 'contact_person', 'customer_name',
|
||||||
'address_display', 'contact_display', 'contact_mobile', 'contact_email',
|
'address_display', 'contact_display', 'contact_mobile', 'contact_email',
|
||||||
'territory', 'customer_group']);
|
'territory', 'customer_group']);
|
||||||
|
|
||||||
|
return this.frm.call({
|
||||||
|
doc: this.frm.doc,
|
||||||
|
method: "set_customer_defaults",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -114,6 +114,7 @@ cur_frm.fields_dict.lead.get_query = function(doc,cdt,cdn) {
|
|||||||
|
|
||||||
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
||||||
if(doc.lead) {
|
if(doc.lead) {
|
||||||
|
unhide_field('territory');
|
||||||
return cur_frm.call({
|
return cur_frm.call({
|
||||||
doc: cur_frm.doc,
|
doc: cur_frm.doc,
|
||||||
method: "set_lead_defaults",
|
method: "set_lead_defaults",
|
||||||
@ -123,7 +124,6 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
unhide_field('territory');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,36 +21,7 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
completed = 0;
|
completed = 0;
|
||||||
|
|
||||||
body.html('<div class="progress progress-striped active">\
|
body.html('<div class="progress progress-striped active">\
|
||||||
<div class="progress-bar" style="width: 100%;"></div></div>')
|
<div class="progress-bar" style="width: 100%;"></div></div>');
|
||||||
|
|
||||||
return wn.call({
|
|
||||||
method: "setup.page.setup.setup.get",
|
|
||||||
callback: function(r) {
|
|
||||||
if(r.message) {
|
|
||||||
body.empty();
|
|
||||||
if(wn.boot.expires_on) {
|
|
||||||
$(body).prepend("<div class='text-muted' style='text-align:right'>Account expires on "
|
|
||||||
+ wn.datetime.global_date_format(wn.boot.expires_on) + "</div>");
|
|
||||||
}
|
|
||||||
|
|
||||||
$completed = $('<h4>Setup Completed <span class="completed-percent"></span><h4>\
|
|
||||||
<div class="progress"><div class="progress-bar"></div></div>')
|
|
||||||
.appendTo(body);
|
|
||||||
|
|
||||||
$.each(r.message, function(i, item) {
|
|
||||||
render_item(item)
|
|
||||||
});
|
|
||||||
|
|
||||||
var completed_percent = cint(flt(completed) / total * 100) + "%";
|
|
||||||
$completed
|
|
||||||
.find(".progress-bar")
|
|
||||||
.css({"width": completed_percent});
|
|
||||||
$(body)
|
|
||||||
.find(".completed-percent")
|
|
||||||
.html("(" + completed_percent + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var render_item = function(item, dependency) {
|
var render_item = function(item, dependency) {
|
||||||
if(item.type==="Section") {
|
if(item.type==="Section") {
|
||||||
@ -68,12 +39,12 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
.appendTo(body);
|
.appendTo(body);
|
||||||
|
|
||||||
$('<div class="col col-lg-1"></div>').appendTo(row);
|
$('<div class="col col-lg-1"></div>').appendTo(row);
|
||||||
|
|
||||||
if(item.type==="Link") {
|
if(item.type==="Link") {
|
||||||
var col = $('<div class="col col-lg-5"><b><a href="#'
|
var col = $('<div class="col col-lg-5"><b><a href="#'
|
||||||
+item.route+'"><i class="'+item.icon+'"></i> '
|
+item.route+'"><i class="'+item.icon+'"></i> '
|
||||||
+item.title+'</a></b></div>').appendTo(row);
|
+item.title+'</a></b></div>').appendTo(row);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var col = $(repl('<div class="col col-lg-5">\
|
var col = $(repl('<div class="col col-lg-5">\
|
||||||
<span class="badge view-link">%(count)s</span>\
|
<span class="badge view-link">%(count)s</span>\
|
||||||
@ -102,12 +73,12 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
col.addClass("col-offset-1");
|
col.addClass("col-offset-1");
|
||||||
else
|
else
|
||||||
$('<div class="col col-lg-1"></div>').appendTo(row);
|
$('<div class="col col-lg-1"></div>').appendTo(row);
|
||||||
|
|
||||||
if(item.doctype) {
|
if(item.doctype) {
|
||||||
var badge = col.find(".badge, .data-link")
|
var badge = col.find(".badge, .data-link")
|
||||||
.attr("data-doctype", item.doctype)
|
.attr("data-doctype", item.doctype)
|
||||||
.css({"cursor": "pointer"})
|
.css({"cursor": "pointer"})
|
||||||
|
|
||||||
if(item.single) {
|
if(item.single) {
|
||||||
badge.click(function() {
|
badge.click(function() {
|
||||||
wn.set_route("Form", $(this).attr("data-doctype"))
|
wn.set_route("Form", $(this).attr("data-doctype"))
|
||||||
@ -118,10 +89,10 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tree
|
// tree
|
||||||
$links = $('<div class="col col-lg-5">').appendTo(row);
|
$links = $('<div class="col col-lg-5">').appendTo(row);
|
||||||
|
|
||||||
if(item.tree) {
|
if(item.tree) {
|
||||||
$('<a class="view-link"><i class="icon-sitemap"></i> Browse</a>\
|
$('<a class="view-link"><i class="icon-sitemap"></i> Browse</a>\
|
||||||
<span class="text-muted">|</span> \
|
<span class="text-muted">|</span> \
|
||||||
@ -134,7 +105,7 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
mylink.click(function() {
|
mylink.click(function() {
|
||||||
wn.set_route(item.tree, item.doctype);
|
wn.set_route(item.tree, item.doctype);
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if(item.single) {
|
} else if(item.single) {
|
||||||
$('<a class="view-link"><i class="icon-edit"></i> Edit</a>')
|
$('<a class="view-link"><i class="icon-edit"></i> Edit</a>')
|
||||||
.appendTo($links)
|
.appendTo($links)
|
||||||
@ -183,7 +154,7 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
wn.route_options = {doctype:$(this).attr("data-doctype")}
|
wn.route_options = {doctype:$(this).attr("data-doctype")}
|
||||||
wn.set_route("data-import-tool");
|
wn.set_route("data-import-tool");
|
||||||
})
|
})
|
||||||
|
|
||||||
if(item.links) {
|
if(item.links) {
|
||||||
$.each(item.links, function(i, link) {
|
$.each(item.links, function(i, link) {
|
||||||
var newlinks = $('<span class="text-muted"> |</span> \
|
var newlinks = $('<span class="text-muted"> |</span> \
|
||||||
@ -192,11 +163,40 @@ wn.pages.Setup.make = function(wrapper) {
|
|||||||
.appendTo($links)
|
.appendTo($links)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if(item.dependencies) {
|
if(item.dependencies) {
|
||||||
$.each(item.dependencies, function(i, d) {
|
$.each(item.dependencies, function(i, d) {
|
||||||
render_item(d, true);
|
render_item(d, true);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return wn.call({
|
||||||
|
method: "setup.page.setup.setup.get",
|
||||||
|
callback: function(r) {
|
||||||
|
if(r.message) {
|
||||||
|
body.empty();
|
||||||
|
if(wn.boot.expires_on) {
|
||||||
|
$(body).prepend("<div class='text-muted' style='text-align:right'>Account expires on "
|
||||||
|
+ wn.datetime.global_date_format(wn.boot.expires_on) + "</div>");
|
||||||
|
}
|
||||||
|
|
||||||
|
$completed = $('<h4>Setup Completed <span class="completed-percent"></span><h4>\
|
||||||
|
<div class="progress"><div class="progress-bar"></div></div>')
|
||||||
|
.appendTo(body);
|
||||||
|
|
||||||
|
$.each(r.message, function(i, item) {
|
||||||
|
render_item(item)
|
||||||
|
});
|
||||||
|
|
||||||
|
var completed_percent = cint(flt(completed) / total * 100) + "%";
|
||||||
|
$completed
|
||||||
|
.find(".progress-bar")
|
||||||
|
.css({"width": completed_percent});
|
||||||
|
$(body)
|
||||||
|
.find(".completed-percent")
|
||||||
|
.html("(" + completed_percent + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@ -36,6 +36,8 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
|
|||||||
|
|
||||||
if (doc.docstatus==1) {
|
if (doc.docstatus==1) {
|
||||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
||||||
|
this.show_stock_ledger();
|
||||||
|
this.show_general_ledger();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc.docstatus==0 && !doc.__islocal) {
|
if(doc.docstatus==0 && !doc.__islocal) {
|
||||||
|
|||||||
@ -33,6 +33,9 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
this.make_purchase_invoice);
|
this.make_purchase_invoice);
|
||||||
}
|
}
|
||||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
|
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
|
||||||
|
|
||||||
|
this.show_stock_ledger();
|
||||||
|
this.show_general_ledger();
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.add_custom_button(wn._('From Purchase Order'),
|
cur_frm.add_custom_button(wn._('From Purchase Order'),
|
||||||
@ -68,6 +71,10 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
|||||||
var item = wn.model.get_doc(cdt, cdn);
|
var item = wn.model.get_doc(cdt, cdn);
|
||||||
wn.model.round_floats_in(item, ["qty", "received_qty"]);
|
wn.model.round_floats_in(item, ["qty", "received_qty"]);
|
||||||
|
|
||||||
|
if(!(item.received_qty || item.rejected_qty) && item.qty) {
|
||||||
|
item.received_qty = item.qty;
|
||||||
|
}
|
||||||
|
|
||||||
if(item.qty > item.received_qty) {
|
if(item.qty > item.received_qty) {
|
||||||
msgprint(wn._("Error") + ": " + wn._(wn.meta.get_label(item.doctype, "qty", item.name))
|
msgprint(wn._("Error") + ": " + wn._(wn.meta.get_label(item.doctype, "qty", item.name))
|
||||||
+ " > " + wn._(wn.meta.get_label(item.doctype, "received_qty", item.name)));
|
+ " > " + wn._(wn.meta.get_label(item.doctype, "received_qty", item.name)));
|
||||||
|
|||||||
@ -25,8 +25,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
set_default_account: function() {
|
set_default_account: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
if (sys_defaults.auto_inventory_accounting && !this.frm.doc.expense_adjustment_account) {
|
if (cint(wn.defaults.get_default("auto_inventory_accounting")) && !this.frm.doc.expense_adjustment_account) {
|
||||||
if (this.frm.doc.purpose == "Sales Return")
|
if (this.frm.doc.purpose == "Sales Return")
|
||||||
account_for = "stock_in_hand_account";
|
account_for = "stock_in_hand_account";
|
||||||
else if (this.frm.doc.purpose == "Purchase Return")
|
else if (this.frm.doc.purpose == "Purchase Return")
|
||||||
account_for = "stock_received_but_not_billed";
|
account_for = "stock_received_but_not_billed";
|
||||||
@ -78,7 +78,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sys_defaults.auto_inventory_accounting) {
|
if(cint(wn.defaults.get_default("auto_inventory_accounting"))) {
|
||||||
this.frm.add_fetch("company", "stock_adjustment_account", "expense_adjustment_account");
|
this.frm.add_fetch("company", "stock_adjustment_account", "expense_adjustment_account");
|
||||||
|
|
||||||
this.frm.fields_dict["expense_adjustment_account"].get_query = function() {
|
this.frm.fields_dict["expense_adjustment_account"].get_query = function() {
|
||||||
@ -105,11 +105,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
erpnext.hide_naming_series();
|
erpnext.hide_naming_series();
|
||||||
this.toggle_related_fields(this.frm.doc);
|
this.toggle_related_fields(this.frm.doc);
|
||||||
this.toggle_enable_bom();
|
this.toggle_enable_bom();
|
||||||
if (this.frm.doc.docstatus==1) {
|
this.show_stock_ledger();
|
||||||
this.show_stock_ledger();
|
this.show_general_ledger();
|
||||||
if(wn.boot.auto_inventory_accounting)
|
|
||||||
this.show_general_ledger();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.frm.doc.docstatus === 1 &&
|
if(this.frm.doc.docstatus === 1 &&
|
||||||
wn.boot.profile.can_create.indexOf("Journal Voucher")!==-1) {
|
wn.boot.profile.can_create.indexOf("Journal Voucher")!==-1) {
|
||||||
|
|||||||
@ -68,6 +68,7 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
|
|||||||
} else if(this.frm.doc.docstatus == 1) {
|
} else if(this.frm.doc.docstatus == 1) {
|
||||||
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify its effect.");
|
this.frm.set_intro("Cancelling this Stock Reconciliation will nullify its effect.");
|
||||||
this.show_stock_ledger();
|
this.show_stock_ledger();
|
||||||
|
this.show_general_ledger();
|
||||||
} else {
|
} else {
|
||||||
this.frm.set_intro("");
|
this.frm.set_intro("");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,13 +26,13 @@ erpnext.support.CustomerIssue = wn.ui.form.Controller.extend({
|
|||||||
customer: function() {
|
customer: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
if(this.frm.doc.customer) {
|
if(this.frm.doc.customer) {
|
||||||
|
// TODO shift this to depends_on
|
||||||
|
unhide_field(['customer_address', 'contact_person']);
|
||||||
|
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
method: "set_customer_defaults",
|
method: "set_customer_defaults",
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO shift this to depends_on
|
|
||||||
unhide_field(['customer_address', 'contact_person']);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -62,13 +62,13 @@ erpnext.support.MaintenanceVisit = wn.ui.form.Controller.extend({
|
|||||||
customer: function() {
|
customer: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
if(this.frm.doc.customer) {
|
if(this.frm.doc.customer) {
|
||||||
|
// TODO shift this to depends_on
|
||||||
|
cur_frm.cscript.hide_contact_info();
|
||||||
|
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
method: "set_customer_defaults",
|
method: "set_customer_defaults",
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO shift this to depends_on
|
|
||||||
cur_frm.cscript.hide_contact_info();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -18,7 +18,7 @@ $(document).ready(function() {
|
|||||||
var item_code = $('[itemscope] [itemprop="name"]').text().trim();
|
var item_code = $('[itemscope] [itemprop="name"]').text().trim();
|
||||||
var qty = 0;
|
var qty = 0;
|
||||||
|
|
||||||
return wn.call({
|
wn.call({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "website.helpers.product.get_product_info",
|
method: "website.helpers.product.get_product_info",
|
||||||
args: {
|
args: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user