Saturday, August 5, 2023
1 change · master
Enhancements to existing features
Timesheet revenue reports now better reflect prepaid or fixed-price service sales by spreading the full sale amount across the delivered timesheet hours. This helps businesses see revenue allocation that matches the actual fixed-price contract value instead of underreporting based only on hourly unit prices.
Original PR description
...services In the reporting of Timesheets, "timesheet revenues" represent `sol.price_unit * sum(timesheets.unit_amount)`. While this calculation is correct for SOLs with a service invoiced on…
...services In the reporting of Timesheets, "timesheet revenues" represent `sol.price_unit * sum(timesheets.unit_amount)`. While this calculation is correct for SOLs with a service invoiced on delivered quantities, it doesn't reflect the truth when the product is prepaid/fixed price (ordered quantities). With this commit, the "timesheet revenues" related to the latter type of services will be equal to `sol.price_total / sol.qty_delivered * sum(timesheets.unit_amount)`. Where we determine the revenue per unit, and apply it to the total duration of timesheets. Example: Say a SOL with a service of type "prepaid/fixed price", an ordered quantity of 4, and a price per unit of 3.00€. The total price is 12.00€ no matter how much has been delivered. Say users A and B, having respectively timesheeted 2h and 1h, so the delivered quantity of the SOL is 3. We'll note "timesheet revenue of user X" "TR(X)". Before this commit: `TR(A) = 3.00€/h * 2h = 6.00€` `TR(B) = 3.00€/h * 1h = 3.00€` `TR(A) + TR(B) = 6.00€ + 3.00€ = 9.00€` The total timesheet revenues is 9.00€ where it should be 12.00€. Now: `TR(A) = 12.00€ / 3h * 2h = 8.00€` `TR(B) = 12.00€ / 3h * 1h = 4.00€` `TR(A) + TR(B) = 8.00€ + 4.00€ = 12.00€` The total timesheet revenues corresponds to the SOL's total price. task-3368808 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr