@extends('layouts/fams_layout') @section('title', '| Report') @section('content') @include('successMsg')
{!! Form::open(['url' => 'famsFixedAssetsDepReport','method' => 'get']) !!} @php $userBranchId = Auth::user()->branchId; @endphp @if($userBranchId==1)
{!! Form::label('', 'Project:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Pro. Type:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Branch:', ['class' => 'control-label pull-left']) !!}
@endif
{!! Form::label('', 'Category:', ['class' => 'control-label pull-left']) !!}
{!! Form::label('', 'Pro. Type:', ['class' => 'control-label pull-left']) !!}
{!! Form::label('', 'Search By:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('searchMethod',[''=>'Please Select','1'=>'Fiscal Year','2'=>'Current Year','3'=>'Date Range'],$searchMethodSelected,['id'=>'searchMethod','class'=>'form-control input-sm']) !!}
{!! Form::submit('Search',['id'=>'search','class'=>'btn btn-primary btn-xs','style'=>'font-size:15px;']) !!}
{!! Form::close() !!}
{{-- End Filtering Group --}}

Fixed Assets Depreciation Report

@php if($branchSelected===0){ $selectedBranchName = "All Branches"; } else{ $selectedBranchName = DB::table('gnr_branch')->where('id',$branchSelected)->value('name'); } $selectedProjectName = DB::table('gnr_project')->where('id',$projectSelected)->value('name'); $selectedProjectTypeName = DB::table('gnr_project_type')->where('id',$projectTypeSelected)->value('name'); $selectedCategoryName = DB::table('fams_product_category')->where('id',$categorySelected)->value('name'); @endphp @if(!$firstRequest )

@php $index = 0; $totalCostPrice = 0; $totalDepOpeningBalance = 0; $totalAmount = 0; $totalClosingBalance = 0; @endphp @foreach($products as $key => $product) @php $productCost = (float) $product->totalCost + (float) DB::table('fams_additional_charge')->where('productId',$product->id)->where('purchaseDate','<=',$endDate)->sum('amount'); $depOpeningBalance = (float)$product->depreciationOpeningBalance + (float)DB::table('fams_depreciation_details')->where('productId',$product->id)->where('depTo','<',$startDate)->sum('amount'); $useDays = DB::table('fams_depreciation_details')->where('productId',$product->id)->where('depTo','>=',$startDate)->where('depTo','<=',$endDate)->sum('days'); $currentDep = DB::table('fams_depreciation_details')->where('productId',$product->id)->where('depTo','>=',$startDate)->where('depTo','<=',$endDate)->sum('amount'); @endphp @php $totalCostPrice = $totalCostPrice + $productCost; @endphp @php $totalDepOpeningBalance = $totalDepOpeningBalance + $depOpeningBalance; @endphp @php $totalAmount = $totalAmount + $currentDep; @endphp @php $totalClosingBalance = $totalClosingBalance + $depOpeningBalance+$currentDep; @endphp @endforeach
SL# Purchase Date Product Name Product ID Number Cost Price Dep. Rate(%) Depreciation
Opening Balance Curr. Period Total Dep.
Use Day Amount (TK)
{{$key+1}} {{date('d-m-Y',strtotime($product->purchaseDate))}} {{$product->name}} {{$prefix.$product->productCode}} {{number_format($productCost,2)}}{{$product->depreciationPercentage}} {{number_format($depOpeningBalance,2)}}{{$useDays}} {{number_format($currentDep,2)}}{{number_format($depOpeningBalance+$currentDep,2)}}
Total {{number_format($totalCostPrice,2)}} {{number_format($totalDepOpeningBalance,2)}} {{number_format($totalAmount,2)}} {{number_format($totalClosingBalance,2)}}
@endif
{{-- Filtering Mehod --}} {{-- End Filtering Mehod --}} {{-- Filtering --}}