Good day
I have a problem that I have to fix before the end of the month when I do invoicing.
V14.24.3 … latest version
I have project and tasks, multi currency. When I generate a time sheet, the timesheet
reports the costing correctly based on the exchange rate …
billabe amount
and
base billable amount
IF I look at the code , right when you SUBMIT the time sheet it sums the existing project
costs with those on the time sheet and stores that in the Project cost table.
But is uses the billable amount and not the base billable amount. It must use the
base billable amount so that the project costing is in the base currency although the
time sheet has costing in both currency. So I agree with the fact that the project
has the base currency symbol … .but it uses the non-base currency numbers when
adding th etime sheet costs to the project costs.
I thought I found a place in the code that I can change to fix this, but clearly I am mis-iterpreting
things because its not working.
I really need help urgently. There is no time to submit this as an issue. Thanks
It would help if you overrode the functions that are being used
Good day @CA_B.C_Chechani . Thank you
That is what I tried …
In the table tabTimesheet Detail , the columns are …
billing_amount
costing_amount
which are the columns for the billing and costing amounts in the foreign currency
The columns for the base currency are…
base_billing_amount
base_costing_amount
So in project.py, “update_project” calls “update_costing” and in “update_costing”
the query looks like this
TimesheetDetail = frappe.qb.DocType("Timesheet Detail")
from_time_sheet = (
frappe.qb.from_(TimesheetDetail)
.select(
Sum(TimesheetDetail.costing_amount).as_("costing_amount"),
Sum(TimesheetDetail.billing_amount).as_("billing_amount"),
Min(TimesheetDetail.from_time).as_("start_date"),
Max(TimesheetDetail.to_time).as_("end_date"),
Sum(TimesheetDetail.hours).as_("time"),
)
.where((TimesheetDetail.project == self.name) & (TimesheetDetail.docstatus == 1))
).run(as_dict=True)[0]
so I added “base_” to “billing_amount” and “costing_amount”. Now it looks like this…
type or paste code here TimesheetDetail = frappe.qb.DocType("Timesheet Detail")
from_time_sheet = (
frappe.qb.from_(TimesheetDetail)
.select(
Sum(TimesheetDetail.base_costing_amount).as_("costing_amount"),
Sum(TimesheetDetail.base_billing_amount).as_("billing_amount"),
Min(TimesheetDetail.from_time).as_("start_date"),
Max(TimesheetDetail.to_time).as_("end_date"),
Sum(TimesheetDetail.hours).as_("time"),
)
.where((TimesheetDetail.project == self.name) & (TimesheetDetail.docstatus == 1))
).run(as_dict=True)[0]
I thought I had it sorted , but I clearly must be misinterpreting.
@willspenc We are currently addressing the issue you’ve encountered, as we are experiencing a similar challenge. If you have already found a resolution, could you please share your approach? Alternatively, we would appreciate your feedback if you are interested in testing our solution.