mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 03:08:51 +02:00
Added an checkbox in the withdrawal/move dialog, that if checked automatically deletes a part lot if it becomes empty during the operation
Fixes issue #327
This commit is contained in:
parent
9e69a09a19
commit
ffb5d3e790
4 changed files with 35 additions and 7 deletions
|
@ -400,6 +400,7 @@ class PartController extends AbstractController
|
|||
$amount = (float) $request->request->get('amount');
|
||||
$comment = $request->request->get('comment');
|
||||
$action = $request->request->get('action');
|
||||
$delete_lot_if_empty = $request->request->getBoolean('delete_lot_if_empty', false);
|
||||
|
||||
$timestamp = null;
|
||||
$timestamp_str = $request->request->getString('timestamp', '');
|
||||
|
@ -418,7 +419,7 @@ class PartController extends AbstractController
|
|||
case "withdraw":
|
||||
case "remove":
|
||||
$this->denyAccessUnlessGranted('withdraw', $partLot);
|
||||
$withdrawAddHelper->withdraw($partLot, $amount, $comment, $timestamp);
|
||||
$withdrawAddHelper->withdraw($partLot, $amount, $comment, $timestamp, $delete_lot_if_empty);
|
||||
break;
|
||||
case "add":
|
||||
$this->denyAccessUnlessGranted('add', $partLot);
|
||||
|
@ -427,7 +428,7 @@ class PartController extends AbstractController
|
|||
case "move":
|
||||
$this->denyAccessUnlessGranted('move', $partLot);
|
||||
$this->denyAccessUnlessGranted('move', $targetLot);
|
||||
$withdrawAddHelper->move($partLot, $targetLot, $amount, $comment, $timestamp);
|
||||
$withdrawAddHelper->move($partLot, $targetLot, $amount, $comment, $timestamp, $delete_lot_if_empty);
|
||||
break;
|
||||
default:
|
||||
throw new \RuntimeException("Unknown action!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue