fix: Reset save button after error handling
feat: Clear review mode and revert to edit mode when navigating to next item feat: Implement close button functionality fix: Handle edge case with zero delivery notes feat: Add new type field with free text option fix: Enable cancellation reversal in WarehouseAdmin improve: Enhance article search autocomplete functionality
This commit is contained in:
@@ -16,6 +16,7 @@ class WarehouseShippingNoteController extends TTCrud {
|
||||
['value' => 'cancelled', 'text' => 'Storniert', 'icon' => 'fas fa-ban text-danger'],
|
||||
['value' => 'on_hold', 'text' => 'In Wartestellung', 'icon' => 'fas fa-pause text-warning'],
|
||||
]]],
|
||||
['key' => 'type', 'text' => 'Typ', 'required' => true],
|
||||
['key' => 'deliveryAddressName', 'text' => 'L.-Adr. Name', 'required' => true],
|
||||
['key' => 'deliveryAddressLine', 'text' => 'L.-Adr.', 'required' => true],
|
||||
['key' => 'deliveryAddressPLZ', 'text' => 'L.-Adr. PLZ', 'required' => true],
|
||||
@@ -378,23 +379,13 @@ class WarehouseShippingNoteController extends TTCrud {
|
||||
}
|
||||
|
||||
protected function changeStatusAction() {
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
$json = json_decode(file_get_contents('php://input'), true);
|
||||
$id = $json['id'];
|
||||
$status = $json['status'];
|
||||
if (strlen($id) < 1) {
|
||||
http_response_code(500);
|
||||
self::returnJson(['success' => false, 'message' => 'Lieferschein wurde nicht gefunden']);
|
||||
}
|
||||
if (empty($json['id'])) self::sendError('Lieferschein wurde nicht gefunden');
|
||||
|
||||
$shippingNote = (array) WarehouseShippingNoteModel::get($id);
|
||||
if ($shippingNote['status'] === 'invoiced') {
|
||||
http_response_code(500);
|
||||
self::returnJson(['success' => false, 'message' => 'Status kann nicht geändert werden']);
|
||||
}
|
||||
$shippingNote = (array) WarehouseShippingNoteModel::get($json['id']);
|
||||
if ($shippingNote['status'] === 'invoiced') self::sendError('Status kann nicht geändert werden');
|
||||
|
||||
$shippingNote['status'] = $status;
|
||||
$shippingNote['status'] = $json['status'];
|
||||
WarehouseShippingNoteModel::update($shippingNote);
|
||||
$statusNiceText = [
|
||||
'new' => 'Neu',
|
||||
@@ -404,7 +395,7 @@ class WarehouseShippingNoteController extends TTCrud {
|
||||
'cancelled' => 'Storniert',
|
||||
'on_hold' => 'In Wartestellung',
|
||||
];
|
||||
self::returnJson(['success' => true, 'message' => 'Status wurde auf ' . $statusNiceText[$status] . ' geändert']);
|
||||
self::returnJson(['success' => true, 'message' => 'Status wurde auf ' . $statusNiceText[$json['status']] . ' geändert']);
|
||||
}
|
||||
|
||||
//TODO: either move this to TimerecordingCarController or make it better
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
class WarehouseShippingNoteModel extends TTCrudBaseModel {
|
||||
public int $id;
|
||||
public ?int $billingAddressId;
|
||||
public string $type;
|
||||
public string $deliveryAddressName;
|
||||
public string $deliveryAddressLine;
|
||||
public string $deliveryAddressPLZ;
|
||||
|
||||
Reference in New Issue
Block a user