@extends('layouts.main') @section('content')

Cement Sales Report

{{-- FILTER --}}
{{-- ✅ ADDED: WORKSTATION DROPDOWN --}}
{{-- EXPORT BUTTONS --}} {{-- /EXPORT BUTTONS --}}
{{-- SALES TABLE --}}
Cement Sales
@foreach($sales as $s) @php // Ensure these are numeric when displayed $buy = (float) str_replace(',', '', (string)($s->buying_price ?? 0)); $sell = (float) str_replace(',', '', (string)($s->selling_price ?? 0)); @endphp @endforeach
Date Payment Mode Qty Buying Selling Revenue Profit
{{ optional($s->created_at)->format('d M Y') }} {{ ucfirst($s->payment_mode) }} {{ number_format($s->quantity) }} {{ number_format($buy, 2) }} {{ number_format($sell, 2) }} {{ number_format($s->revenue, 2) }} {{ number_format($s->profit, 2) }}
{{-- PROFIT & LOSS --}}
Profit & Loss Summary
Total Quantity
{{ number_format($pl['qty']) }} Bags
Total Cost
{{ number_format($pl['cost'], 2) }}
Total Revenue
{{ number_format($pl['revenue'], 2) }}
Net Profit
{{ number_format($pl['profit'], 2) }}
Cash Sales {{ number_format($pl['cash'], 2) }}
Loan Sales {{ number_format($pl['loan'], 2) }}
Creditor Sales {{ number_format($pl['creditor'], 2) }}
Total Revenue {{ number_format($pl['revenue'], 2) }}
Net Profit {{ number_format($pl['profit'], 2) }}
@endsection @section('scripts') @endsection