77 lines
2.4 KiB
TypeScript
77 lines
2.4 KiB
TypeScript
/* eslint-disable object-curly-newline */
|
||
|
||
import type { Values } from 'stores/results/types';
|
||
|
||
export const id = 'output';
|
||
export const title = 'Результаты';
|
||
|
||
export const titles: Record<Values, string> = {
|
||
resultTotalGraphwithNDS: 'Итого по графику, с НДС',
|
||
resultPlPrice: 'Стоимость ПЛ с НДС',
|
||
resultPriceUpPr: 'Удорожание, год',
|
||
resultIRRGraphPerc: 'IRR по графику клиента, %',
|
||
resultIRRNominalPerc: 'IRR (номинал), %',
|
||
resultInsKasko: 'КАСКО, НС, ДГО в графике',
|
||
resultInsOsago: 'ОСАГО в графике',
|
||
resultDopProdSum: 'Общая сумма доп.продуктов',
|
||
resultFirstPayment: 'Первый платеж',
|
||
resultLastPayment: 'Последний платеж',
|
||
resultTerm: 'Срок, мес.',
|
||
resultAB_FL: 'АВ ФЛ, без НДФЛ.',
|
||
resultAB_UL: 'АВ ЮЛ, с НДС.',
|
||
resultBonusMPL: 'Бонус МПЛ за лизинг, без НДФЛ',
|
||
resultDopMPLLeasing: 'Доп.бонус МПЛ за лизинг, без НДФЛ',
|
||
resultBonusDopProd: 'Бонус МПЛ за доп.продукты, без НДФЛ',
|
||
resultBonusSafeFinance: 'Бонус за Safe Finance без НДФЛ',
|
||
resultFirstPaymentRiskPolicy: 'Первый платеж по риск политике, %',
|
||
};
|
||
|
||
const moneyFormatters = Object.fromEntries(
|
||
(
|
||
[
|
||
'resultTotalGraphwithNDS',
|
||
'resultPlPrice',
|
||
'resultInsKasko',
|
||
'resultInsOsago',
|
||
'resultDopProdSum',
|
||
'resultFirstPayment',
|
||
'resultLastPayment',
|
||
'resultAB_FL',
|
||
'resultAB_UL',
|
||
'resultBonusMPL',
|
||
'resultDopMPLLeasing',
|
||
'resultBonusDopProd',
|
||
'tbxSubsidySum',
|
||
'resultBonusSafeFinance',
|
||
'resultPriceUpPr',
|
||
] as Values[]
|
||
).map((a) => [
|
||
a,
|
||
// prettier-ignore
|
||
Intl.NumberFormat('ru', {
|
||
style: 'currency',
|
||
currency: 'RUB',
|
||
}).format,
|
||
])
|
||
);
|
||
|
||
const percentFormatters = Object.fromEntries(
|
||
(['resultIRRGraphPerc', 'resultIRRNominalPerc', 'resultFirstPaymentRiskPolicy'] as Values[]).map(
|
||
(a) => [
|
||
a,
|
||
// prettier-ignore
|
||
Intl.NumberFormat('ru', {
|
||
style: 'percent',
|
||
minimumFractionDigits: 2,
|
||
maximumFractionDigits: 2,
|
||
}).format,
|
||
]
|
||
)
|
||
);
|
||
|
||
const defaultFormatters = {
|
||
resultTerm: Intl.NumberFormat('ru').format,
|
||
};
|
||
|
||
export const formatters = Object.assign(moneyFormatters, percentFormatters, defaultFormatters);
|