add inventory item changes
This commit is contained in:
@@ -202,14 +202,26 @@ class InventoryItemController extends Controller
|
||||
|
||||
$model->save(false);
|
||||
|
||||
$prev = Url::previous("inventory-item-index");
|
||||
\Yii::$app->session->setFlash('success', "Mennyiség elmentve: " . $model->productName . ' - ' .$model->count . ' db');
|
||||
|
||||
if (isset($prev)) {
|
||||
return $this->redirect($prev);
|
||||
} else {
|
||||
// $prev = Url::previous("inventory-item-index");
|
||||
|
||||
|
||||
|
||||
// if (isset($prev)) {
|
||||
// return $this->redirect($prev);
|
||||
// } else {
|
||||
// return $this->redirect(['index', 'id' => $inventory->id_inventory]);
|
||||
// }
|
||||
|
||||
$next = InventoryItem::findNextItemAlphabetical($model->id_inventory_item);
|
||||
if ( isset($next)){
|
||||
return $this->redirect(['inventory-item/update', 'id' => $next]);
|
||||
}else{
|
||||
return $this->redirect(['index', 'id' => $inventory->id_inventory]);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
|
||||
Reference in New Issue
Block a user