fixed default tax fetch issue
This commit is contained in:
parent
61ade3d486
commit
7deaff1979
@ -30,7 +30,7 @@ cur_frm.cscript.load_taxes = function(doc, cdt, cdn, callback) {
|
||||
callback(doc, cdt, cdn);
|
||||
}
|
||||
} else {
|
||||
$c_obj([doc],'load_default_taxes','',function(r,rt){
|
||||
$c_obj(make_doclist(doc.doctype, doc.name),'load_default_taxes','',function(r,rt){
|
||||
refresh_field('other_charges');
|
||||
if(callback) callback(doc, cdt, cdn);
|
||||
});
|
||||
@ -72,6 +72,8 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
|
||||
cur_frm.cscript.load_defaults(doc, dt, dn, callback);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cur_frm.cscript.load_taxes(doc, dt, dn, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,12 +214,15 @@ class DocType(TransactionBase):
|
||||
# Load Default Taxes
|
||||
# ====================
|
||||
def load_default_taxes(self, obj):
|
||||
self.get_other_charges(obj,1)
|
||||
if cstr(obj.doc.charge):
|
||||
self.get_other_charges(obj)
|
||||
else:
|
||||
self.get_other_charges(obj, 1)
|
||||
|
||||
|
||||
# Get other charges from Master
|
||||
# =================================================================================
|
||||
def get_other_charges(self,obj,default = 0):
|
||||
def get_other_charges(self,obj, default=0):
|
||||
obj.doc.clear_table(obj.doclist,'other_charges')
|
||||
if not getlist(obj.doclist, 'other_charges'):
|
||||
if default: add_cond = 'ifnull(t2.is_default,0) = 1'
|
||||
|
Loading…
x
Reference in New Issue
Block a user