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);
|
||||
$fees = $monthlyFees->get($key, 0);
|
||||
$discount = (int) ($revenue->total_discount ?? 0);
|
||||
$hpp = (int) ($monthlyHpp->get($key, 0));
|
||||
$deduction = $discount + $fees;
|
||||
|
||||
$result[] = [
|
||||
'month' => $monthLabel,
|
||||
'total' => (int) ($revenue->total_revenue ?? 0),
|
||||
'net' => (int) ($revenue->total_revenue ?? 0) - $deduction,
|
||||
'net' => (int) ($revenue->total_revenue ?? 0) - $deduction - $hpp,
|
||||
'deduction' => $deduction,
|
||||
];
|
||||
|
||||
|
||||
@ -194,7 +194,7 @@ const revenueChartConfig = {
|
||||
|
||||
const revenueTotals = computed(() => ({
|
||||
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,
|
||||
}));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user