@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 )
Ambala Foundation
House # 62, Block # Ka, Piciculture Housing Society, Shyamoli, Dhaka-1207
Fixed Assets Purchase Report
{{--
{{$selectedBranchName}}
--}}
{{date('F d, Y',strtotime($endDate))}}
Branch Name : @php
if($selectedBranchName==null){
echo "All";
}
else{
echo $selectedBranchName;
}
@endphp
Reporting Peroid : {{date('d-m-Y',strtotime($startDate))." to ".date('d-m-Y',strtotime($endDate))}}
Project Name : @php
if($selectedProjectName==null){
echo "All";
}
else{
echo $selectedProjectName;
}
@endphp
Assets Category : @php
if($selectedCategoryName==null){
echo "All";
}
else{
echo $selectedCategoryName;
}
@endphp
Project Type : @php
if($selectedProjectTypeName==null){
echo "All";
}
else{
echo $selectedProjectTypeName;
}
@endphp
Print Date : {{date('F d,Y')}}
| SL# |
Purchase Date |
Branch |
Product Name |
Product ID |
Quantity |
Amount (Tk) |
@php
$totalQuantity = 0;
$totalAmount = 0;
@endphp
@foreach($branchId as $branch2)
@php
$subTotalQuantity = 0;
$subTotalAmount = 0;
$purchases = DB::table('fams_purchase')->where('branchId',$branch2)->where('purchaseDate','>=',$startDate)->where('purchaseDate','<=',$endDate)->whereIn('productId',$filteredProduct)/*->whereNotIn('productId',$result)*/->orderBy('purchaseDate','asc')->get();
$hasData = (int) DB::table('fams_purchase')->where('branchId',$branch2)->where('purchaseDate','>=',$startDate)->where('purchaseDate','<=',$endDate)->whereIn('productId',$filteredProduct)/*->whereNotIn('productId',$result)*/->orderBy('purchaseDate','asc')->value('id');
//echo $hasData."
";
@endphp
@if($hasData>0)
@foreach($purchases as $key => $purchase)
@php
$branchName = DB::table('gnr_branch')->where('id',$purchase->branchId)->value('name');
$productNameId = (int) DB::table('fams_product')->where('id',$purchase->productId)->value('productNameId');
$productName = DB::table('fams_product_name')->where('id',$productNameId)->value('name');
$productCode = DB::table('fams_product')->where('id',$purchase->productId)->value('productCode');
@endphp
| {{$key+1}} |
{{date('d-m-Y',strtotime($purchase->purchaseDate))}} |
{{$branchName}} |
{{$productName}} |
{{$prefix.$productCode}} |
{{$purchase->quantity}} |
@php $subTotalQuantity = $subTotalQuantity + $purchase->quantity; @endphp
{{number_format($purchase->costPrice,2)}} |
@php $subTotalAmount = $subTotalAmount + $purchase->costPrice; @endphp
@endforeach
| Sub Total |
{{$subTotalQuantity}} |
{{number_format($subTotalAmount,2)}} |
@php $totalQuantity = $totalQuantity + $subTotalQuantity; @endphp
@php $totalAmount = $totalAmount + $subTotalAmount; @endphp
@endif
@endforeach
| Total |
{{$totalQuantity}} |
{{number_format($totalAmount,2)}} |
@endif