diff --git a/accounts/page/accounts_browser/accounts_browser.py b/accounts/page/accounts_browser/accounts_browser.py
index 76c64b7ca8..8b24394f36 100644
--- a/accounts/page/accounts_browser/accounts_browser.py
+++ b/accounts/page/accounts_browser/accounts_browser.py
@@ -20,7 +20,7 @@ def get_companies():
else:
return [r[0] for r in webnotes.conn.sql("""select name from tabCompany
where docstatus!=2""")]
-
+
@webnotes.whitelist()
def get_children():
args = webnotes.form_dict
diff --git a/accounts/search_criteria/creditors_ledger/creditors_ledger.txt b/accounts/search_criteria/creditors_ledger/creditors_ledger.txt
index 9a7565c2d7..12134e1ec0 100644
--- a/accounts/search_criteria/creditors_ledger/creditors_ledger.txt
+++ b/accounts/search_criteria/creditors_ledger/creditors_ledger.txt
@@ -1,31 +1,27 @@
-# Search Criteria, creditors_ledger
[
-
- # These values are common in all dictionaries
- {
- 'creation': '2012-04-03 12:49:51',
- 'docstatus': 0,
- 'modified': '2012-04-03 12:49:51',
- 'modified_by': u'Administrator',
- 'owner': u'nabin@webnotestech.com'
- },
-
- # These values are common for all Search Criteria
- {
- 'criteria_name': u"Creditor's Ledger",
- 'doc_type': u'GL Entry',
- 'doctype': 'Search Criteria',
- 'filters': u"{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
- 'module': u'Accounts',
- 'name': '__common__',
- 'page_len': 50,
- 'sort_order': u'DESC',
- 'standard': u'Yes'
- },
-
- # Search Criteria, creditors_ledger
- {
- 'doctype': 'Search Criteria',
- 'name': u'creditors_ledger'
- }
+ {
+ "owner": "nabin@erpnext.com",
+ "docstatus": 0,
+ "creation": "2012-05-14 18:05:41",
+ "modified_by": "nabin@erpnext.com",
+ "modified": "2012-12-06 11:36:09"
+ },
+ {
+ "custom_query": null,
+ "report_script": null,
+ "page_len": 50,
+ "module": "Accounts",
+ "standard": "Yes",
+ "sort_order": "DESC",
+ "filters": "{\"GL Entry\\u0001Voucher Type\":[],\"GL Entry\\u0001Is Cancelled\":[\"No\"],\"GL Entry\\u0001Is Opening\":[\"\"],\"GL Entry\\u0001Fiscal Year\":[\"\"]}",
+ "doc_type": "GL Entry",
+ "name": "__common__",
+ "doctype": "Search Criteria",
+ "sort_by": "`tabGL Entry`.`name`",
+ "criteria_name": "Creditor's Ledger"
+ },
+ {
+ "name": "creditors_ledger",
+ "doctype": "Search Criteria"
+ }
]
\ No newline at end of file
diff --git a/accounts/search_criteria/debtors_ledger/debtors_ledger.txt b/accounts/search_criteria/debtors_ledger/debtors_ledger.txt
index 09910970d6..a86800318e 100644
--- a/accounts/search_criteria/debtors_ledger/debtors_ledger.txt
+++ b/accounts/search_criteria/debtors_ledger/debtors_ledger.txt
@@ -1,31 +1,27 @@
-# Search Criteria, debtors_ledger
[
-
- # These values are common in all dictionaries
- {
- 'creation': '2012-04-03 12:49:51',
- 'docstatus': 0,
- 'modified': '2012-04-03 12:49:51',
- 'modified_by': u'Administrator',
- 'owner': u'nabin@webnotestech.com'
- },
-
- # These values are common for all Search Criteria
- {
- 'criteria_name': u"Debtor's Ledger",
- 'doc_type': u'GL Entry',
- 'doctype': 'Search Criteria',
- 'filters': u"{'GL Entry\x01Voucher Type':'','GL Entry\x01Is Cancelled':'No','GL Entry\x01Is Opening':'','GL Entry\x01Fiscal Year':''}",
- 'module': u'Accounts',
- 'name': '__common__',
- 'page_len': 50,
- 'sort_order': u'DESC',
- 'standard': u'Yes'
- },
-
- # Search Criteria, debtors_ledger
- {
- 'doctype': 'Search Criteria',
- 'name': u'debtors_ledger'
- }
+ {
+ "owner": "nabin@erpnext.com",
+ "docstatus": 0,
+ "creation": "2012-05-14 18:05:42",
+ "modified_by": "nabin@erpnext.com",
+ "modified": "2012-12-06 11:37:15"
+ },
+ {
+ "custom_query": null,
+ "report_script": null,
+ "page_len": 50,
+ "module": "Accounts",
+ "standard": "Yes",
+ "sort_order": "DESC",
+ "filters": "{\"GL Entry\\u0001Voucher Type\":[],\"GL Entry\\u0001Is Cancelled\":[\"No\"],\"GL Entry\\u0001Is Opening\":[],\"GL Entry\\u0001Fiscal Year\":[]}",
+ "doc_type": "GL Entry",
+ "name": "__common__",
+ "doctype": "Search Criteria",
+ "sort_by": "`tabGL Entry`.`name`",
+ "criteria_name": "Debtor's Ledger"
+ },
+ {
+ "name": "debtors_ledger",
+ "doctype": "Search Criteria"
+ }
]
\ No newline at end of file
diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js
index 3b7223621d..b29ccb7191 100644
--- a/buying/doctype/purchase_common/purchase_common.js
+++ b/buying/doctype/purchase_common/purchase_common.js
@@ -199,23 +199,35 @@ cur_frm.cscript.update_stock_qty = function(doc,cdt,cdn){
}
//==================== UOM ======================================================================
-cur_frm.cscript.uom = function(doc, cdt, cdn) {
+cur_frm.cscript.uom = function(doc, cdt, cdn, args) {
+ if(!args) args = {};
+
+ // args passed can contain conversion_factor
var d = locals[cdt][cdn];
- if (d.item_code && d.uom) {
- call_back = function(doc, cdt, cdn){
- cur_frm.cscript.calc_amount(doc, 2);
- }
- str_arg = {'item_code':d.item_code, 'uom':d.uom, 'stock_qty':flt(d.stock_qty), 'qty': flt(d.qty), 'conversion_rate':doc.conversion_rate, 'doc_name': doc.name}
- // Updates Conversion Factor, Qty and Purchase Rate
- get_server_fields('get_uom_details',JSON.stringify(str_arg), fname, doc,cdt,cdn,1, call_back);
- // don't make mistake of calling update_stock_qty() the get_uom_details returns stock_qty as per conversion factor properly
+ $.extend(args, {
+ item_code: d.item_code,
+ uom: d.uom,
+ stock_qty: flt(d.stock_qty),
+ });
+
+ if(d.item_code && d.uom) {
+ cur_frm.call({
+ method: "buying.doctype.purchase_common.purchase_common.get_uom_details",
+ args: { args: args },
+ child: d,
+ callback: function(r) {
+ cur_frm.cscript.calc_amount(doc, 2);
+ }
+ });
}
}
//==================== Conversion factor =========================================================
cur_frm.cscript.conversion_factor = function(doc, cdt, cdn) {
- cur_frm.cscript.uom(doc, cdt, cdn);
+ var item = locals[cdt][cdn];
+
+ cur_frm.cscript.uom(doc, cdt, cdn, { conversion_factor: item.conversion_factor });
}
//==================== stock qty ======================================================================
diff --git a/buying/doctype/purchase_common/purchase_common.py b/buying/doctype/purchase_common/purchase_common.py
index eb8ebef874..9c1187dd01 100644
--- a/buying/doctype/purchase_common/purchase_common.py
+++ b/buying/doctype/purchase_common/purchase_common.py
@@ -182,39 +182,6 @@ class DocType(TransactionBase):
ret = { 'projected_qty' : bin and flt(bin[0]['projected_qty']) or 0 }
return ret
- def get_uom_details(self, arg = ''):
- """fetches details on change of UOM"""
- import json
- arg, ret = json.loads(arg), {}
-
- uom = webnotes.conn.sql("""\
- select conversion_factor
- from `tabUOM Conversion Detail`
- where parent = %s and uom = %s""", (arg['item_code'],arg['uom']), as_dict = 1)
-
- if not uom: return ret
-
- last_purchase_details, last_purchase_date = self.get_last_purchase_details(arg['item_code'], arg['doc_name'])
-
- conversion_factor = flt(uom[0]['conversion_factor'])
- conversion_rate = flt(arg['conversion_rate'])
- purchase_ref_rate = last_purchase_details and \
- (last_purchase_details['purchase_ref_rate'] * conversion_factor) or 0
- purchase_rate = last_purchase_details and \
- (last_purchase_details['purchase_rate'] * conversion_factor) or 0
-
- ret = {
- 'conversion_factor': conversion_factor,
- 'qty': flt(arg['stock_qty']) / conversion_factor,
- 'purchase_ref_rate': purchase_ref_rate,
- 'purchase_rate': purchase_rate,
- 'import_ref_rate': purchase_ref_rate / conversion_rate,
- 'import_rate': purchase_rate / conversion_rate,
- }
-
- return ret
-
-
# --- Last Purchase Rate related methods ---
def update_last_purchase_rate(self, obj, is_submit):
@@ -683,3 +650,27 @@ class DocType(TransactionBase):
if d.prevdoc_doctype and d.prevdoc_docname:
dt = sql("select transaction_date from `tab%s` where name = '%s'" % (d.prevdoc_doctype, d.prevdoc_docname))
d.prevdoc_date = dt and dt[0][0].strftime('%Y-%m-%d') or ''
+
+@webnotes.whitelist()
+def get_uom_details(args=None):
+ """fetches details on change of UOM"""
+ if not args:
+ return {}
+
+ if isinstance(args, basestring):
+ import json
+ args = json.loads(args)
+
+ uom = webnotes.conn.sql("""select conversion_factor
+ from `tabUOM Conversion Detail` where parent = %s and uom = %s""",
+ (args['item_code'], args['uom']), as_dict=1)
+
+ if not uom: return {}
+
+ conversion_factor = args.get("conversion_factor") or \
+ flt(uom[0]["conversion_factor"])
+
+ return {
+ "conversion_factor": conversion_factor,
+ "qty": flt(args["stock_qty"]) / conversion_factor,
+ }
\ No newline at end of file
diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py
index 4497bcd524..e52499cfd0 100644
--- a/buying/doctype/purchase_order/purchase_order.py
+++ b/buying/doctype/purchase_order/purchase_order.py
@@ -69,10 +69,6 @@ class DocType(TransactionBase):
- # Get UOM Details
- def get_uom_details(self, arg = ''):
- return get_obj('Purchase Common').get_uom_details(arg)
-
# get available qty at warehouse
def get_bin_details(self, arg = ''):
return get_obj(dt='Purchase Common').get_bin_details(arg)
diff --git a/buying/doctype/purchase_order/purchase_order_list.js b/buying/doctype/purchase_order/purchase_order_list.js
index 69f97f5aa3..762c63596a 100644
--- a/buying/doctype/purchase_order/purchase_order_list.js
+++ b/buying/doctype/purchase_order/purchase_order_list.js
@@ -27,7 +27,7 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({
},
css: {'text-align':'right'}
},
- {width: '8%', content: 'per_received', type:'bar-graph', label:'Delivered'},
+ {width: '8%', content: 'per_received', type:'bar-graph', label:'Received'},
{width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'},
{width: '12%', content:'transaction_date',
css: {'text-align': 'right', 'color':'#777'},
diff --git a/buying/doctype/purchase_request/purchase_request.py b/buying/doctype/purchase_request/purchase_request.py
index 79c740000a..7d0e08e440 100644
--- a/buying/doctype/purchase_request/purchase_request.py
+++ b/buying/doctype/purchase_request/purchase_request.py
@@ -121,11 +121,6 @@ class DocType:
doc.fields[r] = ret[r]
- # Get UOM Details
- # ---------------------------------
- def get_uom_details(self, arg = ''):
- return get_obj(dt='Purchase Common').get_uom_details(arg)
-
# GET TERMS & CONDITIONS
#-----------------------------
def get_tc_details(self):
@@ -219,4 +214,4 @@ class DocType:
self.update_bin(is_submit = 0, is_stopped = (cstr(self.doc.status) == 'Stopped') and 1 or 0)
# Step 5:=> Set Status
- webnotes.conn.set(self.doc,'status','Cancelled')
+ webnotes.conn.set(self.doc,'status','Cancelled')
\ No newline at end of file
diff --git a/controllers/tax_controller.py b/controllers/tax_controller.py
index 7aa8e239d6..d70ba3e4f2 100644
--- a/controllers/tax_controller.py
+++ b/controllers/tax_controller.py
@@ -140,7 +140,7 @@ class TaxController(TransactionController):
self.doc.net_total = flt(self.doc.net_total, self.precision.main.net_total)
self.doc.fields[self.fmap.net_total_print] = \
flt(self.doc.fields.get(self.fmap.net_total_print),
- self.precision.main[self.fmap.net_total_print])
+ self.precision.main.get(self.fmap.net_total_print))
def calculate_taxes(self):
for item in self.item_doclist:
diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js
index 09befee8ac..d3bde1217b 100644
--- a/home/page/latest_updates/latest_updates.js
+++ b/home/page/latest_updates/latest_updates.js
@@ -1,5 +1,7 @@
erpnext.updates = [
["5th December 2012", [
+ "Leave Application: Now can set approver.",
+ "New Roles Added: Leave Approver and Expense Approver.",
"Production Order is now linked with sales order.",
"Production Planning Tool: The field 'Allow SA items as raw material' has been renamed to 'Use multi-level BOM', 'Include in plan' column from SO table has been deleted",
"Batch nos are now filtered with item and available qty",
diff --git a/hr/__init__.py b/hr/__init__.py
index 96bd47bdbe..429c71955b 100644
--- a/hr/__init__.py
+++ b/hr/__init__.py
@@ -3,4 +3,6 @@ install_docs = [
{"doctype":"Role", "role_name":"Employee", "name":"Employee"},
{"doctype":"Role", "role_name":"HR Manager", "name":"HR Manager"},
{"doctype":"Role", "role_name":"HR User", "name":"HR User"},
+ {"doctype":"Role", "role_name":"Leave Approver", "name":"Leave Approver"},
+ {"doctype":"Role", "role_name":"Expense Approver", "name":"Expense Approver"},
]
diff --git a/hr/doctype/expense_claim/expense_claim.js b/hr/doctype/expense_claim/expense_claim.js
index 466a8cf3fe..8ba097821f 100644
--- a/hr/doctype/expense_claim/expense_claim.js
+++ b/hr/doctype/expense_claim/expense_claim.js
@@ -15,79 +15,84 @@
// along with this program. If not, see .
cur_frm.add_fetch('employee', 'company', 'company');
+cur_frm.add_fetch('employee','employee_name','employee_name');
cur_frm.cscript.onload = function(doc,cdt,cdn){
- //
- if(!doc.approval_status) set_multiple(cdt,cdn,{approval_status:'Draft'});
- if(doc.employee) cur_frm.cscript.employee(doc,cdt,cdn);
-
+ if(!doc.approval_status)
+ cur_frm.set_value("approval_status", "Draft")
+
if (doc.__islocal) {
- if(doc.amended_from) set_multiple(cdt,cdn,{approval_status:'Draft'});
- var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);
- for(var i = 0; i