Пример #1
0
 public function getLastMonthSales()
 {
     $data['num'] = jual::where('tgl', '>=', Carbon::now()->subMonth()->format('Y-m-d'))->where('status', 1)->sum('totnetto');
     $data['num'] = Helpers::currency($data['num'], 0, 'id');
     $data['tgl1'] = Carbon::parse('First day of this month')->format('Y-m-d');
     $data['tgl1'] = Carbon::now()->subMonth()->format('Y-m-d');
     $data['tgl2'] = Carbon::now()->format('Y-m-d');
     return $data;
 }
Пример #2
0
 /**
  * Search all in Penjualan List
  *
  * @return Response
  * @author Y. Brahmantyo A.K
  **/
 public function postSearch(Request $request)
 {
     $jual = jual::where('tgl', '<', '2015-10-05');
     $total = ['totbruto' => $jual->sum('totbruto'), 'totqty' => $jual->sum('totqty'), 'totdiskon' => $jual->sum('totdiskon'), 'totnetto' => $jual->sum('totnetto')];
     return redirect('admin.transaction.penjualan.penjualan', $total)->with('jual', $jual->paginate(Config::get('pages'))->appends('show', Config::get('pages')));
 }