{{--@endif--}}
INVOICE
Invoice Number.: OAT2024 - {{$invoice->id}}
 
Invoice Date.: {{$invoice->date_created}}
CREDIT PERIOD: {{$invoice->credit_period}}
 
DUE ON: {{$due_on}}

FROM
{{$company->company_name}}
{{$company->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}}
{{$invoice->client->address}} {{$invoice->client->region}}
{{$invoice->client->street}}, {{$invoice->client->plot_number}}
Phone: {{$invoice->client->phone}}
VRN: 40-001968-P
 
TIN: 106-381-577
Exchange Rate: {{$invoice->exchange_rate}}
Currency: @if($currency == 'USD') Us Dollars @elseif($currency == 'TSH') Tsh @endif



{{--*/ $i = 1 /*--}} {{--*/ $sub_amount = 0 /*--}} {{--*/ $total_tax = 0 /*--}} {{--*/ $amount = 0 /*--}} @foreach($destinations as $detail) {{--*/ $sub_amount += $amount /*--}} {{--*/ $i ++ /*--}} @endforeach @foreach($additional_amounts as $detail) @if($detail->transaction_type == 'DEBIT') {{--*/ $sub_amount += $detail->getAmount($invoice->currency) /*--}} @else($detail->transaction_type == 'CREDIT') {{--*/ $sub_amount -= $detail->getAmount($invoice->currency) /*--}} @endif {{--*/ $i ++ /*--}} @endforeach
# Item Description Charges Description Sub-Total
Route/Container No/Truck No/Trailer/File No. Qnty(ton) Rate Tax
{{$i}} {{$detail->routeName}}/{{$detail->destination->container}} /{{$detail->RouteAssignment->vehicle}}/ {{$detail->RouteAssignment->trailer}}/{{$detail->destination->file_number}} {{$detail->destination->quantity}} @if($detail->destination == $currency) {{number_format($detail->destination->rate,2)}} @else @if($currency == 'USD') @if($invoice->exchange_rate > 0) {{$detail->destination->rate/$invoice->exchange_rate}} @else -ERROR- @endif @elseif($currency == 'TSH') @if($invoice->exchange_rate > 0) {{$detail->destination->rate*$invoice->exchange_rate}} @else -ERROR- @endif @endif @endif @if($detail->isTaxed == 1) @if($detail->destination == $currency) {{--*/ $total_tax += $detail->destination->amount*0.18 /*--}} @else @if($currency == 'USD') @if($invoice->exchange_rate > 0) {{--*/ $total_tax += ($detail->destination->amount*0.18)/$invoice->exchange_rate /*--}} @else {{--*/ $total_tax += 0 /*--}} @endif @elseif($currency == 'TSH') @if($invoice->exchange_rate > 0) {{--*/ $total_tax += ($detail->destination->amount*0.18)*$invoice->exchange_rate /*--}} @else {{--*/ $total_tax += 0 /*--}} @endif @endif @endif @else @endif @if($detail->destination->currency == $currency) {{number_format($amount=$detail->destination->amountValue,2)}} @else @if($currency == 'USD') @if($invoice->exchange_rate > 0) {{number_format($amount=$detail->destination->amountValue/$invoice->exchange_rate,2)}} @else -ERROR- @endif @elseif($currency == 'TSH') @if($invoice->exchange_rate > 0) {{number_format($amount=$detail->destination->amountValue*$invoice->exchange_rate,2)}} @else -ERROR- @endif @endif @endif
{{$i}} {{$detail->description}} {{number_format($detail->getAmount($invoice->currency),2)}}
Pre-tax subtotal {{number_format($sub_amount,2)}}
Tax (18%) @if($invoice->currency == 'USD') {{$total_tax}} @elseif($invoice->currency == 'TSH') @if(is_double($total_tax*$invoice->exchange_rate)) {{number_format($total_tax*$invoice->exchange_rate)}} @else {{$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
{{\App\Logistics\Facades\Logistics::numberToWord($sub_amount+$total_tax,$currency)}} only.
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