@layerfi/components 0.1.135 → 0.1.136-alpha
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/cjs/index.cjs +777 -407
- package/dist/esm/index.mjs +763 -393
- package/dist/index.css +278 -11
- package/dist/index.d.ts +7 -2
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -104,8 +104,9 @@ let recharts = require("recharts");
|
|
|
104
104
|
let react_dom = require("react-dom");
|
|
105
105
|
let react_calendly = require("react-calendly");
|
|
106
106
|
let react_aria_components_Meter = require("react-aria-components/Meter");
|
|
107
|
-
let react_aria_components_Collection = require("react-aria-components/Collection");
|
|
108
107
|
let react_aria_components_Tree = require("react-aria-components/Tree");
|
|
108
|
+
let react_aria_components_Collection = require("react-aria-components/Collection");
|
|
109
|
+
let react_aria_components_ListBox = require("react-aria-components/ListBox");
|
|
109
110
|
let react_aria_components_Breadcrumbs = require("react-aria-components/Breadcrumbs");
|
|
110
111
|
let react_aria_components_Link = require("react-aria-components/Link");
|
|
111
112
|
//#region \0@oxc-project+runtime@0.127.0/helpers/typeof.js
|
|
@@ -283,7 +284,7 @@ var getIntlLocale = (locale) => {
|
|
|
283
284
|
};
|
|
284
285
|
var package_default = {
|
|
285
286
|
name: "@layerfi/components",
|
|
286
|
-
version: "0.1.
|
|
287
|
+
version: "0.1.136-alpha",
|
|
287
288
|
description: "Layer React Components",
|
|
288
289
|
main: "dist/cjs/index.cjs",
|
|
289
290
|
module: "dist/esm/index.mjs",
|
|
@@ -728,7 +729,7 @@ function _requestOAuthToken() {
|
|
|
728
729
|
return _requestOAuthToken.apply(this, arguments);
|
|
729
730
|
}
|
|
730
731
|
var AUTH_TAG_KEY = "#auth";
|
|
731
|
-
function buildKey$
|
|
732
|
+
function buildKey$90({ appId, appSecret, businessAccessToken, apiUrl, authUrl, scope }) {
|
|
732
733
|
if (businessAccessToken) return {
|
|
733
734
|
apiUrl,
|
|
734
735
|
businessAccessToken,
|
|
@@ -751,7 +752,7 @@ var FALLBACK_REFRESH_MS = DEFAULT_EXPIRES_IN_SECONDS / 2 * 1e3;
|
|
|
751
752
|
function useAuth() {
|
|
752
753
|
const { apiUrl, authUrl, scope } = useEnvironment();
|
|
753
754
|
const { appId, appSecret, businessAccessToken } = useAuthInput();
|
|
754
|
-
return (0, swr.default)(() => buildKey$
|
|
755
|
+
return (0, swr.default)(() => buildKey$90({
|
|
755
756
|
appId,
|
|
756
757
|
appSecret,
|
|
757
758
|
businessAccessToken,
|
|
@@ -799,7 +800,7 @@ var useLayerContext = () => {
|
|
|
799
800
|
var BANK_ACCOUNTS_TAG_KEY = "#bank-accounts";
|
|
800
801
|
var requiresNotification = (bankAccount) => bankAccount.is_disconnected && bankAccount.notify_when_disconnected;
|
|
801
802
|
var listBankAccounts = get$1(({ businessId }) => `/v1/businesses/${businessId}/bank-accounts`);
|
|
802
|
-
function buildKey$
|
|
803
|
+
function buildKey$89({ access_token: accessToken, apiUrl, businessId }) {
|
|
803
804
|
if (accessToken && apiUrl) return {
|
|
804
805
|
accessToken,
|
|
805
806
|
apiUrl,
|
|
@@ -820,7 +821,7 @@ function useListBankAccounts() {
|
|
|
820
821
|
const { businessId } = useLayerContext();
|
|
821
822
|
const { apiUrl } = useEnvironment();
|
|
822
823
|
const { data: auth } = useAuth();
|
|
823
|
-
return new ListBankAccountsSWRResponse((0, swr.default)(() => buildKey$
|
|
824
|
+
return new ListBankAccountsSWRResponse((0, swr.default)(() => buildKey$89(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
824
825
|
apiUrl,
|
|
825
826
|
businessId
|
|
826
827
|
})), ({ accessToken, apiUrl, businessId }) => listBankAccounts(apiUrl, accessToken, { params: { businessId } })().then(({ data }) => data)));
|
|
@@ -1208,6 +1209,7 @@ var common_default$1 = {
|
|
|
1208
1209
|
"accounting": "Accounting",
|
|
1209
1210
|
"ach": "ACH",
|
|
1210
1211
|
"address": "Address",
|
|
1212
|
+
"all": "All",
|
|
1211
1213
|
"amount": "Amount",
|
|
1212
1214
|
"assets": "Assets",
|
|
1213
1215
|
"balance": "Balance",
|
|
@@ -1475,6 +1477,7 @@ var invoices_default$1 = {
|
|
|
1475
1477
|
action: {
|
|
1476
1478
|
"add_line_item": "Add line item",
|
|
1477
1479
|
"create_invoice": "Create Invoice",
|
|
1480
|
+
"download_pdf": "Download PDF",
|
|
1478
1481
|
"mark_paid": "Mark as paid",
|
|
1479
1482
|
"mark_void": "Mark as void",
|
|
1480
1483
|
"record_invoice_payment": "Record invoice payment",
|
|
@@ -1494,6 +1497,7 @@ var invoices_default$1 = {
|
|
|
1494
1497
|
},
|
|
1495
1498
|
error: {
|
|
1496
1499
|
"couldnt_load_invoices": "We couldn’t load your invoices",
|
|
1500
|
+
"download_failed": "Download failed",
|
|
1497
1501
|
"load_invoices": "An error occurred while loading your invoices. Please check your connection and try again.",
|
|
1498
1502
|
"load_payment_methods": "We couldn't load payment methods",
|
|
1499
1503
|
"refund_invoice": "There was an error issuing a refund for this invoice. Please check your connection and try again in a few seconds.",
|
|
@@ -1511,6 +1515,8 @@ var invoices_default$1 = {
|
|
|
1511
1515
|
"custom": "Custom",
|
|
1512
1516
|
"custom_payment_instructions": "Custom Payment Instructions",
|
|
1513
1517
|
"discount": "Discount",
|
|
1518
|
+
"download_started": "Download started",
|
|
1519
|
+
"download_successful": "Download successful",
|
|
1514
1520
|
"due_date": "Due date",
|
|
1515
1521
|
"editing_invoice": "Editing Invoice",
|
|
1516
1522
|
"editing_invoice_number": "Editing Invoice #{{invoiceNumber}}",
|
|
@@ -1520,6 +1526,7 @@ var invoices_default$1 = {
|
|
|
1520
1526
|
"invoice_number_component": "<label>Invoice</label> <value>#{{invoiceNumber}}</value>",
|
|
1521
1527
|
"invoice_number_label": "Invoice number",
|
|
1522
1528
|
"invoice_paid_successfully": "Invoice paid successfully",
|
|
1529
|
+
"invoice_saved": "Invoice saved",
|
|
1523
1530
|
"invoice_saved_and_sent_successfully": "Invoice saved and sent successfully",
|
|
1524
1531
|
"invoices": "Invoices",
|
|
1525
1532
|
"net_10": "Net 10",
|
|
@@ -1755,9 +1762,11 @@ var reports_default$1 = {
|
|
|
1755
1762
|
"load_reports_navigation": "Something went wrong while loading this navigation. Please try again."
|
|
1756
1763
|
},
|
|
1757
1764
|
label: {
|
|
1765
|
+
"accrual": "Accrual",
|
|
1758
1766
|
"adjustments_net_income": "Adjustments to Net Income",
|
|
1759
1767
|
"assets": "Assets",
|
|
1760
1768
|
"balance_sheet": "Balance Sheet",
|
|
1769
|
+
"cash": "Cash",
|
|
1761
1770
|
"cash_beginning_of_period": "Cash at Beginning of Period",
|
|
1762
1771
|
"cash_end_of_period": "Cash at End of Period",
|
|
1763
1772
|
"cash_flow_statement": "Cash Flow Statement",
|
|
@@ -1777,9 +1786,11 @@ var reports_default$1 = {
|
|
|
1777
1786
|
"profit_loss_detail_report": "Profit and Loss Detail Report",
|
|
1778
1787
|
"report_period": "Report period",
|
|
1779
1788
|
"report_type": "Report type",
|
|
1789
|
+
"reporting_basis": "Reporting basis",
|
|
1780
1790
|
"reports": "Reports",
|
|
1781
1791
|
"reports_navigation": "Reports navigation",
|
|
1782
1792
|
"select_report": "Select report",
|
|
1793
|
+
"switch_report": "Switch report",
|
|
1783
1794
|
"total_display_name": "Total of {{displayName}}"
|
|
1784
1795
|
}
|
|
1785
1796
|
};
|
|
@@ -2029,7 +2040,6 @@ var timeTracking_default$1 = {
|
|
|
2029
2040
|
};
|
|
2030
2041
|
var trips_default$1 = {
|
|
2031
2042
|
action: {
|
|
2032
|
-
"add_trip": "Add Trip",
|
|
2033
2043
|
"delete_trip": "Delete Trip",
|
|
2034
2044
|
"edit_trip": "Edit Trip",
|
|
2035
2045
|
"record_trip": "Record Trip",
|
|
@@ -2295,7 +2305,7 @@ var bankTransactions_default = {
|
|
|
2295
2305
|
"split_transaction": "Répartir la transaction",
|
|
2296
2306
|
"uncategorize_all": "Tout décatégoriser",
|
|
2297
2307
|
"upload_receipt": "Téléverser un reçu",
|
|
2298
|
-
"upload_transactions_manually": "
|
|
2308
|
+
"upload_transactions_manually": "Importer les transactions manuellement"
|
|
2299
2309
|
},
|
|
2300
2310
|
empty: {
|
|
2301
2311
|
"no_categorized_transactions": "Vous n’avez aucune transaction catégorisée",
|
|
@@ -2310,7 +2320,7 @@ var bankTransactions_default = {
|
|
|
2310
2320
|
"approval_failed_check_connection": "L’approbation a échoué. Vérifiez la connexion et réessayez dans quelques secondes.",
|
|
2311
2321
|
"categorize_transactions": "Échec de la catégorisation des transactions",
|
|
2312
2322
|
"confirm_transactions": "Échec de la confirmation des transactions",
|
|
2313
|
-
"couldnt_load_transactions": "Nous n’avons pas
|
|
2323
|
+
"couldnt_load_transactions": "Nous n’avons pas réussi à récupérer vos transactions",
|
|
2314
2324
|
"delete": "Échec de la suppression",
|
|
2315
2325
|
"download_retry": "Le téléchargement a échoué, veuillez réessayer",
|
|
2316
2326
|
"matching_transactions_not_found": "Nous n’avons pas trouvé de transactions correspondantes",
|
|
@@ -2328,14 +2338,14 @@ var bankTransactions_default = {
|
|
|
2328
2338
|
"affected_transactions": "Transactions concernées",
|
|
2329
2339
|
"all_categories_uppercase": "TOUTES LES CATÉGORIES",
|
|
2330
2340
|
"all_done": "Tout est terminé",
|
|
2331
|
-
"bank_transactions": "
|
|
2341
|
+
"bank_transactions": "Activité bancaire",
|
|
2332
2342
|
"categorization_status": "État de la catégorisation",
|
|
2333
2343
|
"categorize_count_selected_one": "Cette action catégorisera {{displayCount}} transaction sélectionnée dans la catégorie {{category}}.",
|
|
2334
2344
|
"categorize_count_selected_other": "Cette action catégorisera {{displayCount}} transactions sélectionnées dans la catégorie {{category}}.",
|
|
2335
2345
|
"categorized": "Catégorisé",
|
|
2336
2346
|
"count_transactions_will_be_skipped_one": "{{displayCount}} transaction sera ignorée en raison de l’absence de catégorie.",
|
|
2337
2347
|
"count_transactions_will_be_skipped_other": "{{displayCount}} transactions seront ignorées en raison de l’absence de catégorie.",
|
|
2338
|
-
"data_on_platform_categorize": "Une fois vos données sur la plateforme, catégorisez-les dans l’onglet
|
|
2348
|
+
"data_on_platform_categorize": "Une fois vos données sur la plateforme, catégorisez-les dans l’onglet Activité bancaire",
|
|
2339
2349
|
"find_match": "Trouver une correspondance",
|
|
2340
2350
|
"generating_suggestions": "Génération des suggestions...",
|
|
2341
2351
|
"generating_suggestions_transaction": "Génération de suggestions pour la transaction...",
|
|
@@ -2368,7 +2378,7 @@ var bankTransactions_default = {
|
|
|
2368
2378
|
"transfer_uppercase": "VIREMENT",
|
|
2369
2379
|
"uncategorize_count_selected_one": "Cette action décatégorisera {{displayCount}} transaction sélectionnée.",
|
|
2370
2380
|
"uncategorize_count_selected_other": "Cette action décatégorisera {{displayCount}} transactions sélectionnées.",
|
|
2371
|
-
"upload_transactions_or_wait_for_bank_sync": "
|
|
2381
|
+
"upload_transactions_or_wait_for_bank_sync": "Importez vos transactions ou attendez qu’elles soient synchronisées depuis votre banque"
|
|
2372
2382
|
},
|
|
2373
2383
|
prompt: {
|
|
2374
2384
|
"categorize_selected_transactions": "Catégoriser toutes les transactions sélectionnées?",
|
|
@@ -2396,7 +2406,6 @@ var bookkeeping_default = {
|
|
|
2396
2406
|
"bookkeeping_tasks": "Tâches de tenue de livres",
|
|
2397
2407
|
"complete_bookkeeping_onboarding_call": "Une fois votre appel d’intégration à la tenue de livres terminé, vos tâches de tenue de livres s’afficheront ici.",
|
|
2398
2408
|
"completed_over_total_done_one": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminée",
|
|
2399
|
-
"completed_over_total_done_many": "",
|
|
2400
2409
|
"completed_over_total_done_other": "<completed>{{displayCompletedTaskCount}}</completed>/{{displayTotalTaskCount}} terminées",
|
|
2401
2410
|
"count_open_tasks_one": "{{displayCount}} tâche ouverte en {{displayYear}}",
|
|
2402
2411
|
"count_open_tasks_other": "{{displayCount}} tâches ouvertes en {{displayYear}}",
|
|
@@ -2604,7 +2613,7 @@ var common_default = {
|
|
|
2604
2613
|
"download_label": "Télécharger",
|
|
2605
2614
|
"edit_details": "Modifier les détails",
|
|
2606
2615
|
"edit_label": "Modifier",
|
|
2607
|
-
"expand_all": "
|
|
2616
|
+
"expand_all": "Tout développer",
|
|
2608
2617
|
"link_label": "Lier",
|
|
2609
2618
|
"manage_label": "Gérer",
|
|
2610
2619
|
"post_label": "Comptabiliser",
|
|
@@ -2627,9 +2636,9 @@ var common_default = {
|
|
|
2627
2636
|
},
|
|
2628
2637
|
empty: { "results": "Aucun résultat trouvé" },
|
|
2629
2638
|
error: {
|
|
2630
|
-
"couldnt_load_data": "Nous n’avons pas
|
|
2639
|
+
"couldnt_load_data": "Nous n’avons pas réussi à récupérer vos données.",
|
|
2631
2640
|
"download_failed_check_connection": "Le téléchargement a échoué. Vérifiez votre connexion et réessayez dans quelques secondes.",
|
|
2632
|
-
"load_options": "
|
|
2641
|
+
"load_options": "Le chargement des options a échoué",
|
|
2633
2642
|
"please_try_again": "Veuillez réessayer.",
|
|
2634
2643
|
"please_try_again_later": "Veuillez réessayer plus tard",
|
|
2635
2644
|
"saving": "Erreur lors de l’enregistrement",
|
|
@@ -2643,11 +2652,12 @@ var common_default = {
|
|
|
2643
2652
|
"accounting": "Comptabilité",
|
|
2644
2653
|
"ach": "ACH",
|
|
2645
2654
|
"address": "Adresse",
|
|
2655
|
+
"all": "Tous",
|
|
2646
2656
|
"amount": "Montant",
|
|
2647
2657
|
"assets": "Actifs",
|
|
2648
2658
|
"balance": "Solde",
|
|
2649
2659
|
"bulk_actions": "Actions groupées",
|
|
2650
|
-
"business": "
|
|
2660
|
+
"business": "Commerce",
|
|
2651
2661
|
"cash": "Espèces",
|
|
2652
2662
|
"category": "Catégorie",
|
|
2653
2663
|
"check": "Chèque",
|
|
@@ -2910,6 +2920,7 @@ var invoices_default = {
|
|
|
2910
2920
|
action: {
|
|
2911
2921
|
"add_line_item": "Ajouter une ligne",
|
|
2912
2922
|
"create_invoice": "Créer une facture",
|
|
2923
|
+
"download_pdf": "Télécharger le PDF",
|
|
2913
2924
|
"mark_paid": "Marquer comme payée",
|
|
2914
2925
|
"mark_void": "Marquer comme annulée",
|
|
2915
2926
|
"record_invoice_payment": "Enregistrer le paiement de la facture",
|
|
@@ -2928,7 +2939,8 @@ var invoices_default = {
|
|
|
2928
2939
|
"invoices_filtered": "Nous n’avons trouvé aucune facture avec les filtres actuels. Essayez de les modifier ou de les effacer pour voir plus de résultats."
|
|
2929
2940
|
},
|
|
2930
2941
|
error: {
|
|
2931
|
-
"couldnt_load_invoices": "Nous n’avons pas
|
|
2942
|
+
"couldnt_load_invoices": "Nous n’avons pas réussi à récupérer vos factures",
|
|
2943
|
+
"download_failed": "Échec du téléchargement",
|
|
2932
2944
|
"load_invoices": "Une erreur s’est produite lors du chargement de vos factures. Veuillez vérifier votre connexion et réessayer.",
|
|
2933
2945
|
"load_payment_methods": "Nous n’avons pas pu charger les modes de paiement",
|
|
2934
2946
|
"refund_invoice": "Une erreur s’est produite lors de l’émission d’un remboursement pour cette facture. Veuillez vérifier votre connexion et réessayer dans quelques secondes.",
|
|
@@ -2946,6 +2958,8 @@ var invoices_default = {
|
|
|
2946
2958
|
"custom": "Personnalisé",
|
|
2947
2959
|
"custom_payment_instructions": "Instructions de paiement personnalisées",
|
|
2948
2960
|
"discount": "Rabais",
|
|
2961
|
+
"download_started": "Téléchargement démarré",
|
|
2962
|
+
"download_successful": "Téléchargement réussi",
|
|
2949
2963
|
"due_date": "Date d’échéance",
|
|
2950
2964
|
"editing_invoice": "Modification de la facture",
|
|
2951
2965
|
"editing_invoice_number": "Modification de la facture #{{invoiceNumber}}",
|
|
@@ -2955,6 +2969,7 @@ var invoices_default = {
|
|
|
2955
2969
|
"invoice_number_component": "<label>Facture</label> <value>#{{invoiceNumber}}</value>",
|
|
2956
2970
|
"invoice_number_label": "Numéro de facture",
|
|
2957
2971
|
"invoice_paid_successfully": "Facture payée avec succès",
|
|
2972
|
+
"invoice_saved": "Facture enregistrée",
|
|
2958
2973
|
"invoice_saved_and_sent_successfully": "Facture enregistrée et envoyée avec succès",
|
|
2959
2974
|
"invoices": "Factures",
|
|
2960
2975
|
"net_10": "Net 10",
|
|
@@ -2965,7 +2980,7 @@ var invoices_default = {
|
|
|
2965
2980
|
"number_abbreviation": "N°",
|
|
2966
2981
|
"open_balance": "Solde impayé",
|
|
2967
2982
|
"overdue_invoices_count": "Factures en retard : {{overdueCount}}",
|
|
2968
|
-
"owed_last_12_months": "<owed>
|
|
2983
|
+
"owed_last_12_months": "<owed>Ce qui vous est dû</owed> <period>12 derniers mois</period>",
|
|
2969
2984
|
"paid_last_30_days": "<paid>Payé</paid> <period>30 derniers jours</period>",
|
|
2970
2985
|
"payment_date": "Date du paiement",
|
|
2971
2986
|
"payment_details": "Détails du paiement",
|
|
@@ -2984,8 +2999,8 @@ var invoices_default = {
|
|
|
2984
2999
|
"reset_invoice_warning": "La réinitialisation de cette facture supprimera tous les paiements, remboursements et radiations qui y sont associés et la remettra à l’état envoyé.",
|
|
2985
3000
|
"search_invoices": "Rechercher des factures",
|
|
2986
3001
|
"sent_date": "Date d’envoi",
|
|
2987
|
-
"status_filter": "Filtre
|
|
2988
|
-
"status_with_label": "
|
|
3002
|
+
"status_filter": "Filtre de statut",
|
|
3003
|
+
"status_with_label": "Statut : {{label}}",
|
|
2989
3004
|
"subtotal": "Sous-total",
|
|
2990
3005
|
"tax_rate": "Taux d’imposition",
|
|
2991
3006
|
"tax_rate_title_case": "Taux d’imposition",
|
|
@@ -3038,8 +3053,8 @@ var invoices_default = {
|
|
|
3038
3053
|
};
|
|
3039
3054
|
var landingPage_default = {
|
|
3040
3055
|
action: {
|
|
3041
|
-
"book_call": "
|
|
3042
|
-
"learn_more": "
|
|
3056
|
+
"book_call": "Planifier un appel",
|
|
3057
|
+
"learn_more": "Découvrir plus"
|
|
3043
3058
|
},
|
|
3044
3059
|
label: {
|
|
3045
3060
|
"all_finances_in_one_place": "Toutes vos finances en un seul endroit",
|
|
@@ -3062,7 +3077,7 @@ var landingPage_default = {
|
|
|
3062
3077
|
"track_business_finances_within_platform": "Suivez les finances de votre entreprise, directement dans {{platformName}}.",
|
|
3063
3078
|
"track_expenses_and_get_reports": "Suivez vos dépenses et obtenez des rapports faciles à comprendre, conçus spécialement pour les entreprises du secteur {{industry}}.",
|
|
3064
3079
|
"track_expenses_and_receipts": "Suivez les dépenses et les reçus",
|
|
3065
|
-
"use_platform_name_accounting": "Utilisez
|
|
3080
|
+
"use_platform_name_accounting": "Utilisez {{platformName}} Accounting vous même, ou laissez votre tenue de livres à notre équipe d’experts"
|
|
3066
3081
|
}
|
|
3067
3082
|
};
|
|
3068
3083
|
var linkedAccounts_default = {
|
|
@@ -3117,10 +3132,10 @@ var linkedAccounts_default = {
|
|
|
3117
3132
|
"import_data_simple_integration": "Importez des données grâce à une intégration simple.",
|
|
3118
3133
|
"ledger_balance": "Solde du grand livre",
|
|
3119
3134
|
"link_bank_accounts_and_credit_cards": "Liez vos comptes bancaires et vos cartes de crédit",
|
|
3120
|
-
"link_more_accounts_any_time": "Vous pouvez lier d’autres comptes en tout temps à partir de la section
|
|
3135
|
+
"link_more_accounts_any_time": "Vous pouvez lier d’autres comptes en tout temps à partir de la section Activité bancaire",
|
|
3121
3136
|
"link_your_bank_accounts": "Liez vos comptes bancaires",
|
|
3122
3137
|
"link_your_bank_accounts_description": "Lier vos comptes bancaires nous permet de charger vos opérations bancaires et de les catégoriser automatiquement.",
|
|
3123
|
-
"linked_accounts": "Comptes
|
|
3138
|
+
"linked_accounts": "Comptes connectés",
|
|
3124
3139
|
"loading_accounts": "Chargement de vos comptes...",
|
|
3125
3140
|
"may_take_few_minutes": "Cela peut prendre quelques minutes",
|
|
3126
3141
|
"may_take_up_to_5_minutes": "Cela peut prendre jusqu’à 5 minutes",
|
|
@@ -3154,13 +3169,13 @@ var mileageTracking_default = {
|
|
|
3154
3169
|
label: {
|
|
3155
3170
|
"deduction_colon": "Déduction :",
|
|
3156
3171
|
"in_year": "En {{year}}",
|
|
3157
|
-
"mileage_tracking": "Suivi
|
|
3172
|
+
"mileage_tracking": "Suivi des kilomètres parcourus",
|
|
3158
3173
|
"miles_colon": "Kilométrage\xA0:",
|
|
3159
3174
|
"miles_month": "Kilométrage ce mois-ci",
|
|
3160
3175
|
"standard_rate_formatted_deduction": "Taux standard\xA0: {{formattedDeductionRate}}/mile",
|
|
3161
3176
|
"tax_deduction": "Déduction fiscale",
|
|
3162
3177
|
"total_deduction": "Déduction totale",
|
|
3163
|
-
"total_miles": "
|
|
3178
|
+
"total_miles": "Kilomètres totaux",
|
|
3164
3179
|
"total_miles_in_year": "Total des milles en {{displayYear}}\xA0:",
|
|
3165
3180
|
"total_tax_deduction": "Déduction fiscale totale :"
|
|
3166
3181
|
}
|
|
@@ -3190,9 +3205,11 @@ var reports_default = {
|
|
|
3190
3205
|
"load_reports_navigation": "Une erreur s’est produite lors du chargement de cette navigation. Veuillez réessayer."
|
|
3191
3206
|
},
|
|
3192
3207
|
label: {
|
|
3208
|
+
"accrual": "Comptabilité d'exercice",
|
|
3193
3209
|
"adjustments_net_income": "Ajustements au bénéfice net",
|
|
3194
3210
|
"assets": "Actifs",
|
|
3195
3211
|
"balance_sheet": "Bilan",
|
|
3212
|
+
"cash": "Comptabilité de caisse",
|
|
3196
3213
|
"cash_beginning_of_period": "Trésorerie au début de la période",
|
|
3197
3214
|
"cash_end_of_period": "Trésorerie à la fin de la période",
|
|
3198
3215
|
"cash_flow_statement": "État des flux de trésorerie",
|
|
@@ -3212,9 +3229,11 @@ var reports_default = {
|
|
|
3212
3229
|
"profit_loss_detail_report": "Rapport détaillé de l’état des résultats",
|
|
3213
3230
|
"report_period": "Période du rapport",
|
|
3214
3231
|
"report_type": "Type de rapport",
|
|
3232
|
+
"reporting_basis": "Méthode comptable",
|
|
3215
3233
|
"reports": "Rapports",
|
|
3216
3234
|
"reports_navigation": "Navigation des rapports",
|
|
3217
3235
|
"select_report": "Sélectionner un rapport",
|
|
3236
|
+
"switch_report": "Changer de rapport",
|
|
3218
3237
|
"total_display_name": "Total de {{displayName}}"
|
|
3219
3238
|
}
|
|
3220
3239
|
};
|
|
@@ -3371,7 +3390,7 @@ var timeTracking_default = {
|
|
|
3371
3390
|
"discard_timer": "Annuler le minuteur",
|
|
3372
3391
|
"edit_entry": "Modifier l'entrée",
|
|
3373
3392
|
"save_entry": "Enregistrer l'entrée",
|
|
3374
|
-
"start_timer": "
|
|
3393
|
+
"start_timer": "Commencer le minuteur",
|
|
3375
3394
|
"view_entry": "Voir l'entrée"
|
|
3376
3395
|
},
|
|
3377
3396
|
empty: {
|
|
@@ -3464,46 +3483,45 @@ var timeTracking_default = {
|
|
|
3464
3483
|
};
|
|
3465
3484
|
var trips_default = {
|
|
3466
3485
|
action: {
|
|
3467
|
-
"
|
|
3468
|
-
"
|
|
3469
|
-
"
|
|
3470
|
-
"
|
|
3471
|
-
"
|
|
3472
|
-
"view_trip": "Afficher le trajet"
|
|
3486
|
+
"delete_trip": "Supprimer le voyage",
|
|
3487
|
+
"edit_trip": "Modifier le voyage",
|
|
3488
|
+
"record_trip": "Ajouter un voyage",
|
|
3489
|
+
"save_trip": "Enregistrer le voyage",
|
|
3490
|
+
"view_trip": "Afficher le voyage"
|
|
3473
3491
|
},
|
|
3474
3492
|
empty: {
|
|
3475
|
-
"add_first_trip": "Ajoutez votre premier
|
|
3476
|
-
"no_trips_yet": "Aucun
|
|
3493
|
+
"add_first_trip": "Ajoutez votre premier voyage pour commencer à faire le suivi des kilomètres parcourus.",
|
|
3494
|
+
"no_trips_yet": "Aucun voyage pour le moment"
|
|
3477
3495
|
},
|
|
3478
3496
|
error: {
|
|
3479
|
-
"delete_trip": "Échec de la suppression du
|
|
3480
|
-
"load_trips": "Nous n'avons pas pu charger vos
|
|
3481
|
-
"load_trips_error": "Une erreur s'est produite lors du chargement de vos
|
|
3497
|
+
"delete_trip": "Échec de la suppression du voyage. Veuillez vérifier votre connexion et réessayer.",
|
|
3498
|
+
"load_trips": "Nous n'avons pas pu charger vos voyages",
|
|
3499
|
+
"load_trips_error": "Une erreur s'est produite lors du chargement de vos voyages. Veuillez vérifier votre connexion et réessayer."
|
|
3482
3500
|
},
|
|
3483
3501
|
label: {
|
|
3484
|
-
"additional_trip_actions": "Actions supplémentaires pour les
|
|
3485
|
-
"delete_trip_warning": "Ce
|
|
3502
|
+
"additional_trip_actions": "Actions supplémentaires pour les voyages",
|
|
3503
|
+
"delete_trip_warning": "Ce voyage sera supprimé définitivement. Cette action ne peut pas être annulée.",
|
|
3486
3504
|
"distance": "Distance",
|
|
3487
3505
|
"distance_mi": "{{distance}} mi",
|
|
3488
3506
|
"distance_miles": "Distance (milles)",
|
|
3489
3507
|
"end_address": "Adresse de destination",
|
|
3490
3508
|
"enter_address": "Saisissez l’adresse",
|
|
3491
3509
|
"enter_distance": "Saisissez la distance",
|
|
3492
|
-
"search_trips": "Rechercher des
|
|
3510
|
+
"search_trips": "Rechercher des voyages",
|
|
3493
3511
|
"start_address": "Adresse de départ",
|
|
3494
|
-
"trip_date": "Date du
|
|
3495
|
-
"trip_details": "Détails du
|
|
3512
|
+
"trip_date": "Date du voyage",
|
|
3513
|
+
"trip_details": "Détails du voyage",
|
|
3496
3514
|
"trip_end_address": "<bold>Destination :</bold> {{address}}",
|
|
3497
|
-
"trip_purpose": "Motif du
|
|
3515
|
+
"trip_purpose": "Motif du voyage",
|
|
3498
3516
|
"trip_start_address": "<bold>Départ :</bold> {{address}}",
|
|
3499
|
-
"trips": "
|
|
3517
|
+
"trips": "Voyages"
|
|
3500
3518
|
},
|
|
3501
|
-
prompt: { "delete_trip": "Supprimer ce
|
|
3519
|
+
prompt: { "delete_trip": "Supprimer ce voyage?" },
|
|
3502
3520
|
validation: {
|
|
3503
3521
|
"distance_greater_than_zero": "La distance doit être supérieure à zéro.",
|
|
3504
3522
|
"purpose_required": "Le motif est un champ obligatoire.",
|
|
3505
|
-
"trip_date_not_future": "La date du
|
|
3506
|
-
"trip_date_required": "La date du
|
|
3523
|
+
"trip_date_not_future": "La date du voyage ne peut pas être dans le futur.",
|
|
3524
|
+
"trip_date_required": "La date du voyage est un champ obligatoire."
|
|
3507
3525
|
}
|
|
3508
3526
|
};
|
|
3509
3527
|
var ui_default = {
|
|
@@ -3526,7 +3544,7 @@ var ui_default = {
|
|
|
3526
3544
|
};
|
|
3527
3545
|
var upload_default = {
|
|
3528
3546
|
action: {
|
|
3529
|
-
"click_copy_required": "Cliquez pour copier les
|
|
3547
|
+
"click_copy_required": "Cliquez pour copier les noms de colonnes requis",
|
|
3530
3548
|
"create_account": "Créer un compte",
|
|
3531
3549
|
"create_input_value": "Créer \"{{inputValue}}\"",
|
|
3532
3550
|
"download_template": "Télécharger le modèle",
|
|
@@ -3547,7 +3565,7 @@ var upload_default = {
|
|
|
3547
3565
|
"count_transactions_have_one": "{{displayCount}} transaction a été téléversée vers votre compte.",
|
|
3548
3566
|
"count_transactions_have_other": "{{displayCount}} transactions ont été téléversées vers votre compte.",
|
|
3549
3567
|
"csv_validation_preview": "Aperçu de la validation du fichier CSV",
|
|
3550
|
-
"drag_drop_file_browse": "Glissez
|
|
3568
|
+
"drag_drop_file_browse": "Glissez et déposez un fichier, ou <browse>parcourez vos fichiers</browse>.",
|
|
3551
3569
|
"im_done_uploading": "J’ai terminé de téléverser les transactions",
|
|
3552
3570
|
"need_help_download_example_csv": "Besoin d’aide? Téléchargez un fichier CSV d’exemple",
|
|
3553
3571
|
"review_transactions": "Vérifier les transactions",
|
|
@@ -3805,7 +3823,7 @@ var useLocalizedKey = () => {
|
|
|
3805
3823
|
var _excluded$119 = ["trigger"];
|
|
3806
3824
|
var UNLINK_BANK_ACCOUNT_TAG_KEY = "#unlink-bank-account";
|
|
3807
3825
|
var unlinkBankAccount = del(({ businessId, bankAccountId }) => `/v1/businesses/${businessId}/bank-accounts/${bankAccountId}`);
|
|
3808
|
-
function buildKey$
|
|
3826
|
+
function buildKey$88({ access_token: accessToken, apiUrl, businessId }) {
|
|
3809
3827
|
if (accessToken && apiUrl) return {
|
|
3810
3828
|
accessToken,
|
|
3811
3829
|
apiUrl,
|
|
@@ -3818,7 +3836,7 @@ function useUnlinkBankAccount() {
|
|
|
3818
3836
|
const { businessId } = useLayerContext();
|
|
3819
3837
|
const { apiUrl } = useEnvironment();
|
|
3820
3838
|
const { data: auth } = useAuth();
|
|
3821
|
-
const _useSWRMutation = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
3839
|
+
const _useSWRMutation = (0, swr_mutation.default)(() => withLocale(buildKey$88({
|
|
3822
3840
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
3823
3841
|
apiUrl,
|
|
3824
3842
|
businessId
|
|
@@ -9488,7 +9506,7 @@ var getBookkeepingStatus = get$1(({ businessId }) => {
|
|
|
9488
9506
|
});
|
|
9489
9507
|
var BOOKKEEPING_TAG_KEY = "#bookkeeping";
|
|
9490
9508
|
var BOOKKEEPING_STATUS_TAG_KEY = "#bookkeeping-status";
|
|
9491
|
-
function buildKey$
|
|
9509
|
+
function buildKey$87({ access_token: accessToken, apiUrl, businessId }) {
|
|
9492
9510
|
if (accessToken && apiUrl) return {
|
|
9493
9511
|
accessToken,
|
|
9494
9512
|
apiUrl,
|
|
@@ -9499,7 +9517,7 @@ function buildKey$86({ access_token: accessToken, apiUrl, businessId }) {
|
|
|
9499
9517
|
function useBookkeepingStatus() {
|
|
9500
9518
|
const { data: auth } = useAuth();
|
|
9501
9519
|
const { businessId } = useLayerContext();
|
|
9502
|
-
return (0, swr.default)(() => buildKey$
|
|
9520
|
+
return (0, swr.default)(() => buildKey$87(_objectSpread2(_objectSpread2({}, auth), {}, { businessId })), ({ accessToken, apiUrl, businessId }) => getBookkeepingStatus(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(BookkeepingStatusResponseSchema)).then(({ data }) => data));
|
|
9503
9521
|
}
|
|
9504
9522
|
function useBookkeepingStatusGlobalCacheActions() {
|
|
9505
9523
|
const { forceReload } = useGlobalCacheActions();
|
|
@@ -10506,7 +10524,7 @@ var CheckCircle$2 = (_ref) => {
|
|
|
10506
10524
|
//#endregion
|
|
10507
10525
|
//#region src/icons/RefreshCcw.tsx
|
|
10508
10526
|
var _excluded$106 = ["size"];
|
|
10509
|
-
var RefreshCcw$
|
|
10527
|
+
var RefreshCcw$2 = (_ref) => {
|
|
10510
10528
|
let { size = 18 } = _ref;
|
|
10511
10529
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", _objectSpread2(_objectSpread2({
|
|
10512
10530
|
viewBox: "0 0 18 18",
|
|
@@ -10598,7 +10616,7 @@ var DataState = ({ status, title, description, onRefresh, isLoading, icon, spaci
|
|
|
10598
10616
|
rightIcon: isLoading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loader$1, {
|
|
10599
10617
|
size: 14,
|
|
10600
10618
|
className: "Layer__anim--rotating"
|
|
10601
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
10619
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 }),
|
|
10602
10620
|
onClick: onRefresh,
|
|
10603
10621
|
disabled: isLoading,
|
|
10604
10622
|
children: t("common:action.refresh_label", "Refresh")
|
|
@@ -10718,7 +10736,7 @@ var BREAKPOINTS = {
|
|
|
10718
10736
|
//#endregion
|
|
10719
10737
|
//#region src/hooks/api/businesses/[business-id]/categories/useCategories.ts
|
|
10720
10738
|
var CATEGORIES_TAG_KEY = "#categories";
|
|
10721
|
-
function buildKey$
|
|
10739
|
+
function buildKey$86({ access_token: accessToken, apiUrl, businessId, mode }) {
|
|
10722
10740
|
if (accessToken && apiUrl) return {
|
|
10723
10741
|
accessToken,
|
|
10724
10742
|
apiUrl,
|
|
@@ -10734,7 +10752,7 @@ function useCategories({ mode } = {}) {
|
|
|
10734
10752
|
const withLocale = useLocalizedKey();
|
|
10735
10753
|
const { data: auth } = useAuth();
|
|
10736
10754
|
const { businessId } = useLayerContext();
|
|
10737
|
-
return (0, swr.default)(() => withLocale(buildKey$
|
|
10755
|
+
return (0, swr.default)(() => withLocale(buildKey$86(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
10738
10756
|
businessId,
|
|
10739
10757
|
mode
|
|
10740
10758
|
}))), ({ accessToken, apiUrl, businessId, mode }) => getCategories(apiUrl, accessToken, { params: {
|
|
@@ -10844,7 +10862,7 @@ function useCustomersGlobalCacheActions() {
|
|
|
10844
10862
|
//#endregion
|
|
10845
10863
|
//#region src/hooks/api/businesses/[business-id]/tags/dimensions/useTagDimensions.ts
|
|
10846
10864
|
var TAG_DIMENSIONS_TAG_KEY = "#tag-dimensions";
|
|
10847
|
-
function buildKey$
|
|
10865
|
+
function buildKey$85({ access_token: accessToken, apiUrl, businessId, isEnabled }) {
|
|
10848
10866
|
if (!isEnabled) return;
|
|
10849
10867
|
if (accessToken && apiUrl) return {
|
|
10850
10868
|
accessToken,
|
|
@@ -10860,7 +10878,7 @@ function useTagDimensions({ isEnabled = true } = {}) {
|
|
|
10860
10878
|
const { data: auth } = useAuth();
|
|
10861
10879
|
const { apiUrl } = useEnvironment();
|
|
10862
10880
|
const { businessId } = useLayerContext();
|
|
10863
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
10881
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$85(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
10864
10882
|
apiUrl,
|
|
10865
10883
|
businessId,
|
|
10866
10884
|
isEnabled
|
|
@@ -11263,7 +11281,7 @@ var getBankTransactionsExcel = get$1(({ businessId, categorized, direction, quer
|
|
|
11263
11281
|
sortOrder
|
|
11264
11282
|
})}`;
|
|
11265
11283
|
});
|
|
11266
|
-
function buildKey$
|
|
11284
|
+
function buildKey$84({ access_token: accessToken, apiUrl, businessId }) {
|
|
11267
11285
|
if (accessToken && apiUrl) return {
|
|
11268
11286
|
accessToken,
|
|
11269
11287
|
apiUrl,
|
|
@@ -11275,7 +11293,7 @@ function useBankTransactionsDownload() {
|
|
|
11275
11293
|
const withLocale = useLocalizedKey();
|
|
11276
11294
|
const { data } = useAuth();
|
|
11277
11295
|
const { businessId } = useLayerContext();
|
|
11278
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
11296
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$84(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { categorized, direction, query, startDate, endDate, tagFilterQueryString } }) => getBankTransactionsExcel(apiUrl, accessToken, { params: {
|
|
11279
11297
|
businessId,
|
|
11280
11298
|
categorized,
|
|
11281
11299
|
query,
|
|
@@ -11568,13 +11586,17 @@ var _excluded$103 = [
|
|
|
11568
11586
|
"pb",
|
|
11569
11587
|
"pbe",
|
|
11570
11588
|
"pbs",
|
|
11589
|
+
"pi",
|
|
11590
|
+
"pie",
|
|
11591
|
+
"pis",
|
|
11571
11592
|
"size",
|
|
11572
11593
|
"status",
|
|
11594
|
+
"textCase",
|
|
11573
11595
|
"variant",
|
|
11574
11596
|
"weight"
|
|
11575
11597
|
];
|
|
11576
11598
|
function splitTextProps(props) {
|
|
11577
|
-
const { align, children, ellipsis, nonAria, noWrap, numeric, pb, pbe, pbs, size, status, variant, weight } = props, restProps = _objectWithoutProperties(props, _excluded$103);
|
|
11599
|
+
const { align, children, ellipsis, nonAria, noWrap, numeric, pb, pbe, pbs, pi, pie, pis, size, status, textCase, variant, weight } = props, restProps = _objectWithoutProperties(props, _excluded$103);
|
|
11578
11600
|
return {
|
|
11579
11601
|
children,
|
|
11580
11602
|
dataProperties: toDataProperties({
|
|
@@ -11585,8 +11607,12 @@ function splitTextProps(props) {
|
|
|
11585
11607
|
pb,
|
|
11586
11608
|
pbe,
|
|
11587
11609
|
pbs,
|
|
11610
|
+
pi,
|
|
11611
|
+
pie,
|
|
11612
|
+
pis,
|
|
11588
11613
|
size,
|
|
11589
11614
|
status,
|
|
11615
|
+
"text-case": textCase,
|
|
11590
11616
|
variant,
|
|
11591
11617
|
weight
|
|
11592
11618
|
}),
|
|
@@ -12471,7 +12497,7 @@ var getProfitAndLossDetailLines = (apiUrl, accessToken, params) => {
|
|
|
12471
12497
|
//#endregion
|
|
12472
12498
|
//#region src/hooks/api/businesses/[business-id]/reports/profit-and-loss/useProfitAndLossReport.tsx
|
|
12473
12499
|
var PNL_REPORT_TAG_KEY = "#profit-and-loss-report";
|
|
12474
|
-
function buildKey$
|
|
12500
|
+
function buildKey$83({ access_token: accessToken, apiUrl, businessId, startDate, endDate, tagKey, tagValues, reportingBasis, includeUncategorized }) {
|
|
12475
12501
|
if (accessToken && apiUrl) return {
|
|
12476
12502
|
accessToken,
|
|
12477
12503
|
apiUrl,
|
|
@@ -12499,7 +12525,7 @@ function useProfitAndLossReport({ startDate, endDate, tagKey, tagValues, reporti
|
|
|
12499
12525
|
const withLocale = useLocalizedKey();
|
|
12500
12526
|
const { data } = useAuth();
|
|
12501
12527
|
const { businessId } = useLayerContext();
|
|
12502
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
12528
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$83(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
12503
12529
|
businessId,
|
|
12504
12530
|
startDate,
|
|
12505
12531
|
endDate,
|
|
@@ -12524,7 +12550,7 @@ var useProfitAndLossReportCacheActions = () => {
|
|
|
12524
12550
|
//#endregion
|
|
12525
12551
|
//#region src/hooks/api/businesses/[business-id]/reports/profit-and-loss-comparison/useProfitAndLossComparisonReport.tsx
|
|
12526
12552
|
var PNL_COMPARISON_REPORT_TAG_KEY = "#profit-and-loss-comparison-report";
|
|
12527
|
-
function buildKey$
|
|
12553
|
+
function buildKey$82({ access_token: accessToken, apiUrl, businessId, periods, tagFilters, reportingBasis }) {
|
|
12528
12554
|
if (accessToken && apiUrl && periods) return {
|
|
12529
12555
|
accessToken,
|
|
12530
12556
|
apiUrl,
|
|
@@ -12541,7 +12567,7 @@ function useProfitAndLossComparisonReport({ periods, tagFilters, reportingBasis
|
|
|
12541
12567
|
const { data } = useAuth();
|
|
12542
12568
|
const { businessId } = useLayerContext();
|
|
12543
12569
|
const { apiUrl } = useEnvironment();
|
|
12544
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
12570
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$82(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
12545
12571
|
apiUrl,
|
|
12546
12572
|
businessId,
|
|
12547
12573
|
periods,
|
|
@@ -12563,7 +12589,7 @@ var useProfitAndLossComparisonReportCacheActions = () => {
|
|
|
12563
12589
|
//#endregion
|
|
12564
12590
|
//#region src/hooks/api/businesses/[business-id]/reports/profit-and-loss-summaries/useProfitAndLossSummaries.tsx
|
|
12565
12591
|
var PNL_SUMMARIES_TAG_KEY = "#profit-and-loss-summaries";
|
|
12566
|
-
function buildKey$
|
|
12592
|
+
function buildKey$81({ access_token: accessToken, apiUrl, businessId, startMonth, startYear, endMonth, endYear, tagKey, tagValues, reportingBasis }) {
|
|
12567
12593
|
if (accessToken && apiUrl) return {
|
|
12568
12594
|
accessToken,
|
|
12569
12595
|
apiUrl,
|
|
@@ -12593,7 +12619,7 @@ function useProfitAndLossSummaries({ startYear, startMonth, endYear, endMonth, t
|
|
|
12593
12619
|
const withLocale = useLocalizedKey();
|
|
12594
12620
|
const { data } = useAuth();
|
|
12595
12621
|
const { businessId } = useLayerContext();
|
|
12596
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
12622
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$81(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
12597
12623
|
businessId,
|
|
12598
12624
|
startYear,
|
|
12599
12625
|
startMonth,
|
|
@@ -12656,7 +12682,7 @@ var CategorizeTransactionRequestSchema$1 = effect.Schema.Struct({
|
|
|
12656
12682
|
});
|
|
12657
12683
|
var BulkCategorizeRequestSchema = effect.Schema.Struct({ transactions: effect.Schema.Array(CategorizeTransactionRequestSchema$1) });
|
|
12658
12684
|
var bulkCategorize = post(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/bulk-categorize`);
|
|
12659
|
-
function buildKey$
|
|
12685
|
+
function buildKey$80({ access_token: accessToken, apiUrl, businessId }) {
|
|
12660
12686
|
if (accessToken && apiUrl) return {
|
|
12661
12687
|
accessToken,
|
|
12662
12688
|
apiUrl,
|
|
@@ -12670,7 +12696,7 @@ var useBulkCategorize = () => {
|
|
|
12670
12696
|
const { businessId, eventCallbacks } = useLayerContext();
|
|
12671
12697
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
12672
12698
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
12673
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
12699
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$80(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg }) => bulkCategorize(apiUrl, accessToken, {
|
|
12674
12700
|
params: { businessId },
|
|
12675
12701
|
body: effect.Schema.encodeSync(BulkCategorizeRequestSchema)(arg)
|
|
12676
12702
|
}).then(({ data }) => data), {
|
|
@@ -13122,7 +13148,7 @@ var MobileDrawerKeyboardSpacer = () => {
|
|
|
13122
13148
|
});
|
|
13123
13149
|
};
|
|
13124
13150
|
var DIALOG_CLASS_NAME = "Layer__Dialog";
|
|
13125
|
-
var Dialog$
|
|
13151
|
+
var Dialog$4 = (0, react.forwardRef)((_ref2, ref) => {
|
|
13126
13152
|
let { variant = "center", children, slots, isEntering, isExiting, fixedHeight } = _ref2, restProps = _objectWithoutProperties(_ref2, _excluded2$13);
|
|
13127
13153
|
const dataProperties = toDataProperties({
|
|
13128
13154
|
variant,
|
|
@@ -13146,7 +13172,7 @@ var Dialog$3 = (0, react.forwardRef)((_ref2, ref) => {
|
|
|
13146
13172
|
}
|
|
13147
13173
|
}));
|
|
13148
13174
|
});
|
|
13149
|
-
Dialog$
|
|
13175
|
+
Dialog$4.displayName = "Dialog";
|
|
13150
13176
|
function Modal({ isOpen, size = "md", flexBlock, flexInline, onOpenChange, children, "aria-label": ariaLabel, role, variant = "center", isDismissable = false }) {
|
|
13151
13177
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalOverlay, {
|
|
13152
13178
|
isOpen,
|
|
@@ -13158,7 +13184,7 @@ function Modal({ isOpen, size = "md", flexBlock, flexInline, onOpenChange, child
|
|
|
13158
13184
|
flexInline,
|
|
13159
13185
|
size,
|
|
13160
13186
|
variant,
|
|
13161
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog$
|
|
13187
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog$4, {
|
|
13162
13188
|
role: role !== null && role !== void 0 ? role : "dialog",
|
|
13163
13189
|
"aria-label": ariaLabel,
|
|
13164
13190
|
variant,
|
|
@@ -13178,7 +13204,7 @@ function Drawer({ isOpen, onOpenChange, size = "md", flexBlock, flexInline, chil
|
|
|
13178
13204
|
flexInline,
|
|
13179
13205
|
size,
|
|
13180
13206
|
variant,
|
|
13181
|
-
children: ({ isEntering, isExiting }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog$
|
|
13207
|
+
children: ({ isEntering, isExiting }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog$4, {
|
|
13182
13208
|
role: role !== null && role !== void 0 ? role : "dialog",
|
|
13183
13209
|
"aria-label": ariaLabel,
|
|
13184
13210
|
variant,
|
|
@@ -13330,7 +13356,7 @@ var AlertCircle$1 = (_ref) => {
|
|
|
13330
13356
|
//#endregion
|
|
13331
13357
|
//#region src/icons/Save.tsx
|
|
13332
13358
|
var _excluded$97 = ["size"];
|
|
13333
|
-
var Save$
|
|
13359
|
+
var Save$7 = (_ref) => {
|
|
13334
13360
|
let { size = 18 } = _ref;
|
|
13335
13361
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", _objectSpread2(_objectSpread2({
|
|
13336
13362
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -13377,7 +13403,7 @@ var RetryButton = (_ref) => {
|
|
|
13377
13403
|
className: baseClassName,
|
|
13378
13404
|
variant: ButtonVariant.secondary,
|
|
13379
13405
|
disabled: processing || disabled,
|
|
13380
|
-
rightIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
13406
|
+
rightIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 }),
|
|
13381
13407
|
justify: "center",
|
|
13382
13408
|
tooltip: error,
|
|
13383
13409
|
children
|
|
@@ -13419,7 +13445,7 @@ var buildRightIcon = ({ processing, error, action, noIcon }) => {
|
|
|
13419
13445
|
});
|
|
13420
13446
|
if (action === SubmitAction.UPLOAD) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.UploadCloud, { size: 12 });
|
|
13421
13447
|
if (action === SubmitAction.UPDATE) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckCircle$2, { size: 14 });
|
|
13422
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Save$
|
|
13448
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Save$7, { size: 16 });
|
|
13423
13449
|
};
|
|
13424
13450
|
var SubmitButton = (_ref) => {
|
|
13425
13451
|
let { active, className, processing, disabled, error, children, action = SubmitAction.SAVE, noIcon, variant = ButtonVariant.primary, withRetry, iconAsPrimary = true } = _ref, props = _objectWithoutProperties(_ref, _excluded$95);
|
|
@@ -13592,7 +13618,7 @@ var Check$4 = (_ref) => {
|
|
|
13592
13618
|
//#endregion
|
|
13593
13619
|
//#region src/icons/ChevronDown.tsx
|
|
13594
13620
|
var _excluded$92 = ["size"];
|
|
13595
|
-
var ChevronDown = (_ref) => {
|
|
13621
|
+
var ChevronDown$1 = (_ref) => {
|
|
13596
13622
|
let { size = 18 } = _ref;
|
|
13597
13623
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", _objectSpread2(_objectSpread2({
|
|
13598
13624
|
viewBox: "0 0 18 18",
|
|
@@ -13652,7 +13678,7 @@ function buildCustomDropdownIndicator() {
|
|
|
13652
13678
|
const { isDisabled } = restProps;
|
|
13653
13679
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_select.components.DropdownIndicator, _objectSpread2(_objectSpread2({}, restProps), {}, {
|
|
13654
13680
|
className: COMBO_BOX_CLASS_NAMES.DROPDOWN_INDICATOR,
|
|
13655
|
-
children: !isDisabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {})
|
|
13681
|
+
children: !isDisabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown$1, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {})
|
|
13656
13682
|
}));
|
|
13657
13683
|
};
|
|
13658
13684
|
}
|
|
@@ -14574,7 +14600,7 @@ var CategorySelectDrawerWithTrigger = ({ selectedValue, onSelectedValueChange, s
|
|
|
14574
14600
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, _objectSpread2(_objectSpread2({
|
|
14575
14601
|
ellipsis: true,
|
|
14576
14602
|
size: "md"
|
|
14577
|
-
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.TriggerSpan), {}, { children: (_selectedValue$label = selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label) !== null && _selectedValue$label !== void 0 ? _selectedValue$label : t("common:action.select_label", "Select...") })), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown, { size: 16 })]
|
|
14603
|
+
}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.TriggerSpan), {}, { children: (_selectedValue$label = selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label) !== null && _selectedValue$label !== void 0 ? _selectedValue$label : t("common:action.select_label", "Select...") })), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown$1, { size: 16 })]
|
|
14578
14604
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CategorySelectDrawer, {
|
|
14579
14605
|
onSelectedValueChange,
|
|
14580
14606
|
selectedValue,
|
|
@@ -14586,8 +14612,8 @@ var CategorySelectDrawerWithTrigger = ({ selectedValue, onSelectedValueChange, s
|
|
|
14586
14612
|
};
|
|
14587
14613
|
//#endregion
|
|
14588
14614
|
//#region src/components/TaxCodeSelect/useTaxCodeSelect.ts
|
|
14589
|
-
var EMPTY_ARRAY$
|
|
14590
|
-
var useTaxCodeSelect = ({ options = EMPTY_ARRAY$
|
|
14615
|
+
var EMPTY_ARRAY$8 = [];
|
|
14616
|
+
var useTaxCodeSelect = ({ options = EMPTY_ARRAY$8, selectedValue, onSelectedValueChange }) => {
|
|
14591
14617
|
const { t } = (0, react_i18next.useTranslation)();
|
|
14592
14618
|
const noTaxCodeOption = (0, react.useMemo)(() => TaxCodeComboBoxOption.noTaxCode(t("bankTransactions:action.no_tax_code", "No tax code")), [t]);
|
|
14593
14619
|
const optionsWithNoTaxCode = (0, react.useMemo)(() => [noTaxCodeOption, ...options], [noTaxCodeOption, options]);
|
|
@@ -14749,7 +14775,7 @@ var MobileListSection = ({ label, items, renderItem, onClickItem }) => /* @__PUR
|
|
|
14749
14775
|
});
|
|
14750
14776
|
//#endregion
|
|
14751
14777
|
//#region src/components/ui/MobileList/MobileList.tsx
|
|
14752
|
-
var EMPTY_ARRAY$
|
|
14778
|
+
var EMPTY_ARRAY$7 = [];
|
|
14753
14779
|
var isSelectionEnabled = (props) => props.selectionMode !== "none" && props.enableSelection;
|
|
14754
14780
|
var isGrouped = (data) => !!data && !Array.isArray(data);
|
|
14755
14781
|
var MobileList = ({ ariaLabel, data, slots, renderItem, onClickItem, isLoading, isError, variant = "default", enableSelection = false, selectionMode = "none", selectedKeys, onSelectionChange }) => {
|
|
@@ -14783,7 +14809,7 @@ var MobileList = ({ ariaLabel, data, slots, renderItem, onClickItem, isLoading,
|
|
|
14783
14809
|
items: group.items,
|
|
14784
14810
|
renderItem,
|
|
14785
14811
|
onClickItem
|
|
14786
|
-
}, group.label)) : (data !== null && data !== void 0 ? data : EMPTY_ARRAY$
|
|
14812
|
+
}, group.label)) : (data !== null && data !== void 0 ? data : EMPTY_ARRAY$7).map(renderRow)
|
|
14787
14813
|
});
|
|
14788
14814
|
};
|
|
14789
14815
|
//#endregion
|
|
@@ -14886,7 +14912,7 @@ var MobileSelectionDrawerWithTrigger = (_ref) => {
|
|
|
14886
14912
|
const openDrawer = (0, react.useCallback)(() => setIsOpen(true), []);
|
|
14887
14913
|
const resolvedPlaceholder = placeholder !== null && placeholder !== void 0 ? placeholder : t("common:action.select_label", "Select...");
|
|
14888
14914
|
const resolvedSearchPlaceholder = searchPlaceholder !== null && searchPlaceholder !== void 0 ? searchPlaceholder : t("common:action.search_label", "Search");
|
|
14889
|
-
const triggerIcon = (_slotProps$Trigger$ic = slotProps === null || slotProps === void 0 || (_slotProps$Trigger = slotProps.Trigger) === null || _slotProps$Trigger === void 0 ? void 0 : _slotProps$Trigger.icon) !== null && _slotProps$Trigger$ic !== void 0 ? _slotProps$Trigger$ic : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown, { size: 16 });
|
|
14915
|
+
const triggerIcon = (_slotProps$Trigger$ic = slotProps === null || slotProps === void 0 || (_slotProps$Trigger = slotProps.Trigger) === null || _slotProps$Trigger === void 0 ? void 0 : _slotProps$Trigger.icon) !== null && _slotProps$Trigger$ic !== void 0 ? _slotProps$Trigger$ic : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown$1, { size: 16 });
|
|
14890
14916
|
const filteredOptionsOrGroups = (0, react.useMemo)(() => filterOptionsOrGroups(groups ? { groups } : { options: options !== null && options !== void 0 ? options : [] }, searchQuery.trim().toLowerCase()), [
|
|
14891
14917
|
options,
|
|
14892
14918
|
groups,
|
|
@@ -14917,6 +14943,7 @@ var MobileSelectionDrawerWithTrigger = (_ref) => {
|
|
|
14917
14943
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
14918
14944
|
size: "sm",
|
|
14919
14945
|
ellipsis: true,
|
|
14946
|
+
pie: "xs",
|
|
14920
14947
|
children: (_resolvedSelectedValu = resolvedSelectedValue === null || resolvedSelectedValue === void 0 ? void 0 : resolvedSelectedValue.label) !== null && _resolvedSelectedValu !== void 0 ? _resolvedSelectedValu : resolvedPlaceholder
|
|
14921
14948
|
}), !isDisabled && triggerIcon]
|
|
14922
14949
|
})
|
|
@@ -15177,7 +15204,7 @@ effect.Schema.Struct({ businessId: effect.Schema.String });
|
|
|
15177
15204
|
var bulkMatchOrCategorize = post(({ businessId }) => {
|
|
15178
15205
|
return `/v1/businesses/${businessId}/bank-transactions/bulk-match-or-categorize`;
|
|
15179
15206
|
});
|
|
15180
|
-
function buildKey$
|
|
15207
|
+
function buildKey$79({ access_token: accessToken, apiUrl, businessId }) {
|
|
15181
15208
|
if (accessToken && apiUrl) return {
|
|
15182
15209
|
accessToken,
|
|
15183
15210
|
apiUrl,
|
|
@@ -15196,7 +15223,7 @@ var useBulkMatchOrCategorize = () => {
|
|
|
15196
15223
|
const buildTransactionsPayload = (0, react.useCallback)(() => {
|
|
15197
15224
|
return { transactions: buildBulkMatchOrCategorizePayload(selectedIds, categorizations) };
|
|
15198
15225
|
}, [selectedIds, categorizations]);
|
|
15199
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
15226
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$79(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg }) => bulkMatchOrCategorize(apiUrl, accessToken, {
|
|
15200
15227
|
params: { businessId },
|
|
15201
15228
|
body: effect.Schema.encodeSync(BulkMatchOrCategorizeRequestSchema)(arg)
|
|
15202
15229
|
}).then(({ data }) => data), {
|
|
@@ -15283,7 +15310,7 @@ var BankTransactionsConfirmAllModal = ({ isOpen, onOpenChange, isMobileView = fa
|
|
|
15283
15310
|
var BULK_UNCATEGORIZE_BANK_TRANSACTIONS_TAG_KEY = "#bulk-uncategorize-bank-transactions";
|
|
15284
15311
|
var BulkUncategorizeRequestSchema = effect.Schema.Struct({ transactionIds: effect.Schema.propertySignature(effect.Schema.Array(effect.Schema.UUID)).pipe(effect.Schema.fromKey("transaction_ids")) });
|
|
15285
15312
|
var bulkUncategorize = post(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/bulk-uncategorize`);
|
|
15286
|
-
function buildKey$
|
|
15313
|
+
function buildKey$78({ access_token: accessToken, apiUrl, businessId }) {
|
|
15287
15314
|
if (accessToken && apiUrl) return {
|
|
15288
15315
|
accessToken,
|
|
15289
15316
|
apiUrl,
|
|
@@ -15297,7 +15324,7 @@ var useBulkUncategorize = () => {
|
|
|
15297
15324
|
const { businessId, eventCallbacks } = useLayerContext();
|
|
15298
15325
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
15299
15326
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
15300
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
15327
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$78(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg }) => bulkUncategorize(apiUrl, accessToken, {
|
|
15301
15328
|
params: { businessId },
|
|
15302
15329
|
body: effect.Schema.encodeSync(BulkUncategorizeRequestSchema)(arg)
|
|
15303
15330
|
}).then(({ data }) => data), {
|
|
@@ -15679,7 +15706,7 @@ var mapRawCustomAccountToCustomAccount = (raw) => ({
|
|
|
15679
15706
|
//#endregion
|
|
15680
15707
|
//#region src/hooks/api/businesses/[business-id]/custom-accounts/useCustomAccounts.ts
|
|
15681
15708
|
var CUSTOM_ACCOUNTS_TAG_KEY = "#custom-accounts";
|
|
15682
|
-
function buildKey$
|
|
15709
|
+
function buildKey$77({ access_token: accessToken, apiUrl, businessId, userCreated }) {
|
|
15683
15710
|
if (accessToken && apiUrl) return {
|
|
15684
15711
|
accessToken,
|
|
15685
15712
|
apiUrl,
|
|
@@ -15697,7 +15724,7 @@ function useCustomAccounts({ userCreated } = {}) {
|
|
|
15697
15724
|
const withLocale = useLocalizedKey();
|
|
15698
15725
|
const { data } = useAuth();
|
|
15699
15726
|
const { businessId } = useLayerContext();
|
|
15700
|
-
return (0, swr.default)(() => withLocale(buildKey$
|
|
15727
|
+
return (0, swr.default)(() => withLocale(buildKey$77(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
15701
15728
|
businessId,
|
|
15702
15729
|
userCreated
|
|
15703
15730
|
}))), ({ accessToken, apiUrl, businessId, userCreated }) => getCustomAccounts(apiUrl, accessToken, { params: {
|
|
@@ -15707,7 +15734,7 @@ function useCustomAccounts({ userCreated } = {}) {
|
|
|
15707
15734
|
}
|
|
15708
15735
|
//#endregion
|
|
15709
15736
|
//#region src/hooks/api/businesses/[business-id]/custom-accounts/[custom-account-id]/parse-csv/useCustomAccountParseCsv.ts
|
|
15710
|
-
function buildKey$
|
|
15737
|
+
function buildKey$76({ access_token: accessToken, apiUrl, businessId }) {
|
|
15711
15738
|
if (accessToken && apiUrl) return {
|
|
15712
15739
|
accessToken,
|
|
15713
15740
|
apiUrl,
|
|
@@ -15724,7 +15751,7 @@ function useCustomAccountParseCsv() {
|
|
|
15724
15751
|
const withLocale = useLocalizedKey();
|
|
15725
15752
|
const { data } = useAuth();
|
|
15726
15753
|
const { businessId } = useLayerContext();
|
|
15727
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
15754
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$76(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { customAccountId, file } }) => parseCsv(apiUrl, accessToken, {
|
|
15728
15755
|
businessId,
|
|
15729
15756
|
customAccountId,
|
|
15730
15757
|
file
|
|
@@ -16006,7 +16033,7 @@ get$1(({ businessId }) => `/v1/businesses/${businessId}/external-accounts`);
|
|
|
16006
16033
|
//#endregion
|
|
16007
16034
|
//#region src/hooks/api/businesses/[business-id]/custom-accounts/useCreateCustomAccount.ts
|
|
16008
16035
|
var createCustomAccount = post(({ businessId }) => `/v1/businesses/${businessId}/custom-accounts`);
|
|
16009
|
-
function buildKey$
|
|
16036
|
+
function buildKey$75({ access_token: accessToken, apiUrl, businessId }) {
|
|
16010
16037
|
if (accessToken && apiUrl) return {
|
|
16011
16038
|
accessToken,
|
|
16012
16039
|
apiUrl,
|
|
@@ -16019,7 +16046,7 @@ function useCreateCustomAccount() {
|
|
|
16019
16046
|
const { data } = useAuth();
|
|
16020
16047
|
const { businessId } = useLayerContext();
|
|
16021
16048
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
16022
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
16049
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$75(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => createCustomAccount(apiUrl, accessToken, {
|
|
16023
16050
|
params: { businessId },
|
|
16024
16051
|
body
|
|
16025
16052
|
}).then(({ data }) => mapRawCustomAccountToCustomAccount(data)), { revalidate: false });
|
|
@@ -16560,7 +16587,7 @@ var DateCalendar = ({ minDate, maxDate, variant }) => {
|
|
|
16560
16587
|
var PickerDropdownIndicator = ({ onClick }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components_Button.Button, {
|
|
16561
16588
|
className: "Layer__PickerDropdownIndicator",
|
|
16562
16589
|
onPress: onClick,
|
|
16563
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown, { size: 16 })
|
|
16590
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDown$1, { size: 16 })
|
|
16564
16591
|
});
|
|
16565
16592
|
//#endregion
|
|
16566
16593
|
//#region src/components/DatePicker/DatePickerInput.tsx
|
|
@@ -17595,7 +17622,7 @@ function UploadTransactionsUploadCsvStep({ selectedAccount, onSelectAccount, sel
|
|
|
17595
17622
|
//#region src/hooks/api/businesses/[business-id]/custom-accounts/[custom-account-id]/transactions/useCreateCustomAccountTransactions.ts
|
|
17596
17623
|
var _excluded$58 = ["customAccountId"];
|
|
17597
17624
|
var createCustomAccountTransactions = post(({ businessId, customAccountId }) => `/v1/businesses/${businessId}/custom-accounts/${customAccountId}/transactions`);
|
|
17598
|
-
function buildKey$
|
|
17625
|
+
function buildKey$74({ access_token: accessToken, apiUrl, businessId }) {
|
|
17599
17626
|
if (accessToken && apiUrl) return {
|
|
17600
17627
|
accessToken,
|
|
17601
17628
|
apiUrl,
|
|
@@ -17607,7 +17634,7 @@ function useCreateCustomAccountTransactions() {
|
|
|
17607
17634
|
const withLocale = useLocalizedKey();
|
|
17608
17635
|
const { data } = useAuth();
|
|
17609
17636
|
const { businessId } = useLayerContext();
|
|
17610
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
17637
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$74(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, _ref) => {
|
|
17611
17638
|
let { arg: _ref2 } = _ref, { customAccountId } = _ref2, body = _objectWithoutProperties(_ref2, _excluded$58);
|
|
17612
17639
|
return createCustomAccountTransactions(apiUrl, accessToken, {
|
|
17613
17640
|
params: {
|
|
@@ -17980,7 +18007,7 @@ var DEFAULT_NUM_ROWS = 15;
|
|
|
17980
18007
|
var HEADER_HEIGHT = 52;
|
|
17981
18008
|
var DEFAULT_TABLE_HEIGHT = DEFAULT_ROW_HEIGHT * DEFAULT_NUM_ROWS + HEADER_HEIGHT - 1;
|
|
17982
18009
|
var CSS_PREFIX = "Layer__UI__VirtualizedTable";
|
|
17983
|
-
var EMPTY_ARRAY$
|
|
18010
|
+
var EMPTY_ARRAY$6 = [];
|
|
17984
18011
|
var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentName, ariaLabel, slots, shrinkHeightToFitRows = false, height = DEFAULT_TABLE_HEIGHT, rowHeight = DEFAULT_ROW_HEIGHT, overscan = DEFAULT_OVERSCAN }) => {
|
|
17985
18012
|
const { EmptyState, ErrorState } = slots;
|
|
17986
18013
|
const containerRef = (0, react.useRef)(null);
|
|
@@ -17996,7 +18023,7 @@ var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentN
|
|
|
17996
18023
|
shrinkHeightToFitRows
|
|
17997
18024
|
]);
|
|
17998
18025
|
const table = (0, _tanstack_react_table.useReactTable)({
|
|
17999
|
-
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$
|
|
18026
|
+
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$6,
|
|
18000
18027
|
columns: getColumnDefs(columnConfig),
|
|
18001
18028
|
getCoreRowModel: (0, _tanstack_react_table.getCoreRowModel)(),
|
|
18002
18029
|
getSortedRowModel: (0, _tanstack_react_table.getSortedRowModel)()
|
|
@@ -18792,7 +18819,7 @@ var SyncingComponent = ({ titleVariant = "default", onRefresh, inProgress = fals
|
|
|
18792
18819
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
18793
18820
|
className: "Layer__syncing-component__actions",
|
|
18794
18821
|
children: inProgress ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SmallLoader, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
|
|
18795
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
18822
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, {}),
|
|
18796
18823
|
onClick: handleRefresh
|
|
18797
18824
|
})
|
|
18798
18825
|
}), !hideContent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -19083,7 +19110,7 @@ var useGetBankTransactionMatchOrCategoryWithDefault = (bankTransaction) => {
|
|
|
19083
19110
|
var _excluded$56 = ["bankTransactionId"];
|
|
19084
19111
|
var CATEGORIZE_BANK_TRANSACTION_TAG = "#categorize-bank-transaction";
|
|
19085
19112
|
var categorizeBankTransaction = put(({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/categorize`);
|
|
19086
|
-
function buildKey$
|
|
19113
|
+
function buildKey$73({ access_token: accessToken, apiUrl, businessId }) {
|
|
19087
19114
|
if (accessToken && apiUrl) return {
|
|
19088
19115
|
accessToken,
|
|
19089
19116
|
apiUrl,
|
|
@@ -19099,7 +19126,7 @@ function useCategorizeBankTransaction() {
|
|
|
19099
19126
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
19100
19127
|
const { useBankTransactionsOptions } = useBankTransactionsContext();
|
|
19101
19128
|
const { forceReloadBackgroundBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
19102
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
19129
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$73({
|
|
19103
19130
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
19104
19131
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
19105
19132
|
businessId
|
|
@@ -19177,7 +19204,7 @@ function useCategorizeBankTransactionWithCacheUpdate() {
|
|
|
19177
19204
|
var _excluded$55 = ["bankTransactionId"];
|
|
19178
19205
|
var matchBankTransaction = put(({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/match`);
|
|
19179
19206
|
var MATCH_BANK_TRANSACTION_TAG = "#match-bank-transaction";
|
|
19180
|
-
function buildKey$
|
|
19207
|
+
function buildKey$72({ access_token: accessToken, apiUrl, businessId }) {
|
|
19181
19208
|
if (accessToken && apiUrl) return {
|
|
19182
19209
|
accessToken,
|
|
19183
19210
|
apiUrl,
|
|
@@ -19193,7 +19220,7 @@ function useMatchBankTransaction() {
|
|
|
19193
19220
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
19194
19221
|
const { useBankTransactionsOptions } = useBankTransactionsContext();
|
|
19195
19222
|
const { forceReloadBackgroundBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
19196
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
19223
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$72({
|
|
19197
19224
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
19198
19225
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
19199
19226
|
businessId
|
|
@@ -19586,7 +19613,7 @@ var getBookkeepingPeriods = get$1(({ businessId }) => {
|
|
|
19586
19613
|
return `/v1/businesses/${businessId}/bookkeeping/periods`;
|
|
19587
19614
|
});
|
|
19588
19615
|
var BOOKKEEPING_PERIODS_TAG_KEY = "#bookkeeping-periods";
|
|
19589
|
-
function buildKey$
|
|
19616
|
+
function buildKey$71({ access_token: accessToken, apiUrl, businessId, isActiveOrPaused }) {
|
|
19590
19617
|
if (accessToken && apiUrl && isActiveOrPaused) return {
|
|
19591
19618
|
accessToken,
|
|
19592
19619
|
apiUrl,
|
|
@@ -19600,7 +19627,7 @@ function useBookkeepingPeriods() {
|
|
|
19600
19627
|
const { businessId } = useLayerContext();
|
|
19601
19628
|
const { data, isLoading: isLoadingBookkeepingStatus } = useBookkeepingStatus();
|
|
19602
19629
|
const isActiveOrPaused = data ? isActiveOrPausedBookkeepingStatus(data.status) : false;
|
|
19603
|
-
const swrResponse = (0, swr.default)(() => withLocale(buildKey$
|
|
19630
|
+
const swrResponse = (0, swr.default)(() => withLocale(buildKey$71(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
19604
19631
|
businessId,
|
|
19605
19632
|
isActiveOrPaused
|
|
19606
19633
|
}))), ({ accessToken, apiUrl, businessId }) => getBookkeepingPeriods(apiUrl, accessToken, { params: { businessId } })().then(({ data: { periods } }) => periods.map((period) => _objectSpread2(_objectSpread2({}, period), {}, {
|
|
@@ -19773,7 +19800,7 @@ function useMinMutatingMutation({ swrMutationResponse, minMutatingMs }) {
|
|
|
19773
19800
|
//#endregion
|
|
19774
19801
|
//#region src/hooks/api/businesses/[business-id]/bank-transactions/[bank-transaction-id]/metadata/useSetMetadataOnBankTransaction.ts
|
|
19775
19802
|
var SET_METADATA_ON_BANK_TRANSACTION_TAG_KEY = "#set-metadata-on-bank-transaction";
|
|
19776
|
-
function buildKey$
|
|
19803
|
+
function buildKey$70({ access_token: accessToken, apiUrl, businessId, bankTransactionId }) {
|
|
19777
19804
|
if (accessToken && apiUrl) return {
|
|
19778
19805
|
accessToken,
|
|
19779
19806
|
apiUrl,
|
|
@@ -19787,7 +19814,7 @@ function useSetMetadataOnBankTransaction({ bankTransactionId }) {
|
|
|
19787
19814
|
const withLocale = useLocalizedKey();
|
|
19788
19815
|
const { data } = useAuth();
|
|
19789
19816
|
const { businessId } = useLayerContext();
|
|
19790
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
19817
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$70(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
19791
19818
|
businessId,
|
|
19792
19819
|
bankTransactionId
|
|
19793
19820
|
}))), ({ accessToken, apiUrl, businessId, bankTransactionId }, { arg: { vendor, customer } }) => {
|
|
@@ -19836,7 +19863,7 @@ function useSetMetadataOnBankTransaction({ bankTransactionId }) {
|
|
|
19836
19863
|
//#region src/hooks/api/businesses/[business-id]/bank-transactions/tags/useRemoveTagFromBankTransaction.ts
|
|
19837
19864
|
var REMOVE_TAG_FROM_BANK_TRANSACTION_TAG_KEY = "#remove-tag-from-bank-transaction";
|
|
19838
19865
|
var removeTagFromBankTransaction = del(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/tags`);
|
|
19839
|
-
function buildKey$
|
|
19866
|
+
function buildKey$69({ access_token: accessToken, apiUrl, businessId, bankTransactionId }) {
|
|
19840
19867
|
if (accessToken && apiUrl) return {
|
|
19841
19868
|
accessToken,
|
|
19842
19869
|
apiUrl,
|
|
@@ -19849,7 +19876,7 @@ function useRemoveTagFromBankTransaction({ bankTransactionId }) {
|
|
|
19849
19876
|
const withLocale = useLocalizedKey();
|
|
19850
19877
|
const { data } = useAuth();
|
|
19851
19878
|
const { businessId } = useLayerContext();
|
|
19852
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
19879
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$69(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
19853
19880
|
businessId,
|
|
19854
19881
|
bankTransactionId
|
|
19855
19882
|
}))), ({ accessToken, apiUrl, businessId }, { arg: { tagId } }) => removeTagFromBankTransaction(apiUrl, accessToken, {
|
|
@@ -19888,7 +19915,7 @@ function useRemoveTagFromBankTransaction({ bankTransactionId }) {
|
|
|
19888
19915
|
//#region src/hooks/api/businesses/[business-id]/bank-transactions/tags/useTagBankTransaction.ts
|
|
19889
19916
|
var TAG_BANK_TRANSACTION_TAG_KEY = "#tag-bank-transaction";
|
|
19890
19917
|
var tagBankTransaction = post(({ businessId }) => `/v1/businesses/${businessId}/bank-transactions/tags`);
|
|
19891
|
-
function buildKey$
|
|
19918
|
+
function buildKey$68({ access_token: accessToken, apiUrl, businessId, bankTransactionId }) {
|
|
19892
19919
|
if (accessToken && apiUrl) return {
|
|
19893
19920
|
accessToken,
|
|
19894
19921
|
apiUrl,
|
|
@@ -19901,7 +19928,7 @@ function useTagBankTransaction({ bankTransactionId }) {
|
|
|
19901
19928
|
const withLocale = useLocalizedKey();
|
|
19902
19929
|
const { data } = useAuth();
|
|
19903
19930
|
const { businessId } = useLayerContext();
|
|
19904
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
19931
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$68(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
19905
19932
|
businessId,
|
|
19906
19933
|
bankTransactionId
|
|
19907
19934
|
}))), ({ accessToken, apiUrl, businessId, bankTransactionId }, { arg: { key, value, dimensionDisplayName, valueDisplayName } }) => tagBankTransaction(apiUrl, accessToken, {
|
|
@@ -20468,7 +20495,7 @@ function BankTransactionCustomerVendorSelector({ bankTransaction }) {
|
|
|
20468
20495
|
//#region src/hooks/api/businesses/[business-id]/bank-transactions/[bank-transaction-id]/metadata/useBankTransactionsMetadata.ts
|
|
20469
20496
|
var getBankTransactionMetadata = get$1(({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/metadata`);
|
|
20470
20497
|
var GET_BANK_TRANSACTION_METADATA_TAG_KEY = "#bank-transaction-metadata";
|
|
20471
|
-
function buildKey$
|
|
20498
|
+
function buildKey$67({ access_token: accessToken, apiUrl, businessId, bankTransactionId }) {
|
|
20472
20499
|
if (accessToken && apiUrl) return {
|
|
20473
20500
|
accessToken,
|
|
20474
20501
|
apiUrl,
|
|
@@ -20481,7 +20508,7 @@ function useBankTransactionMetadata({ bankTransactionId }) {
|
|
|
20481
20508
|
const withLocale = useLocalizedKey();
|
|
20482
20509
|
const { data: auth } = useAuth();
|
|
20483
20510
|
const { businessId } = useLayerContext();
|
|
20484
|
-
return (0, swr.default)(() => withLocale(buildKey$
|
|
20511
|
+
return (0, swr.default)(() => withLocale(buildKey$67(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
20485
20512
|
businessId,
|
|
20486
20513
|
bankTransactionId
|
|
20487
20514
|
}))), ({ accessToken, apiUrl, businessId }) => getBankTransactionMetadata(apiUrl, accessToken, { params: {
|
|
@@ -20493,7 +20520,7 @@ function useBankTransactionMetadata({ bankTransactionId }) {
|
|
|
20493
20520
|
//#region src/hooks/api/businesses/[business-id]/bank-transactions/[bank-transaction-id]/metadata/useUpdateBankTransactionMetadata.ts
|
|
20494
20521
|
var updateBankTransactionMetadata = put(({ businessId, bankTransactionId }) => `/v1/businesses/${businessId}/bank-transactions/${bankTransactionId}/metadata`);
|
|
20495
20522
|
var UPDATE_BANK_TRANSACTION_METADATA_TAG_KEY = "#update-bank-transaction-metadata";
|
|
20496
|
-
function buildKey$
|
|
20523
|
+
function buildKey$66({ access_token: accessToken, apiUrl, businessId, bankTransactionId }) {
|
|
20497
20524
|
if (accessToken && apiUrl) return {
|
|
20498
20525
|
accessToken,
|
|
20499
20526
|
apiUrl,
|
|
@@ -20507,7 +20534,7 @@ function useUpdateBankTransactionMetadata({ bankTransactionId, onSuccess }) {
|
|
|
20507
20534
|
const { data: auth } = useAuth();
|
|
20508
20535
|
const { businessId } = useLayerContext();
|
|
20509
20536
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
20510
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
20537
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$66({
|
|
20511
20538
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
20512
20539
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
20513
20540
|
businessId,
|
|
@@ -20640,7 +20667,7 @@ var BankTransactionMemo = ({ bankTransactionId, isMobile }) => {
|
|
|
20640
20667
|
//#endregion
|
|
20641
20668
|
//#region src/hooks/api/businesses/[business-id]/tags/dimensions/key/[dimension-key]/useTagDimensionByKey.ts
|
|
20642
20669
|
var TAG_DIMENSION_BY_KEY_TAG_KEY = "#tag-dimension-by-key";
|
|
20643
|
-
function buildKey$
|
|
20670
|
+
function buildKey$65({ access_token: accessToken, apiUrl, businessId, isEnabled, dimensionKey }) {
|
|
20644
20671
|
if (!isEnabled) return;
|
|
20645
20672
|
if (accessToken && apiUrl) return {
|
|
20646
20673
|
accessToken,
|
|
@@ -20656,7 +20683,7 @@ function useTagDimensionByKey({ isEnabled = true, dimensionKey }) {
|
|
|
20656
20683
|
const { data: auth } = useAuth();
|
|
20657
20684
|
const { apiUrl } = useEnvironment();
|
|
20658
20685
|
const { businessId } = useLayerContext();
|
|
20659
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
20686
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$65(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
20660
20687
|
apiUrl,
|
|
20661
20688
|
isEnabled,
|
|
20662
20689
|
businessId,
|
|
@@ -23402,7 +23429,7 @@ function useCategorizationRulesGlobalCacheActions() {
|
|
|
23402
23429
|
//#endregion
|
|
23403
23430
|
//#region src/hooks/api/businesses/[business-id]/categorization-rules/[categorization-rule-id]/archive/useArchiveCategorizationRule.ts
|
|
23404
23431
|
var ARCHIVE_CATEGORIZATION_RULE_TAG = "#archive-categorization-rule";
|
|
23405
|
-
function buildKey$
|
|
23432
|
+
function buildKey$64({ access_token: accessToken, apiUrl, businessId }) {
|
|
23406
23433
|
if (accessToken && apiUrl) return {
|
|
23407
23434
|
accessToken,
|
|
23408
23435
|
apiUrl,
|
|
@@ -23417,7 +23444,7 @@ function useArchiveCategorizationRule() {
|
|
|
23417
23444
|
const { data: auth } = useAuth();
|
|
23418
23445
|
const { businessId } = useLayerContext();
|
|
23419
23446
|
const { forceReloadCategorizationRules } = useCategorizationRulesGlobalCacheActions();
|
|
23420
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
23447
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$64({
|
|
23421
23448
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
23422
23449
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
23423
23450
|
businessId
|
|
@@ -23622,13 +23649,13 @@ var Pagination = ({ onPageChange, totalCount, siblingCount = 1, currentPage, pag
|
|
|
23622
23649
|
//#endregion
|
|
23623
23650
|
//#region src/components/ui/MobileList/PaginatedMobileList.tsx
|
|
23624
23651
|
var _excluded$41 = ["data", "paginationProps"];
|
|
23625
|
-
var EMPTY_ARRAY$
|
|
23652
|
+
var EMPTY_ARRAY$5 = [];
|
|
23626
23653
|
var PaginatedMobileList = (props) => {
|
|
23627
23654
|
var _data$length;
|
|
23628
23655
|
const { data, paginationProps } = props, listProps = _objectWithoutProperties(props, _excluded$41);
|
|
23629
23656
|
const { initialPage = 0, onSetPage, pageSize = 20, hasMore, fetchMore, autoResetPageIndexRef } = paginationProps;
|
|
23630
23657
|
const { pageItems, pageIndex, setPage } = usePaginatedList({
|
|
23631
|
-
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$
|
|
23658
|
+
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$5,
|
|
23632
23659
|
pageSize,
|
|
23633
23660
|
initialPage,
|
|
23634
23661
|
onSetPage
|
|
@@ -23870,7 +23897,7 @@ function ConditionalList({ list, Empty, Container, isLoading, Loading, isError,
|
|
|
23870
23897
|
}
|
|
23871
23898
|
//#endregion
|
|
23872
23899
|
//#region src/components/DataTable/DataTable.tsx
|
|
23873
|
-
var EMPTY_ARRAY$
|
|
23900
|
+
var EMPTY_ARRAY$4 = [];
|
|
23874
23901
|
var DataTable = ({ isLoading, isError, componentName, ariaLabel, slots, dependencies, data, headerGroups, numColumns, withClickableRow }) => {
|
|
23875
23902
|
const scrollContainerRef = (0, react.useRef)(null);
|
|
23876
23903
|
const nonAria = headerGroups.length > 1 || numColumns === 0;
|
|
@@ -23936,7 +23963,7 @@ var DataTable = ({ isLoading, isError, componentName, ariaLabel, slots, dependen
|
|
|
23936
23963
|
dependencies,
|
|
23937
23964
|
nonAria,
|
|
23938
23965
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalList, {
|
|
23939
|
-
list: data !== null && data !== void 0 ? data : EMPTY_ARRAY$
|
|
23966
|
+
list: data !== null && data !== void 0 ? data : EMPTY_ARRAY$4,
|
|
23940
23967
|
isLoading,
|
|
23941
23968
|
isError,
|
|
23942
23969
|
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataTableSkeleton, {
|
|
@@ -24297,7 +24324,7 @@ var ErrorBoundary = class extends react.Component {
|
|
|
24297
24324
|
//#endregion
|
|
24298
24325
|
//#region src/hooks/api/businesses/[business-id]/categorization-rules/suggestions/useRejectCategorizationRulesUpdateSuggestion.ts
|
|
24299
24326
|
var REJECT_CATEGORIZATION_RULE_SUGGESTION_TAG = "#reject-categorization-rule-suggestion";
|
|
24300
|
-
function buildKey$
|
|
24327
|
+
function buildKey$63({ access_token: accessToken, apiUrl, businessId }) {
|
|
24301
24328
|
if (accessToken && apiUrl) return {
|
|
24302
24329
|
accessToken,
|
|
24303
24330
|
apiUrl,
|
|
@@ -24310,7 +24337,7 @@ function useRejectCategorizationRulesUpdateSuggestion() {
|
|
|
24310
24337
|
const withLocale = useLocalizedKey();
|
|
24311
24338
|
const { data: auth } = useAuth();
|
|
24312
24339
|
const { businessId } = useLayerContext();
|
|
24313
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
24340
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$63({
|
|
24314
24341
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
24315
24342
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
24316
24343
|
businessId
|
|
@@ -24330,7 +24357,7 @@ function useRejectCategorizationRulesUpdateSuggestion() {
|
|
|
24330
24357
|
//#endregion
|
|
24331
24358
|
//#region src/hooks/api/businesses/[business-id]/categorization-rules/useCreateCategorizationRule.ts
|
|
24332
24359
|
var CREATE_CATEGORIZATION_RULE_TAG = "#create-categorization-rule";
|
|
24333
|
-
function buildKey$
|
|
24360
|
+
function buildKey$62({ access_token: accessToken, apiUrl, businessId }) {
|
|
24334
24361
|
if (accessToken && apiUrl) return {
|
|
24335
24362
|
accessToken,
|
|
24336
24363
|
apiUrl,
|
|
@@ -24347,7 +24374,7 @@ function useCreateCategorizationRule() {
|
|
|
24347
24374
|
const { forceReloadBankTransactions } = useBankTransactionsGlobalCacheActions();
|
|
24348
24375
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
24349
24376
|
const { forceReloadCategorizationRules } = useCategorizationRulesGlobalCacheActions();
|
|
24350
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
24377
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$62({
|
|
24351
24378
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
24352
24379
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
24353
24380
|
businessId
|
|
@@ -25361,7 +25388,7 @@ var LinkedAccountOptions = ({ children, config, showLedgerBalance }) => {
|
|
|
25361
25388
|
var getBadgeConfig$1 = (quickbooksUiState, hasSynced) => {
|
|
25362
25389
|
if (!hasSynced) return _objectSpread2({
|
|
25363
25390
|
variant: BadgeVariant.INFO,
|
|
25364
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
25391
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 })
|
|
25365
25392
|
}, translationKey("integrations:action.sync_label", "Sync"));
|
|
25366
25393
|
switch (quickbooksUiState) {
|
|
25367
25394
|
case QuickbooksConnectionSyncUiState.SyncFailed: return _objectSpread2({
|
|
@@ -25376,7 +25403,7 @@ var getBadgeConfig$1 = (quickbooksUiState, hasSynced) => {
|
|
|
25376
25403
|
default:
|
|
25377
25404
|
case QuickbooksConnectionSyncUiState.Syncing: return _objectSpread2({
|
|
25378
25405
|
variant: BadgeVariant.INFO,
|
|
25379
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
25406
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 })
|
|
25380
25407
|
}, translationKey("integrations:action.sync_label", "Sync"));
|
|
25381
25408
|
}
|
|
25382
25409
|
};
|
|
@@ -25509,7 +25536,7 @@ var PlusIcon = (_ref) => {
|
|
|
25509
25536
|
};
|
|
25510
25537
|
//#endregion
|
|
25511
25538
|
//#region src/hooks/features/bankAccounts/useConfirmAndExcludeMultiple.ts
|
|
25512
|
-
function buildKey$
|
|
25539
|
+
function buildKey$61({ access_token: accessToken, apiUrl, businessId }) {
|
|
25513
25540
|
if (accessToken && apiUrl) return {
|
|
25514
25541
|
accessToken,
|
|
25515
25542
|
apiUrl,
|
|
@@ -25539,7 +25566,7 @@ function useConfirmAndExcludeMultiple({ onSuccess }) {
|
|
|
25539
25566
|
const withLocale = useLocalizedKey();
|
|
25540
25567
|
const { data: auth } = useAuth();
|
|
25541
25568
|
const { businessId } = useLayerContext();
|
|
25542
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
25569
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$61({
|
|
25543
25570
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
25544
25571
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
25545
25572
|
businessId
|
|
@@ -26398,7 +26425,7 @@ var LinkedAccountsContent = ({ asWidget, showLedgerBalance, showUnlinkItem, show
|
|
|
26398
26425
|
//#endregion
|
|
26399
26426
|
//#region src/hooks/legacy/useUpdateOpeningBalanceAndDate.ts
|
|
26400
26427
|
var updateBankAccountOpeningBalance = post(({ businessId, bankAccountId }) => `/v1/businesses/${businessId}/bank-accounts/${bankAccountId}/opening-balance`);
|
|
26401
|
-
function buildKey$
|
|
26428
|
+
function buildKey$60({ access_token: accessToken, apiUrl, businessId, data }) {
|
|
26402
26429
|
if (accessToken && apiUrl) return {
|
|
26403
26430
|
accessToken,
|
|
26404
26431
|
apiUrl,
|
|
@@ -26430,7 +26457,7 @@ function useBulkSetOpeningBalanceAndDate(data, { onSuccess }) {
|
|
|
26430
26457
|
if (!openingBalance) errors.push("MISSING_BALANCE");
|
|
26431
26458
|
return errors;
|
|
26432
26459
|
};
|
|
26433
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
26460
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$60({
|
|
26434
26461
|
access_token: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
26435
26462
|
apiUrl: auth === null || auth === void 0 ? void 0 : auth.apiUrl,
|
|
26436
26463
|
businessId,
|
|
@@ -29865,7 +29892,7 @@ var getProfitAndLossDetailLinesExcel = (apiUrl, accessToken, params) => {
|
|
|
29865
29892
|
});
|
|
29866
29893
|
return get$1(({ businessId }) => `/v1/businesses/${businessId}/reports/profit-and-loss/lines/exports/excel?${queryParams.toString()}`)(apiUrl, accessToken, { params: { businessId } });
|
|
29867
29894
|
};
|
|
29868
|
-
function buildKey$
|
|
29895
|
+
function buildKey$59({ access_token: accessToken, apiUrl, businessId, startDate, endDate, pnlStructureLineItemName, tagFilter, reportingBasis, pnlStructure }) {
|
|
29869
29896
|
if (accessToken && apiUrl) return {
|
|
29870
29897
|
accessToken,
|
|
29871
29898
|
apiUrl,
|
|
@@ -29888,7 +29915,7 @@ function useProfitAndLossDetailLinesExport({ startDate, endDate, pnlStructureLin
|
|
|
29888
29915
|
const { data: auth } = useAuth();
|
|
29889
29916
|
const { businessId } = useLayerContext();
|
|
29890
29917
|
const { apiUrl } = useEnvironment();
|
|
29891
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
29918
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$59(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
29892
29919
|
apiUrl,
|
|
29893
29920
|
businessId,
|
|
29894
29921
|
startDate,
|
|
@@ -31170,7 +31197,7 @@ function TransactionsToReview({ onClick, tagFilter = void 0, variants }) {
|
|
|
31170
31197
|
if (isError) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Badge, {
|
|
31171
31198
|
variant: BadgeVariant.ERROR,
|
|
31172
31199
|
size: BadgeSize.SMALL,
|
|
31173
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
31200
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 }),
|
|
31174
31201
|
onClick: () => void mutate(),
|
|
31175
31202
|
children: t("common:action.refresh_label", "Refresh")
|
|
31176
31203
|
});
|
|
@@ -31369,7 +31396,7 @@ ProfitAndLoss.Report = ProfitAndLossReport;
|
|
|
31369
31396
|
var getBalanceSheet = get$1(({ businessId, effectiveDate }) => {
|
|
31370
31397
|
return `/v1/businesses/${businessId}/reports/balance-sheet?${toDefinedSearchParameters({ effectiveDate })}`;
|
|
31371
31398
|
});
|
|
31372
|
-
function buildKey$
|
|
31399
|
+
function buildKey$58({ access_token: accessToken, apiUrl, businessId, effectiveDate }) {
|
|
31373
31400
|
if (accessToken && apiUrl) return {
|
|
31374
31401
|
accessToken,
|
|
31375
31402
|
apiUrl,
|
|
@@ -31383,7 +31410,7 @@ function useBalanceSheet({ effectiveDate = (0, date_fns.endOfDay)(/* @__PURE__ *
|
|
|
31383
31410
|
const { data: auth } = useAuth();
|
|
31384
31411
|
const { apiUrl } = useEnvironment();
|
|
31385
31412
|
const { businessId } = useLayerContext();
|
|
31386
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
31413
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$58(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
31387
31414
|
apiUrl,
|
|
31388
31415
|
businessId,
|
|
31389
31416
|
effectiveDate
|
|
@@ -31447,7 +31474,7 @@ var getBalanceSheetExcel = get$1(({ businessId, effectiveDate }) => {
|
|
|
31447
31474
|
return `/v1/businesses/${businessId}/reports/balance-sheet/exports/excel?${toDefinedSearchParameters({ effectiveDate })}`;
|
|
31448
31475
|
});
|
|
31449
31476
|
var DOWNLOAD_BALANCE_SHEET_TAG_KEY = "#download-balance-sheet";
|
|
31450
|
-
function buildKey$
|
|
31477
|
+
function buildKey$57({ access_token: accessToken, apiUrl, businessId, effectiveDate }) {
|
|
31451
31478
|
if (accessToken && apiUrl) return {
|
|
31452
31479
|
accessToken,
|
|
31453
31480
|
apiUrl,
|
|
@@ -31460,7 +31487,7 @@ function useBalanceSheetDownload({ effectiveDate, onSuccess }) {
|
|
|
31460
31487
|
const withLocale = useLocalizedKey();
|
|
31461
31488
|
const { data: auth } = useAuth();
|
|
31462
31489
|
const { businessId } = useLayerContext();
|
|
31463
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
31490
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$57(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
31464
31491
|
businessId,
|
|
31465
31492
|
effectiveDate
|
|
31466
31493
|
}))), ({ accessToken, apiUrl, businessId, effectiveDate }) => getBalanceSheetExcel(apiUrl, accessToken, { params: {
|
|
@@ -31675,7 +31702,7 @@ var getStatementOfCashFlow = get$1(({ businessId, startDate, endDate }) => {
|
|
|
31675
31702
|
endDate
|
|
31676
31703
|
})}`;
|
|
31677
31704
|
});
|
|
31678
|
-
function buildKey$
|
|
31705
|
+
function buildKey$56({ access_token: accessToken, apiUrl, businessId, startDate, endDate }) {
|
|
31679
31706
|
if (accessToken && apiUrl) return {
|
|
31680
31707
|
accessToken,
|
|
31681
31708
|
apiUrl,
|
|
@@ -31690,7 +31717,7 @@ function useStatementOfCashFlow({ startDate = (0, date_fns.startOfMonth)(/* @__P
|
|
|
31690
31717
|
const { data: auth } = useAuth();
|
|
31691
31718
|
const { apiUrl } = useEnvironment();
|
|
31692
31719
|
const { businessId } = useLayerContext();
|
|
31693
|
-
return new SWRQueryResult((0, swr.default)(withLocale(buildKey$
|
|
31720
|
+
return new SWRQueryResult((0, swr.default)(withLocale(buildKey$56(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
31694
31721
|
apiUrl,
|
|
31695
31722
|
businessId,
|
|
31696
31723
|
startDate,
|
|
@@ -31751,7 +31778,7 @@ var getCashflowStatementCSV = get$1(({ businessId, startDate, endDate }) => {
|
|
|
31751
31778
|
})}`;
|
|
31752
31779
|
});
|
|
31753
31780
|
var DOWNLOAD_CASHFLOW_STATEMENT_TAG_KEY = "#download-cashflow-statement";
|
|
31754
|
-
function buildKey$
|
|
31781
|
+
function buildKey$55({ access_token: accessToken, apiUrl, businessId, startDate, endDate }) {
|
|
31755
31782
|
if (accessToken && apiUrl) return {
|
|
31756
31783
|
accessToken,
|
|
31757
31784
|
apiUrl,
|
|
@@ -31765,7 +31792,7 @@ function useCashflowStatementDownload({ startDate, endDate, onSuccess }) {
|
|
|
31765
31792
|
const withLocale = useLocalizedKey();
|
|
31766
31793
|
const { data: auth } = useAuth();
|
|
31767
31794
|
const { businessId } = useLayerContext();
|
|
31768
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
31795
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$55(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
31769
31796
|
businessId,
|
|
31770
31797
|
startDate,
|
|
31771
31798
|
endDate
|
|
@@ -31935,7 +31962,7 @@ var StatementOfCashFlowView = ({ view: propView, stringOverrides, dateSelectionM
|
|
|
31935
31962
|
//#endregion
|
|
31936
31963
|
//#region src/hooks/api/businesses/[business-id]/ledger/accounts/[account-id]/useDeleteLedgerAccount.ts
|
|
31937
31964
|
var deleteAccountFromLedger = del(({ businessId, accountId }) => `/v1/businesses/${businessId}/ledger/accounts/${accountId}`);
|
|
31938
|
-
function buildKey$
|
|
31965
|
+
function buildKey$54({ access_token: accessToken, apiUrl, businessId }) {
|
|
31939
31966
|
if (accessToken && apiUrl) return {
|
|
31940
31967
|
accessToken,
|
|
31941
31968
|
apiUrl,
|
|
@@ -31947,7 +31974,7 @@ function useDeleteAccountFromLedger() {
|
|
|
31947
31974
|
const withLocale = useLocalizedKey();
|
|
31948
31975
|
const { data } = useAuth();
|
|
31949
31976
|
const { businessId } = useLayerContext();
|
|
31950
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
31977
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$54(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { accountId } }) => deleteAccountFromLedger(apiUrl, accessToken, { params: {
|
|
31951
31978
|
businessId,
|
|
31952
31979
|
accountId
|
|
31953
31980
|
} }), {
|
|
@@ -31969,7 +31996,7 @@ var getLedgerAccountBalances = get$1(({ businessId, startDate, endDate }) => {
|
|
|
31969
31996
|
endDate
|
|
31970
31997
|
})}`;
|
|
31971
31998
|
});
|
|
31972
|
-
function buildKey$
|
|
31999
|
+
function buildKey$53({ access_token: accessToken, apiUrl, businessId, startDate, endDate }) {
|
|
31973
32000
|
if (accessToken && apiUrl) return {
|
|
31974
32001
|
accessToken,
|
|
31975
32002
|
apiUrl,
|
|
@@ -31983,7 +32010,7 @@ function useLedgerBalances(withDates, startDate, endDate) {
|
|
|
31983
32010
|
const withLocale = useLocalizedKey();
|
|
31984
32011
|
const { data } = useAuth();
|
|
31985
32012
|
const { businessId } = useLayerContext();
|
|
31986
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
32013
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$53(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
31987
32014
|
businessId,
|
|
31988
32015
|
startDate: withDates ? startDate : void 0,
|
|
31989
32016
|
endDate: withDates ? endDate : void 0
|
|
@@ -32551,7 +32578,7 @@ function useListLedgerAccountLines({ accountId, include_entries_before_activatio
|
|
|
32551
32578
|
//#region src/hooks/api/businesses/[business-id]/ledger/entries/[entry-id]/useLedgerAccountsEntry.ts
|
|
32552
32579
|
var LEDGER_ACCOUNTS_ENTRY_TAG_KEY = "#ledger-accounts-entry";
|
|
32553
32580
|
var getLedgerAccountsEntry = get$1(({ businessId, entryId }) => `/v1/businesses/${businessId}/ledger/entries/${entryId}`);
|
|
32554
|
-
function buildKey$
|
|
32581
|
+
function buildKey$52({ accessToken, apiUrl, businessId, entryId }) {
|
|
32555
32582
|
if (!accessToken || !entryId) return null;
|
|
32556
32583
|
return {
|
|
32557
32584
|
accessToken,
|
|
@@ -32566,7 +32593,7 @@ function useLedgerAccountsEntry({ entryId }) {
|
|
|
32566
32593
|
const { businessId } = useLayerContext();
|
|
32567
32594
|
const { apiUrl } = useEnvironment();
|
|
32568
32595
|
const { data: auth } = useAuth();
|
|
32569
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
32596
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$52({
|
|
32570
32597
|
accessToken: auth === null || auth === void 0 ? void 0 : auth.access_token,
|
|
32571
32598
|
apiUrl,
|
|
32572
32599
|
businessId,
|
|
@@ -32973,7 +33000,7 @@ var getRowIndentStyle = ({ depth, canExpand, indentSizePx }) => ({
|
|
|
32973
33000
|
paddingInlineStart: depth * indentSizePx + (canExpand ? 0 : CHEVRON_OFFSET_PX),
|
|
32974
33001
|
overflow: "hidden"
|
|
32975
33002
|
});
|
|
32976
|
-
var EMPTY_ARRAY$
|
|
33003
|
+
var EMPTY_ARRAY$3 = [];
|
|
32977
33004
|
function ExpandableDataTable({ data, isLoading, isError, columnConfig, componentName, ariaLabel, slots, getSubRows, getRowId, indentSize = "sm" }) {
|
|
32978
33005
|
const { expanded, setExpanded } = (0, react.useContext)(ExpandableDataTableContext);
|
|
32979
33006
|
const wrappedColumnConfig = (0, react.useMemo)(() => {
|
|
@@ -33005,7 +33032,7 @@ function ExpandableDataTable({ data, isLoading, isError, columnConfig, component
|
|
|
33005
33032
|
const columnDefs = getColumnDefs(wrappedColumnConfig);
|
|
33006
33033
|
const columnPinning = (0, react.useMemo)(() => getColumnPinning(wrappedColumnConfig), [wrappedColumnConfig]);
|
|
33007
33034
|
const table = (0, _tanstack_react_table.useReactTable)({
|
|
33008
|
-
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$
|
|
33035
|
+
data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$3,
|
|
33009
33036
|
columns: columnDefs,
|
|
33010
33037
|
getSubRows,
|
|
33011
33038
|
getCoreRowModel: (0, _tanstack_react_table.getCoreRowModel)(),
|
|
@@ -33318,7 +33345,7 @@ var Plus$8 = (_ref) => {
|
|
|
33318
33345
|
//#endregion
|
|
33319
33346
|
//#region src/hooks/api/businesses/[business-id]/ledger/balances/exports/csv/useAccountBalancesDownload.ts
|
|
33320
33347
|
var getLedgerAccountBalancesCSV = get$1(({ businessId }) => `/v1/businesses/${businessId}/ledger/balances/exports/csv`);
|
|
33321
|
-
function buildKey$
|
|
33348
|
+
function buildKey$51({ access_token: accessToken, apiUrl, businessId, startCutoff, endCutoff }) {
|
|
33322
33349
|
if (accessToken && apiUrl) return {
|
|
33323
33350
|
accessToken,
|
|
33324
33351
|
apiUrl,
|
|
@@ -33336,7 +33363,7 @@ function useAccountBalancesDownload({ startCutoff, endCutoff, onSuccess }) {
|
|
|
33336
33363
|
const withLocale = useLocalizedKey();
|
|
33337
33364
|
const { data: auth } = useAuth();
|
|
33338
33365
|
const { businessId } = useLayerContext();
|
|
33339
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
33366
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$51(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
33340
33367
|
businessId,
|
|
33341
33368
|
startCutoff,
|
|
33342
33369
|
endCutoff
|
|
@@ -34308,7 +34335,7 @@ var UpsertJournalEntryMode = /* @__PURE__ */ function(UpsertJournalEntryMode) {
|
|
|
34308
34335
|
return UpsertJournalEntryMode;
|
|
34309
34336
|
}({});
|
|
34310
34337
|
var createJournalEntry = post(({ businessId }) => `/v1/businesses/${businessId}/ledger/journal-entries`);
|
|
34311
|
-
function buildKey$
|
|
34338
|
+
function buildKey$50({ access_token: accessToken, apiUrl, businessId }) {
|
|
34312
34339
|
if (accessToken && apiUrl) return {
|
|
34313
34340
|
accessToken,
|
|
34314
34341
|
apiUrl,
|
|
@@ -34325,7 +34352,7 @@ var useUpsertJournalEntry = (props) => {
|
|
|
34325
34352
|
const { forceReloadLedgerEntries } = useLedgerEntriesCacheActions();
|
|
34326
34353
|
const { debouncedInvalidateProfitAndLoss } = useProfitAndLossGlobalInvalidator();
|
|
34327
34354
|
const { invalidate } = useGlobalCacheActions();
|
|
34328
|
-
const rawMutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
34355
|
+
const rawMutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$50(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => {
|
|
34329
34356
|
return createJournalEntry(apiUrl, accessToken, {
|
|
34330
34357
|
params: { businessId },
|
|
34331
34358
|
body
|
|
@@ -34619,10 +34646,10 @@ var JournalEntryLineItem = ({ form, index, displayIndex, isReadOnly, onDeleteLin
|
|
|
34619
34646
|
};
|
|
34620
34647
|
//#endregion
|
|
34621
34648
|
//#region src/components/Journal/JournalEntryForm/JournalEntryLineItemsTable.tsx
|
|
34622
|
-
var EMPTY_ARRAY$
|
|
34649
|
+
var EMPTY_ARRAY$2 = [];
|
|
34623
34650
|
var JournalEntryLineItemsTable = ({ form, isReadOnly, title, direction, showTags = false }) => {
|
|
34624
34651
|
const { t } = (0, react_i18next.useTranslation)();
|
|
34625
|
-
const lineItems = (0, _tanstack_react_form.useStore)(form.store, (state) => state.values.lineItems || EMPTY_ARRAY$
|
|
34652
|
+
const lineItems = (0, _tanstack_react_form.useStore)(form.store, (state) => state.values.lineItems || EMPTY_ARRAY$2);
|
|
34626
34653
|
const filteredIndices = (0, react.useMemo)(() => {
|
|
34627
34654
|
const indices = [];
|
|
34628
34655
|
lineItems.forEach((item, index) => {
|
|
@@ -35035,7 +35062,7 @@ var JournalEntryDrawerHeader = ({ onSubmit, formState }) => {
|
|
|
35035
35062
|
//#endregion
|
|
35036
35063
|
//#region src/hooks/api/businesses/[business-id]/ledger/entries/exports/csv/useJournalEntriesDownload.ts
|
|
35037
35064
|
var getJournalEntriesCSV = get$1(({ businessId }) => `/v1/businesses/${businessId}/ledger/entries/exports/csv`);
|
|
35038
|
-
function buildKey$
|
|
35065
|
+
function buildKey$49({ access_token: accessToken, apiUrl, businessId, startCutoff, endCutoff }) {
|
|
35039
35066
|
if (accessToken && apiUrl) return {
|
|
35040
35067
|
accessToken,
|
|
35041
35068
|
apiUrl,
|
|
@@ -35053,7 +35080,7 @@ function useJournalEntriesDownload({ startCutoff, endCutoff, onSuccess }) {
|
|
|
35053
35080
|
const withLocale = useLocalizedKey();
|
|
35054
35081
|
const { data: auth } = useAuth();
|
|
35055
35082
|
const { businessId } = useLayerContext();
|
|
35056
|
-
return (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
35083
|
+
return (0, swr_mutation.default)(() => withLocale(buildKey$49(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
35057
35084
|
businessId,
|
|
35058
35085
|
startCutoff,
|
|
35059
35086
|
endCutoff
|
|
@@ -35277,7 +35304,7 @@ var JournalEntryDetails = () => {
|
|
|
35277
35304
|
}) }), (entry === null || entry === void 0 ? void 0 : entry.entry_type) === "MANUAL" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
35278
35305
|
className: "Layer__journal__entry-details__reverse-btn-container",
|
|
35279
35306
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$2, {
|
|
35280
|
-
rightIcon: reverseEntryError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertCircle$1, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
35307
|
+
rightIcon: reverseEntryError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertCircle$1, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 }),
|
|
35281
35308
|
variant: ButtonVariant.secondary,
|
|
35282
35309
|
onClick: reverseEntryProcessing ? () => {} : onReverseEntry,
|
|
35283
35310
|
isProcessing: reverseEntryProcessing,
|
|
@@ -35745,7 +35772,7 @@ function getIconForTask(task) {
|
|
|
35745
35772
|
//#endregion
|
|
35746
35773
|
//#region src/hooks/api/businesses/[business-id]/tasks/[task-id]/upload/delete/useDeleteUploadsOnTask.ts
|
|
35747
35774
|
var deleteUploadsOnTask = post(({ businessId, taskId }) => `/v1/businesses/${businessId}/tasks/${taskId}/upload/delete`);
|
|
35748
|
-
function buildKey$
|
|
35775
|
+
function buildKey$48({ access_token: accessToken, apiUrl, businessId }) {
|
|
35749
35776
|
if (accessToken && apiUrl) return {
|
|
35750
35777
|
accessToken,
|
|
35751
35778
|
apiUrl,
|
|
@@ -35758,7 +35785,7 @@ function useDeleteUploadsOnTask() {
|
|
|
35758
35785
|
const { data: auth } = useAuth();
|
|
35759
35786
|
const { businessId } = useLayerContext();
|
|
35760
35787
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
35761
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
35788
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$48(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { taskId } }) => deleteUploadsOnTask(apiUrl, accessToken, { params: {
|
|
35762
35789
|
businessId,
|
|
35763
35790
|
taskId
|
|
35764
35791
|
} }), {
|
|
@@ -35779,7 +35806,7 @@ function useDeleteUploadsOnTask() {
|
|
|
35779
35806
|
//#endregion
|
|
35780
35807
|
//#region src/hooks/api/businesses/[business-id]/tasks/[task-id]/upload/update-description/useUpdateTaskUploadDescription.ts
|
|
35781
35808
|
var updateTaskUploadsDescription = post(({ businessId, taskId }) => `/v1/businesses/${businessId}/tasks/${taskId}/upload/update-description`);
|
|
35782
|
-
function buildKey$
|
|
35809
|
+
function buildKey$47({ access_token: accessToken, apiUrl, businessId }) {
|
|
35783
35810
|
if (accessToken && apiUrl) return {
|
|
35784
35811
|
accessToken,
|
|
35785
35812
|
apiUrl,
|
|
@@ -35792,7 +35819,7 @@ function useUpdateTaskUploadDescription() {
|
|
|
35792
35819
|
const { data: auth } = useAuth();
|
|
35793
35820
|
const { businessId } = useLayerContext();
|
|
35794
35821
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
35795
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
35822
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$47(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { taskId, description } }) => updateTaskUploadsDescription(apiUrl, accessToken, {
|
|
35796
35823
|
params: {
|
|
35797
35824
|
businessId,
|
|
35798
35825
|
taskId
|
|
@@ -35824,7 +35851,7 @@ function completeTaskWithUpload(baseUrl, accessToken, { businessId, taskId, file
|
|
|
35824
35851
|
if (description) formData.append("description", description);
|
|
35825
35852
|
return postWithFormData(`/v1/businesses/${businessId}/tasks/${taskId}/upload`, formData, baseUrl, accessToken);
|
|
35826
35853
|
}
|
|
35827
|
-
function buildKey$
|
|
35854
|
+
function buildKey$46({ access_token: accessToken, apiUrl, businessId }) {
|
|
35828
35855
|
if (accessToken && apiUrl) return {
|
|
35829
35856
|
accessToken,
|
|
35830
35857
|
apiUrl,
|
|
@@ -35837,7 +35864,7 @@ function useUploadDocumentsForTask() {
|
|
|
35837
35864
|
const { data: auth } = useAuth();
|
|
35838
35865
|
const { businessId } = useLayerContext();
|
|
35839
35866
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
35840
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
35867
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$46(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { taskId, files, description } }) => completeTaskWithUpload(apiUrl, accessToken, {
|
|
35841
35868
|
businessId,
|
|
35842
35869
|
taskId,
|
|
35843
35870
|
files,
|
|
@@ -35860,7 +35887,7 @@ function useUploadDocumentsForTask() {
|
|
|
35860
35887
|
//#endregion
|
|
35861
35888
|
//#region src/hooks/api/businesses/[business-id]/tasks/[task-id]/user-response/useSubmitResponseForTask.ts
|
|
35862
35889
|
var submitUserResponseForTask = post(({ businessId, taskId }) => `/v1/businesses/${businessId}/tasks/${taskId}/user-response`);
|
|
35863
|
-
function buildKey$
|
|
35890
|
+
function buildKey$45({ access_token: accessToken, apiUrl, businessId }) {
|
|
35864
35891
|
if (accessToken && apiUrl) return {
|
|
35865
35892
|
accessToken,
|
|
35866
35893
|
apiUrl,
|
|
@@ -35873,7 +35900,7 @@ function useSubmitUserResponseForTask() {
|
|
|
35873
35900
|
const { data: auth } = useAuth();
|
|
35874
35901
|
const { businessId } = useLayerContext();
|
|
35875
35902
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
35876
|
-
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
35903
|
+
const mutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$45(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: { taskId, userResponse } }) => submitUserResponseForTask(apiUrl, accessToken, {
|
|
35877
35904
|
body: {
|
|
35878
35905
|
type: "FreeResponse",
|
|
35879
35906
|
user_response: userResponse
|
|
@@ -37795,7 +37822,7 @@ var MileageSummarySchema = effect.Schema.Struct({ years: effect.Schema.Array(Mil
|
|
|
37795
37822
|
//#endregion
|
|
37796
37823
|
//#region src/hooks/api/businesses/[business-id]/mileage/summary/useMileageSummary.tsx
|
|
37797
37824
|
var MILEAGE_SUMMARY_TAG_KEY = "#mileage-summary";
|
|
37798
|
-
function buildKey$
|
|
37825
|
+
function buildKey$44({ access_token: accessToken, apiUrl, businessId }) {
|
|
37799
37826
|
if (accessToken && apiUrl) return {
|
|
37800
37827
|
accessToken,
|
|
37801
37828
|
apiUrl,
|
|
@@ -37808,7 +37835,7 @@ function useMileageSummary() {
|
|
|
37808
37835
|
const withLocale = useLocalizedKey();
|
|
37809
37836
|
const { data } = useAuth();
|
|
37810
37837
|
const { businessId } = useLayerContext();
|
|
37811
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
37838
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$44(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }) => getMileageSummary(apiUrl, accessToken, { params: { businessId } })().then(({ data }) => effect.Schema.decodeUnknownPromise(MileageSummarySchema)(data))));
|
|
37812
37839
|
}
|
|
37813
37840
|
var useMileageSummaryGlobalCacheActions = () => {
|
|
37814
37841
|
const { invalidate } = useGlobalCacheActions();
|
|
@@ -38011,7 +38038,7 @@ var listVehicles = get$1(({ businessId, allowArchived }) => {
|
|
|
38011
38038
|
return `/v1/businesses/${businessId}/mileage/vehicles?${toDefinedSearchParameters({ allowArchived })}`;
|
|
38012
38039
|
});
|
|
38013
38040
|
var VEHICLES_TAG_KEY = "#list-vehicles";
|
|
38014
|
-
function buildKey$
|
|
38041
|
+
function buildKey$43({ access_token: accessToken, apiUrl, businessId, allowArchived }) {
|
|
38015
38042
|
if (accessToken && apiUrl) return {
|
|
38016
38043
|
accessToken,
|
|
38017
38044
|
apiUrl,
|
|
@@ -38030,7 +38057,7 @@ function useListVehicles({ allowArchived } = {}) {
|
|
|
38030
38057
|
const withLocale = useLocalizedKey();
|
|
38031
38058
|
const { data } = useAuth();
|
|
38032
38059
|
const { businessId } = useLayerContext();
|
|
38033
|
-
return new ListVehiclesSWRResponse((0, swr.default)(() => withLocale(buildKey$
|
|
38060
|
+
return new ListVehiclesSWRResponse((0, swr.default)(() => withLocale(buildKey$43(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
38034
38061
|
businessId,
|
|
38035
38062
|
allowArchived
|
|
38036
38063
|
}))), ({ accessToken, apiUrl, businessId, allowArchived }) => listVehicles(apiUrl, accessToken, { params: {
|
|
@@ -38059,7 +38086,7 @@ var UpsertTripMode = /* @__PURE__ */ function(UpsertTripMode) {
|
|
|
38059
38086
|
}({});
|
|
38060
38087
|
var createTrip = post(({ businessId }) => `/v1/businesses/${businessId}/mileage/trips`);
|
|
38061
38088
|
var updateTrip = patch(({ businessId, tripId }) => `/v1/businesses/${businessId}/mileage/trips/${tripId}`);
|
|
38062
|
-
function buildKey$
|
|
38089
|
+
function buildKey$42({ access_token: accessToken, apiUrl, businessId, tripId = void 0 }) {
|
|
38063
38090
|
if (accessToken && apiUrl) return {
|
|
38064
38091
|
accessToken,
|
|
38065
38092
|
apiUrl,
|
|
@@ -38100,7 +38127,7 @@ var useUpsertTrip = (props) => {
|
|
|
38100
38127
|
const { businessId } = useLayerContext();
|
|
38101
38128
|
const { mode } = props;
|
|
38102
38129
|
const tripId = mode === UpsertTripMode.Update ? props.tripId : void 0;
|
|
38103
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
38130
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$42(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
38104
38131
|
businessId,
|
|
38105
38132
|
tripId
|
|
38106
38133
|
}))), ({ accessToken, apiUrl, businessId, tripId }, { arg: body }) => {
|
|
@@ -38718,7 +38745,7 @@ var MileageSummaryCard = () => {
|
|
|
38718
38745
|
children: t("mileageTracking:label.mileage_tracking", "Mileage Tracking")
|
|
38719
38746
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button$1, {
|
|
38720
38747
|
onPress: onRecordTrip,
|
|
38721
|
-
children: [t("trips:action.
|
|
38748
|
+
children: [t("trips:action.record_trip", "Record Trip"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Plus$8, { size: 16 })]
|
|
38722
38749
|
})]
|
|
38723
38750
|
}),
|
|
38724
38751
|
mileageSummaryCardContent,
|
|
@@ -38941,7 +38968,7 @@ var InvoiceSummaryStatsResponseSchema = effect.Schema.Struct({
|
|
|
38941
38968
|
//#endregion
|
|
38942
38969
|
//#region src/hooks/api/businesses/[business-id]/invoices/summary-stats/useInvoiceSummaryStats.tsx
|
|
38943
38970
|
var INVOICE_SUMMARY_STATS_TAG_KEY = "#invoices-summary-stats";
|
|
38944
|
-
function buildKey$
|
|
38971
|
+
function buildKey$41({ access_token: accessToken, apiUrl, businessId }) {
|
|
38945
38972
|
if (accessToken && apiUrl) return {
|
|
38946
38973
|
accessToken,
|
|
38947
38974
|
apiUrl,
|
|
@@ -38954,7 +38981,7 @@ function useInvoiceSummaryStats() {
|
|
|
38954
38981
|
const withLocale = useLocalizedKey();
|
|
38955
38982
|
const { data } = useAuth();
|
|
38956
38983
|
const { businessId } = useLayerContext();
|
|
38957
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
38984
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$41(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }) => getInvoiceSummaryStats(apiUrl, accessToken, { params: { businessId } })().then(({ data }) => effect.Schema.decodeUnknownPromise(InvoiceSummaryStatsResponseSchema)(data))));
|
|
38958
38985
|
}
|
|
38959
38986
|
var useInvoiceSummaryStatsCacheActions = () => {
|
|
38960
38987
|
const { forceReload } = useGlobalCacheActions();
|
|
@@ -39067,7 +39094,7 @@ var UpsertInvoiceMode = /* @__PURE__ */ function(UpsertInvoiceMode) {
|
|
|
39067
39094
|
}({});
|
|
39068
39095
|
var createInvoice = post(({ businessId }) => `/v1/businesses/${businessId}/invoices`);
|
|
39069
39096
|
var updateInvoice = patch(({ businessId, invoiceId }) => `/v1/businesses/${businessId}/invoices/${invoiceId}`);
|
|
39070
|
-
function buildKey$
|
|
39097
|
+
function buildKey$40({ access_token: accessToken, apiUrl, businessId, invoiceId = void 0 }) {
|
|
39071
39098
|
if (accessToken && apiUrl) return {
|
|
39072
39099
|
accessToken,
|
|
39073
39100
|
apiUrl,
|
|
@@ -39108,7 +39135,7 @@ var useUpsertInvoice = (props) => {
|
|
|
39108
39135
|
const { businessId } = useLayerContext();
|
|
39109
39136
|
const { mode } = props;
|
|
39110
39137
|
const invoiceId = mode === UpsertInvoiceMode.Update ? props.invoiceId : void 0;
|
|
39111
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
39138
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$40(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
39112
39139
|
businessId,
|
|
39113
39140
|
invoiceId
|
|
39114
39141
|
}))), ({ accessToken, apiUrl, businessId, invoiceId }, { arg: body }) => {
|
|
@@ -39318,7 +39345,7 @@ var InvoiceStatusFilter = /* @__PURE__ */ function(InvoiceStatusFilter) {
|
|
|
39318
39345
|
return InvoiceStatusFilter;
|
|
39319
39346
|
}(InvoiceStatusFilter || {});
|
|
39320
39347
|
var INVOICE_STATUS_CONFIG = [
|
|
39321
|
-
_objectSpread2({ value: InvoiceStatusFilter.All }, translationKey("common:label.
|
|
39348
|
+
_objectSpread2({ value: InvoiceStatusFilter.All }, translationKey("common:label.all", "All")),
|
|
39322
39349
|
_objectSpread2({ value: InvoiceStatusFilter.Unpaid }, translationKey("invoices:state.unpaid", "Unpaid")),
|
|
39323
39350
|
_objectSpread2({ value: InvoiceStatusFilter.Overdue }, translationKey("invoices:state.overdue", "Overdue")),
|
|
39324
39351
|
_objectSpread2({ value: InvoiceStatusFilter.Sent }, translationKey("invoices:state.sent", "Sent")),
|
|
@@ -39520,7 +39547,7 @@ var InvoiceTable = () => {
|
|
|
39520
39547
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container, {
|
|
39521
39548
|
name: "InvoiceTable",
|
|
39522
39549
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataTableHeader, {
|
|
39523
|
-
name: "Invoices",
|
|
39550
|
+
name: t("invoices:label.invoices", "Invoices"),
|
|
39524
39551
|
slots: {
|
|
39525
39552
|
HeaderActions: CreateInvoiceButton,
|
|
39526
39553
|
HeaderFilters: StatusFilter
|
|
@@ -39675,6 +39702,61 @@ var DiscardInvoiceChangesModal = ({ isOpen, onOpenChange, onConfirm }) => {
|
|
|
39675
39702
|
});
|
|
39676
39703
|
};
|
|
39677
39704
|
//#endregion
|
|
39705
|
+
//#region src/schemas/common/s3PresignedUrl.ts
|
|
39706
|
+
var S3PresignedUrlSchema = effect.Schema.Struct({
|
|
39707
|
+
presignedUrl: effect.Schema.String,
|
|
39708
|
+
fileType: effect.Schema.String,
|
|
39709
|
+
fileName: effect.Schema.String,
|
|
39710
|
+
createdAt: effect.Schema.Date,
|
|
39711
|
+
documentId: effect.Schema.NullishOr(effect.Schema.UUID)
|
|
39712
|
+
});
|
|
39713
|
+
//#endregion
|
|
39714
|
+
//#region src/hooks/api/businesses/[business-id]/invoices/[invoice-id]/pdf/useInvoicePdfDownload.tsx
|
|
39715
|
+
var getInvoicePdf = get$1(({ businessId, invoiceId }) => `/v1/businesses/${businessId}/invoices/${invoiceId}/pdf`);
|
|
39716
|
+
var DOWNLOAD_INVOICE_PDF_TAG_KEY = "#download-invoice-pdf";
|
|
39717
|
+
var InvoicePdfReturnSchema = effect.Schema.Struct({ data: S3PresignedUrlSchema });
|
|
39718
|
+
function buildKey$39({ access_token: accessToken, apiUrl, businessId, invoiceId }) {
|
|
39719
|
+
if (accessToken && apiUrl) return {
|
|
39720
|
+
accessToken,
|
|
39721
|
+
apiUrl,
|
|
39722
|
+
businessId,
|
|
39723
|
+
invoiceId,
|
|
39724
|
+
tags: [DOWNLOAD_INVOICE_PDF_TAG_KEY]
|
|
39725
|
+
};
|
|
39726
|
+
}
|
|
39727
|
+
function useInvoicePdfDownload({ invoiceId, onSuccess, onError }) {
|
|
39728
|
+
const withLocale = useLocalizedKey();
|
|
39729
|
+
const { data } = useAuth();
|
|
39730
|
+
const { businessId } = useLayerContext();
|
|
39731
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$39(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
39732
|
+
businessId,
|
|
39733
|
+
invoiceId
|
|
39734
|
+
}))), ({ accessToken, apiUrl, businessId, invoiceId }) => getInvoicePdf(apiUrl, accessToken, { params: {
|
|
39735
|
+
businessId,
|
|
39736
|
+
invoiceId
|
|
39737
|
+
} })().then(effect.Schema.decodeUnknownPromise(InvoicePdfReturnSchema)).then(function() {
|
|
39738
|
+
var _ref = _asyncToGenerator(function* ({ data }) {
|
|
39739
|
+
if (onSuccess) yield onSuccess(data);
|
|
39740
|
+
return data;
|
|
39741
|
+
});
|
|
39742
|
+
return function(_x) {
|
|
39743
|
+
return _ref.apply(this, arguments);
|
|
39744
|
+
};
|
|
39745
|
+
}()), {
|
|
39746
|
+
revalidate: false,
|
|
39747
|
+
throwOnError: false,
|
|
39748
|
+
onError
|
|
39749
|
+
}));
|
|
39750
|
+
const originalTrigger = mutationResponse.trigger;
|
|
39751
|
+
const stableProxiedTrigger = (0, react.useCallback)(_asyncToGenerator(function* (...triggerParameters) {
|
|
39752
|
+
return originalTrigger(...triggerParameters);
|
|
39753
|
+
}), [originalTrigger]);
|
|
39754
|
+
return new Proxy(mutationResponse, { get(target, prop) {
|
|
39755
|
+
if (prop === "trigger") return stableProxiedTrigger;
|
|
39756
|
+
return Reflect.get(target, prop);
|
|
39757
|
+
} });
|
|
39758
|
+
}
|
|
39759
|
+
//#endregion
|
|
39678
39760
|
//#region src/components/PaymentMethod/schemas.ts
|
|
39679
39761
|
var PaymentMethod = /* @__PURE__ */ function(PaymentMethod) {
|
|
39680
39762
|
PaymentMethod["Cash"] = "CASH";
|
|
@@ -40315,6 +40397,7 @@ function InvoiceWriteoffModal({ isOpen, onOpenChange, invoice, onSuccess }) {
|
|
|
40315
40397
|
//#region src/components/Invoices/InvoiceDetail/InvoiceDetailHeaderMenu.tsx
|
|
40316
40398
|
var InvoiceDetailHeaderMenuActions = /* @__PURE__ */ function(InvoiceDetailHeaderMenuActions) {
|
|
40317
40399
|
InvoiceDetailHeaderMenuActions["Edit"] = "Edit";
|
|
40400
|
+
InvoiceDetailHeaderMenuActions["DownloadPdf"] = "DownloadPdf";
|
|
40318
40401
|
InvoiceDetailHeaderMenuActions["Void"] = "Void";
|
|
40319
40402
|
InvoiceDetailHeaderMenuActions["Refund"] = "Refund";
|
|
40320
40403
|
InvoiceDetailHeaderMenuActions["Writeoff"] = "Writeoff";
|
|
@@ -40324,15 +40407,24 @@ var InvoiceDetailHeaderMenuActions = /* @__PURE__ */ function(InvoiceDetailHeade
|
|
|
40324
40407
|
var availableActions = {
|
|
40325
40408
|
[InvoiceStatus.Sent]: [
|
|
40326
40409
|
InvoiceDetailHeaderMenuActions.Edit,
|
|
40410
|
+
InvoiceDetailHeaderMenuActions.DownloadPdf,
|
|
40327
40411
|
InvoiceDetailHeaderMenuActions.Void,
|
|
40328
40412
|
InvoiceDetailHeaderMenuActions.Writeoff
|
|
40329
40413
|
],
|
|
40330
|
-
[InvoiceStatus.PartiallyPaid]: [
|
|
40331
|
-
|
|
40332
|
-
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
[InvoiceStatus.
|
|
40414
|
+
[InvoiceStatus.PartiallyPaid]: [
|
|
40415
|
+
InvoiceDetailHeaderMenuActions.DownloadPdf,
|
|
40416
|
+
InvoiceDetailHeaderMenuActions.Writeoff,
|
|
40417
|
+
InvoiceDetailHeaderMenuActions.Reset
|
|
40418
|
+
],
|
|
40419
|
+
[InvoiceStatus.Paid]: [
|
|
40420
|
+
InvoiceDetailHeaderMenuActions.DownloadPdf,
|
|
40421
|
+
InvoiceDetailHeaderMenuActions.Refund,
|
|
40422
|
+
InvoiceDetailHeaderMenuActions.Reset
|
|
40423
|
+
],
|
|
40424
|
+
[InvoiceStatus.Voided]: [InvoiceDetailHeaderMenuActions.DownloadPdf, InvoiceDetailHeaderMenuActions.Reset],
|
|
40425
|
+
[InvoiceStatus.PartiallyWrittenOff]: [InvoiceDetailHeaderMenuActions.DownloadPdf, InvoiceDetailHeaderMenuActions.Reset],
|
|
40426
|
+
[InvoiceStatus.WrittenOff]: [InvoiceDetailHeaderMenuActions.DownloadPdf, InvoiceDetailHeaderMenuActions.Reset],
|
|
40427
|
+
[InvoiceStatus.Refunded]: [InvoiceDetailHeaderMenuActions.DownloadPdf, InvoiceDetailHeaderMenuActions.Reset]
|
|
40336
40428
|
};
|
|
40337
40429
|
var getInvoiceActions = (invoice) => {
|
|
40338
40430
|
return availableActions[invoice.status];
|
|
@@ -40341,7 +40433,9 @@ var InvoiceDetailHeaderMenu = ({ onEditInvoice }) => {
|
|
|
40341
40433
|
const { t } = (0, react_i18next.useTranslation)();
|
|
40342
40434
|
const viewState = useInvoiceDetail();
|
|
40343
40435
|
const { toViewInvoice } = useInvoiceNavigation();
|
|
40436
|
+
const { addToast } = useLayerContext();
|
|
40344
40437
|
const [openModal, setOpenModal] = (0, react.useState)();
|
|
40438
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
40345
40439
|
const onSuccessUpdateInvoice = (0, react.useCallback)((updatedInvoice) => {
|
|
40346
40440
|
toViewInvoice(updatedInvoice);
|
|
40347
40441
|
}, [toViewInvoice]);
|
|
@@ -40356,6 +40450,27 @@ var InvoiceDetailHeaderMenu = ({ onEditInvoice }) => {
|
|
|
40356
40450
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Menu, { size: 14 })
|
|
40357
40451
|
});
|
|
40358
40452
|
}, []);
|
|
40453
|
+
const { trigger: downloadInvoicePdf, isMutating: isDownloadingInvoicePdf } = useInvoicePdfDownload({
|
|
40454
|
+
invoiceId: viewState.mode === UpsertInvoiceMode.Update ? viewState.invoice.id : "",
|
|
40455
|
+
onSuccess: ({ presignedUrl, fileName }) => {
|
|
40456
|
+
triggerInvisibleDownload({
|
|
40457
|
+
url: presignedUrl,
|
|
40458
|
+
filename: fileName
|
|
40459
|
+
});
|
|
40460
|
+
addToast({
|
|
40461
|
+
content: t("invoices:label.download_successful", "Download successful"),
|
|
40462
|
+
type: "success"
|
|
40463
|
+
});
|
|
40464
|
+
},
|
|
40465
|
+
onError: () => addToast({
|
|
40466
|
+
content: t("invoices:error.download_failed", "Download failed"),
|
|
40467
|
+
type: "error"
|
|
40468
|
+
})
|
|
40469
|
+
});
|
|
40470
|
+
const onDownloadInvoicePdf = () => {
|
|
40471
|
+
addToast({ content: t("invoices:label.download_started", "Download started") });
|
|
40472
|
+
downloadInvoicePdf();
|
|
40473
|
+
};
|
|
40359
40474
|
if (viewState.mode === UpsertInvoiceMode.Create) return null;
|
|
40360
40475
|
const invoice = viewState.invoice;
|
|
40361
40476
|
const invoiceActions = getInvoiceActions(invoice);
|
|
@@ -40401,9 +40516,18 @@ var InvoiceDetailHeaderMenu = ({ onEditInvoice }) => {
|
|
|
40401
40516
|
size: "sm",
|
|
40402
40517
|
children: t("invoices:action.reset_to_sent", "Reset to sent")
|
|
40403
40518
|
})
|
|
40404
|
-
}, InvoiceDetailHeaderMenuActions.Reset)
|
|
40519
|
+
}, InvoiceDetailHeaderMenuActions.Reset),
|
|
40520
|
+
invoiceActions.includes(InvoiceDetailHeaderMenuActions.DownloadPdf) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItem$1, {
|
|
40521
|
+
isDisabled: isDownloadingInvoicePdf,
|
|
40522
|
+
onClick: onDownloadInvoicePdf,
|
|
40523
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
40524
|
+
size: "sm",
|
|
40525
|
+
children: t("invoices:action.download_pdf", "Download PDF")
|
|
40526
|
+
})
|
|
40527
|
+
}, InvoiceDetailHeaderMenuActions.DownloadPdf)
|
|
40405
40528
|
] })
|
|
40406
40529
|
}),
|
|
40530
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvisibleDownload, { ref: invisibleDownloadRef }),
|
|
40407
40531
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvoiceRefundModal, {
|
|
40408
40532
|
isOpen: openModal === InvoiceDetailHeaderMenuActions.Refund,
|
|
40409
40533
|
onOpenChange: onOpenChangeByMode(InvoiceDetailHeaderMenuActions.Refund),
|
|
@@ -40431,6 +40555,27 @@ var InvoiceDetailHeaderMenu = ({ onEditInvoice }) => {
|
|
|
40431
40555
|
] });
|
|
40432
40556
|
};
|
|
40433
40557
|
//#endregion
|
|
40558
|
+
//#region src/components/Invoices/InvoicePreview/InvoicePdfDownloadButton.tsx
|
|
40559
|
+
var InvoicePdfDownloadButton = ({ invoiceId }) => {
|
|
40560
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
40561
|
+
const { invisibleDownloadRef, triggerInvisibleDownload } = useInvisibleDownload();
|
|
40562
|
+
const { trigger, isMutating, isError } = useInvoicePdfDownload({
|
|
40563
|
+
invoiceId,
|
|
40564
|
+
onSuccess: ({ presignedUrl, fileName }) => triggerInvisibleDownload({
|
|
40565
|
+
url: presignedUrl,
|
|
40566
|
+
filename: fileName
|
|
40567
|
+
})
|
|
40568
|
+
});
|
|
40569
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button$1, {
|
|
40570
|
+
isPending: isMutating,
|
|
40571
|
+
isDisabled: isMutating,
|
|
40572
|
+
onPress: () => {
|
|
40573
|
+
trigger();
|
|
40574
|
+
},
|
|
40575
|
+
children: [isError ? t("common:action.retry_label", "Retry") : t("invoices:action.download_pdf", "Download PDF"), isError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.RefreshCcw, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Download, { size: 14 })]
|
|
40576
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvisibleDownload, { ref: invisibleDownloadRef })] });
|
|
40577
|
+
};
|
|
40578
|
+
//#endregion
|
|
40434
40579
|
//#region src/components/Invoices/InvoiceDetail/InvoiceDetailHeader.tsx
|
|
40435
40580
|
var HeaderMode = /* @__PURE__ */ function(HeaderMode) {
|
|
40436
40581
|
HeaderMode["View"] = "View";
|
|
@@ -40445,8 +40590,8 @@ var getHeaderMode = (viewState) => {
|
|
|
40445
40590
|
};
|
|
40446
40591
|
var HEADING_I18N = {
|
|
40447
40592
|
[HeaderMode.Preview]: {
|
|
40448
|
-
withNumber: translationKey("invoices:label.
|
|
40449
|
-
noNumber: translationKey("invoices:
|
|
40593
|
+
withNumber: translationKey("invoices:label.invoice_number", "Invoice #{{invoiceNumber}}"),
|
|
40594
|
+
noNumber: translationKey("invoices:action.view_invoice", "View Invoice")
|
|
40450
40595
|
},
|
|
40451
40596
|
[HeaderMode.View]: {
|
|
40452
40597
|
withNumber: translationKey("invoices:label.invoice_number", "Invoice #{{invoiceNumber}}"),
|
|
@@ -40463,26 +40608,29 @@ var getHeadingContent = (headerMode, invoiceNumber, t) => {
|
|
|
40463
40608
|
};
|
|
40464
40609
|
var InvoiceDetailHeader = ({ onSubmitInvoiceForm, formState, openInvoicePaymentDrawer }) => {
|
|
40465
40610
|
const { t } = (0, react_i18next.useTranslation)();
|
|
40611
|
+
const { accountingConfiguration } = useLayerContext();
|
|
40466
40612
|
const viewState = useInvoiceDetail();
|
|
40467
40613
|
const { toEditInvoice } = useInvoiceNavigation();
|
|
40468
|
-
const
|
|
40469
|
-
|
|
40470
|
-
|
|
40471
|
-
|
|
40614
|
+
const buttonContent = !!(accountingConfiguration === null || accountingConfiguration === void 0 ? void 0 : accountingConfiguration.enableStripeOnboarding) ? {
|
|
40615
|
+
label: t("common:label.next", "Next"),
|
|
40616
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ArrowRight, { size: 14 })
|
|
40617
|
+
} : {
|
|
40618
|
+
label: t("common:action.save_label", "Save"),
|
|
40619
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Save, { size: 14 })
|
|
40620
|
+
};
|
|
40621
|
+
const formStepButton = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button$1, {
|
|
40472
40622
|
isDisabled: formState.isSubmitting,
|
|
40473
|
-
onPress:
|
|
40474
|
-
|
|
40475
|
-
|
|
40476
|
-
|
|
40477
|
-
|
|
40478
|
-
onPressNext
|
|
40479
|
-
]);
|
|
40623
|
+
onPress: () => {
|
|
40624
|
+
onSubmitInvoiceForm();
|
|
40625
|
+
},
|
|
40626
|
+
children: [buttonContent.label, buttonContent.icon]
|
|
40627
|
+
});
|
|
40480
40628
|
if (viewState.mode === UpsertInvoiceMode.Create) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
40481
40629
|
justify: "space-between",
|
|
40482
40630
|
align: "center",
|
|
40483
40631
|
fluid: true,
|
|
40484
40632
|
pie: "md",
|
|
40485
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading$1, { children: t("invoices:action.create_invoice", "Create Invoice") }),
|
|
40633
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Heading$1, { children: t("invoices:action.create_invoice", "Create Invoice") }), formStepButton]
|
|
40486
40634
|
});
|
|
40487
40635
|
const headerMode = getHeaderMode(viewState);
|
|
40488
40636
|
const headingContent = getHeadingContent(headerMode, viewState.invoice.invoiceNumber, t);
|
|
@@ -40498,7 +40646,8 @@ var InvoiceDetailHeader = ({ onSubmitInvoiceForm, formState, openInvoicePaymentD
|
|
|
40498
40646
|
ellipsis: true,
|
|
40499
40647
|
children: headingContent
|
|
40500
40648
|
}),
|
|
40501
|
-
headerMode === HeaderMode.Edit &&
|
|
40649
|
+
headerMode === HeaderMode.Edit && formStepButton,
|
|
40650
|
+
headerMode === HeaderMode.Preview && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvoicePdfDownloadButton, { invoiceId: viewState.invoice.id }),
|
|
40502
40651
|
headerMode === HeaderMode.View && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
40503
40652
|
gap: "xs",
|
|
40504
40653
|
children: [canMarkAsPaid && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button$1, {
|
|
@@ -41010,29 +41159,6 @@ var InvoicePaymentDrawer = ({ isOpen, onOpenChange, invoice }) => {
|
|
|
41010
41159
|
});
|
|
41011
41160
|
};
|
|
41012
41161
|
//#endregion
|
|
41013
|
-
//#region src/hooks/api/businesses/[business-id]/accounting-config/useAccountingConfiguration.tsx
|
|
41014
|
-
var ACCOUNTING_CONFIGURATION_TAG_KEY = "#accounting-configuration";
|
|
41015
|
-
function buildKey$33({ access_token: accessToken, apiUrl, businessId }) {
|
|
41016
|
-
if (accessToken && apiUrl) return {
|
|
41017
|
-
accessToken,
|
|
41018
|
-
apiUrl,
|
|
41019
|
-
businessId,
|
|
41020
|
-
tag: [ACCOUNTING_CONFIGURATION_TAG_KEY]
|
|
41021
|
-
};
|
|
41022
|
-
}
|
|
41023
|
-
var getAccountingConfiguration = get$1(({ businessId }) => {
|
|
41024
|
-
return `/v1/businesses/${businessId}/accounting-config`;
|
|
41025
|
-
});
|
|
41026
|
-
function useAccountingConfiguration({ businessId }) {
|
|
41027
|
-
const { apiUrl } = useEnvironment();
|
|
41028
|
-
const { data: auth } = useAuth();
|
|
41029
|
-
const queryKey = buildKey$33(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
41030
|
-
apiUrl,
|
|
41031
|
-
businessId
|
|
41032
|
-
}));
|
|
41033
|
-
return new SWRQueryResult((0, swr.default)(() => queryKey, ({ accessToken, apiUrl, businessId }) => getAccountingConfiguration(apiUrl, accessToken, { params: { businessId } })().then(({ data }) => effect_index.Schema.decodeUnknownPromise(AccountingConfigurationSchema)(data))));
|
|
41034
|
-
}
|
|
41035
|
-
//#endregion
|
|
41036
41162
|
//#region src/hooks/api/businesses/[business-id]/customers/useUpsertCustomer.tsx
|
|
41037
41163
|
var UPSERT_CUSTOMER_TAG_KEY = "#upsert-customer";
|
|
41038
41164
|
var UpsertCustomerMode = /* @__PURE__ */ function(UpsertCustomerMode) {
|
|
@@ -41042,7 +41168,7 @@ var UpsertCustomerMode = /* @__PURE__ */ function(UpsertCustomerMode) {
|
|
|
41042
41168
|
}({});
|
|
41043
41169
|
var createCustomer = post(({ businessId }) => `/v1/businesses/${businessId}/customers`);
|
|
41044
41170
|
var updateCustomer = patch(({ businessId, customerId }) => `/v1/businesses/${businessId}/customers/${customerId}`);
|
|
41045
|
-
function buildKey$
|
|
41171
|
+
function buildKey$33({ access_token: accessToken, apiUrl, businessId, customerId = void 0 }) {
|
|
41046
41172
|
if (accessToken && apiUrl) return {
|
|
41047
41173
|
accessToken,
|
|
41048
41174
|
apiUrl,
|
|
@@ -41086,7 +41212,7 @@ var useUpsertCustomer = (props) => {
|
|
|
41086
41212
|
const { businessId } = useLayerContext();
|
|
41087
41213
|
const { mode } = props;
|
|
41088
41214
|
const customerId = mode === UpsertCustomerMode.Update ? props.customerId : void 0;
|
|
41089
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
41215
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$33(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
41090
41216
|
businessId,
|
|
41091
41217
|
customerId
|
|
41092
41218
|
}))), ({ accessToken, apiUrl, businessId, customerId }, { arg: body }) => {
|
|
@@ -42116,13 +42242,11 @@ var useInvoiceForm = (props) => {
|
|
|
42116
42242
|
//#region src/components/Invoices/InvoiceForm/InvoiceForm.tsx
|
|
42117
42243
|
var _excluded$14 = ["isReadOnly"];
|
|
42118
42244
|
var InvoiceForm = (0, react.forwardRef)((props, ref) => {
|
|
42119
|
-
var _accountingConfig$ena;
|
|
42120
42245
|
const _useInvoiceDetail = useInvoiceDetail(), { isReadOnly } = _useInvoiceDetail, viewState = _objectWithoutProperties(_useInvoiceDetail, _excluded$14);
|
|
42121
42246
|
const { mode } = viewState;
|
|
42122
42247
|
const { onSuccess, onChangeFormState } = props;
|
|
42123
|
-
const {
|
|
42124
|
-
const
|
|
42125
|
-
const enableCustomerManagement = (_accountingConfig$ena = accountingConfig === null || accountingConfig === void 0 ? void 0 : accountingConfig.enableCustomerManagement) !== null && _accountingConfig$ena !== void 0 ? _accountingConfig$ena : false;
|
|
42248
|
+
const { accountingConfiguration } = useLayerContext();
|
|
42249
|
+
const enableCustomerManagement = (accountingConfiguration === null || accountingConfiguration === void 0 ? void 0 : accountingConfiguration.enableCustomerManagement) === true;
|
|
42126
42250
|
const { form, formState, totals, submitError } = useInvoiceForm(_objectSpread2({ onSuccess }, viewState));
|
|
42127
42251
|
const initialDueAt = mode === UpsertInvoiceMode.Update ? viewState.invoice.dueAt : null;
|
|
42128
42252
|
const { formState: customerFormState, isOpen: isCustomerDrawerOpen, editCustomer, createCustomer, onOpenChange: onCustomerDrawerOpenChange, onSuccess: onCustomerDrawerSuccess } = useCustomerFormDrawer(form);
|
|
@@ -42184,7 +42308,8 @@ var InvoicePaymentMethodsResponseSchema = effect.Schema.Struct({ data: InvoicePa
|
|
|
42184
42308
|
//#endregion
|
|
42185
42309
|
//#region src/hooks/api/businesses/[business-id]/invoices/[invoice-id]/payment-methods/useInvoicePaymentMethods.tsx
|
|
42186
42310
|
var INVOICE_PAYMENT_METHODS_TAG_KEY = "#invoice-payment-methods";
|
|
42187
|
-
function buildKey$
|
|
42311
|
+
function buildKey$32({ access_token: accessToken, apiUrl, businessId, isEnabled, invoiceId }) {
|
|
42312
|
+
if (!isEnabled) return;
|
|
42188
42313
|
if (accessToken && apiUrl && invoiceId) return {
|
|
42189
42314
|
accessToken,
|
|
42190
42315
|
apiUrl,
|
|
@@ -42194,12 +42319,13 @@ function buildKey$31({ access_token: accessToken, apiUrl, businessId, invoiceId
|
|
|
42194
42319
|
};
|
|
42195
42320
|
}
|
|
42196
42321
|
var getInvoicePaymentMethods = get$1(({ businessId, invoiceId }) => `/v1/businesses/${businessId}/invoices/${invoiceId}/payment-methods`);
|
|
42197
|
-
function useInvoicePaymentMethods({ invoiceId }) {
|
|
42322
|
+
function useInvoicePaymentMethods({ invoiceId, isEnabled = true }) {
|
|
42198
42323
|
const withLocale = useLocalizedKey();
|
|
42199
42324
|
const { data } = useAuth();
|
|
42200
42325
|
const { businessId } = useLayerContext();
|
|
42201
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
42326
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$32(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
42202
42327
|
businessId,
|
|
42328
|
+
isEnabled,
|
|
42203
42329
|
invoiceId
|
|
42204
42330
|
}))), ({ accessToken, apiUrl, businessId, invoiceId }) => getInvoicePaymentMethods(apiUrl, accessToken, { params: {
|
|
42205
42331
|
businessId,
|
|
@@ -42212,7 +42338,7 @@ var FINALIZE_INVOICE_TAG_KEY = "#finalize-invoice";
|
|
|
42212
42338
|
var FinalizeInvoiceBodySchema = effect.Schema.extend(InvoicePaymentMethodsSchema, effect.Schema.Struct({ customPaymentInstructions: effect.Schema.optional(effect.Schema.String).pipe(effect.Schema.fromKey("custom_payment_instructions")) }));
|
|
42213
42339
|
var FinalizeInvoiceResponseSchema = effect.Schema.Struct({ data: effect.Schema.extend(InvoicePaymentMethodsSchema, effect.Schema.Struct({ invoice: InvoiceSchema })) });
|
|
42214
42340
|
var finalizeInvoice = put(({ businessId, invoiceId }) => `/v1/businesses/${businessId}/invoices/${invoiceId}/finalize-invoice`);
|
|
42215
|
-
function buildKey$
|
|
42341
|
+
function buildKey$31({ access_token: accessToken, apiUrl, businessId, invoiceId }) {
|
|
42216
42342
|
if (accessToken && apiUrl) return {
|
|
42217
42343
|
accessToken,
|
|
42218
42344
|
apiUrl,
|
|
@@ -42226,7 +42352,7 @@ function useFinalizeInvoice({ invoiceId }) {
|
|
|
42226
42352
|
const { data } = useAuth();
|
|
42227
42353
|
const { businessId } = useLayerContext();
|
|
42228
42354
|
const { mutate } = (0, swr.useSWRConfig)();
|
|
42229
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
42355
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$31(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
42230
42356
|
businessId,
|
|
42231
42357
|
invoiceId
|
|
42232
42358
|
}))), ({ accessToken, apiUrl, businessId, invoiceId }, { arg: body }) => finalizeInvoice(apiUrl, accessToken, {
|
|
@@ -42398,7 +42524,7 @@ var InvoiceFinalizeForm = ({ invoice, initialPaymentMethods, onSuccess }) => {
|
|
|
42398
42524
|
//#endregion
|
|
42399
42525
|
//#region src/hooks/api/businesses/[business-id]/invoices/[invoice-id]/html/useInvoicePreview.tsx
|
|
42400
42526
|
var INVOICE_PREVIEW_TAG_KEY = "#invoices-preview";
|
|
42401
|
-
function buildKey$
|
|
42527
|
+
function buildKey$30({ access_token: accessToken, apiUrl, businessId, invoiceId }) {
|
|
42402
42528
|
if (accessToken && apiUrl) return {
|
|
42403
42529
|
accessToken,
|
|
42404
42530
|
apiUrl,
|
|
@@ -42412,7 +42538,7 @@ function useInvoicePreview({ invoiceId }) {
|
|
|
42412
42538
|
const withLocale = useLocalizedKey();
|
|
42413
42539
|
const { data } = useAuth();
|
|
42414
42540
|
const { businessId } = useLayerContext();
|
|
42415
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
42541
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$30(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
42416
42542
|
businessId,
|
|
42417
42543
|
invoiceId
|
|
42418
42544
|
}))), ({ accessToken, apiUrl, businessId, invoiceId }) => getInvoicePreview(apiUrl, accessToken, { params: {
|
|
@@ -42456,16 +42582,21 @@ var InvoicePreview = () => {
|
|
|
42456
42582
|
//#region src/components/Invoices/InvoicePreview/InvoiceFinalizeStep.tsx
|
|
42457
42583
|
var InvoiceFinalizeStep = ({ onSuccess }) => {
|
|
42458
42584
|
const { t } = (0, react_i18next.useTranslation)();
|
|
42585
|
+
const { accountingConfiguration } = useLayerContext();
|
|
42459
42586
|
const { invoice } = useInvoicePreviewRoute();
|
|
42460
|
-
const
|
|
42587
|
+
const showPaymentMethods = !!(accountingConfiguration === null || accountingConfiguration === void 0 ? void 0 : accountingConfiguration.enableStripeOnboarding);
|
|
42588
|
+
const { data, isLoading, isError } = useInvoicePaymentMethods({
|
|
42589
|
+
invoiceId: invoice.id,
|
|
42590
|
+
isEnabled: showPaymentMethods
|
|
42591
|
+
});
|
|
42461
42592
|
const paymentMethodsData = data === null || data === void 0 ? void 0 : data.data;
|
|
42462
42593
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
42463
|
-
className: "Layer__InvoiceFinalizeStep",
|
|
42594
|
+
className: (0, classnames.default)("Layer__InvoiceFinalizeStep", !showPaymentMethods && "Layer__InvoiceFinalizeStep--previewOnly"),
|
|
42464
42595
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
42465
|
-
className: "Layer__InvoiceFinalizeStep__PreviewPanel",
|
|
42596
|
+
className: (0, classnames.default)("Layer__InvoiceFinalizeStep__PreviewPanel", !showPaymentMethods && "Layer__InvoiceFinalizeStep__PreviewPanel--previewOnly"),
|
|
42466
42597
|
fluid: true,
|
|
42467
42598
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvoicePreview, {})
|
|
42468
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
42599
|
+
}), showPaymentMethods && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
42469
42600
|
className: "Layer__InvoiceFinalizeStep__PaymentMethodsPanel",
|
|
42470
42601
|
fluid: true,
|
|
42471
42602
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
@@ -42505,11 +42636,21 @@ var InvoiceDetail = () => {
|
|
|
42505
42636
|
const [isPaymentDrawerOpen, setIsPaymentDrawerOpen] = (0, react.useState)(false);
|
|
42506
42637
|
const [isDiscardChangesModalOpen, setIsDiscardChangesModalOpen] = (0, react.useState)(false);
|
|
42507
42638
|
const { toInvoiceTable, toPreviewInvoice, toEditInvoice, toViewInvoice } = useInvoiceNavigation();
|
|
42508
|
-
const { addToast } = useLayerContext();
|
|
42639
|
+
const { addToast, accountingConfiguration } = useLayerContext();
|
|
42640
|
+
const enablePaymentMethodsOnFinalize = !!(accountingConfiguration === null || accountingConfiguration === void 0 ? void 0 : accountingConfiguration.enableStripeOnboarding);
|
|
42509
42641
|
const invoiceFormRef = (0, react.useRef)(null);
|
|
42510
42642
|
const onUpsertInvoiceSuccess = (0, react.useCallback)((invoice) => {
|
|
42643
|
+
if (!enablePaymentMethodsOnFinalize) addToast({
|
|
42644
|
+
content: t("invoices:label.invoice_saved", "Invoice saved"),
|
|
42645
|
+
type: "success"
|
|
42646
|
+
});
|
|
42511
42647
|
toPreviewInvoice(invoice);
|
|
42512
|
-
}, [
|
|
42648
|
+
}, [
|
|
42649
|
+
addToast,
|
|
42650
|
+
enablePaymentMethodsOnFinalize,
|
|
42651
|
+
t,
|
|
42652
|
+
toPreviewInvoice
|
|
42653
|
+
]);
|
|
42513
42654
|
const onSubmitInvoiceForm = (0, react.useCallback)(() => {
|
|
42514
42655
|
var _invoiceFormRef$curre;
|
|
42515
42656
|
return (_invoiceFormRef$curre = invoiceFormRef.current) === null || _invoiceFormRef$curre === void 0 ? void 0 : _invoiceFormRef$curre.submit();
|
|
@@ -42805,7 +42946,7 @@ var StripeAccountStatusResponseSchema = effect.Schema.Struct({ data: StripeAccou
|
|
|
42805
42946
|
//#endregion
|
|
42806
42947
|
//#region src/hooks/api/businesses/[business-id]/stripe/status/useStripeAccountStatus.tsx
|
|
42807
42948
|
var STRIPE_ACCOUNT_STATUS_TAG_KEY = "#stripe-account-status";
|
|
42808
|
-
function buildKey$
|
|
42949
|
+
function buildKey$29({ access_token: accessToken, apiUrl, businessId }) {
|
|
42809
42950
|
if (accessToken && apiUrl) return {
|
|
42810
42951
|
accessToken,
|
|
42811
42952
|
apiUrl,
|
|
@@ -42819,7 +42960,7 @@ function useStripeAccountStatus() {
|
|
|
42819
42960
|
const { data } = useAuth();
|
|
42820
42961
|
const { businessId } = useLayerContext();
|
|
42821
42962
|
const { apiUrl } = useEnvironment();
|
|
42822
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
42963
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$29(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
42823
42964
|
apiUrl,
|
|
42824
42965
|
businessId
|
|
42825
42966
|
}))), ({ accessToken, apiUrl, businessId }) => getStripeAccountStatus(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(StripeAccountStatusResponseSchema)).then(({ data }) => data)));
|
|
@@ -42939,7 +43080,7 @@ var StripeConnectAccountLinkDataSchema = effect.Schema.Struct({
|
|
|
42939
43080
|
});
|
|
42940
43081
|
var StripeConnectAccountLinkResponseSchema = effect.Schema.Struct({ data: StripeConnectAccountLinkDataSchema });
|
|
42941
43082
|
var createStripeConnectAccountLink = post(({ businessId }) => `/v1/businesses/${businessId}/stripe/connect-account-link`);
|
|
42942
|
-
function buildKey$
|
|
43083
|
+
function buildKey$28({ access_token: accessToken, apiUrl, businessId }) {
|
|
42943
43084
|
if (accessToken && apiUrl) return {
|
|
42944
43085
|
accessToken,
|
|
42945
43086
|
apiUrl,
|
|
@@ -42952,7 +43093,7 @@ function useStripeConnectAccountLink() {
|
|
|
42952
43093
|
const { data } = useAuth();
|
|
42953
43094
|
const { businessId } = useLayerContext();
|
|
42954
43095
|
const { apiUrl } = useEnvironment();
|
|
42955
|
-
return new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
43096
|
+
return new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$28(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
42956
43097
|
apiUrl,
|
|
42957
43098
|
businessId
|
|
42958
43099
|
}))), ({ accessToken, apiUrl, businessId }) => {
|
|
@@ -43051,9 +43192,10 @@ var InvoiceOverview = () => {
|
|
|
43051
43192
|
//#endregion
|
|
43052
43193
|
//#region src/components/Invoices/Invoices.tsx
|
|
43053
43194
|
var Invoices = ({ stringOverrides }) => {
|
|
43195
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
43054
43196
|
usePreloadCustomers();
|
|
43055
43197
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvoicesRouteStoreProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, {
|
|
43056
|
-
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || "Invoices",
|
|
43198
|
+
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || t("invoices:label.invoices", "Invoices"),
|
|
43057
43199
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvoicesContent, {})
|
|
43058
43200
|
}) });
|
|
43059
43201
|
};
|
|
@@ -43118,7 +43260,7 @@ var Components = ({ hideChart = false, hideTable = false, stringOverrides }) =>
|
|
|
43118
43260
|
//#region src/hooks/api/businesses/[business-id]/reports/config/useReportConfig.ts
|
|
43119
43261
|
var REPORT_CONFIG_TAG_KEY = "#report-config";
|
|
43120
43262
|
var getReportConfig = get$1(({ businessId }) => `/v1/businesses/${businessId}/reports/config`);
|
|
43121
|
-
function buildKey$
|
|
43263
|
+
function buildKey$27({ access_token: accessToken, apiUrl, businessId }) {
|
|
43122
43264
|
if (accessToken && apiUrl) return {
|
|
43123
43265
|
accessToken,
|
|
43124
43266
|
apiUrl,
|
|
@@ -43130,7 +43272,7 @@ function useReportConfig() {
|
|
|
43130
43272
|
const withLocale = useLocalizedKey();
|
|
43131
43273
|
const { data: auth } = useAuth();
|
|
43132
43274
|
const { businessId } = useLayerContext();
|
|
43133
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
43275
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$27(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
43134
43276
|
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
43135
43277
|
return getReportConfig(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(ReportConfigResponseSchema)).then(({ data }) => data);
|
|
43136
43278
|
});
|
|
@@ -43374,31 +43516,13 @@ var TreeItemContent = (_ref3) => {
|
|
|
43374
43516
|
};
|
|
43375
43517
|
TreeItemContent.displayName = "TreeItemContent";
|
|
43376
43518
|
//#endregion
|
|
43377
|
-
//#region src/components/TreeNavigation/
|
|
43378
|
-
|
|
43379
|
-
for (const node of items) if (isGroup(node)) {
|
|
43380
|
-
onGroup(node);
|
|
43381
|
-
visitTree(getChildren(node), isGroup, getChildren, onGroup, onLeaf);
|
|
43382
|
-
} else onLeaf(node);
|
|
43383
|
-
};
|
|
43384
|
-
var indexTree = ({ items, isGroup, getChildren, getGroupId, getLeafId }) => {
|
|
43385
|
-
const groupIds = [];
|
|
43386
|
-
const leafMap = /* @__PURE__ */ new Map();
|
|
43387
|
-
visitTree(items, isGroup, getChildren, (group) => groupIds.push(getGroupId(group)), (leaf) => leafMap.set(getLeafId(leaf), leaf));
|
|
43388
|
-
return {
|
|
43389
|
-
groupIds,
|
|
43390
|
-
leafMap
|
|
43391
|
-
};
|
|
43392
|
-
};
|
|
43393
|
-
//#endregion
|
|
43394
|
-
//#region src/components/TreeNavigation/TreeNavigation.tsx
|
|
43395
|
-
var renderTreeGroup = ({ group, groupConfig, onToggle, renderItem, chevronLabel }) => {
|
|
43396
|
-
const groupId = groupConfig.getId(group);
|
|
43519
|
+
//#region src/components/NestedNavigation/TreeNavigation/TreeNavigationGroup.tsx
|
|
43520
|
+
function TreeNavigationGroup({ id, group, groupConfig, onToggle, renderItem, chevronLabel }) {
|
|
43397
43521
|
const textValue = groupConfig.getTextValue(group);
|
|
43398
43522
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TreeItem, {
|
|
43399
|
-
id
|
|
43523
|
+
id,
|
|
43400
43524
|
textValue,
|
|
43401
|
-
onAction: () => onToggle(
|
|
43525
|
+
onAction: () => onToggle(id),
|
|
43402
43526
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeItemContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
43403
43527
|
className: "Layer__TreeNavigation__Row",
|
|
43404
43528
|
align: "center",
|
|
@@ -43417,22 +43541,64 @@ var renderTreeGroup = ({ group, groupConfig, onToggle, renderItem, chevronLabel
|
|
|
43417
43541
|
children: renderItem
|
|
43418
43542
|
})]
|
|
43419
43543
|
});
|
|
43544
|
+
}
|
|
43545
|
+
//#endregion
|
|
43546
|
+
//#region src/components/NestedNavigation/TreeNavigation/TreeNavigationLeaf.tsx
|
|
43547
|
+
function TreeNavigationLeaf({ id, leaf, leafConfig }) {
|
|
43548
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeItem, {
|
|
43549
|
+
id,
|
|
43550
|
+
textValue: leafConfig.getTextValue(leaf),
|
|
43551
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeItemContent, { children: leafConfig.renderLabel(leaf) })
|
|
43552
|
+
});
|
|
43553
|
+
}
|
|
43554
|
+
//#endregion
|
|
43555
|
+
//#region src/components/NestedNavigation/utils.ts
|
|
43556
|
+
var indexRecursiveNavigation = ({ items, isGroup, groupConfig, leafConfig }) => {
|
|
43557
|
+
const groupIds = [];
|
|
43558
|
+
const leafMap = /* @__PURE__ */ new Map();
|
|
43559
|
+
const visit = (nodes) => {
|
|
43560
|
+
for (const node of nodes) if (isGroup(node)) {
|
|
43561
|
+
groupIds.push(groupConfig.getId(node));
|
|
43562
|
+
visit(groupConfig.getChildren(node));
|
|
43563
|
+
} else leafMap.set(leafConfig.getId(node), node);
|
|
43564
|
+
};
|
|
43565
|
+
visit(items);
|
|
43566
|
+
return {
|
|
43567
|
+
groupIds,
|
|
43568
|
+
leafMap
|
|
43569
|
+
};
|
|
43420
43570
|
};
|
|
43421
|
-
var
|
|
43422
|
-
|
|
43423
|
-
|
|
43424
|
-
|
|
43425
|
-
|
|
43571
|
+
var indexFlatNavigation = ({ items, groupConfig, leafConfig }) => {
|
|
43572
|
+
const groupIds = [];
|
|
43573
|
+
const leafMap = /* @__PURE__ */ new Map();
|
|
43574
|
+
for (const group of items) {
|
|
43575
|
+
groupIds.push(groupConfig.getId(group));
|
|
43576
|
+
for (const leaf of groupConfig.getChildren(group)) leafMap.set(leafConfig.getId(leaf), leaf);
|
|
43577
|
+
}
|
|
43578
|
+
return {
|
|
43579
|
+
groupIds,
|
|
43580
|
+
leafMap
|
|
43581
|
+
};
|
|
43582
|
+
};
|
|
43583
|
+
var getSelectedItemSet = (selectedItem) => selectedItem != null ? new Set([selectedItem]) : /* @__PURE__ */ new Set();
|
|
43584
|
+
var handleSelectItem = ({ selection, leafMap, onSelectLeaf }) => {
|
|
43585
|
+
if (selection === "all") return;
|
|
43586
|
+
const nextKey = selection.values().next().value;
|
|
43587
|
+
if (nextKey == null) return;
|
|
43588
|
+
const leaf = leafMap.get(nextKey);
|
|
43589
|
+
if (leaf) onSelectLeaf(leaf);
|
|
43590
|
+
};
|
|
43591
|
+
//#endregion
|
|
43592
|
+
//#region src/components/NestedNavigation/TreeNavigation/TreeNavigation.tsx
|
|
43426
43593
|
function TreeNavigation({ items, selectedItem, isGroup, groupConfig, leafConfig, ariaLabel }) {
|
|
43427
43594
|
const { t } = (0, react_i18next.useTranslation)();
|
|
43428
43595
|
const chevronLabel = (0, react.useCallback)((groupName) => t("common:action.toggle_section", "Toggle {{name}}", { name: groupName }), [t]);
|
|
43429
43596
|
const itemArray = (0, react.useMemo)(() => Array.from(items), [items]);
|
|
43430
|
-
const { groupIds, leafMap } = (0, react.useMemo)(() =>
|
|
43597
|
+
const { groupIds, leafMap } = (0, react.useMemo)(() => indexRecursiveNavigation({
|
|
43431
43598
|
items: itemArray,
|
|
43432
43599
|
isGroup,
|
|
43433
|
-
|
|
43434
|
-
|
|
43435
|
-
getLeafId: leafConfig.getId
|
|
43600
|
+
groupConfig,
|
|
43601
|
+
leafConfig
|
|
43436
43602
|
}), [
|
|
43437
43603
|
itemArray,
|
|
43438
43604
|
isGroup,
|
|
@@ -43449,22 +43615,23 @@ function TreeNavigation({ items, selectedItem, isGroup, groupConfig, leafConfig,
|
|
|
43449
43615
|
});
|
|
43450
43616
|
}, []);
|
|
43451
43617
|
const handleSelectionChange = (0, react.useCallback)((selection) => {
|
|
43452
|
-
|
|
43453
|
-
|
|
43454
|
-
|
|
43455
|
-
|
|
43456
|
-
|
|
43618
|
+
handleSelectItem({
|
|
43619
|
+
selection,
|
|
43620
|
+
leafMap,
|
|
43621
|
+
onSelectLeaf: leafConfig.onSelectLeaf
|
|
43622
|
+
});
|
|
43457
43623
|
}, [leafMap, leafConfig]);
|
|
43458
|
-
const selectedItems = selectedItem != null ? [selectedItem] : [];
|
|
43459
43624
|
const renderItem = (item) => {
|
|
43460
|
-
if (isGroup(item)) return
|
|
43625
|
+
if (isGroup(item)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNavigationGroup, {
|
|
43626
|
+
id: groupConfig.getId(item),
|
|
43461
43627
|
group: item,
|
|
43462
43628
|
groupConfig,
|
|
43463
43629
|
onToggle: toggleGroup,
|
|
43464
43630
|
renderItem,
|
|
43465
43631
|
chevronLabel
|
|
43466
43632
|
});
|
|
43467
|
-
return
|
|
43633
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNavigationLeaf, {
|
|
43634
|
+
id: leafConfig.getId(item),
|
|
43468
43635
|
leaf: item,
|
|
43469
43636
|
leafConfig
|
|
43470
43637
|
});
|
|
@@ -43472,7 +43639,7 @@ function TreeNavigation({ items, selectedItem, isGroup, groupConfig, leafConfig,
|
|
|
43472
43639
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tree, {
|
|
43473
43640
|
"aria-label": ariaLabel,
|
|
43474
43641
|
selectionMode: "single",
|
|
43475
|
-
selectedKeys:
|
|
43642
|
+
selectedKeys: getSelectedItemSet(selectedItem),
|
|
43476
43643
|
onSelectionChange: handleSelectionChange,
|
|
43477
43644
|
disabledKeys: groupIds,
|
|
43478
43645
|
disabledBehavior: "selection",
|
|
@@ -43484,7 +43651,7 @@ function TreeNavigation({ items, selectedItem, isGroup, groupConfig, leafConfig,
|
|
|
43484
43651
|
});
|
|
43485
43652
|
}
|
|
43486
43653
|
//#endregion
|
|
43487
|
-
//#region src/components/TreeNavigation/TreeNavigationSkeleton.tsx
|
|
43654
|
+
//#region src/components/NestedNavigation/TreeNavigation/TreeNavigationSkeleton.tsx
|
|
43488
43655
|
var TreeNavigationSkeleton = ({ groups = 2, leavesPerGroup = 3 }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
43489
43656
|
className: "Layer__TreeNavigationSkeleton",
|
|
43490
43657
|
"aria-hidden": "true",
|
|
@@ -43506,8 +43673,8 @@ var TreeNavigationSkeleton = ({ groups = 2, leavesPerGroup = 3 }) => /* @__PURE_
|
|
|
43506
43673
|
}, leafIndex))] }, groupIndex))
|
|
43507
43674
|
});
|
|
43508
43675
|
//#endregion
|
|
43509
|
-
//#region src/components/ReportsNavigation/
|
|
43510
|
-
var
|
|
43676
|
+
//#region src/components/ReportsNavigation/ReportsNavigationSidebarError.tsx
|
|
43677
|
+
var ReportsNavigationSidebarError = () => {
|
|
43511
43678
|
const { t } = (0, react_i18next.useTranslation)();
|
|
43512
43679
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataState, {
|
|
43513
43680
|
status: DataStateStatus.failed,
|
|
@@ -43516,37 +43683,51 @@ var ReportsNavigationError = () => {
|
|
|
43516
43683
|
spacing: true
|
|
43517
43684
|
});
|
|
43518
43685
|
};
|
|
43686
|
+
//#endregion
|
|
43687
|
+
//#region src/components/ReportsNavigation/utils.tsx
|
|
43519
43688
|
var isReportGroup = (item) => "reports" in item;
|
|
43520
|
-
var
|
|
43689
|
+
var sharedReportGroupConfig = {
|
|
43521
43690
|
getId: (group) => group.groupType,
|
|
43522
43691
|
getTextValue: (group) => group.displayName,
|
|
43523
|
-
getChildren: (group) => group.reports
|
|
43524
|
-
renderLabel: (group) => {
|
|
43525
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
43526
|
-
ellipsis: true,
|
|
43527
|
-
weight: "bold",
|
|
43528
|
-
children: group.displayName
|
|
43529
|
-
});
|
|
43530
|
-
}
|
|
43692
|
+
getChildren: (group) => group.reports
|
|
43531
43693
|
};
|
|
43532
|
-
var
|
|
43694
|
+
var buildRecursiveReportsGroupConfig = (renderLabel) => _objectSpread2(_objectSpread2({}, sharedReportGroupConfig), {}, {
|
|
43695
|
+
isRecursive: true,
|
|
43696
|
+
renderLabel
|
|
43697
|
+
});
|
|
43698
|
+
var buildFlatReportsGroupConfig = (renderLabel) => _objectSpread2(_objectSpread2({}, sharedReportGroupConfig), {}, {
|
|
43699
|
+
isRecursive: false,
|
|
43700
|
+
renderLabel
|
|
43701
|
+
});
|
|
43702
|
+
var buildReportsLeafConfig = (onSelectLeaf, renderLabel) => ({
|
|
43533
43703
|
getId: (leaf) => leaf.key,
|
|
43534
43704
|
getTextValue: (leaf) => leaf.displayName,
|
|
43535
|
-
renderLabel
|
|
43705
|
+
renderLabel,
|
|
43536
43706
|
onSelectLeaf
|
|
43537
43707
|
});
|
|
43538
|
-
|
|
43708
|
+
//#endregion
|
|
43709
|
+
//#region src/components/ReportsNavigation/ReportsNavigationSidebar.tsx
|
|
43710
|
+
var groupConfig$1 = buildRecursiveReportsGroupConfig((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
43711
|
+
ellipsis: true,
|
|
43712
|
+
weight: "bold",
|
|
43713
|
+
children: group.displayName
|
|
43714
|
+
}));
|
|
43715
|
+
var renderLeafLabel$1 = (leaf) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
43716
|
+
ellipsis: true,
|
|
43717
|
+
children: leaf.displayName
|
|
43718
|
+
});
|
|
43719
|
+
function ReportsNavigationSidebar() {
|
|
43539
43720
|
const { t } = (0, react_i18next.useTranslation)();
|
|
43540
43721
|
const { data, isLoading, isError } = useReportConfig();
|
|
43541
43722
|
const { baseReport, setBaseReport } = useBaseUnifiedReport();
|
|
43542
|
-
const leafConfig = (0, react.useMemo)(() =>
|
|
43723
|
+
const leafConfig = (0, react.useMemo)(() => buildReportsLeafConfig(setBaseReport, renderLeafLabel$1), [setBaseReport]);
|
|
43543
43724
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalBlock, {
|
|
43544
43725
|
data,
|
|
43545
43726
|
isLoading,
|
|
43546
43727
|
Loading: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNavigationSkeleton, {}),
|
|
43547
43728
|
Inactive: null,
|
|
43548
43729
|
isError,
|
|
43549
|
-
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
43730
|
+
Error: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReportsNavigationSidebarError, {}),
|
|
43550
43731
|
children: ({ data }) => {
|
|
43551
43732
|
var _baseReport$key;
|
|
43552
43733
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TreeNavigation, {
|
|
@@ -43554,7 +43735,7 @@ function ReportsNavigation() {
|
|
|
43554
43735
|
items: data,
|
|
43555
43736
|
selectedItem: (_baseReport$key = baseReport === null || baseReport === void 0 ? void 0 : baseReport.key) !== null && _baseReport$key !== void 0 ? _baseReport$key : null,
|
|
43556
43737
|
isGroup: isReportGroup,
|
|
43557
|
-
groupConfig,
|
|
43738
|
+
groupConfig: groupConfig$1,
|
|
43558
43739
|
leafConfig
|
|
43559
43740
|
});
|
|
43560
43741
|
}
|
|
@@ -43613,15 +43794,6 @@ function ReportsMobileSelectionDrawer() {
|
|
|
43613
43794
|
});
|
|
43614
43795
|
}
|
|
43615
43796
|
//#endregion
|
|
43616
|
-
//#region src/schemas/common/s3PresignedUrl.ts
|
|
43617
|
-
var S3PresignedUrlSchema = effect.Schema.Struct({
|
|
43618
|
-
presignedUrl: effect.Schema.String,
|
|
43619
|
-
fileType: effect.Schema.String,
|
|
43620
|
-
fileName: effect.Schema.String,
|
|
43621
|
-
createdAt: effect.Schema.Date,
|
|
43622
|
-
documentId: effect.Schema.NullishOr(effect.Schema.UUID)
|
|
43623
|
-
});
|
|
43624
|
-
//#endregion
|
|
43625
43797
|
//#region src/hooks/api/businesses/[business-id]/reports/unified/report-name/exports/excel/useUnifiedReportExcel.ts
|
|
43626
43798
|
var _excluded$9 = ["businessId", "route"], _excluded2$3 = [
|
|
43627
43799
|
"accessToken",
|
|
@@ -43635,7 +43807,7 @@ var getUnifiedReportExcel = get$1((_ref) => {
|
|
|
43635
43807
|
});
|
|
43636
43808
|
var getTag$1 = (report) => `#unified-${report}-report-excel`;
|
|
43637
43809
|
var UnifiedReportExcelReturnSchema = effect.Schema.Struct({ data: S3PresignedUrlSchema });
|
|
43638
|
-
function buildKey$
|
|
43810
|
+
function buildKey$26({ access_token: accessToken, apiUrl, businessId, params }) {
|
|
43639
43811
|
if (!params || !accessToken || !apiUrl) return;
|
|
43640
43812
|
return _objectSpread2(_objectSpread2({
|
|
43641
43813
|
accessToken,
|
|
@@ -43649,7 +43821,7 @@ function useUnifiedReportExcel({ onSuccess } = {}) {
|
|
|
43649
43821
|
const { apiUrl } = useEnvironment();
|
|
43650
43822
|
const { businessId } = useLayerContext();
|
|
43651
43823
|
const params = useUnifiedReportParams();
|
|
43652
|
-
return new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
43824
|
+
return new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$26(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
43653
43825
|
apiUrl,
|
|
43654
43826
|
businessId,
|
|
43655
43827
|
params
|
|
@@ -43687,7 +43859,7 @@ function UnifiedReportDownloadButton({ iconOnly }) {
|
|
|
43687
43859
|
isDisabled: isMutating,
|
|
43688
43860
|
icon: resolvedIconOnly,
|
|
43689
43861
|
"aria-label": resolvedIconOnly ? buttonText : void 0,
|
|
43690
|
-
children: [!resolvedIconOnly && buttonText, isError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$
|
|
43862
|
+
children: [!resolvedIconOnly && buttonText, isError ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshCcw$2, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DownloadCloud, { size: 16 })]
|
|
43691
43863
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InvisibleDownload, { ref: invisibleDownloadRef })] });
|
|
43692
43864
|
}
|
|
43693
43865
|
//#endregion
|
|
@@ -43714,7 +43886,7 @@ var _excluded$8 = ["businessId", "route"], _excluded2$2 = [
|
|
|
43714
43886
|
"tags"
|
|
43715
43887
|
];
|
|
43716
43888
|
var getTag = (report) => `#unified-${report}-report`;
|
|
43717
|
-
function buildKey$
|
|
43889
|
+
function buildKey$25({ access_token: accessToken, apiUrl, businessId, params }) {
|
|
43718
43890
|
if (!params || !accessToken || !apiUrl) return;
|
|
43719
43891
|
return _objectSpread2(_objectSpread2({
|
|
43720
43892
|
accessToken,
|
|
@@ -43732,7 +43904,7 @@ function useUnifiedReport() {
|
|
|
43732
43904
|
const { apiUrl } = useEnvironment();
|
|
43733
43905
|
const { businessId } = useLayerContext();
|
|
43734
43906
|
const params = useUnifiedReportParams();
|
|
43735
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
43907
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$25(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
43736
43908
|
apiUrl,
|
|
43737
43909
|
businessId,
|
|
43738
43910
|
params
|
|
@@ -43912,6 +44084,166 @@ var UnifiedReportTable = () => {
|
|
|
43912
44084
|
});
|
|
43913
44085
|
};
|
|
43914
44086
|
//#endregion
|
|
44087
|
+
//#region src/components/ui/Overlay/Overlay.tsx
|
|
44088
|
+
function Overlay({ children, slots, slotProps }) {
|
|
44089
|
+
var _slotProps$Dialog;
|
|
44090
|
+
const trigger = slots.Trigger;
|
|
44091
|
+
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
44092
|
+
const close = (0, react.useCallback)(() => setIsOpen(false), []);
|
|
44093
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components_Dialog.DialogTrigger, {
|
|
44094
|
+
isOpen,
|
|
44095
|
+
onOpenChange: setIsOpen,
|
|
44096
|
+
children: [typeof trigger === "function" ? trigger({ isOpen }) : trigger, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popover$2, _objectSpread2(_objectSpread2({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.Popover), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components_Dialog.Dialog, {
|
|
44097
|
+
className: "Layer__Overlay__Dialog",
|
|
44098
|
+
style: { width: slotProps === null || slotProps === void 0 || (_slotProps$Dialog = slotProps.Dialog) === null || _slotProps$Dialog === void 0 ? void 0 : _slotProps$Dialog.width },
|
|
44099
|
+
children: typeof children === "function" ? children({ close }) : children
|
|
44100
|
+
}) }))]
|
|
44101
|
+
});
|
|
44102
|
+
}
|
|
44103
|
+
//#endregion
|
|
44104
|
+
//#region src/components/NestedNavigation/MegaMenu/MegaMenuListItem.tsx
|
|
44105
|
+
function MegaMenuListItem({ id, leaf, leafConfig }) {
|
|
44106
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components_ListBox.ListBoxItem, {
|
|
44107
|
+
id,
|
|
44108
|
+
textValue: leafConfig.getTextValue(leaf),
|
|
44109
|
+
className: "Layer__MegaMenuListItem",
|
|
44110
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
44111
|
+
slot: "label",
|
|
44112
|
+
children: leafConfig.renderLabel(leaf)
|
|
44113
|
+
})
|
|
44114
|
+
});
|
|
44115
|
+
}
|
|
44116
|
+
//#endregion
|
|
44117
|
+
//#region src/components/NestedNavigation/MegaMenu/MegaMenuListSection.tsx
|
|
44118
|
+
function MegaMenuListSection({ id, group, groupConfig, leafConfig }) {
|
|
44119
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components_ListBox.ListBoxSection, {
|
|
44120
|
+
id,
|
|
44121
|
+
className: "Layer__MegaMenuListSection",
|
|
44122
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header$3, {
|
|
44123
|
+
slot: "header",
|
|
44124
|
+
pis: "xs",
|
|
44125
|
+
pbe: "xs",
|
|
44126
|
+
children: groupConfig.renderLabel(group)
|
|
44127
|
+
}), Array.from(groupConfig.getChildren(group)).map((leaf) => {
|
|
44128
|
+
const leafId = leafConfig.getId(leaf);
|
|
44129
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MegaMenuListItem, {
|
|
44130
|
+
id: leafId,
|
|
44131
|
+
leaf,
|
|
44132
|
+
leafConfig
|
|
44133
|
+
}, leafId);
|
|
44134
|
+
})]
|
|
44135
|
+
});
|
|
44136
|
+
}
|
|
44137
|
+
//#endregion
|
|
44138
|
+
//#region src/components/NestedNavigation/MegaMenu/MegaMenuList.tsx
|
|
44139
|
+
function MegaMenuList({ items, selectedItem, groupConfig, leafConfig, onSelectItem }) {
|
|
44140
|
+
const itemArray = (0, react.useMemo)(() => Array.from(items), [items]);
|
|
44141
|
+
const { leafMap } = (0, react.useMemo)(() => indexFlatNavigation({
|
|
44142
|
+
items: itemArray,
|
|
44143
|
+
groupConfig,
|
|
44144
|
+
leafConfig
|
|
44145
|
+
}), [
|
|
44146
|
+
itemArray,
|
|
44147
|
+
groupConfig,
|
|
44148
|
+
leafConfig
|
|
44149
|
+
]);
|
|
44150
|
+
const handleSelectionChange = (0, react.useCallback)((selection) => {
|
|
44151
|
+
handleSelectItem({
|
|
44152
|
+
selection,
|
|
44153
|
+
leafMap,
|
|
44154
|
+
onSelectLeaf: leafConfig.onSelectLeaf
|
|
44155
|
+
});
|
|
44156
|
+
onSelectItem();
|
|
44157
|
+
}, [
|
|
44158
|
+
leafMap,
|
|
44159
|
+
leafConfig.onSelectLeaf,
|
|
44160
|
+
onSelectItem
|
|
44161
|
+
]);
|
|
44162
|
+
const sectionCount = Math.min(itemArray.length, 3);
|
|
44163
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components_ListBox.ListBox, {
|
|
44164
|
+
layout: "grid",
|
|
44165
|
+
selectionMode: "single",
|
|
44166
|
+
selectedKeys: getSelectedItemSet(selectedItem),
|
|
44167
|
+
onSelectionChange: handleSelectionChange,
|
|
44168
|
+
items: itemArray,
|
|
44169
|
+
className: "Layer__MegaMenuList",
|
|
44170
|
+
"data-section-count": sectionCount,
|
|
44171
|
+
children: (group) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MegaMenuListSection, {
|
|
44172
|
+
id: groupConfig.getId(group),
|
|
44173
|
+
group,
|
|
44174
|
+
groupConfig,
|
|
44175
|
+
leafConfig
|
|
44176
|
+
})
|
|
44177
|
+
});
|
|
44178
|
+
}
|
|
44179
|
+
//#endregion
|
|
44180
|
+
//#region src/components/NestedNavigation/MegaMenu/MegaMenu.tsx
|
|
44181
|
+
var COLUMN_WIDTH = 200;
|
|
44182
|
+
var COLUMN_GAP = 24;
|
|
44183
|
+
var PADDING = 16;
|
|
44184
|
+
var getWidth = (numGroups) => {
|
|
44185
|
+
const numColumns = Math.min(numGroups, 3);
|
|
44186
|
+
return numColumns * COLUMN_WIDTH + (numColumns - 1) * COLUMN_GAP + PADDING * 2;
|
|
44187
|
+
};
|
|
44188
|
+
function MegaMenu({ items, selectedItem, placement, groupConfig, leafConfig, slots }) {
|
|
44189
|
+
const itemArray = (0, react.useMemo)(() => Array.from(items), [items]);
|
|
44190
|
+
const width = getWidth(itemArray.length);
|
|
44191
|
+
const slotProps = (0, react.useMemo)(() => ({
|
|
44192
|
+
Popover: {
|
|
44193
|
+
placement,
|
|
44194
|
+
flexInline: true
|
|
44195
|
+
},
|
|
44196
|
+
Dialog: { width }
|
|
44197
|
+
}), [placement, width]);
|
|
44198
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, {
|
|
44199
|
+
slots: { Trigger: slots.Trigger },
|
|
44200
|
+
slotProps,
|
|
44201
|
+
children: ({ close }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MegaMenuList, {
|
|
44202
|
+
items: itemArray,
|
|
44203
|
+
selectedItem,
|
|
44204
|
+
groupConfig,
|
|
44205
|
+
leafConfig,
|
|
44206
|
+
onSelectItem: close
|
|
44207
|
+
})
|
|
44208
|
+
});
|
|
44209
|
+
}
|
|
44210
|
+
//#endregion
|
|
44211
|
+
//#region src/components/ReportsNavigation/ReportsMegaMenu.tsx
|
|
44212
|
+
var groupConfig = buildFlatReportsGroupConfig((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
44213
|
+
size: "sm",
|
|
44214
|
+
weight: "bold",
|
|
44215
|
+
variant: "subtle",
|
|
44216
|
+
textCase: "uppercase",
|
|
44217
|
+
children: group.displayName
|
|
44218
|
+
}));
|
|
44219
|
+
var renderLeafLabel = (leaf) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, { children: leaf.displayName });
|
|
44220
|
+
var EMPTY_ARRAY$1 = [];
|
|
44221
|
+
function ReportsMegaMenu() {
|
|
44222
|
+
var _baseReport$key;
|
|
44223
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
44224
|
+
const { data, isLoading, isError } = useReportConfig();
|
|
44225
|
+
const { baseReport, setBaseReport } = useBaseUnifiedReport();
|
|
44226
|
+
const leafConfig = (0, react.useMemo)(() => buildReportsLeafConfig(setBaseReport, renderLeafLabel), [setBaseReport]);
|
|
44227
|
+
const Trigger = (0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Button$1, {
|
|
44228
|
+
variant: "outlined",
|
|
44229
|
+
isPending: isLoading,
|
|
44230
|
+
isDisabled: isError,
|
|
44231
|
+
children: [t("reports:label.switch_report", "Switch report"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDown, { size: 14 })]
|
|
44232
|
+
}), [
|
|
44233
|
+
t,
|
|
44234
|
+
isLoading,
|
|
44235
|
+
isError
|
|
44236
|
+
]);
|
|
44237
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MegaMenu, {
|
|
44238
|
+
items: data !== null && data !== void 0 ? data : EMPTY_ARRAY$1,
|
|
44239
|
+
selectedItem: (_baseReport$key = baseReport === null || baseReport === void 0 ? void 0 : baseReport.key) !== null && _baseReport$key !== void 0 ? _baseReport$key : null,
|
|
44240
|
+
placement: "bottom left",
|
|
44241
|
+
groupConfig,
|
|
44242
|
+
leafConfig,
|
|
44243
|
+
slots: { Trigger }
|
|
44244
|
+
});
|
|
44245
|
+
}
|
|
44246
|
+
//#endregion
|
|
43915
44247
|
//#region src/components/YearPicker/YearPicker.tsx
|
|
43916
44248
|
var YearPicker = ({ label, year, onChange, minDate = null, maxDate = null, isDisabled = false }) => {
|
|
43917
44249
|
var _minDate$year, _maxDate$year;
|
|
@@ -44218,7 +44550,7 @@ var UnifiedReportControls = () => {
|
|
|
44218
44550
|
//#endregion
|
|
44219
44551
|
//#region src/components/UnifiedReports/UnifiedReportBaseHeader.tsx
|
|
44220
44552
|
var resolveVariant$1 = ({ width }) => width <= BREAKPOINTS.MOBILE ? "Mobile" : "Desktop";
|
|
44221
|
-
var UnifiedReportBaseHeaderRow = (
|
|
44553
|
+
var UnifiedReportBaseHeaderRow = (props) => {
|
|
44222
44554
|
const { baseReport } = useBaseUnifiedReport();
|
|
44223
44555
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
44224
44556
|
pi: "lg",
|
|
@@ -44226,24 +44558,31 @@ var UnifiedReportBaseHeaderRow = ({ variant }) => {
|
|
|
44226
44558
|
align: "center",
|
|
44227
44559
|
justify: "space-between",
|
|
44228
44560
|
className: "Layer__UnifiedReports__BaseHeaderRow",
|
|
44229
|
-
children: [!(variant === "Mobile") &&
|
|
44230
|
-
|
|
44231
|
-
|
|
44232
|
-
children: baseReport.
|
|
44233
|
-
|
|
44234
|
-
|
|
44235
|
-
|
|
44236
|
-
|
|
44561
|
+
children: [!(props.variant === "Mobile") && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
44562
|
+
align: "center",
|
|
44563
|
+
gap: "lg",
|
|
44564
|
+
children: [baseReport ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Span, {
|
|
44565
|
+
size: "lg",
|
|
44566
|
+
weight: "bold",
|
|
44567
|
+
children: baseReport.displayName
|
|
44568
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkeletonLoader, {
|
|
44569
|
+
width: "192px",
|
|
44570
|
+
height: "24px"
|
|
44571
|
+
}), props.navigationVariant === "menu" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReportsMegaMenu, {})]
|
|
44572
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportHeaderButtons, { variant: props.variant })]
|
|
44237
44573
|
});
|
|
44238
44574
|
};
|
|
44239
|
-
var UnifiedReportBaseHeader = () => {
|
|
44575
|
+
var UnifiedReportBaseHeader = ({ navigationVariant }) => {
|
|
44240
44576
|
const { isDesktop } = useSizeClass();
|
|
44241
44577
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
44242
44578
|
className: "Layer__UnifiedReports__BaseHeader",
|
|
44243
44579
|
children: [isDesktop && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ResponsiveComponent, {
|
|
44244
44580
|
resolveVariant: resolveVariant$1,
|
|
44245
44581
|
slots: {
|
|
44246
|
-
Desktop: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportBaseHeaderRow, {
|
|
44582
|
+
Desktop: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportBaseHeaderRow, {
|
|
44583
|
+
variant: "Desktop",
|
|
44584
|
+
navigationVariant
|
|
44585
|
+
}),
|
|
44247
44586
|
Mobile: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportBaseHeaderRow, { variant: "Mobile" })
|
|
44248
44587
|
}
|
|
44249
44588
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportControls, {})]
|
|
@@ -44363,13 +44702,13 @@ var UnifiedReportDetailHeader = () => {
|
|
|
44363
44702
|
};
|
|
44364
44703
|
//#endregion
|
|
44365
44704
|
//#region src/components/UnifiedReports/UnifiedReportTableHeader.tsx
|
|
44366
|
-
var UnifiedReportTableHeader = () => {
|
|
44705
|
+
var UnifiedReportTableHeader = ({ navigationVariant }) => {
|
|
44367
44706
|
const { isDetailView } = useDetailUnifiedReport();
|
|
44368
|
-
return isDetailView ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportDetailHeader, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportBaseHeader, {});
|
|
44707
|
+
return isDetailView ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportDetailHeader, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportBaseHeader, { navigationVariant });
|
|
44369
44708
|
};
|
|
44370
44709
|
//#endregion
|
|
44371
44710
|
//#region src/components/UnifiedReports/UnifiedReports.tsx
|
|
44372
|
-
var UnifiedReportContent = () => {
|
|
44711
|
+
var UnifiedReportContent = ({ navigationVariant = "sidebar" }) => {
|
|
44373
44712
|
const { t } = (0, react_i18next.useTranslation)();
|
|
44374
44713
|
const { isDesktop } = useSizeClass();
|
|
44375
44714
|
const header = (0, react.useMemo)(() => {
|
|
@@ -44382,21 +44721,21 @@ var UnifiedReportContent = () => {
|
|
|
44382
44721
|
header,
|
|
44383
44722
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HStack, {
|
|
44384
44723
|
className: "Layer__UnifiedReports__Body",
|
|
44385
|
-
children: [isDesktop && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
44724
|
+
children: [isDesktop && navigationVariant === "sidebar" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VStack, {
|
|
44386
44725
|
className: "Layer__UnifiedReports__Sidebar",
|
|
44387
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
44726
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReportsNavigationSidebar, {})
|
|
44388
44727
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(VStack, {
|
|
44389
44728
|
fluid: true,
|
|
44390
44729
|
className: "Layer__UnifiedReports__Content",
|
|
44391
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportTableHeader, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportTable, {})]
|
|
44730
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportTableHeader, { navigationVariant }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportTable, {})]
|
|
44392
44731
|
})]
|
|
44393
44732
|
})
|
|
44394
44733
|
});
|
|
44395
44734
|
};
|
|
44396
|
-
var UnifiedReports = ({ dateSelectionMode }) => {
|
|
44735
|
+
var UnifiedReports = ({ dateSelectionMode, navigationVariant }) => {
|
|
44397
44736
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportStoreProvider, {
|
|
44398
44737
|
dateSelectionMode,
|
|
44399
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandableDataTableProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportContent, {}) })
|
|
44738
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandableDataTableProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnifiedReportContent, { navigationVariant }) })
|
|
44400
44739
|
});
|
|
44401
44740
|
};
|
|
44402
44741
|
//#endregion
|
|
@@ -44509,12 +44848,13 @@ var AccountingOverview = ({ title, showTitle = true, enableOnboarding = false, o
|
|
|
44509
44848
|
const { t } = (0, react_i18next.useTranslation)();
|
|
44510
44849
|
const { value: sizeClass } = useSizeClass();
|
|
44511
44850
|
const profitAndLossSummariesVariants = slotProps === null || slotProps === void 0 || (_slotProps$profitAndL = slotProps.profitAndLoss) === null || _slotProps$profitAndL === void 0 || (_slotProps$profitAndL = _slotProps$profitAndL.summaries) === null || _slotProps$profitAndL === void 0 ? void 0 : _slotProps$profitAndL.variants;
|
|
44851
|
+
const profitAndLossTagFilter = (tagFilter === null || tagFilter === void 0 ? void 0 : tagFilter.tagValues.length) ? {
|
|
44852
|
+
key: tagFilter.tagKey,
|
|
44853
|
+
values: tagFilter.tagValues
|
|
44854
|
+
} : void 0;
|
|
44512
44855
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss, {
|
|
44513
44856
|
asContainer: false,
|
|
44514
|
-
tagFilter:
|
|
44515
|
-
key: tagFilter.tagKey,
|
|
44516
|
-
values: tagFilter.tagValues
|
|
44517
|
-
} : void 0,
|
|
44857
|
+
tagFilter: profitAndLossTagFilter,
|
|
44518
44858
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(View, {
|
|
44519
44859
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || title || t("overview:label.accounting_overview", "Accounting overview"),
|
|
44520
44860
|
viewClassName: "Layer__AccountingOverview",
|
|
@@ -44540,10 +44880,7 @@ var AccountingOverview = ({ title, showTitle = true, enableOnboarding = false, o
|
|
|
44540
44880
|
className: "Layer__AccountingOverview__ProfitAndLossHeader",
|
|
44541
44881
|
trailingContent: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PnlLegend, { direction: "row" })
|
|
44542
44882
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss.Chart, {
|
|
44543
|
-
tagFilter:
|
|
44544
|
-
key: tagFilter.tagKey,
|
|
44545
|
-
values: tagFilter.tagValues
|
|
44546
|
-
} : void 0,
|
|
44883
|
+
tagFilter: profitAndLossTagFilter,
|
|
44547
44884
|
hideLegend: true
|
|
44548
44885
|
})]
|
|
44549
44886
|
}),
|
|
@@ -44593,7 +44930,7 @@ var BankTransactionsWithLinkedAccounts = ({ title, showTitle = true, elevatedLin
|
|
|
44593
44930
|
//#region src/hooks/api/businesses/[business-id]/call-bookings/useCreateCallBooking.tsx
|
|
44594
44931
|
var CREATE_CALL_BOOKING_TAG_KEY = "#create-call-booking";
|
|
44595
44932
|
var createCallBooking = post(({ businessId }) => `/v1/businesses/${businessId}/call-bookings`);
|
|
44596
|
-
function buildKey$
|
|
44933
|
+
function buildKey$24({ access_token: accessToken, apiUrl, businessId }) {
|
|
44597
44934
|
if (accessToken && apiUrl) return {
|
|
44598
44935
|
accessToken,
|
|
44599
44936
|
apiUrl,
|
|
@@ -44606,7 +44943,7 @@ function useCreateCallBooking() {
|
|
|
44606
44943
|
const { data } = useAuth();
|
|
44607
44944
|
const { businessId } = useLayerContext();
|
|
44608
44945
|
const { forceReloadCallBookings } = useCallBookingsGlobalCacheActions();
|
|
44609
|
-
const rawMutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$
|
|
44946
|
+
const rawMutationResponse = (0, swr_mutation.default)(() => withLocale(buildKey$24(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => createCallBooking(apiUrl, accessToken, {
|
|
44610
44947
|
params: { businessId },
|
|
44611
44948
|
body
|
|
44612
44949
|
}).then(effect.Schema.decodeUnknownPromise(CallBookingItemResponseSchema)), {
|
|
@@ -45037,16 +45374,21 @@ var BookkeepingOverviewTasksContent = ({ callBooking, showCallBookingCard, tasks
|
|
|
45037
45374
|
onClickReconnectAccounts
|
|
45038
45375
|
})] });
|
|
45039
45376
|
};
|
|
45040
|
-
var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts, stringOverrides, slotProps }) => {
|
|
45377
|
+
var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts, chartColorsList, stringOverrides, slotProps, tagFilter = void 0 }) => {
|
|
45041
45378
|
var _slotProps$profitAndL, _stringOverrides$prof, _stringOverrides$prof2, _stringOverrides$prof3;
|
|
45042
45379
|
const { t } = (0, react_i18next.useTranslation)();
|
|
45043
45380
|
const [width] = useWindowSize();
|
|
45044
45381
|
const { value: sizeClass } = useSizeClass();
|
|
45045
45382
|
const profitAndLossSummariesVariants = slotProps === null || slotProps === void 0 || (_slotProps$profitAndL = slotProps.profitAndLoss) === null || _slotProps$profitAndL === void 0 || (_slotProps$profitAndL = _slotProps$profitAndL.summaries) === null || _slotProps$profitAndL === void 0 ? void 0 : _slotProps$profitAndL.variants;
|
|
45383
|
+
const profitAndLossTagFilter = (tagFilter === null || tagFilter === void 0 ? void 0 : tagFilter.tagValues.length) ? {
|
|
45384
|
+
key: tagFilter.tagKey,
|
|
45385
|
+
values: tagFilter.tagValues
|
|
45386
|
+
} : void 0;
|
|
45046
45387
|
const { upperContentRef, targetElementRef, upperElementInFocus } = useKeepInMobileViewport();
|
|
45047
45388
|
const { callBooking, showCallBookingCard, handleBookCall, isCalendlyVisible, calendlyLink, calendlyRef, closeCalendly } = useBookkeepingOnboardingCallBooking();
|
|
45048
45389
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ProfitAndLoss, {
|
|
45049
45390
|
asContainer: false,
|
|
45391
|
+
tagFilter: profitAndLossTagFilter,
|
|
45050
45392
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(View, {
|
|
45051
45393
|
viewClassName: "Layer__bookkeeping-overview--view Layer__BookkeepingOverview",
|
|
45052
45394
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || title || t("overview:label.bookkeeping_overview", "Bookkeeping overview"),
|
|
@@ -45103,16 +45445,21 @@ var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts,
|
|
|
45103
45445
|
fluid: true,
|
|
45104
45446
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss.Summaries, {
|
|
45105
45447
|
stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$prof2 = stringOverrides.profitAndLoss) === null || _stringOverrides$prof2 === void 0 ? void 0 : _stringOverrides$prof2.summaries,
|
|
45448
|
+
chartColorsList,
|
|
45106
45449
|
variants: profitAndLossSummariesVariants
|
|
45107
45450
|
})
|
|
45108
45451
|
}),
|
|
45109
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss.Chart, {
|
|
45452
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLoss.Chart, {
|
|
45453
|
+
hideLegend: true,
|
|
45454
|
+
tagFilter: profitAndLossTagFilter
|
|
45455
|
+
})
|
|
45110
45456
|
]
|
|
45111
45457
|
})
|
|
45112
45458
|
}),
|
|
45113
45459
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProfitAndLossOverviewDetailedCharts, {
|
|
45114
45460
|
variant: "bookkeeping",
|
|
45115
|
-
detailedChartsStringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$prof3 = stringOverrides.profitAndLoss) === null || _stringOverrides$prof3 === void 0 ? void 0 : _stringOverrides$prof3.detailedCharts
|
|
45461
|
+
detailedChartsStringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$prof3 = stringOverrides.profitAndLoss) === null || _stringOverrides$prof3 === void 0 ? void 0 : _stringOverrides$prof3.detailedCharts,
|
|
45462
|
+
chartColorsList
|
|
45116
45463
|
})
|
|
45117
45464
|
]
|
|
45118
45465
|
}), isCalendlyVisible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -45467,7 +45814,7 @@ var TripPurposeFilterValue = /* @__PURE__ */ function(TripPurposeFilterValue) {
|
|
|
45467
45814
|
return TripPurposeFilterValue;
|
|
45468
45815
|
}({});
|
|
45469
45816
|
var TRIP_PURPOSE_CONFIG = [
|
|
45470
|
-
_objectSpread2(_objectSpread2({}, translationKey("common:label.
|
|
45817
|
+
_objectSpread2(_objectSpread2({}, translationKey("common:label.all", "All")), {}, { value: TripPurposeFilterValue.All }),
|
|
45471
45818
|
_objectSpread2(_objectSpread2({}, translationKey("common:label.business", "Business")), {}, { value: TripPurposeFilterValue.Business }),
|
|
45472
45819
|
_objectSpread2(_objectSpread2({}, translationKey("common:label.personal", "Personal")), {}, { value: TripPurposeFilterValue.Personal })
|
|
45473
45820
|
];
|
|
@@ -45587,7 +45934,7 @@ function useAutoResetPageIndex(filters, data) {
|
|
|
45587
45934
|
//#region src/hooks/api/businesses/[business-id]/mileage/trips/[trip-id]/useDeleteTrip.tsx
|
|
45588
45935
|
var DELETE_TRIP_TAG_KEY = "#delete-trip";
|
|
45589
45936
|
var deleteTrip = del(({ businessId, tripId }) => `/v1/businesses/${businessId}/mileage/trips/${tripId}`);
|
|
45590
|
-
function buildKey$
|
|
45937
|
+
function buildKey$23({ access_token: accessToken, apiUrl, businessId, tripId }) {
|
|
45591
45938
|
if (accessToken && apiUrl) return {
|
|
45592
45939
|
accessToken,
|
|
45593
45940
|
apiUrl,
|
|
@@ -45600,7 +45947,7 @@ var useDeleteTrip = ({ tripId }) => {
|
|
|
45600
45947
|
const withLocale = useLocalizedKey();
|
|
45601
45948
|
const { data } = useAuth();
|
|
45602
45949
|
const { businessId } = useLayerContext();
|
|
45603
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
45950
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$23(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
45604
45951
|
businessId,
|
|
45605
45952
|
tripId
|
|
45606
45953
|
}))), ({ accessToken, apiUrl, businessId, tripId }) => {
|
|
@@ -46144,7 +46491,7 @@ var UpsertVehicleMode = /* @__PURE__ */ function(UpsertVehicleMode) {
|
|
|
46144
46491
|
}({});
|
|
46145
46492
|
var createVehicle = post(({ businessId }) => `/v1/businesses/${businessId}/mileage/vehicles`);
|
|
46146
46493
|
var updateVehicle = patch(({ businessId, vehicleId }) => `/v1/businesses/${businessId}/mileage/vehicles/${vehicleId}`);
|
|
46147
|
-
function buildKey$
|
|
46494
|
+
function buildKey$22({ access_token: accessToken, apiUrl, businessId, vehicleId = void 0 }) {
|
|
46148
46495
|
if (accessToken && apiUrl) return {
|
|
46149
46496
|
accessToken,
|
|
46150
46497
|
apiUrl,
|
|
@@ -46188,7 +46535,7 @@ var useUpsertVehicle = (props) => {
|
|
|
46188
46535
|
const { businessId } = useLayerContext();
|
|
46189
46536
|
const { mode } = props;
|
|
46190
46537
|
const vehicleId = mode === UpsertVehicleMode.Update ? props.vehicleId : void 0;
|
|
46191
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
46538
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$22(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
46192
46539
|
businessId,
|
|
46193
46540
|
vehicleId
|
|
46194
46541
|
}))), ({ accessToken, apiUrl, businessId, vehicleId }, { arg: body }) => {
|
|
@@ -46497,7 +46844,7 @@ var VehicleDrawer = ({ isOpen, onOpenChange, vehicle, onSuccess }) => {
|
|
|
46497
46844
|
var ARCHIVE_VEHICLE_TAG_KEY = "#archive-vehicle";
|
|
46498
46845
|
var ArchiveVehicleReturnSchema = effect.Schema.Struct({ data: VehicleSchema });
|
|
46499
46846
|
var archiveVehicle = post(({ businessId, vehicleId }) => `/v1/businesses/${businessId}/mileage/vehicles/${vehicleId}/archive`);
|
|
46500
|
-
function buildKey$
|
|
46847
|
+
function buildKey$21({ access_token: accessToken, apiUrl, businessId, vehicleId }) {
|
|
46501
46848
|
if (accessToken && apiUrl) return {
|
|
46502
46849
|
accessToken,
|
|
46503
46850
|
apiUrl,
|
|
@@ -46510,7 +46857,7 @@ var useArchiveVehicle = ({ vehicleId }) => {
|
|
|
46510
46857
|
const withLocale = useLocalizedKey();
|
|
46511
46858
|
const { data } = useAuth();
|
|
46512
46859
|
const { businessId } = useLayerContext();
|
|
46513
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
46860
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$21(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
46514
46861
|
businessId,
|
|
46515
46862
|
vehicleId
|
|
46516
46863
|
}))), ({ accessToken, apiUrl, businessId, vehicleId }) => {
|
|
@@ -46558,7 +46905,7 @@ function VehicleArchiveConfirmationModal({ isOpen, onOpenChange, vehicle, useDra
|
|
|
46558
46905
|
//#region src/hooks/api/businesses/[business-id]/mileage/vehicles/[vehicle-id]/useDeleteVehicle.tsx
|
|
46559
46906
|
var DELETE_VEHICLE_TAG_KEY = "#delete-vehicle";
|
|
46560
46907
|
var deleteVehicle = del(({ businessId, vehicleId }) => `/v1/businesses/${businessId}/mileage/vehicles/${vehicleId}`);
|
|
46561
|
-
function buildKey$
|
|
46908
|
+
function buildKey$20({ access_token: accessToken, apiUrl, businessId, vehicleId }) {
|
|
46562
46909
|
if (accessToken && apiUrl) return {
|
|
46563
46910
|
accessToken,
|
|
46564
46911
|
apiUrl,
|
|
@@ -46571,7 +46918,7 @@ var useDeleteVehicle = ({ vehicleId }) => {
|
|
|
46571
46918
|
const withLocale = useLocalizedKey();
|
|
46572
46919
|
const { data } = useAuth();
|
|
46573
46920
|
const { businessId } = useLayerContext();
|
|
46574
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
46921
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$20(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
46575
46922
|
businessId,
|
|
46576
46923
|
vehicleId
|
|
46577
46924
|
}))), ({ accessToken, apiUrl, businessId, vehicleId }) => {
|
|
@@ -46620,7 +46967,7 @@ function VehicleDeleteConfirmationModal({ isOpen, onOpenChange, vehicle, useDraw
|
|
|
46620
46967
|
var REACTIVATE_VEHICLE_TAG_KEY = "#reactivate-vehicle";
|
|
46621
46968
|
var ReactivateVehicleReturnSchema = effect.Schema.Struct({ data: VehicleSchema });
|
|
46622
46969
|
var reactivateVehicle = post(({ businessId, vehicleId }) => `/v1/businesses/${businessId}/mileage/vehicles/${vehicleId}/reactivate`);
|
|
46623
|
-
function buildKey$
|
|
46970
|
+
function buildKey$19({ access_token: accessToken, apiUrl, businessId, vehicleId }) {
|
|
46624
46971
|
if (accessToken && apiUrl) return {
|
|
46625
46972
|
accessToken,
|
|
46626
46973
|
apiUrl,
|
|
@@ -46633,7 +46980,7 @@ var useReactivateVehicle = ({ vehicleId }) => {
|
|
|
46633
46980
|
const withLocale = useLocalizedKey();
|
|
46634
46981
|
const { data } = useAuth();
|
|
46635
46982
|
const { businessId } = useLayerContext();
|
|
46636
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
46983
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$19(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
46637
46984
|
businessId,
|
|
46638
46985
|
vehicleId
|
|
46639
46986
|
}))), ({ accessToken, apiUrl, businessId, vehicleId }) => {
|
|
@@ -47519,7 +47866,7 @@ var TAX_PROFILE_TAG_KEY = "#tax-profile";
|
|
|
47519
47866
|
var getTaxProfile = get$1(({ businessId }) => {
|
|
47520
47867
|
return `/v1/businesses/${businessId}/tax-estimates/profile`;
|
|
47521
47868
|
});
|
|
47522
|
-
function buildKey$
|
|
47869
|
+
function buildKey$18({ access_token: accessToken, apiUrl, businessId }) {
|
|
47523
47870
|
if (accessToken && apiUrl) return {
|
|
47524
47871
|
accessToken,
|
|
47525
47872
|
apiUrl,
|
|
@@ -47531,7 +47878,7 @@ function useTaxProfile() {
|
|
|
47531
47878
|
const withLocale = useLocalizedKey();
|
|
47532
47879
|
const { data: auth } = useAuth();
|
|
47533
47880
|
const { businessId } = useLayerContext();
|
|
47534
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
47881
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$18(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
47535
47882
|
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
|
|
47536
47883
|
return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
|
|
47537
47884
|
});
|
|
@@ -48043,7 +48390,7 @@ var getTaxSummary = get$1(({ businessId, year, reportingBasis, fullYearProjectio
|
|
|
48043
48390
|
full_year_projection: fullYearProjection
|
|
48044
48391
|
})}`;
|
|
48045
48392
|
});
|
|
48046
|
-
function buildKey$
|
|
48393
|
+
function buildKey$17({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
|
|
48047
48394
|
if (!enabled) return;
|
|
48048
48395
|
if (accessToken && apiUrl) return {
|
|
48049
48396
|
accessToken,
|
|
@@ -48059,7 +48406,7 @@ function useTaxSummary({ year, reportingBasis, fullYearProjection, enabled = tru
|
|
|
48059
48406
|
const withLocale = useLocalizedKey();
|
|
48060
48407
|
const { data: auth } = useAuth();
|
|
48061
48408
|
const { businessId } = useLayerContext();
|
|
48062
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
48409
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
48063
48410
|
businessId,
|
|
48064
48411
|
year,
|
|
48065
48412
|
reportingBasis,
|
|
@@ -48704,7 +49051,7 @@ var getTaxDetails = get$1(({ businessId, year, reportingBasis, fullYearProjectio
|
|
|
48704
49051
|
full_year_projection: fullYearProjection
|
|
48705
49052
|
})}`;
|
|
48706
49053
|
});
|
|
48707
|
-
function buildKey$
|
|
49054
|
+
function buildKey$16({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection }) {
|
|
48708
49055
|
if (accessToken && apiUrl) return {
|
|
48709
49056
|
accessToken,
|
|
48710
49057
|
apiUrl,
|
|
@@ -48719,7 +49066,7 @@ function useTaxDetails({ year, reportingBasis, fullYearProjection }) {
|
|
|
48719
49066
|
const withLocale = useLocalizedKey();
|
|
48720
49067
|
const { data: auth } = useAuth();
|
|
48721
49068
|
const { businessId } = useLayerContext();
|
|
48722
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
49069
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
48723
49070
|
businessId,
|
|
48724
49071
|
year,
|
|
48725
49072
|
reportingBasis,
|
|
@@ -48767,7 +49114,7 @@ var getTaxPayments = get$1(({ businessId, year, reportingBasis, fullYearProjecti
|
|
|
48767
49114
|
full_year_projection: fullYearProjection
|
|
48768
49115
|
})}`;
|
|
48769
49116
|
});
|
|
48770
|
-
function buildKey$
|
|
49117
|
+
function buildKey$15({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection }) {
|
|
48771
49118
|
if (accessToken && apiUrl) return {
|
|
48772
49119
|
accessToken,
|
|
48773
49120
|
apiUrl,
|
|
@@ -48782,7 +49129,7 @@ function useTaxPayments({ year, reportingBasis, fullYearProjection }) {
|
|
|
48782
49129
|
const withLocale = useLocalizedKey();
|
|
48783
49130
|
const { data: auth } = useAuth();
|
|
48784
49131
|
const { businessId } = useLayerContext();
|
|
48785
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
49132
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$15(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
48786
49133
|
businessId,
|
|
48787
49134
|
year,
|
|
48788
49135
|
reportingBasis,
|
|
@@ -48815,7 +49162,7 @@ var UpsertTaxProfileMode = /* @__PURE__ */ function(UpsertTaxProfileMode) {
|
|
|
48815
49162
|
}({});
|
|
48816
49163
|
var createTaxProfile = post(({ businessId }) => `/v1/businesses/${businessId}/tax-estimates/profile`);
|
|
48817
49164
|
var updateTaxProfile = patch(({ businessId }) => `/v1/businesses/${businessId}/tax-estimates/profile`);
|
|
48818
|
-
function buildKey$
|
|
49165
|
+
function buildKey$14({ access_token: accessToken, apiUrl, businessId }) {
|
|
48819
49166
|
if (accessToken && apiUrl) return {
|
|
48820
49167
|
accessToken,
|
|
48821
49168
|
apiUrl,
|
|
@@ -48833,7 +49180,7 @@ function useUpsertTaxProfile({ mode }) {
|
|
|
48833
49180
|
const { patchTaxProfile } = useTaxProfileGlobalCacheActions();
|
|
48834
49181
|
const { forceReloadTaxPayments } = useTaxPaymentsGlobalCacheActions();
|
|
48835
49182
|
const { forceReloadTaxDetails } = useTaxDetailsGlobalCacheActions();
|
|
48836
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
49183
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$14(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
|
|
48837
49184
|
var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }, { arg }) {
|
|
48838
49185
|
return getRequestFn(mode)(apiUrl, accessToken, {
|
|
48839
49186
|
params: { businessId },
|
|
@@ -49130,7 +49477,7 @@ var getTaxEstimatesBanner = get$1(({ businessId, year, reportingBasis, fullYearP
|
|
|
49130
49477
|
full_year_projection: fullYearProjection
|
|
49131
49478
|
})}`;
|
|
49132
49479
|
});
|
|
49133
|
-
function buildKey$
|
|
49480
|
+
function buildKey$13({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection }) {
|
|
49134
49481
|
if (accessToken && apiUrl) return {
|
|
49135
49482
|
accessToken,
|
|
49136
49483
|
apiUrl,
|
|
@@ -49145,7 +49492,7 @@ function useTaxEstimatesBanner({ year, reportingBasis, fullYearProjection }) {
|
|
|
49145
49492
|
const withLocale = useLocalizedKey();
|
|
49146
49493
|
const { data: auth } = useAuth();
|
|
49147
49494
|
const { businessId } = useLayerContext();
|
|
49148
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
49495
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$13(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
49149
49496
|
businessId,
|
|
49150
49497
|
year,
|
|
49151
49498
|
reportingBasis,
|
|
@@ -50179,7 +50526,7 @@ effect.Schema.Struct({ date: CalendarDateSchema });
|
|
|
50179
50526
|
var ACTIVE_TIME_TRACKER_TAG_KEY = "#active-time-tracker";
|
|
50180
50527
|
var ActiveTimeTrackerResponseSchema = effect.Schema.Struct({ data: effect.Schema.Struct({ timeEntry: (0, effect.pipe)(effect.Schema.propertySignature(effect.Schema.NullishOr(TimeEntrySchema)), effect.Schema.fromKey("time_entry")) }) });
|
|
50181
50528
|
var getActiveTimeTracker = get$1(({ businessId }) => `/v1/businesses/${businessId}/time-tracking/tracker/active`);
|
|
50182
|
-
function buildKey$
|
|
50529
|
+
function buildKey$12({ access_token: accessToken, apiUrl, businessId }) {
|
|
50183
50530
|
if (accessToken && apiUrl) return {
|
|
50184
50531
|
accessToken,
|
|
50185
50532
|
apiUrl,
|
|
@@ -50196,7 +50543,7 @@ function useActiveTimeTracker() {
|
|
|
50196
50543
|
const withLocale = useLocalizedKey();
|
|
50197
50544
|
const { data } = useAuth();
|
|
50198
50545
|
const { businessId } = useLayerContext();
|
|
50199
|
-
return new ActiveTimeTrackerSWRResponse((0, swr.default)(() => withLocale(buildKey$
|
|
50546
|
+
return new ActiveTimeTrackerSWRResponse((0, swr.default)(() => withLocale(buildKey$12(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }) => getActiveTimeTracker(apiUrl, accessToken, { params: { businessId } })().then(effect.Schema.decodeUnknownPromise(ActiveTimeTrackerResponseSchema)).then(({ data }) => {
|
|
50200
50547
|
var _data$timeEntry;
|
|
50201
50548
|
return (_data$timeEntry = data.timeEntry) !== null && _data$timeEntry !== void 0 ? _data$timeEntry : null;
|
|
50202
50549
|
})));
|
|
@@ -50234,7 +50581,7 @@ effect.Schema.Struct({
|
|
|
50234
50581
|
var CATALOG_SERVICES_TAG_KEY = "#catalog-services";
|
|
50235
50582
|
var LIST_CATALOG_SERVICES_TAG_KEY = "#list-catalog-services";
|
|
50236
50583
|
var ListCatalogServicesResponseSchema = effect.Schema.Struct({ data: effect.Schema.Array(CatalogServiceSchema) });
|
|
50237
|
-
function buildKey$
|
|
50584
|
+
function buildKey$11({ access_token: accessToken, apiUrl, businessId, allowArchived, isEnabled = true }) {
|
|
50238
50585
|
if (!isEnabled) return;
|
|
50239
50586
|
if (accessToken && apiUrl) return {
|
|
50240
50587
|
accessToken,
|
|
@@ -50256,7 +50603,7 @@ function useListCatalogServices({ allowArchived, isEnabled = true } = {}) {
|
|
|
50256
50603
|
const withLocale = useLocalizedKey();
|
|
50257
50604
|
const { data } = useAuth();
|
|
50258
50605
|
const { businessId } = useLayerContext();
|
|
50259
|
-
return new ListCatalogServicesSWRResponse((0, swr.default)(() => withLocale(buildKey$
|
|
50606
|
+
return new ListCatalogServicesSWRResponse((0, swr.default)(() => withLocale(buildKey$11(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
50260
50607
|
businessId,
|
|
50261
50608
|
allowArchived,
|
|
50262
50609
|
isEnabled
|
|
@@ -50306,7 +50653,7 @@ var ExpandableCard = ({ children, isExpanded, onToggleExpanded, slots }) => {
|
|
|
50306
50653
|
var ARCHIVE_CATALOG_SERVICE_TAG_KEY = "#archive-catalog-service";
|
|
50307
50654
|
var ArchiveCatalogServiceResponseSchema = effect.Schema.Struct({ data: CatalogServiceSchema });
|
|
50308
50655
|
var archiveCatalogService = post(({ businessId, serviceId }) => `/v1/businesses/${businessId}/catalog/services/${serviceId}/archive`);
|
|
50309
|
-
function buildKey$
|
|
50656
|
+
function buildKey$10({ access_token: accessToken, apiUrl, businessId, serviceId }) {
|
|
50310
50657
|
if (accessToken && apiUrl) return {
|
|
50311
50658
|
accessToken,
|
|
50312
50659
|
apiUrl,
|
|
@@ -50320,7 +50667,7 @@ function useArchiveCatalogService({ serviceId }) {
|
|
|
50320
50667
|
const { data } = useAuth();
|
|
50321
50668
|
const { businessId } = useLayerContext();
|
|
50322
50669
|
const { forceReloadCatalogServices } = useCatalogServicesGlobalCacheActions();
|
|
50323
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
50670
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$10(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
50324
50671
|
businessId,
|
|
50325
50672
|
serviceId
|
|
50326
50673
|
}))), ({ accessToken, apiUrl, businessId, serviceId: sid }) => archiveCatalogService(apiUrl, accessToken, { params: {
|
|
@@ -50372,7 +50719,7 @@ function ServiceArchiveModal({ service, isOpen, onOpenChange, onSuccess }) {
|
|
|
50372
50719
|
var UPDATE_CATALOG_SERVICE_TAG_KEY = "#update-catalog-service";
|
|
50373
50720
|
var UpdateCatalogServiceResponseSchema = effect.Schema.Struct({ data: CatalogServiceSchema });
|
|
50374
50721
|
var updateCatalogService = patch(({ businessId, serviceId }) => `/v1/businesses/${businessId}/catalog/services/${serviceId}`);
|
|
50375
|
-
function buildKey$
|
|
50722
|
+
function buildKey$9({ access_token: accessToken, apiUrl, businessId, serviceId }) {
|
|
50376
50723
|
if (accessToken && apiUrl) return {
|
|
50377
50724
|
accessToken,
|
|
50378
50725
|
apiUrl,
|
|
@@ -50386,7 +50733,7 @@ function useUpdateCatalogService({ serviceId }) {
|
|
|
50386
50733
|
const { data } = useAuth();
|
|
50387
50734
|
const { businessId } = useLayerContext();
|
|
50388
50735
|
const { patchCatalogServiceByKey } = useCatalogServicesGlobalCacheActions();
|
|
50389
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
50736
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$9(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
50390
50737
|
businessId,
|
|
50391
50738
|
serviceId
|
|
50392
50739
|
}))), ({ accessToken, apiUrl, businessId, serviceId }, { arg: body }) => updateCatalogService(apiUrl, accessToken, {
|
|
@@ -50415,7 +50762,7 @@ function useUpdateCatalogService({ serviceId }) {
|
|
|
50415
50762
|
var CREATE_CATALOG_SERVICE_TAG_KEY = "#create-catalog-service";
|
|
50416
50763
|
var CreateCatalogServiceResponseSchema = effect.Schema.Struct({ data: CatalogServiceSchema });
|
|
50417
50764
|
var createCatalogService = post(({ businessId }) => `/v1/businesses/${businessId}/catalog/services`);
|
|
50418
|
-
function buildKey$
|
|
50765
|
+
function buildKey$8({ access_token: accessToken, apiUrl, businessId }) {
|
|
50419
50766
|
if (accessToken && apiUrl) return {
|
|
50420
50767
|
accessToken,
|
|
50421
50768
|
apiUrl,
|
|
@@ -50428,7 +50775,7 @@ function useCreateCatalogService() {
|
|
|
50428
50775
|
const { data } = useAuth();
|
|
50429
50776
|
const { businessId } = useLayerContext();
|
|
50430
50777
|
const { forceReloadCatalogServices } = useCatalogServicesGlobalCacheActions();
|
|
50431
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
50778
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$8(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => createCatalogService(apiUrl, accessToken, {
|
|
50432
50779
|
params: { businessId },
|
|
50433
50780
|
body
|
|
50434
50781
|
}).then(effect.Schema.decodeUnknownPromise(CreateCatalogServiceResponseSchema)), {
|
|
@@ -50611,7 +50958,7 @@ function ServiceFormCard(props) {
|
|
|
50611
50958
|
var REACTIVATE_CATALOG_SERVICE_TAG_KEY = "#reactivate-catalog-service";
|
|
50612
50959
|
var ReactivateCatalogServiceResponseSchema = effect.Schema.Struct({ data: CatalogServiceSchema });
|
|
50613
50960
|
var reactivateCatalogService = post(({ businessId, serviceId }) => `/v1/businesses/${businessId}/catalog/services/${serviceId}/reactivate`);
|
|
50614
|
-
function buildKey$
|
|
50961
|
+
function buildKey$7({ access_token: accessToken, apiUrl, businessId, serviceId }) {
|
|
50615
50962
|
if (accessToken && apiUrl) return {
|
|
50616
50963
|
accessToken,
|
|
50617
50964
|
apiUrl,
|
|
@@ -50625,7 +50972,7 @@ function useReactivateCatalogService({ serviceId }) {
|
|
|
50625
50972
|
const { data } = useAuth();
|
|
50626
50973
|
const { businessId } = useLayerContext();
|
|
50627
50974
|
const { forceReloadCatalogServices } = useCatalogServicesGlobalCacheActions();
|
|
50628
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
50975
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$7(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
50629
50976
|
businessId,
|
|
50630
50977
|
serviceId
|
|
50631
50978
|
}))), ({ accessToken, apiUrl, businessId, serviceId: sid }) => reactivateCatalogService(apiUrl, accessToken, { params: {
|
|
@@ -51122,7 +51469,7 @@ function toUpdatePayload(activeEntry, draft) {
|
|
|
51122
51469
|
//#region src/hooks/api/businesses/[business-id]/time-tracking/summary/useTimeTrackingSummary.ts
|
|
51123
51470
|
var TimeTrackingSummaryResponseSchema = effect.Schema.Struct({ data: TimeEntrySummarySchema });
|
|
51124
51471
|
var TIME_TRACKING_SUMMARY_TAG_KEY = "#time-tracking-summary";
|
|
51125
|
-
function buildKey$
|
|
51472
|
+
function buildKey$6({ access_token: accessToken, apiUrl, businessId, customerId, serviceId, startDate, endDate }) {
|
|
51126
51473
|
if (accessToken && apiUrl) return {
|
|
51127
51474
|
accessToken,
|
|
51128
51475
|
apiUrl,
|
|
@@ -51148,7 +51495,7 @@ function useTimeTrackingSummary(filterParams = {}) {
|
|
|
51148
51495
|
const withLocale = useLocalizedKey();
|
|
51149
51496
|
const { data } = useAuth();
|
|
51150
51497
|
const { businessId } = useLayerContext();
|
|
51151
|
-
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$
|
|
51498
|
+
return new SWRQueryResult((0, swr.default)(() => withLocale(buildKey$6(_objectSpread2(_objectSpread2({}, data), {}, { businessId }, filterParams))), ({ accessToken, apiUrl, businessId, customerId, serviceId, startDate, endDate }) => getTimeTrackingSummary(apiUrl, accessToken, { params: {
|
|
51152
51499
|
businessId,
|
|
51153
51500
|
customerId,
|
|
51154
51501
|
serviceId,
|
|
@@ -51249,7 +51596,7 @@ function useTimeEntriesGlobalCacheActions() {
|
|
|
51249
51596
|
//#region src/hooks/api/businesses/[business-id]/time-tracking/time-entries/[time-entry-id]/useDeleteTimeEntry.ts
|
|
51250
51597
|
var DELETE_TIME_ENTRY_TAG_KEY = "#delete-time-entry";
|
|
51251
51598
|
var deleteTimeEntry = del(({ businessId, timeEntryId }) => `/v1/businesses/${businessId}/time-tracking/time-entries/${timeEntryId}`);
|
|
51252
|
-
function buildKey$
|
|
51599
|
+
function buildKey$5({ access_token: accessToken, apiUrl, businessId, timeEntryId }) {
|
|
51253
51600
|
if (accessToken && apiUrl) return {
|
|
51254
51601
|
accessToken,
|
|
51255
51602
|
apiUrl,
|
|
@@ -51264,7 +51611,7 @@ var useDeleteTimeEntry = ({ timeEntryId }) => {
|
|
|
51264
51611
|
const { businessId } = useLayerContext();
|
|
51265
51612
|
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => {
|
|
51266
51613
|
if (!timeEntryId) return;
|
|
51267
|
-
return withLocale(buildKey$
|
|
51614
|
+
return withLocale(buildKey$5(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
51268
51615
|
businessId,
|
|
51269
51616
|
timeEntryId
|
|
51270
51617
|
})));
|
|
@@ -51305,7 +51652,7 @@ var UpsertTimeEntryMode = /* @__PURE__ */ function(UpsertTimeEntryMode) {
|
|
|
51305
51652
|
}({});
|
|
51306
51653
|
var createTimeEntry = post(({ businessId }) => `/v1/businesses/${businessId}/time-tracking/time-entries`);
|
|
51307
51654
|
var updateTimeEntry = patch(({ businessId, timeEntryId }) => `/v1/businesses/${businessId}/time-tracking/time-entries/${timeEntryId}`);
|
|
51308
|
-
function buildKey$
|
|
51655
|
+
function buildKey$4({ access_token: accessToken, apiUrl, businessId, timeEntryId = void 0 }) {
|
|
51309
51656
|
if (accessToken && apiUrl) return {
|
|
51310
51657
|
accessToken,
|
|
51311
51658
|
apiUrl,
|
|
@@ -51321,7 +51668,7 @@ function useUpsertTimeEntry(props) {
|
|
|
51321
51668
|
const { businessId } = useLayerContext();
|
|
51322
51669
|
const { mode } = props;
|
|
51323
51670
|
const timeEntryId = mode === UpsertTimeEntryMode.Update ? props.timeEntryId : void 0;
|
|
51324
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
51671
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$4(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
51325
51672
|
businessId,
|
|
51326
51673
|
timeEntryId
|
|
51327
51674
|
}))), ({ accessToken, apiUrl, businessId, timeEntryId }, { arg: body }) => {
|
|
@@ -51369,7 +51716,7 @@ function useUpsertTimeEntry(props) {
|
|
|
51369
51716
|
var STOP_TIME_TRACKER_TAG_KEY = "#stop-time-tracker";
|
|
51370
51717
|
var StopTimeTrackerResponseSchema = effect.Schema.Struct({ data: effect.Schema.Struct({ id: effect.Schema.UUID }) });
|
|
51371
51718
|
var stopTimeTracker = post(({ businessId }) => `/v1/businesses/${businessId}/time-tracking/tracker/stop`);
|
|
51372
|
-
function buildKey$
|
|
51719
|
+
function buildKey$3({ access_token: accessToken, apiUrl, businessId }) {
|
|
51373
51720
|
if (accessToken && apiUrl) return {
|
|
51374
51721
|
accessToken,
|
|
51375
51722
|
apiUrl,
|
|
@@ -51384,7 +51731,7 @@ var useStopTimeTracker = () => {
|
|
|
51384
51731
|
const { forceReloadTimeEntries } = useTimeEntriesGlobalCacheActions();
|
|
51385
51732
|
const { invalidateTimeTrackingSummary } = useTimeTrackingSummaryGlobalCacheActions();
|
|
51386
51733
|
const { invalidateActiveTimeTracker } = useActiveTimeTrackerGlobalCacheActions();
|
|
51387
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
51734
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$3(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => stopTimeTracker(apiUrl, accessToken, {
|
|
51388
51735
|
params: { businessId },
|
|
51389
51736
|
body
|
|
51390
51737
|
}).then(effect.Schema.decodeUnknownPromise(StopTimeTrackerResponseSchema)), {
|
|
@@ -51732,7 +52079,7 @@ var ActiveTimeTrackerBanner = ({ activeEntry, timerDisplayValue }) => {
|
|
|
51732
52079
|
var START_TIME_TRACKER_TAG_KEY = "#start-time-tracker";
|
|
51733
52080
|
var StartTimeTrackerResponseSchema = effect.Schema.Struct({ data: TimeEntrySchema });
|
|
51734
52081
|
var startTimeTracker = post(({ businessId }) => `/v1/businesses/${businessId}/time-tracking/tracker/start`);
|
|
51735
|
-
function buildKey$
|
|
52082
|
+
function buildKey$2({ access_token: accessToken, apiUrl, businessId }) {
|
|
51736
52083
|
if (accessToken && apiUrl) return {
|
|
51737
52084
|
accessToken,
|
|
51738
52085
|
apiUrl,
|
|
@@ -51745,7 +52092,7 @@ var useStartTimeTracker = () => {
|
|
|
51745
52092
|
const { data } = useAuth();
|
|
51746
52093
|
const { businessId } = useLayerContext();
|
|
51747
52094
|
const { invalidateActiveTimeTracker } = useActiveTimeTrackerGlobalCacheActions();
|
|
51748
|
-
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$
|
|
52095
|
+
const mutationResponse = new SWRMutationResult((0, swr_mutation.default)(() => withLocale(buildKey$2(_objectSpread2(_objectSpread2({}, data), {}, { businessId }))), ({ accessToken, apiUrl, businessId }, { arg: body }) => startTimeTracker(apiUrl, accessToken, {
|
|
51749
52096
|
params: { businessId },
|
|
51750
52097
|
body
|
|
51751
52098
|
}).then(effect.Schema.decodeUnknownPromise(StartTimeTrackerResponseSchema)), {
|
|
@@ -53075,6 +53422,29 @@ var LayerContextActionName = /* @__PURE__ */ function(LayerContextActionName) {
|
|
|
53075
53422
|
return LayerContextActionName;
|
|
53076
53423
|
}({});
|
|
53077
53424
|
//#endregion
|
|
53425
|
+
//#region src/hooks/api/businesses/[business-id]/accounting-config/useAccountingConfiguration.tsx
|
|
53426
|
+
var ACCOUNTING_CONFIGURATION_TAG_KEY = "#accounting-configuration";
|
|
53427
|
+
function buildKey$1({ access_token: accessToken, apiUrl, businessId }) {
|
|
53428
|
+
if (accessToken && apiUrl) return {
|
|
53429
|
+
accessToken,
|
|
53430
|
+
apiUrl,
|
|
53431
|
+
businessId,
|
|
53432
|
+
tag: [ACCOUNTING_CONFIGURATION_TAG_KEY]
|
|
53433
|
+
};
|
|
53434
|
+
}
|
|
53435
|
+
var getAccountingConfiguration = get$1(({ businessId }) => {
|
|
53436
|
+
return `/v1/businesses/${businessId}/accounting-config`;
|
|
53437
|
+
});
|
|
53438
|
+
function useAccountingConfiguration({ businessId }) {
|
|
53439
|
+
const { apiUrl } = useEnvironment();
|
|
53440
|
+
const { data: auth } = useAuth();
|
|
53441
|
+
const queryKey = buildKey$1(_objectSpread2(_objectSpread2({}, auth), {}, {
|
|
53442
|
+
apiUrl,
|
|
53443
|
+
businessId
|
|
53444
|
+
}));
|
|
53445
|
+
return new SWRQueryResult((0, swr.default)(() => queryKey, ({ accessToken, apiUrl, businessId }) => getAccountingConfiguration(apiUrl, accessToken, { params: { businessId } })().then(({ data }) => effect_index.Schema.decodeUnknownPromise(AccountingConfigurationSchema)(data))));
|
|
53446
|
+
}
|
|
53447
|
+
//#endregion
|
|
53078
53448
|
//#region src/schemas/business.ts
|
|
53079
53449
|
var BusinessSchema = effect.Schema.Struct({
|
|
53080
53450
|
id: effect.Schema.UUID,
|