@extends('layouts.admin') @section('page-title') {{__('Proposal Detail')}} @endsection @php $settings = Utility::settings(); $creatorId = \Auth::user()->creatorId(); $company_state = strtolower(trim($settings['company_state'] ?? 'defaultstate')); $customer_state = strtolower(trim($customer->billing_state ?? '')); $isSameState = $company_state === $customer_state; @endphp @push('script-page') @endpush @section('breadcrumb')
{{ __('Created on ') }}{{ \Auth::user()->dateFormat($proposal->issue_date) }}
@can('edit proposal') {{ __('Edit') }} @endcan@if ($proposal->status != 0) {{ __('Sent on') }} {{ \Auth::user()->dateFormat($proposal->send_date) }} @else @can('send proposal') {{ __('Status') }} : {{ __('Not Sent') }} @endcan @endif
@if ($proposal->status == 0) @can('send proposal') {{ __('Send') }} @endcan @endif| # | {{__('Product')}} | {{__('Quantity')}} | {{__('Rate')}} | {{__('Discount')}} | {{__('Tax')}} | {{__('Description')}} | {{__('Price')}} {{__('after tax & discount')}} |
|---|---|---|---|---|---|---|---|
| {{ $key + 1 }} | {{ !empty($productName) ? $productName->name : '' }} | {{ $iteam->quantity . ' (' . ($productName->unit->name ?? '') . ')' }} | {{ \Auth::user()->priceFormat($iteam->price) }} | {{ \Auth::user()->priceFormat($iteam->discount) }} |
@php
$taxData = json_decode($iteam->tax, true);
if (!is_array($taxData) && !empty($iteam->tax)) {
$taxData = explode(',', $iteam->tax);
}
$iteamTaxPrice = 0;
$taxRates = [];
$taxDetails = [];
$taxableAmount = ($iteam->price - $iteam->discount) * $iteam->quantity;
@endphp
@if (!empty($taxData))
@foreach (array_unique($taxData) as $taxId)
@php
$tax = \App\Models\Tax::find((int) trim($taxId));
if ($tax) {
$taxRates[] = floatval($tax->rate);
$taxDetails[] = $tax;
}
@endphp
@endforeach
@php
$totalRate = array_sum($taxRates);
$totalTaxAmount = ($taxableAmount * $totalRate) / 100;
$iteamTaxPrice += $totalTaxAmount;
@endphp
@if (strtolower($tax_type) === 'vat')
@php
$taxSummary['VAT'] = ($taxSummary['VAT'] ?? 0) + $totalTaxAmount;
@endphp
VAT ({{ $totalRate }}%) - ₹{{ number_format($totalTaxAmount, 2) }}
@elseif (strtolower($tax_type) === 'gst')
@if ($isSameState)
@php
$halfRate = $totalRate / 2;
$halfAmount = $totalTaxAmount / 2;
$taxSummary['CGST'] = ($taxSummary['CGST'] ?? 0) + $halfAmount;
$taxSummary['SGST'] = ($taxSummary['SGST'] ?? 0) + $halfAmount;
@endphp
CGST ({{ $halfRate }}%) - ₹{{ number_format($halfAmount, 2) }}
SGST ({{ $halfRate }}%) - ₹{{ number_format($halfAmount, 2) }}
@else
@php
$taxSummary['IGST'] = ($taxSummary['IGST'] ?? 0) + $totalTaxAmount;
@endphp
IGST ({{ $totalRate }}%) - ₹{{ number_format($totalTaxAmount, 2) }}
@endif
@endif
@else
—
@endif
|
{{ !empty($iteam->description) ? $iteam->description : '-' }} | {{ \Auth::user()->priceFormat($taxableAmount + $iteamTaxPrice) }} |
| {{__('Total')}} | {{ $totalQuantity }} | {{ \Auth::user()->priceFormat($totalPrice) }} | {{ \Auth::user()->priceFormat($totalDiscount) }} | {{ \Auth::user()->priceFormat($totalTaxPrice) }} | |||
| {{__('Sub Total')}} | {{ \Auth::user()->priceFormat($proposal->getSubTotal()) }} | ||||||
| {{__('Discount')}} | {{ \Auth::user()->priceFormat($proposal->getTotalDiscount()) }} | ||||||
| {{ $taxName }} | {{ \Auth::user()->priceFormat($taxPrice) }} | ||||||
| {{__('Total')}} | {{ \Auth::user()->priceFormat($taxableAmount + $iteamTaxPrice) }} | ||||||