fix(falukant): improve product pricing logic and update localization for office notifications
All checks were successful
Deploy to production / deploy (push) Successful in 2m44s
All checks were successful
Deploy to production / deploy (push) Successful in 2m44s
- Refactored the product pricing logic in `falukantService.js` to ensure accurate regional pricing calculations based on client values and server data. - Added new notification translations for "office filled" in multiple languages (Cebuano, German, English, Spanish, French) to enhance user experience and clarity in notifications.
This commit is contained in:
@@ -7036,13 +7036,15 @@ ORDER BY r.id`,
|
||||
? Number(clientPriceRaw)
|
||||
: NaN;
|
||||
let currentRegionalPrice;
|
||||
if (!Number.isNaN(clientPriceNum)) {
|
||||
// Referenzpreis wie in der Ertrags-Tabelle (z. B. MAX-Worth über Filialen)
|
||||
currentRegionalPrice = clientPriceNum;
|
||||
} else if (currentRegionId) {
|
||||
// Wie getProductPricesInCities: bei bekannter Standort-Region immer
|
||||
// serverseitigen Verkaufspreis dieser Region als Referenz — nicht den
|
||||
// Client-Wert (Ertrags-Tabelle kann MAX-Worth über Filialen nutzen).
|
||||
if (currentRegionId) {
|
||||
const wp = worthByProductRegion.get(`${product.id}-${currentRegionId}`) ?? 50;
|
||||
currentRegionalPrice = calcRegionalSellPriceSync(product, knowledgeFactor, wp)
|
||||
?? Number(product.sellCost) ?? 0;
|
||||
?? (!Number.isNaN(clientPriceNum) ? clientPriceNum : Number(product.sellCost) ?? 0);
|
||||
} else if (!Number.isNaN(clientPriceNum)) {
|
||||
currentRegionalPrice = clientPriceNum;
|
||||
} else {
|
||||
currentRegionalPrice = Number(product.sellCost) || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user