feild rename - internal rate/cost into costing rate/amount
This commit is contained in:
parent
aabf150423
commit
709c43674b
@ -100,13 +100,13 @@
|
|||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"description": "per hour",
|
"description": "per hour",
|
||||||
"fieldname": "internal_rate",
|
"fieldname": "costing_rate",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"label": "Internal Rate",
|
"label": "Costing Rate",
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@ -135,7 +135,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-03-25 07:50:46.554655",
|
"modified": "2015-04-01 02:06:37.510007",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Activity Cost",
|
"name": "Activity Cost",
|
||||||
|
@ -45,7 +45,7 @@ frappe.ui.form.on("Time Log", "to_time", function(frm) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var calculate_cost = function(doc) {
|
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){
|
if (doc.billable==1){
|
||||||
cur_frm.set_value("billing_amount", doc.billing_rate * doc.hours);
|
cur_frm.set_value("billing_amount", doc.billing_rate * doc.hours);
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ var get_activity_cost = function(frm) {
|
|||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
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);
|
cur_frm.set_value("billing_rate", r.message.billing_rate);
|
||||||
calculate_cost(frm.doc);
|
calculate_cost(frm.doc);
|
||||||
}
|
}
|
||||||
|
@ -208,18 +208,18 @@
|
|||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"description": "per hour",
|
"description": "per hour",
|
||||||
"fieldname": "internal_rate",
|
"fieldname": "costing_rate",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Internal Rate",
|
"label": "Costing Rate",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"fieldname": "internal_cost",
|
"fieldname": "costing_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Internal Cost",
|
"label": "Costing Amount",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
@ -217,9 +217,9 @@ class TimeLog(Document):
|
|||||||
|
|
||||||
def validate_cost(self):
|
def validate_cost(self):
|
||||||
rate = get_activity_cost(self.employee, self.activity_type)
|
rate = get_activity_cost(self.employee, self.activity_type)
|
||||||
self.internal_rate = rate.get('internal_rate')
|
self.costing_rate = rate.get('costing_rate') or 0
|
||||||
self.billing_rate = rate.get('billing_rate')
|
self.billing_rate = rate.get('billing_rate') or 0
|
||||||
self.internal_cost = self.internal_rate * self.hours
|
self.costing_amount = self.costing_rate * self.hours
|
||||||
if self.billable:
|
if self.billable:
|
||||||
self.billing_amount = self.billing_rate * self.hours
|
self.billing_amount = self.billing_rate * self.hours
|
||||||
else:
|
else:
|
||||||
@ -281,7 +281,7 @@ def get_events(start, end, filters=None):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_activity_cost(employee=None, activity_type=None):
|
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")
|
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 }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user