@php $jsonencode = json_encode($purchasedetails); $tanggal = date('d/m/Y',strtotime($data->created_at)); @endphp @php $jenis = $data->is_paid; $total = $data->total; $discount = $data->discount; if ($discount > 100) { $discountshow =number_format($discount,0,',','.'); $totalall = $total - $discount; }else { $discountshow = $discount . " %"; $totalall = $total - ($total * $discount/100); } $hasil_rupiah =number_format($totalall,0,',','.'); if ($jenis) { $trans = "Cash"; }else { $trans = "Credit"; } $hargabarang = $datadetail->custom_price; $qty = $datadetail->qty; $discountitem = $datadetail->discount; if ($discountitem > 100) { $discountitemshow =number_format($discountitem,0,',','.'); $hargatotal = ($hargabarang * $qty) - $discountitem; }else { $discountitemshow = $discountitem . " % "; $hargatotal = ($hargabarang * $qty) - ($hargabarang * $discountitem/100); } $hargabarangshow =number_format($datadetail->custom_price,0,',','.'); $hasil_rupiahshow =number_format($hargatotal,0,',','.'); $totalshow =number_format($total,0,',','.'); @endphp
Periode : {{$tanggal}}
No Pembelian : {{$data->code}} No Bon : {{$data->bon_number}}| Tipe Pembayaran : {{$trans}} |
||||||||
| No | Nama Barang | Kode Barang | Harga Barang | Qty | Discount Barang | Total | ||
|---|---|---|---|---|---|---|---|---|
| ".$number." | "; echo "".$details[$i]->name." | "; echo "".$details[$i]->code." | "; echo "".number_format($details[$i]->price,0,',','.')." | "; echo "".$purchasedetails[$i]->qty." | "; if ($purchasedetails[$i]->discount > 100) { echo "".number_format($purchasedetails[$i]->discount,0,',','.')." | "; echo "".number_format((($purchasedetails[$i]->custom_price * $purchasedetails[$i]->qty)-$purchasedetails[$i]->discount),0,',','.')." | "; }else{ echo "".$purchasedetails[$i]->discount." % | "; echo "".number_format((($purchasedetails[$i]->custom_price * $purchasedetails[$i]->qty)-($purchasedetails[$i]->custom_price*$purchasedetails[$i]->discount/100)),0,',','.')." | "; } echo "
| Total All: | {{$totalshow}} | |||||||
| Discount All: | {{$discountshow}} | |||||||
| Total : | {{$hasil_rupiah}} | |||||||
{{$jsonencode}}
--}}Dicetak Pada : {{date('d/m/Y')}}