@php use Carbon\Carbon; use App\Http\Helpers\Helper; @endphp @extends("frontend.main") @section("content")
Khách hàng
{{ $invoice->Customer->firstname . " " . $invoice->Customer->lastname }}
Điện thoại: {{ $invoice->Customer->phone }}
Email: {{ $invoice->Customer->email }}
Địa chỉ: {{ $invoice->Customer->address }}
Thông tin hoá đơn
Mã hoá đơn: #{{ $invoice->id }}
Ngày tạo: {{ Carbon::parse($invoice->date)->format("d/m/Y") }}
Hạn thanh toán: {{ Carbon::parse($invoice->due_date)->format("d/m/Y") }}
Tổng tiền: {{ number_format($invoice->total,0,',','.') }} đ

Chi tiết hoá đơn
@if($invoice->InvoiceItem->count()) @foreach($invoice->InvoiceItem->all() as $key => $item) @endforeach @php($discount = 0) @if($invoice->Order) @endif @endif
# Dịch vụ Thời hạn Số tiền
{{ $key + 1 }} {{ $item->description }} {!! Helper::ViewBillingCycle($item->billing) !!} {{ number_format($item->amount * Helper::BillingFormat($item->billing),0,',','.') }} đ
Giảm giá {{ number_format($invoice->Order->discount_value,0,',','.') }} đ @php( $discount = $invoice->Order->discount_value)
Thành tiền (Chưa VAT) {{ number_format($invoice->InvoiceItem->sum('amount') * Helper::BillingFormat($item->billing) - $discount,0,',','.') }} đ
VAT (10%) {{ number_format(($invoice->InvoiceItem->sum('amount') * Helper::BillingFormat($item->billing) - $discount) * (10/100),0,',','.') }} đ
Tổng cộng {{ number_format($invoice->total,0,',','.') }} đ
Thông tin thanh toán
Trạng thái thanh toán:
{!! Helper::ViewInvoiceStatus($invoice->status) !!}
@if($invoice->status === 1)
Ngày thanh toán:
{{ Carbon::parse($invoice->date_paid)->format('d/m/Y') }}
{{--
Phương thức thanh toán:
{{ $invoice->Payment->name }}
--}} @endif @if($invoice->status === 0)
Tổng thanh toán:
{{ number_format($invoice->total,0,',','.') }} đ
@endif
@push('viewScripts') @endpush @push('viewStyles') @endpush @endsection