@extends('layouts.app') @section('content')

Invoice # {{ $data['order_details']['invoice_no'] }}

{{-- New sales invoices. --}}
{{--
Actions
--}}
Actions
{{ csrf_field() }}
@php $timestamp = strtotime($data['order_details']['invoice_date']); $invoice_date = date("d-m-Y", $timestamp); @endphp
@php $timestamp = strtotime($data['order_details']['due_date']); $due_date = date("d-m-Y", $timestamp); @endphp
@foreach($data['customers'] as $customer) {{ ($data['order_details']['customer_id'] == $customer['id']) ? $customer['telephone'] : '' }} @endforeach
@foreach($data['customers'] as $customer) {{ ($data['order_details']['customer_id'] == $customer['id']) ? $customer['telephone']: '' }} @endforeach
Description*
Ledger Account*
Qty*
Price/Rate*
Discount
VAT Rate
VAT Amount
Total
@php $cart_items = session()->get('items', []); $new_row_id = 0; $decimal_point =$data['decimal_point']; @endphp
@foreach ($cart_items as $cart_item) @php $parent_product_id = $cart_item['product_id']; $variant_product_name = ""; $variant_product_attributes = session()->get('variant_product_attributes', []); $new_row_id = $cart_item['row_id']; @endphp @foreach($variant_product_attributes as $variant_product_attribute) @if($variant_product_attribute['row_id'] == $cart_item['row_id']) @php $parent_product_id = $variant_product_attribute['product_id']; @endphp @foreach($data['all_products'] as $key => $value) @if($value->id == $cart_item['product_id']) @php $variant_product_name = $value->variant_name .'-'. $value->item_code; @endphp @endif @endforeach @endif @endforeach
@php $product_accept = 0; @endphp
@php $stock = 0; @endphp @foreach($data['product_stock'] as $key => $value) @if($key == $cart_item['product_id']) @php $stock = $value; @endphp @endif @endforeach
Amount: @php $discount_percentage = 0; $discount_percentage = ($cart_item['discount']/($cart_item['qty']* $cart_item['price'])) * 100; @endphp %
@php $vat_amount = ($cart_item['vat']/100) * (($cart_item['qty'] * $cart_item['price']) - $cart_item['discount']); $vat_amount = number_format($vat_amount, $decimal_point, '.', ''); $total_amount = (($cart_item['qty'] * $cart_item['price']) - $cart_item['discount']) + $vat_amount; $total_amount = number_format($total_amount, $decimal_point, '.', ''); @endphp
{{ $vat_amount }}
{{ $total_amount }}
@endforeach
Amount: %
{{ number_format(0,$decimal_point) }}
{{ number_format(0,$decimal_point) }}
@php $sub_total = ($data['order_details']['real_amount'] + $data['order_details']['discount_amount']) - $data['order_details']['tax_amount']; $sub_total = number_format($sub_total,$decimal_point); @endphp {{ $sub_total }}
{{ number_format($data['order_details']['discount_amount'],$decimal_point) }}
Amount: %
{{ number_format($data['order_details']['tax_amount'],$decimal_point) }}
{{ number_format($data['order_details']['total_amount'],$decimal_point) }}

Receive Payment

@if($data['transaction_count'] > 0)

History & Notes

Recorded by @php $latest_date_time = strtotime($data['latest_transaction_history']->created_at); $latest_date_value = date("d M Y", $latest_date_time); $latest_time_value = date("h:i", $latest_date_time); @endphp @foreach($data['users'] as $users) @if($data['latest_transaction_history']->created_by == $users['id']) {{ $users['name'] }} @endif @endforeach on {{ $latest_date_value }} at {{ $data['time'] }}

@foreach($data['customers'] as $customer) @if($data['order_details']['customer_id'] == $customer['id']) @php $cust_name = $customer['fname']; @endphp @endif @endforeach @php $latest_to_timestamp = strtotime($data['latest_transaction_history']->transaction_date); $latest_transaction_date = date("d M Y", $latest_to_timestamp); @endphp @if($data['transaction_details']->balance == 0) Full payment received from {{ $cust_name }} on {{ $latest_transaction_date }}. @else Partial payment received from {{ $cust_name }} on {{ $latest_transaction_date }} for {{ $data['latest_transaction_history']->credit }}. There is {{ $data['transaction_details']->balance }} due for this invoice. @endif

@endif
@endsection @section('admin_css') @stop @section('admin_js') @include('admin.js.sale-index') @stop