Ergaenze Chargenformular um Lagerbewegungen
This commit is contained in:
1 parent
1e5ededa00
commit
5908f71a39
3 files changed
+147
-5
No files matched your search
@@ -46,6 +46,9 @@ try {
|
||||
$manufacturerPartyId = $manufacturerPartyId === null || $manufacturerPartyId === ''
|
||||
? null
|
||||
: (int) $manufacturerPartyId;
|
||||
$receiptQty = isset($data['receiptQty']) && $data['receiptQty'] !== '' ? (float) $data['receiptQty'] : 0.0;
|
||||
$adjustmentQty = isset($data['adjustmentQty']) && $data['adjustmentQty'] !== '' ? (float) $data['adjustmentQty'] : 0.0;
|
||||
$outQty = isset($data['outQty']) && $data['outQty'] !== '' ? (float) $data['outQty'] : 0.0;
|
||||
$updatedLot = update_stock_lot_traceability(
|
||||
$pdo,
|
||||
(int) ($data['lotId'] ?? 0),
|
||||
@@ -54,9 +57,12 @@ try {
|
||||
isset($data['mfgDate']) ? (string) $data['mfgDate'] : null,
|
||||
isset($data['expiryDate']) ? (string) $data['expiryDate'] : null,
|
||||
isset($data['purchaseDate']) ? (string) $data['purchaseDate'] : null,
|
||||
(string) ($currentUser['username'] ?? $currentUser['email'] ?? 'unknown')
|
||||
(string) ($currentUser['username'] ?? $currentUser['email'] ?? 'unknown'),
|
||||
$receiptQty,
|
||||
$adjustmentQty,
|
||||
$outQty
|
||||
);
|
||||
json_response(200, ['ok' => true, 'lot' => $updatedLot]);
|
||||
json_response(200, ['ok' => true, 'lot' => $updatedLot, 'balance' => get_stock_lot_balance($pdo, (int) ($data['lotId'] ?? 0))]);
|
||||
}
|
||||
|
||||
json_response(422, ['ok' => false, 'error' => 'Unsupported action']);
|
||||
|
||||
Reference in new issue
Block a user