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)
|
? Number(clientPriceRaw)
|
||||||
: NaN;
|
: NaN;
|
||||||
let currentRegionalPrice;
|
let currentRegionalPrice;
|
||||||
if (!Number.isNaN(clientPriceNum)) {
|
// Wie getProductPricesInCities: bei bekannter Standort-Region immer
|
||||||
// Referenzpreis wie in der Ertrags-Tabelle (z. B. MAX-Worth über Filialen)
|
// serverseitigen Verkaufspreis dieser Region als Referenz — nicht den
|
||||||
currentRegionalPrice = clientPriceNum;
|
// Client-Wert (Ertrags-Tabelle kann MAX-Worth über Filialen nutzen).
|
||||||
} else if (currentRegionId) {
|
if (currentRegionId) {
|
||||||
const wp = worthByProductRegion.get(`${product.id}-${currentRegionId}`) ?? 50;
|
const wp = worthByProductRegion.get(`${product.id}-${currentRegionId}`) ?? 50;
|
||||||
currentRegionalPrice = calcRegionalSellPriceSync(product, knowledgeFactor, wp)
|
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 {
|
} else {
|
||||||
currentRegionalPrice = Number(product.sellCost) || 0;
|
currentRegionalPrice = Number(product.sellCost) || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"notify_election_created": "Giskedyul ang usa ka bag-ong eleksiyon.",
|
"notify_election_created": "Giskedyul ang usa ka bag-ong eleksiyon.",
|
||||||
|
"notify_office_filled": "Na puno ang usa ka politikal nga opisina.",
|
||||||
"director_death": "Namatay si {characterName} sa edad nga {ageYears}. Isip amo, kinahanglan kang magtudlo og bag-ong direktor.{regionLabel}{spouses}{children}{lovers}",
|
"director_death": "Namatay si {characterName} sa edad nga {ageYears}. Isip amo, kinahanglan kang magtudlo og bag-ong direktor.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"relationship_death": "Namatay si {characterName} sa edad nga {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
"relationship_death": "Namatay si {characterName} sa edad nga {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"child_death": "Namatay ang imong anak nga si {characterName} sa edad nga {ageYears}.{regionLabel}",
|
"child_death": "Namatay ang imong anak nga si {characterName} sa edad nga {ageYears}.{regionLabel}",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"notify_election_created": "Es wurde eine neue Wahl ausgeschrieben.",
|
"notify_election_created": "Es wurde eine neue Wahl ausgeschrieben.",
|
||||||
|
"notify_office_filled": "Ein politisches Amt wurde neu besetzt.",
|
||||||
"director_death": "{characterName} ist im Alter von {ageYears} Jahren verstorben. Als Arbeitgeber musst du die Direktion neu besetzen.{regionLabel}{spouses}{children}{lovers}",
|
"director_death": "{characterName} ist im Alter von {ageYears} Jahren verstorben. Als Arbeitgeber musst du die Direktion neu besetzen.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"relationship_death": "{characterName} ist im Alter von {ageYears} Jahren verstorben.{regionLabel}{spouses}{children}{lovers}",
|
"relationship_death": "{characterName} ist im Alter von {ageYears} Jahren verstorben.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"child_death": "Dein Kind {characterName} ist im Alter von {ageYears} Jahren verstorben.{regionLabel}",
|
"child_death": "Dein Kind {characterName} ist im Alter von {ageYears} Jahren verstorben.{regionLabel}",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"notify_election_created": "A new election has been scheduled.",
|
"notify_election_created": "A new election has been scheduled.",
|
||||||
|
"notify_office_filled": "A political office has been filled.",
|
||||||
"director_death": "{characterName} died at the age of {ageYears}. As employer you need to appoint a new director.{regionLabel}{spouses}{children}{lovers}",
|
"director_death": "{characterName} died at the age of {ageYears}. As employer you need to appoint a new director.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"relationship_death": "{characterName} died at the age of {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
"relationship_death": "{characterName} died at the age of {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"child_death": "Your child {characterName} died at the age of {ageYears}.{regionLabel}",
|
"child_death": "Your child {characterName} died at the age of {ageYears}.{regionLabel}",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"notify_election_created": "Se ha convocado una nueva elección.",
|
"notify_election_created": "Se ha convocado una nueva elección.",
|
||||||
|
"notify_office_filled": "Se ha cubierto un cargo político.",
|
||||||
"director_death": "{characterName} ha fallecido a la edad de {ageYears} años. Como empleador debes nombrar un nuevo director.{regionLabel}{spouses}{children}{lovers}",
|
"director_death": "{characterName} ha fallecido a la edad de {ageYears} años. Como empleador debes nombrar un nuevo director.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"relationship_death": "{characterName} ha fallecido a la edad de {ageYears} años.{regionLabel}{spouses}{children}{lovers}",
|
"relationship_death": "{characterName} ha fallecido a la edad de {ageYears} años.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"child_death": "Tu hijo/a {characterName} ha fallecido a la edad de {ageYears} años.{regionLabel}",
|
"child_death": "Tu hijo/a {characterName} ha fallecido a la edad de {ageYears} años.{regionLabel}",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"notify_election_created": "Une nouvelle élection a été déclenchée.",
|
"notify_election_created": "Une nouvelle élection a été déclenchée.",
|
||||||
|
"notify_office_filled": "Une fonction politique a été pourvue.",
|
||||||
"director_death": "{characterName} est décédé à l'âge de {ageYears}. En tant qu'employeur, vous devez remplir le conseil d'administration.{regionLabel}{spouses}{children}{lovers}",
|
"director_death": "{characterName} est décédé à l'âge de {ageYears}. En tant qu'employeur, vous devez remplir le conseil d'administration.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"relationship_death": "{characterName} est décédé à l'âge de {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
"relationship_death": "{characterName} est décédé à l'âge de {ageYears}.{regionLabel}{spouses}{children}{lovers}",
|
||||||
"child_death": "Votre enfant {characterName} est décédé à l'âge de {ageYears}.{regionLabel}",
|
"child_death": "Votre enfant {characterName} est décédé à l'âge de {ageYears}.{regionLabel}",
|
||||||
|
|||||||
Reference in New Issue
Block a user