Advertisement
Slivia

laravel

Oct 30th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. $report = DB::table('acc_cash')
  2. ->whereBetween('acc_date', [$from_date, $till_date])
  3. ->where('acc_head', 'LIKE', "%". $head_name)
  4. ->orderBy('acc_date', 'ASC')
  5. ->get();
  6.  
  7. $reportSum = DB::table('acc_cash')
  8. ->whereBetween('acc_date', [$from_date, $till_date])
  9. ->where('acc_head', 'LIKE', "%". $head_name)
  10. ->orderBy('acc_date', 'ASC')
  11. ->sum('cash_amount');
  12.  
  13. #dd($report);
  14. return view('pages.accounts.reports.reportExpenses')->with('report', $report)->with('accHead', $accHead)->with('reportSum', $reportSum);
  15.  
  16.  
  17. <tbody>
  18. @if(isset($report))
  19. <?php $count =0; $sum=0; ?>
  20. @foreach($report as $rep)
  21. <?php ++$count; ?>
  22. <tr class="odd gradeX">
  23. <td class="center">{{$count}}</td>
  24. <td class="center">{{$rep->acc_date}}</td>
  25. <td class="center">{{$rep->pay_id}}</td>
  26. <td class="center">{{number_format($rep->cash_amount, 0)}}</td>
  27. <td class="center">{{ucwords($rep->acc_head)}}</td>
  28. <td class="center">{{ucwords($rep->acc_note)}}</td>
  29.  
  30. </tr>
  31.  
  32. @endforeach
  33. @endif
  34.  
  35. <tr>
  36.  
  37. <td class="center"></td>
  38. <td class="center"></td>
  39. <td class="center">Total: </td>
  40. <td class="center" > {{ $reportSum }}</td>
  41. <td class="center"></td>
  42. <td class="center"></td>
  43. </tr>
  44.  
  45. </tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement