@extends('layouts.admin') @push('styles') @endpush @section('content')
Refresh

Daily Purchase Report

@if (!empty($reportData)) @php $sl = 1; $totalQuantity = 0; $totalAmount = 0; @endphp @foreach ($reportData as $key => $stock) @php $lastPrice = Helper::lastPrice(['product_id' => $stock->product_id]); if(empty($lastPrice)){ $lastPrice = Helper::lastPrice2(['id' => $stock->product_id]); } $avgPrice = Helper::avgPrice(['product_id' => $stock->product_id]); if(empty($avgPrice)){ $avgPrice = $lastPrice; } $previousPrice = Helper::previousPrice(['product_id' => $stock->product_id]); $quantity = (float) $stock->quantity; $quantityFormatted = number_format($stock->quantity, 3, '.', ','); $totalAmount += ($stock->quantity * $stock->rate); $totalQuantity += $stock->quantity; @endphp @endforeach @endif
SL Date Product Name Unit Use Qty Pur. Price Total Amt.
{{$sl++}} {{ Helper::dateFormate($stock->purDate)}} {{$stock->product_name}} {{$stock->unit_name}} {{$quantityFormatted}} {{$stock->rate}} {{number_format($quantity * $stock->rate,2)}}
Total Quantity {{$totalQuantity}} Total Amount {{$totalAmount}}
@endsection @push('scripts') @endpush