@tonzxz/government-forms 0.1.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/FORM_CATALOG.md +44 -0
- package/README.md +165 -0
- package/dist/definitions.d.ts +1147 -0
- package/dist/definitions.js +60 -0
- package/dist/forms/iar.d.ts +172 -0
- package/dist/forms/iar.js +6 -0
- package/dist/forms/ics.d.ts +48 -0
- package/dist/forms/ics.js +6 -0
- package/dist/forms/iirup.d.ts +54 -0
- package/dist/forms/iirup.js +6 -0
- package/dist/forms/iirusp.d.ts +32 -0
- package/dist/forms/iirusp.js +6 -0
- package/dist/forms/itr.d.ts +42 -0
- package/dist/forms/itr.js +6 -0
- package/dist/forms/par.d.ts +84 -0
- package/dist/forms/par.js +6 -0
- package/dist/forms/ppelc.d.ts +34 -0
- package/dist/forms/ppelc.js +6 -0
- package/dist/forms/pr.d.ts +27 -0
- package/dist/forms/pr.js +6 -0
- package/dist/forms/property-card.d.ts +68 -0
- package/dist/forms/property-card.js +6 -0
- package/dist/forms/ptr.d.ts +54 -0
- package/dist/forms/ptr.js +6 -0
- package/dist/forms/regspi.d.ts +32 -0
- package/dist/forms/regspi.js +6 -0
- package/dist/forms/ris.d.ts +66 -0
- package/dist/forms/ris.js +6 -0
- package/dist/forms/rlsddp.d.ts +54 -0
- package/dist/forms/rlsddp.js +6 -0
- package/dist/forms/rlsddsp.d.ts +42 -0
- package/dist/forms/rlsddsp.js +6 -0
- package/dist/forms/rpci.d.ts +32 -0
- package/dist/forms/rpci.js +6 -0
- package/dist/forms/rpcppe.d.ts +32 -0
- package/dist/forms/rpcppe.js +6 -0
- package/dist/forms/rpcsp.d.ts +32 -0
- package/dist/forms/rpcsp.js +6 -0
- package/dist/forms/rrsp.d.ts +32 -0
- package/dist/forms/rrsp.js +6 -0
- package/dist/forms/rsmi.d.ts +32 -0
- package/dist/forms/rsmi.js +6 -0
- package/dist/forms/rsmp.d.ts +33 -0
- package/dist/forms/rsmp.js +6 -0
- package/dist/forms/rspi.d.ts +32 -0
- package/dist/forms/rspi.js +6 -0
- package/dist/forms/spc.d.ts +37 -0
- package/dist/forms/spc.js +6 -0
- package/dist/forms/splc.d.ts +41 -0
- package/dist/forms/splc.js +6 -0
- package/dist/forms/stock-card.d.ts +28 -0
- package/dist/forms/stock-card.js +6 -0
- package/dist/forms/wmr.d.ts +32 -0
- package/dist/forms/wmr.js +6 -0
- package/dist/gam/components/gam-report-workbench.d.ts +40 -0
- package/dist/gam/components/gam-report-workbench.js +2 -0
- package/dist/gam/components/grand-total-computation.d.ts +10 -0
- package/dist/gam/components/grand-total-computation.js +26 -0
- package/dist/gam/components/iar-preview.d.ts +30 -0
- package/dist/gam/components/iar-preview.js +150 -0
- package/dist/gam/components/ics-preview.d.ts +31 -0
- package/dist/gam/components/ics-preview.js +114 -0
- package/dist/gam/components/iirup-preview.d.ts +42 -0
- package/dist/gam/components/iirup-preview.js +237 -0
- package/dist/gam/components/itr-preview.d.ts +31 -0
- package/dist/gam/components/itr-preview.js +180 -0
- package/dist/gam/components/par-preview.d.ts +28 -0
- package/dist/gam/components/par-preview.js +95 -0
- package/dist/gam/components/ppelc-preview.d.ts +28 -0
- package/dist/gam/components/ppelc-preview.js +128 -0
- package/dist/gam/components/property-card-preview.d.ts +21 -0
- package/dist/gam/components/property-card-preview.js +117 -0
- package/dist/gam/components/ptr-preview.d.ts +36 -0
- package/dist/gam/components/ptr-preview.js +122 -0
- package/dist/gam/components/purchase-order-page-client.d.ts +66 -0
- package/dist/gam/components/purchase-order-page-client.js +179 -0
- package/dist/gam/components/reg-spi-preview.d.ts +28 -0
- package/dist/gam/components/reg-spi-preview.js +138 -0
- package/dist/gam/components/ris-form.d.ts +13 -0
- package/dist/gam/components/ris-form.js +20 -0
- package/dist/gam/components/ris-preview.d.ts +7 -0
- package/dist/gam/components/ris-preview.js +16 -0
- package/dist/gam/components/rlsddp-preview.d.ts +34 -0
- package/dist/gam/components/rlsddp-preview.js +251 -0
- package/dist/gam/components/rlsddsp-preview.d.ts +33 -0
- package/dist/gam/components/rlsddsp-preview.js +226 -0
- package/dist/gam/components/rpci-preview.d.ts +27 -0
- package/dist/gam/components/rpci-preview.js +123 -0
- package/dist/gam/components/rpcppe-preview.d.ts +28 -0
- package/dist/gam/components/rpcppe-preview.js +133 -0
- package/dist/gam/components/rpcsp-preview.d.ts +29 -0
- package/dist/gam/components/rpcsp-preview.js +81 -0
- package/dist/gam/components/rspi-preview.d.ts +23 -0
- package/dist/gam/components/rspi-preview.js +72 -0
- package/dist/gam/components/spc-preview.d.ts +23 -0
- package/dist/gam/components/spc-preview.js +149 -0
- package/dist/gam/components/splc-entry-form.d.ts +14 -0
- package/dist/gam/components/splc-entry-form.js +6 -0
- package/dist/gam/components/splc-preview.d.ts +27 -0
- package/dist/gam/components/splc-preview.js +192 -0
- package/dist/gam/components/stock-card-preview.d.ts +14 -0
- package/dist/gam/components/stock-card-preview.js +17 -0
- package/dist/gam/config/new-report-config.d.ts +1094 -0
- package/dist/gam/config/new-report-config.js +1478 -0
- package/dist/gam/purchase-order-flow.d.ts +146 -0
- package/dist/gam/purchase-order-flow.js +173 -0
- package/dist/gam/purchase-request/workflow.d.ts +19 -0
- package/dist/gam/purchase-request/workflow.js +45 -0
- package/dist/gam/types/ris-types.d.ts +37 -0
- package/dist/gam/types/ris-types.js +1 -0
- package/dist/gam/utils/export-ics-xlsx.d.ts +28 -0
- package/dist/gam/utils/export-ics-xlsx.js +273 -0
- package/dist/gam/utils/export-par-xlsx.d.ts +18 -0
- package/dist/gam/utils/export-par-xlsx.js +181 -0
- package/dist/gam/utils/export-preview-pdf.d.ts +13 -0
- package/dist/gam/utils/export-preview-pdf.js +270 -0
- package/dist/gam/utils/export-report-xlsx.d.ts +228 -0
- package/dist/gam/utils/export-report-xlsx.js +873 -0
- package/dist/gam/utils/line-totals.d.ts +6 -0
- package/dist/gam/utils/line-totals.js +18 -0
- package/dist/gam/utils/monetary-input.d.ts +6 -0
- package/dist/gam/utils/monetary-input.js +18 -0
- package/dist/gam/utils/print-element.d.ts +8 -0
- package/dist/gam/utils/print-element.js +157 -0
- package/dist/government-form.d.ts +16 -0
- package/dist/government-form.js +45 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +50 -0
- package/dist/internal/components/configurable-form-layout.d.ts +20 -0
- package/dist/internal/components/configurable-form-layout.js +49 -0
- package/dist/internal/components/ui/badge.d.ts +7 -0
- package/dist/internal/components/ui/badge.js +34 -0
- package/dist/internal/components/ui/button.d.ts +10 -0
- package/dist/internal/components/ui/button.js +35 -0
- package/dist/internal/components/ui/calendar.d.ts +8 -0
- package/dist/internal/components/ui/calendar.js +77 -0
- package/dist/internal/components/ui/command.d.ts +19 -0
- package/dist/internal/components/ui/command.js +36 -0
- package/dist/internal/components/ui/date-input.d.ts +14 -0
- package/dist/internal/components/ui/date-input.js +33 -0
- package/dist/internal/components/ui/date-picker.d.ts +19 -0
- package/dist/internal/components/ui/date-picker.js +34 -0
- package/dist/internal/components/ui/dialog.d.ts +18 -0
- package/dist/internal/components/ui/dialog.js +38 -0
- package/dist/internal/components/ui/input-group.d.ts +18 -0
- package/dist/internal/components/ui/input-group.js +57 -0
- package/dist/internal/components/ui/input.d.ts +3 -0
- package/dist/internal/components/ui/input.js +12 -0
- package/dist/internal/components/ui/label.d.ts +3 -0
- package/dist/internal/components/ui/label.js +7 -0
- package/dist/internal/components/ui/popover.d.ts +9 -0
- package/dist/internal/components/ui/popover.js +23 -0
- package/dist/internal/components/ui/select.d.ts +17 -0
- package/dist/internal/components/ui/select.js +35 -0
- package/dist/internal/components/ui/switch.d.ts +5 -0
- package/dist/internal/components/ui/switch.js +8 -0
- package/dist/internal/components/ui/table.d.ts +10 -0
- package/dist/internal/components/ui/table.js +28 -0
- package/dist/internal/components/ui/tabs.d.ts +10 -0
- package/dist/internal/components/ui/tabs.js +29 -0
- package/dist/internal/components/ui/textarea.d.ts +3 -0
- package/dist/internal/components/ui/textarea.js +7 -0
- package/dist/internal/components/ui/tooltip.d.ts +6 -0
- package/dist/internal/components/ui/tooltip.js +17 -0
- package/dist/internal/contracts/modules/v1/reg-spi-reports/reg-spi-reports.schema.d.ts +112 -0
- package/dist/internal/contracts/modules/v1/reg-spi-reports/reg-spi-reports.schema.js +91 -0
- package/dist/internal/hooks/use-form-field-order.d.ts +7 -0
- package/dist/internal/hooks/use-form-field-order.js +43 -0
- package/dist/internal/lib/utils.d.ts +2 -0
- package/dist/internal/lib/utils.js +3 -0
- package/dist/inventory/components/inventory-item-form.d.ts +7 -0
- package/dist/inventory/components/inventory-item-form.js +5 -0
- package/dist/inventory/components/inventory-item-preview.d.ts +6 -0
- package/dist/inventory/components/inventory-item-preview.js +5 -0
- package/dist/inventory/iar.d.ts +4 -0
- package/dist/inventory/iar.js +4 -0
- package/dist/inventory/ics.d.ts +2 -0
- package/dist/inventory/ics.js +3 -0
- package/dist/inventory/iirup.d.ts +2 -0
- package/dist/inventory/iirup.js +3 -0
- package/dist/inventory/iirusp.d.ts +4 -0
- package/dist/inventory/iirusp.js +4 -0
- package/dist/inventory/index.d.ts +3 -0
- package/dist/inventory/index.js +4 -0
- package/dist/inventory/item.d.ts +3 -0
- package/dist/inventory/item.js +3 -0
- package/dist/inventory/itr.d.ts +4 -0
- package/dist/inventory/itr.js +4 -0
- package/dist/inventory/par.d.ts +2 -0
- package/dist/inventory/par.js +3 -0
- package/dist/inventory/po.d.ts +2 -0
- package/dist/inventory/po.js +2 -0
- package/dist/inventory/ppelc.d.ts +2 -0
- package/dist/inventory/ppelc.js +3 -0
- package/dist/inventory/pplc.d.ts +2 -0
- package/dist/inventory/pplc.js +4 -0
- package/dist/inventory/pr.d.ts +4 -0
- package/dist/inventory/pr.js +4 -0
- package/dist/inventory/property-card.d.ts +2 -0
- package/dist/inventory/property-card.js +3 -0
- package/dist/inventory/ptr.d.ts +2 -0
- package/dist/inventory/ptr.js +3 -0
- package/dist/inventory/regspi.d.ts +4 -0
- package/dist/inventory/regspi.js +4 -0
- package/dist/inventory/ris.d.ts +4 -0
- package/dist/inventory/ris.js +4 -0
- package/dist/inventory/rlsddp.d.ts +4 -0
- package/dist/inventory/rlsddp.js +4 -0
- package/dist/inventory/rlsddsp.d.ts +2 -0
- package/dist/inventory/rlsddsp.js +3 -0
- package/dist/inventory/rpci.d.ts +2 -0
- package/dist/inventory/rpci.js +3 -0
- package/dist/inventory/rpcppe.d.ts +2 -0
- package/dist/inventory/rpcppe.js +3 -0
- package/dist/inventory/rpcsp.d.ts +2 -0
- package/dist/inventory/rpcsp.js +3 -0
- package/dist/inventory/rrsp.d.ts +2 -0
- package/dist/inventory/rrsp.js +3 -0
- package/dist/inventory/rsmi.d.ts +4 -0
- package/dist/inventory/rsmi.js +4 -0
- package/dist/inventory/rsmp.d.ts +4 -0
- package/dist/inventory/rsmp.js +4 -0
- package/dist/inventory/rspi.d.ts +2 -0
- package/dist/inventory/rspi.js +3 -0
- package/dist/inventory/spc.d.ts +2 -0
- package/dist/inventory/spc.js +3 -0
- package/dist/inventory/splc.d.ts +3 -0
- package/dist/inventory/splc.js +4 -0
- package/dist/inventory/stock-card.d.ts +4 -0
- package/dist/inventory/stock-card.js +4 -0
- package/dist/inventory/types.d.ts +11 -0
- package/dist/inventory/types.js +1 -0
- package/dist/inventory/wmr.d.ts +4 -0
- package/dist/inventory/wmr.js +4 -0
- package/dist/lib/rpcsp-accountable-person.d.ts +1 -0
- package/dist/lib/rpcsp-accountable-person.js +10 -0
- package/dist/reports/iar/_components/create-form.d.ts +13 -0
- package/dist/reports/iar/_components/create-form.js +92 -0
- package/dist/reports/iar/_components/document-preview.d.ts +11 -0
- package/dist/reports/iar/_components/document-preview.js +131 -0
- package/dist/reports/iar/types.d.ts +97 -0
- package/dist/reports/iar/types.js +24 -0
- package/dist/reports/iirusp/_components/create-form.d.ts +17 -0
- package/dist/reports/iirusp/_components/create-form.js +118 -0
- package/dist/reports/iirusp/_components/document-preview.d.ts +8 -0
- package/dist/reports/iirusp/_components/document-preview.js +389 -0
- package/dist/reports/iirusp/types.d.ts +134 -0
- package/dist/reports/iirusp/types.js +29 -0
- package/dist/reports/iirusp/utils.d.ts +29 -0
- package/dist/reports/iirusp/utils.js +488 -0
- package/dist/reports/itr/_components/create-form.d.ts +28 -0
- package/dist/reports/itr/_components/create-form.js +90 -0
- package/dist/reports/itr/_components/document-preview.d.ts +6 -0
- package/dist/reports/itr/_components/document-preview.js +7 -0
- package/dist/reports/itr/types.d.ts +68 -0
- package/dist/reports/itr/types.js +27 -0
- package/dist/reports/itr/utils.d.ts +24 -0
- package/dist/reports/itr/utils.js +76 -0
- package/dist/reports/pr/_components/create-form.d.ts +16 -0
- package/dist/reports/pr/_components/create-form.js +52 -0
- package/dist/reports/pr/_components/document-preview.d.ts +7 -0
- package/dist/reports/pr/_components/document-preview.js +9 -0
- package/dist/reports/pr/types.d.ts +69 -0
- package/dist/reports/pr/types.js +1 -0
- package/dist/reports/pr/utils.d.ts +72 -0
- package/dist/reports/pr/utils.js +572 -0
- package/dist/reports/regspi/_components/create-form.d.ts +19 -0
- package/dist/reports/regspi/_components/create-form.js +33 -0
- package/dist/reports/regspi/_components/document-preview.d.ts +6 -0
- package/dist/reports/regspi/_components/document-preview.js +7 -0
- package/dist/reports/regspi/types.d.ts +29 -0
- package/dist/reports/regspi/types.js +24 -0
- package/dist/reports/regspi/utils.d.ts +48 -0
- package/dist/reports/regspi/utils.js +98 -0
- package/dist/reports/ris/_components/create-form.d.ts +36 -0
- package/dist/reports/ris/_components/create-form.js +149 -0
- package/dist/reports/ris/_components/document-preview.d.ts +8 -0
- package/dist/reports/ris/_components/document-preview.js +31 -0
- package/dist/reports/ris/types.d.ts +93 -0
- package/dist/reports/ris/types.js +1 -0
- package/dist/reports/rlsddp/_components/create-form.d.ts +11 -0
- package/dist/reports/rlsddp/_components/create-form.js +165 -0
- package/dist/reports/rlsddp/_components/document-preview.d.ts +8 -0
- package/dist/reports/rlsddp/_components/document-preview.js +15 -0
- package/dist/reports/rlsddp/types.d.ts +105 -0
- package/dist/reports/rlsddp/types.js +31 -0
- package/dist/reports/rrsp/components/rrsp-preview.d.ts +21 -0
- package/dist/reports/rrsp/components/rrsp-preview.js +155 -0
- package/dist/reports/rsmi/components/rsmi-create-form.d.ts +20 -0
- package/dist/reports/rsmi/components/rsmi-create-form.js +8 -0
- package/dist/reports/rsmi/components/rsmi-document-body.d.ts +15 -0
- package/dist/reports/rsmi/components/rsmi-document-body.js +12 -0
- package/dist/reports/rsmi/components/rsmi-types.d.ts +45 -0
- package/dist/reports/rsmi/components/rsmi-types.js +1 -0
- package/dist/reports/rsmi/components/rsmi-utils.d.ts +2 -0
- package/dist/reports/rsmi/components/rsmi-utils.js +18 -0
- package/dist/reports/rsmp/components/rsmp-create-modal.d.ts +5 -0
- package/dist/reports/rsmp/components/rsmp-create-modal.js +7 -0
- package/dist/reports/rsmp/components/rsmp-preview-modal.d.ts +11 -0
- package/dist/reports/rsmp/components/rsmp-preview-modal.js +47 -0
- package/dist/reports/rsmp/components/rsmp-types.d.ts +44 -0
- package/dist/reports/rsmp/components/rsmp-types.js +1 -0
- package/dist/reports/rsmp/components/rsmp-utils.d.ts +5 -0
- package/dist/reports/rsmp/components/rsmp-utils.js +41 -0
- package/dist/reports/rsmp/lib/rsmp-grouping.d.ts +14 -0
- package/dist/reports/rsmp/lib/rsmp-grouping.js +75 -0
- package/dist/reports/stock-card/_components/create-form.d.ts +13 -0
- package/dist/reports/stock-card/_components/create-form.js +39 -0
- package/dist/reports/stock-card/_components/document-preview.d.ts +7 -0
- package/dist/reports/stock-card/_components/document-preview.js +29 -0
- package/dist/reports/stock-card/types.d.ts +31 -0
- package/dist/reports/stock-card/types.js +1 -0
- package/dist/reports/stock-card/utils.d.ts +32 -0
- package/dist/reports/stock-card/utils.js +248 -0
- package/dist/reports/wmr/_components/create-form.d.ts +22 -0
- package/dist/reports/wmr/_components/create-form.js +61 -0
- package/dist/reports/wmr/_components/document-preview.d.ts +10 -0
- package/dist/reports/wmr/_components/document-preview.js +59 -0
- package/dist/reports/wmr/types.d.ts +45 -0
- package/dist/reports/wmr/types.js +1 -0
- package/dist/reports/wmr/utils.d.ts +32 -0
- package/dist/reports/wmr/utils.js +343 -0
- package/dist/styles.css +4492 -0
- package/extraction-manifest.json +620 -0
- package/package.json +197 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
const FIXED_ROWS = 27;
|
|
4
|
+
function display(value) {
|
|
5
|
+
return value?.trim() ?? "";
|
|
6
|
+
}
|
|
7
|
+
function fmtDate(value) {
|
|
8
|
+
if (!value || value.trim() === "")
|
|
9
|
+
return "";
|
|
10
|
+
const date = new Date(value);
|
|
11
|
+
if (Number.isNaN(date.getTime()))
|
|
12
|
+
return value;
|
|
13
|
+
return date.toLocaleDateString("en-PH");
|
|
14
|
+
}
|
|
15
|
+
function fmtQty(value) {
|
|
16
|
+
if (!value || value.trim() === "")
|
|
17
|
+
return "";
|
|
18
|
+
const n = Number(value);
|
|
19
|
+
if (Number.isNaN(n))
|
|
20
|
+
return value;
|
|
21
|
+
return n === 0 ? "" : Number.isInteger(n) ? n.toString() : n.toFixed(2);
|
|
22
|
+
}
|
|
23
|
+
function fmtAmount(value) {
|
|
24
|
+
if (!value || value.trim() === "")
|
|
25
|
+
return "";
|
|
26
|
+
const n = Number(value);
|
|
27
|
+
if (Number.isNaN(n))
|
|
28
|
+
return value;
|
|
29
|
+
return n === 0
|
|
30
|
+
? ""
|
|
31
|
+
: n.toLocaleString("en-PH", {
|
|
32
|
+
minimumFractionDigits: 2,
|
|
33
|
+
maximumFractionDigits: 2,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const BORDER = "1.25px solid #111";
|
|
37
|
+
const OUTER_BORDER = "1.8px solid #111";
|
|
38
|
+
const gridBorder = {
|
|
39
|
+
border: 0,
|
|
40
|
+
borderRight: BORDER,
|
|
41
|
+
borderBottom: BORDER,
|
|
42
|
+
};
|
|
43
|
+
const metaCell = {
|
|
44
|
+
...gridBorder,
|
|
45
|
+
height: "7.8mm",
|
|
46
|
+
padding: "0.7mm 1mm",
|
|
47
|
+
fontSize: "9pt",
|
|
48
|
+
fontWeight: 700,
|
|
49
|
+
lineHeight: 1.15,
|
|
50
|
+
verticalAlign: "top",
|
|
51
|
+
textAlign: "left",
|
|
52
|
+
};
|
|
53
|
+
const headerCell = {
|
|
54
|
+
...gridBorder,
|
|
55
|
+
padding: "0.55mm 0.7mm",
|
|
56
|
+
textAlign: "center",
|
|
57
|
+
verticalAlign: "middle",
|
|
58
|
+
fontSize: "8.4pt",
|
|
59
|
+
fontWeight: 700,
|
|
60
|
+
lineHeight: 1.08,
|
|
61
|
+
};
|
|
62
|
+
const bodyCell = {
|
|
63
|
+
...gridBorder,
|
|
64
|
+
height: "5mm",
|
|
65
|
+
padding: "0.3mm 0.7mm",
|
|
66
|
+
fontSize: "7.2pt",
|
|
67
|
+
lineHeight: 1.3,
|
|
68
|
+
overflowWrap: "anywhere",
|
|
69
|
+
whiteSpace: "normal",
|
|
70
|
+
verticalAlign: "middle",
|
|
71
|
+
};
|
|
72
|
+
export function SpcPreview({ entityName, fundCluster, semiExpendableProperty, semiExpendablePropertyNumber, description, entries, }) {
|
|
73
|
+
const rows = Array.from({ length: Math.max(FIXED_ROWS, entries.length) }, (_, index) => entries[index] ?? null);
|
|
74
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { children: `
|
|
75
|
+
/* Keep grouped/row-spanning header cells on a single transparent paint
|
|
76
|
+
layer. Chromium can otherwise paint their backgrounds over labels
|
|
77
|
+
when this page is printed or captured for PDF export. */
|
|
78
|
+
.spc-a4-page[data-pdf-page="true"] :is(table, thead, tbody, tr, th, td) {
|
|
79
|
+
background-color: transparent !important;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media print {
|
|
83
|
+
.no-print { display: none !important; }
|
|
84
|
+
@page { size: A4 landscape; margin: 0; }
|
|
85
|
+
body { background: white !important; }
|
|
86
|
+
.spc-a4-page {
|
|
87
|
+
box-shadow: none !important;
|
|
88
|
+
margin: 0 !important;
|
|
89
|
+
padding: 20mm 14mm 14mm !important;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.spc-a4-page * {
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
` }), _jsx("div", { style: { boxSizing: "border-box", overflow: "visible", width: "297mm" }, children: _jsxs("div", { className: "spc-a4-page bg-white shadow-sm", "data-pdf-page": "true", "data-pdf-orientation": "landscape", style: {
|
|
97
|
+
boxSizing: "border-box",
|
|
98
|
+
width: "297mm",
|
|
99
|
+
minHeight: "210mm",
|
|
100
|
+
padding: "20mm 14mm 14mm",
|
|
101
|
+
fontFamily: '"Times New Roman", Times, serif',
|
|
102
|
+
color: "#111",
|
|
103
|
+
}, children: [_jsxs("header", { style: {
|
|
104
|
+
position: "relative",
|
|
105
|
+
height: "36mm",
|
|
106
|
+
}, children: [_jsx("div", { style: {
|
|
107
|
+
position: "absolute",
|
|
108
|
+
right: "3mm",
|
|
109
|
+
top: 0,
|
|
110
|
+
fontSize: "9pt",
|
|
111
|
+
fontStyle: "italic",
|
|
112
|
+
fontWeight: 600,
|
|
113
|
+
}, children: "Annex A.1" }), _jsx("div", { style: {
|
|
114
|
+
position: "absolute",
|
|
115
|
+
left: 0,
|
|
116
|
+
right: 0,
|
|
117
|
+
top: "14mm",
|
|
118
|
+
textAlign: "center",
|
|
119
|
+
fontSize: "13pt",
|
|
120
|
+
fontWeight: 700,
|
|
121
|
+
letterSpacing: "0.2px",
|
|
122
|
+
}, children: "SEMI-EXPENDABLE PROPERTY CARD" }), _jsxs("div", { style: {
|
|
123
|
+
position: "absolute",
|
|
124
|
+
left: 0,
|
|
125
|
+
right: 0,
|
|
126
|
+
bottom: "2mm",
|
|
127
|
+
display: "grid",
|
|
128
|
+
gridTemplateColumns: "1fr auto",
|
|
129
|
+
columnGap: "12mm",
|
|
130
|
+
fontSize: "9.2pt",
|
|
131
|
+
fontWeight: 700,
|
|
132
|
+
alignItems: "end",
|
|
133
|
+
}, children: [_jsxs("div", { children: ["Entity Name :", " ", _jsx("span", { style: {
|
|
134
|
+
display: "inline-block",
|
|
135
|
+
boxSizing: "border-box",
|
|
136
|
+
height: "5.5mm",
|
|
137
|
+
minWidth: "64mm",
|
|
138
|
+
borderBottom: BORDER,
|
|
139
|
+
padding: "0.6mm 1mm 1.4mm",
|
|
140
|
+
lineHeight: 1.15,
|
|
141
|
+
verticalAlign: "bottom",
|
|
142
|
+
}, children: display(entityName) })] }), _jsxs("div", { style: { minWidth: "58mm" }, children: ["Fund Cluster: ", display(fundCluster)] })] })] }), _jsxs("table", { style: {
|
|
143
|
+
width: "100%",
|
|
144
|
+
borderCollapse: "collapse",
|
|
145
|
+
borderSpacing: 0,
|
|
146
|
+
tableLayout: "fixed",
|
|
147
|
+
border: OUTER_BORDER,
|
|
148
|
+
}, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "6.8%" } }), _jsx("col", { style: { width: "10.5%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "6%" } }), _jsx("col", { style: { width: "6.2%" } }), _jsx("col", { style: { width: "5.5%" } }), _jsx("col", { style: { width: "6.5%" } }), _jsx("col", { style: { width: "8.3%" } }), _jsx("col", { style: { width: "15.4%" } }), _jsx("col", { style: { width: "8.3%" } }), _jsx("col", { style: { width: "8.9%" } }), _jsx("col", { style: { width: "10.6%" } })] }), _jsxs("thead", { children: [_jsxs("tr", { children: [_jsxs("th", { colSpan: 10, style: metaCell, children: ["Semi-Expendable Property : ", display(semiExpendableProperty)] }), _jsxs("th", { colSpan: 2, rowSpan: 2, style: metaCell, children: ["Semi-Expendable Property Number: ", display(semiExpendablePropertyNumber)] })] }), _jsx("tr", { children: _jsxs("th", { colSpan: 10, style: metaCell, children: ["Description : ", display(description)] }) }), _jsxs("tr", { style: { height: "5.8mm" }, children: [_jsx("th", { rowSpan: 2, style: headerCell, children: "Date" }), _jsx("th", { rowSpan: 2, style: headerCell, children: "Reference" }), _jsx("th", { colSpan: 3, style: headerCell, children: "Receipt" }), _jsx("th", { style: headerCell, children: "Receipt" }), _jsx("th", { colSpan: 3, style: headerCell, children: "Issue/Transfer/ Disposal" }), _jsx("th", { style: headerCell, children: "Balance" }), _jsx("th", { rowSpan: 2, style: headerCell, children: "Amount" }), _jsx("th", { rowSpan: 2, style: headerCell, children: "Remarks" })] }), _jsxs("tr", { style: { height: "5.6mm" }, children: [_jsx("th", { style: headerCell, children: "Qty." }), _jsx("th", { style: headerCell, children: "Unit Cost" }), _jsx("th", { style: headerCell, children: "Total Cost" }), _jsx("th", { style: headerCell, children: "Qty." }), _jsx("th", { style: headerCell, children: "Item No." }), _jsx("th", { style: headerCell, children: "Qty." }), _jsx("th", { style: headerCell, children: "Office/Officer" }), _jsx("th", { style: headerCell, children: "Qty." })] })] }), _jsx("tbody", { children: rows.map((row, index) => (_jsxs("tr", { children: [_jsx("td", { style: { ...bodyCell, textAlign: "center" }, children: row ? fmtDate(row.entryDate) : "" }), _jsx("td", { style: bodyCell, children: row ? display(row.reference) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "center" }, children: row ? fmtQty(row.receiptQty) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "right" }, children: row ? fmtAmount(row.receiptUnitCost) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "right" }, children: row ? fmtAmount(row.receiptTotalCost) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "center" }, children: row ? fmtQty(row.receiptQty) : "" }), _jsx("td", { style: bodyCell, children: row ? display(row.itemNo) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "center" }, children: row ? fmtQty(row.issueTransferDisposalQty) : "" }), _jsx("td", { style: bodyCell, children: row ? display(row.issueTransferDisposalOfficeOfficer) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "center" }, children: row ? fmtQty(row.balanceQty) : "" }), _jsx("td", { style: { ...bodyCell, textAlign: "right" }, children: row ? fmtAmount(row.amount) : "" }), _jsx("td", { style: bodyCell, children: row ? display(row.remarks) : "" })] }, index))) })] })] }) })] }));
|
|
149
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GamTableField } from "./gam-report-workbench.js";
|
|
2
|
+
type SplcEntryFormProps = {
|
|
3
|
+
tableFields: GamTableField[];
|
|
4
|
+
entryForm: Record<string, string>;
|
|
5
|
+
setEntryForm: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
6
|
+
entryFormError: string | null;
|
|
7
|
+
activeTableRowIndex: number | null;
|
|
8
|
+
tableRowsCount: number;
|
|
9
|
+
renderFieldInput: (field: GamTableField, value: string, onChange: (value: string) => void, className?: string) => React.ReactNode;
|
|
10
|
+
onAddOrSaveEntry: () => void;
|
|
11
|
+
onResetEntryForm: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function SplcEntryForm({ tableFields, entryForm, setEntryForm, entryFormError, activeTableRowIndex, tableRowsCount, renderFieldInput, onAddOrSaveEntry, onResetEntryForm, }: SplcEntryFormProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "../../internal/components/ui/button.js";
|
|
4
|
+
export function SplcEntryForm({ tableFields, entryForm, setEntryForm, entryFormError, activeTableRowIndex, tableRowsCount, renderFieldInput, onAddOrSaveEntry, onResetEntryForm, }) {
|
|
5
|
+
return (_jsxs("div", { className: "space-y-4", children: [activeTableRowIndex !== null && (_jsxs("p", { className: "rounded border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: ["Editing Entry #", activeTableRowIndex + 1] })), _jsx("div", { className: "grid gap-3 md:grid-cols-2", children: tableFields.map(field => (_jsxs("div", { children: [_jsxs("label", { className: "mb-1 block text-xs font-medium", children: [field.label, field.required ? " *" : ""] }), renderFieldInput(field, entryForm[field.id] ?? "", value => setEntryForm(prev => ({ ...prev, [field.id]: value })))] }, `splc-entry-form-${field.id}`))) }), entryFormError && _jsx("p", { className: "text-sm text-rose-600", children: entryFormError }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(Button, { type: "button", onClick: onAddOrSaveEntry, className: "shadow-sm", children: activeTableRowIndex !== null ? "Save Entry" : "Add Entry" }), _jsx(Button, { type: "button", variant: "outline", onClick: onResetEntryForm, children: activeTableRowIndex !== null ? "Cancel Edit" : "Clear Entry" })] }), _jsxs("p", { className: "text-muted-foreground text-xs", children: ["Entries added: ", tableRowsCount, ". Use document preview hover actions to edit or delete rows."] })] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type SplcEntryRow = {
|
|
2
|
+
entryDate: string;
|
|
3
|
+
reference: string;
|
|
4
|
+
receiptQty: string;
|
|
5
|
+
unitCost: string;
|
|
6
|
+
totalCost: string;
|
|
7
|
+
issuesTransfersAdjustments: string;
|
|
8
|
+
accumulatedImpairmentLosses: string;
|
|
9
|
+
adjustedCost: string;
|
|
10
|
+
natureOfRepair: string;
|
|
11
|
+
amount: string;
|
|
12
|
+
};
|
|
13
|
+
export type SplcPreviewProps = {
|
|
14
|
+
entityName: string;
|
|
15
|
+
fundCluster: string;
|
|
16
|
+
semiExpendableProperty: string;
|
|
17
|
+
semiExpendablePropertyNumber?: string;
|
|
18
|
+
description: string;
|
|
19
|
+
uacsObjectCode?: string;
|
|
20
|
+
repairHistory?: string;
|
|
21
|
+
entries: SplcEntryRow[];
|
|
22
|
+
onEditEntry?: (entryIndex: number) => void;
|
|
23
|
+
onDeleteEntry?: (entryIndex: number) => void;
|
|
24
|
+
activeEntryIndex?: number | null;
|
|
25
|
+
};
|
|
26
|
+
export declare function SplcPreview({ entityName, fundCluster, semiExpendableProperty, semiExpendablePropertyNumber, description, uacsObjectCode, repairHistory, entries, onEditEntry, onDeleteEntry, activeEntryIndex, }: SplcPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const FIXED_ROWS = 27;
|
|
5
|
+
function display(value) {
|
|
6
|
+
return value?.trim() ?? "";
|
|
7
|
+
}
|
|
8
|
+
function fmtDate(value) {
|
|
9
|
+
if (!value || value.trim() === "")
|
|
10
|
+
return "";
|
|
11
|
+
const date = new Date(value);
|
|
12
|
+
if (Number.isNaN(date.getTime()))
|
|
13
|
+
return value;
|
|
14
|
+
return date.toLocaleDateString("en-PH");
|
|
15
|
+
}
|
|
16
|
+
function fmtQty(value) {
|
|
17
|
+
if (!value || value.trim() === "")
|
|
18
|
+
return "";
|
|
19
|
+
const n = Number(value);
|
|
20
|
+
if (Number.isNaN(n))
|
|
21
|
+
return value;
|
|
22
|
+
return n === 0 ? "" : Number.isInteger(n) ? n.toString() : n.toFixed(2);
|
|
23
|
+
}
|
|
24
|
+
function fmtAmount(value) {
|
|
25
|
+
if (!value || value.trim() === "")
|
|
26
|
+
return "";
|
|
27
|
+
const n = Number(value);
|
|
28
|
+
if (Number.isNaN(n))
|
|
29
|
+
return value;
|
|
30
|
+
return n === 0
|
|
31
|
+
? ""
|
|
32
|
+
: n.toLocaleString("en-PH", {
|
|
33
|
+
minimumFractionDigits: 2,
|
|
34
|
+
maximumFractionDigits: 2,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const BORDER = "1.3px solid #111";
|
|
38
|
+
const OUTER_BORDER = "1.8px solid #111";
|
|
39
|
+
const thBase = {
|
|
40
|
+
border: BORDER,
|
|
41
|
+
padding: "0.7mm 0.8mm",
|
|
42
|
+
textAlign: "center",
|
|
43
|
+
fontWeight: 700,
|
|
44
|
+
verticalAlign: "middle",
|
|
45
|
+
lineHeight: 1.08,
|
|
46
|
+
fontSize: "8.5pt",
|
|
47
|
+
};
|
|
48
|
+
const tdBase = {
|
|
49
|
+
border: BORDER,
|
|
50
|
+
padding: "0.35mm 0.8mm",
|
|
51
|
+
fontSize: "7.4pt",
|
|
52
|
+
height: "5mm",
|
|
53
|
+
whiteSpace: "normal",
|
|
54
|
+
overflowWrap: "anywhere",
|
|
55
|
+
wordBreak: "break-word",
|
|
56
|
+
lineHeight: 1.1,
|
|
57
|
+
verticalAlign: "middle",
|
|
58
|
+
};
|
|
59
|
+
const metaCell = {
|
|
60
|
+
border: BORDER,
|
|
61
|
+
height: "8mm",
|
|
62
|
+
padding: "0.7mm 1mm",
|
|
63
|
+
fontSize: "9.2pt",
|
|
64
|
+
fontWeight: 700,
|
|
65
|
+
lineHeight: 1.15,
|
|
66
|
+
verticalAlign: "top",
|
|
67
|
+
textAlign: "left",
|
|
68
|
+
whiteSpace: "normal",
|
|
69
|
+
overflowWrap: "anywhere",
|
|
70
|
+
wordBreak: "break-word",
|
|
71
|
+
};
|
|
72
|
+
export function SplcPreview({ entityName, fundCluster, semiExpendableProperty, semiExpendablePropertyNumber, description, uacsObjectCode, repairHistory, entries, onEditEntry, onDeleteEntry, activeEntryIndex, }) {
|
|
73
|
+
const [hoveredEntryIndex, setHoveredEntryIndex] = useState(null);
|
|
74
|
+
const rows = Array.from({ length: Math.max(FIXED_ROWS, entries.length) }, (_, index) => entries[index] ?? null);
|
|
75
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { children: `
|
|
76
|
+
@media print {
|
|
77
|
+
.no-print { display: none !important; }
|
|
78
|
+
@page { size: A4 landscape; margin: 0; }
|
|
79
|
+
body { background: white !important; }
|
|
80
|
+
.splc-a4-page {
|
|
81
|
+
box-shadow: none !important;
|
|
82
|
+
margin: 0 !important;
|
|
83
|
+
padding: 31mm 14mm 14mm !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.splc-a4-page * {
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
}
|
|
90
|
+
` }), _jsx("div", { style: { overflowX: "auto", width: "100%" }, children: _jsxs("div", { className: "splc-a4-page bg-white shadow-sm", "data-pdf-page": "true", "data-pdf-orientation": "landscape", style: {
|
|
91
|
+
boxSizing: "border-box",
|
|
92
|
+
width: "297mm",
|
|
93
|
+
minHeight: "210mm",
|
|
94
|
+
padding: "31mm 14mm 14mm",
|
|
95
|
+
fontFamily: '"Times New Roman", Times, serif',
|
|
96
|
+
color: "#111",
|
|
97
|
+
}, children: [_jsxs("header", { style: {
|
|
98
|
+
position: "relative",
|
|
99
|
+
width: "100%",
|
|
100
|
+
height: "25mm",
|
|
101
|
+
}, children: [_jsx("div", { style: {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
right: "3mm",
|
|
104
|
+
top: 0,
|
|
105
|
+
fontSize: "9pt",
|
|
106
|
+
fontStyle: "italic",
|
|
107
|
+
fontWeight: 600,
|
|
108
|
+
}, children: "Annex A.2" }), _jsx("div", { style: {
|
|
109
|
+
position: "absolute",
|
|
110
|
+
left: 0,
|
|
111
|
+
right: 0,
|
|
112
|
+
top: "8mm",
|
|
113
|
+
textAlign: "center",
|
|
114
|
+
fontSize: "14pt",
|
|
115
|
+
fontWeight: 700,
|
|
116
|
+
letterSpacing: "0.1px",
|
|
117
|
+
}, children: "SEMI-EXPENDABLE PROPERTY LEDGER CARD" }), _jsxs("div", { style: {
|
|
118
|
+
position: "absolute",
|
|
119
|
+
left: 0,
|
|
120
|
+
right: 0,
|
|
121
|
+
bottom: 0,
|
|
122
|
+
display: "grid",
|
|
123
|
+
gridTemplateColumns: "1fr 90mm",
|
|
124
|
+
columnGap: "12mm",
|
|
125
|
+
alignItems: "end",
|
|
126
|
+
fontSize: "9.5pt",
|
|
127
|
+
fontWeight: 700,
|
|
128
|
+
}, children: [_jsxs("div", { children: ["Entity Name :", " ", _jsx("span", { style: {
|
|
129
|
+
display: "inline-block",
|
|
130
|
+
boxSizing: "border-box",
|
|
131
|
+
height: "5.5mm",
|
|
132
|
+
minWidth: "70mm",
|
|
133
|
+
maxWidth: "calc(100% - 24mm)",
|
|
134
|
+
borderBottom: BORDER,
|
|
135
|
+
padding: "0.6mm 1mm 1.4mm",
|
|
136
|
+
lineHeight: 1.15,
|
|
137
|
+
verticalAlign: "bottom",
|
|
138
|
+
whiteSpace: "normal",
|
|
139
|
+
overflowWrap: "anywhere",
|
|
140
|
+
wordBreak: "break-word",
|
|
141
|
+
}, children: display(entityName) })] }), _jsxs("div", { children: ["Fund Cluster :", " ", _jsx("span", { style: {
|
|
142
|
+
display: "inline-block",
|
|
143
|
+
boxSizing: "border-box",
|
|
144
|
+
height: "5.5mm",
|
|
145
|
+
minWidth: "36mm",
|
|
146
|
+
maxWidth: "calc(100% - 28mm)",
|
|
147
|
+
borderBottom: BORDER,
|
|
148
|
+
padding: "0.6mm 1mm 1.4mm",
|
|
149
|
+
lineHeight: 1.15,
|
|
150
|
+
verticalAlign: "bottom",
|
|
151
|
+
whiteSpace: "normal",
|
|
152
|
+
overflowWrap: "anywhere",
|
|
153
|
+
wordBreak: "break-word",
|
|
154
|
+
}, children: display(fundCluster) })] })] })] }), _jsxs("table", { style: {
|
|
155
|
+
width: "100%",
|
|
156
|
+
borderCollapse: "collapse",
|
|
157
|
+
tableLayout: "fixed",
|
|
158
|
+
border: OUTER_BORDER,
|
|
159
|
+
}, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "7.5%" } }), _jsx("col", { style: { width: "11.8%" } }), _jsx("col", { style: { width: "6.1%" } }), _jsx("col", { style: { width: "8.5%" } }), _jsx("col", { style: { width: "10.5%" } }), _jsx("col", { style: { width: "14.1%" } }), _jsx("col", { style: { width: "12.4%" } }), _jsx("col", { style: { width: "14%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "8.1%" } })] }), _jsxs("thead", { children: [_jsxs("tr", { children: [_jsxs("th", { colSpan: 6, style: metaCell, children: ["Semi-expendable Property: ", display(semiExpendableProperty)] }), _jsxs("th", { colSpan: 4, style: metaCell, children: ["Semi-expendable Property No.: ", display(semiExpendablePropertyNumber)] })] }), _jsxs("tr", { children: [_jsxs("th", { colSpan: 6, style: metaCell, children: ["Description: ", display(description)] }), _jsxs("th", { colSpan: 2, style: metaCell, children: ["UACS Object Code: ", display(uacsObjectCode)] }), _jsxs("th", { colSpan: 2, style: metaCell, children: ["Repair History ", display(repairHistory)] })] }), _jsxs("tr", { style: { height: "7.2mm" }, children: [_jsx("th", { rowSpan: 2, style: thBase, children: "Date" }), _jsx("th", { rowSpan: 2, style: thBase, children: "Reference" }), _jsx("th", { colSpan: 3, style: thBase, children: "Receipt" }), _jsxs("th", { rowSpan: 2, style: thBase, children: ["Issues/Transfers/", _jsx("br", {}), "Adjustment/s"] }), _jsxs("th", { rowSpan: 2, style: thBase, children: ["Accumulated", _jsx("br", {}), "Impairment Losses"] }), _jsxs("th", { rowSpan: 2, style: thBase, children: ["Adjusted", _jsx("br", {}), "Cost"] }), _jsx("th", { colSpan: 2, style: thBase, children: "Repair History" })] }), _jsxs("tr", { style: { height: "8mm" }, children: [_jsx("th", { style: thBase, children: "Qty." }), _jsxs("th", { style: thBase, children: ["Unit", _jsx("br", {}), "Cost"] }), _jsxs("th", { style: thBase, children: ["Total", _jsx("br", {}), "Cost"] }), _jsxs("th", { style: thBase, children: ["Nature of", _jsx("br", {}), "Repair"] }), _jsx("th", { style: thBase, children: "Amount" })] })] }), _jsx("tbody", { children: rows.map((row, index) => {
|
|
160
|
+
const hasEntry = row !== null;
|
|
161
|
+
const isHovered = hoveredEntryIndex === index;
|
|
162
|
+
const isActive = activeEntryIndex === index;
|
|
163
|
+
return (_jsxs("tr", { onMouseEnter: () => {
|
|
164
|
+
if (hasEntry)
|
|
165
|
+
setHoveredEntryIndex(index);
|
|
166
|
+
}, onMouseLeave: () => {
|
|
167
|
+
if (hoveredEntryIndex === index)
|
|
168
|
+
setHoveredEntryIndex(null);
|
|
169
|
+
}, style: isActive ? { backgroundColor: "#fff8d8" } : undefined, children: [_jsxs("td", { style: { ...tdBase, position: "relative", textAlign: "center" }, children: [row ? fmtDate(row.entryDate) : "", hasEntry && isHovered ? (_jsxs("span", { style: {
|
|
170
|
+
position: "absolute",
|
|
171
|
+
top: "0.5mm",
|
|
172
|
+
right: "0.5mm",
|
|
173
|
+
display: "flex",
|
|
174
|
+
gap: "1mm",
|
|
175
|
+
}, children: [onEditEntry ? (_jsx("button", { type: "button", onClick: () => onEditEntry(index), style: {
|
|
176
|
+
fontSize: "6.5pt",
|
|
177
|
+
lineHeight: 1,
|
|
178
|
+
padding: "1px 4px",
|
|
179
|
+
border: "1px solid #475569",
|
|
180
|
+
backgroundColor: "#f8fafc",
|
|
181
|
+
cursor: "pointer",
|
|
182
|
+
}, children: "Edit" })) : null, onDeleteEntry ? (_jsx("button", { type: "button", onClick: () => onDeleteEntry(index), style: {
|
|
183
|
+
fontSize: "6.5pt",
|
|
184
|
+
lineHeight: 1,
|
|
185
|
+
padding: "1px 4px",
|
|
186
|
+
border: "1px solid #b91c1c",
|
|
187
|
+
backgroundColor: "#fef2f2",
|
|
188
|
+
color: "#b91c1c",
|
|
189
|
+
cursor: "pointer",
|
|
190
|
+
}, children: "Delete" })) : null] })) : null] }), _jsx("td", { style: tdBase, children: row ? display(row.reference) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "center" }, children: row ? fmtQty(row.receiptQty) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "right" }, children: row ? fmtAmount(row.unitCost) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "right" }, children: row ? fmtAmount(row.totalCost) : "" }), _jsx("td", { style: tdBase, children: row ? display(row.issuesTransfersAdjustments) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "right" }, children: row ? fmtAmount(row.accumulatedImpairmentLosses) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "right" }, children: row ? fmtAmount(row.adjustedCost) : "" }), _jsx("td", { style: tdBase, children: row ? display(row.natureOfRepair) : "" }), _jsx("td", { style: { ...tdBase, textAlign: "right" }, children: row ? fmtAmount(row.amount) : "" })] }, index));
|
|
191
|
+
}) })] })] }) })] }));
|
|
192
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type StockCardPreviewProps = {
|
|
2
|
+
stockCardNo: string;
|
|
3
|
+
itemCode: string;
|
|
4
|
+
itemName: string;
|
|
5
|
+
warehouse: string;
|
|
6
|
+
receiptQty: string;
|
|
7
|
+
issueQty: string;
|
|
8
|
+
balanceQty: string;
|
|
9
|
+
referenceDoc: string;
|
|
10
|
+
transactionDate: string;
|
|
11
|
+
status?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function StockCardPreview({ stockCardNo, itemCode, itemName, warehouse, receiptQty, issueQty, balanceQty, referenceDoc, transactionDate, status, }: StockCardPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
function formatDate(value) {
|
|
4
|
+
if (!value)
|
|
5
|
+
return "-";
|
|
6
|
+
const date = new Date(value);
|
|
7
|
+
if (Number.isNaN(date.getTime()))
|
|
8
|
+
return value;
|
|
9
|
+
return date.toLocaleDateString("en-PH", {
|
|
10
|
+
year: "numeric",
|
|
11
|
+
month: "short",
|
|
12
|
+
day: "2-digit",
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function StockCardPreview({ stockCardNo, itemCode, itemName, warehouse, receiptQty, issueQty, balanceQty, referenceDoc, transactionDate, status, }) {
|
|
16
|
+
return (_jsxs("div", { className: "rounded-md border bg-white p-6", children: [_jsx("h4", { className: "mb-5 text-center text-lg font-semibold tracking-wide", children: "STOCK CARD" }), _jsxs("div", { className: "grid gap-2 border p-3 text-xs md:grid-cols-2", children: [_jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Stock Card No:" }), " ", stockCardNo || "-"] }), _jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Item Code:" }), " ", itemCode || "-"] }), _jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Item Name:" }), " ", itemName || "-"] }), _jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Warehouse:" }), " ", warehouse || "-"] }), _jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Reference:" }), " ", referenceDoc || "-"] }), _jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Transaction Date:" }), " ", formatDate(transactionDate)] }), status ? (_jsxs("p", { children: [_jsx("span", { className: "font-semibold", children: "Status:" }), " ", status] })) : null] }), _jsxs("table", { className: "mt-4 min-w-full border-collapse text-xs", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "border bg-slate-50 p-2 text-left", children: "Receipt Qty" }), _jsx("th", { className: "border bg-slate-50 p-2 text-left", children: "Issue Qty" }), _jsx("th", { className: "border bg-slate-50 p-2 text-left", children: "Balance Qty" })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { className: "border p-2", children: receiptQty || "-" }), _jsx("td", { className: "border p-2", children: issueQty || "-" }), _jsx("td", { className: "border p-2", children: balanceQty || "-" })] }) })] })] }));
|
|
17
|
+
}
|