@nice2dev/ui-erp 1.0.10 → 1.0.12

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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useState, useMemo, useCallback } from "react";
2
+ import React, { useState, useMemo, useCallback, forwardRef, useRef, useEffect } from "react";
3
3
  const DEFAULT_VIEW_CONFIG$1 = {
4
4
  timeUnit: "day",
5
5
  showUtilization: true,
@@ -128,13 +128,13 @@ const NiceResourceAllocation = ({
128
128
  return "transparent";
129
129
  }
130
130
  if (util.overallocated) {
131
- return "rgba(239, 68, 68, 0.4)";
131
+ return "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))";
132
132
  }
133
133
  if (util.utilizationPercent >= config.utilizationThreshold) {
134
- return "rgba(245, 158, 11, 0.3)";
134
+ return "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))";
135
135
  }
136
136
  if (util.utilizationPercent > 0) {
137
- return "rgba(34, 197, 94, 0.2)";
137
+ return "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))";
138
138
  }
139
139
  return "transparent";
140
140
  };
@@ -235,11 +235,11 @@ const NiceResourceAllocation = ({
235
235
  ] }),
236
236
  /* @__PURE__ */ jsxs("div", { className: "allocation__legend", children: [
237
237
  /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
238
- /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "rgba(34, 197, 94, 0.2)" } }),
238
+ /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "var(--nice-success-tint-20, rgba(34, 197, 94, 0.2))" } }),
239
239
  /* @__PURE__ */ jsx("span", { children: "Allocated" })
240
240
  ] }),
241
241
  /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
242
- /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "rgba(245, 158, 11, 0.3)" } }),
242
+ /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "var(--nice-warning-tint-30, rgba(245, 158, 11, 0.3))" } }),
243
243
  /* @__PURE__ */ jsxs("span", { children: [
244
244
  "High Utilization (",
245
245
  ">",
@@ -249,7 +249,7 @@ const NiceResourceAllocation = ({
249
249
  ] })
250
250
  ] }),
251
251
  /* @__PURE__ */ jsxs("div", { className: "legend-item", children: [
252
- /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "rgba(239, 68, 68, 0.4)" } }),
252
+ /* @__PURE__ */ jsx("span", { className: "legend-color", style: { backgroundColor: "var(--nice-danger-tint-40, rgba(239, 68, 68, 0.4))" } }),
253
253
  /* @__PURE__ */ jsx("span", { children: "Overallocated" })
254
254
  ] })
255
255
  ] }),
@@ -572,17 +572,17 @@ const NiceInventoryManager = ({
572
572
  const getStatusColor = (status) => {
573
573
  switch (status) {
574
574
  case "in-stock":
575
- return "#22c55e";
575
+ return "var(--nice-success, #22c55e)";
576
576
  case "low-stock":
577
- return "#f59e0b";
577
+ return "var(--nice-warning, #f59e0b)";
578
578
  case "out-of-stock":
579
- return "#ef4444";
579
+ return "var(--nice-danger, #ef4444)";
580
580
  case "on-order":
581
- return "#3b82f6";
581
+ return "var(--nice-primary, #3b82f6)";
582
582
  case "discontinued":
583
- return "#6b7280";
583
+ return "var(--nice-text-secondary, #6b7280)";
584
584
  default:
585
- return "#6b7280";
585
+ return "var(--nice-text-secondary, #6b7280)";
586
586
  }
587
587
  };
588
588
  const getTransactionIcon = (type) => {
@@ -1264,8 +1264,741 @@ const NiceInventoryManager = ({
1264
1264
  ] }) })
1265
1265
  ] });
1266
1266
  };
1267
+ const STATUS_COLOR = {
1268
+ draft: "var(--nice-color-muted, #6b7280)",
1269
+ issued: "var(--nice-color-info, #2563eb)",
1270
+ sent: "var(--nice-color-info, #2563eb)",
1271
+ paid: "var(--nice-color-success, #16a34a)",
1272
+ "partially-paid": "var(--nice-color-warning, #ca8a04)",
1273
+ overdue: "var(--nice-color-danger, #dc2626)",
1274
+ cancelled: "var(--nice-color-muted, #6b7280)"
1275
+ };
1276
+ function lineNet(line) {
1277
+ const gross = line.quantity * line.unitPrice.amount;
1278
+ const discounted = line.discount ? gross * (1 - line.discount) : gross;
1279
+ return Math.round(discounted);
1280
+ }
1281
+ function lineVat(line) {
1282
+ return Math.round(lineNet(line) * line.vatRate);
1283
+ }
1284
+ function fmtMoney$1(amount, currency, locale) {
1285
+ const code = typeof currency === "string" ? currency : currency.code;
1286
+ const decimals = typeof currency === "string" ? 2 : currency.decimalPlaces ?? 2;
1287
+ return new Intl.NumberFormat(locale, { style: "currency", currency: code }).format(amount / Math.pow(10, decimals));
1288
+ }
1289
+ function fmtDate$1(d, locale) {
1290
+ const dt = d instanceof Date ? d : new Date(d);
1291
+ return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
1292
+ }
1293
+ const NiceInvoiceView = forwardRef(
1294
+ function NiceInvoiceView2({ invoice, locale, currency, hideSections, labels, onAction, showActions = false, density = "comfortable", className, style, id }, ref) {
1295
+ var _a;
1296
+ const cur = currency ?? invoice.currency ?? ((_a = invoice.lines[0]) == null ? void 0 : _a.unitPrice.currency) ?? "EUR";
1297
+ const L = {
1298
+ invoiceNumber: "Invoice",
1299
+ issueDate: "Issue date",
1300
+ dueDate: "Due date",
1301
+ seller: "Seller",
1302
+ buyer: "Buyer",
1303
+ description: "Description",
1304
+ qty: "Qty",
1305
+ unitPrice: "Unit price",
1306
+ vat: "VAT",
1307
+ net: "Net",
1308
+ gross: "Gross",
1309
+ subtotal: "Subtotal",
1310
+ vatTotal: "VAT total",
1311
+ total: "Total",
1312
+ vatBreakdown: "VAT breakdown",
1313
+ timeline: "History",
1314
+ notes: "Notes",
1315
+ vatId: "VAT ID",
1316
+ ...labels
1317
+ };
1318
+ const totals = useMemo(() => {
1319
+ let net = 0;
1320
+ let vat = 0;
1321
+ const byRate = /* @__PURE__ */ new Map();
1322
+ for (const ln of invoice.lines) {
1323
+ const n = lineNet(ln);
1324
+ const v = lineVat(ln);
1325
+ net += n;
1326
+ vat += v;
1327
+ const cell = byRate.get(ln.vatRate) ?? { net: 0, vat: 0 };
1328
+ cell.net += n;
1329
+ cell.vat += v;
1330
+ byRate.set(ln.vatRate, cell);
1331
+ }
1332
+ return { net, vat, gross: net + vat, byRate };
1333
+ }, [invoice.lines]);
1334
+ return /* @__PURE__ */ jsxs(
1335
+ "article",
1336
+ {
1337
+ ref,
1338
+ id,
1339
+ className: `nice-invoice-view nice-invoice-view--${density} ${className ?? ""}`,
1340
+ style,
1341
+ "aria-label": `${L.invoiceNumber} ${invoice.invoiceNumber}`,
1342
+ children: [
1343
+ !(hideSections == null ? void 0 : hideSections.header) && /* @__PURE__ */ jsxs("header", { className: "nice-invoice-view__header", children: [
1344
+ /* @__PURE__ */ jsxs("div", { children: [
1345
+ /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__title", children: [
1346
+ L.invoiceNumber,
1347
+ " ",
1348
+ /* @__PURE__ */ jsx("strong", { children: invoice.invoiceNumber })
1349
+ ] }),
1350
+ /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__dates", children: [
1351
+ /* @__PURE__ */ jsxs("span", { children: [
1352
+ L.issueDate,
1353
+ ": ",
1354
+ fmtDate$1(invoice.issueDate, locale)
1355
+ ] }),
1356
+ /* @__PURE__ */ jsxs("span", { children: [
1357
+ L.dueDate,
1358
+ ": ",
1359
+ fmtDate$1(invoice.dueDate, locale)
1360
+ ] })
1361
+ ] })
1362
+ ] }),
1363
+ /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__status", style: { color: STATUS_COLOR[invoice.status] }, children: [
1364
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "●" }),
1365
+ " ",
1366
+ invoice.status
1367
+ ] }),
1368
+ showActions && /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__actions", children: [
1369
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onAction == null ? void 0 : onAction("download"), children: "↓" }),
1370
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onAction == null ? void 0 : onAction("print"), children: "⎙" }),
1371
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onAction == null ? void 0 : onAction("send"), children: "✉" })
1372
+ ] })
1373
+ ] }),
1374
+ !(hideSections == null ? void 0 : hideSections.header) && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__parties", children: [
1375
+ /* @__PURE__ */ jsxs("div", { children: [
1376
+ /* @__PURE__ */ jsx("h4", { children: L.seller }),
1377
+ /* @__PURE__ */ jsx("div", { children: invoice.seller.name }),
1378
+ invoice.seller.vatId && /* @__PURE__ */ jsxs("div", { children: [
1379
+ L.vatId,
1380
+ ": ",
1381
+ invoice.seller.vatId
1382
+ ] })
1383
+ ] }),
1384
+ /* @__PURE__ */ jsxs("div", { children: [
1385
+ /* @__PURE__ */ jsx("h4", { children: L.buyer }),
1386
+ /* @__PURE__ */ jsx("div", { children: invoice.buyer.name }),
1387
+ invoice.buyer.vatId && /* @__PURE__ */ jsxs("div", { children: [
1388
+ L.vatId,
1389
+ ": ",
1390
+ invoice.buyer.vatId
1391
+ ] })
1392
+ ] })
1393
+ ] }),
1394
+ !(hideSections == null ? void 0 : hideSections.lines) && /* @__PURE__ */ jsxs("table", { className: "nice-invoice-view__lines", children: [
1395
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
1396
+ /* @__PURE__ */ jsx("th", { children: L.description }),
1397
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.qty }),
1398
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.unitPrice }),
1399
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.vat }),
1400
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.net }),
1401
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.gross })
1402
+ ] }) }),
1403
+ /* @__PURE__ */ jsx("tbody", { children: invoice.lines.map((ln) => {
1404
+ const n = lineNet(ln);
1405
+ const v = lineVat(ln);
1406
+ return /* @__PURE__ */ jsxs("tr", { children: [
1407
+ /* @__PURE__ */ jsx("td", { children: ln.description }),
1408
+ /* @__PURE__ */ jsxs("td", { className: "nice-num", children: [
1409
+ ln.quantity,
1410
+ ln.unit ? ` ${ln.unit}` : ""
1411
+ ] }),
1412
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(ln.unitPrice.amount, cur, locale) }),
1413
+ /* @__PURE__ */ jsxs("td", { className: "nice-num", children: [
1414
+ (ln.vatRate * 100).toFixed(0),
1415
+ "%"
1416
+ ] }),
1417
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(n, cur, locale) }),
1418
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(n + v, cur, locale) })
1419
+ ] }, ln.id);
1420
+ }) })
1421
+ ] }),
1422
+ !(hideSections == null ? void 0 : hideSections.vat) && totals.byRate.size > 0 && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__vat", children: [
1423
+ /* @__PURE__ */ jsx("h4", { children: L.vatBreakdown }),
1424
+ /* @__PURE__ */ jsxs("table", { children: [
1425
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
1426
+ /* @__PURE__ */ jsx("th", { children: L.vat }),
1427
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.net }),
1428
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.vat }),
1429
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.gross })
1430
+ ] }) }),
1431
+ /* @__PURE__ */ jsx("tbody", { children: [...totals.byRate.entries()].sort((a, b) => b[0] - a[0]).map(([rate, c]) => /* @__PURE__ */ jsxs("tr", { children: [
1432
+ /* @__PURE__ */ jsxs("td", { children: [
1433
+ (rate * 100).toFixed(0),
1434
+ "%"
1435
+ ] }),
1436
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c.net, cur, locale) }),
1437
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c.vat, cur, locale) }),
1438
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney$1(c.net + c.vat, cur, locale) })
1439
+ ] }, rate)) })
1440
+ ] })
1441
+ ] }),
1442
+ !(hideSections == null ? void 0 : hideSections.totals) && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__totals", "aria-label": L.total, children: [
1443
+ /* @__PURE__ */ jsxs("div", { children: [
1444
+ /* @__PURE__ */ jsx("span", { children: L.subtotal }),
1445
+ /* @__PURE__ */ jsx("span", { children: fmtMoney$1(totals.net, cur, locale) })
1446
+ ] }),
1447
+ /* @__PURE__ */ jsxs("div", { children: [
1448
+ /* @__PURE__ */ jsx("span", { children: L.vatTotal }),
1449
+ /* @__PURE__ */ jsx("span", { children: fmtMoney$1(totals.vat, cur, locale) })
1450
+ ] }),
1451
+ /* @__PURE__ */ jsxs("div", { className: "nice-invoice-view__grand", children: [
1452
+ /* @__PURE__ */ jsx("span", { children: L.total }),
1453
+ /* @__PURE__ */ jsx("strong", { children: fmtMoney$1(totals.gross, cur, locale) })
1454
+ ] })
1455
+ ] }),
1456
+ !(hideSections == null ? void 0 : hideSections.timeline) && invoice.history && invoice.history.length > 0 && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__timeline", children: [
1457
+ /* @__PURE__ */ jsx("h4", { children: L.timeline }),
1458
+ /* @__PURE__ */ jsx("ol", { children: invoice.history.map((h, i) => /* @__PURE__ */ jsxs("li", { children: [
1459
+ /* @__PURE__ */ jsx("span", { className: "nice-invoice-view__t-date", children: fmtDate$1(h.at, locale) }),
1460
+ /* @__PURE__ */ jsx("span", { className: "nice-invoice-view__t-status", style: { color: STATUS_COLOR[h.status] }, children: h.status }),
1461
+ h.note && /* @__PURE__ */ jsxs("span", { className: "nice-invoice-view__t-note", children: [
1462
+ " — ",
1463
+ h.note
1464
+ ] })
1465
+ ] }, i)) })
1466
+ ] }),
1467
+ !(hideSections == null ? void 0 : hideSections.notes) && invoice.notes && /* @__PURE__ */ jsxs("section", { className: "nice-invoice-view__notes", children: [
1468
+ /* @__PURE__ */ jsx("h4", { children: L.notes }),
1469
+ /* @__PURE__ */ jsx("p", { children: invoice.notes })
1470
+ ] })
1471
+ ]
1472
+ }
1473
+ );
1474
+ }
1475
+ );
1476
+ function colorFor(occ, colors) {
1477
+ if (occ <= 0.01) return colors.low;
1478
+ if (occ < 0.5) return colors.low;
1479
+ if (occ < 0.85) return colors.mid;
1480
+ return colors.high;
1481
+ }
1482
+ const NiceWarehouseView = forwardRef(
1483
+ function NiceWarehouseView2({ warehouseName, cells, colors = { low: "#dcfce7", mid: "#fde68a", high: "#fecaca" }, onCellClick, showLegend = true, cellSize = 48, aisleEvery = 4, className, style, id }, ref) {
1484
+ const [hovered, setHovered] = useState(null);
1485
+ const grid = useMemo(() => {
1486
+ const rows = /* @__PURE__ */ new Map();
1487
+ for (const c of cells) {
1488
+ const rowKey = c.row !== void 0 ? `r${c.row}` : c.location.rack ?? c.location.aisle ?? "0";
1489
+ let arr = rows.get(rowKey);
1490
+ if (!arr) {
1491
+ arr = [];
1492
+ rows.set(rowKey, arr);
1493
+ }
1494
+ arr.push(c);
1495
+ }
1496
+ return [...rows.entries()].map(([rowKey, arr]) => ({ rowKey, cells: arr }));
1497
+ }, [cells]);
1498
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-warehouse-view ${className ?? ""}`, style, children: [
1499
+ /* @__PURE__ */ jsxs("header", { className: "nice-warehouse-view__header", children: [
1500
+ /* @__PURE__ */ jsx("h3", { children: warehouseName }),
1501
+ showLegend && /* @__PURE__ */ jsxs("div", { className: "nice-warehouse-view__legend", "aria-label": "Occupancy legend", children: [
1502
+ /* @__PURE__ */ jsx("span", { style: { background: colors.low } }),
1503
+ " low",
1504
+ /* @__PURE__ */ jsx("span", { style: { background: colors.mid } }),
1505
+ " mid",
1506
+ /* @__PURE__ */ jsx("span", { style: { background: colors.high } }),
1507
+ " high"
1508
+ ] })
1509
+ ] }),
1510
+ /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__grid", role: "grid", "aria-label": warehouseName, children: grid.map(({ rowKey, cells: row }) => /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__row", role: "row", children: row.map((c, idx) => {
1511
+ const key = [c.location.rack, c.location.aisle, c.location.shelf, c.location.bin].filter(Boolean).join("-") || String(idx);
1512
+ const aisleBreak = aisleEvery > 0 && idx > 0 && idx % aisleEvery === 0;
1513
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
1514
+ aisleBreak && /* @__PURE__ */ jsx("div", { className: "nice-warehouse-view__aisle", "aria-hidden": true }),
1515
+ /* @__PURE__ */ jsx(
1516
+ "button",
1517
+ {
1518
+ type: "button",
1519
+ role: "gridcell",
1520
+ className: "nice-warehouse-view__cell",
1521
+ style: {
1522
+ width: cellSize,
1523
+ height: cellSize,
1524
+ background: colorFor(c.occupancy, colors)
1525
+ },
1526
+ title: `${key} — ${(c.occupancy * 100).toFixed(0)}% (${c.items.length} items)`,
1527
+ onClick: () => onCellClick == null ? void 0 : onCellClick(c),
1528
+ onMouseEnter: () => setHovered(c),
1529
+ onMouseLeave: () => setHovered(null),
1530
+ children: /* @__PURE__ */ jsx("span", { className: "nice-warehouse-view__bin", children: c.location.bin ?? c.location.shelf ?? "" })
1531
+ }
1532
+ )
1533
+ ] }, key);
1534
+ }) }, rowKey)) }),
1535
+ hovered && /* @__PURE__ */ jsxs("aside", { className: "nice-warehouse-view__details", "aria-live": "polite", children: [
1536
+ /* @__PURE__ */ jsxs("strong", { children: [
1537
+ hovered.location.rack,
1538
+ "/",
1539
+ hovered.location.shelf,
1540
+ "/",
1541
+ hovered.location.bin
1542
+ ] }),
1543
+ /* @__PURE__ */ jsxs("div", { children: [
1544
+ hovered.items.length,
1545
+ " items · ",
1546
+ (hovered.occupancy * 100).toFixed(0),
1547
+ "% full"
1548
+ ] }),
1549
+ /* @__PURE__ */ jsxs("ul", { children: [
1550
+ hovered.items.slice(0, 5).map((it) => /* @__PURE__ */ jsxs("li", { children: [
1551
+ it.sku,
1552
+ " — ",
1553
+ it.name
1554
+ ] }, it.id)),
1555
+ hovered.items.length > 5 && /* @__PURE__ */ jsxs("li", { children: [
1556
+ "…+",
1557
+ hovered.items.length - 5
1558
+ ] })
1559
+ ] })
1560
+ ] })
1561
+ ] });
1562
+ }
1563
+ );
1564
+ const STATUS_TINT = {
1565
+ draft: "#6b7280",
1566
+ "pending-approval": "#ca8a04",
1567
+ approved: "#2563eb",
1568
+ ordered: "#0891b2",
1569
+ "partially-received": "#9333ea",
1570
+ received: "#16a34a",
1571
+ cancelled: "#dc2626"
1572
+ };
1573
+ function fmtMoney(amount, currency, locale) {
1574
+ const code = typeof currency === "string" ? currency : currency.code;
1575
+ const decimals = typeof currency === "string" ? 2 : currency.decimalPlaces ?? 2;
1576
+ return new Intl.NumberFormat(locale, { style: "currency", currency: code }).format(amount / Math.pow(10, decimals));
1577
+ }
1578
+ function fmtDate(d, locale) {
1579
+ if (!d) return "—";
1580
+ const dt = d instanceof Date ? d : new Date(d);
1581
+ return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(dt);
1582
+ }
1583
+ const NicePurchaseOrder = forwardRef(
1584
+ function NicePurchaseOrder2({ orders, selectable = true, initialSelectedId, locale, labels, readOnly, onOrderApprove, onReceiveItems, onOrderUpdate, className, style, id }, ref) {
1585
+ var _a;
1586
+ const [selectedId, setSelectedId] = useState(initialSelectedId ?? ((_a = orders[0]) == null ? void 0 : _a.id));
1587
+ const L = {
1588
+ orderNumber: "PO #",
1589
+ supplier: "Supplier",
1590
+ status: "Status",
1591
+ orderDate: "Ordered",
1592
+ expected: "Expected",
1593
+ total: "Total",
1594
+ sku: "SKU",
1595
+ name: "Item",
1596
+ qty: "Qty",
1597
+ received: "Recv",
1598
+ unitPrice: "Unit",
1599
+ lineTotal: "Subtotal",
1600
+ notes: "Notes",
1601
+ approve: "Approve",
1602
+ receive: "Receive all",
1603
+ ...labels
1604
+ };
1605
+ const selected = useMemo(
1606
+ () => orders.find((o) => o.id === selectedId),
1607
+ [orders, selectedId]
1608
+ );
1609
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-purchase-order ${className ?? ""}`, style, children: [
1610
+ /* @__PURE__ */ jsxs("table", { className: "nice-purchase-order__list", children: [
1611
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
1612
+ /* @__PURE__ */ jsx("th", { children: L.orderNumber }),
1613
+ /* @__PURE__ */ jsx("th", { children: L.supplier }),
1614
+ /* @__PURE__ */ jsx("th", { children: L.status }),
1615
+ /* @__PURE__ */ jsx("th", { children: L.orderDate }),
1616
+ /* @__PURE__ */ jsx("th", { children: L.expected }),
1617
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.total })
1618
+ ] }) }),
1619
+ /* @__PURE__ */ jsx("tbody", { children: orders.map((o) => /* @__PURE__ */ jsxs(
1620
+ "tr",
1621
+ {
1622
+ "aria-selected": o.id === selectedId,
1623
+ className: o.id === selectedId ? "is-selected" : void 0,
1624
+ onClick: () => selectable && setSelectedId(o.id),
1625
+ children: [
1626
+ /* @__PURE__ */ jsx("td", { children: o.orderNumber }),
1627
+ /* @__PURE__ */ jsx("td", { children: o.supplier.name }),
1628
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", { style: { color: STATUS_TINT[o.status] }, children: [
1629
+ "● ",
1630
+ o.status
1631
+ ] }) }),
1632
+ /* @__PURE__ */ jsx("td", { children: fmtDate(o.orderDate, locale) }),
1633
+ /* @__PURE__ */ jsx("td", { children: fmtDate(o.expectedDelivery, locale) }),
1634
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(o.total.amount, o.total.currency, locale) })
1635
+ ]
1636
+ },
1637
+ o.id
1638
+ )) })
1639
+ ] }),
1640
+ selectable && selected && /* @__PURE__ */ jsxs("section", { className: "nice-purchase-order__detail", "aria-label": `${L.orderNumber} ${selected.orderNumber}`, children: [
1641
+ /* @__PURE__ */ jsxs("header", { children: [
1642
+ /* @__PURE__ */ jsxs("h3", { children: [
1643
+ selected.orderNumber,
1644
+ " — ",
1645
+ selected.supplier.name
1646
+ ] }),
1647
+ !readOnly && /* @__PURE__ */ jsxs("div", { className: "nice-purchase-order__actions", children: [
1648
+ selected.status === "pending-approval" && onOrderApprove && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onOrderApprove(selected.id), children: L.approve }),
1649
+ (selected.status === "ordered" || selected.status === "partially-received") && onReceiveItems && /* @__PURE__ */ jsx(
1650
+ "button",
1651
+ {
1652
+ type: "button",
1653
+ onClick: () => onReceiveItems(selected.id, selected.items.map((it) => ({ itemId: it.itemId, quantity: it.quantity - (it.receivedQuantity ?? 0) }))),
1654
+ children: L.receive
1655
+ }
1656
+ ),
1657
+ onOrderUpdate && selected.status === "draft" && /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onOrderUpdate({ ...selected, status: "pending-approval" }), children: "Submit" })
1658
+ ] })
1659
+ ] }),
1660
+ /* @__PURE__ */ jsxs("table", { className: "nice-purchase-order__items", children: [
1661
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
1662
+ /* @__PURE__ */ jsx("th", { children: L.sku }),
1663
+ /* @__PURE__ */ jsx("th", { children: L.name }),
1664
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.qty }),
1665
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.received }),
1666
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.unitPrice }),
1667
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.lineTotal })
1668
+ ] }) }),
1669
+ /* @__PURE__ */ jsx("tbody", { children: selected.items.map((it) => /* @__PURE__ */ jsxs("tr", { children: [
1670
+ /* @__PURE__ */ jsx("td", { children: it.sku }),
1671
+ /* @__PURE__ */ jsx("td", { children: it.itemName }),
1672
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: it.quantity }),
1673
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: it.receivedQuantity ?? 0 }),
1674
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(it.unitPrice.amount, it.unitPrice.currency, locale) }),
1675
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: fmtMoney(it.lineTotal.amount, it.lineTotal.currency, locale) })
1676
+ ] }, it.itemId)) }),
1677
+ /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { children: [
1678
+ /* @__PURE__ */ jsx("td", { colSpan: 5, className: "nice-num", children: L.total }),
1679
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: /* @__PURE__ */ jsx("strong", { children: fmtMoney(selected.total.amount, selected.total.currency, locale) }) })
1680
+ ] }) })
1681
+ ] }),
1682
+ selected.notes && /* @__PURE__ */ jsxs("p", { className: "nice-purchase-order__notes", children: [
1683
+ /* @__PURE__ */ jsxs("strong", { children: [
1684
+ L.notes,
1685
+ ":"
1686
+ ] }),
1687
+ " ",
1688
+ selected.notes
1689
+ ] })
1690
+ ] })
1691
+ ] });
1692
+ }
1693
+ );
1694
+ const NiceHRDashboard = forwardRef(
1695
+ function NiceHRDashboard2({ employees, labels, hideWidgets, locale, density = "comfortable", onWidgetClick, className, style, id }, ref) {
1696
+ const L = {
1697
+ headcount: "Headcount",
1698
+ fte: "FTE",
1699
+ vacationBalance: "Avg vacation balance",
1700
+ sickLeave: "Avg sick days (YTD)",
1701
+ departments: "Departments",
1702
+ activeEmployees: "Active",
1703
+ ...labels
1704
+ };
1705
+ const stats = useMemo(() => {
1706
+ const active = employees.filter((e) => e.active !== false);
1707
+ const fte = active.reduce((s, e) => s + (e.fte ?? 1), 0);
1708
+ const vacationAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.vacationBalanceDays ?? 0), 0) / active.length;
1709
+ const sickAvg = active.length === 0 ? 0 : active.reduce((s, e) => s + (e.sickLeaveDaysYtd ?? 0), 0) / active.length;
1710
+ const byDepartment = /* @__PURE__ */ new Map();
1711
+ for (const e of active) {
1712
+ const k = e.department ?? "—";
1713
+ byDepartment.set(k, (byDepartment.get(k) ?? 0) + 1);
1714
+ }
1715
+ return { headcount: employees.length, active: active.length, fte, vacationAvg, sickAvg, byDepartment };
1716
+ }, [employees]);
1717
+ const fmt = (n, d = 1) => n.toLocaleString(locale, { maximumFractionDigits: d });
1718
+ const Widget = ({ kind, label, value, hint }) => /* @__PURE__ */ jsxs(
1719
+ "button",
1720
+ {
1721
+ type: "button",
1722
+ className: "nice-hr-dashboard__widget",
1723
+ onClick: () => onWidgetClick == null ? void 0 : onWidgetClick(kind),
1724
+ children: [
1725
+ /* @__PURE__ */ jsx("span", { className: "nice-hr-dashboard__label", children: label }),
1726
+ /* @__PURE__ */ jsx("span", { className: "nice-hr-dashboard__value", children: value }),
1727
+ hint && /* @__PURE__ */ jsx("span", { className: "nice-hr-dashboard__hint", children: hint })
1728
+ ]
1729
+ }
1730
+ );
1731
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-hr-dashboard nice-hr-dashboard--${density} ${className ?? ""}`, style, role: "group", "aria-label": "HR dashboard", children: [
1732
+ !(hideWidgets == null ? void 0 : hideWidgets.headcount) && /* @__PURE__ */ jsx(Widget, { kind: "headcount", label: L.headcount, value: fmt(stats.headcount, 0), hint: `${L.activeEmployees}: ${fmt(stats.active, 0)}` }),
1733
+ !(hideWidgets == null ? void 0 : hideWidgets.fte) && /* @__PURE__ */ jsx(Widget, { kind: "fte", label: L.fte, value: fmt(stats.fte, 2) }),
1734
+ !(hideWidgets == null ? void 0 : hideWidgets.vacation) && /* @__PURE__ */ jsx(Widget, { kind: "vacation", label: L.vacationBalance, value: `${fmt(stats.vacationAvg, 1)} d` }),
1735
+ !(hideWidgets == null ? void 0 : hideWidgets.sick) && /* @__PURE__ */ jsx(Widget, { kind: "sick", label: L.sickLeave, value: `${fmt(stats.sickAvg, 1)} d` }),
1736
+ !(hideWidgets == null ? void 0 : hideWidgets.departments) && /* @__PURE__ */ jsx(
1737
+ Widget,
1738
+ {
1739
+ kind: "departments",
1740
+ label: L.departments,
1741
+ value: fmt(stats.byDepartment.size, 0),
1742
+ hint: /* @__PURE__ */ jsx("ul", { className: "nice-hr-dashboard__dept-list", children: [...stats.byDepartment.entries()].slice(0, 5).map(([d, n]) => /* @__PURE__ */ jsxs("li", { children: [
1743
+ d,
1744
+ ": ",
1745
+ n
1746
+ ] }, d)) })
1747
+ }
1748
+ )
1749
+ ] });
1750
+ }
1751
+ );
1752
+ const wait = (ms) => new Promise((r) => setTimeout(r, ms));
1753
+ const NICE_VAT_PRESETS = {
1754
+ PL: [
1755
+ { code: "PL-23", rate: 0.23, label: "23%", description: "Stawka podstawowa" },
1756
+ { code: "PL-8", rate: 0.08, label: "8%", description: "Stawka obniżona" },
1757
+ { code: "PL-5", rate: 0.05, label: "5%", description: "Stawka obniżona" },
1758
+ { code: "PL-0", rate: 0, label: "0%", description: "Stawka zerowa (eksport)" },
1759
+ { code: "PL-zw", rate: 0, label: "zw.", description: "Zwolnienie" }
1760
+ ],
1761
+ EU: [
1762
+ { code: "EU-21", rate: 0.21, label: "21%" },
1763
+ { code: "EU-19", rate: 0.19, label: "19%" },
1764
+ { code: "EU-9", rate: 0.09, label: "9%" },
1765
+ { code: "EU-0", rate: 0, label: "0%" }
1766
+ ],
1767
+ UK: [
1768
+ { code: "UK-20", rate: 0.2, label: "20%", description: "Standard" },
1769
+ { code: "UK-5", rate: 0.05, label: "5%", description: "Reduced" },
1770
+ { code: "UK-0", rate: 0, label: "0%", description: "Zero" }
1771
+ ]
1772
+ };
1773
+ const DEFAULT_SEED = {
1774
+ invoices: [],
1775
+ purchaseOrders: [],
1776
+ inventory: [],
1777
+ suppliers: [],
1778
+ employees: [],
1779
+ resources: [],
1780
+ vatRates: NICE_VAT_PRESETS.PL
1781
+ };
1782
+ function useMockErpApi(options = {}) {
1783
+ const { latencyMs = 300, errorRate = 0, seed } = options;
1784
+ const [loading, setLoading] = useState(true);
1785
+ const [error, setError] = useState(null);
1786
+ const [data, setData] = useState(() => ({ ...DEFAULT_SEED, ...seed }));
1787
+ const settledRef = useRef(false);
1788
+ const refresh = useCallback(async () => {
1789
+ setLoading(true);
1790
+ setError(null);
1791
+ await wait(latencyMs);
1792
+ if (Math.random() < errorRate) {
1793
+ setError(new Error("Mock ERP API: simulated failure"));
1794
+ } else {
1795
+ setData((d) => ({ ...d }));
1796
+ }
1797
+ setLoading(false);
1798
+ }, [latencyMs, errorRate]);
1799
+ useEffect(() => {
1800
+ if (settledRef.current) return;
1801
+ settledRef.current = true;
1802
+ void refresh();
1803
+ }, [refresh]);
1804
+ const writeWith = useCallback(
1805
+ async (key, item) => {
1806
+ await wait(latencyMs);
1807
+ if (Math.random() < errorRate) throw new Error("Mock ERP API: write failed");
1808
+ setData((d) => {
1809
+ const arr = [...d[key]];
1810
+ const idx = arr.findIndex((i) => i.id === item.id);
1811
+ if (idx >= 0) arr[idx] = item;
1812
+ else arr.push(item);
1813
+ return { ...d, [key]: arr };
1814
+ });
1815
+ },
1816
+ [latencyMs, errorRate]
1817
+ );
1818
+ return useMemo(
1819
+ () => ({
1820
+ loading,
1821
+ error,
1822
+ invoices: data.invoices,
1823
+ purchaseOrders: data.purchaseOrders,
1824
+ inventory: data.inventory,
1825
+ suppliers: data.suppliers,
1826
+ employees: data.employees,
1827
+ resources: data.resources,
1828
+ vatRates: data.vatRates,
1829
+ refresh,
1830
+ upsertInvoice: (i) => writeWith("invoices", i),
1831
+ upsertPurchaseOrder: (p) => writeWith("purchaseOrders", p),
1832
+ upsertInventory: (i) => writeWith("inventory", i)
1833
+ }),
1834
+ [loading, error, data, refresh, writeWith]
1835
+ );
1836
+ }
1837
+ const NiceVatTable = forwardRef(
1838
+ function NiceVatTable2({ country = "PL", rates, editable = false, onChange, onRemove, locale, labels, density = "comfortable", className, style, id }, ref) {
1839
+ const [internal, setInternal] = useState(rates ?? NICE_VAT_PRESETS[country]);
1840
+ const L = { code: "Code", rate: "Rate", label: "Label", description: "Description", add: "+ Add", remove: "Remove", ...labels };
1841
+ const update = useCallback(
1842
+ (next) => {
1843
+ setInternal(next);
1844
+ onChange == null ? void 0 : onChange(next);
1845
+ },
1846
+ [onChange]
1847
+ );
1848
+ const onCellEdit = (idx, key, raw) => {
1849
+ const next = [...internal];
1850
+ const r = { ...next[idx] };
1851
+ if (key === "rate") {
1852
+ const n = Number(raw.replace(",", "."));
1853
+ if (!Number.isFinite(n)) return;
1854
+ r.rate = n > 1 ? n / 100 : n;
1855
+ } else if (key === "code" || key === "label" || key === "description") {
1856
+ r[key] = raw;
1857
+ }
1858
+ next[idx] = r;
1859
+ update(next);
1860
+ };
1861
+ const addRow = () => {
1862
+ update([...internal, { code: `NEW-${internal.length + 1}`, rate: 0, label: "0%" }]);
1863
+ };
1864
+ const removeRow = (idx) => {
1865
+ const code = internal[idx].code;
1866
+ const next = internal.filter((_, i) => i !== idx);
1867
+ update(next);
1868
+ onRemove == null ? void 0 : onRemove(code);
1869
+ };
1870
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-vat-table nice-vat-table--${density} ${className ?? ""}`, style, children: [
1871
+ /* @__PURE__ */ jsxs("table", { children: [
1872
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
1873
+ /* @__PURE__ */ jsx("th", { children: L.code }),
1874
+ /* @__PURE__ */ jsx("th", { className: "nice-num", children: L.rate }),
1875
+ /* @__PURE__ */ jsx("th", { children: L.label }),
1876
+ /* @__PURE__ */ jsx("th", { children: L.description }),
1877
+ editable && /* @__PURE__ */ jsx("th", { "aria-label": L.remove })
1878
+ ] }) }),
1879
+ /* @__PURE__ */ jsx("tbody", { children: internal.map((r, idx) => /* @__PURE__ */ jsxs("tr", { children: [
1880
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx("input", { value: r.code, onChange: (e) => onCellEdit(idx, "code", e.target.value) }) : r.code }),
1881
+ /* @__PURE__ */ jsx("td", { className: "nice-num", children: editable ? /* @__PURE__ */ jsx("input", { type: "number", step: "0.01", min: 0, max: 1, value: r.rate, onChange: (e) => onCellEdit(idx, "rate", e.target.value) }) : `${(r.rate * 100).toLocaleString(locale, { maximumFractionDigits: 2 })}%` }),
1882
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx("input", { value: r.label ?? "", onChange: (e) => onCellEdit(idx, "label", e.target.value) }) : r.label ?? "" }),
1883
+ /* @__PURE__ */ jsx("td", { children: editable ? /* @__PURE__ */ jsx("input", { value: r.description ?? "", onChange: (e) => onCellEdit(idx, "description", e.target.value) }) : r.description ?? "" }),
1884
+ editable && /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => removeRow(idx), "aria-label": L.remove, children: "×" }) })
1885
+ ] }, r.code)) })
1886
+ ] }),
1887
+ editable && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-vat-table__add", onClick: addRow, children: L.add })
1888
+ ] });
1889
+ }
1890
+ );
1891
+ function pad(n) {
1892
+ return n < 10 ? `0${n}` : String(n);
1893
+ }
1894
+ function isoDate(d) {
1895
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
1896
+ }
1897
+ function escapeXml(s) {
1898
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
1899
+ }
1900
+ function defaultBuildXml(opts) {
1901
+ const { format, period, taxpayer, invoices } = opts;
1902
+ const lines = [];
1903
+ lines.push('<?xml version="1.0" encoding="UTF-8"?>');
1904
+ lines.push(`<JPK xmlns="http://jpk.mf.gov.pl/wzor/2022/01/01/${format}/" formCode="${format}">`);
1905
+ lines.push(" <Naglowek>");
1906
+ lines.push(` <KodFormularza>${format}</KodFormularza>`);
1907
+ lines.push(` <DataOd>${isoDate(period.from)}</DataOd>`);
1908
+ lines.push(` <DataDo>${isoDate(period.to)}</DataDo>`);
1909
+ lines.push(" </Naglowek>");
1910
+ lines.push(" <Podmiot1>");
1911
+ lines.push(` <NIP>${escapeXml(taxpayer.nip)}</NIP>`);
1912
+ lines.push(` <PelnaNazwa>${escapeXml(taxpayer.name)}</PelnaNazwa>`);
1913
+ if (taxpayer.regon) lines.push(` <REGON>${escapeXml(taxpayer.regon)}</REGON>`);
1914
+ lines.push(" </Podmiot1>");
1915
+ for (const inv of invoices) {
1916
+ lines.push(" <Faktura>");
1917
+ lines.push(` <NumerFaktury>${escapeXml(inv.invoiceNumber)}</NumerFaktury>`);
1918
+ lines.push(` <DataWystawienia>${isoDate(inv.issueDate instanceof Date ? inv.issueDate : new Date(inv.issueDate))}</DataWystawienia>`);
1919
+ lines.push(` <NazwaNabywcy>${escapeXml(inv.buyer.name)}</NazwaNabywcy>`);
1920
+ if (inv.buyer.vatId) lines.push(` <NIPNabywcy>${escapeXml(inv.buyer.vatId)}</NIPNabywcy>`);
1921
+ let net = 0;
1922
+ let vat = 0;
1923
+ for (const ln of inv.lines) {
1924
+ const n = Math.round(ln.quantity * ln.unitPrice.amount * (1 - (ln.discount ?? 0)));
1925
+ const v = Math.round(n * ln.vatRate);
1926
+ net += n;
1927
+ vat += v;
1928
+ }
1929
+ lines.push(` <SumaNetto>${(net / 100).toFixed(2)}</SumaNetto>`);
1930
+ lines.push(` <SumaVAT>${(vat / 100).toFixed(2)}</SumaVAT>`);
1931
+ lines.push(` <SumaBrutto>${((net + vat) / 100).toFixed(2)}</SumaBrutto>`);
1932
+ lines.push(" </Faktura>");
1933
+ }
1934
+ lines.push("</JPK>");
1935
+ return lines.join("\n");
1936
+ }
1937
+ const NiceJpkExporter = forwardRef(
1938
+ function NiceJpkExporter2({ invoices, taxpayer, defaultFormat = "JPK_V7M", defaultPeriod, buildXml = defaultBuildXml, onExport, filenameFor, labels, className, style, id }, ref) {
1939
+ const today = /* @__PURE__ */ new Date();
1940
+ const [format, setFormat] = useState(defaultFormat);
1941
+ const [from, setFrom] = useState(isoDate((defaultPeriod == null ? void 0 : defaultPeriod.from) ?? new Date(today.getFullYear(), today.getMonth(), 1)));
1942
+ const [to, setTo] = useState(isoDate((defaultPeriod == null ? void 0 : defaultPeriod.to) ?? new Date(today.getFullYear(), today.getMonth() + 1, 0)));
1943
+ const L = { format: "Format", from: "From", to: "To", export: "Export", ...labels };
1944
+ const exportNow = useCallback(() => {
1945
+ const opts = {
1946
+ format,
1947
+ period: { from: new Date(from), to: new Date(to) },
1948
+ taxpayer,
1949
+ invoices
1950
+ };
1951
+ const xml = buildXml(opts);
1952
+ const blob = new Blob([xml], { type: "application/xml" });
1953
+ const filename = (filenameFor == null ? void 0 : filenameFor(opts)) ?? `${format}_${from}_${to}.xml`;
1954
+ onExport == null ? void 0 : onExport(xml, blob, opts);
1955
+ if (typeof window !== "undefined" && typeof URL.createObjectURL === "function") {
1956
+ const url = URL.createObjectURL(blob);
1957
+ const a = document.createElement("a");
1958
+ a.href = url;
1959
+ a.download = filename;
1960
+ document.body.appendChild(a);
1961
+ a.click();
1962
+ a.remove();
1963
+ URL.revokeObjectURL(url);
1964
+ }
1965
+ }, [format, from, to, taxpayer, invoices, buildXml, onExport, filenameFor]);
1966
+ return /* @__PURE__ */ jsxs("div", { ref, id, className: `nice-jpk-exporter ${className ?? ""}`, style, children: [
1967
+ /* @__PURE__ */ jsxs("label", { children: [
1968
+ L.format,
1969
+ /* @__PURE__ */ jsxs("select", { value: format, onChange: (e) => setFormat(e.target.value), children: [
1970
+ /* @__PURE__ */ jsx("option", { value: "JPK_V7M", children: "JPK_V7M" }),
1971
+ /* @__PURE__ */ jsx("option", { value: "JPK_V7K", children: "JPK_V7K" }),
1972
+ /* @__PURE__ */ jsx("option", { value: "JPK_FA", children: "JPK_FA" })
1973
+ ] })
1974
+ ] }),
1975
+ /* @__PURE__ */ jsxs("label", { children: [
1976
+ L.from,
1977
+ /* @__PURE__ */ jsx("input", { type: "date", value: from, onChange: (e) => setFrom(e.target.value) })
1978
+ ] }),
1979
+ /* @__PURE__ */ jsxs("label", { children: [
1980
+ L.to,
1981
+ /* @__PURE__ */ jsx("input", { type: "date", value: to, onChange: (e) => setTo(e.target.value) })
1982
+ ] }),
1983
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: exportNow, children: L.export }),
1984
+ /* @__PURE__ */ jsxs("small", { children: [
1985
+ invoices.length,
1986
+ " invoices ready"
1987
+ ] })
1988
+ ] });
1989
+ }
1990
+ );
1267
1991
  export {
1992
+ NICE_VAT_PRESETS,
1993
+ NiceHRDashboard,
1268
1994
  NiceInventoryManager,
1269
- NiceResourceAllocation
1995
+ NiceInvoiceView,
1996
+ NiceJpkExporter,
1997
+ NicePurchaseOrder,
1998
+ NiceResourceAllocation,
1999
+ NiceVatTable,
2000
+ NiceWarehouseView,
2001
+ defaultBuildXml as buildJpkXml,
2002
+ useMockErpApi
1270
2003
  };
1271
2004
  //# sourceMappingURL=index.mjs.map