@if($purchases->isEmpty() && $production->isEmpty() && $sales->isEmpty())
No data found for the selected filters.
@else
| Date |
Supplier |
Quantity (Bags) |
Price per Bag |
Total Amount |
@foreach($purchases as $purchase)
| {{ $purchase->created_at->format('d M Y') }} |
{{ $purchase->supplier->name }} |
{{ number_format($purchase->total) }} |
{{ number_format($purchase->bought_price, 2) }} |
{{ number_format($purchase->bought_price * $purchase->total, 2) }} |
@endforeach
| Total Purchases |
{{ number_format($purchases->sum('total')) }} |
{{ number_format($purchases->sum('bought_price'), 2) }} |
{{ number_format($purchases->sum(function($item) {
return $item->bought_price * $item->total;
}), 2) }} |
| Date |
Cement (Bags) |
Good Bricks |
Status |
@php
$totalCement = 0;
$totalBricks = 0;
@endphp
@foreach($production as $prod)
@php
$stock_bricks = App\Models\StockBrick::where('stock_id', $prod->id)->first();
$bricks_produced = $stock_bricks ? $stock_bricks->total_bricks_without_fault : 0;
$status = $stock_bricks && $stock_bricks->expected_output != 0
? 'Actual Output Not Given'
: '';
$totalCement += $prod->total;
$totalBricks += $bricks_produced;
@endphp
| {{ $prod->created_at->format('d M Y') }} |
{{ number_format($prod->total) }} |
{{ number_format($bricks_produced) }} |
{{ $status }} |
@endforeach
| Total Cement Used: |
{{ number_format($totalCement) }} bags |
| Total Good Bricks: |
{{ number_format($totalBricks) }} |
| Date |
Quantity (Bags) |
Unit Price |
Total Amount |
@php
$totalQuantity = 0;
$totalAmount = 0;
$totalUnitPrice = 0;
@endphp
@foreach($sales as $sale)
@php
$unitPrice = str_replace(',', '', $sale->selling_price);
$saleAmount = $sale->quantity * $unitPrice;
$totalQuantity += $sale->quantity;
$totalAmount += $saleAmount;
$totalUnitPrice += $unitPrice;
@endphp
| {{ \Carbon\Carbon::parse($sale->created_at)->format('d M Y') }} |
{{ number_format($sale->quantity) }} |
{{ number_format($unitPrice, 2) }} |
{{ number_format($saleAmount, 2) }} |
@endforeach
| Total Sales |
{{ number_format($totalQuantity) }}
|
{{ number_format($totalUnitPrice, 2) }}
|
{{ number_format($totalAmount, 2) }}
|
Stock Movement
| Opening Stock (as of {{ $startDate->format('d M Y') }}) |
{{ number_format($openingStock ?? 0) }} bags |
| Total Purchased |
{{ number_format($purchases->sum('total')) }} bags |
| Total Used in Production |
{{ number_format($production->sum('total')) }} bags |
| Total Sold |
{{ number_format($sales->sum('quantity')) }} bags |
| Closing Stock (as of {{ $endDate->format('d M Y') }}) |
{{ number_format($closingStock ?? 0) }} bags |
Stock Value
| Average Purchase Rate |
{{ number_format($averageRate ?? 0, 2) }} per bag |
| Average Sale Rate |
{{ number_format($averageSaleRate ?? 0, 2) }} per bag |
| Current Stock Value |
{{ number_format(($closingStock ?? 0) * ($averageRate ?? 0), 2) }}
|
@endif
@endsection
@section('scripts')
@endsection