feild rename - internal rate/cost into costing rate/amount

This commit is contained in:
Neil Trini Lasrado 2015-04-01 12:08:18 +05:30
parent aabf150423
commit 709c43674b
4 changed files with 14 additions and 14 deletions

View File

@ -100,13 +100,13 @@
"allow_on_submit": 0,
"default": "0",
"description": "per hour",
"fieldname": "internal_rate",
"fieldname": "costing_rate",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Internal Rate",
"label": "Costing Rate",
"no_copy": 0,
"permlevel": 0,
"precision": "",
@ -135,7 +135,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"modified": "2015-03-25 07:50:46.554655",
"modified": "2015-04-01 02:06:37.510007",
"modified_by": "Administrator",
"module": "Projects",
"name": "Activity Cost",

View File

@ -45,7 +45,7 @@ frappe.ui.form.on("Time Log", "to_time", function(frm) {
});
var calculate_cost = function(doc) {
cur_frm.set_value("internal_cost", doc.internal_rate * doc.hours);
cur_frm.set_value("costing_amount", doc.costing_rate * doc.hours);
if (doc.billable==1){
cur_frm.set_value("billing_amount", doc.billing_rate * doc.hours);
}
@ -60,7 +60,7 @@ var get_activity_cost = function(frm) {
},
callback: function(r) {
if(!r.exc) {
cur_frm.set_value("internal_rate", r.message.internal_rate);
cur_frm.set_value("costing_rate", r.message.costing_rate);
cur_frm.set_value("billing_rate", r.message.billing_rate);
calculate_cost(frm.doc);
}

View File

@ -208,18 +208,18 @@
{
"default": "0",
"description": "per hour",
"fieldname": "internal_rate",
"fieldname": "costing_rate",
"fieldtype": "Currency",
"label": "Internal Rate",
"label": "Costing Rate",
"permlevel": 0,
"precision": "",
"read_only": 1
},
{
"default": "0",
"fieldname": "internal_cost",
"fieldname": "costing_amount",
"fieldtype": "Currency",
"label": "Internal Cost",
"label": "Costing Amount",
"permlevel": 0,
"precision": "",
"read_only": 1

View File

@ -217,9 +217,9 @@ class TimeLog(Document):
def validate_cost(self):
rate = get_activity_cost(self.employee, self.activity_type)
self.internal_rate = rate.get('internal_rate')
self.billing_rate = rate.get('billing_rate')
self.internal_cost = self.internal_rate * self.hours
self.costing_rate = rate.get('costing_rate') or 0
self.billing_rate = rate.get('billing_rate') or 0
self.costing_amount = self.costing_rate * self.hours
if self.billable:
self.billing_amount = self.billing_rate * self.hours
else:
@ -281,7 +281,7 @@ def get_events(start, end, filters=None):
@frappe.whitelist()
def get_activity_cost(employee=None, activity_type=None):
internal_rate = frappe.db.get_value("Activity Cost", {"employee":employee,"activity_type":activity_type}, "internal_rate")
costing_rate = frappe.db.get_value("Activity Cost", {"employee":employee,"activity_type":activity_type}, "costing_rate")
billing_rate = frappe.db.get_value("Activity Cost", {"employee":employee,"activity_type":activity_type}, "billing_rate")
return {"internal_rate": internal_rate, "billing_rate": billing_rate }
return {"costing_rate": costing_rate, "billing_rate": billing_rate }