예제 #1
0
 /**
  * Show the form for creating a new resource.
  * GET /payments/create
  *
  * @return Response
  */
 public function create($id)
 {
     $invoices = Invoice::with('invoicedetail')->find($id);
     $paymenttypes = Paymenttype::all();
     $total = $invoices->invoicedetail->rent + $invoices->invoicedetail->water + $invoices->invoicedetail->electricity + $invoices->invoicedetail->security;
     $houseid = $invoices->houseID;
     $balance = Payment::where('houseID', $houseid)->sum('balance');
     return View::make('backend.code.payment.create', compact('invoices', 'invoicedetail', 'total', 'balance'));
 }
 /**
  * Display a listing of the resource.
  * GET /paymenttype
  *
  * @return Response
  */
 public function index()
 {
     $paymenttypes = Paymenttype::all();
     return View::make('backend.code.paymenttype.index', compact('paymenttypes'));
 }