@alfadocs/ui-kit 1.115.0 → 1.116.0
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/_chunks/accessible-target-Bs9ELM3l.js +6 -0
- package/dist/_chunks/{actions-cell-renderer-bI27uXXC.js → actions-cell-renderer-DzHxDyI7.js} +3 -3
- package/dist/_chunks/{address-fields-D5Ije0S2.js → address-fields-BFVCtfP2.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-BZ36ULQk.js → anamnesis-summary-rows-gEXqU5i5.js} +6 -6
- package/dist/_chunks/{appointment-card-D_-aBrx5.js → appointment-card-BMZoXaGx.js} +3 -3
- package/dist/_chunks/{appointment-peek-DWfcpoGy.js → appointment-peek-B1CCv-7J.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DxLu3afn.js → appointment-timeline-0k4LxODn.js} +3 -3
- package/dist/_chunks/{appointment-tray-BhXOJpIJ.js → appointment-tray-DIxpgIXM.js} +2 -2
- package/dist/_chunks/arrow-down-left-DECv-dJt.js +15 -0
- package/dist/_chunks/{balance-badge-cell-CXHihM22.js → balance-badge-cell-L7bD0Nsh.js} +6 -6
- package/dist/_chunks/bill-line-table-WEIRDcv6.js +1563 -0
- package/dist/_chunks/{bmi-calculator-Ba4yoR31.js → bmi-calculator-BjUfXqcY.js} +2 -2
- package/dist/_chunks/{button-group-CUnNnt8a.js → button-group-BvU9vRnX.js} +2 -2
- package/dist/_chunks/{calculator-dialog-D4TyJwqy.js → calculator-dialog-BGX5XQCM.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-BVzFi4hH.js → calendar-appointment-editor-dialog-DqZMb4yd.js} +16 -16
- package/dist/_chunks/{care-plan-card-BA3MfdfZ.js → care-plan-card-CfV8jiF0.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-CUtFZ813.js → care-plan-entry-card-Bt01kyTl.js} +3 -3
- package/dist/_chunks/{chart-DebrFZ6L.js → chart-BSx8cfMm.js} +2 -2
- package/dist/_chunks/circle-off-DuT9pVy2.js +16 -0
- package/dist/_chunks/combobox-BBCVQS-S.js +935 -0
- package/dist/_chunks/{compact-editor-fields-cP6yh7xv.js → compact-editor-fields-6sTWRLtf.js} +3 -3
- package/dist/_chunks/{contact-profile-card-DMXWBBkU.js → contact-profile-card-BRCHbQ3-.js} +2 -2
- package/dist/_chunks/{country-select-CUuGOAoZ.js → country-select-C2GdvRtS.js} +2 -2
- package/dist/_chunks/{cycle-calculator-C68V9rdH.js → cycle-calculator-Brd0PP4U.js} +2 -2
- package/dist/_chunks/{dashboard-grid-DrOkTtya.js → dashboard-grid-3aidD-IQ.js} +2 -2
- package/dist/_chunks/{toolbar-Bc3pjfG5.js → data-grid-ByhrYGVw.js} +3013 -3106
- package/dist/_chunks/{data-grid-tabs-CsLbIv0h.js → data-grid-tabs-D9Y4DeeH.js} +2 -2
- package/dist/_chunks/{data-table-DXaE2Ret.js → data-table-B47iw2CO.js} +101 -100
- package/dist/_chunks/{date-range-panel-CBFfkgmz.js → date-range-panel-B-DUtfw3.js} +7 -7
- package/dist/_chunks/default-tabs-BQcSqcNG.js +2250 -0
- package/dist/_chunks/dialog-CIUn5oLb.js +348 -0
- package/dist/_chunks/{document-preview-WvJKHJOP.js → document-preview-B_JGHsEW.js} +2 -2
- package/dist/_chunks/{dropdown-menu-CqxBthww.js → dropdown-menu-Dmbak7q6.js} +320 -248
- package/dist/_chunks/{due-date-calculator-C1UA5jpS.js → due-date-calculator-DzIQXEX5.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-CtlMhLai.js → editable-currency-cell-renderer-p-Q1UkZS.js} +2 -2
- package/dist/_chunks/export-files-BByoK9Cg.js +248 -0
- package/dist/_chunks/{face-scheme-DkoxiDCh.js → face-scheme-CEjJUnNe.js} +19 -18
- package/dist/_chunks/{fetal-weight-DmZzMRzB.js → fetal-weight-CJTlfh_k.js} +2 -2
- package/dist/_chunks/{file-manager-DFFExyym.js → file-manager-DEe51ZDe.js} +5 -5
- package/dist/_chunks/format-price-CIX0YJZn.js +179 -0
- package/dist/_chunks/{grid-context-AwsLJRhH.js → grid-context-jn9y8tNE.js} +4 -4
- package/dist/_chunks/{hcg-doubling-CC-dbKE8.js → hcg-doubling-BUZQkSYC.js} +2 -2
- package/dist/_chunks/{header-settings-Df9q1uHt.js → header-settings-DNgvO8fS.js} +2 -2
- package/dist/_chunks/{heatmap-eXdtmEoU.js → heatmap-tn1WxoMT.js} +3 -3
- package/dist/_chunks/{help-me-write-templates-CWxgjDZl.js → help-me-write-templates-C28E_rOt.js} +2 -2
- package/dist/_chunks/highlighter-DSkckT2Q.js +15 -0
- package/dist/_chunks/{icon-button-group-C9mPK-bX.js → icon-button-group-Ca2VkXy5.js} +2 -2
- package/dist/_chunks/{kit-extensions-CzG0RmhQ.js → kit-extensions-BFfLg7c-.js} +6 -6
- package/dist/_chunks/{link-cell-renderer-Ditt5mvT.js → link-cell-renderer-D-Io828l.js} +4 -4
- package/dist/_chunks/{marketplace-app-shell-CcEHJgDd.js → marketplace-app-shell-CBHNg8x-.js} +4 -4
- package/dist/_chunks/money-OE6_oDPH.js +138 -0
- package/dist/_chunks/{muscle-scheme-BkmDUTmk.js → muscle-scheme-7UsRsCHP.js} +2 -2
- package/dist/_chunks/{notes-panel-BVYG_MJE.js → notes-panel-DexbfrFo.js} +3 -3
- package/dist/_chunks/number-input-DUSvP7Dq.js +625 -0
- package/dist/_chunks/{optical-prescription-CvbN8yD2.js → optical-prescription-Da_r8pMr.js} +2 -2
- package/dist/_chunks/parts-CtcTW1PN.js +869 -0
- package/dist/_chunks/{patient-details-DlT-vpSe.js → patient-details-PJ0Y__7t.js} +2 -2
- package/dist/_chunks/{patient-field-row-B54uzvu-.js → patient-field-row-0QP8KCVp.js} +5 -5
- package/dist/_chunks/{patient-search-DDRDCjZi.js → patient-search-Bdx_Ob3y.js} +2 -2
- package/dist/_chunks/{patient-summary-card-Dy9-CzON.js → patient-summary-card-BOfXDP8a.js} +3 -3
- package/dist/_chunks/{payment-request-card-BmV2pLoM.js → payment-request-card-_04afZEx.js} +14 -13
- package/dist/_chunks/{practice-results-BlxfBx-D.js → practice-results-CrBjScXX.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-qZpw3zj8.js → pregnancy-dating-Bg_VUPwl.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-DQoOM8QV.js → pregnancy-weight-gain-B-eXFdmq.js} +2 -2
- package/dist/_chunks/{province-select-cVOlwEc5.js → province-select-CTM8A9SM.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-C1LGeX-G.js → radiograph-panel.agent-9jwXlOXB.js} +2 -2
- package/dist/_chunks/{reserved.agent-6p3Hm4oH.js → reserved.agent-C1zRHaya.js} +4 -4
- package/dist/_chunks/{rich-text-editor-efaMWbYz.js → rich-text-editor-r80Zw8ll.js} +12 -11
- package/dist/_chunks/row-actions-Df7TJbNR.js +213 -0
- package/dist/_chunks/{signature-request-BnTihryS.js → signature-request-CgvjLic3.js} +3 -3
- package/dist/_chunks/{tab-bar-C_pggqVr.js → tab-bar-DTn8pHqH.js} +2 -2
- package/dist/_chunks/{tabs-CXYjr_8O.js → tabs-CsmgkiG6.js} +2 -2
- package/dist/_chunks/{task-editor-CSa6vQ9r.js → task-editor-DgUjtqpX.js} +168 -178
- package/dist/_chunks/{tasks-panel-CVjY1d7Q.js → tasks-panel-B5Nsf10r.js} +2 -2
- package/dist/_chunks/{theme-toggle-CObX2Ffa.js → theme-toggle-DfvdEg_V.js} +3 -3
- package/dist/_chunks/{token-insert-menu-Dl3x2ekR.js → token-insert-menu-BdcmK5Um.js} +2 -2
- package/dist/_chunks/toolbar-DbUQBrq4.js +159 -0
- package/dist/_chunks/{tooth-scheme-C-ALCHaV.js → tooth-scheme-LTkT4EXd.js} +2 -2
- package/dist/_chunks/{transaction-chip-CohY6sTA.js → transaction-chip-CkYd-3ky.js} +47 -57
- package/dist/_chunks/{treatment-receipt-BydbojdD.js → treatment-receipt-1VnuinhY.js} +2 -2
- package/dist/_chunks/undo-2-EBxWjj1W.js +15 -0
- package/dist/_chunks/{unit-converter-D77vmlzN.js → unit-converter-YKlHyUC2.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-BMAiQYo6.js → use-appointment-details-read-_r7cjTtm.js} +7 -7
- package/dist/_chunks/{verify-identity-types-C85EXNzy.js → verify-identity-types-D_LdByCp.js} +2 -2
- package/dist/_chunks/{widget-picker-U4JsEhQE.js → widget-picker-DrxJjEkv.js} +2 -2
- package/dist/_chunks/{workflow-map-B4XkcET0.js → workflow-map-D-u8_YSr.js} +2 -2
- package/dist/_chunks/{workflow-status-9wb7iWUd.js → workflow-status-fykpTxfb.js} +2 -2
- package/dist/_chunks/{workflow-webhook-action-DNSe65yd.js → workflow-webhook-action-DM3W8XZE.js} +2 -2
- package/dist/agent-catalog.json +1080 -1
- package/dist/agent-i18n/en.json +50 -0
- package/dist/components/_shared/accessible-target.d.ts +12 -0
- package/dist/components/_shared/decimal.d.ts +171 -0
- package/dist/components/_shared/format-price.d.ts +54 -2
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/bill-line-table/bill-line-table.agent.d.ts +4 -0
- package/dist/components/bill-line-table/bill-line-table.columns.d.ts +47 -0
- package/dist/components/bill-line-table/bill-line-table.d.ts +4 -0
- package/dist/components/bill-line-table/bill-line-table.model.d.ts +173 -0
- package/dist/components/bill-line-table/bill-line-table.types.d.ts +443 -0
- package/dist/components/bill-line-table/bill-line-table.variants.d.ts +34 -0
- package/dist/components/bill-line-table/index.d.ts +6 -0
- package/dist/components/bill-line-table/index.js +23 -0
- package/dist/components/bill-table/bill-table.agent.d.ts +4 -0
- package/dist/components/bill-table/bill-table.d.ts +13 -0
- package/dist/components/bill-table/bill-table.variants.d.ts +55 -0
- package/dist/components/bill-table/cells.d.ts +89 -0
- package/dist/components/bill-table/columns.d.ts +21 -0
- package/dist/components/bill-table/default-tabs.d.ts +21 -0
- package/dist/components/bill-table/handle.d.ts +19 -0
- package/dist/components/bill-table/index.d.ts +7 -0
- package/dist/components/bill-table/index.js +19 -0
- package/dist/components/bill-table/model.d.ts +103 -0
- package/dist/components/bill-table/row-actions.d.ts +27 -0
- package/dist/components/bill-table/status-maps.d.ts +225 -0
- package/dist/components/bill-table/types.d.ts +542 -0
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts +59 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dashboard-grid/index.js +1 -1
- package/dist/components/data-grid/body.d.ts +6 -0
- package/dist/components/data-grid/data-grid.variants.d.ts +1 -9
- package/dist/components/data-grid/editors.d.ts +7 -1
- package/dist/components/data-grid/index.js +9 -8
- package/dist/components/data-grid/selection.d.ts +10 -0
- package/dist/components/data-grid/types.d.ts +61 -11
- package/dist/components/data-grid-tabs/index.js +1 -1
- package/dist/components/data-table/index.js +4 -4
- package/dist/components/dialog/focus-return.d.ts +12 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -0
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/money/index.js +1 -1
- package/dist/components/money/money.d.ts +39 -6
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/number-input/index.d.ts +2 -2
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/number-input.d.ts +43 -2
- package/dist/components/number-input/use-locale-number.d.ts +67 -3
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/row-actions/index.d.ts +3 -0
- package/dist/components/row-actions/index.js +5 -0
- package/dist/components/row-actions/row-actions.d.ts +63 -0
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/smart-date/smart-date.d.ts +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/token-insert-menu/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/decimal/index.js +149 -0
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +248 -0
- package/dist/i18n/locales/ar.js +249 -1
- package/dist/i18n/locales/de.d.ts +248 -0
- package/dist/i18n/locales/de.js +249 -1
- package/dist/i18n/locales/el.d.ts +248 -0
- package/dist/i18n/locales/el.js +249 -1
- package/dist/i18n/locales/en.d.ts +248 -0
- package/dist/i18n/locales/en.js +249 -1
- package/dist/i18n/locales/es.d.ts +248 -0
- package/dist/i18n/locales/es.js +249 -1
- package/dist/i18n/locales/fr.d.ts +248 -0
- package/dist/i18n/locales/fr.js +249 -1
- package/dist/i18n/locales/hi.d.ts +248 -0
- package/dist/i18n/locales/hi.js +249 -1
- package/dist/i18n/locales/it.d.ts +248 -0
- package/dist/i18n/locales/it.js +249 -1
- package/dist/i18n/locales/ja.d.ts +248 -0
- package/dist/i18n/locales/ja.js +249 -1
- package/dist/i18n/locales/nl.d.ts +248 -0
- package/dist/i18n/locales/nl.js +249 -1
- package/dist/i18n/locales/pl.d.ts +248 -0
- package/dist/i18n/locales/pl.js +249 -1
- package/dist/i18n/locales/pt.d.ts +248 -0
- package/dist/i18n/locales/pt.js +249 -1
- package/dist/i18n/locales/ro.d.ts +248 -0
- package/dist/i18n/locales/ro.js +249 -1
- package/dist/i18n/locales/ru.d.ts +248 -0
- package/dist/i18n/locales/ru.js +249 -1
- package/dist/i18n/locales/sq.d.ts +248 -0
- package/dist/i18n/locales/sq.js +249 -1
- package/dist/i18n/locales/sv.d.ts +248 -0
- package/dist/i18n/locales/sv.js +249 -1
- package/dist/i18n/locales/tr.d.ts +248 -0
- package/dist/i18n/locales/tr.js +249 -1
- package/dist/i18n/locales/zh.d.ts +248 -0
- package/dist/i18n/locales/zh.js +249 -1
- package/dist/index.js +1298 -1246
- package/dist/locales/ar.json +249 -1
- package/dist/locales/de.json +249 -1
- package/dist/locales/el.json +249 -1
- package/dist/locales/en.json +249 -1
- package/dist/locales/es.json +249 -1
- package/dist/locales/fr.json +249 -1
- package/dist/locales/hi.json +249 -1
- package/dist/locales/it.json +249 -1
- package/dist/locales/ja.json +249 -1
- package/dist/locales/nl.json +249 -1
- package/dist/locales/pl.json +249 -1
- package/dist/locales/pt.json +249 -1
- package/dist/locales/ro.json +249 -1
- package/dist/locales/ru.json +249 -1
- package/dist/locales/sq.json +249 -1
- package/dist/locales/sv.json +249 -1
- package/dist/locales/tr.json +249 -1
- package/dist/locales/zh.json +249 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/verify-identity/index.js +1 -1
- package/dist/patterns/workflow-webhook-action/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/combobox-duuDRI1t.js +0 -688
- package/dist/_chunks/dialog-BTjSQjdY.js +0 -274
- package/dist/_chunks/format-price-BcFBa-WP.js +0 -52
- package/dist/_chunks/money-Tsczpjfz.js +0 -102
- package/dist/_chunks/number-input-CVwI1ltI.js +0 -423
- package/dist/_chunks/parts-Wz2LeGnH.js +0 -1113
- package/dist/_chunks/undo-2-CYNAzclj.js +0 -26
|
@@ -0,0 +1,2250 @@
|
|
|
1
|
+
import { jsxs as T, jsx as l, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Ee, useMemo as M, createElement as ft, forwardRef as yt, useRef as K, useState as ht, useImperativeHandle as gt, useCallback as Tt } from "react";
|
|
3
|
+
import { useTranslation as v } from "react-i18next";
|
|
4
|
+
import { u as St } from "./registry-DvAUVLHh.js";
|
|
5
|
+
import { D as vt, e as wt } from "./data-grid-ByhrYGVw.js";
|
|
6
|
+
import { D as N } from "./toolbar-DbUQBrq4.js";
|
|
7
|
+
import { I as It } from "./icon-button-group-Ca2VkXy5.js";
|
|
8
|
+
import { c as w } from "./index-D2ZczOXr.js";
|
|
9
|
+
import { b as kt, a as Nt } from "./accessible-target-Bs9ELM3l.js";
|
|
10
|
+
import { R as Lt } from "./row-actions-Df7TJbNR.js";
|
|
11
|
+
import { V as Be } from "./visually-hidden-BHxEUGyT.js";
|
|
12
|
+
import { B as At } from "./badge-BUk4RjTS.js";
|
|
13
|
+
import { B as Ot } from "./button-DohK_Ak_.js";
|
|
14
|
+
import { I as _t } from "./icon-button-S8_weU3g.js";
|
|
15
|
+
import { I as Dt } from "./info-tip-C-MPkShR.js";
|
|
16
|
+
import { M as oe } from "./money-OE6_oDPH.js";
|
|
17
|
+
import { P as F } from "./popover-CN5IsOeS.js";
|
|
18
|
+
import { a as Ct } from "./format-number-DdzqwMs1.js";
|
|
19
|
+
import { decimalToNumber as Rt } from "../decimal/index.js";
|
|
20
|
+
import { f as Pt } from "./intl-locale-FWh-Y5_3.js";
|
|
21
|
+
import { I as Et } from "./info-CGn22peZ.js";
|
|
22
|
+
import { A as Bt } from "./arrow-down-left-DECv-dJt.js";
|
|
23
|
+
import { A as xt } from "./arrow-up-right-C2v_MKsK.js";
|
|
24
|
+
import { i as Ft } from "./is-development-CLUAnsU7.js";
|
|
25
|
+
import { F as xe } from "./file-text-5yv6r2ls.js";
|
|
26
|
+
import { c as le } from "./createLucideIcon-DhHxpK9K.js";
|
|
27
|
+
import { P as Wt } from "./pencil-B1sKKyuT.js";
|
|
28
|
+
import { C as Mt } from "./circle-off-DuT9pVy2.js";
|
|
29
|
+
import { U as Ut } from "./undo-2-EBxWjj1W.js";
|
|
30
|
+
import { T as Kt } from "./trash-2-uumy3fy1.js";
|
|
31
|
+
/**
|
|
32
|
+
* @license lucide-react v1.22.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const Vt = [
|
|
38
|
+
[
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
42
|
+
key: "1oefj6"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
|
|
46
|
+
["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
|
|
47
|
+
["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
|
|
48
|
+
], Fe = le("file-code", Vt);
|
|
49
|
+
/**
|
|
50
|
+
* @license lucide-react v1.22.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/
|
|
55
|
+
const zt = [
|
|
56
|
+
["path", { d: "M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17", key: "geh8rc" }],
|
|
57
|
+
[
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
d: "m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",
|
|
61
|
+
key: "1fto5m"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
["path", { d: "m2 16 6 6", key: "1pfhp9" }],
|
|
65
|
+
["circle", { cx: "16", cy: "9", r: "2.9", key: "1n0dlu" }],
|
|
66
|
+
["circle", { cx: "6", cy: "5", r: "3", key: "151irh" }]
|
|
67
|
+
], jt = le("hand-coins", zt);
|
|
68
|
+
/**
|
|
69
|
+
* @license lucide-react v1.22.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/
|
|
74
|
+
const qt = [
|
|
75
|
+
["path", { d: "M12 22V12", key: "d0xqtd" }],
|
|
76
|
+
["path", { d: "M16 17h6", key: "1ook5g" }],
|
|
77
|
+
["path", { d: "M19 14v6", key: "1ckrd5" }],
|
|
78
|
+
[
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
81
|
+
d: "M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955",
|
|
82
|
+
key: "28k6lz"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
["path", { d: "M3.29 7 12 12l8.71-5", key: "19ckod" }],
|
|
86
|
+
["path", { d: "m7.5 4.27 8.997 5.148", key: "9yrvtv" }]
|
|
87
|
+
], $t = le("package-plus", qt), Ht = ["number", "date", "counterparty", "amount"], Yt = ["incoming", "outgoing"], Zt = [
|
|
88
|
+
"paid",
|
|
89
|
+
"partiallyPaid",
|
|
90
|
+
"unpaid",
|
|
91
|
+
"overdue",
|
|
92
|
+
"writtenOff",
|
|
93
|
+
"noPaymentDue"
|
|
94
|
+
], Gt = [
|
|
95
|
+
"notSent",
|
|
96
|
+
"sending",
|
|
97
|
+
"pending",
|
|
98
|
+
"accepted",
|
|
99
|
+
"delivered",
|
|
100
|
+
"notDelivered",
|
|
101
|
+
"rejected",
|
|
102
|
+
"received"
|
|
103
|
+
], Xt = ["notLoaded", "toReview", "loaded"], Qt = ["full", "partial", "credit", "proforma", "other"], Jt = [25, 50, 100], ei = [
|
|
104
|
+
"date",
|
|
105
|
+
"direction",
|
|
106
|
+
"counterparty",
|
|
107
|
+
"amount",
|
|
108
|
+
"paymentStatus",
|
|
109
|
+
"sdiStatus",
|
|
110
|
+
"warehouseStatus"
|
|
111
|
+
], ti = /* @__PURE__ */ new Set([
|
|
112
|
+
"date",
|
|
113
|
+
"direction",
|
|
114
|
+
"amount",
|
|
115
|
+
"paymentStatus",
|
|
116
|
+
"sdiStatus",
|
|
117
|
+
"warehouseStatus",
|
|
118
|
+
"datePreset",
|
|
119
|
+
"type",
|
|
120
|
+
"number",
|
|
121
|
+
"prefix",
|
|
122
|
+
"withInsuranceNet",
|
|
123
|
+
"withVat",
|
|
124
|
+
"withTaxAtSource",
|
|
125
|
+
"withWelfareFundContribution",
|
|
126
|
+
"withUnpaidAmount",
|
|
127
|
+
"writtenOff",
|
|
128
|
+
"taxOfficeNotification",
|
|
129
|
+
"receivedFromSdi",
|
|
130
|
+
"sentToSdi",
|
|
131
|
+
"selfBill",
|
|
132
|
+
"liabilityDate",
|
|
133
|
+
"sdiEntryDate",
|
|
134
|
+
"relationType",
|
|
135
|
+
"insurance"
|
|
136
|
+
]), We = { masked: !0 };
|
|
137
|
+
function C(e, t) {
|
|
138
|
+
throw new Error(`${e}: ${t}`);
|
|
139
|
+
}
|
|
140
|
+
function R(e, t) {
|
|
141
|
+
e.getRowIds().includes(t) || C("UNKNOWN_ROW", `no bill "${t}" on the current page.`);
|
|
142
|
+
}
|
|
143
|
+
const W = (e) => ({
|
|
144
|
+
type: "object",
|
|
145
|
+
properties: {
|
|
146
|
+
type: { const: "set" },
|
|
147
|
+
values: { type: "array", items: { enum: [...e] } }
|
|
148
|
+
},
|
|
149
|
+
required: ["type", "values"],
|
|
150
|
+
additionalProperties: !1
|
|
151
|
+
}), ee = {
|
|
152
|
+
type: "object",
|
|
153
|
+
properties: {
|
|
154
|
+
type: { const: "inRange" },
|
|
155
|
+
dateFrom: { type: ["string", "null"], format: "date" },
|
|
156
|
+
dateTo: { type: ["string", "null"], format: "date" }
|
|
157
|
+
},
|
|
158
|
+
required: ["type", "dateFrom", "dateTo"],
|
|
159
|
+
additionalProperties: !1
|
|
160
|
+
}, A = {
|
|
161
|
+
type: "boolean",
|
|
162
|
+
description: "true = yes, false = no; leave the key out for either."
|
|
163
|
+
}, Me = {
|
|
164
|
+
type: "object",
|
|
165
|
+
additionalProperties: !1,
|
|
166
|
+
properties: {
|
|
167
|
+
date: ee,
|
|
168
|
+
direction: W(Yt),
|
|
169
|
+
amount: {
|
|
170
|
+
type: "object",
|
|
171
|
+
description: "Amount in major units (12.50), as on the platform form.",
|
|
172
|
+
properties: {
|
|
173
|
+
type: {
|
|
174
|
+
enum: ["inRange", "greaterThanOrEqual", "lessThanOrEqual", "equals"]
|
|
175
|
+
},
|
|
176
|
+
filter: { type: "number" },
|
|
177
|
+
filterTo: { type: "number" }
|
|
178
|
+
},
|
|
179
|
+
required: ["type"],
|
|
180
|
+
additionalProperties: !1
|
|
181
|
+
},
|
|
182
|
+
paymentStatus: W(Zt),
|
|
183
|
+
sdiStatus: W(Gt),
|
|
184
|
+
warehouseStatus: W(Xt),
|
|
185
|
+
datePreset: { enum: ["today", "thisMonth", "thisYear"] },
|
|
186
|
+
type: W(Qt),
|
|
187
|
+
number: { type: "string" },
|
|
188
|
+
prefix: { type: "string" },
|
|
189
|
+
withInsuranceNet: A,
|
|
190
|
+
withVat: A,
|
|
191
|
+
withTaxAtSource: A,
|
|
192
|
+
withWelfareFundContribution: A,
|
|
193
|
+
withUnpaidAmount: A,
|
|
194
|
+
writtenOff: A,
|
|
195
|
+
taxOfficeNotification: A,
|
|
196
|
+
receivedFromSdi: A,
|
|
197
|
+
sentToSdi: A,
|
|
198
|
+
selfBill: A,
|
|
199
|
+
liabilityDate: ee,
|
|
200
|
+
sdiEntryDate: ee,
|
|
201
|
+
relationType: { enum: ["patient", "company", "operator"] },
|
|
202
|
+
insurance: { type: "string" }
|
|
203
|
+
}
|
|
204
|
+
}, ii = new Set(
|
|
205
|
+
Object.keys(Me.properties)
|
|
206
|
+
);
|
|
207
|
+
function ai(e) {
|
|
208
|
+
const t = { ...e.getFilter() };
|
|
209
|
+
if (!e.getFeatures().privacyMode)
|
|
210
|
+
return t;
|
|
211
|
+
const a = {};
|
|
212
|
+
for (const [s, c] of Object.entries(t))
|
|
213
|
+
a[s] = ti.has(s) ? c : We;
|
|
214
|
+
return a;
|
|
215
|
+
}
|
|
216
|
+
const V = {
|
|
217
|
+
type: "object",
|
|
218
|
+
properties: { id: { type: "string", description: "A bill id (rows)." } },
|
|
219
|
+
required: ["id"],
|
|
220
|
+
additionalProperties: !1
|
|
221
|
+
}, ni = {
|
|
222
|
+
id: "bill-table",
|
|
223
|
+
capabilities: [
|
|
224
|
+
"select_multiple",
|
|
225
|
+
"range_pick",
|
|
226
|
+
"filter",
|
|
227
|
+
"sort",
|
|
228
|
+
"paginate",
|
|
229
|
+
"view_change",
|
|
230
|
+
"scroll",
|
|
231
|
+
// open_bill moves to the bill page (26 section 4: `navigate`).
|
|
232
|
+
"navigate",
|
|
233
|
+
// load_into_warehouse opens the HTP-7311 dialog (`open`: a Dialog).
|
|
234
|
+
// download_bill fits no capability exactly (a file request): the
|
|
235
|
+
// agent-readiness-auditor rules on it.
|
|
236
|
+
"open"
|
|
237
|
+
],
|
|
238
|
+
state: {
|
|
239
|
+
features: {
|
|
240
|
+
type: "{ selectable, privacyMode, showWarehouseStatus, sortableColumns, status }",
|
|
241
|
+
descriptionKey: "ui.agent.billTable.state.features",
|
|
242
|
+
description: "What this bill list can do now: selection, privacy mode, the warehouse column, sortable columns and loading status.",
|
|
243
|
+
read: (e) => e.getFeatures()
|
|
244
|
+
},
|
|
245
|
+
rows: {
|
|
246
|
+
type: "Array<{ id, number, type, date, direction, counterpartyKind, counterpartyName?, amountMinor, paymentStatus, sdiStatus, warehouseStatus, actions }>",
|
|
247
|
+
descriptionKey: "ui.agent.billTable.state.rows",
|
|
248
|
+
description: "The bills on the current page, amounts in hundredths. A counterparty name is given only for companies; patients and other people are never named.",
|
|
249
|
+
read: (e) => e.getRowSummaries()
|
|
250
|
+
},
|
|
251
|
+
selection: {
|
|
252
|
+
type: "string[]",
|
|
253
|
+
descriptionKey: "ui.agent.billTable.state.selection",
|
|
254
|
+
description: "Ids of the selected bills, on every page.",
|
|
255
|
+
read: (e) => e.getSelection()
|
|
256
|
+
},
|
|
257
|
+
sort: {
|
|
258
|
+
type: "Array<{ colId, sort }>",
|
|
259
|
+
descriptionKey: "ui.agent.billTable.state.sort",
|
|
260
|
+
description: "The active sort, as the server receives it. A counterparty sort is left out while privacy mode is on.",
|
|
261
|
+
read: (e) => e.getQuery().sorting
|
|
262
|
+
},
|
|
263
|
+
filter: {
|
|
264
|
+
type: "object",
|
|
265
|
+
descriptionKey: "ui.agent.billTable.state.filter",
|
|
266
|
+
description: "The active filters. Under privacy mode, filters that can point at a person read { masked: true }.",
|
|
267
|
+
read: (e) => ai(e)
|
|
268
|
+
},
|
|
269
|
+
quickFilter: {
|
|
270
|
+
type: "'' | { masked: true }",
|
|
271
|
+
descriptionKey: "ui.agent.billTable.state.quickFilter",
|
|
272
|
+
description: "Empty when no quick search is set; otherwise { masked: true }, since the text may be a name. Set it with set_quick_filter.",
|
|
273
|
+
// Masked in both modes: a person's name typed here must not reach
|
|
274
|
+
// agent state, privacy mode or not.
|
|
275
|
+
read: (e) => e.getQuickFilter() === "" ? "" : We
|
|
276
|
+
},
|
|
277
|
+
currentPage: {
|
|
278
|
+
type: "number",
|
|
279
|
+
descriptionKey: "ui.agent.billTable.state.currentPage",
|
|
280
|
+
description: "Zero-based page index.",
|
|
281
|
+
read: (e) => e.getQuery().pagination.pageIndex
|
|
282
|
+
},
|
|
283
|
+
pageSize: {
|
|
284
|
+
type: "number",
|
|
285
|
+
descriptionKey: "ui.agent.billTable.state.pageSize",
|
|
286
|
+
description: "Bills per page.",
|
|
287
|
+
read: (e) => e.getQuery().pagination.pageSize
|
|
288
|
+
},
|
|
289
|
+
pageCount: {
|
|
290
|
+
type: "number",
|
|
291
|
+
descriptionKey: "ui.agent.billTable.state.pageCount",
|
|
292
|
+
description: "Number of pages; -1 when the total is unknown.",
|
|
293
|
+
read: (e) => e.getPageCount()
|
|
294
|
+
},
|
|
295
|
+
rowCount: {
|
|
296
|
+
type: "number",
|
|
297
|
+
descriptionKey: "ui.agent.billTable.state.rowCount",
|
|
298
|
+
description: "Bills matching the filters, on every page; -1 when unknown.",
|
|
299
|
+
read: (e) => e.getRowCount()
|
|
300
|
+
},
|
|
301
|
+
columns: {
|
|
302
|
+
type: "Array<{ id, label, visible, canHide, sortable, masked }>",
|
|
303
|
+
descriptionKey: "ui.agent.billTable.state.columns",
|
|
304
|
+
description: "The columns, in display order.",
|
|
305
|
+
read: (e) => e.getColumns()
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
actions: {
|
|
309
|
+
select_rows: {
|
|
310
|
+
safety: "read",
|
|
311
|
+
argsType: "{ ids: string[] }",
|
|
312
|
+
argsSchema: {
|
|
313
|
+
type: "object",
|
|
314
|
+
properties: { ids: { type: "array", items: { type: "string" } } },
|
|
315
|
+
required: ["ids"],
|
|
316
|
+
additionalProperties: !1
|
|
317
|
+
},
|
|
318
|
+
returns: "string[]",
|
|
319
|
+
idempotent: !0,
|
|
320
|
+
errors: ["SELECTION_DISABLED: the list is read-only."],
|
|
321
|
+
descriptionKey: "ui.agent.billTable.actions.selectRows",
|
|
322
|
+
description: "Replace the selection with the given bill ids. Changing a filter or the search clears it.",
|
|
323
|
+
invoke: (e, t) => (e.getFeatures().selectable || C("SELECTION_DISABLED", "this list has no selection."), e.setSelection(t.ids), e.getSelection())
|
|
324
|
+
},
|
|
325
|
+
select_range: {
|
|
326
|
+
safety: "read",
|
|
327
|
+
argsType: "{ fromId: string, toId: string }",
|
|
328
|
+
argsSchema: {
|
|
329
|
+
type: "object",
|
|
330
|
+
properties: { fromId: { type: "string" }, toId: { type: "string" } },
|
|
331
|
+
required: ["fromId", "toId"],
|
|
332
|
+
additionalProperties: !1
|
|
333
|
+
},
|
|
334
|
+
idempotent: !0,
|
|
335
|
+
errors: [
|
|
336
|
+
"SELECTION_DISABLED: the list is read-only.",
|
|
337
|
+
"UNKNOWN_ROW: fromId or toId is not on the current page."
|
|
338
|
+
],
|
|
339
|
+
descriptionKey: "ui.agent.billTable.actions.selectRange",
|
|
340
|
+
description: "Select every bill from fromId to toId on the current page, inclusive.",
|
|
341
|
+
invoke: (e, t) => {
|
|
342
|
+
e.getFeatures().selectable || C("SELECTION_DISABLED", "this list has no selection."), R(e, t.fromId), R(e, t.toId), e.selectRange(t.fromId, t.toId);
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
clear_selection: {
|
|
346
|
+
safety: "read",
|
|
347
|
+
idempotent: !0,
|
|
348
|
+
descriptionKey: "ui.agent.billTable.actions.clearSelection",
|
|
349
|
+
description: "Clear the selection on every page.",
|
|
350
|
+
invoke: (e) => e.clearSelection()
|
|
351
|
+
},
|
|
352
|
+
sort_by: {
|
|
353
|
+
safety: "read",
|
|
354
|
+
openWorld: !0,
|
|
355
|
+
argsType: '{ colId: "number" | "date" | "counterparty" | "amount", sort: "asc" | "desc" }',
|
|
356
|
+
argsSchema: {
|
|
357
|
+
type: "object",
|
|
358
|
+
properties: {
|
|
359
|
+
colId: { enum: [...Ht] },
|
|
360
|
+
sort: { enum: ["asc", "desc"] }
|
|
361
|
+
},
|
|
362
|
+
required: ["colId", "sort"],
|
|
363
|
+
additionalProperties: !1
|
|
364
|
+
},
|
|
365
|
+
idempotent: !0,
|
|
366
|
+
errors: [
|
|
367
|
+
"SORT_DISABLED: the server cannot sort this column (features.sortableColumns).",
|
|
368
|
+
"COLUMN_MASKED: counterparty cannot be sorted while privacy mode is on."
|
|
369
|
+
],
|
|
370
|
+
examples: [{ args: { colId: "amount", sort: "desc" } }],
|
|
371
|
+
descriptionKey: "ui.agent.billTable.actions.sortBy",
|
|
372
|
+
description: "Sort the bills by one column. The host fetches the first page again.",
|
|
373
|
+
invoke: (e, t) => {
|
|
374
|
+
e.getFeatures().sortableColumns.includes(t.colId) || C("SORT_DISABLED", `column "${t.colId}" does not sort.`);
|
|
375
|
+
const s = e.getColumns().find((c) => c.id === t.colId);
|
|
376
|
+
s != null && s.masked && C("COLUMN_MASKED", `"${t.colId}" is hidden by privacy mode.`), e.setSort([{ colId: t.colId, sort: t.sort }]);
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
apply_filter: {
|
|
380
|
+
safety: "read",
|
|
381
|
+
openWorld: !0,
|
|
382
|
+
argsType: "{ model: BillTableFilterModel }",
|
|
383
|
+
argsSchema: {
|
|
384
|
+
type: "object",
|
|
385
|
+
properties: { model: Me },
|
|
386
|
+
required: ["model"],
|
|
387
|
+
additionalProperties: !1
|
|
388
|
+
},
|
|
389
|
+
idempotent: !0,
|
|
390
|
+
errors: [
|
|
391
|
+
"UNKNOWN_FILTER: a key is not a bill filter.",
|
|
392
|
+
"Changing filters clears the selection."
|
|
393
|
+
],
|
|
394
|
+
examples: [
|
|
395
|
+
{
|
|
396
|
+
args: {
|
|
397
|
+
model: {
|
|
398
|
+
sdiStatus: { type: "set", values: ["received"] },
|
|
399
|
+
warehouseStatus: { type: "set", values: ["toReview"] }
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
note: "Bills from SDI that need a warehouse review."
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
descriptionKey: "ui.agent.billTable.actions.applyFilter",
|
|
406
|
+
description: "Replace the filters. The host fetches the first page again.",
|
|
407
|
+
invoke: (e, t) => {
|
|
408
|
+
for (const a of Object.keys(t.model))
|
|
409
|
+
ii.has(a) || C("UNKNOWN_FILTER", `"${a}" is not a bill filter.`);
|
|
410
|
+
e.setFilter(t.model);
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
set_quick_filter: {
|
|
414
|
+
safety: "read",
|
|
415
|
+
openWorld: !0,
|
|
416
|
+
argsType: "{ text: string }",
|
|
417
|
+
argsSchema: {
|
|
418
|
+
type: "object",
|
|
419
|
+
properties: { text: { type: "string" } },
|
|
420
|
+
required: ["text"],
|
|
421
|
+
additionalProperties: !1
|
|
422
|
+
},
|
|
423
|
+
idempotent: !0,
|
|
424
|
+
errors: ["Changing the search clears the selection."],
|
|
425
|
+
descriptionKey: "ui.agent.billTable.actions.setQuickFilter",
|
|
426
|
+
description: "Search by bill number, and by counterparty name unless privacy mode is on.",
|
|
427
|
+
invoke: (e, t) => e.setQuickFilter(t.text)
|
|
428
|
+
},
|
|
429
|
+
clear_filters: {
|
|
430
|
+
safety: "read",
|
|
431
|
+
openWorld: !0,
|
|
432
|
+
idempotent: !0,
|
|
433
|
+
descriptionKey: "ui.agent.billTable.actions.clearFilters",
|
|
434
|
+
description: "Remove every filter and the quick search.",
|
|
435
|
+
invoke: (e) => e.clearFilters()
|
|
436
|
+
},
|
|
437
|
+
go_to_page: {
|
|
438
|
+
safety: "read",
|
|
439
|
+
openWorld: !0,
|
|
440
|
+
argsType: "{ pageIndex: number }",
|
|
441
|
+
argsSchema: {
|
|
442
|
+
type: "object",
|
|
443
|
+
properties: { pageIndex: { type: "integer", minimum: 0 } },
|
|
444
|
+
required: ["pageIndex"],
|
|
445
|
+
additionalProperties: !1
|
|
446
|
+
},
|
|
447
|
+
idempotent: !0,
|
|
448
|
+
descriptionKey: "ui.agent.billTable.actions.goToPage",
|
|
449
|
+
description: "Go to a zero-based page.",
|
|
450
|
+
invoke: (e, t) => e.goToPage(t.pageIndex)
|
|
451
|
+
},
|
|
452
|
+
set_page_size: {
|
|
453
|
+
safety: "read",
|
|
454
|
+
openWorld: !0,
|
|
455
|
+
argsType: "{ size: 25 | 50 | 100 }",
|
|
456
|
+
argsSchema: {
|
|
457
|
+
type: "object",
|
|
458
|
+
properties: { size: { enum: [...Jt] } },
|
|
459
|
+
required: ["size"],
|
|
460
|
+
additionalProperties: !1
|
|
461
|
+
},
|
|
462
|
+
idempotent: !0,
|
|
463
|
+
descriptionKey: "ui.agent.billTable.actions.setPageSize",
|
|
464
|
+
description: "Change how many bills show per page.",
|
|
465
|
+
invoke: (e, t) => e.setPageSize(t.size)
|
|
466
|
+
},
|
|
467
|
+
scroll_to_row: {
|
|
468
|
+
safety: "read",
|
|
469
|
+
argsType: "{ id: string }",
|
|
470
|
+
argsSchema: V,
|
|
471
|
+
idempotent: !0,
|
|
472
|
+
errors: ["UNKNOWN_ROW: the id is not on the current page."],
|
|
473
|
+
descriptionKey: "ui.agent.billTable.actions.scrollToRow",
|
|
474
|
+
description: "Scroll a bill on the current page into view.",
|
|
475
|
+
invoke: (e, t) => {
|
|
476
|
+
R(e, t.id), e.scrollToRow(t.id);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
set_column_visibility: {
|
|
480
|
+
safety: "write",
|
|
481
|
+
argsType: "{ id: string, visible: boolean }",
|
|
482
|
+
argsSchema: {
|
|
483
|
+
type: "object",
|
|
484
|
+
properties: {
|
|
485
|
+
id: { enum: [...ei] },
|
|
486
|
+
visible: { type: "boolean" }
|
|
487
|
+
},
|
|
488
|
+
required: ["id", "visible"],
|
|
489
|
+
additionalProperties: !1
|
|
490
|
+
},
|
|
491
|
+
idempotent: !0,
|
|
492
|
+
errors: [
|
|
493
|
+
"UNKNOWN_COLUMN: the column is not in this list (warehouseStatus needs the warehouse module).",
|
|
494
|
+
"NOT_HIDEABLE: number and actions always show."
|
|
495
|
+
],
|
|
496
|
+
descriptionKey: "ui.agent.billTable.actions.setColumnVisibility",
|
|
497
|
+
description: "Show or hide a column. The choice is saved for this list.",
|
|
498
|
+
invoke: (e, t) => {
|
|
499
|
+
const a = e.getColumns().find((s) => s.id === t.id);
|
|
500
|
+
a || C("UNKNOWN_COLUMN", `no column "${t.id}".`), a.canHide || C("NOT_HIDEABLE", `"${t.id}" always shows.`), e.setColumnVisible(t.id, t.visible);
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
reset_columns: {
|
|
504
|
+
safety: "destructive",
|
|
505
|
+
idempotent: !0,
|
|
506
|
+
descriptionKey: "ui.agent.billTable.actions.resetColumns",
|
|
507
|
+
description: "Put every column back to its default and delete the column choices saved for this list.",
|
|
508
|
+
invoke: (e) => e.resetColumns()
|
|
509
|
+
},
|
|
510
|
+
get_row_actions: {
|
|
511
|
+
safety: "read",
|
|
512
|
+
argsType: "{ id: string }",
|
|
513
|
+
argsSchema: V,
|
|
514
|
+
returns: 'Record<action, "enabled" | { disabled: reason }>',
|
|
515
|
+
idempotent: !0,
|
|
516
|
+
errors: ["UNKNOWN_ROW: the id is not on the current page."],
|
|
517
|
+
descriptionKey: "ui.agent.billTable.actions.getRowActions",
|
|
518
|
+
description: "Which actions one bill offers now, and why a disabled one is disabled.",
|
|
519
|
+
// The agent-safe projection (reason codes, a host's text as `host`),
|
|
520
|
+
// never `handle.getRowActions`, which carries the host's text.
|
|
521
|
+
invoke: (e, t) => {
|
|
522
|
+
var a;
|
|
523
|
+
return R(e, t.id), ((a = e.getRowSummaries().find((s) => s.id === t.id)) == null ? void 0 : a.actions) ?? {};
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
open_bill: {
|
|
527
|
+
safety: "read",
|
|
528
|
+
openWorld: !0,
|
|
529
|
+
argsType: "{ id: string }",
|
|
530
|
+
argsSchema: V,
|
|
531
|
+
errors: [
|
|
532
|
+
"UNKNOWN_ROW: the id is not on the current page.",
|
|
533
|
+
"ACTION_UNAVAILABLE: the bill offers no open action.",
|
|
534
|
+
"ACTION_DISABLED: followed by the reason code."
|
|
535
|
+
],
|
|
536
|
+
descriptionKey: "ui.agent.billTable.actions.openBill",
|
|
537
|
+
description: "Open one bill. The host shows its page.",
|
|
538
|
+
invoke: (e, t) => {
|
|
539
|
+
R(e, t.id), e.openBill(t.id);
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
download_bill: {
|
|
543
|
+
// A bill PDF or XML names the patient: a document with patient data
|
|
544
|
+
// leaves the UI for the device (signature-request precedent, phi).
|
|
545
|
+
safety: "phi",
|
|
546
|
+
openWorld: !0,
|
|
547
|
+
argsType: '{ id: string, format: "pdf" | "xml" }',
|
|
548
|
+
argsSchema: {
|
|
549
|
+
type: "object",
|
|
550
|
+
properties: {
|
|
551
|
+
id: { type: "string" },
|
|
552
|
+
format: { enum: ["pdf", "xml"] }
|
|
553
|
+
},
|
|
554
|
+
required: ["id", "format"],
|
|
555
|
+
additionalProperties: !1
|
|
556
|
+
},
|
|
557
|
+
errors: [
|
|
558
|
+
"UNKNOWN_ROW: the id is not on the current page.",
|
|
559
|
+
"ACTION_UNAVAILABLE: the bill offers no download in this format.",
|
|
560
|
+
"ACTION_DISABLED: followed by the reason code."
|
|
561
|
+
],
|
|
562
|
+
descriptionKey: "ui.agent.billTable.actions.downloadBill",
|
|
563
|
+
description: "Download one bill as a PDF or an electronic invoice (XML).",
|
|
564
|
+
invoke: (e, t) => {
|
|
565
|
+
R(e, t.id), e.downloadBill(t.id, t.format);
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
load_into_warehouse: {
|
|
569
|
+
// Opens the review dialog (or the upsell without the module);
|
|
570
|
+
// nothing loads until the user confirms there.
|
|
571
|
+
safety: "read",
|
|
572
|
+
openWorld: !0,
|
|
573
|
+
argsType: "{ id: string }",
|
|
574
|
+
argsSchema: V,
|
|
575
|
+
errors: [
|
|
576
|
+
"UNKNOWN_ROW: the id is not on the current page.",
|
|
577
|
+
"ACTION_UNAVAILABLE: not an incoming SDI bill.",
|
|
578
|
+
"ACTION_DISABLED: alreadyLoaded, when the bill is already in the warehouse."
|
|
579
|
+
],
|
|
580
|
+
descriptionKey: "ui.agent.billTable.actions.loadIntoWarehouse",
|
|
581
|
+
description: "Open the dialog that loads an incoming SDI bill's lines into the warehouse. Nothing loads until the user confirms.",
|
|
582
|
+
invoke: (e, t) => {
|
|
583
|
+
R(e, t.id), e.loadIntoWarehouse(t.id);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
domHooks: {
|
|
588
|
+
root: {
|
|
589
|
+
attr: "data-component",
|
|
590
|
+
value: "bill-table",
|
|
591
|
+
description: "Marks the element as a kit BillTable."
|
|
592
|
+
},
|
|
593
|
+
instanceId: {
|
|
594
|
+
attr: "data-component-id",
|
|
595
|
+
sourceProp: "gridId",
|
|
596
|
+
description: "Sourced from gridId (default accounting-bills)."
|
|
597
|
+
},
|
|
598
|
+
item: {
|
|
599
|
+
attr: "data-row-id",
|
|
600
|
+
description: "Opaque bill id on each row (DataGrid). Act through the handle, not the DOM."
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}, oi = w("ds:w-full ds:min-w-0", {
|
|
604
|
+
variants: {
|
|
605
|
+
height: {
|
|
606
|
+
auto: "ds:block",
|
|
607
|
+
fill: "ds:flex ds:min-h-0 ds:flex-auto ds:flex-col"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
defaultVariants: { height: "auto" }
|
|
611
|
+
}), q = w(
|
|
612
|
+
"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
613
|
+
{
|
|
614
|
+
variants: {
|
|
615
|
+
align: {
|
|
616
|
+
start: "ds:items-start",
|
|
617
|
+
end: "ds:items-end"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
defaultVariants: { align: "start" }
|
|
621
|
+
}
|
|
622
|
+
), j = w(
|
|
623
|
+
"type-meta ds:text-[color:var(--muted-foreground)]"
|
|
624
|
+
), re = w(
|
|
625
|
+
"ds:inline-flex ds:min-w-0 ds:max-w-full ds:items-center ds:gap-[var(--spacing-xs)]"
|
|
626
|
+
), li = w(
|
|
627
|
+
"ds:size-4 ds:shrink-0 ds:rtl:-scale-x-100"
|
|
628
|
+
), ri = w(
|
|
629
|
+
"ds:block ds:min-w-0 ds:max-w-full ds:truncate"
|
|
630
|
+
), si = w([
|
|
631
|
+
"ds:max-w-full ds:[--primary:var(--primary-readable)] ds:[--primary-hover:var(--primary-readable-hover)]",
|
|
632
|
+
"ds:[tr[data-selected]_&]:[--primary:var(--primary-readable-hover)]",
|
|
633
|
+
"ds:data-[component=button]:sm:before:block",
|
|
634
|
+
kt
|
|
635
|
+
]), di = w("ds:font-medium"), ci = w(
|
|
636
|
+
"ds:mt-[var(--spacing-sm)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
637
|
+
), ui = w(
|
|
638
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"
|
|
639
|
+
), pi = w("ds:m-0", {
|
|
640
|
+
variants: {
|
|
641
|
+
tone: {
|
|
642
|
+
muted: "ds:text-[color:var(--muted-foreground)]",
|
|
643
|
+
strong: "ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-sm)] ds:text-[color:var(--foreground)] ds:[font-weight:var(--font-weight-semibold)]"
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
defaultVariants: { tone: "muted" }
|
|
647
|
+
}), bi = w(
|
|
648
|
+
"ds:m-0 ds:grid ds:grid-cols-[1fr_auto] ds:items-baseline ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)]"
|
|
649
|
+
), mi = w(
|
|
650
|
+
"ds:m-0 ds:text-[color:var(--muted-foreground)]"
|
|
651
|
+
), fi = w("ds:m-0 ds:text-end"), $ = ["incoming", "outgoing"], xa = [
|
|
652
|
+
"full",
|
|
653
|
+
"partial",
|
|
654
|
+
"credit",
|
|
655
|
+
"proforma",
|
|
656
|
+
"other"
|
|
657
|
+
], yi = [
|
|
658
|
+
"paid",
|
|
659
|
+
"partiallyPaid",
|
|
660
|
+
"unpaid",
|
|
661
|
+
"overdue",
|
|
662
|
+
"writtenOff",
|
|
663
|
+
"noPaymentDue"
|
|
664
|
+
], hi = [
|
|
665
|
+
"notApplicable",
|
|
666
|
+
"notSent",
|
|
667
|
+
"sending",
|
|
668
|
+
"pending",
|
|
669
|
+
"accepted",
|
|
670
|
+
"delivered",
|
|
671
|
+
"notDelivered",
|
|
672
|
+
"rejected",
|
|
673
|
+
"received"
|
|
674
|
+
], gi = [
|
|
675
|
+
"notLoaded",
|
|
676
|
+
"toReview",
|
|
677
|
+
"loaded"
|
|
678
|
+
], Fa = [
|
|
679
|
+
"patient",
|
|
680
|
+
"person",
|
|
681
|
+
"company"
|
|
682
|
+
], Ue = [
|
|
683
|
+
"open",
|
|
684
|
+
"downloadPdf",
|
|
685
|
+
"downloadXml",
|
|
686
|
+
"loadIntoWarehouse",
|
|
687
|
+
"edit",
|
|
688
|
+
"recordPayment",
|
|
689
|
+
"writeOff",
|
|
690
|
+
"undoWriteOff",
|
|
691
|
+
"delete"
|
|
692
|
+
], Wa = [
|
|
693
|
+
"alreadyLoaded",
|
|
694
|
+
"sentToSdi",
|
|
695
|
+
"legalStorage",
|
|
696
|
+
"paymentAutomation",
|
|
697
|
+
"noPermission",
|
|
698
|
+
"inProgress"
|
|
699
|
+
], Ti = [
|
|
700
|
+
"number",
|
|
701
|
+
"date",
|
|
702
|
+
"direction",
|
|
703
|
+
"counterparty",
|
|
704
|
+
"amount",
|
|
705
|
+
"paymentStatus",
|
|
706
|
+
"sdiStatus",
|
|
707
|
+
"warehouseStatus",
|
|
708
|
+
"actions"
|
|
709
|
+
], Ke = [
|
|
710
|
+
"number",
|
|
711
|
+
"date",
|
|
712
|
+
"counterparty",
|
|
713
|
+
"amount"
|
|
714
|
+
], Ma = [
|
|
715
|
+
"csv",
|
|
716
|
+
"csvDetailed",
|
|
717
|
+
"pdfZip",
|
|
718
|
+
"pdfSingle",
|
|
719
|
+
"xmlOutgoingZip",
|
|
720
|
+
"xmlIncomingZip"
|
|
721
|
+
], Ua = [
|
|
722
|
+
"bills-this-year",
|
|
723
|
+
"bills-all",
|
|
724
|
+
"bills-incoming",
|
|
725
|
+
"bills-outgoing",
|
|
726
|
+
"bills-to-pay",
|
|
727
|
+
"bills-to-collect",
|
|
728
|
+
"bills-to-load"
|
|
729
|
+
], Si = "accounting-bills", vi = [
|
|
730
|
+
{ colId: "date", sort: "desc" }
|
|
731
|
+
], Ae = [25, 50, 100], H = 2, _ = { source: "user" }, te = { source: "api" };
|
|
732
|
+
function wi(e) {
|
|
733
|
+
return e.counterparty !== null && e.counterparty.kind !== "company";
|
|
734
|
+
}
|
|
735
|
+
function Ii(e) {
|
|
736
|
+
return Number.isSafeInteger(e) ? Rt({ units: e, scale: H }) : null;
|
|
737
|
+
}
|
|
738
|
+
const Oe = /* @__PURE__ */ new Map(), ki = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
739
|
+
function Ve(e, t) {
|
|
740
|
+
const a = ki.exec(e);
|
|
741
|
+
if (!a) return e;
|
|
742
|
+
const [, s, c, b] = a, i = new Date(
|
|
743
|
+
Date.UTC(Number(s), Number(c) - 1, Number(b))
|
|
744
|
+
);
|
|
745
|
+
if (Number.isNaN(i.getTime())) return e;
|
|
746
|
+
const n = Pt(t);
|
|
747
|
+
let o = Oe.get(n);
|
|
748
|
+
return o || (o = new Intl.DateTimeFormat(n, {
|
|
749
|
+
dateStyle: "medium",
|
|
750
|
+
timeZone: "UTC"
|
|
751
|
+
}), Oe.set(n, o)), o.format(i);
|
|
752
|
+
}
|
|
753
|
+
const Ni = new Set(Ke);
|
|
754
|
+
function Li(e) {
|
|
755
|
+
return Ni.has(e);
|
|
756
|
+
}
|
|
757
|
+
function ae(e) {
|
|
758
|
+
const t = [];
|
|
759
|
+
for (const a of e)
|
|
760
|
+
Li(a.colId) && t.push({ colId: a.colId, sort: a.sort });
|
|
761
|
+
return t;
|
|
762
|
+
}
|
|
763
|
+
function ze(e) {
|
|
764
|
+
return e.map((t) => `${t.colId}:${t.sort}`).join("|");
|
|
765
|
+
}
|
|
766
|
+
function Ai(e, t) {
|
|
767
|
+
return t && ze(e) === t.key ? t.raw : e;
|
|
768
|
+
}
|
|
769
|
+
const Oi = {
|
|
770
|
+
open: "onOpen",
|
|
771
|
+
downloadPdf: "onDownload",
|
|
772
|
+
downloadXml: "onDownload",
|
|
773
|
+
loadIntoWarehouse: "onLoadIntoWarehouse",
|
|
774
|
+
edit: "onEdit",
|
|
775
|
+
recordPayment: "onRecordPayment",
|
|
776
|
+
writeOff: "onWriteOff",
|
|
777
|
+
undoWriteOff: "onWriteOff",
|
|
778
|
+
delete: "onDelete"
|
|
779
|
+
};
|
|
780
|
+
function se(e, t) {
|
|
781
|
+
return typeof e[Oi[t]] == "function";
|
|
782
|
+
}
|
|
783
|
+
function je(e) {
|
|
784
|
+
return typeof e.disabled == "string" ? e.disabled : "host";
|
|
785
|
+
}
|
|
786
|
+
function _i(e, t, a, s) {
|
|
787
|
+
const c = {};
|
|
788
|
+
for (const b of Ue) {
|
|
789
|
+
const i = e.actions[b];
|
|
790
|
+
i === void 0 || !se(t, b) || (c[b] = a && i !== "enabled" && typeof i.disabled != "string" ? { disabled: { text: s } } : i);
|
|
791
|
+
}
|
|
792
|
+
return c;
|
|
793
|
+
}
|
|
794
|
+
function Di(e, t) {
|
|
795
|
+
const a = {};
|
|
796
|
+
for (const s of Ue) {
|
|
797
|
+
const c = e.actions[s];
|
|
798
|
+
c === void 0 || !se(t, s) || (a[s] = c === "enabled" ? "enabled" : { disabled: je(c) });
|
|
799
|
+
}
|
|
800
|
+
return a;
|
|
801
|
+
}
|
|
802
|
+
function Ci(e, t) {
|
|
803
|
+
var s, c;
|
|
804
|
+
const a = {
|
|
805
|
+
id: e.id,
|
|
806
|
+
number: e.number,
|
|
807
|
+
type: e.type,
|
|
808
|
+
date: e.date,
|
|
809
|
+
direction: e.direction,
|
|
810
|
+
counterpartyKind: ((s = e.counterparty) == null ? void 0 : s.kind) ?? null,
|
|
811
|
+
amountMinor: e.amountMinor,
|
|
812
|
+
paymentStatus: e.paymentStatus,
|
|
813
|
+
sdiStatus: e.sdiStatus,
|
|
814
|
+
warehouseStatus: e.warehouseStatus ?? null,
|
|
815
|
+
actions: Di(e, t)
|
|
816
|
+
};
|
|
817
|
+
return ((c = e.counterparty) == null ? void 0 : c.kind) === "company" && (a.counterpartyName = e.counterparty.name), a;
|
|
818
|
+
}
|
|
819
|
+
const qe = {
|
|
820
|
+
paid: { key: "billTable.paymentStatus.paid", en: "Paid", variant: "success" },
|
|
821
|
+
partiallyPaid: {
|
|
822
|
+
key: "billTable.paymentStatus.partiallyPaid",
|
|
823
|
+
en: "Partly paid",
|
|
824
|
+
variant: "warning"
|
|
825
|
+
},
|
|
826
|
+
unpaid: {
|
|
827
|
+
key: "billTable.paymentStatus.unpaid",
|
|
828
|
+
en: "Unpaid",
|
|
829
|
+
variant: "warning"
|
|
830
|
+
},
|
|
831
|
+
overdue: {
|
|
832
|
+
key: "billTable.paymentStatus.overdue",
|
|
833
|
+
en: "Overdue",
|
|
834
|
+
variant: "error"
|
|
835
|
+
},
|
|
836
|
+
writtenOff: {
|
|
837
|
+
key: "billTable.paymentStatus.writtenOff",
|
|
838
|
+
en: "Written off",
|
|
839
|
+
variant: "neutral"
|
|
840
|
+
},
|
|
841
|
+
noPaymentDue: {
|
|
842
|
+
key: "billTable.paymentStatus.noPaymentDue",
|
|
843
|
+
en: "No payment due",
|
|
844
|
+
variant: "neutral"
|
|
845
|
+
}
|
|
846
|
+
}, $e = {
|
|
847
|
+
notSent: {
|
|
848
|
+
key: "billTable.sdiStatus.notSent",
|
|
849
|
+
en: "Not sent",
|
|
850
|
+
variant: "neutral"
|
|
851
|
+
},
|
|
852
|
+
sending: {
|
|
853
|
+
key: "billTable.sdiStatus.sending",
|
|
854
|
+
en: "Sending",
|
|
855
|
+
variant: "info"
|
|
856
|
+
},
|
|
857
|
+
pending: {
|
|
858
|
+
key: "billTable.sdiStatus.pending",
|
|
859
|
+
en: "Awaiting SDI",
|
|
860
|
+
variant: "warning"
|
|
861
|
+
},
|
|
862
|
+
accepted: {
|
|
863
|
+
key: "billTable.sdiStatus.accepted",
|
|
864
|
+
en: "Accepted",
|
|
865
|
+
variant: "success"
|
|
866
|
+
},
|
|
867
|
+
delivered: {
|
|
868
|
+
key: "billTable.sdiStatus.delivered",
|
|
869
|
+
en: "Delivered",
|
|
870
|
+
variant: "success"
|
|
871
|
+
},
|
|
872
|
+
notDelivered: {
|
|
873
|
+
key: "billTable.sdiStatus.notDelivered",
|
|
874
|
+
en: "Not delivered",
|
|
875
|
+
variant: "warning"
|
|
876
|
+
},
|
|
877
|
+
rejected: {
|
|
878
|
+
key: "billTable.sdiStatus.rejected",
|
|
879
|
+
en: "Rejected",
|
|
880
|
+
variant: "error"
|
|
881
|
+
},
|
|
882
|
+
received: {
|
|
883
|
+
key: "billTable.sdiStatus.received",
|
|
884
|
+
en: "Received from SDI",
|
|
885
|
+
variant: "info"
|
|
886
|
+
}
|
|
887
|
+
}, He = {
|
|
888
|
+
notLoaded: {
|
|
889
|
+
key: "billTable.warehouseStatus.notLoaded",
|
|
890
|
+
en: "Not loaded",
|
|
891
|
+
variant: "neutral"
|
|
892
|
+
},
|
|
893
|
+
toReview: {
|
|
894
|
+
key: "billTable.warehouseStatus.toReview",
|
|
895
|
+
en: "To review",
|
|
896
|
+
variant: "warning"
|
|
897
|
+
},
|
|
898
|
+
loaded: {
|
|
899
|
+
key: "billTable.warehouseStatus.loaded",
|
|
900
|
+
en: "Loaded",
|
|
901
|
+
variant: "success"
|
|
902
|
+
}
|
|
903
|
+
}, Y = {
|
|
904
|
+
incoming: { key: "billTable.direction.incoming", en: "Incoming" },
|
|
905
|
+
outgoing: { key: "billTable.direction.outgoing", en: "Outgoing" }
|
|
906
|
+
}, Ri = {
|
|
907
|
+
partial: { key: "billTable.type.partial", en: "Deposit" },
|
|
908
|
+
credit: { key: "billTable.type.credit", en: "Credit note" },
|
|
909
|
+
proforma: { key: "billTable.type.proforma", en: "Pro forma" },
|
|
910
|
+
other: { key: "billTable.type.other", en: "Other document" }
|
|
911
|
+
}, Pi = {
|
|
912
|
+
downloadPdf: { key: "billTable.action.downloadPdf", en: "Download PDF" },
|
|
913
|
+
downloadXml: { key: "billTable.action.downloadXml", en: "Download XML" },
|
|
914
|
+
loadIntoWarehouse: {
|
|
915
|
+
key: "billTable.action.loadIntoWarehouse",
|
|
916
|
+
en: "Load into warehouse"
|
|
917
|
+
},
|
|
918
|
+
edit: { key: "billTable.action.edit", en: "Edit" },
|
|
919
|
+
recordPayment: {
|
|
920
|
+
key: "billTable.action.recordPayment",
|
|
921
|
+
en: "Record payment"
|
|
922
|
+
},
|
|
923
|
+
writeOff: {
|
|
924
|
+
key: "billTable.action.writeOff",
|
|
925
|
+
en: "Write off the unpaid amount"
|
|
926
|
+
},
|
|
927
|
+
undoWriteOff: { key: "billTable.action.undoWriteOff", en: "Undo write-off" },
|
|
928
|
+
delete: { key: "billTable.action.delete", en: "Delete" }
|
|
929
|
+
}, Ye = {
|
|
930
|
+
alreadyLoaded: {
|
|
931
|
+
key: "billTable.disabledReason.alreadyLoaded",
|
|
932
|
+
en: "This bill is already in the warehouse."
|
|
933
|
+
},
|
|
934
|
+
sentToSdi: {
|
|
935
|
+
key: "billTable.disabledReason.sentToSdi",
|
|
936
|
+
en: "This bill was sent to SDI, so it cannot be changed."
|
|
937
|
+
},
|
|
938
|
+
legalStorage: {
|
|
939
|
+
key: "billTable.disabledReason.legalStorage",
|
|
940
|
+
en: "This bill is in legal storage, so it cannot be changed."
|
|
941
|
+
},
|
|
942
|
+
paymentAutomation: {
|
|
943
|
+
key: "billTable.disabledReason.paymentAutomation",
|
|
944
|
+
en: "This bill has automatic payments, so it cannot be changed."
|
|
945
|
+
},
|
|
946
|
+
noPermission: {
|
|
947
|
+
key: "billTable.disabledReason.noPermission",
|
|
948
|
+
en: "You do not have permission to do this."
|
|
949
|
+
},
|
|
950
|
+
inProgress: {
|
|
951
|
+
key: "billTable.disabledReason.inProgress",
|
|
952
|
+
en: "Already in progress."
|
|
953
|
+
}
|
|
954
|
+
}, Ei = {
|
|
955
|
+
csv: { key: "billTable.export.csv", en: "CSV" },
|
|
956
|
+
csvDetailed: {
|
|
957
|
+
key: "billTable.export.csvDetailed",
|
|
958
|
+
en: "CSV with treatments"
|
|
959
|
+
},
|
|
960
|
+
pdfZip: { key: "billTable.export.pdfZip", en: "ZIP with one PDF per bill" },
|
|
961
|
+
pdfSingle: { key: "billTable.export.pdfSingle", en: "One PDF" },
|
|
962
|
+
xmlOutgoingZip: {
|
|
963
|
+
key: "billTable.export.xmlOutgoingZip",
|
|
964
|
+
en: "ZIP of sent electronic invoices (XML)"
|
|
965
|
+
},
|
|
966
|
+
xmlIncomingZip: {
|
|
967
|
+
key: "billTable.export.xmlIncomingZip",
|
|
968
|
+
en: "ZIP of electronic invoices received from SDI (XML)"
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
function Bi({
|
|
972
|
+
row: e,
|
|
973
|
+
openHintId: t,
|
|
974
|
+
onOpen: a,
|
|
975
|
+
hideHostText: s
|
|
976
|
+
}) {
|
|
977
|
+
const { t: c } = v("ui"), b = Ee(), i = e.actions.open;
|
|
978
|
+
let n = null;
|
|
979
|
+
if (e.type !== "full") {
|
|
980
|
+
const d = Ri[e.type];
|
|
981
|
+
n = c(d.key, d.en);
|
|
982
|
+
}
|
|
983
|
+
let o = null;
|
|
984
|
+
if (i !== void 0 && i !== "enabled")
|
|
985
|
+
if (typeof i.disabled == "string") {
|
|
986
|
+
const d = Ye[i.disabled];
|
|
987
|
+
o = c(d.key, d.en);
|
|
988
|
+
} else
|
|
989
|
+
o = s ? c(
|
|
990
|
+
"billTable.disabledReason.privacyHidden",
|
|
991
|
+
"Not available (reason hidden in privacy mode)"
|
|
992
|
+
) : i.disabled.text;
|
|
993
|
+
return /* @__PURE__ */ T("span", { className: q(), children: [
|
|
994
|
+
i === void 0 ? /* @__PURE__ */ l("span", { className: di(), children: e.number }) : /* @__PURE__ */ l(
|
|
995
|
+
Ot,
|
|
996
|
+
{
|
|
997
|
+
intent: "link",
|
|
998
|
+
size: "sm",
|
|
999
|
+
className: si(),
|
|
1000
|
+
"aria-describedby": o ? `${t} ${b}` : t,
|
|
1001
|
+
"aria-disabled": o ? !0 : void 0,
|
|
1002
|
+
onClick: (d) => {
|
|
1003
|
+
if (o) {
|
|
1004
|
+
d.preventDefault();
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
a(e);
|
|
1008
|
+
},
|
|
1009
|
+
children: e.number
|
|
1010
|
+
}
|
|
1011
|
+
),
|
|
1012
|
+
o ? /* @__PURE__ */ l("span", { hidden: !0, id: b, children: o }) : null,
|
|
1013
|
+
n ? /* @__PURE__ */ l("span", { className: j(), children: n }) : null
|
|
1014
|
+
] });
|
|
1015
|
+
}
|
|
1016
|
+
function xi({ day: e }) {
|
|
1017
|
+
const { i18n: t } = v("ui");
|
|
1018
|
+
return /* @__PURE__ */ l("span", { children: Ve(e, t.language) });
|
|
1019
|
+
}
|
|
1020
|
+
function Ze({ direction: e }) {
|
|
1021
|
+
return /* @__PURE__ */ l(e === "incoming" ? Bt : xt, { "aria-hidden": "true", className: li() });
|
|
1022
|
+
}
|
|
1023
|
+
function Ge({ direction: e }) {
|
|
1024
|
+
const { t } = v("ui"), a = Y[e];
|
|
1025
|
+
return /* @__PURE__ */ T("span", { className: re(), children: [
|
|
1026
|
+
/* @__PURE__ */ l(Ze, { direction: e }),
|
|
1027
|
+
/* @__PURE__ */ l("span", { children: t(a.key, a.en) })
|
|
1028
|
+
] });
|
|
1029
|
+
}
|
|
1030
|
+
function Fi({
|
|
1031
|
+
counterparty: e
|
|
1032
|
+
}) {
|
|
1033
|
+
const { t } = v("ui");
|
|
1034
|
+
return e === null ? /* @__PURE__ */ l("span", { className: j(), children: t("billTable.counterparty.none", "No counterparty") }) : /* @__PURE__ */ T("span", { className: q(), children: [
|
|
1035
|
+
/* @__PURE__ */ l("span", { dir: "auto", className: ri(), children: e.name }),
|
|
1036
|
+
e.deleted ? /* @__PURE__ */ l("span", { className: j(), children: t("billTable.counterparty.deleted", "Deleted") }) : null
|
|
1037
|
+
] });
|
|
1038
|
+
}
|
|
1039
|
+
function Wi({
|
|
1040
|
+
amountMinor: e,
|
|
1041
|
+
currency: t
|
|
1042
|
+
}) {
|
|
1043
|
+
return /* @__PURE__ */ l(
|
|
1044
|
+
oe,
|
|
1045
|
+
{
|
|
1046
|
+
size: "sm",
|
|
1047
|
+
value: e,
|
|
1048
|
+
currency: t,
|
|
1049
|
+
scale: H
|
|
1050
|
+
}
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1053
|
+
function de({
|
|
1054
|
+
label: e,
|
|
1055
|
+
variant: t
|
|
1056
|
+
}) {
|
|
1057
|
+
return /* @__PURE__ */ l(At, { size: "sm", variant: t, withDot: !0, children: e });
|
|
1058
|
+
}
|
|
1059
|
+
const Mi = /* @__PURE__ */ new Set([
|
|
1060
|
+
"unpaid",
|
|
1061
|
+
"partiallyPaid",
|
|
1062
|
+
"overdue"
|
|
1063
|
+
]);
|
|
1064
|
+
function Ui({
|
|
1065
|
+
status: e,
|
|
1066
|
+
nextDueDate: t
|
|
1067
|
+
}) {
|
|
1068
|
+
const { t: a, i18n: s } = v("ui"), c = qe[e];
|
|
1069
|
+
return /* @__PURE__ */ T("span", { className: q(), children: [
|
|
1070
|
+
/* @__PURE__ */ l(de, { label: a(c.key, c.en), variant: c.variant }),
|
|
1071
|
+
t && Mi.has(e) ? /* @__PURE__ */ l("span", { className: j(), children: a("billTable.paymentStatus.due", "Due {{date}}", {
|
|
1072
|
+
date: Ve(t, s.language)
|
|
1073
|
+
}) }) : null
|
|
1074
|
+
] });
|
|
1075
|
+
}
|
|
1076
|
+
function Ki({ status: e }) {
|
|
1077
|
+
const { t } = v("ui");
|
|
1078
|
+
if (e === "notApplicable") return null;
|
|
1079
|
+
const a = $e[e];
|
|
1080
|
+
return /* @__PURE__ */ l(de, { label: t(a.key, a.en), variant: a.variant });
|
|
1081
|
+
}
|
|
1082
|
+
function Vi({
|
|
1083
|
+
status: e
|
|
1084
|
+
}) {
|
|
1085
|
+
const { t } = v("ui");
|
|
1086
|
+
if (e === null) return null;
|
|
1087
|
+
const a = He[e];
|
|
1088
|
+
return /* @__PURE__ */ l(de, { label: t(a.key, a.en), variant: a.variant });
|
|
1089
|
+
}
|
|
1090
|
+
function zi() {
|
|
1091
|
+
const { t: e } = v("ui");
|
|
1092
|
+
return /* @__PURE__ */ l(
|
|
1093
|
+
Dt,
|
|
1094
|
+
{
|
|
1095
|
+
size: "sm",
|
|
1096
|
+
content: e(
|
|
1097
|
+
"billTable.sdiHelp",
|
|
1098
|
+
"SDI is the Italian exchange system for electronic invoices."
|
|
1099
|
+
)
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
function B({
|
|
1104
|
+
label: e,
|
|
1105
|
+
value: t,
|
|
1106
|
+
currency: a
|
|
1107
|
+
}) {
|
|
1108
|
+
return /* @__PURE__ */ T(ne, { children: [
|
|
1109
|
+
/* @__PURE__ */ l("dt", { className: mi(), children: e }),
|
|
1110
|
+
/* @__PURE__ */ l("dd", { className: fi(), children: /* @__PURE__ */ l(
|
|
1111
|
+
oe,
|
|
1112
|
+
{
|
|
1113
|
+
size: "sm",
|
|
1114
|
+
value: t,
|
|
1115
|
+
currency: a,
|
|
1116
|
+
scale: H
|
|
1117
|
+
}
|
|
1118
|
+
) })
|
|
1119
|
+
] });
|
|
1120
|
+
}
|
|
1121
|
+
function ji({
|
|
1122
|
+
totals: e,
|
|
1123
|
+
currency: t
|
|
1124
|
+
}) {
|
|
1125
|
+
const { t: a, i18n: s } = v("ui");
|
|
1126
|
+
return /* @__PURE__ */ l("div", { className: ci(), children: $.map((c) => {
|
|
1127
|
+
const b = e[c];
|
|
1128
|
+
return b ? /* @__PURE__ */ T("div", { className: ui(), children: [
|
|
1129
|
+
/* @__PURE__ */ T("p", { className: pi({ tone: "strong" }), children: [
|
|
1130
|
+
/* @__PURE__ */ l(Ge, { direction: c }),
|
|
1131
|
+
/* @__PURE__ */ l("span", { children: a("billTable.totals.count", "{{formatted}} bills", {
|
|
1132
|
+
count: b.count,
|
|
1133
|
+
formatted: Ct(b.count, s.language)
|
|
1134
|
+
}) })
|
|
1135
|
+
] }),
|
|
1136
|
+
/* @__PURE__ */ T("dl", { className: bi(), children: [
|
|
1137
|
+
/* @__PURE__ */ l(
|
|
1138
|
+
B,
|
|
1139
|
+
{
|
|
1140
|
+
label: a("billTable.totals.gross", "Gross"),
|
|
1141
|
+
value: b.grossMinor,
|
|
1142
|
+
currency: t
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1145
|
+
/* @__PURE__ */ l(
|
|
1146
|
+
B,
|
|
1147
|
+
{
|
|
1148
|
+
label: a("billTable.totals.net", "Net"),
|
|
1149
|
+
value: b.netMinor,
|
|
1150
|
+
currency: t
|
|
1151
|
+
}
|
|
1152
|
+
),
|
|
1153
|
+
/* @__PURE__ */ l(
|
|
1154
|
+
B,
|
|
1155
|
+
{
|
|
1156
|
+
label: a("billTable.totals.vat", "VAT"),
|
|
1157
|
+
value: b.vatMinor,
|
|
1158
|
+
currency: t
|
|
1159
|
+
}
|
|
1160
|
+
),
|
|
1161
|
+
/* @__PURE__ */ l(
|
|
1162
|
+
B,
|
|
1163
|
+
{
|
|
1164
|
+
label: a("billTable.totals.taxAtSource", "Withholding tax"),
|
|
1165
|
+
value: b.taxAtSourceMinor,
|
|
1166
|
+
currency: t
|
|
1167
|
+
}
|
|
1168
|
+
),
|
|
1169
|
+
/* @__PURE__ */ l(
|
|
1170
|
+
B,
|
|
1171
|
+
{
|
|
1172
|
+
label: a("billTable.totals.paid", "Paid"),
|
|
1173
|
+
value: b.paidMinor,
|
|
1174
|
+
currency: t
|
|
1175
|
+
}
|
|
1176
|
+
),
|
|
1177
|
+
/* @__PURE__ */ l(
|
|
1178
|
+
B,
|
|
1179
|
+
{
|
|
1180
|
+
label: a("billTable.totals.unpaid", "Unpaid"),
|
|
1181
|
+
value: b.unpaidMinor,
|
|
1182
|
+
currency: t
|
|
1183
|
+
}
|
|
1184
|
+
)
|
|
1185
|
+
] })
|
|
1186
|
+
] }, c) : null;
|
|
1187
|
+
}) });
|
|
1188
|
+
}
|
|
1189
|
+
function qi({
|
|
1190
|
+
totals: e,
|
|
1191
|
+
currency: t
|
|
1192
|
+
}) {
|
|
1193
|
+
const { t: a } = v("ui"), s = a("billTable.totals.breakdown", "Totals breakdown");
|
|
1194
|
+
return /* @__PURE__ */ T("span", { className: re(), children: [
|
|
1195
|
+
/* @__PURE__ */ l("span", { children: a("dataTable.totalRow", "Total") }),
|
|
1196
|
+
/* @__PURE__ */ T(F, { children: [
|
|
1197
|
+
/* @__PURE__ */ l(F.Trigger, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1198
|
+
_t,
|
|
1199
|
+
{
|
|
1200
|
+
intent: "ghost",
|
|
1201
|
+
size: "sm",
|
|
1202
|
+
icon: /* @__PURE__ */ l(Et, { "aria-hidden": "true" }),
|
|
1203
|
+
"aria-label": s,
|
|
1204
|
+
className: Nt
|
|
1205
|
+
}
|
|
1206
|
+
) }),
|
|
1207
|
+
/* @__PURE__ */ T(F.Content, { side: "top", align: "start", size: "md", children: [
|
|
1208
|
+
/* @__PURE__ */ l(F.Heading, { children: s }),
|
|
1209
|
+
/* @__PURE__ */ l(F.Description, { children: a(
|
|
1210
|
+
"billTable.totals.scope",
|
|
1211
|
+
"Every bill that matches the filters, on all pages."
|
|
1212
|
+
) }),
|
|
1213
|
+
/* @__PURE__ */ l(ji, { totals: e, currency: t })
|
|
1214
|
+
] })
|
|
1215
|
+
] })
|
|
1216
|
+
] });
|
|
1217
|
+
}
|
|
1218
|
+
function _e({
|
|
1219
|
+
totals: e,
|
|
1220
|
+
field: t,
|
|
1221
|
+
currency: a
|
|
1222
|
+
}) {
|
|
1223
|
+
const { t: s } = v("ui");
|
|
1224
|
+
return /* @__PURE__ */ l(
|
|
1225
|
+
"span",
|
|
1226
|
+
{
|
|
1227
|
+
className: q({
|
|
1228
|
+
align: t === "grossMinor" ? "end" : "start"
|
|
1229
|
+
}),
|
|
1230
|
+
children: $.map((c) => {
|
|
1231
|
+
const b = e[c];
|
|
1232
|
+
if (!b) return null;
|
|
1233
|
+
const i = Y[c], n = s(i.key, i.en);
|
|
1234
|
+
return /* @__PURE__ */ T("span", { className: re(), children: [
|
|
1235
|
+
/* @__PURE__ */ l(Ze, { direction: c }),
|
|
1236
|
+
t === "grossMinor" ? /* @__PURE__ */ l("span", { children: n }) : /* @__PURE__ */ T(ne, { children: [
|
|
1237
|
+
/* @__PURE__ */ l(Be, { children: n }),
|
|
1238
|
+
/* @__PURE__ */ l("span", { children: s("billTable.totals.unpaid", "Unpaid") })
|
|
1239
|
+
] }),
|
|
1240
|
+
/* @__PURE__ */ l(
|
|
1241
|
+
oe,
|
|
1242
|
+
{
|
|
1243
|
+
size: "sm",
|
|
1244
|
+
value: b[t],
|
|
1245
|
+
currency: a,
|
|
1246
|
+
scale: H
|
|
1247
|
+
}
|
|
1248
|
+
)
|
|
1249
|
+
] }, c);
|
|
1250
|
+
})
|
|
1251
|
+
}
|
|
1252
|
+
);
|
|
1253
|
+
}
|
|
1254
|
+
const $i = [
|
|
1255
|
+
"inRange",
|
|
1256
|
+
"greaterThanOrEqual",
|
|
1257
|
+
"lessThanOrEqual",
|
|
1258
|
+
"equals"
|
|
1259
|
+
], Hi = hi.filter(
|
|
1260
|
+
(e) => e !== "notApplicable"
|
|
1261
|
+
);
|
|
1262
|
+
function Yi({
|
|
1263
|
+
currency: e,
|
|
1264
|
+
showWarehouseStatus: t,
|
|
1265
|
+
sortableColumns: a,
|
|
1266
|
+
totals: s,
|
|
1267
|
+
privacyMode: c,
|
|
1268
|
+
openHintId: b,
|
|
1269
|
+
onOpenRow: i,
|
|
1270
|
+
rowActions: n
|
|
1271
|
+
}) {
|
|
1272
|
+
const { t: o } = v("ui"), d = a.join("|");
|
|
1273
|
+
return M(() => {
|
|
1274
|
+
const y = new Set(d.split("|")), P = (r) => {
|
|
1275
|
+
const h = Y[r];
|
|
1276
|
+
return o(h.key, h.en);
|
|
1277
|
+
}, S = (r) => {
|
|
1278
|
+
const h = qe[r];
|
|
1279
|
+
return o(h.key, h.en);
|
|
1280
|
+
}, I = (r) => {
|
|
1281
|
+
const h = $e[r];
|
|
1282
|
+
return o(h.key, h.en);
|
|
1283
|
+
}, k = (r) => {
|
|
1284
|
+
const h = He[r];
|
|
1285
|
+
return o(h.key, h.en);
|
|
1286
|
+
}, f = (r, h) => r.map((L) => ({ value: L, label: h(L) })), m = o("dataTable.actions", "Actions"), u = [
|
|
1287
|
+
{
|
|
1288
|
+
id: "number",
|
|
1289
|
+
header: o("billTable.column.number", "Number"),
|
|
1290
|
+
// The number names the row: `<th scope="row">`, "Select A12",
|
|
1291
|
+
// "Actions, A12". Pinned at the inline start, always shown.
|
|
1292
|
+
rowHeader: !0,
|
|
1293
|
+
pin: "start",
|
|
1294
|
+
hideable: !1,
|
|
1295
|
+
reorderable: !1,
|
|
1296
|
+
pinnable: !1,
|
|
1297
|
+
size: 136,
|
|
1298
|
+
minSize: 112,
|
|
1299
|
+
value: (r) => r.number,
|
|
1300
|
+
exportValue: (r) => r.number,
|
|
1301
|
+
sort: y.has("number") ? "text" : void 0,
|
|
1302
|
+
cell: (r) => /* @__PURE__ */ l(
|
|
1303
|
+
Bi,
|
|
1304
|
+
{
|
|
1305
|
+
row: r,
|
|
1306
|
+
openHintId: b,
|
|
1307
|
+
onOpen: i,
|
|
1308
|
+
hideHostText: c
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
footer: s ? /* @__PURE__ */ l(qi, { totals: s, currency: e }) : void 0
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
id: "date",
|
|
1315
|
+
header: o("billTable.column.date", "Date"),
|
|
1316
|
+
size: 120,
|
|
1317
|
+
responsiveTier: 1,
|
|
1318
|
+
// A calendar day `YYYY-MM-DD`; DataGrid formats it for export.
|
|
1319
|
+
value: (r) => r.date,
|
|
1320
|
+
sort: y.has("date") ? "date" : void 0,
|
|
1321
|
+
sortDescFirst: !0,
|
|
1322
|
+
// One request per range: the server filters on Apply.
|
|
1323
|
+
filter: { kind: "dateRange", commitMode: "apply" },
|
|
1324
|
+
search: !1,
|
|
1325
|
+
cell: (r) => /* @__PURE__ */ l(xi, { day: r.date })
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
id: "direction",
|
|
1329
|
+
header: o("billTable.column.direction", "Direction"),
|
|
1330
|
+
size: 132,
|
|
1331
|
+
responsiveTier: 1,
|
|
1332
|
+
value: (r) => r.direction,
|
|
1333
|
+
exportValue: (r) => P(r.direction),
|
|
1334
|
+
filter: {
|
|
1335
|
+
kind: "select",
|
|
1336
|
+
options: f($, P)
|
|
1337
|
+
},
|
|
1338
|
+
search: !1,
|
|
1339
|
+
cell: (r) => /* @__PURE__ */ l(Ge, { direction: r.direction })
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
id: "counterparty",
|
|
1343
|
+
header: o("billTable.column.counterparty", "Counterparty"),
|
|
1344
|
+
size: 240,
|
|
1345
|
+
minSize: 160,
|
|
1346
|
+
value: (r) => {
|
|
1347
|
+
var h;
|
|
1348
|
+
return ((h = r.counterparty) == null ? void 0 : h.name) ?? null;
|
|
1349
|
+
},
|
|
1350
|
+
// Off while privacy mode is on: the whole column leaves sorting and
|
|
1351
|
+
// the server query (DataGrid's whole-column privacy rule).
|
|
1352
|
+
sort: y.has("counterparty") ? "text" : void 0,
|
|
1353
|
+
// Patients and other people are masked; companies stay visible.
|
|
1354
|
+
privacy: { mode: "mask", appliesTo: wi },
|
|
1355
|
+
cell: (r) => /* @__PURE__ */ l(Fi, { counterparty: r.counterparty })
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
id: "amount",
|
|
1359
|
+
header: o("billTable.column.amount", "Amount"),
|
|
1360
|
+
align: "end",
|
|
1361
|
+
size: 136,
|
|
1362
|
+
value: (r) => r.amountMinor,
|
|
1363
|
+
exportValue: (r) => Ii(r.amountMinor),
|
|
1364
|
+
sort: y.has("amount") ? "number" : void 0,
|
|
1365
|
+
sortDescFirst: !0,
|
|
1366
|
+
// A currency NumberInput in the table currency. Bounds are MAJOR
|
|
1367
|
+
// units as typed (12.50), like the platform's amount_from/_to;
|
|
1368
|
+
// the server converts. Rows carry minor units.
|
|
1369
|
+
filter: {
|
|
1370
|
+
kind: "number",
|
|
1371
|
+
mode: "currency",
|
|
1372
|
+
currency: e,
|
|
1373
|
+
operators: $i,
|
|
1374
|
+
defaultOperator: "inRange"
|
|
1375
|
+
},
|
|
1376
|
+
search: !1,
|
|
1377
|
+
cell: (r) => /* @__PURE__ */ l(Wi, { amountMinor: r.amountMinor, currency: e }),
|
|
1378
|
+
footer: s ? /* @__PURE__ */ l(
|
|
1379
|
+
_e,
|
|
1380
|
+
{
|
|
1381
|
+
totals: s,
|
|
1382
|
+
field: "grossMinor",
|
|
1383
|
+
currency: e
|
|
1384
|
+
}
|
|
1385
|
+
) : void 0
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
id: "paymentStatus",
|
|
1389
|
+
header: o("billTable.column.paymentStatus", "Payment status"),
|
|
1390
|
+
size: 168,
|
|
1391
|
+
responsiveTier: 2,
|
|
1392
|
+
value: (r) => r.paymentStatus,
|
|
1393
|
+
exportValue: (r) => S(r.paymentStatus),
|
|
1394
|
+
filter: {
|
|
1395
|
+
kind: "select",
|
|
1396
|
+
options: f(yi, S)
|
|
1397
|
+
},
|
|
1398
|
+
search: !1,
|
|
1399
|
+
cell: (r) => /* @__PURE__ */ l(
|
|
1400
|
+
Ui,
|
|
1401
|
+
{
|
|
1402
|
+
status: r.paymentStatus,
|
|
1403
|
+
nextDueDate: r.nextDueDate ?? null
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
footer: s ? /* @__PURE__ */ l(
|
|
1407
|
+
_e,
|
|
1408
|
+
{
|
|
1409
|
+
totals: s,
|
|
1410
|
+
field: "unpaidMinor",
|
|
1411
|
+
currency: e
|
|
1412
|
+
}
|
|
1413
|
+
) : void 0
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
id: "sdiStatus",
|
|
1417
|
+
header: o("billTable.column.sdiStatus", "SDI status"),
|
|
1418
|
+
headerTip: /* @__PURE__ */ l(zi, {}),
|
|
1419
|
+
size: 168,
|
|
1420
|
+
responsiveTier: 3,
|
|
1421
|
+
value: (r) => r.sdiStatus === "notApplicable" ? null : r.sdiStatus,
|
|
1422
|
+
exportValue: (r) => r.sdiStatus === "notApplicable" ? "" : I(r.sdiStatus),
|
|
1423
|
+
filter: {
|
|
1424
|
+
kind: "select",
|
|
1425
|
+
options: f(Hi, I)
|
|
1426
|
+
},
|
|
1427
|
+
search: !1,
|
|
1428
|
+
cell: (r) => /* @__PURE__ */ l(Ki, { status: r.sdiStatus })
|
|
1429
|
+
}
|
|
1430
|
+
];
|
|
1431
|
+
return t && u.push({
|
|
1432
|
+
id: "warehouseStatus",
|
|
1433
|
+
header: o("billTable.column.warehouseStatus", "Warehouse status"),
|
|
1434
|
+
size: 152,
|
|
1435
|
+
responsiveTier: 2,
|
|
1436
|
+
value: (r) => r.warehouseStatus ?? null,
|
|
1437
|
+
exportValue: (r) => r.warehouseStatus ? k(r.warehouseStatus) : "",
|
|
1438
|
+
filter: {
|
|
1439
|
+
kind: "select",
|
|
1440
|
+
options: f(gi, k)
|
|
1441
|
+
},
|
|
1442
|
+
search: !1,
|
|
1443
|
+
cell: (r) => /* @__PURE__ */ l(Vi, { status: r.warehouseStatus ?? null })
|
|
1444
|
+
}), u.push({
|
|
1445
|
+
id: "actions",
|
|
1446
|
+
header: /* @__PURE__ */ l(Be, { children: m }),
|
|
1447
|
+
headerLabel: m,
|
|
1448
|
+
pin: "end",
|
|
1449
|
+
size: 64,
|
|
1450
|
+
hideable: !1,
|
|
1451
|
+
reorderable: !1,
|
|
1452
|
+
pinnable: !1,
|
|
1453
|
+
resizable: !1,
|
|
1454
|
+
exportable: !1,
|
|
1455
|
+
printable: !1,
|
|
1456
|
+
search: !1,
|
|
1457
|
+
// Kit RowActions, menu only: one "More actions" button per row, the
|
|
1458
|
+
// group named by reference ("Actions, A12"), never by row data in an
|
|
1459
|
+
// attribute. A row that offers no menu item renders no button.
|
|
1460
|
+
cell: (r, h) => /* @__PURE__ */ l(
|
|
1461
|
+
Lt,
|
|
1462
|
+
{
|
|
1463
|
+
row: r,
|
|
1464
|
+
actions: n,
|
|
1465
|
+
maxInline: 0,
|
|
1466
|
+
"aria-labelledby": h.inputLabelledBy
|
|
1467
|
+
}
|
|
1468
|
+
)
|
|
1469
|
+
}), u;
|
|
1470
|
+
}, [
|
|
1471
|
+
o,
|
|
1472
|
+
e,
|
|
1473
|
+
t,
|
|
1474
|
+
d,
|
|
1475
|
+
s,
|
|
1476
|
+
c,
|
|
1477
|
+
b,
|
|
1478
|
+
i,
|
|
1479
|
+
n
|
|
1480
|
+
]);
|
|
1481
|
+
}
|
|
1482
|
+
function z(e, t) {
|
|
1483
|
+
throw new Error(`${e}: ${t}`);
|
|
1484
|
+
}
|
|
1485
|
+
function ie(e) {
|
|
1486
|
+
Ft() && console.warn(`[BillTable] ${e}`);
|
|
1487
|
+
}
|
|
1488
|
+
const Zi = new Set(Ti);
|
|
1489
|
+
function Gi(e) {
|
|
1490
|
+
return Zi.has(e);
|
|
1491
|
+
}
|
|
1492
|
+
function De(e) {
|
|
1493
|
+
return new Set(
|
|
1494
|
+
e.getColumns().filter((t) => t.masked === !0).map((t) => t.id)
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
function Xi(e, t) {
|
|
1498
|
+
const a = () => e.current, s = () => t.current;
|
|
1499
|
+
function c(i) {
|
|
1500
|
+
return s().rows.find((o) => o.id === i) ?? z("UNKNOWN_ROW", `no bill "${i}" on the current page.`);
|
|
1501
|
+
}
|
|
1502
|
+
function b(i, n) {
|
|
1503
|
+
const o = c(i), { callbacks: d } = s(), y = o.actions[n];
|
|
1504
|
+
return (y === void 0 || !se(d, n)) && z("ACTION_UNAVAILABLE", `bill "${i}" does not offer ${n}.`), y !== "enabled" && z("ACTION_DISABLED", je(y)), { row: o, callbacks: d };
|
|
1505
|
+
}
|
|
1506
|
+
return {
|
|
1507
|
+
getFeatures() {
|
|
1508
|
+
const { features: i } = s();
|
|
1509
|
+
return { ...i, sortableColumns: [...i.sortableColumns] };
|
|
1510
|
+
},
|
|
1511
|
+
/* ---- query ---- */
|
|
1512
|
+
getQuery() {
|
|
1513
|
+
const i = a(), { privacyMode: n } = s().features;
|
|
1514
|
+
if (!i)
|
|
1515
|
+
return {
|
|
1516
|
+
sorting: [],
|
|
1517
|
+
filters: {},
|
|
1518
|
+
quickFilter: "",
|
|
1519
|
+
pagination: { pageIndex: 0, pageSize: vt },
|
|
1520
|
+
privacyMode: n
|
|
1521
|
+
};
|
|
1522
|
+
const o = De(i), d = { ...i.getFilter() };
|
|
1523
|
+
for (const y of Object.keys(d))
|
|
1524
|
+
o.has(y) && delete d[y];
|
|
1525
|
+
return {
|
|
1526
|
+
sorting: ae(
|
|
1527
|
+
i.getSort().filter((y) => !o.has(y.colId))
|
|
1528
|
+
),
|
|
1529
|
+
filters: d,
|
|
1530
|
+
quickFilter: i.getQuickFilter(),
|
|
1531
|
+
pagination: {
|
|
1532
|
+
pageIndex: i.getCurrentPage(),
|
|
1533
|
+
pageSize: i.getPageSize()
|
|
1534
|
+
},
|
|
1535
|
+
privacyMode: n
|
|
1536
|
+
};
|
|
1537
|
+
},
|
|
1538
|
+
setSort(i) {
|
|
1539
|
+
const n = a();
|
|
1540
|
+
if (!n) return;
|
|
1541
|
+
const { sortableColumns: o } = s().features, d = De(n);
|
|
1542
|
+
for (const y of i) {
|
|
1543
|
+
if (!o.includes(y.colId)) {
|
|
1544
|
+
ie(`setSort: the server does not sort "${y.colId}".`);
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
if (d.has(y.colId)) {
|
|
1548
|
+
ie(`setSort: "${y.colId}" is hidden by privacy mode.`);
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
i.length > 1 && ie("setSort: the server sorts by one column; the first one is used."), n.setSort(i.slice(0, 1));
|
|
1553
|
+
},
|
|
1554
|
+
getFilter() {
|
|
1555
|
+
var i;
|
|
1556
|
+
return { ...((i = a()) == null ? void 0 : i.getFilter()) ?? {} };
|
|
1557
|
+
},
|
|
1558
|
+
setFilter(i, n) {
|
|
1559
|
+
var o;
|
|
1560
|
+
(o = a()) == null || o.setFilter(i, n);
|
|
1561
|
+
},
|
|
1562
|
+
getQuickFilter() {
|
|
1563
|
+
var i;
|
|
1564
|
+
return ((i = a()) == null ? void 0 : i.getQuickFilter()) ?? "";
|
|
1565
|
+
},
|
|
1566
|
+
setQuickFilter(i, n) {
|
|
1567
|
+
var o;
|
|
1568
|
+
(o = a()) == null || o.setQuickFilter(i, n);
|
|
1569
|
+
},
|
|
1570
|
+
clearFilters() {
|
|
1571
|
+
var i;
|
|
1572
|
+
(i = a()) == null || i.clearFilters();
|
|
1573
|
+
},
|
|
1574
|
+
goToPage(i) {
|
|
1575
|
+
var n;
|
|
1576
|
+
(n = a()) == null || n.goToPage(i);
|
|
1577
|
+
},
|
|
1578
|
+
setPageSize(i) {
|
|
1579
|
+
var n;
|
|
1580
|
+
(n = a()) == null || n.setPageSize(i);
|
|
1581
|
+
},
|
|
1582
|
+
getPageCount() {
|
|
1583
|
+
var i;
|
|
1584
|
+
return ((i = a()) == null ? void 0 : i.getPageCount()) ?? 0;
|
|
1585
|
+
},
|
|
1586
|
+
getRowCount() {
|
|
1587
|
+
var i;
|
|
1588
|
+
return ((i = a()) == null ? void 0 : i.getRowCount()) ?? 0;
|
|
1589
|
+
},
|
|
1590
|
+
getRowIds() {
|
|
1591
|
+
var i;
|
|
1592
|
+
return ((i = a()) == null ? void 0 : i.getRowIds()) ?? s().rows.map((n) => n.id);
|
|
1593
|
+
},
|
|
1594
|
+
/* ---- selection ---- */
|
|
1595
|
+
getSelection() {
|
|
1596
|
+
var i;
|
|
1597
|
+
return ((i = a()) == null ? void 0 : i.getSelection()) ?? [];
|
|
1598
|
+
},
|
|
1599
|
+
setSelection(i) {
|
|
1600
|
+
var n;
|
|
1601
|
+
(n = a()) == null || n.setSelection(i);
|
|
1602
|
+
},
|
|
1603
|
+
selectRange(i, n) {
|
|
1604
|
+
var o;
|
|
1605
|
+
(o = a()) == null || o.selectRange(i, n);
|
|
1606
|
+
},
|
|
1607
|
+
clearSelection() {
|
|
1608
|
+
var i;
|
|
1609
|
+
(i = a()) == null || i.clearSelection();
|
|
1610
|
+
},
|
|
1611
|
+
/* ---- columns ---- */
|
|
1612
|
+
getColumns() {
|
|
1613
|
+
const i = a();
|
|
1614
|
+
if (!i) return [];
|
|
1615
|
+
const { privacyMode: n } = s().features, o = [];
|
|
1616
|
+
for (const d of i.getColumns())
|
|
1617
|
+
Gi(d.id) && o.push({
|
|
1618
|
+
id: d.id,
|
|
1619
|
+
label: d.label,
|
|
1620
|
+
visible: d.visible,
|
|
1621
|
+
canHide: d.canHide,
|
|
1622
|
+
sortable: d.sortable,
|
|
1623
|
+
// DataGrid reports `masked`; a missing value counts as masked
|
|
1624
|
+
// for the counterparty while privacy mode is on.
|
|
1625
|
+
masked: d.masked ?? (n && d.id === "counterparty")
|
|
1626
|
+
});
|
|
1627
|
+
return o;
|
|
1628
|
+
},
|
|
1629
|
+
setColumnVisible(i, n) {
|
|
1630
|
+
var o;
|
|
1631
|
+
(o = a()) == null || o.setColumnVisible(i, n);
|
|
1632
|
+
},
|
|
1633
|
+
resetColumns() {
|
|
1634
|
+
var i;
|
|
1635
|
+
(i = a()) == null || i.resetColumnState();
|
|
1636
|
+
},
|
|
1637
|
+
/* ---- focus ---- */
|
|
1638
|
+
scrollToRow(i) {
|
|
1639
|
+
var n;
|
|
1640
|
+
(n = a()) == null || n.scrollToRow(i);
|
|
1641
|
+
},
|
|
1642
|
+
focusRow(i, n = "number") {
|
|
1643
|
+
var o;
|
|
1644
|
+
(o = a()) == null || o.focusRow(i, n);
|
|
1645
|
+
},
|
|
1646
|
+
/* ---- rows (agent-safe projection) ---- */
|
|
1647
|
+
getRowSummaries() {
|
|
1648
|
+
const { rows: i, callbacks: n } = s();
|
|
1649
|
+
return i.map((o) => Ci(o, n));
|
|
1650
|
+
},
|
|
1651
|
+
/* ---- row actions ---- */
|
|
1652
|
+
getRowActions(i) {
|
|
1653
|
+
const n = c(i), { callbacks: o, features: d, hiddenReasonText: y } = s();
|
|
1654
|
+
return _i(
|
|
1655
|
+
n,
|
|
1656
|
+
o,
|
|
1657
|
+
d.privacyMode,
|
|
1658
|
+
y
|
|
1659
|
+
);
|
|
1660
|
+
},
|
|
1661
|
+
openBill(i) {
|
|
1662
|
+
const { row: n, callbacks: o } = b(i, "open");
|
|
1663
|
+
o.onOpen(n, te);
|
|
1664
|
+
},
|
|
1665
|
+
downloadBill(i, n) {
|
|
1666
|
+
var y;
|
|
1667
|
+
n !== "pdf" && n !== "xml" && z("ACTION_UNAVAILABLE", `unknown format "${String(n)}".`);
|
|
1668
|
+
const { row: o, callbacks: d } = b(
|
|
1669
|
+
i,
|
|
1670
|
+
n === "xml" ? "downloadXml" : "downloadPdf"
|
|
1671
|
+
);
|
|
1672
|
+
(y = d.onDownload) == null || y.call(d, o, n, te);
|
|
1673
|
+
},
|
|
1674
|
+
loadIntoWarehouse(i) {
|
|
1675
|
+
var d;
|
|
1676
|
+
const { row: n, callbacks: o } = b(i, "loadIntoWarehouse");
|
|
1677
|
+
(d = o.onLoadIntoWarehouse) == null || d.call(o, n, {
|
|
1678
|
+
...te,
|
|
1679
|
+
warehouseStatus: n.warehouseStatus ?? null
|
|
1680
|
+
});
|
|
1681
|
+
},
|
|
1682
|
+
/* ---- change feed ---- */
|
|
1683
|
+
subscribe(i) {
|
|
1684
|
+
var n;
|
|
1685
|
+
return ((n = a()) == null ? void 0 : n.subscribe(i)) ?? (() => {
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
const Qi = {
|
|
1691
|
+
downloadPdf: "downloads",
|
|
1692
|
+
downloadXml: "downloads",
|
|
1693
|
+
loadIntoWarehouse: "warehouse",
|
|
1694
|
+
edit: "bill",
|
|
1695
|
+
recordPayment: "bill",
|
|
1696
|
+
writeOff: "bill",
|
|
1697
|
+
undoWriteOff: "bill",
|
|
1698
|
+
delete: "delete"
|
|
1699
|
+
};
|
|
1700
|
+
function Ji({
|
|
1701
|
+
callbacksRef: e,
|
|
1702
|
+
available: t,
|
|
1703
|
+
privacyMode: a
|
|
1704
|
+
}) {
|
|
1705
|
+
const { t: s } = v("ui"), {
|
|
1706
|
+
download: c,
|
|
1707
|
+
loadIntoWarehouse: b,
|
|
1708
|
+
edit: i,
|
|
1709
|
+
recordPayment: n,
|
|
1710
|
+
writeOff: o,
|
|
1711
|
+
delete: d
|
|
1712
|
+
} = t;
|
|
1713
|
+
return M(() => {
|
|
1714
|
+
const y = s(
|
|
1715
|
+
"billTable.disabledReason.privacyHidden",
|
|
1716
|
+
"Not available (reason hidden in privacy mode)"
|
|
1717
|
+
), P = (f, m) => {
|
|
1718
|
+
const u = f.actions[m];
|
|
1719
|
+
if (!(u === void 0 || u === "enabled")) {
|
|
1720
|
+
if (typeof u.disabled == "string") {
|
|
1721
|
+
const r = Ye[u.disabled];
|
|
1722
|
+
return s(r.key, r.en);
|
|
1723
|
+
}
|
|
1724
|
+
return a ? y : u.disabled.text;
|
|
1725
|
+
}
|
|
1726
|
+
}, S = (f, m, u, r = "default") => {
|
|
1727
|
+
const h = Pi[f];
|
|
1728
|
+
return {
|
|
1729
|
+
// Developer constant: React key and `data-action-id`, never row data.
|
|
1730
|
+
id: f,
|
|
1731
|
+
// Design 3.6 menu group: the menu draws a separator between groups.
|
|
1732
|
+
section: Qi[f],
|
|
1733
|
+
icon: ft(m, { "aria-hidden": !0 }),
|
|
1734
|
+
label: s(h.key, h.en),
|
|
1735
|
+
onClick: u,
|
|
1736
|
+
variant: r,
|
|
1737
|
+
hidden: (L) => L.actions[f] === void 0,
|
|
1738
|
+
disabled: (L) => {
|
|
1739
|
+
const x = L.actions[f];
|
|
1740
|
+
return x !== void 0 && x !== "enabled";
|
|
1741
|
+
},
|
|
1742
|
+
disabledReason: (L) => P(L, f)
|
|
1743
|
+
};
|
|
1744
|
+
}, I = () => e.current, k = [];
|
|
1745
|
+
return c && k.push(
|
|
1746
|
+
S(
|
|
1747
|
+
"downloadPdf",
|
|
1748
|
+
xe,
|
|
1749
|
+
(f) => {
|
|
1750
|
+
var m, u;
|
|
1751
|
+
return (u = (m = I()).onDownload) == null ? void 0 : u.call(m, f, "pdf", _);
|
|
1752
|
+
}
|
|
1753
|
+
),
|
|
1754
|
+
S(
|
|
1755
|
+
"downloadXml",
|
|
1756
|
+
Fe,
|
|
1757
|
+
(f) => {
|
|
1758
|
+
var m, u;
|
|
1759
|
+
return (u = (m = I()).onDownload) == null ? void 0 : u.call(m, f, "xml", _);
|
|
1760
|
+
}
|
|
1761
|
+
)
|
|
1762
|
+
), b && k.push(
|
|
1763
|
+
S(
|
|
1764
|
+
"loadIntoWarehouse",
|
|
1765
|
+
$t,
|
|
1766
|
+
(f) => {
|
|
1767
|
+
var m, u;
|
|
1768
|
+
return (u = (m = I()).onLoadIntoWarehouse) == null ? void 0 : u.call(m, f, {
|
|
1769
|
+
..._,
|
|
1770
|
+
// HTP-7312 analytics: `bill_warehouse_load_clicked
|
|
1771
|
+
// { warehouse_status }`; `null` without the module.
|
|
1772
|
+
warehouseStatus: f.warehouseStatus ?? null
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
)
|
|
1776
|
+
), i && k.push(
|
|
1777
|
+
S("edit", Wt, (f) => {
|
|
1778
|
+
var m, u;
|
|
1779
|
+
return (u = (m = I()).onEdit) == null ? void 0 : u.call(m, f, _);
|
|
1780
|
+
})
|
|
1781
|
+
), n && k.push(
|
|
1782
|
+
S(
|
|
1783
|
+
"recordPayment",
|
|
1784
|
+
jt,
|
|
1785
|
+
(f) => {
|
|
1786
|
+
var m, u;
|
|
1787
|
+
return (u = (m = I()).onRecordPayment) == null ? void 0 : u.call(m, f, _);
|
|
1788
|
+
}
|
|
1789
|
+
)
|
|
1790
|
+
), o && k.push(
|
|
1791
|
+
S(
|
|
1792
|
+
"writeOff",
|
|
1793
|
+
Mt,
|
|
1794
|
+
(f) => {
|
|
1795
|
+
var m, u;
|
|
1796
|
+
return (u = (m = I()).onWriteOff) == null ? void 0 : u.call(m, f, !1, _);
|
|
1797
|
+
}
|
|
1798
|
+
),
|
|
1799
|
+
S(
|
|
1800
|
+
"undoWriteOff",
|
|
1801
|
+
Ut,
|
|
1802
|
+
(f) => {
|
|
1803
|
+
var m, u;
|
|
1804
|
+
return (u = (m = I()).onWriteOff) == null ? void 0 : u.call(m, f, !0, _);
|
|
1805
|
+
}
|
|
1806
|
+
)
|
|
1807
|
+
), d && k.push(
|
|
1808
|
+
S(
|
|
1809
|
+
"delete",
|
|
1810
|
+
Kt,
|
|
1811
|
+
(f) => {
|
|
1812
|
+
var m, u;
|
|
1813
|
+
return (u = (m = I()).onDelete) == null ? void 0 : u.call(m, f, _);
|
|
1814
|
+
},
|
|
1815
|
+
"destructive"
|
|
1816
|
+
)
|
|
1817
|
+
), k;
|
|
1818
|
+
}, [
|
|
1819
|
+
s,
|
|
1820
|
+
e,
|
|
1821
|
+
c,
|
|
1822
|
+
b,
|
|
1823
|
+
i,
|
|
1824
|
+
n,
|
|
1825
|
+
o,
|
|
1826
|
+
d,
|
|
1827
|
+
a
|
|
1828
|
+
]);
|
|
1829
|
+
}
|
|
1830
|
+
const ea = [], ta = (e) => e.id, ia = (e) => e.number, aa = yt(
|
|
1831
|
+
function(t, a) {
|
|
1832
|
+
const {
|
|
1833
|
+
/* data */
|
|
1834
|
+
rows: s,
|
|
1835
|
+
rowCount: c,
|
|
1836
|
+
currency: b = "EUR",
|
|
1837
|
+
totals: i = null,
|
|
1838
|
+
/* query */
|
|
1839
|
+
query: n,
|
|
1840
|
+
defaultQuery: o,
|
|
1841
|
+
onQueryChange: d,
|
|
1842
|
+
sortableColumns: y = Ke,
|
|
1843
|
+
pageSizeOptions: P = Ae,
|
|
1844
|
+
/* selection */
|
|
1845
|
+
selectable: S = !0,
|
|
1846
|
+
selection: I,
|
|
1847
|
+
defaultSelection: k,
|
|
1848
|
+
onSelectionChange: f,
|
|
1849
|
+
/* columns */
|
|
1850
|
+
showWarehouseStatus: m = !1,
|
|
1851
|
+
gridId: u = Si,
|
|
1852
|
+
persistColumnState: r = !0,
|
|
1853
|
+
/* row actions */
|
|
1854
|
+
onOpen: h,
|
|
1855
|
+
onDownload: L,
|
|
1856
|
+
onLoadIntoWarehouse: x,
|
|
1857
|
+
onEdit: ce,
|
|
1858
|
+
onRecordPayment: ue,
|
|
1859
|
+
onWriteOff: pe,
|
|
1860
|
+
onDelete: be,
|
|
1861
|
+
/* bulk and list actions */
|
|
1862
|
+
onBulkDownload: Z,
|
|
1863
|
+
listDownloads: me = ea,
|
|
1864
|
+
onListDownload: fe,
|
|
1865
|
+
onRefresh: ye,
|
|
1866
|
+
/* toolbar */
|
|
1867
|
+
toolbarStart: Xe,
|
|
1868
|
+
extraFilterLabels: he,
|
|
1869
|
+
/* states */
|
|
1870
|
+
status: ge = "ready",
|
|
1871
|
+
error: O,
|
|
1872
|
+
onCreateBill: Te,
|
|
1873
|
+
headingLevel: Se,
|
|
1874
|
+
/* privacy and layout */
|
|
1875
|
+
privacyMode: E = !1,
|
|
1876
|
+
caption: Qe,
|
|
1877
|
+
density: Je = "default",
|
|
1878
|
+
height: ve = "auto",
|
|
1879
|
+
/* DOM: naming goes to the grid's scroll region */
|
|
1880
|
+
className: et,
|
|
1881
|
+
"aria-label": tt,
|
|
1882
|
+
"aria-labelledby": it,
|
|
1883
|
+
"aria-describedby": at,
|
|
1884
|
+
...nt
|
|
1885
|
+
} = t, { t: p } = v("ui"), we = Ee(), G = K(null), X = {
|
|
1886
|
+
onOpen: h,
|
|
1887
|
+
onDownload: L,
|
|
1888
|
+
onLoadIntoWarehouse: x,
|
|
1889
|
+
onEdit: ce,
|
|
1890
|
+
onRecordPayment: ue,
|
|
1891
|
+
onWriteOff: pe,
|
|
1892
|
+
onDelete: be
|
|
1893
|
+
}, Q = K(X);
|
|
1894
|
+
Q.current = X;
|
|
1895
|
+
const ot = p(
|
|
1896
|
+
"billTable.disabledReason.privacyHidden",
|
|
1897
|
+
"Not available (reason hidden in privacy mode)"
|
|
1898
|
+
), Ie = {
|
|
1899
|
+
rows: s,
|
|
1900
|
+
callbacks: X,
|
|
1901
|
+
features: {
|
|
1902
|
+
selectable: S,
|
|
1903
|
+
privacyMode: E,
|
|
1904
|
+
showWarehouseStatus: m,
|
|
1905
|
+
sortableColumns: [...y],
|
|
1906
|
+
status: ge
|
|
1907
|
+
},
|
|
1908
|
+
hiddenReasonText: ot
|
|
1909
|
+
}, ke = K(Ie);
|
|
1910
|
+
ke.current = Ie;
|
|
1911
|
+
const [U] = ht(() => Xi(G, ke));
|
|
1912
|
+
gt(a, () => U, [U]), St(ni, U, u);
|
|
1913
|
+
const Ne = K(null), lt = (g) => {
|
|
1914
|
+
var Le;
|
|
1915
|
+
const D = ae(g.sorting);
|
|
1916
|
+
Ne.current = {
|
|
1917
|
+
key: ze(D),
|
|
1918
|
+
raw: ae(((Le = G.current) == null ? void 0 : Le.getSort()) ?? g.sorting)
|
|
1919
|
+
}, d == null || d({
|
|
1920
|
+
sorting: D,
|
|
1921
|
+
// Column models and host keys; DataGrid evaluates none of them in
|
|
1922
|
+
// server mode and passes the host's keys through as written.
|
|
1923
|
+
filters: g.filters,
|
|
1924
|
+
quickFilter: g.quickFilter,
|
|
1925
|
+
pagination: { ...g.pagination },
|
|
1926
|
+
privacyMode: E
|
|
1927
|
+
});
|
|
1928
|
+
}, rt = n ? Ai(n.sorting, Ne.current) : void 0, J = P.join(","), st = M(
|
|
1929
|
+
() => ({
|
|
1930
|
+
pageSizeOptions: J === "" ? Ae : J.split(",").map(Number)
|
|
1931
|
+
}),
|
|
1932
|
+
[J]
|
|
1933
|
+
), dt = M(() => ({ ...{
|
|
1934
|
+
datePreset: p("billTable.filter.datePreset", "Period"),
|
|
1935
|
+
type: p("billTable.filter.type", "Type"),
|
|
1936
|
+
number: p("billTable.filter.number", "Number"),
|
|
1937
|
+
prefix: p("billTable.filter.prefix", "Prefix"),
|
|
1938
|
+
withInsuranceNet: p(
|
|
1939
|
+
"billTable.filter.withInsuranceNet",
|
|
1940
|
+
"Insurer amount"
|
|
1941
|
+
),
|
|
1942
|
+
withVat: p("billTable.filter.withVat", "VAT"),
|
|
1943
|
+
withTaxAtSource: p(
|
|
1944
|
+
"billTable.filter.withTaxAtSource",
|
|
1945
|
+
"Withholding tax"
|
|
1946
|
+
),
|
|
1947
|
+
withWelfareFundContribution: p(
|
|
1948
|
+
"billTable.filter.withWelfareFundContribution",
|
|
1949
|
+
"Welfare fund contribution"
|
|
1950
|
+
),
|
|
1951
|
+
withUnpaidAmount: p(
|
|
1952
|
+
"billTable.filter.withUnpaidAmount",
|
|
1953
|
+
"Amount still to pay"
|
|
1954
|
+
),
|
|
1955
|
+
writtenOff: p("billTable.filter.writtenOff", "Written off"),
|
|
1956
|
+
taxOfficeNotification: p(
|
|
1957
|
+
"billTable.filter.taxOfficeNotification",
|
|
1958
|
+
"Consent to send to Sistema TS"
|
|
1959
|
+
),
|
|
1960
|
+
receivedFromSdi: p(
|
|
1961
|
+
"billTable.filter.receivedFromSdi",
|
|
1962
|
+
"Received from SDI"
|
|
1963
|
+
),
|
|
1964
|
+
sentToSdi: p("billTable.filter.sentToSdi", "Sent to SDI"),
|
|
1965
|
+
selfBill: p("billTable.filter.selfBill", "Self-billing"),
|
|
1966
|
+
liabilityDate: p("billTable.filter.liabilityDate", "Due date"),
|
|
1967
|
+
sdiEntryDate: p(
|
|
1968
|
+
"billTable.filter.sdiEntryDate",
|
|
1969
|
+
"Date received by SDI"
|
|
1970
|
+
),
|
|
1971
|
+
relationType: p("billTable.filter.relationType", "Counterparty type"),
|
|
1972
|
+
relation: p("billTable.filter.relation", "Counterparty"),
|
|
1973
|
+
insurance: p("billTable.filter.insurance", "Insurer"),
|
|
1974
|
+
personalAssistant: p(
|
|
1975
|
+
"billTable.filter.personalAssistant",
|
|
1976
|
+
"Personal assistant"
|
|
1977
|
+
)
|
|
1978
|
+
}, ...he }), [p, he]), ct = Ji({
|
|
1979
|
+
callbacksRef: Q,
|
|
1980
|
+
available: {
|
|
1981
|
+
download: !!L,
|
|
1982
|
+
loadIntoWarehouse: !!x,
|
|
1983
|
+
edit: !!ce,
|
|
1984
|
+
recordPayment: !!ue,
|
|
1985
|
+
writeOff: !!pe,
|
|
1986
|
+
delete: !!be
|
|
1987
|
+
},
|
|
1988
|
+
privacyMode: E
|
|
1989
|
+
}), ut = Tt((g) => {
|
|
1990
|
+
Q.current.onOpen(g, _);
|
|
1991
|
+
}, []), pt = Yi({
|
|
1992
|
+
currency: b,
|
|
1993
|
+
showWarehouseStatus: m,
|
|
1994
|
+
sortableColumns: y,
|
|
1995
|
+
totals: i,
|
|
1996
|
+
privacyMode: E,
|
|
1997
|
+
openHintId: we,
|
|
1998
|
+
onOpenRow: ut,
|
|
1999
|
+
rowActions: ct
|
|
2000
|
+
}), bt = $.map((g) => {
|
|
2001
|
+
const D = Y[g];
|
|
2002
|
+
return { value: g, label: p(D.key, D.en) };
|
|
2003
|
+
}), mt = /* @__PURE__ */ T(N, { children: [
|
|
2004
|
+
/* @__PURE__ */ T(N.FilterBar, { children: [
|
|
2005
|
+
Xe,
|
|
2006
|
+
/* @__PURE__ */ l(
|
|
2007
|
+
N.QuickSearch,
|
|
2008
|
+
{
|
|
2009
|
+
placeholder: E ? p("billTable.search.placeholderPrivate", "Search by number") : p(
|
|
2010
|
+
"billTable.search.placeholder",
|
|
2011
|
+
"Search by number or counterparty"
|
|
2012
|
+
)
|
|
2013
|
+
}
|
|
2014
|
+
),
|
|
2015
|
+
/* @__PURE__ */ l(
|
|
2016
|
+
N.FacetFilter,
|
|
2017
|
+
{
|
|
2018
|
+
field: "direction",
|
|
2019
|
+
label: p("billTable.column.direction", "Direction"),
|
|
2020
|
+
options: [
|
|
2021
|
+
{ value: null, label: p("dataTable.selectFilter.all", "All") },
|
|
2022
|
+
...bt
|
|
2023
|
+
]
|
|
2024
|
+
}
|
|
2025
|
+
),
|
|
2026
|
+
/* @__PURE__ */ l(N.FilterChips, {})
|
|
2027
|
+
] }),
|
|
2028
|
+
/* @__PURE__ */ T(N.Actions, { children: [
|
|
2029
|
+
S && Z ? /* @__PURE__ */ T(ne, { children: [
|
|
2030
|
+
/* @__PURE__ */ l(
|
|
2031
|
+
N.BulkAction,
|
|
2032
|
+
{
|
|
2033
|
+
label: p("billTable.bulk.downloadPdf", "Download PDFs"),
|
|
2034
|
+
icon: /* @__PURE__ */ l(xe, { "aria-hidden": "true" }),
|
|
2035
|
+
onAction: ({ selectedRowIds: g }) => Z([...g], "pdf")
|
|
2036
|
+
}
|
|
2037
|
+
),
|
|
2038
|
+
/* @__PURE__ */ l(
|
|
2039
|
+
N.BulkAction,
|
|
2040
|
+
{
|
|
2041
|
+
label: p("billTable.bulk.downloadXml", "Download XML files"),
|
|
2042
|
+
icon: /* @__PURE__ */ l(Fe, { "aria-hidden": "true" }),
|
|
2043
|
+
onAction: ({ selectedRowIds: g }) => Z([...g], "xml")
|
|
2044
|
+
}
|
|
2045
|
+
)
|
|
2046
|
+
] }) : null,
|
|
2047
|
+
/* @__PURE__ */ T(
|
|
2048
|
+
It,
|
|
2049
|
+
{
|
|
2050
|
+
"aria-label": p("dataTable.tableActions", "Table actions"),
|
|
2051
|
+
children: [
|
|
2052
|
+
me.length > 0 && fe ? (
|
|
2053
|
+
// Today's list downloads apply the query to every matching
|
|
2054
|
+
// bill on the server; DataGrid's built-in CSV, Excel and PDF
|
|
2055
|
+
// would export one page, so only custom items are offered.
|
|
2056
|
+
/* @__PURE__ */ l(
|
|
2057
|
+
N.ExportMenu,
|
|
2058
|
+
{
|
|
2059
|
+
label: p("billTable.export.menu", "Download list"),
|
|
2060
|
+
children: me.map((g) => {
|
|
2061
|
+
const D = Ei[g];
|
|
2062
|
+
return /* @__PURE__ */ l(
|
|
2063
|
+
N.ExportMenu.Item,
|
|
2064
|
+
{
|
|
2065
|
+
format: "custom",
|
|
2066
|
+
label: p(D.key, D.en),
|
|
2067
|
+
onExport: () => fe(g, U.getQuery())
|
|
2068
|
+
},
|
|
2069
|
+
g
|
|
2070
|
+
);
|
|
2071
|
+
})
|
|
2072
|
+
}
|
|
2073
|
+
)
|
|
2074
|
+
) : null,
|
|
2075
|
+
ye ? /* @__PURE__ */ l(N.Refresh, { onRefresh: ye }) : null,
|
|
2076
|
+
/* @__PURE__ */ l(N.ColumnToggle, {})
|
|
2077
|
+
]
|
|
2078
|
+
}
|
|
2079
|
+
)
|
|
2080
|
+
] })
|
|
2081
|
+
] });
|
|
2082
|
+
return /* @__PURE__ */ T(
|
|
2083
|
+
"div",
|
|
2084
|
+
{
|
|
2085
|
+
"data-component": "bill-table",
|
|
2086
|
+
"data-component-id": u,
|
|
2087
|
+
className: oi({ height: ve, className: et }),
|
|
2088
|
+
...nt,
|
|
2089
|
+
children: [
|
|
2090
|
+
/* @__PURE__ */ l("span", { hidden: !0, id: we, children: p("billTable.open", "Open bill") }),
|
|
2091
|
+
/* @__PURE__ */ l(
|
|
2092
|
+
wt,
|
|
2093
|
+
{
|
|
2094
|
+
ref: G,
|
|
2095
|
+
columns: pt,
|
|
2096
|
+
rows: s,
|
|
2097
|
+
getRowId: ta,
|
|
2098
|
+
caption: Qe ?? p("billTable.caption", "Bills"),
|
|
2099
|
+
"aria-label": tt,
|
|
2100
|
+
"aria-labelledby": it,
|
|
2101
|
+
"aria-describedby": at,
|
|
2102
|
+
gridId: u,
|
|
2103
|
+
registerAgent: !1,
|
|
2104
|
+
persistColumnState: r,
|
|
2105
|
+
dataMode: "server",
|
|
2106
|
+
rowCount: c,
|
|
2107
|
+
sorting: rt,
|
|
2108
|
+
defaultSorting: (o == null ? void 0 : o.sorting) ?? vi,
|
|
2109
|
+
filters: n == null ? void 0 : n.filters,
|
|
2110
|
+
defaultFilters: o == null ? void 0 : o.filters,
|
|
2111
|
+
quickFilter: n == null ? void 0 : n.quickFilter,
|
|
2112
|
+
defaultQuickFilter: o == null ? void 0 : o.quickFilter,
|
|
2113
|
+
page: n == null ? void 0 : n.pagination,
|
|
2114
|
+
defaultPage: o == null ? void 0 : o.pagination,
|
|
2115
|
+
onQueryChange: lt,
|
|
2116
|
+
filterLabels: dt,
|
|
2117
|
+
multiSort: !1,
|
|
2118
|
+
maxSortLevels: 1,
|
|
2119
|
+
pagination: st,
|
|
2120
|
+
selectionMode: S ? "multiple" : "none",
|
|
2121
|
+
rowSelection: I,
|
|
2122
|
+
defaultRowSelection: k,
|
|
2123
|
+
onRowSelectionChange: f,
|
|
2124
|
+
selectAllScope: "page",
|
|
2125
|
+
rangeSelection: !0,
|
|
2126
|
+
clearSelectionOnFilterChange: !0,
|
|
2127
|
+
columnResizing: !0,
|
|
2128
|
+
responsiveColumns: !0,
|
|
2129
|
+
getRowLabel: ia,
|
|
2130
|
+
rowLabelPrivacySafe: !0,
|
|
2131
|
+
status: ge,
|
|
2132
|
+
error: {
|
|
2133
|
+
title: (O == null ? void 0 : O.title) ?? p("billTable.error.title", "The bills could not be loaded"),
|
|
2134
|
+
description: O == null ? void 0 : O.description,
|
|
2135
|
+
onRetry: O == null ? void 0 : O.onRetry,
|
|
2136
|
+
headingLevel: Se
|
|
2137
|
+
},
|
|
2138
|
+
empty: {
|
|
2139
|
+
title: p("billTable.empty.title", "No bills yet"),
|
|
2140
|
+
description: p(
|
|
2141
|
+
"billTable.empty.description",
|
|
2142
|
+
"Bills you create, or receive from SDI, appear here."
|
|
2143
|
+
),
|
|
2144
|
+
action: Te ? {
|
|
2145
|
+
label: p("billTable.empty.action", "Add bill"),
|
|
2146
|
+
onClick: Te
|
|
2147
|
+
} : void 0,
|
|
2148
|
+
headingLevel: Se,
|
|
2149
|
+
noResultsTitle: p(
|
|
2150
|
+
"billTable.empty.noResultsTitle",
|
|
2151
|
+
"No bills match your filters"
|
|
2152
|
+
)
|
|
2153
|
+
},
|
|
2154
|
+
toolbar: mt,
|
|
2155
|
+
density: Je,
|
|
2156
|
+
height: ve,
|
|
2157
|
+
privacyMode: E
|
|
2158
|
+
}
|
|
2159
|
+
)
|
|
2160
|
+
]
|
|
2161
|
+
}
|
|
2162
|
+
);
|
|
2163
|
+
}
|
|
2164
|
+
);
|
|
2165
|
+
aa.displayName = "BillTable";
|
|
2166
|
+
const Ce = ["incoming"], Re = ["outgoing"], Pe = [
|
|
2167
|
+
"unpaid",
|
|
2168
|
+
"partiallyPaid",
|
|
2169
|
+
"overdue"
|
|
2170
|
+
], na = ["received"], oa = ["notLoaded", "toReview"];
|
|
2171
|
+
function Ka({
|
|
2172
|
+
withWarehouse: e = !1
|
|
2173
|
+
} = {}) {
|
|
2174
|
+
const { t } = v("ui");
|
|
2175
|
+
return M(() => {
|
|
2176
|
+
const a = [
|
|
2177
|
+
{
|
|
2178
|
+
id: "bills-this-year",
|
|
2179
|
+
label: t("billTable.tabs.thisYear", "This year"),
|
|
2180
|
+
filterModel: { datePreset: "thisYear" },
|
|
2181
|
+
locked: !0,
|
|
2182
|
+
userNamed: !1
|
|
2183
|
+
},
|
|
2184
|
+
{
|
|
2185
|
+
id: "bills-all",
|
|
2186
|
+
label: t("billTable.tabs.all", "All"),
|
|
2187
|
+
filterModel: {},
|
|
2188
|
+
locked: !0,
|
|
2189
|
+
userNamed: !1
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
id: "bills-incoming",
|
|
2193
|
+
label: t("billTable.tabs.incoming", "Incoming"),
|
|
2194
|
+
filterModel: { direction: { type: "set", values: [...Ce] } },
|
|
2195
|
+
userNamed: !1
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
id: "bills-outgoing",
|
|
2199
|
+
label: t("billTable.tabs.outgoing", "Outgoing"),
|
|
2200
|
+
filterModel: { direction: { type: "set", values: [...Re] } },
|
|
2201
|
+
userNamed: !1
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
id: "bills-to-pay",
|
|
2205
|
+
label: t("billTable.tabs.toPay", "To pay"),
|
|
2206
|
+
filterModel: {
|
|
2207
|
+
direction: { type: "set", values: [...Ce] },
|
|
2208
|
+
paymentStatus: { type: "set", values: [...Pe] }
|
|
2209
|
+
},
|
|
2210
|
+
userNamed: !1
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
id: "bills-to-collect",
|
|
2214
|
+
label: t("billTable.tabs.toCollect", "To collect"),
|
|
2215
|
+
filterModel: {
|
|
2216
|
+
direction: { type: "set", values: [...Re] },
|
|
2217
|
+
paymentStatus: { type: "set", values: [...Pe] }
|
|
2218
|
+
},
|
|
2219
|
+
userNamed: !1
|
|
2220
|
+
}
|
|
2221
|
+
];
|
|
2222
|
+
return e && a.push({
|
|
2223
|
+
id: "bills-to-load",
|
|
2224
|
+
label: t("billTable.tabs.toLoad", "To load into warehouse"),
|
|
2225
|
+
filterModel: {
|
|
2226
|
+
sdiStatus: { type: "set", values: [...na] },
|
|
2227
|
+
warehouseStatus: { type: "set", values: [...oa] }
|
|
2228
|
+
},
|
|
2229
|
+
userNamed: !1
|
|
2230
|
+
}), a;
|
|
2231
|
+
}, [t, e]);
|
|
2232
|
+
}
|
|
2233
|
+
export {
|
|
2234
|
+
Wa as B,
|
|
2235
|
+
Fa as a,
|
|
2236
|
+
$ as b,
|
|
2237
|
+
Ma as c,
|
|
2238
|
+
yi as d,
|
|
2239
|
+
Ue as e,
|
|
2240
|
+
hi as f,
|
|
2241
|
+
Ti as g,
|
|
2242
|
+
Ua as h,
|
|
2243
|
+
Ke as i,
|
|
2244
|
+
xa as j,
|
|
2245
|
+
gi as k,
|
|
2246
|
+
aa as l,
|
|
2247
|
+
ni as m,
|
|
2248
|
+
Ka as u
|
|
2249
|
+
};
|
|
2250
|
+
//# sourceMappingURL=default-tabs-BQcSqcNG.js.map
|