public function rollback($inventory_id, $stock_id, $movement_id)
    {
        $item = $this->inventory->find($inventory_id);
        $stock = $this->inventoryStock->find($stock_id);
        $movement = $this->inventoryStockMovement->find($movement_id);

        if ($stock->rollback($movement)) {
            $this->message = 'Successfully rolled back movement';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.inventory.stock.movements.index', [
                $item->id, $stock->id,
            ]);
        } else {
            $this->message = 'There was an error trying to roll back this movement. Please try again.';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.inventory.stock.movements.index', [
                $item->id, $stock->id,
            ]);
        }

        return $this->response();
    }
public function rollback($inventory_id, $stock_id, $movement_id)
    {
        $item = $this->inventory->find($inventory_id);
        $stock = $this->inventoryStock->find($stock_id);
        $movement = $this->inventoryStockMovement->find($movement_id);

        if ($stock->rollback($movement)) {
            $this->message = 'Successfully rolled back movement';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.inventory.stock.movements.index', [
                $item->id, $stock->id,
            ]);
        } else {
            $this->message = 'There was an error trying to roll back this movement. Please try again.';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.inventory.stock.movements.index', [
                $item->id, $stock->id,
            ]);
        }

        return $this->response();
    }
public function rollback ( $ inventory_id , $ stock_id , $ movement_id ) { $ item = $ this -> inventory -> find ( $ inventory_id ) ; $ stock = $ this -> inventoryStock -> find ( $ stock_id ) ; $ movement = $ this -> inventoryStockMovement -> find ( $ movement_id ) ; if ( $ stock -> rollback ( $ movement ) ) { $ this -> message = 'Successfully rolled back movement' ; $ this -> messageType = 'success' ; $ this -> redirect = routeBack ( 'maintenance.inventory.stock.movements.index' , [ $ item -> id , $ stock -> id , ] ) ; } else { $ this -> message = 'There was an error trying to roll back this movement. Please try again.' ; $ this -> messageType = 'success' ; $ this -> redirect = routeBack ( 'maintenance.inventory.stock.movements.index' , [ $ item -> id , $ stock -> id , ] ) ; } return $ this -> response ( ) ; }
Rolls back an inventory stock movement.

@param $inventory_id
@param $stock_id
@param $movement_id

@return \Illuminate\Http\JsonResponse|mixed
Rolls back an inventory stock movement .