@foreach ($lims_product_sale_data as $key => $product_sale) @php $product = DB::table('products')->find($product_sale->product_id); if(!$product) continue; $qty = $product_sale->qty - $product_sale->return_qty; $tax = DB::table('taxes')->where('rate', $product_sale->tax_rate)->first(); $unit = DB::table('units')->find($product_sale->sale_unit_id); @endphp