public function edit($publicId)
 {
     $payment = Payment::scope($publicId)->firstOrFail();
     $payment->payment_date = Utils::fromSqlDate($payment->payment_date);
     $data = array('client' => null, 'invoice' => null, 'invoices' => Invoice::scope()->where('is_recurring', '=', false)->where('is_quote', '=', false)->with('client', 'invoice_status')->orderBy('invoice_number')->get(), 'payment' => $payment, 'method' => 'PUT', 'url' => 'payments/' . $publicId, 'title' => 'Edit Payment', 'paymentTypes' => PaymentType::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'clients' => Client::scope()->with('contacts')->orderBy('name')->get());
     return View::make('payments.edit', $data);
 }