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

 

@include('layouts.head')

Item Wise Sales 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->product_id == $_GET['id']){ $product_name = $val->product_id ."-".$val->product_name; break; } } } @endphp
Item Name : {{ isset($_GET['id']) && $_GET['id'] == "All" ? "All" : $product_name }}
@php $i = 1; $total = 0; $g_torder_quantity = 0; $g_t_total_price = 0; $grand_torder_quantity =0; $grand_total_price =0; $grand_total_commission_tk =0; $grand_total_value =0; @endphp @foreach($department_info as $product_name => $dept) @php $sub_grand_qty = 0; $sub_grand_total = 0; $sub_grand_commission_tk =0; $sub_grand_total_value =0; @endphp @foreach($dept as $sales_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 $sub_torder_quantity = 0; $sub_total_price = 0; $sub_commission_tk = 0; $sub_total_value = 0; //print_r ($product_info); exit(); 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; $tp_price = $row->tp_price; $commission = $row->commission; $total = $product_qty; $amount = $total * $tp_price; $commission_tk = ($amount * $commission)/100; $total_value = $amount - $commission_tk; if(isset($product_quantity[$product_id]) && $row->sales_id == $catrow->sales_id) { $sub_torder_quantity += $product_qty; $sub_commission_tk += $commission_tk; $sub_total_price += $amount; $sub_total_value += $total_value; echo ''; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ''; } } $sub_grand_qty += $sub_torder_quantity; $sub_grand_total += $sub_total_price; $sub_grand_commission_tk += $sub_commission_tk; $sub_grand_total_value += $sub_total_value; $grand_torder_quantity += $sub_torder_quantity; $grand_total_price += $sub_total_price; $grand_total_commission_tk += $sub_commission_tk; $grand_total_value += $sub_total_value; @endphp @endforeach @endforeach
S.L. Date Voucher Customer Name Sales Quantity Sales Price Amount Comm. % Comm. Tk. Total
Item Name: {{$product_name}}
'. $i++ .''. date('d-F-Y', strtotime($catrow->txn_date)) .'PI#'. $catrow->sales_id .''. $catrow->supp_name .''. $product_qty .''. $tp_price .''. number_format($amount,2) .''. $commission .''. number_format($commission_tk,2) .''. number_format($total_value,2) .'
Sub Total = {!! number_format($sub_grand_qty) !!} {!! number_format($sub_grand_total,2) !!} {!! number_format($sub_grand_commission_tk,2) !!} {!! number_format($sub_grand_total_value,2) !!}
Grand Total = {!! number_format($grand_torder_quantity) !!} {{ number_format($grand_total_price,2) }} {{ number_format($grand_total_commission_tk,2) }} {{ number_format($grand_total_value,2) }}
IN WORDS : {!! numberTowords($grand_total_value) !!}
@endsection