@foreach ( $items as $report ) @php $amount = $report->perday_amount * $report->amountday; $discounted = $report->perday_amount * $report->discount_day; $discount += $discounted; $costs += $report->principal; //($report->principal + $report->interest) - $report->perday_amount; $sales += $amount; if($report->product_group == 1 || $report->product_group == 2){ $goldweight += $report->weight; } @endphp @endforeach
รายงานยอดขาย
ประจําเดือน : {{ $monthly }} สาย : {{ $careers }}
วันที่ เลขที่สัญญา ชื่อ/สกุล ยอดขาย ส่วนลด คงเหลือ
{{ $report->first_date }} {{ $report->contract_no }} {{ $report->name }} {{ nb($amount,2)}} {{ nb($discounted,2) }} {{nb( $amount - $discounted ,2) }}
นำหนักทอง: {{ $goldweight }} บาท ยอดขาย: {{ nb($sales,2) }} บาท
ต้นทุน: {{ nb($costs,2) }} บาท ส่วนลด: {{ nb($discount,2) }} บาท
ลูกค้าเก่า: ลูกค้าใหม่: