feat: update AnalysisService and Analysis.vue to include HPP in net revenue calculations for more accurate financial reporting
This commit is contained in:
parent
15f2f0e1d0
commit
82fdb9ee0a
@ -319,12 +319,13 @@ public function getMonthlyRevenue(?Carbon $startDate = null, ?Carbon $endDate =
|
|||||||
$revenue = $monthlyData->firstWhere('month_key', $key);
|
$revenue = $monthlyData->firstWhere('month_key', $key);
|
||||||
$fees = $monthlyFees->get($key, 0);
|
$fees = $monthlyFees->get($key, 0);
|
||||||
$discount = (int) ($revenue->total_discount ?? 0);
|
$discount = (int) ($revenue->total_discount ?? 0);
|
||||||
|
$hpp = (int) ($monthlyHpp->get($key, 0));
|
||||||
$deduction = $discount + $fees;
|
$deduction = $discount + $fees;
|
||||||
|
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'month' => $monthLabel,
|
'month' => $monthLabel,
|
||||||
'total' => (int) ($revenue->total_revenue ?? 0),
|
'total' => (int) ($revenue->total_revenue ?? 0),
|
||||||
'net' => (int) ($revenue->total_revenue ?? 0) - $deduction,
|
'net' => (int) ($revenue->total_revenue ?? 0) - $deduction - $hpp,
|
||||||
'deduction' => $deduction,
|
'deduction' => $deduction,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -194,7 +194,7 @@ const revenueChartConfig = {
|
|||||||
|
|
||||||
const revenueTotals = computed(() => ({
|
const revenueTotals = computed(() => ({
|
||||||
total: props.revenueSummary.total_revenue,
|
total: props.revenueSummary.total_revenue,
|
||||||
net: props.revenueSummary.total_revenue - props.revenueSummary.total_deduction,
|
net: props.revenueSummary.total_revenue - props.revenueSummary.total_deduction - props.profitMetrics.hpp,
|
||||||
deduction: props.revenueSummary.total_deduction,
|
deduction: props.revenueSummary.total_deduction,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user