@extends('layouts.app') @section('title', __('sale.print')) @section('content')
@include('layouts.session')

{{ app('company')['name'] }}

{{ app('company')['address'] }}
{{ __('app.bill_to') }}:

{{ $sale->party->first_name.' '. $sale->party->last_name }}

{{ $sale->party->invoiceing_address }}

#{{ $sale->sale_code }}

{{ __('app.date') }}: {{ $sale->formatted_sale_date }}
@if($sale->reference_no)
{{ __('supplier.supplier_invoice_number') }}: {{ $sale->reference_no }}
@endif @if($sale->sale_order_id)
{{ __('sale.order.order') }}: {{ $sale->saleOrder->order_code }}
@endif
@php $isHasBatchItem = ($sale->itemTransaction->where('tracking_type', 'batch')->count() > 0) ? true : false; //Return from Controller $totalBatchTrackingRowCount = ($isHasBatchItem) ? $batchTrackingRowCount : 0; @endphp @php $i=1; @endphp @foreach($sale->itemTransaction as $transaction) @endforeach @php $subtotal = $sale->itemTransaction->sum(function ($transaction) { /*if($transaction->tax_type == 'inclusive'){ $unitPrice = calculatePrice($transaction->unit_price, $transaction->tax->rate, needInclusive: true); }else{ $unitPrice = calculatePrice($transaction->unit_price, $transaction->tax->rate, needInclusive: false); }*/ $unitPrice = $transaction->unit_price; return $unitPrice * $transaction->quantity; }); $columnCount = 1+$totalBatchTrackingRowCount; @endphp
# {{ __('item.item') }} {{ __('app.qty') }} {{ __('app.total') }}
{{ $i++ }}

{{ $transaction->item->name }}

{{ $transaction->description }} @if ($transaction->itemSerialTransaction->count() > 0)
{{ $transaction->itemSerialTransaction->pluck('itemSerialMaster.serial_code')->implode(', ') }}
@endif
{{ $formatNumber->formatQuantity($transaction->quantity) }} {{ $formatNumber->formatWithPrecision($transaction->total) }}
{{ __('app.subtotal') }} {{ $formatNumber->formatWithPrecision($subtotal) }}
{{ __('app.grand_total') }} {{ $formatNumber->formatWithPrecision($sale->grand_total) }}
{{ __('payment.paid_amount') }} {{$formatNumber->formatWithPrecision($sale->paid_amount)}}
{{ __('payment.balance') }} {{$formatNumber->formatWithPrecision($sale->grand_total - $sale->paid_amount)}}
@include("modals.email.send") @include("modals.sms.send") @endsection @section('js') @endsection