Skip to content

Commit

Permalink
fix(stock): improve FR i18n for CMM modal
Browse files Browse the repository at this point in the history
Improves the French i18n for the CMM modal based on feedback from
@mbayopanda.
  • Loading branch information
jniles committed Feb 20, 2021
1 parent 4373edc commit c2eb208
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/src/i18n/en/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"ALGO_3" : "Algorithm 3",
"ALGO_3_COMMENT" : "The average consumption is obtained by dividing the quantity consumed during the period by the number of days in the period, and by multiplying the result obtained by 30.5.",
"ALGO_4" : "Algorithm 4 (MSH)",
"ALGO_4_COMMENT" : "The average consumption is obtained by dividing the quantity consumed during the period by the difference of the number of months in the period minus the total number of days of stock out in the period. The MSH algorithm is recommended by the Management Sciences for Health organization (https://www.msh.org).",
"ALGO_4_COMMENT" : "The average consumption is obtained by dividing the quantity consumed during the period by number of months of stock (found by subtracting the number of days of stock outs divided by 30.5 from the number of months in the period). The MSH algorithm is recommended by the Management Sciences for Health organization (https://www.msh.org).",
"FIRST_INVENTORY_MOVEMENT_DATE" : "First Recorded Movement",
"LAST_INVENTORY_MOVEMENT_DATE" : "Last Recorded Movement",
"DAYS_BEFORE_CONSUMPTION" : "Days before First Consumption",
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/fr/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@
"LAST_INVENTORY_MOVEMENT_DATE" : "Dernier mouvement enregistré ",
"DAYS_BEFORE_CONSUMPTION" : "Jours avant la première consommation ",
"NUMBER_OF_MONTHS" : "Nombre de mois",
"SUM_CONSUMPTION_DAY" : "Consommation de stock ",
"SUM_CONSUMPTION_DAY" : "Jours de consommation de stock ",
"SUM_CONSUMED_QUANTITY" :"Quantité consommée",
"SUM_DAYS" : "Jours au total",
"SUM_STOCK_DAY" : "Jours avec stock disponible en dépôt",
"SUM_STOCK_OUT_DAYS" : "Rupture de stock",
"SUM_STOCK_OUT_DAYS" : "Jours de rupture de stock",
"NEXT_STOCK_OUT" : "Prochaine rupture de stock",
"TITLE" : "Consommation Mensuelle Moyenne",
"DAYS" : "Jours",
Expand Down
9 changes: 3 additions & 6 deletions client/src/modules/stock/inventories/modals/amc.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ function StockAMCModalController(Stock, Notify, Instance, data, moment, Constant
vm.data.avg_consumption = vm.data[vm.settings.average_consumption_algo];

// calculate date when the stock will run out at current consumption rate
// NOTE(@jniles): momentjs does not accept decimals as of 2.12.0. We need to use days, not
// months
const daysOfStockLeft = (vm.data.quantity_in_stock / vm.data.avg_consumption) * 30.5;

// NOTE: momentjs does not accept decimals as of 2.12.0
const stockOutDate = moment().add(daysOfStockLeft, 'days').toDate();

// provide this information to the view.
vm.data.stock_out_date = stockOutDate;
vm.data.stock_out_date = moment().add(daysOfStockLeft, 'days').toDate();

// nicer aliases to use in the HTML
vm.isAlgo1 = vm.settings.average_consumption_algo === 'algo1';
Expand Down

0 comments on commit c2eb208

Please sign in to comment.