Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
07e9ff3d30
Binary file not shown.
@ -26,14 +26,16 @@ cur_frm.cscript.load_taxes = function(doc, cdt, cdn, callback) {
|
|||||||
// run if this is not executed from dt_map...
|
// run if this is not executed from dt_map...
|
||||||
doc = locals[doc.doctype][doc.name];
|
doc = locals[doc.doctype][doc.name];
|
||||||
if(doc.customer || getchildren('RV Tax Detail', doc.name, 'other_charges', doc.doctype).length) {
|
if(doc.customer || getchildren('RV Tax Detail', doc.name, 'other_charges', doc.doctype).length) {
|
||||||
if(callback) callback(doc, cdt, cdn);
|
if(callback) {
|
||||||
return;
|
callback(doc, cdt, cdn);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
$c_obj([doc],'load_default_taxes','',function(r,rt){
|
$c_obj([doc],'load_default_taxes','',function(r,rt){
|
||||||
refresh_field('other_charges');
|
refresh_field('other_charges');
|
||||||
if(callback) callback(doc, cdt, cdn);
|
if(callback) callback(doc, cdt, cdn);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gets called after existing item details are update to fill in
|
// Gets called after existing item details are update to fill in
|
||||||
|
@ -36,7 +36,9 @@ from utilities.transaction_base import TransactionBase
|
|||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_comp_base_currency(arg=None):
|
def get_comp_base_currency(arg=None):
|
||||||
""" get default currency of company"""
|
""" get default currency of company"""
|
||||||
return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0]
|
res = webnotes.conn.sql("""select default_currency from `tabCompany`
|
||||||
|
where name = %s""", webnotes.form_dict.get('company'))
|
||||||
|
return res and res[0][0] or None
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_price_list_currency(arg=None):
|
def get_price_list_currency(arg=None):
|
||||||
|
@ -30,7 +30,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
|
|||||||
if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
|
if(!doc.status) set_multiple(dt,dn,{status:'Draft'});
|
||||||
if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()});
|
if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()});
|
||||||
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
|
if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});
|
||||||
if(doc.__islocal && doc.customer) cur_frm.cscript.pull_item_details_onload(doc,dt,dn);
|
if(doc.__islocal && doc.customer) cur_frm.cscript.customer(doc,dt,dn,onload=true);
|
||||||
if(!doc.price_list_currency) {
|
if(!doc.price_list_currency) {
|
||||||
set_multiple(dt, dn, {price_list_currency: doc.currency, plc_conversion_rate:1});
|
set_multiple(dt, dn, {price_list_currency: doc.currency, plc_conversion_rate:1});
|
||||||
}
|
}
|
||||||
@ -125,16 +125,6 @@ cur_frm.cscript['Get Items'] = function(doc,dt,dn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//RV-DN : Pull Item details - UOM, Item Group as it was not in Sales Invoice
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
cur_frm.cscript.pull_item_details_onload = function(doc,dt,dn){
|
|
||||||
var callback = function(r,rt){
|
|
||||||
refresh_field('delivery_note_details');
|
|
||||||
cur_frm.cscript.customer(doc,dt,dn,onload=true);
|
|
||||||
}
|
|
||||||
$c_obj(make_doclist(dt,dn),'set_item_details','',callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================ create new contact ============================================================================
|
//================ create new contact ============================================================================
|
||||||
cur_frm.cscript.new_contact = function(){
|
cur_frm.cscript.new_contact = function(){
|
||||||
tn = createLocal('Contact');
|
tn = createLocal('Contact');
|
||||||
|
@ -74,16 +74,6 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
return cstr(self.doc.sales_order_no)
|
return cstr(self.doc.sales_order_no)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------set item details -uom and item group----------------
|
|
||||||
def set_item_details(self):
|
|
||||||
for d in getlist(self.doclist,'delivery_note_details'):
|
|
||||||
res = sql("select stock_uom, item_group from `tabItem` where name ='%s'"%d.item_code)
|
|
||||||
if not d.stock_uom: d.stock_uom = res and cstr(res[0][0]) or ''
|
|
||||||
if not d.item_group: d.item_group = res and cstr(res[0][1]) or ''
|
|
||||||
d.save()
|
|
||||||
|
|
||||||
# ::::: Validates that Sales Order is not pulled twice :::::::
|
# ::::: Validates that Sales Order is not pulled twice :::::::
|
||||||
def validate_prev_docname(self):
|
def validate_prev_docname(self):
|
||||||
for d in getlist(self.doclist, 'delivery_note_details'):
|
for d in getlist(self.doclist, 'delivery_note_details'):
|
||||||
@ -351,16 +341,17 @@ class DocType(TransactionBase):
|
|||||||
"""
|
"""
|
||||||
Validate that if packed qty exists, it should be equal to qty
|
Validate that if packed qty exists, it should be equal to qty
|
||||||
"""
|
"""
|
||||||
if not any([d.fields.get('packed_qty') for d in self.doclist]):
|
if not any([flt(d.fields.get('packed_qty')) for d in self.doclist if
|
||||||
|
d.doctype=='Delivery Note Detail']):
|
||||||
return
|
return
|
||||||
packing_error_list = []
|
packing_error_list = []
|
||||||
for d in self.doclist:
|
for d in self.doclist:
|
||||||
if d.doctype != 'Delivery Note Detail': continue
|
if d.doctype != 'Delivery Note Detail': continue
|
||||||
if d.fields.get('qty') != d.fields.get('packed_qty'):
|
if flt(d.fields.get('qty')) != flt(d.fields.get('packed_qty')):
|
||||||
packing_error_list.append([
|
packing_error_list.append([
|
||||||
d.fields.get('item_code', ''),
|
d.fields.get('item_code', ''),
|
||||||
d.fields.get('qty', ''),
|
d.fields.get('qty', 0),
|
||||||
d.fields.get('packed_qty', '')
|
d.fields.get('packed_qty', 0)
|
||||||
])
|
])
|
||||||
if packing_error_list:
|
if packing_error_list:
|
||||||
from webnotes.utils import cstr
|
from webnotes.utils import cstr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user