예제 #1
0
 /**
  * Update the specified payment in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $payment = Payment::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Payment::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $payment->update($data);
     return Redirect::route('payments.index');
 }
예제 #2
0
 /**
  * Update the specified payment in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $payment = Payment::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Payment::$rules, Payment::$messages);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $payment->erporder_id = Input::get('order');
     $payment->amount_paid = Input::get('amount');
     $payment->receipt_no = Input::get('receipt');
     $payment->received_by = Input::get('received_by');
     $payment->date = date("Y-m-d", strtotime(Input::get('pay_date')));
     $payment->update();
     return Redirect::route('payments.index')->withFlashMessage('Payment successfully updated!');
 }
예제 #3
0
 /**
  * Display the specified resource.
  * GET /accountreceivables/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $payments = Payment::findOrFail($id);
     return View::make('backend.code.payment.show', compact('payments'));
 }
 public function delete($id)
 {
     try {
         $payment = Payment::findOrFail($id);
         $neighbor_property_id = $payment->neighbor_property_id;
         $amount = $payment->amount;
         $mes = date("M");
         if ($payment->delete(['id'])) {
             $payment_states = PaymentStates::where('neighbor_property_id', '=', $neighbor_property_id)->first();
             $payment_states->accumulated = $payment_states->accumulated - $amount;
             $payment_states->{$mes} = $payment_states->{$mes} - $amount;
             $payment_states->update(['id']);
             return Redirect::back()->with('error', false)->with('msg', 'Pago removido exitosamente.')->with('class', 'warning');
         } else {
             echo $exc->getMessage() . " " . $exc->getLine();
             return Redirect::back()->with('error', true)->with('msg', '¡Algo salió mal! Contacte con administrador')->with('class', 'danger');
         }
     } catch (Exception $exc) {
         echo $exc->getMessage() . " " . $exc->getLine();
         return Redirect::back()->with('error', true)->with('msg', '¡Algo salió mal! Contacte con administrador')->with('class', 'danger');
     }
 }
예제 #5
0
 public function notvalidasi($id)
 {
     $payment = Payment::findOrFail($id);
     $data['verifikasi'] = 0;
     $payment->update($data);
     return Redirect::to('admin/valid' . '?statvalid=' . Session::get('statusvalid'))->with("successMessage", "Berhasil membatalkan validasi");
 }