@extends('layouts.sidebar') @section('content') @php $vatAmount = 0; $withholdingTaxAmount = 0; $penalty = 0; // Calculate subtotal without penalty first $subtotal = $data->Amount + $totalElectricAmount + $totalWaterAmount + $additional; // Calculate penalty based on status // Calculate VAT if ($data->lease->client->vat === 'vat') { $vatAmount = $subtotal * 0.12; } // Calculate Withholding Tax if ($data->lease->client->w_holding_tax === 'true') { $withholdingTaxAmount = $subtotal * 0.05; } // Calculate grand total $grandTotal = $subtotal + $vatAmount - $withholdingTaxAmount; @endphp
@endsection