@swan-io/shared-business 13.4.11 → 13.4.13
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/package.json +3 -3
- package/src/components/AccountStatement.js +2 -2
- package/src/components/AccountStatementHeader.js +2 -1
- package/src/components/TaxIdentificationNumberInput.js +1 -1
- package/src/locales/de.json +3 -3
- package/src/locales/en.json +3 -3
- package/src/locales/es.json +3 -3
- package/src/locales/fi.json +3 -3
- package/src/locales/fr.json +4 -4
- package/src/locales/it.json +3 -3
- package/src/locales/nl.json +3 -3
- package/src/locales/pt.json +3 -3
- package/src/utils/validation.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/shared-business",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.13",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">22.12.0"
|
|
6
6
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@swan-io/lake": "13.4.
|
|
28
|
+
"@swan-io/lake": "13.4.13"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@formatjs/intl": "^3.1.6",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@types/react-dom": "^19.1.7",
|
|
51
51
|
"@types/react-native": "^0.72.8",
|
|
52
52
|
"type-fest": "^4.41.0",
|
|
53
|
-
"@swan-io/lake": "13.4.
|
|
53
|
+
"@swan-io/lake": "13.4.13"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Box } from "@swan-io/lake/src/components/Box";
|
|
3
3
|
import { Space } from "@swan-io/lake/src/components/Space";
|
|
4
4
|
import { colors, spacings } from "@swan-io/lake/src/constants/design";
|
|
5
|
-
import { isNotNullish } from "@swan-io/lake/src/utils/nullish";
|
|
5
|
+
import { isNotEmpty, isNotNullish } from "@swan-io/lake/src/utils/nullish";
|
|
6
6
|
import { StyleSheet, Text } from "react-native";
|
|
7
7
|
import { match } from "ts-pattern";
|
|
8
8
|
import { t } from "../utils/i18n";
|
|
@@ -98,7 +98,7 @@ const translateTransaction = (transaction) => {
|
|
|
98
98
|
export const AccountStatementV1 = ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
|
|
99
99
|
return (_jsx(Box, { style: style, children: _jsx(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: _jsxs(Box, { children: [_jsx(Box, { direction: "row", justifyContent: "spaceBetween", children: _jsx(Text, { style: styles.pageTitle, children: t("accountStatement.titleDocument") }) }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.pageSubTitle, children: accountHolderType === "Company"
|
|
100
100
|
? t("accountStatement.titleDocument.companyDescription")
|
|
101
|
-
: t("accountStatement.titleDocument.individualDescription") }), _jsx(Text, { style: styles.sectionTitle, children: accountHolderName.toUpperCase() }), _jsx(Text, { style: styles.text, children: accountHolderAddress.street }), _jsxs(Text, { style: styles.text, children: [accountHolderAddress.city, ", ", isNotNullish(accountHolderAddress.country) && (accountHolderAddress.country)] })] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.firstSectionTitle, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 24 }),
|
|
101
|
+
: t("accountStatement.titleDocument.individualDescription") }), _jsx(Text, { style: styles.sectionTitle, children: accountHolderName.toUpperCase() }), _jsx(Text, { style: styles.text, children: accountHolderAddress.street }), _jsxs(Text, { style: styles.text, children: [accountHolderAddress.city, ", ", isNotNullish(accountHolderAddress.country) && (accountHolderAddress.country)] })] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.firstSectionTitle, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 24 }), isNotEmpty(iban) && (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.iban") }), _jsx(Text, { style: styles.text, children: iban })] })), _jsx(Space, { height: 12 }), isNotEmpty(bic) && (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.bic") }), _jsx(Text, { style: styles.text, children: bic })] })), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.dateTitle, children: t("accountStatement.date", { openingDate, closingDate }) }) }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.openingBalanceText, children: t("accountStatement.openingBalance") }), _jsx(Text, { style: styles.totalAmount, children: openingBalance.value })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: { backgroundColor: colors.gray[50] }, children: [_jsx(Text, { style: [styles.titleColumn, { width: "15%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "22%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "33%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(transaction => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "15%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "22%" }], children: translateTransaction(transaction.type) }), _jsx(Text, { style: [styles.textColumn, { width: "33%" }], children: transaction.label }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.credit ? transaction.credit.value : "" }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.debit ? transaction.debit.value : "" })] }, transaction.id))) })] }), _jsx(Space, { height: 20 }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.fees") }), _jsx(Text, { style: styles.row, children: feesCredit.value }), _jsx(Text, { style: styles.row, children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.total") }), _jsx(Text, { style: styles.row, children: totalsCredit.value }), _jsx(Text, { style: styles.row, children: totalsDebit.value })] })] }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { style: styles.closingBalanceRowText, text: t("accountStatement.closingBalance") }), _jsx(Title, { text: closingBalance.value, style: styles.totalAmount, align: "right" })] }) })] }) }) }));
|
|
102
102
|
};
|
|
103
103
|
export const AccountStatement = (props) => match(props)
|
|
104
104
|
.with({ version: "v1" }, props => _jsx(AccountStatementV1, { ...props }))
|
|
@@ -32,6 +32,7 @@ const styles = {
|
|
|
32
32
|
logo: {
|
|
33
33
|
display: "flex",
|
|
34
34
|
alignItems: "center",
|
|
35
|
+
marginLeft: 10,
|
|
35
36
|
},
|
|
36
37
|
defaultLogo: {
|
|
37
38
|
height: LOGO_MAX_HEIGHT,
|
|
@@ -44,7 +45,7 @@ const styles = {
|
|
|
44
45
|
top: 0.5,
|
|
45
46
|
},
|
|
46
47
|
pageNumber: {
|
|
47
|
-
fontSize: "
|
|
48
|
+
fontSize: "14px",
|
|
48
49
|
color: "#26232F",
|
|
49
50
|
fontWeight: "500",
|
|
50
51
|
textTransform: "uppercase",
|
|
@@ -10,5 +10,5 @@ export const TaxIdentificationNumberInput = ({ ref, value, error, valid, disable
|
|
|
10
10
|
? getCompanyTaxNumberPlaceholder(country)
|
|
11
11
|
: getIndividualTaxNumberPlaceholder(country), }) => {
|
|
12
12
|
const tooltipContents = getTaxNumberTooltip(country);
|
|
13
|
-
return (_jsx(LakeLabel, { label: label, optionalLabel: required === true ? undefined : t("common.optional"), help: tooltipContents != null ? (_jsx(LakeTooltip, { content: tooltipContents, placement: "right",
|
|
13
|
+
return (_jsx(LakeLabel, { label: label, optionalLabel: required === true ? undefined : t("common.optional"), help: tooltipContents != null ? (_jsx(LakeTooltip, { content: tooltipContents, placement: "right", children: _jsx(Icon, { name: "question-circle-regular", size: 16, color: colors.gray[600] }) })) : null, render: id => (_jsx(LakeTextInput, { id: id, ref: ref, placeholder: placeholder, help: isCompany ? getCompanyTaxNumberHelp(country) : getIndividualTaxNumberHelp(country), value: value, error: error, valid: valid, disabled: disabled, onChangeText: onChange, onBlur: onBlur })) }));
|
|
14
14
|
};
|
package/src/locales/de.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Jahr",
|
|
103
103
|
"error.generic": "Ein Fehler ist aufgetreten",
|
|
104
104
|
"error.iban.invalid": "Diese IBAN sieht nicht korrekt aus. Bitte versuchen Sie es erneut.",
|
|
105
|
+
"error.invalidEmail": "Ungültige E-Mail-Adresse",
|
|
106
|
+
"error.invalidName": "Ungültiger Name",
|
|
107
|
+
"error.invalidVatNumber": "Ungültige USt.-ID",
|
|
105
108
|
"error.network.500": "Interner Serverfehler",
|
|
106
109
|
"error.network.503": "Dienst nicht verfügbar",
|
|
107
110
|
"error.requiredField": "Das ist ein Pflichtfeld",
|
|
108
|
-
"error.invalidVatNumber": "Ungültige USt.-ID",
|
|
109
|
-
"error.invalidEmail": "Ungültige E-Mail-Adresse",
|
|
110
|
-
"error.invalidName": "Ungültiger Name",
|
|
111
111
|
"fileInput.browse": "Durchsuchen",
|
|
112
112
|
"fileInput.clickToModify": "Zum Ändern hier klicken",
|
|
113
113
|
"fileInput.dropFile": "Legen Sie Ihre Datei ab, oder {browse}",
|
package/src/locales/en.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Year",
|
|
103
103
|
"error.generic": "An error occurred",
|
|
104
104
|
"error.iban.invalid": "This IBAN doesn't look right. Trying entering it again.",
|
|
105
|
+
"error.invalidEmail": "Invalid email",
|
|
106
|
+
"error.invalidName": "Invalid name",
|
|
107
|
+
"error.invalidVatNumber": "Invalid VAT number",
|
|
105
108
|
"error.network.500": "Internal server error",
|
|
106
109
|
"error.network.503": "Service unavailable",
|
|
107
110
|
"error.requiredField": "This field is required",
|
|
108
|
-
"error.invalidVatNumber": "Invalid VAT number",
|
|
109
|
-
"error.invalidEmail": "Invalid email",
|
|
110
|
-
"error.invalidName": "Invalid name",
|
|
111
111
|
"fileInput.browse": "browse",
|
|
112
112
|
"fileInput.clickToModify": "Click to modify",
|
|
113
113
|
"fileInput.dropFile": "Drop your file, or {browse}",
|
package/src/locales/es.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Año",
|
|
103
103
|
"error.generic": "Ha ocurrido un error",
|
|
104
104
|
"error.iban.invalid": "El IBAN no es correcto. Vuelve a intentarlo.",
|
|
105
|
+
"error.invalidEmail": "Este correo electrónico no es válido",
|
|
106
|
+
"error.invalidName": "Invalid name",
|
|
107
|
+
"error.invalidVatNumber": "Este número de IVA no es válido",
|
|
105
108
|
"error.network.500": "Error de servidor interno",
|
|
106
109
|
"error.network.503": "Servicio no disponible",
|
|
107
110
|
"error.requiredField": "Este campo es obligatorio",
|
|
108
|
-
"error.invalidVatNumber": "Este número de IVA no es válido",
|
|
109
|
-
"error.invalidEmail": "Este correo electrónico no es válido",
|
|
110
|
-
"error.invalidName": "Invalid name",
|
|
111
111
|
"fileInput.browse": "usa el explorador",
|
|
112
112
|
"fileInput.clickToModify": "Haz clic para modificar",
|
|
113
113
|
"fileInput.dropFile": "Suelta el archivo o {browse}",
|
package/src/locales/fi.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Vuosi",
|
|
103
103
|
"error.generic": "Virhe tapahtui",
|
|
104
104
|
"error.iban.invalid": "IBAN-tilinumero ei näytä olevan oikein. Yritä syöttää se uudelleen.",
|
|
105
|
+
"error.invalidEmail": "Virheellinen sähköpostiosoite ",
|
|
106
|
+
"error.invalidName": "Nimi on väärässä muodossa",
|
|
107
|
+
"error.invalidVatNumber": "Virheellinen ALV-numero",
|
|
105
108
|
"error.network.500": "Sisäinen palvelinvirhe",
|
|
106
109
|
"error.network.503": "Palvelua ei saatavilla",
|
|
107
110
|
"error.requiredField": "Vaadittu kenttä",
|
|
108
|
-
"error.invalidVatNumber": "Virheellinen ALV-numero",
|
|
109
|
-
"error.invalidEmail": "Virheellinen sähköpostiosoite ",
|
|
110
|
-
"error.invalidName": "Nimi on väärässä muodossa",
|
|
111
111
|
"fileInput.browse": "selaa",
|
|
112
112
|
"fileInput.clickToModify": "Napsauta muokkkaaksesi",
|
|
113
113
|
"fileInput.dropFile": "Pudota tiedostosi tähän tai {browse}",
|
package/src/locales/fr.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"accountStatement.column.credit": "Crédit (€)",
|
|
7
7
|
"accountStatement.column.date": "Date",
|
|
8
8
|
"accountStatement.column.debit": "Débit (€)",
|
|
9
|
-
"accountStatement.column.description": "
|
|
9
|
+
"accountStatement.column.description": "Description",
|
|
10
10
|
"accountStatement.column.fees": "Frais",
|
|
11
11
|
"accountStatement.column.total": "Total",
|
|
12
12
|
"accountStatement.column.totals": "Totaux",
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Année",
|
|
103
103
|
"error.generic": "Une erreur est survenue",
|
|
104
104
|
"error.iban.invalid": "Cet IBAN semble incorrect. Veuillez le ressaisir.",
|
|
105
|
+
"error.invalidEmail": "E-mail non valide",
|
|
106
|
+
"error.invalidName": "Nom non valide",
|
|
107
|
+
"error.invalidVatNumber": "Numéro de TVA non valide",
|
|
105
108
|
"error.network.500": "Erreur de serveur interne",
|
|
106
109
|
"error.network.503": "Service indisponible",
|
|
107
110
|
"error.requiredField": "Ce champ est requis",
|
|
108
|
-
"error.invalidVatNumber": "Numéro de TVA non valide",
|
|
109
|
-
"error.invalidEmail": "E-mail non valide",
|
|
110
|
-
"error.invalidName": "Nom non valide",
|
|
111
111
|
"fileInput.browse": "parcourir",
|
|
112
112
|
"fileInput.clickToModify": "Cliquez pour modifier",
|
|
113
113
|
"fileInput.dropFile": "Déposez votre fichier, ou {browse}",
|
package/src/locales/it.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Anno",
|
|
103
103
|
"error.generic": "Si è verificato un errore",
|
|
104
104
|
"error.iban.invalid": "L'IBAN non è corretto. Provi a inserirlo di nuovo.",
|
|
105
|
+
"error.invalidEmail": "L'indirizzo e-mail non è valido",
|
|
106
|
+
"error.invalidName": "Nome non valido",
|
|
107
|
+
"error.invalidVatNumber": "Numero di partita IVA non valido",
|
|
105
108
|
"error.network.500": "Errore interno del server",
|
|
106
109
|
"error.network.503": "Servizio non disponibile",
|
|
107
110
|
"error.requiredField": "Questo campo è obbligatorio",
|
|
108
|
-
"error.invalidVatNumber": "Numero di partita IVA non valido",
|
|
109
|
-
"error.invalidEmail": "L'indirizzo e-mail non è valido",
|
|
110
|
-
"error.invalidName": "Nome non valido",
|
|
111
111
|
"fileInput.browse": "sfoglia",
|
|
112
112
|
"fileInput.clickToModify": "Clicchi per modificare",
|
|
113
113
|
"fileInput.dropFile": "Carica i file, o {browse}",
|
package/src/locales/nl.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Jaar",
|
|
103
103
|
"error.generic": "Er is een fout opgetreden",
|
|
104
104
|
"error.iban.invalid": "Dit IBAN nummer lijkt niet juist. Probeer het nog eens.",
|
|
105
|
+
"error.invalidEmail": "Dit e-mailadres is ongeldig",
|
|
106
|
+
"error.invalidName": "Ongeldige naam",
|
|
107
|
+
"error.invalidVatNumber": "Dit BTW-nummer is ongeldig",
|
|
105
108
|
"error.network.500": "Interne Server Fout",
|
|
106
109
|
"error.network.503": "Dienst niet beschikbaar",
|
|
107
110
|
"error.requiredField": "Dit veld is verplicht",
|
|
108
|
-
"error.invalidVatNumber": "Dit BTW-nummer is ongeldig",
|
|
109
|
-
"error.invalidEmail": "Dit e-mailadres is ongeldig",
|
|
110
|
-
"error.invalidName": "Ongeldige naam",
|
|
111
111
|
"fileInput.browse": "browsen",
|
|
112
112
|
"fileInput.clickToModify": "Klik om te bewerken",
|
|
113
113
|
"fileInput.dropFile": "Sleep uw bestand hiernaartoe, of {browse}",
|
package/src/locales/pt.json
CHANGED
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"datePicker.year": "Ano",
|
|
103
103
|
"error.generic": "Ocorreu um erro",
|
|
104
104
|
"error.iban.invalid": "Este IBAN não parece correto. Tente inserir novamente.",
|
|
105
|
+
"error.invalidEmail": "Este e-mail é inválido",
|
|
106
|
+
"error.invalidName": "Nome inválido",
|
|
107
|
+
"error.invalidVatNumber": "Número de IVA inválido",
|
|
105
108
|
"error.network.500": "Erro interno do servidor",
|
|
106
109
|
"error.network.503": "Serviço indisponível",
|
|
107
110
|
"error.requiredField": "Este campo é obrigatório",
|
|
108
|
-
"error.invalidVatNumber": "Número de IVA inválido",
|
|
109
|
-
"error.invalidEmail": "Este e-mail é inválido",
|
|
110
|
-
"error.invalidName": "Nome inválido",
|
|
111
111
|
"fileInput.browse": "navegar",
|
|
112
112
|
"fileInput.clickToModify": "Clique para modificar",
|
|
113
113
|
"fileInput.dropFile": "Arraste o seu ficheiro, ou {browse}",
|
package/src/utils/validation.js
CHANGED
|
@@ -229,7 +229,7 @@ export const getCompanyTaxNumberPlaceholder = (country) => match(country)
|
|
|
229
229
|
.with("ITA", () => `${t("common.form.taxIdentificationNumber.placeholder")} (Codice fiscale)`)
|
|
230
230
|
.otherwise(() => t("common.form.taxIdentificationNumber.placeholder"));
|
|
231
231
|
export const getTaxNumberTooltip = (country) => match(country)
|
|
232
|
-
.with("DEU", () => "
|
|
232
|
+
.with("DEU", () => "Persönliche Steueridentifikationsnummer des wirtschaftlich Berechtigten")
|
|
233
233
|
.with("ESP", () => "Número de Identificación Fiscal") // no need to translate
|
|
234
234
|
.with("ITA", () => t("common.form.taxIdentificationNumber.tooltip.ita"))
|
|
235
235
|
.otherwise(() => undefined);
|