diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index 34b4e37..42971a0 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -3671,7 +3671,6 @@ class FalukantService extends BaseService { } async getProductPricesInCities(hashedUserId, productId, currentPrice, currentRegionId = null) { - console.log(`[getProductPricesInCities] Called with productId: ${productId}, currentPrice: ${currentPrice}, currentRegionId: ${currentRegionId}`); const user = await this.getFalukantUserByHashedId(hashedUserId); const character = await FalukantCharacter.findOne({ where: { userId: user.id } }); if (!character) { @@ -3726,11 +3725,9 @@ class FalukantService extends BaseService { // Für jede Stadt den Preis berechnen und Branch-Typ bestimmen const results = []; - console.log(`[getProductPricesInCities] Processing ${cities.length} cities for product ${productId}, knowledgeFactor: ${knowledgeFactor}, product.sellCost: ${product.sellCost}`); for (const city of cities) { // Aktuelle Stadt ausschließen if (currentRegionId && city.id === currentRegionId) { - console.log(`[getProductPricesInCities] Skipping current city: ${city.name} (${city.id})`); continue; } @@ -3745,8 +3742,6 @@ class FalukantService extends BaseService { const max = basePrice; const priceInCity = min + (max - min) * (knowledgeFactor / 100); - console.log(`[getProductPricesInCities] City: ${city.name} (${city.id}), worthPercent: ${worthPercent}, basePrice: ${basePrice}, priceInCity: ${priceInCity}, currentPrice: ${currentPrice}, isBetter: ${priceInCity > currentPrice}`); - // Nur Städte zurückgeben, wo der Preis höher ist // Keine Toleranz, da wir die aktuelle Stadt bereits ausschließen if (priceInCity > currentPrice) { @@ -3762,8 +3757,6 @@ class FalukantService extends BaseService { } } - console.log(`[getProductPricesInCities] Adding ${city.name} to results: price=${priceInCity}, branchType=${branchType}`); - results.push({ regionId: city.id, regionName: city.name, @@ -3772,8 +3765,6 @@ class FalukantService extends BaseService { }); } } - - console.log(`[getProductPricesInCities] Returning ${results.length} cities with better prices for product ${productId}:`, results.map(r => `${r.regionName} (${r.price.toFixed(2)})`).join(', ')); // Sortiere nach Preis (höchster zuerst) results.sort((a, b) => b.price - a.price); diff --git a/frontend/src/components/falukant/RevenueSection.vue b/frontend/src/components/falukant/RevenueSection.vue index a09f197..a9ddb25 100644 --- a/frontend/src/components/falukant/RevenueSection.vue +++ b/frontend/src/components/falukant/RevenueSection.vue @@ -105,16 +105,13 @@ }, async loadPricesForAllProducts() { if (this.currentRegionId === null || this.currentRegionId === undefined) { - console.log(`[RevenueSection] Skipping loadPricesForAllProducts - currentRegionId is null/undefined`); return; } - console.log(`[RevenueSection] loadPricesForAllProducts called, products: ${this.products.length}, currentRegionId: ${this.currentRegionId}`); for (const product of this.products) { if (this.loadingPrices.has(product.id)) continue; this.loadingPrices.add(product.id); try { const currentPrice = parseFloat(this.calculateProductRevenue(product).absolute); - console.log(`[RevenueSection] Loading prices for product ${product.id} (${product.labelTr}), currentPrice: ${currentPrice}, currentRegionId: ${this.currentRegionId}`); const { data } = await apiClient.get('/api/falukant/products/prices-in-cities', { params: { productId: product.id, @@ -122,7 +119,6 @@ currentRegionId: this.currentRegionId } }); - console.log(`[RevenueSection] Received better prices for product ${product.id}:`, data); this.$set(product, 'betterPrices', data || []); } catch (error) { console.error(`Error loading prices for product ${product.id}:`, error);