{{--@if (file_exists(public_path('img/fsm-logo.png')))--}} {{--
--}} {{----}} {{--
--}} {{--@else--}}
{{--@endif--}}
INVOICE
Invoice Number.: OAT2024 - {{$invoice->id}}
 
Invoice Date.: {{$invoice->date_created}}
CREDIT PERIOD: {{$invoice->credit_period}}
 
DUE ON: {{$due_on}}

FROM
{{$campany->company_name}}
{{$campany->company_address}}
PLOT 7 and 9 BLOCK A
MSAMVU INDUSTRIAL AREA
+255 713 771168
  @if($invoice->bill_consignee == 1) @else @endif
To
{{$invoice->consignee}}
AGENT
{{$invoice->client->name}}
{{$invoice->client->address}} {{$invoice->client->region}}
{{$invoice->client->country}}
To
{{$invoice->client->name}}
VRN: 40-001968-P
 
TIN: 106-381-577
Exchange Rate: {{$invoice->exchange_rate}}
Currency: @if($invoice->currency == 'USD') Us Dollars @elseif($invoice->currency == 'TSH') Tsh @endif



{{--*/ $i = 1 /*--}} {{--*/ $sub_amount = 0 /*--}} {{--*/ $total_tax = 0 /*--}} @foreach($details as $detail) {{--*/ $sub_amount += $detail->amount /*--}} {{--*/ $i ++ /*--}} @endforeach
# Description Amount Taxed Sub-Total
{{$i}} {{$invoice->description}} {{number_format($detail->amount)}} @if($detail->is_taxed == 1) {{--*/ $total_tax += $detail->amount*0.18 /*--}} @else @endif @if($invoice->currency == 'USD') {{number_format($detail->amount)}} @elseif($invoice->currency == 'TSH') @if(is_int($detail->amount*$invoice->exchange_rate)) {{number_format($detail->amount*$invoice->exchange_rate)}} @else {{number_format($detail->amount*$invoice->exchange_rate)}} @endif @endif
Pre-tax subtotal @if($invoice->currency == 'USD') {{number_format($sub_amount)}} @elseif($invoice->currency == 'TSH') @if(is_int($sub_amount*$invoice->exchange_rate)) {{number_format($sub_amount*$invoice->exchange_rate)}} @else {{number_format($sub_amount*$invoice->exchange_rate)}} @endif @endif
Tax (18%) @if($invoice->currency == 'USD') {{number_format($total_tax)}} @elseif($invoice->currency == 'TSH') @if(is_double($total_tax*$invoice->exchange_rate)) {{number_format($total_tax*$invoice->exchange_rate)}} @else {{number_format($total_tax*$invoice->exchange_rate)}} @endif @endif
Grand Total Payable @if($invoice->currency == 'USD') {{number_format($sub_amount+$total_tax,2)}} @elseif($invoice->currency == 'TSH') {{number_format(($sub_amount+$total_tax)*$invoice->exchange_rate,2)}} @endif

{{--AMOUNT IN WORDS
--}} {{--
--}} {{-- 
--}} {{--
--}}
BANK DETAILS
Name: {{$invoice->bankAccount['name']}}
Bank: {{$invoice->bankAccount['bank_name']}}
Account Number(USD): {{$invoice->bankAccount['account_number']}}
SWIFT Code: {{$invoice->bankAccount['swift_code']}}
{{$invoice->bankAccount['location']}}
APPROVAL
Authorized Signature