diff --git a/Admin/Install/attributes.json b/Admin/Install/attributes.json
index 2956872..014f55c 100755
--- a/Admin/Install/attributes.json
+++ b/Admin/Install/attributes.json
@@ -235,19 +235,6 @@
"default_value": "",
"values": []
},
- {
- "name": "tax_id",
- "l11n": {
- "en": "Tax Id",
- "de": "Steuernummer"
- },
- "value_type": 2,
- "is_custom_allowed": true,
- "validation_pattern": "",
- "is_required": false,
- "default_value": "",
- "values": []
- },
{
"name": "legal_form",
"l11n": {
@@ -346,6 +333,19 @@
"default_value": "",
"values": []
},
+ {
+ "name": "bill_approval",
+ "l11n": {
+ "en": "Approval group",
+ "de": "Freigabegruppe"
+ },
+ "value_type": 2,
+ "is_custom_allowed": true,
+ "validation_pattern": "",
+ "is_required": false,
+ "default_value": "",
+ "values": []
+ },
{
"name": "bill_match_pattern",
"l11n": {
diff --git a/Controller/ApiAttributeController.php b/Controller/ApiAttributeController.php
index f9d0a5f..f6d1732 100644
--- a/Controller/ApiAttributeController.php
+++ b/Controller/ApiAttributeController.php
@@ -243,7 +243,7 @@ final class ApiAttributeController extends Controller
->with('type')
->with('type/defaults')
->with('value')
- ->where('id', (int) $request->getData('id'))
+ ->where('id', $request->getDataInt('id') ?? 0)
->execute();
$new = $this->updateAttributeFromRequest($request, clone $old);
@@ -291,7 +291,7 @@ final class ApiAttributeController extends Controller
$supplierAttribute = SupplierAttributeMapper::get()
->with('type')
- ->where('id', (int) $request->getData('id'))
+ ->where('id', $request->getDataInt('id') ?? 0)
->execute();
if ($supplierAttribute->type->isRequired) {
@@ -327,7 +327,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $old */
- $old = SupplierAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
+ $old = SupplierAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$new = $this->updateAttributeTypeL11nFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, SupplierAttributeTypeL11nMapper::class, 'supplier_attribute_type_l11n', $request->getOrigin());
@@ -357,7 +357,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $supplierAttributeTypeL11n */
- $supplierAttributeTypeL11n = SupplierAttributeTypeL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
+ $supplierAttributeTypeL11n = SupplierAttributeTypeL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $supplierAttributeTypeL11n, SupplierAttributeTypeL11nMapper::class, 'supplier_attribute_type_l11n', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $supplierAttributeTypeL11n);
}
@@ -385,7 +385,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeType $old */
- $old = SupplierAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
+ $old = SupplierAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute();
$new = $this->updateAttributeTypeFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, SupplierAttributeTypeMapper::class, 'supplier_attribute_type', $request->getOrigin());
@@ -417,7 +417,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeType $supplierAttributeType */
- $supplierAttributeType = SupplierAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
+ $supplierAttributeType = SupplierAttributeTypeMapper::get()->with('defaults')->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $supplierAttributeType, SupplierAttributeTypeMapper::class, 'supplier_attribute_type', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $supplierAttributeType);
}
@@ -445,7 +445,7 @@ final class ApiAttributeController extends Controller
}
/** @var AttributeValue $old */
- $old = SupplierAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute();
+ $old = SupplierAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
/** @var \Modules\Attribute\Models\Attribute $attr */
$attr = SupplierAttributeMapper::get()
@@ -485,7 +485,7 @@ final class ApiAttributeController extends Controller
// }
// /** @var \Modules\SupplierManagement\Models\SupplierAttributeValue $supplierAttributeValue */
- // $supplierAttributeValue = SupplierAttributeValueMapper::get()->where('id', (int) $request->getData('id'))->execute();
+ // $supplierAttributeValue = SupplierAttributeValueMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
// $this->deleteModel($request->header->account, $supplierAttributeValue, SupplierAttributeValueMapper::class, 'supplier_attribute_value', $request->getOrigin());
// $this->createStandardDeleteResponse($request, $response, $supplierAttributeValue);
}
@@ -513,7 +513,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $old */
- $old = SupplierAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id'));
+ $old = SupplierAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0);
$new = $this->updateAttributeValueL11nFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, SupplierAttributeValueL11nMapper::class, 'supplier_attribute_value_l11n', $request->getOrigin());
@@ -543,7 +543,7 @@ final class ApiAttributeController extends Controller
}
/** @var BaseStringL11n $supplierAttributeValueL11n */
- $supplierAttributeValueL11n = SupplierAttributeValueL11nMapper::get()->where('id', (int) $request->getData('id'))->execute();
+ $supplierAttributeValueL11n = SupplierAttributeValueL11nMapper::get()->where('id', $request->getDataInt('id') ?? 0)->execute();
$this->deleteModel($request->header->account, $supplierAttributeValueL11n, SupplierAttributeValueL11nMapper::class, 'supplier_attribute_value_l11n', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $supplierAttributeValueL11n);
}
diff --git a/Controller/BackendController.php b/Controller/BackendController.php
index 2b8203e..a5a5e6a 100755
--- a/Controller/BackendController.php
+++ b/Controller/BackendController.php
@@ -123,7 +123,7 @@ final class BackendController extends Controller
->with('l11n')
->with('defaults')
->with('defaults/l11n')
- ->where('id', (int) $request->getData('id'))
+ ->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', $response->header->l11n->language)
->where('defaults/l11n/language', [$response->header->l11n->language, null])
->execute();
@@ -156,7 +156,7 @@ final class BackendController extends Controller
$view->attribute = SupplierAttributeValueMapper::get()
->with('l11n')
- ->where('id', (int) $request->getData('id'))
+ ->where('id', $request->getDataInt('id') ?? 0)
->where('l11n/language', [$response->header->l11n->language, null])
->execute();
diff --git a/Docs/Help/en/attributes.md b/Docs/Help/en/attributes.md
index 38547b6..34fd78c 100644
--- a/Docs/Help/en/attributes.md
+++ b/Docs/Help/en/attributes.md
@@ -49,6 +49,7 @@ Suppliers can be put in categories for horizontal and vertical grouping. By defa
| Attribute | Description | Internal default value |
| --------- | ----------- | ---------------------- |
| minimum_order | Minimum order amount required | |
+| bill_approval | Default group that can approve the bill | |
### Accounting
diff --git a/Theme/Backend/supplier-view.tpl.php b/Theme/Backend/supplier-view.tpl.php
index 36b931d..7870fdd 100644
--- a/Theme/Backend/supplier-view.tpl.php
+++ b/Theme/Backend/supplier-view.tpl.php
@@ -44,7 +44,7 @@ $languages = ISO639Enum::getConstants();
$supplier = $this->data['supplier'] ?? new NullSupplier();
$isNew = $supplier->id === 0;
-$supplierImage = $this->getData('supplierImage') ?? new NullMedia();
+$supplierImage = $this->data['supplierImage'] ?? new NullMedia();
$supplierStatus = SupplierStatus::getConstants();
@@ -246,7 +246,7 @@ echo $this->data['nav']->render();