Bill To: Procare Solutions
INVOICE

Date: {{ $sale->created_at ?? '-' }}
@php $subtotal = 0; $totalItemDiscount = 0; foreach ($sale->items as $item) { // Subtotal before discount $subtotal += $item->price * $item->qty; // Sum of item discounts $totalItemDiscount += $item->item_discount ?? 0; } $orderDiscount = $sale->order_discount ?? 0; $totalDiscount = $totalItemDiscount + $orderDiscount; $grandTotal = $subtotal - $totalDiscount; @endphp @foreach ($sale->items as $item) @endforeach
Name Qty Price Discounts Sub total
{{ $item->name }} {{ number_format($item->qty,0) }} PCS ${{ number_format($item->price,2) }} ${{ number_format($item->item_discount,2) }} ${{ number_format($item->subtotal,2) }}
Subtotal ${{ number_format($subtotal,2) }}
Item Discounts ${{ number_format($totalItemDiscount,2) }}
Order Discount ${{ number_format($orderDiscount,2) }}
Total Discount ${{ number_format($totalDiscount,2) }}
Grand Total ${{ number_format($grandTotal,2) }}