Esempio n. 1
0
 /**
  * Show the form for creating a new loanproduct
  *
  * @return Response
  */
 public function create()
 {
     $accounts = Account::all();
     $currencies = Currency::all();
     $charges = DB::table('charges')->where('category', '=', 'loan')->get();
     return View::make('loanproducts.create', compact('accounts', 'charges', 'currencies'));
 }
Esempio n. 2
0
 public static function balanceSheet($date)
 {
     $accounts = Account::all();
     $organization = Organization::find(1);
     $pdf = PDF::loadView('pdf.financials.balancesheet', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
     return $pdf->stream('Balance Sheet.pdf');
 }
Esempio n. 3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     // return Response::json(array('index' => 'cuentas 2'));
     $accounts = Account::all();
     return View::make('cuentas.index')->with('cuentas', $accounts);
 }
 /**
  * Show the form for creating a new savingproduct
  *
  * @return Response
  */
 public function create()
 {
     $accounts = Account::all();
     $charges = Charge::all();
     $currencies = Currency::all();
     return View::make('savingproducts.create', compact('accounts', 'charges', 'currencies'));
 }
 /**
  * Revert the changes to the database.
  *
  * @return void
  */
 public function down()
 {
     $accounts = Account::all();
     foreach ($accounts as $account) {
         $account->delete();
     }
 }
 public function run()
 {
     $faker = $this->getFaker();
     $accounts = Account::all();
     foreach ($accounts as $account) {
         for ($i = 0; $i < rand(-1, 5); $i++) {
             Order::create(["account_id" => $account->id]);
         }
     }
 }
 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     //
     $accounts = Account::all();
     foreach ($accounts as $account) {
         for ($i = 0; $i < 2; $i++) {
             $l = new Location();
             $l->address = "123 fake St.";
             $l->city = "Vancouver";
             $l->postal_code = "V8V3X4";
             $l->account_id = $account->id;
             $l->save();
         }
     }
 }
 /**
  * Make changes to the database.
  *
  * @return void
  */
 public function up()
 {
     //
     $accounts = Account::all();
     foreach ($accounts as $account) {
         for ($i = 1; $i <= 5; $i++) {
             $location = new Location();
             $location->address = "{$i} blah St.";
             $location->city = "Vancouver";
             $location->postal_code = "v8v2v3";
             $location->account_id = $account->id;
             $location->save();
         }
     }
 }
Esempio n. 9
0
 public function financials()
 {
     $report = Input::get('report_type');
     $date = Input::get('date');
     $accounts = Account::all();
     $organization = Organization::find(1);
     if ($report == 'balancesheet') {
         $pdf = PDF::loadView('pdf.financials.balancesheet', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Balance Sheet.pdf');
     }
     if ($report == 'income') {
         $pdf = PDF::loadView('pdf.financials.incomestatement', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Income Statement.pdf');
     }
     if ($report == 'trialbalance') {
         $pdf = PDF::loadView('pdf.financials.trialbalance', compact('accounts', 'date', 'organization'))->setPaper('a4')->setOrientation('potrait');
         return $pdf->stream('Trial Balance.pdf');
     }
 }
Esempio n. 10
0
 /**
  * Setup data
  *
  * @return null
  */
 private static function _seed()
 {
     $database = self::_database();
     User::all()->destroy();
     Bill::all()->destroy();
     Ticket::all()->destroy();
     Tocket::all()->destroy();
     Account::all()->destroy();
     $user = new User();
     $user->id = 1;
     $user->name = "Eustaquio Rangel";
     $user->email = "*****@*****.**";
     $user->code = "12345";
     $user->user_level = 1;
     $user->save();
     $user = new User();
     $user->id = 2;
     $user->name = "Rangel, Eustaquio";
     $user->email = "*****@*****.**";
     $user->code = "54321";
     $user->user_level = 2;
     $user->save();
     for ($i = 1; $i <= 10; $i++) {
         $bill = new Bill();
         $bill->id = $i;
         $bill->user_id = 1;
         $bill->description = "Bill #{$i}";
         $bill->value = $i;
         $bill->save();
         $ticket = new Ticket();
         $ticket->user_id = 1;
         $ticket->description = "Just another ticket";
         $ticket->save();
     }
     $account = new Account();
     $account->user_id = 1;
     $account->account_number = "12345";
     $account->save();
     $account = new Account();
     $account->user_id = 2;
     $account->account_number = "54321";
     $account->save();
 }
Esempio n. 11
0
 /**
  * Show the form for editing the specified paymentmethod.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $paymentmethod = Paymentmethod::find($id);
     $accounts = Account::all();
     return View::make('paymentmethods.edit', compact('paymentmethod', 'accounts'));
 }
Esempio n. 12
0
 /**
  * Show the form for creating a new journal
  *
  * @return Response
  */
 public function create()
 {
     $accounts = Account::all();
     return View::make('journals.create', compact('accounts'));
 }
Esempio n. 13
0
 /**
  * Display a listing of branches
  *
  * @return Response
  */
 public function index()
 {
     $accounts = Account::all();
     return View::make('payroll.index', compact('accounts'));
 }
Esempio n. 14
0
 public function update_later_balance()
 {
     $transactions = self::later_than($this)->get();
     foreach ($transactions as $key => $t) {
         $total = 0;
         $pre = self::earlier_than($t)->first();
         if (is_null($pre)) {
             $total = $t->amount;
         } else {
             $total = $t->amount + $pre->balance->total_amount;
         }
         $t->balance->total_amount = $total;
         $t->balance->save();
     }
     $accounts = Account::all();
     foreach ($accounts as $key => $account) {
         $transactions = self::later_than($this)->where_account_id($account->id)->get();
         foreach ($transactions as $key => $t) {
             $balance = 0;
             $pre = self::earlier_than($t)->where_account_id($t->account_id)->first();
             if (is_null($pre)) {
                 $balance = $t->amount;
             } else {
                 $balance = $t->amount + $pre->balance->balance_amount;
             }
             $t->balance->balance_amount = $balance;
             $t->balance->save();
         }
     }
 }
Esempio n. 15
0
 /**
  * Show the form for creating a new stock
  *
  * @return Response
  */
 public function create()
 {
     $items = Item::all();
     $accounts = Account::all();
     return View::make('purchases.create', compact('items', 'accounts'));
 }
Esempio n. 16
0
 /**
  * Set up tests
  *
  * @return null
  */
 public function setUp()
 {
     Account::all()->destroy();
 }
Esempio n. 17
0
 public function index()
 {
     $account = Account::all();
     return View::make('Admin/pages/account/allAccount', compact('account'));
 }
Esempio n. 18
0
 /**
  * Display a listing of the resource.
  * This route will be called automatically on a GET on the base path
  *
  * @return Response
  */
 public function index()
 {
     $accounts = Account::all();
     return Response::json($accounts);
 }
Esempio n. 19
0
 protected function cleanAccountsTable()
 {
     foreach (Account::all() as $account) {
         $account->delete();
     }
 }
Esempio n. 20
0
 /**
  * Show the form for editing the specified expense.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $expense = Expense::find($id);
     $accounts = Account::all();
     return View::make('expenses.edit', compact('expense', 'accounts'));
 }
Esempio n. 21
0
 public function payment($id)
 {
     $order = Order::findOrFail($id);
     $accounts = Account::all();
     return View::make('orders.payment', compact('order', 'accounts'));
 }