Feature/add e shop
This commit is contained in:
@@ -20,8 +20,8 @@ class WarehouseArticleDistributorController extends TTCrud {
|
||||
'delete' => 'Lieferanteintrag wurde gelöscht',
|
||||
'noChanges' => 'Keine Änderungen',];
|
||||
|
||||
protected function checkExistingThresholdEntry($postData): bool {
|
||||
$count = WarehouseLocationThresholdOverrideModel::count(['articleId' => $postData['articleId'],
|
||||
protected function checkExistingDistributorEntry($postData): bool {
|
||||
$count = WarehouseArticleDistributorModel::count(['articleId' => $postData['articleId'],
|
||||
'distributorId' => $postData['distributorId']]);
|
||||
|
||||
if ($count > 0) {
|
||||
@@ -34,7 +34,7 @@ class WarehouseArticleDistributorController extends TTCrud {
|
||||
}
|
||||
|
||||
protected function beforeCreate($postData): bool {
|
||||
return $this->checkExistingThresholdEntry($postData);
|
||||
return $this->checkExistingDistributorEntry($postData);
|
||||
}
|
||||
|
||||
protected function afterCreate($postData) {
|
||||
@@ -42,7 +42,7 @@ class WarehouseArticleDistributorController extends TTCrud {
|
||||
}
|
||||
|
||||
protected function beforeUpdate($postData): bool {
|
||||
$existing = $this->checkExistingThresholdEntry($postData);
|
||||
$existing = $this->checkExistingDistributorEntry($postData);
|
||||
|
||||
if (!$existing) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user