@php $faktur = $data; // for ($i=0; $i < count($data->transaction_details); $i++) { // $details [] = $data->transaction_details[$i]; // $itemlist [] = $data->transaction_details[$i]->item; // } @endphp @php if ($from === 'null') { $tgl = 'Semua'; }else{ $tgl = date('d/m/Y',strtotime($from)).' s/d '.date('d/m/Y',strtotime($to)); } @endphp
{{$title}}

Sales : {{$datasales ? $datasales->name : $faktur[0]->salesman->name}}

Periode : {{$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; $jsonencode = json_encode($details); $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}} Pelanggan : {{$p->customer->name}}
Tanggal Penjualan : {{$tanggal}}
Tipe Pembayaran : {{$p->is_paid ? "Cash" : "Credit"}}
No Kode Barang Nama Barang Harga Barang Qty Discount Barang 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}} {{$details->discount ? $details->discount : '-'}} {{$hasil_rupiahshow}}
Grand Total : {{number_format($grandtotal,0,',','.')}}
{{--

{{$jsonencode}}

--}} @endforeach @else

Tidak Ada Data

@endif

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