Example #1
0
 /**
  * Get a list of accounts
  *
  * @return static
  */
 public function getList()
 {
     $accounts = $this->account->all();
     $response = $accounts->map(function ($item) {
         return ["id" => $item->id, "name" => $item->name];
     });
     return $response;
 }
 public function stores()
 {
     $accounts = Account::all();
     $data = array();
     foreach ($accounts as $account) {
         $customers = Customer::where('account_id', $account->id)->get();
         $account_children = array();
         foreach ($customers as $customer) {
             $areas = Area::where('customer_id', $customer->id)->get();
             $customer_children = array();
             foreach ($areas as $area) {
                 $regions = Region::where('area_id', $area->id)->get();
                 $area_children = array();
                 foreach ($regions as $region) {
                     $distributors = Distributor::where('region_id', $region->id)->get();
                     $region_children = array();
                     foreach ($distributors as $distributor) {
                         $stores = Store::where('distributor_id', $distributor->id)->get();
                         $distributor_children = array();
                         foreach ($stores as $store) {
                             $distributor_children[] = array('title' => $store->store, 'key' => $account->id . "." . $customer->id . "." . $area->id . "." . $region->id . "." . $distributor->id . "." . $store->id);
                         }
                         $region_children[] = array('select' => true, 'title' => $distributor->distributor, 'isFolder' => true, 'key' => $account->id . "." . $customer->id . "." . $area->id . "." . $region->id . "." . $distributor->id, 'children' => $distributor_children);
                     }
                     $area_children[] = array('select' => true, 'title' => $region->region, 'isFolder' => true, 'key' => $account->id . "." . $customer->id . "." . $area->id . "." . $region->id, 'children' => $region_children);
                 }
                 $customer_children[] = array('select' => true, 'title' => $area->area, 'isFolder' => true, 'key' => $account->id . "." . $customer->id . "." . $area->id, 'children' => $area_children);
             }
             $account_children[] = array('select' => true, 'title' => $customer->customer, 'isFolder' => true, 'key' => $account->id . "." . $customer->id, 'children' => $customer_children);
         }
         $data[] = array('title' => $account->account, 'isFolder' => true, 'key' => $account->id, 'children' => $account_children);
     }
     return response()->json($data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     if (Gate::denies('account.read')) {
         return view(config('app.template') . '.error.403');
     }
     $accounts = Account::all();
     $data = ['accounts' => $accounts, 'states' => Account::$data_states, 'types' => Account::$types];
     return view(config('app.template') . '.account.table', $data);
 }
Example #4
0
 public function retrieve()
 {
     $status = FALSE;
     DB::connection()->enableQueryLog();
     try {
         $data['users'] = App\Account::all();
         $status = TRUE;
     } catch (Exception $e) {
         Log::info($e->getMessage());
     }
     Log::info(json_encode(DB::getQueryLog()));
     $data['status'] = $status;
     return $data;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $login = Login::where('remember_token', '=', $request->header('token'))->where('login_from', '=', $request->ip())->join('members', 'members.id', '=', 'logins.member_id')->where('logins.status', '=', '1')->first();
     $stockTypes = StockType::all();
     $limitOrders = LimitOrder::all();
     if ($login->mtype == 1) {
         $stocks = Stock::orderBy('stockTypeId')->get();
         if (count($stocks) > 0) {
             foreach ($stocks as $stock) {
                 $clientStocks = ClientStock::where('stockId', '=', $stock->id)->where('status', '=', 0)->get();
                 $stock->request = $clientStocks;
                 //$stockProducts = AddProduct::sum('quantity')->where('stockId',$stock->id);
                 $stock->quantity = AddProduct::where('stockId', $stock->id)->sum('quantity');
                 $data[] = $stock;
             }
         } else {
             $data = $stocks;
         }
         $clientStocks = ClientStock::all();
         $clientAccounts = Account::all();
     } else {
         $stocks = Stock::orderBy('stockTypeId')->where('stockTypeId', 3)->get();
         if (count($stocks) > 0) {
             foreach ($stocks as $stock) {
                 $stock->quantity = AddProduct::where('stockId', $stock->id)->sum('quantity');
                 $data[] = $stock;
             }
         } else {
             $data = $stocks;
         }
         $clientStocks = ClientStock::where('memberId', $login->member_id)->get();
         $clientAccounts = Account::where('memberId', $login->member_id)->get();
     }
     $returnData = array('status' => 'ok', 'stocks' => $data, 'stockTypes' => $stockTypes, 'clientStocks' => $clientStocks, 'limitOrders' => $limitOrders, 'clientAccounts' => $clientAccounts, 'code' => 200);
     return $returnData;
 }
 /**
  *
  *	Description: Get All Accounts 
  *	Component: InvestMain
  *
  */
 public function getAllAccounts()
 {
     $accounts = Account::all();
     return $accounts;
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $accounts = Account::all();
     return view('user.index', compact('accounts'));
 }
 public function getIndex()
 {
     $cuentas = DB::table('accounts')->join('transactions', 'accounts.id', '=', 'transactions.account_id')->join('nomenclators', 'transactions.nomenclator_id', '=', 'nomenclators.id')->select('accounts.id', 'montoDebe', 'montoHaber', 'glosa', 'accounts.created_at', 'tipo', 'nomenclator_id', 'monto', 'cuenta')->get();
     $folios = Account::all();
     return view('layouts.main', compact('cuentas', 'leng', 'folios'));
 }
Example #9
0
 public function searchAllAccount()
 {
     return response()->json(Account::all());
 }
Example #10
0
 public function accounts()
 {
     $accs = Account::all();
     $title = "ACCOUNTS";
     return \PDF::loadHTML(view('reports.account_template', compact('accs', 'title')))->stream('report.pdf');
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $accounts = Account::all();
     return $accounts;
 }
Example #12
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $accs = Account::all();
     return view('admin.account.index', compact('accs'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return Account::all();
 }