Ejemplo n.º 1
0
 function destroy($params)
 {
     if (!isset($params['id'])) {
         bail("Must haz id to do that!");
     }
     $inv = new Invoice($params['id']);
     $inv->destroy();
     $this->redirectTo(array('controller' => 'Invoice', 'action' => 'index'));
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified product from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Invoice::destroy($id);
     return Response::json(array('success' => true, 'message' => 'Xóa phiếu thu chi thành công!'));
 }
Ejemplo n.º 3
0
 /**
  * Remove the specified invoice from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Invoice::destroy($id);
     return Redirect::route('invoices.index');
 }
Ejemplo n.º 4
0
 /**
  * Delete a quotation
  */
 public function delete($id)
 {
     if (InvoiceItem::where('invoice_id', '=', $id)->delete()) {
         if (Invoice::destroy($id)) {
             return Redirect::route('invoice_list')->with('mSuccess', 'Le devis a bien été supprimé');
         } else {
             return Redirect::route('invoice_modify', $id)->with('mError', 'Impossible de supprimer ce devis');
         }
     } else {
         return Redirect::route('invoice_modify', $id)->with('mError', 'Impossible de supprimer ce devis');
     }
 }
Ejemplo n.º 5
0
 /**
  * Remove the specified product from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $orderItems = OrdersItem::where('order_id', '=', $id)->get();
     $invoices = Invoice::where('order_id', '=', $id)->get();
     if ($orderItems) {
         foreach ($orderItems as $orderItem) {
             OrdersItem::destroy($orderItem->id);
         }
     }
     if ($invoices) {
         foreach ($invoices as $invoice) {
             Invoice::destroy($invoice->id);
         }
     }
     Order::destroy($id);
     return Response::json(array('success' => true));
 }