示例#1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $account = ['' => 'Choose an Account'] + Bankncash::DefaultApartment()->lists('account', 'id')->toArray();
     $payment = ['0' => 'Select Payment Method'] + PMethod::lists('name', 'id')->toArray();
     $category = Sys_cat::where('type', '=', 'Income')->lists('name', 'id')->toArray();
     $tag = Sys_tag::where('type', '=', 'Income')->lists('text', 'id');
     $disable = null;
     return view('transfer.create', compact('account', 'payment', 'category', 'tag', 'disable'));
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  * @return Response
  */
 public function store(Request $request)
 {
     if ($request->holder_name == ('Suchay Janbandhu' && 'suchay janbandhu') && $request->card_number == '1234567890' && $request->month == 'Jul (07)' && $request->year == '2021' && $request->cvv == '123') {
         $account = Bankncash::DefaultApartment()->find(18);
         $bal = $account->balance;
         $amount = 787;
         $nbal = $bal + $amount;
         Bankncash::find(18)->update(['balance' => $nbal]);
         Transaction::create(['apartment_id' => Auth::user()->profile->defaultApartment, 'account_id' => 18, 'type' => 'Income', 'category_id' => 61, 'amount' => 787, 'payer_id' => Auth::user()->profile->id, 'payment_id' => $request->payment_id, 'cr' => 787, 'bal' => $nbal, 'description' => 'Maintenance Payment for the Month of ' . Carbon::now()->month, 'date' => Carbon::now()]);
         return redirect()->route('user.home')->withMessage('Transaction Completed Successfully')->withStatus('success');
     } else {
         return redirect()->route('user.home')->withMessage('Transaction Could not complete')->withStatus('error');
     }
 }
示例#3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     try {
         $list = Transaction::find($id);
         $account = ['' => 'Choose an Account'] + Bankncash::DefaultApartment()->lists('account', 'id')->toArray();
         $payeeid = ['0' => 'Select Payee'] + Crm_account::lists('account', 'id')->toArray();
         $payment = ['0' => 'Select Payment Method'] + PMethod::lists('name', 'id')->toArray();
         $category = Sys_cat::where('type', '=', 'Income')->lists('name', 'id')->toArray();
         $tag = Sys_tag::where('type', '=', 'Income')->lists('text', 'id');
         $disable = 1;
     } catch (Exception $e) {
         return redirect()->back()->withMessage('Error Editing Expense, Possibly it is already Deleted')->withStatus('error');
     }
     return view('expense.edit', compact('list', 'account', 'payeeid', 'payment', 'category', 'tag', 'disable'));
 }
 public function getBalanceSheet()
 {
     $lists = Bankncash::DefaultApartment()->paginate(10);
     $tbal = Bankncash::DefaultApartment()->get()->sum('balance');
     return view('transaction.balance', compact('lists', 'tbal'));
 }