@extends('admin.layouts.app')
@section('title', 'Purchase Return Report')
@push('styles')
@endpush
@section('container')
@if (session('success'))
{{ session('success') }}
@endif
@if (session('error'))
{{ session('error') }}
@endif
@if(count($purchases)>0)
| SL |
Date |
Supplier |
Invoice No. |
Total Quantity |
@php
$total = 0;
@endphp
@foreach ($purchases as $key => $data)
@php
$subtotal = 0;
$purchaseOrderDetails = \App\Models\PurchaseOrderDetail::where('purchase_order_id',$data->id)->get();
foreach ($purchaseOrderDetails as $purchaseOrderDetail){
$unit = \App\Models\Unit::where('id',$purchaseOrderDetail->unit_id)->first();
$total += $unit->quantity * $purchaseOrderDetail->quantity;
$subtotal += $unit->quantity * $purchaseOrderDetail->quantity;
}
@endphp
| {{ $loop->iteration }} |
{{ date('d-m-Y',strtotime($data->date)) }} |
{{ $data->supplier->name??'' }} |
{{ $data->purchase_no }} |
{{ number_format($subtotal, 2) }} |
@endforeach
| Total |
{{ number_format($total, 2) }} |
@endif
@endsection
@push('scripts')
@endpush