mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
webnotes/erpnext#1090 set default tax type in customer and supplier
This commit is contained in:
@@ -1,31 +1,27 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.cscript.onload = function(doc,dt,dn){
|
||||
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
|
||||
if(!doc.leave_transaction_type) set_multiple(dt,dn,{leave_transaction_type:'Allocation'});
|
||||
|
||||
cur_frm.cscript.onload = function(doc, dt, dn){
|
||||
if(!doc.posting_date)
|
||||
set_multiple(dt, dn, {posting_date: get_today()});
|
||||
if(!doc.leave_transaction_type)
|
||||
set_multiple(dt, dn, {leave_transaction_type: 'Allocation'});
|
||||
}
|
||||
|
||||
|
||||
// Validation For To Date
|
||||
// ================================================================================================
|
||||
cur_frm.cscript.to_date = function(doc, cdt, cdn) {
|
||||
return $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
|
||||
function(r, rt) {
|
||||
var doc = locals[cdt][cdn];
|
||||
if (r.message) {
|
||||
alert(wn._("To date cannot be before from date"));
|
||||
doc.to_date = '';
|
||||
refresh_field('to_date');
|
||||
}
|
||||
}
|
||||
);
|
||||
return $c('runserverobj', args={'method':'to_date_validation','docs':wn.model.compress(make_doclist(doc.doctype, doc.name))},
|
||||
function(r, rt) {
|
||||
var doc = locals[cdt][cdn];
|
||||
if (r.message) {
|
||||
msgprint(wn._("To date cannot be before from date"));
|
||||
doc.to_date = '';
|
||||
refresh_field('to_date');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Allocation Type
|
||||
// ================================================================================================
|
||||
cur_frm.cscript.allocation_type = function (doc, cdt, cdn){
|
||||
doc.no_of_days = '';
|
||||
refresh_field('no_of_days');
|
||||
}
|
||||
doc.no_of_days = '';
|
||||
refresh_field('no_of_days');
|
||||
}
|
||||
Reference in New Issue
Block a user