@extends('admin.layouts.index', ['header' => true, 'nav' => true, 'demo' => true]) @section('css') @endsection @php use App\Setting; use App\Plan; $settings = Setting::first(); $planDetails = Plan::where('plan_id', $transaction->plan_id)->first(); if ($planDetails->validity == 9999) { $term = 'Lifetime'; } elseif ($planDetails->validity >= 30 && $planDetails->validity <= 31) { $term = 'Monthly'; } elseif ($planDetails->validity >= 365 && $planDetails->validity <= 366) { $term = 'Yearly'; } else { $term = $planDetails->validity . ' days'; } // Safe billing array $billing = is_array($transaction->billing_details) ? $transaction->billing_details : []; // From billing $fromName = $billing['from_billing_name'] ?? ''; $fromAddress = $billing['from_billing_address'] ?? ''; $fromCity = $billing['from_billing_city'] ?? ''; $fromState = $billing['from_billing_state'] ?? ''; $fromCountry = $billing['from_billing_country'] ?? ''; $fromEmail = $billing['from_billing_email'] ?? ''; $fromPhone = $billing['from_billing_phone'] ?? ''; $fromVat = $billing['from_vat_number'] ?? ''; // To billing $toName = $billing['to_billing_name'] ?? ''; $toAddress = $billing['to_billing_address'] ?? ''; $toCity = $billing['to_billing_city'] ?? ''; $toState = $billing['to_billing_state'] ?? ''; $toCountry = $billing['to_billing_country'] ?? ''; $toEmail = $billing['to_billing_email'] ?? ''; $toPhone = $billing['to_billing_phone'] ?? ''; $toVat = $billing['to_vat_number'] ?? ''; @endphp @section('content')
@if (Session::has('failed')) @endif @if (Session::has('success')) @endif
{{ config('app.name') }}
{{ $fromName }}
{{ $fromAddress }}, {{ $fromCity }}, {{ $fromState }} {{ $fromCountry }}
{{ __('Email') }}: {{ $fromEmail }}
@if (!empty($fromPhone)) {{ __('Phone') }}: {{ $fromPhone }}
@endif @if (!empty($fromVat)) {{ __('Tax Number') }}: {{ $fromVat }}
@endif

{{ __('INVOICE') }}

#{{ $transaction->invoice_prefix }}{{ $transaction->invoice_number }}

{{ __('Bill To') }}

{{ $toName }}
{{ $toAddress }}, {{ $toCity }}, {{ $toState }} {{ $toCountry }}
{{ __('Email') }}: {{ $toEmail }}
@if (!empty($toPhone)) {{ __('Phone') }}: {{ $toPhone }}
@endif @if (!empty($toVat)) {{ __('Tax Number') }}: {{ $toVat }}
@endif

{{ __('Date') }}: {{ date('M d, Y', strtotime($transaction->transaction_date)) }}

{{ __('Payment Terms') }}: {{ __($transaction->payment_gateway_name != 'TRIAL' ? $term : 'TRIAL') }}

{{ __('Balance Due') }}: {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}0.00
@if (($billing['tax_amount'] ?? 0) > 0) @endif @if (!empty($billing['applied_coupon'])) @else @endif
{{ __('Item') }} {{ __('Quantity') }} {{ __('Rate') }} {{ __('Amount') }}
{{ __($planDetails->plan_name) }} - {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $planDetails->plan_price }}{{ $term == '9999 days' ? '' : '/' . $term }} 1 {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $planDetails->plan_price }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $planDetails->plan_price }}
{{ __('Subtotal') }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $billing['subtotal'] ?? 0 }}
{{ __($billing['tax_name'] ?? '') }} ({{ $billing['tax_value'] ?? 0 }}%) {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $billing['tax_amount'] ?? 0 }}
{{ __('Before Discount') }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }} {{ ($billing['subtotal'] ?? 0) + ($billing['tax_amount'] ?? 0) }}
{{ __('Applied Coupon') }}: {{ $billing['applied_coupon'] }} - {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $billing['discounted_price'] ?? 0 }}
{{ __('After Tax') }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }} {{ ($billing['subtotal'] ?? 0) + ($billing['tax_amount'] ?? 0) }}
{{ __('Total') }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $billing['invoice_amount'] ?? 0 }}
{{ __('Amount Paid') }} {{ $currencies->firstWhere('iso_code', $transaction->transaction_currency)->symbol ?? '' }}{{ $billing['invoice_amount'] ?? 0 }}

{{ __('Notes') }}:
{{ __('Payment from ') }}{{ __($transaction->payment_gateway_name) }}
{{ __('Transaction ID: ') }} {{ $transaction->transaction_id }}

{{ __($config[29]->config_value ?? 'Thank you for your business') }}

@include('admin.includes.footer')
@endsection