@extends('layouts.app') @section('title') {{'Item Wise Purchase Report'}} @endsection @section('content') @include('layouts.numbertowords')
Item Wise Purchase Report Back
@if (Session::has('msg'))
{{ Session::get('msg') }}
@endif
Search Item
Start Date
End Date

 

@include('layouts.head')

Item Wise Purchase Report

{!! date('d-F-Y', strtotime($start_date)) !!} to {!! date('d-F-Y', strtotime($end_date)) !!}

@if (isset( $supplier_list[0]->id) && $supplier_list[0]->id !='') @else @endif

Supplier Name : {{ $supplier_list[0]->id }} - {{ $supplier_list[0]->name }}
Contact Person : {{ $supplier_list[0]->person_name }}
Address : {{ $supplier_list[0]->address }}
Mobile No. : {{ $supplier_list[0]->mobile }}
@php $product_name=""; if(isset($_GET['id']) && $_GET['id'] != "All"){ foreach($item_info as $val){ if($val->id == $_GET['id']){ $product_name = $val->id ."-".$val->product_name; break; } } } @endphp
Item Name : {{ isset($_GET['id']) && $_GET['id'] == "All" ? "All" : $product_name }}
@php $total = 0; $g_torder_quantity = 0; $g_t_quantity = 0; $g_t_total_price = 0; $i = 1; @endphp @foreach($department_info as $product_name => $dept) @php $sub_grand_qty = 0; $sub_grand_total = 0; @endphp @foreach($dept as $invoice_id => $catrow) @php unset($product_quantity); $product_id = explode(',',$catrow->product_id); $product_qty = explode(',',$catrow->product_qty); $product_information = []; foreach ($product_id as $k => $v) { $product_quantity[$v] = 0; $product_information[$v] = $product_qty[$k]; } foreach ($product_id as $k => $v) { $product_quantity[$v] += @$product_qty[$k]; } @endphp @php $torder_quantity = 0; $t_quantity = 0; $t_total_price = 0; foreach($product_info as $row) { // print_r($product_information[$row->product_id]); // print_r($row->product_id); // exit(); $product_qty = isset($product_information[$row->product_id]) ? $product_information[$row->product_id] : 0; //$product_qty = $product_information[$row->product_id]; $product_id = $row->product_id; $product_name = $row->product_name; $pack_type = $row->pack_type; $dp_price = $row->dp_price; $total = $product_qty; $total_value = $total * $dp_price; if($total >0){ $avg_price = $total_value / $total; }else{ $avg_price = ""; } if(isset($product_quantity[$product_id]) && $catrow->invoice_id == $row->invoice_id) { $torder_quantity = $product_qty; $t_quantity += $total; $t_total_price += $total_value; echo ''; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ''; } } $g_torder_quantity += $torder_quantity; $g_t_quantity += $t_quantity; $g_t_total_price += $t_total_price; $sub_grand_qty += $torder_quantity; $sub_grand_total += $t_total_price; @endphp @endforeach @endforeach
S.L. Date Voucher Supplier Name Purchase Quantity Purchase Price Total
Item Name: {{$product_name}}
'. $i++ .''. date('d-F-Y', strtotime($catrow->txn_date)) .'PI#'. $catrow->invoice_id .''. $catrow->supp_name .''. $product_qty .''. number_format($avg_price,2) .''. number_format($total_value,2) .'
Sub Total = {!! number_format($sub_grand_qty) !!} {!! number_format($sub_grand_total,2) !!}
Grand Total = {!! number_format($g_torder_quantity) !!} {{ number_format($g_t_total_price,2) }}
IN WORDS : {!! numberTowords($g_t_total_price) !!}
@endsection