Feature/add e shop

This commit is contained in:
Luca Haid
2024-07-24 13:25:49 +00:00
parent 1c8f1acf2a
commit 6c79a9302f
30 changed files with 588 additions and 53 deletions
@@ -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;