public function modalEstadoCuenta()
 {
     $neighbor_property_id = Input::get('neighbor_property_id');
     $user_id = Auth::user()->id;
     $colonia = Session::get("colonia");
     $urbanism = Urbanism::where('colony_id', '=', $colonia)->first();
     $urbanismo = $urbanism->id;
     $urb_name = $urbanism->name;
     $property_id = NeighborProperty::where('urbanism_id', '=', $urbanismo)->pluck('id');
     $vigencia = date("Y-m");
     $months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Decem");
     $today = date("Y-m-d");
     $ano = date("Y");
     $selano = Payment::select(DB::raw('DATE_FORMAT(payments.created_at,\'%Y\') as y'))->groupBy(DB::raw('Year(payments.created_at)'))->orderBy(DB::raw('Year(payments.created_at)'))->get();
     $monthly_all = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->get();
     $monthly_ini = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->orderBy('monthly_fee.created_at', 'ASC')->pluck('since');
     $mes_ini = (int) date("m", strtotime($monthly_ini));
     $cuotas = array();
     foreach ($monthly_all as $cuota_mensual) {
         $ini = (int) date("m", strtotime($cuota_mensual->since));
         $fin = (int) date("m", strtotime($cuota_mensual->until));
         if ($cuota_mensual->until == NULL) {
             $fin = (int) date("m");
         }
         for ($i = $ini; $i <= $fin; $i++) {
             $cuotas[$months[$i - 1]] = $cuota_mensual->amount;
         }
     }
     for ($j = 0; $j <= 11; $j++) {
         if ($j + 1 < $mes_ini) {
             $saldoAnteriol[$j] = "";
             $cuataMes[$j] = "";
             $totalDebe[$j] = "";
             $pagos[$j] = "";
             $saldoTotal[$j] = "";
         } elseif ($j + 1 <= date("m")) {
             $saldoAnteriol[$j] = $saldoTotal[$j - 1];
             $cuataMes[$j] = -$cuotas[$months[$j]];
             $totalDebe[$j] = $saldoAnteriol[$j] + $cuataMes[$j];
             $neighbor_payments = PaymentStates::with('NeighborProperty')->where('neighbor_property_id', '=', $neighbor_property_id)->first();
             if ($neighbor_payments) {
                 $pagos[$j] = $neighbor_payments->{$months}[$j] == NULL ? 0 : $neighbor_payments->{$months}[$j];
             } else {
                 $pagos[$j] = 0;
             }
             $saldoTotal[$j] = $totalDebe[$j] + $pagos[$j];
         } elseif ($j + 1 > date("m")) {
             $saldoAnteriol[$j] = "";
             $cuataMes[$j] = "";
             $totalDebe[$j] = "";
             $pagos[$j] = "";
             $saldoTotal[$j] = "";
         }
     }
     $neighbor = NeighborProperty::find($neighbor_property_id);
     return View::make('dashboard.payments.neighbors.table_neigbor', compact('breadcrumbs_data', 'saldoAnteriol', 'cuataMes', 'totalDebe', 'pagos', 'saldoTotal', 'mes_ini', 'ini', 'months', 'color', 'neighbor'));
 }