Merge branch 'version-13-hotfix' into si_total_billing_hours_v13

This commit is contained in:
Raffael Meyer
2021-08-15 18:45:33 +02:00
committed by GitHub
160 changed files with 6224 additions and 2444 deletions

View File

@@ -310,6 +310,7 @@
"read_only": 1
},
{
"default": "1",
"fieldname": "exchange_rate",
"fieldtype": "Float",
"label": "Exchange Rate"
@@ -319,7 +320,7 @@
"idx": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-05-18 16:10:08.249619",
"modified": "2021-06-09 12:08:53.930200",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet",

View File

@@ -235,7 +235,8 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
tsd.billing_amount as billing_amount,
tsd.activity_type as activity_type,
tsd.description as description,
ts.currency as currency
ts.currency as currency,
tsd.project_name as project_name
FROM `tabTimesheet Detail` tsd
@@ -262,6 +263,20 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
return frappe.db.sql(query, filters, as_dict=1)
@frappe.whitelist()
def get_timesheet_detail_rate(timelog, currency):
timelog_detail = frappe.db.sql("""SELECT tsd.billing_amount as billing_amount,
ts.currency as currency FROM `tabTimesheet Detail` tsd
INNER JOIN `tabTimesheet` ts ON ts.name=tsd.parent
WHERE tsd.name = '{0}'""".format(timelog), as_dict = 1)[0]
if timelog_detail.currency:
exchange_rate = get_exchange_rate(timelog_detail.currency, currency)
return timelog_detail.billing_amount * exchange_rate
return timelog_detail.billing_amount
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_timesheet(doctype, txt, searchfield, start, page_len, filters):