@php $faktur = $data; $jsonencode = json_encode($datacust); if ($from === 'null') { $tgl = 'Semua'; }else{ $tgl = date('d/m/Y',strtotime($from)).' s/d '.date('d/m/Y',strtotime($to)); } @endphp
Laporan
{{$title}}

Pelanggan : {{$datacust === null ? $faktur[0]->customer->name : $datacust->name}}

Tanggal : {{$tgl}}

@if(count($faktur) > 0) @foreach($data as $p) @php $tanggal = date('d/m/Y',strtotime($p->created_at)); @endphp @foreach($p->transaction_details as $details) @php $i = 1; $item = $details->item; $hargabarang = $details->custom_price; $qty = $details->qty; $discountitem = $details->discount; if ($discountitem > 100) { $discountitemshow =number_format($discountitem,0,',','.'); $hargatotal = ($hargabarang * $qty) - $discountitem; }else { $discountitemshow = $discountitem . " % "; $hargatotal = ($hargabarang * $qty) - ($hargabarang * $discountitem/100); } $hasil_rupiahshow =number_format($hargatotal,0,',','.'); @endphp @endforeach @php $totalsub = $p->total; $discall = $p->discount; if ($discall > 100) { $grandtotal = $totalsub - $discall; }else{ $grandtotal = $totalsub - ($totalsub * $discall/100); } @endphp
No Faktur : {{$p->code}} Sales : {{$p->salesman->name}}
Tanggal Penjualan : {{$tanggal}}
Tipe Pembayaran : {{$p->is_paid ? "Cash" : "Credit"}}
No Barcode Nama Barang Harga Qty Total
{{$i++}} {{!empty($item) ? $item->code : '-'}} {{!empty($item) ? $item->name : $details->item_name}} {{!empty($item) ? number_format($item->price,0,',','.') : number_format($details->custom_price,0,',','.')}} {{$details->qty}} {{$hasil_rupiahshow}}
Grand Total : {{number_format($grandtotal,0,',','.')}}
@endforeach @else

Tidak ada data

@endif {{-- {{$jsonencode}} --}}

Dicetak Pada : {{date('d/m/Y')}}