@things-factory/invoice 10.1.157 → 10.1.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/document/document-amount.d.ts +3 -3
- package/dist-client/document/document-amount.js +3 -5
- package/dist-client/document/document-amount.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/invoice/invoice-rules.d.ts +1 -0
- package/dist-server/service/invoice/invoice-rules.js +5 -3
- package/dist-server/service/invoice/invoice-rules.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-shared/currency-digits.d.ts +6 -0
- package/dist-shared/currency-digits.js +22 -0
- package/dist-shared/currency-digits.js.map +1 -0
- package/package.json +8 -7
- package/shared/currency-digits.ts +18 -0
- package/translations/ko.json +2 -2
- package/tsconfig.shared.json +18 -0
- package/tsconfig.shared.tsbuildinfo +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
/** An amount in its currency, with exactly the currency's decimal places. */
|
|
1
|
+
import { currencyDigits } from '@things-factory/invoice/dist-shared/currency-digits.js';
|
|
2
|
+
export { currencyDigits };
|
|
3
|
+
/** An amount in its currency, with exactly the currency's decimal places; a code the platform does not know, plainly. */
|
|
4
4
|
export declare function documentAmount(value: number | null | undefined, currency: string): string;
|
|
5
5
|
/** The currencies a document may be written in, most used first. */
|
|
6
6
|
export declare function currencyChoices(): string[];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { i18next } from '@operato/i18n';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
/** An amount in its currency, with exactly the currency's decimal places. */
|
|
2
|
+
import { currencyDigits } from '@things-factory/invoice/dist-shared/currency-digits.js';
|
|
3
|
+
export { currencyDigits };
|
|
4
|
+
/** An amount in its currency, with exactly the currency's decimal places; a code the platform does not know, plainly. */
|
|
7
5
|
export function documentAmount(value, currency) {
|
|
8
6
|
if (value === null || value === undefined || !Number.isFinite(Number(value)))
|
|
9
7
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-amount.js","sourceRoot":"","sources":["../../client/document/document-amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"document-amount.js","sourceRoot":"","sources":["../../client/document/document-amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAA;AAEvF,OAAO,EAAE,cAAc,EAAE,CAAA;AAEzB,yHAAyH;AACzH,MAAM,UAAU,cAAc,CAAC,KAAgC,EAAE,QAAgB;IAC/E,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACvF,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACvC,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,CAAC,EAAE,CAAA;AAClJ,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,GAAI,IAAY,CAAC,iBAAiB,CAAC,CAAC,CAAG,IAAY,CAAC,iBAAiB,CAAC,UAAU,CAAc,CAAC,CAAC,CAAC,EAAE,CAAA;IAC5G,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IACjD,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { i18next } from '@operato/i18n'\nimport { currencyDigits } from '@things-factory/invoice/dist-shared/currency-digits.js'\n\nexport { currencyDigits }\n\n/** An amount in its currency, with exactly the currency's decimal places; a code the platform does not know, plainly. */\nexport function documentAmount(value: number | null | undefined, currency: string): string {\n if (value === null || value === undefined || !Number.isFinite(Number(value))) return ''\n const digits = currencyDigits(currency)\n return `${currency} ${Number(value).toLocaleString(i18next.language || 'ko', { minimumFractionDigits: digits, maximumFractionDigits: digits })}`\n}\n\n/** The currencies a document may be written in, most used first. */\nexport function currencyChoices(): string[] {\n const all = (Intl as any).supportedValuesOf ? ((Intl as any).supportedValuesOf('currency') as string[]) : []\n const first = ['KRW', 'USD', 'EUR', 'JPY', 'CNY']\n return [...first, ...all.filter(code => !first.includes(code))]\n}\n"]}
|