Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3500,6 +3500,7 @@ const CONST = {
PROVINCIAL_TAX_POSTING_ACCOUNT: 'provincialTaxPostingAccount',
ALLOW_FOREIGN_CURRENCY: 'allowForeignCurrency',
EXPORT_TO_NEXT_OPEN_PERIOD: 'exportToNextOpenPeriod',
SPLIT_EXPORTS_BY_POSTING_PERIOD: 'splitExportsByPostingPeriod',
IMPORT_FIELDS: ['departments', 'classes', 'locations'],
AUTO_SYNC: 'autoSync',
ACCOUNTING_METHOD: 'accountingMethod',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5510,6 +5510,11 @@ ${amount} für ${merchant} – ${date}`,
journalEntriesProvTaxPostingAccount: 'Buchungszeilen-Konto für Provinzsteuerbuchungen',
foreignCurrencyAmount: 'Betrag in Fremdwährung exportieren',
exportToNextOpenPeriod: 'In die nächste offene Periode exportieren',
exportToNextOpenPeriodLockedSubtitle:
'Um den Export in die nächste offene Periode zu deaktivieren, deaktiviere zuerst die Aufteilung nicht erstattungsfähiger Exporte nach Periode.',
splitExportsByPostingPeriod: 'Exporte nach Buchungsperiode aufteilen',
splitExportsByPostingPeriodSubtitle:
'Aktiviere den Export in die nächste offene Periode, um die Aufteilung nicht erstattungsfähiger Exporte nach Periode in NetSuite zu aktivieren',
nonReimbursableJournalPostingAccount: 'Nicht erstattungsfähiges Konto für Buchungssätze',
reimbursableJournalPostingAccount: 'Konto für die Verbuchung erstattungsfähiger Posten',
journalPostingPreference: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5595,6 +5595,11 @@ ${amount} για ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Λογαριασμός καταχώρισης επαρχιακού φόρου για λογιστικές εγγραφές',
foreignCurrencyAmount: 'Εξαγωγή ποσού σε ξένο νόμισμα',
exportToNextOpenPeriod: 'Εξαγωγή στην επόμενη ανοικτή περίοδο',
exportToNextOpenPeriodLockedSubtitle:
'Για να απενεργοποιήσετε την εξαγωγή στην επόμενη ανοικτή περίοδο, απενεργοποιήστε πρώτα τη διαίρεση των μη αποζημιώσιμων εξαγωγών ανά περίοδο.',
splitExportsByPostingPeriod: 'Διαίρεση εξαγωγών ανά περίοδο καταχώρισης',
splitExportsByPostingPeriodSubtitle:
'Ενεργοποιήστε την εξαγωγή στην επόμενη ανοικτή περίοδο για να ενεργοποιήσετε τη διαίρεση των μη αποζημιώσιμων εξαγωγών ανά περίοδο στο NetSuite',
nonReimbursableJournalPostingAccount: 'Λογαριασμός καταχώρισης μη αποζημιώσιμων εγγραφών',
reimbursableJournalPostingAccount: 'Λογαριασμός καταχώρισης ημερολογίου επιστρέψιμων εξόδων',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5639,6 +5639,9 @@ const translations = {
journalEntriesProvTaxPostingAccount: 'Journal entries provincial tax posting account',
foreignCurrencyAmount: 'Export foreign currency amount',
exportToNextOpenPeriod: 'Export to next open period',
exportToNextOpenPeriodLockedSubtitle: 'To disable export to next open period, first disable split non-reimbursable exports by period.',
splitExportsByPostingPeriod: 'Split exports by posting period',
splitExportsByPostingPeriodSubtitle: 'Enable export to next open period to enable split non-reimbursable exports by period in NetSuite',
nonReimbursableJournalPostingAccount: 'Non-reimbursable journal posting account',
reimbursableJournalPostingAccount: 'Reimbursable journal posting account',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5436,6 +5436,9 @@ ${amount} para ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Cuenta de registro de impuestos provinciales de asientos contables',
foreignCurrencyAmount: 'Exportar importe en moneda extranjera',
exportToNextOpenPeriod: 'Exportar al siguiente período abierto',
exportToNextOpenPeriodLockedSubtitle: 'Para desactivar la exportación al siguiente período abierto, primero desactiva la división de exportaciones no reembolsables por período.',
splitExportsByPostingPeriod: 'Dividir exportaciones por período contable',
splitExportsByPostingPeriodSubtitle: 'Activa la exportación al siguiente período abierto para habilitar la división de exportaciones no reembolsables por período en NetSuite',
nonReimbursableJournalPostingAccount: 'Cuenta de registro de diario no reembolsable',
reimbursableJournalPostingAccount: 'Cuenta de registro de diario reembolsable',
journalPostingPreference: {
Expand Down
5 changes: 5 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5517,6 +5517,11 @@ ${amount} pour ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Compte de comptabilisation de la taxe provinciale des écritures de journal',
foreignCurrencyAmount: 'Exporter le montant en devise étrangère',
exportToNextOpenPeriod: 'Exporter vers la prochaine période ouverte',
exportToNextOpenPeriodLockedSubtitle:
"Pour désactiver l'exportation vers la prochaine période ouverte, désactivez d'abord la division des exportations non remboursables par période.",
splitExportsByPostingPeriod: 'Diviser les exportations par période comptable',
splitExportsByPostingPeriodSubtitle:
"Activez l'exportation vers la prochaine période ouverte pour activer la division des exportations non remboursables par période dans NetSuite",
nonReimbursableJournalPostingAccount: 'Compte de saisie des écritures non remboursables',
reimbursableJournalPostingAccount: 'Compte de comptabilisation des écritures remboursables',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5474,6 +5474,9 @@ ${amount} per ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Conto di registrazione contabile dell’imposta provinciale',
foreignCurrencyAmount: 'Esporta importo in valuta estera',
exportToNextOpenPeriod: 'Esporta nel prossimo periodo aperto',
exportToNextOpenPeriodLockedSubtitle: "Per disattivare l'esportazione nel prossimo periodo aperto, disattiva prima la divisione delle esportazioni non rimborsabili per periodo.",
splitExportsByPostingPeriod: 'Dividi le esportazioni per periodo di registrazione',
splitExportsByPostingPeriodSubtitle: "Attiva l'esportazione nel prossimo periodo aperto per abilitare la divisione delle esportazioni non rimborsabili per periodo in NetSuite",
nonReimbursableJournalPostingAccount: 'Conto di registrazione per spese non rimborsabili',
reimbursableJournalPostingAccount: 'Conto di registrazione per rimborsabili',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5418,6 +5418,9 @@ ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの'
journalEntriesProvTaxPostingAccount: '仕訳の地方税計上勘定',
foreignCurrencyAmount: '外貨金額をエクスポート',
exportToNextOpenPeriod: '次の未締め期間にエクスポート',
exportToNextOpenPeriodLockedSubtitle: '次の未締め期間へのエクスポートを無効にするには、先に立替精算対象外エクスポートの期間ごとの分割を無効にしてください。',
splitExportsByPostingPeriod: '転記期間ごとにエクスポートを分割',
splitExportsByPostingPeriodSubtitle: 'NetSuiteで立替精算対象外エクスポートの期間ごとの分割を有効にするには、次の未締め期間へのエクスポートを有効にしてください',
nonReimbursableJournalPostingAccount: '立替精算対象外の仕訳計上勘定',
reimbursableJournalPostingAccount: '立替精算用仕訳計上勘定',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5473,6 +5473,9 @@ ${amount} voor ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Boekingen provinciale belastingboekingsrekening',
foreignCurrencyAmount: 'Bedrag in vreemde valuta exporteren',
exportToNextOpenPeriod: 'Exporteren naar volgende open periode',
exportToNextOpenPeriodLockedSubtitle: 'Om exporteren naar de volgende open periode uit te schakelen, schakel eerst het splitsen van niet-vergoedbare exports per periode uit.',
splitExportsByPostingPeriod: 'Exports splitsen per boekingsperiode',
splitExportsByPostingPeriodSubtitle: 'Schakel exporteren naar de volgende open periode in om het splitsen van niet-vergoedbare exports per periode in NetSuite in te schakelen',
nonReimbursableJournalPostingAccount: 'Niet-vergoedbaar journaalboekkostenrekening',
reimbursableJournalPostingAccount: 'Boekhoudrekening voor terugbetaalbare boeking',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5500,6 +5500,9 @@ ${amount} dla ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Konto księgowania prowincjonalnego podatku w dzienniku',
foreignCurrencyAmount: 'Eksportuj kwotę w walucie obcej',
exportToNextOpenPeriod: 'Eksportuj do następnego otwartego okresu',
exportToNextOpenPeriodLockedSubtitle: 'Aby wyłączyć eksport do następnego otwartego okresu, najpierw wyłącz dzielenie eksportów niepodlegających zwrotowi według okresu.',
splitExportsByPostingPeriod: 'Podziel eksporty według okresu księgowego',
splitExportsByPostingPeriodSubtitle: 'Włącz eksport do następnego otwartego okresu, aby włączyć dzielenie eksportów niepodlegających zwrotowi według okresu w NetSuite',
nonReimbursableJournalPostingAccount: 'Konto księgowania nierozliczanych wydatków',
reimbursableJournalPostingAccount: 'Konto księgowe dla zwrotów kosztów',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5466,6 +5466,9 @@ ${amount} para ${merchant} - ${date}`,
journalEntriesProvTaxPostingAccount: 'Conta de lançamento de impostos provinciais em lançamentos contábeis',
foreignCurrencyAmount: 'Exportar valor em moeda estrangeira',
exportToNextOpenPeriod: 'Exportar para o próximo período em aberto',
exportToNextOpenPeriodLockedSubtitle: 'Para desativar a exportação para o próximo período em aberto, primeiro desative a divisão de exportações não reembolsáveis por período.',
splitExportsByPostingPeriod: 'Dividir exportações por período de lançamento',
splitExportsByPostingPeriodSubtitle: 'Ative a exportação para o próximo período em aberto para habilitar a divisão de exportações não reembolsáveis por período no NetSuite',
nonReimbursableJournalPostingAccount: 'Conta de lançamento de diário não reembolsável',
reimbursableJournalPostingAccount: 'Conta contábil para lançamentos reembolsáveis',
journalPostingPreference: {
Expand Down
3 changes: 3 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5283,6 +5283,9 @@ ${amount},商户:${merchant} - 日期:${date}`,
journalEntriesProvTaxPostingAccount: '日记账分录省税过账科目',
foreignCurrencyAmount: '导出外币金额',
exportToNextOpenPeriod: '导出到下一个未结会计期间',
exportToNextOpenPeriodLockedSubtitle: '要禁用导出到下一个未结会计期间,请先禁用按期间拆分不可报销导出。',
splitExportsByPostingPeriod: '按过账期间拆分导出',
splitExportsByPostingPeriodSubtitle: '启用导出到下一个未结会计期间,以在 NetSuite 中启用按期间拆分不可报销导出',
nonReimbursableJournalPostingAccount: '不可报销日记账入账科目',
reimbursableJournalPostingAccount: '可报销日记账过账科目',
journalPostingPreference: {
Expand Down
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ const WRITE_COMMANDS = {
UPDATE_NETSUITE_TAX_POSTING_ACCOUNT: 'UpdateNetSuiteTaxPostingAccount',
UPDATE_NETSUITE_ALLOW_FOREIGN_CURRENCY: 'UpdateNetSuiteAllowForeignCurrency',
UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD: 'UpdateNetSuiteExportToNextOpenPeriod',
UPDATE_NETSUITE_SPLIT_EXPORTS_BY_POSTING_PERIOD: 'UpdateNetSuiteSplitExportsByPostingPeriod',
UPDATE_NETSUITE_CUSTOM_SEGMENTS: 'UpdateNetSuiteCustomSegments',
UPDATE_NETSUITE_CUSTOM_LISTS: 'UpdateNetSuiteCustomLists',
UPDATE_NETSUITE_AUTO_SYNC: 'UpdateNetSuiteAutoSync',
Expand Down Expand Up @@ -1347,6 +1348,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_NETSUITE_TAX_POSTING_ACCOUNT]: Parameters.UpdateNetSuiteGenericTypeParams<'bankAccountID', string>;
[WRITE_COMMANDS.UPDATE_NETSUITE_ALLOW_FOREIGN_CURRENCY]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_SPLIT_EXPORTS_BY_POSTING_PERIOD]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_CUSTOM_SEGMENTS]: Parameters.UpdateNetSuiteGenericTypeParams<'customSegments', string>; // JSON string NetSuiteCustomSegment[]
[WRITE_COMMANDS.UPDATE_NETSUITE_CUSTOM_LISTS]: Parameters.UpdateNetSuiteGenericTypeParams<'customLists', string>; // JSON string NetSuiteCustomList[]
[WRITE_COMMANDS.UPDATE_NETSUITE_AUTO_SYNC]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
Expand Down
11 changes: 11 additions & 0 deletions src/libs/actions/connections/NetSuiteCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,16 @@ function updateNetSuiteExportToNextOpenPeriod(policyID: string, value: boolean,
API.write(WRITE_COMMANDS.UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD, parameters, onyxData);
}

function updateNetSuiteSplitExportsByPostingPeriod(policyID: string, value: boolean, oldValue: boolean) {
const onyxData = updateNetSuiteOnyxData(policyID, CONST.NETSUITE_CONFIG.SPLIT_EXPORTS_BY_POSTING_PERIOD, value, oldValue);

const parameters = {
policyID,
enabled: value,
};
API.write(WRITE_COMMANDS.UPDATE_NETSUITE_SPLIT_EXPORTS_BY_POSTING_PERIOD, parameters, onyxData);
}

function updateNetSuiteAutoSync(policyID: string | undefined, value: boolean) {
if (!policyID) {
return;
Expand Down Expand Up @@ -1123,6 +1133,7 @@ export {
updateNetSuiteProvincialTaxPostingAccount,
updateNetSuiteAllowForeignCurrency,
updateNetSuiteExportToNextOpenPeriod,
updateNetSuiteSplitExportsByPostingPeriod,
updateNetSuiteImportMapping,
updateNetSuiteCrossSubsidiaryCustomersConfiguration,
updateNetSuiteCustomSegments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import usePermissions from '@hooks/usePermissions';
import useThemeStyles from '@hooks/useThemeStyles';
import useWorkspaceAccountID from '@hooks/useWorkspaceAccountID';

import {updateNetSuiteAllowForeignCurrency, updateNetSuiteExportToNextOpenPeriod} from '@libs/actions/connections/NetSuiteCommands';
import {updateNetSuiteAllowForeignCurrency, updateNetSuiteExportToNextOpenPeriod, updateNetSuiteSplitExportsByPostingPeriod} from '@libs/actions/connections/NetSuiteCommands';
import {getCardSettings} from '@libs/CardUtils';
import {getLatestErrorField} from '@libs/ErrorUtils';
import createDynamicRoute from '@libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute';
Expand Down Expand Up @@ -208,6 +208,24 @@ function NetSuiteExportConfigurationPage({policy}: WithPolicyConnectionsProps) {
onToggle: () => (!policyID ? null : updateNetSuiteExportToNextOpenPeriod(policyID, !config?.exportToNextOpenPeriod, config?.exportToNextOpenPeriod ?? false)),
pendingAction: settingsPendingAction([CONST.NETSUITE_CONFIG.EXPORT_TO_NEXT_OPEN_PERIOD], config?.pendingFields),
errors: getLatestErrorField(config, CONST.NETSUITE_CONFIG.EXPORT_TO_NEXT_OPEN_PERIOD),
// Split exports need the next-open-period fallback for closed periods, so this stays locked while split is on
disabled: !!config?.splitExportsByPostingPeriod,
showLockIcon: !!config?.splitExportsByPostingPeriod,
subtitle: config?.splitExportsByPostingPeriod ? translate('workspace.netsuite.exportToNextOpenPeriodLockedSubtitle') : undefined,
},
{
type: 'toggle',
title: translate('workspace.netsuite.splitExportsByPostingPeriod'),
isActive: !!config?.splitExportsByPostingPeriod,
switchAccessibilityLabel: translate('workspace.netsuite.splitExportsByPostingPeriod'),
subtitle: !config?.exportToNextOpenPeriod && !config?.splitExportsByPostingPeriod ? translate('workspace.netsuite.splitExportsByPostingPeriodSubtitle') : undefined,
onCloseError: !policyID ? undefined : () => clearNetSuiteErrorField(policyID, CONST.NETSUITE_CONFIG.SPLIT_EXPORTS_BY_POSTING_PERIOD),
onToggle: () => (!policyID ? null : updateNetSuiteSplitExportsByPostingPeriod(policyID, !config?.splitExportsByPostingPeriod, config?.splitExportsByPostingPeriod ?? false)),
pendingAction: settingsPendingAction([CONST.NETSUITE_CONFIG.SPLIT_EXPORTS_BY_POSTING_PERIOD], config?.pendingFields),
errors: getLatestErrorField(config, CONST.NETSUITE_CONFIG.SPLIT_EXPORTS_BY_POSTING_PERIOD),
// Splitting moves expenses to earlier dates which can land in closed periods, so it needs the next-open-period fallback. An active split stays editable so a bad config state can always be undone.
disabled: !config?.exportToNextOpenPeriod && !config?.splitExportsByPostingPeriod,
showLockIcon: !config?.exportToNextOpenPeriod && !config?.splitExportsByPostingPeriod,
},
];

Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/accounting/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function getAccountingIntegrationData(
...(!shouldHideTaxPostingAccountSelect(canUseNetSuiteUSATax, netsuiteSelectedSubsidiary, netsuiteConfig) ? [CONST.NETSUITE_CONFIG.TAX_POSTING_ACCOUNT] : []),
...(!shouldHideExportForeignCurrencyAmount(netsuiteConfig) ? [CONST.NETSUITE_CONFIG.ALLOW_FOREIGN_CURRENCY] : []),
CONST.NETSUITE_CONFIG.EXPORT_TO_NEXT_OPEN_PERIOD,
CONST.NETSUITE_CONFIG.SPLIT_EXPORTS_BY_POSTING_PERIOD,
],
onCardReconciliationPagePress: () => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_CARD_RECONCILIATION.getRoute(policyID, CONST.POLICY.CONNECTIONS.ROUTE.NETSUITE)),
onAdvancedPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_ADVANCED.getRoute(policyID)),
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,9 @@ type NetSuiteConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Whether we should export to the most recent open period if the current one is closed */
exportToNextOpenPeriod: boolean;

/** Whether non-reimbursable exports are split into one transaction per calendar month */
splitExportsByPostingPeriod?: boolean;

/** Whether we will include the original foreign amount of a transaction to NetSuite */
allowForeignCurrency?: boolean;

Expand Down
Loading