Add price type selection modal and backend functionality for addresses
This commit is contained in:
@@ -48,6 +48,18 @@ class WarehouseArticlePriceTypeController extends TTCrud {
|
||||
$WarehouseArticleController->updatePricesAction();
|
||||
}
|
||||
|
||||
protected function beforeDelete(): bool {
|
||||
$priceTypeId = $this->request->id;
|
||||
$usedByAddresses = AddressPriceTypeModel::getAll(['priceType_id' => $priceTypeId]);
|
||||
|
||||
if (!empty($usedByAddresses)) {
|
||||
$this->infoMessages['delete'] = 'Dieser Preistyp kann nicht gelöscht werden, da er von ' . count($usedByAddresses) . ' Kunde(n) verwendet wird.';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getHistoryAction() {
|
||||
$history = WarehouseHistoryModel::getByRowId($this->request->id, $this->mod);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user