@extends('backend.invoice.master') @php($title= 'Invoice') @if($payment->model=='Purchase') @php($title='Credit Purchase Invoice') @else @php($title = $payment->sale->sale_type =='Cash'? 'Sale Invoice' : 'Sale Invoice') @endif @section('title') {{ $title }} @endsection @section('body')

Name:{{ $payment->sale->client_name }} Mobile:{{ $payment->sale->client_mobile }} Address:
Date:{{ dateFormat($payment->created_at,'d-m-Y') }} Time:{{ dateFormat($payment->created_at,'h:m:i') }} Invoice No:{{ memoNo($payment->sale->id) }}
{{-- --}} @foreach($payment->sale->details as $detail) {{-- @php($factor = unitConversionFactor($detail->unit_id,$detail->secondary_unit_id))--}} {{-- --}} @endforeach {{-- @if($payment->sale->vat>0)--}} {{-- @endif--}} {{-- @if($payment->sale->discount>0)--}} {{-- @endif--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @php($total = $payment->sale->total)--}} @php($total = $payment->sale->product_cost+$payment->sale->vat-$payment->sale->discount) @php($received = $payment->amount) {{-- @php($due = ($total - $received))--}} {{-- @if($due>0)--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @endif--}} {{-- --}} {{-- @php($oldBalance = clientLastBalance($payment->client_id,$payment->id))--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @php($presentBalance = customerNewBalance($due,$oldBalance))--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
Sl Product CompanyQuantityQuantity Rate(Taka) Rate(Taka)
{{ numberFormat($loop->iteration) }} {{ $detail->product->name }} {{ $detail->product->brand->name }}{{ numberFormat($detail->quantity*$factor) }} {{ $detail->secondaryUnit->code }}{{ numberFormat($detail->quantity,dp($detail->quantity)) }} {{ $detail->unit->code }} {{ numberFormat($detail->rate,2) }} {{ numberFormat($detail->rate*$detail->quantity,2) }}
Total Cost: {{ numberFormat($payment->sale->product_cost,2) }}/-
Vat(+): {{ numberFormat($payment->sale->vat,2) }}/-
Discount(-): {{ numberFormat($payment->sale->discount,2) }}/-
Transport Cost:{{ numberFormat($payment->sale->transport_cost,2) }}/-
Labour cost:{{ numberFormat($payment->sale->labour_cost,2) }}/-
Total:{{ numberFormat($total,2) }}/-
Received:{{ numberFormat($received,2) }}/-
{{ 'Discount' }}:{{ numberFormat($due,2) }}/-
In word: {{ convertNumberToWord($received) }} Taka Only
Previous {{ $oldBalance['title'] == 'Credit' ? 'Receivable' : 'Payable' }}:{{ $oldBal = $oldBalance['balance'] }}/-
New {{ $presentBalance['title'] == 'Credit' ? 'Receivable' : 'Payable' }}:{{ $presentBalance['balance'] }}/-
@endsection