@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,28 @@
|
|
|
1
|
+
import { type BasicForm, type ItemRow } from "../types.js";
|
|
2
|
+
type AccountablePersonOption = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
activeTab: string;
|
|
8
|
+
onTabChange: (tab: string) => void;
|
|
9
|
+
basicForm: BasicForm;
|
|
10
|
+
onBasicFormChange: (update: Partial<BasicForm>) => void;
|
|
11
|
+
items: ItemRow[];
|
|
12
|
+
itemDraft: Omit<ItemRow, "id">;
|
|
13
|
+
onItemDraftChange: (update: Partial<Omit<ItemRow, "id">>) => void;
|
|
14
|
+
onAddItem: () => void;
|
|
15
|
+
onRemoveItem: (id: string) => void;
|
|
16
|
+
onItemChange?: (id: string, update: Partial<Omit<ItemRow, "id">>) => void;
|
|
17
|
+
allowAdditionalItems?: boolean;
|
|
18
|
+
allowRemoveItems?: boolean;
|
|
19
|
+
modalMode: "create" | "view" | "edit";
|
|
20
|
+
itrNo?: string;
|
|
21
|
+
destinationAccountablePeople?: AccountablePersonOption[];
|
|
22
|
+
selectedDestinationAccountablePersonId?: string;
|
|
23
|
+
onDestinationAccountablePersonChange?: (id: string) => void;
|
|
24
|
+
autoFilledDivisionSections?: boolean;
|
|
25
|
+
readOnlyItemAmount?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare function CreateForm({ activeTab, onTabChange, basicForm, onBasicFormChange, items, itemDraft, onItemDraftChange, onAddItem, onRemoveItem, onItemChange, allowAdditionalItems, allowRemoveItems, modalMode, itrNo, destinationAccountablePeople, selectedDestinationAccountablePersonId, onDestinationAccountablePersonChange, autoFilledDivisionSections, readOnlyItemAmount, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ConfigurableFormLayout, } from "../../../internal/components/configurable-form-layout.js";
|
|
4
|
+
import { DateInput } from "../../../internal/components/ui/date-input.js";
|
|
5
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../internal/components/ui/tabs.js";
|
|
6
|
+
import { PROPERTY_CONDITIONS, TRANSFER_TYPES } from "../types.js";
|
|
7
|
+
import { fmtAmount, fmtDate } from "../utils.js";
|
|
8
|
+
export function CreateForm({ activeTab, onTabChange, basicForm, onBasicFormChange, items, itemDraft, onItemDraftChange, onAddItem, onRemoveItem, onItemChange, allowAdditionalItems = true, allowRemoveItems = true, modalMode, itrNo, destinationAccountablePeople, selectedDestinationAccountablePersonId, onDestinationAccountablePersonChange, autoFilledDivisionSections = false, readOnlyItemAmount = false, }) {
|
|
9
|
+
const inputClassName = "bg-background text-foreground placeholder:text-muted-foreground/70 w-full rounded-md border px-3 py-2 text-sm";
|
|
10
|
+
const compactInputClassName = "bg-background text-foreground placeholder:text-muted-foreground/70 w-full rounded-md border px-3 py-1.5 text-sm";
|
|
11
|
+
const fields = [
|
|
12
|
+
{
|
|
13
|
+
id: "entityName",
|
|
14
|
+
label: "Entity Name *",
|
|
15
|
+
render: () => (_jsx("input", { value: basicForm.entityName, onChange: e => onBasicFormChange({ entityName: e.target.value }), placeholder: "Entity Name", className: inputClassName })),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "fundCluster",
|
|
19
|
+
label: "Fund Cluster *",
|
|
20
|
+
render: () => (_jsx("input", { value: basicForm.fundCluster, onChange: e => onBasicFormChange({ fundCluster: e.target.value }), placeholder: "Fund Cluster", className: inputClassName })),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "fromAccountablePerson",
|
|
24
|
+
label: "From Accountable Person *",
|
|
25
|
+
render: () => (_jsx("input", { value: basicForm.fromAccountablePerson, onChange: e => onBasicFormChange({
|
|
26
|
+
fromAccountablePerson: e.target.value,
|
|
27
|
+
fromAccountableOfficer: e.target.value,
|
|
28
|
+
}), placeholder: "From accountable person", className: inputClassName })),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "fromDivisionSection",
|
|
32
|
+
label: "From Section/Division *",
|
|
33
|
+
render: () => (_jsx("input", { value: basicForm.fromDivisionSection, onChange: e => onBasicFormChange({ fromDivisionSection: e.target.value }), placeholder: autoFilledDivisionSections
|
|
34
|
+
? "Auto-filled from current accountable person"
|
|
35
|
+
: "From section/division", readOnly: autoFilledDivisionSections, className: inputClassName })),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "toAccountablePerson",
|
|
39
|
+
label: destinationAccountablePeople ? "To Accountable Officer *" : "To Accountable Person *",
|
|
40
|
+
render: () => destinationAccountablePeople ? (_jsxs("select", { value: selectedDestinationAccountablePersonId ?? "", onChange: e => onDestinationAccountablePersonChange?.(e.target.value), className: inputClassName, children: [_jsx("option", { value: "", children: "Select requestor" }), destinationAccountablePeople.map(person => (_jsx("option", { value: person.id, children: person.name }, person.id)))] })) : (_jsx("input", { value: basicForm.toAccountablePerson, onChange: e => onBasicFormChange({
|
|
41
|
+
toAccountablePerson: e.target.value,
|
|
42
|
+
toAccountableOfficer: e.target.value,
|
|
43
|
+
}), placeholder: "To accountable person", className: inputClassName })),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "toDivisionSection",
|
|
47
|
+
label: "To Section/Division *",
|
|
48
|
+
render: () => (_jsx("input", { value: basicForm.toDivisionSection, onChange: e => onBasicFormChange({ toDivisionSection: e.target.value }), placeholder: autoFilledDivisionSections
|
|
49
|
+
? "Auto-filled from selected requestor"
|
|
50
|
+
: "To section/division", readOnly: autoFilledDivisionSections, className: inputClassName })),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "transferDate",
|
|
54
|
+
label: "Date",
|
|
55
|
+
render: () => (_jsx(DateInput, { value: basicForm.transferDate, onValueChange: transferDate => onBasicFormChange({ transferDate }), className: inputClassName })),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "transferType",
|
|
59
|
+
label: "Transfer Type",
|
|
60
|
+
render: () => (_jsxs("select", { value: basicForm.transferType, onChange: e => onBasicFormChange({ transferType: e.target.value }), className: inputClassName, children: [_jsx("option", { value: "", children: "Select transfer type" }), TRANSFER_TYPES.map(t => (_jsx("option", { children: t }, t)))] })),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "transferTypeOthers",
|
|
64
|
+
label: "Transfer Type (Other — specify)",
|
|
65
|
+
fullWidth: true,
|
|
66
|
+
render: () => (_jsx("input", { value: basicForm.transferTypeOthers, onChange: e => onBasicFormChange({ transferTypeOthers: e.target.value }), placeholder: basicForm.transferType === "Others"
|
|
67
|
+
? "Specify transfer type"
|
|
68
|
+
: "Only applies when Transfer Type is 'Others'", disabled: basicForm.transferType !== "Others", className: `${inputClassName} disabled:cursor-not-allowed disabled:opacity-50` })),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "reasonForTransfer",
|
|
72
|
+
label: "Reason for Transfer",
|
|
73
|
+
fullWidth: true,
|
|
74
|
+
render: () => (_jsx("input", { value: basicForm.reasonForTransfer, onChange: e => onBasicFormChange({ reasonForTransfer: e.target.value }), placeholder: "Reason for transfer", className: inputClassName })),
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
return (_jsxs(Tabs, { value: activeTab, onValueChange: onTabChange, children: [_jsxs(TabsList, { className: "grid w-full grid-cols-2", children: [_jsx(TabsTrigger, { value: "basic", children: "Basic Info" }), _jsx(TabsTrigger, { value: "items", children: "Items" })] }), _jsx(TabsContent, { value: "basic", className: "mt-4", children: _jsx(ConfigurableFormLayout, { formKey: "itr-basic-info", fields: fields, header: _jsxs("div", { className: "rounded-md border border-indigo-200 bg-indigo-50 p-3 dark:border-indigo-900/70 dark:bg-indigo-500/10", children: [_jsx("p", { className: "text-muted-foreground text-xs font-medium", children: "ITR Number" }), _jsx("p", { className: "text-foreground text-sm italic", children: modalMode === "edit" && itrNo ? itrNo : "Auto-generated on save" })] }) }) }), _jsxs(TabsContent, { value: "items", className: "mt-4 space-y-3", children: [_jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs("table", { className: "min-w-full border-collapse text-xs", children: [_jsx("thead", { className: "bg-muted/60 text-muted-foreground", children: _jsxs("tr", { children: [_jsx("th", { className: "border p-1 text-left", children: "Date Acquired" }), _jsx("th", { className: "border p-1 text-left", children: "Property No." }), _jsx("th", { className: "border p-1 text-left", children: "Description" }), _jsx("th", { className: "border p-1 text-right", children: "Amount" }), _jsx("th", { className: "border p-1 text-left", children: "Property Condition" }), _jsx("th", { className: "border p-1 text-left", children: "Action" })] }) }), _jsxs("tbody", { children: [items.map(item => (_jsxs("tr", { children: [_jsx("td", { className: "border p-1", children: onItemChange && !readOnlyItemAmount ? (_jsx(DateInput, { value: item.dateAcquired, onValueChange: dateAcquired => onItemChange(item.id, { dateAcquired }), className: "bg-background text-foreground w-full min-w-28 rounded border px-1.5 py-1" })) : (fmtDate(item.dateAcquired)) }), _jsx("td", { className: "border p-1", children: onItemChange ? (_jsx("input", { value: item.propertyNo || item.itemNo, onChange: e => onItemChange(item.id, {
|
|
78
|
+
propertyNo: e.target.value,
|
|
79
|
+
itemNo: e.target.value,
|
|
80
|
+
}), className: "bg-background text-foreground w-full min-w-28 rounded border px-1.5 py-1" })) : (item.propertyNo || item.itemNo) }), _jsx("td", { className: "border p-1", children: onItemChange ? (_jsx("input", { value: item.description, onChange: e => onItemChange(item.id, { description: e.target.value }), className: "bg-background text-foreground w-full min-w-40 rounded border px-1.5 py-1" })) : (item.description) }), _jsx("td", { className: "border p-1 text-right", children: onItemChange ? (_jsx("input", { type: "number", min: 0, value: item.amount, onChange: e => onItemChange(item.id, { amount: e.target.value }), className: "bg-background text-foreground w-24 rounded border px-1.5 py-1 text-right" })) : (fmtAmount(item.amount)) }), _jsx("td", { className: "border p-1", children: onItemChange ? (_jsxs("select", { value: item.conditionOfPPE || item.conditionOfInventory, onChange: e => onItemChange(item.id, {
|
|
81
|
+
conditionOfPPE: e.target.value,
|
|
82
|
+
conditionOfInventory: e.target.value,
|
|
83
|
+
}), className: "bg-background text-foreground w-full min-w-28 rounded border px-1.5 py-1", children: [_jsx("option", { value: "", children: "Select condition" }), PROPERTY_CONDITIONS.map(condition => (_jsx("option", { value: condition, children: condition }, condition)))] })) : (item.conditionOfPPE || item.conditionOfInventory) }), _jsx("td", { className: "border p-1", children: allowRemoveItems ? (_jsx("button", { onClick: () => onRemoveItem(item.id), className: "rounded border px-2 py-0.5 text-xs", children: "Remove" })) : (_jsx("span", { className: "text-muted-foreground text-xs", children: "Transferred item" })) })] }, item.id))), items.length === 0 && (_jsx("tr", { children: _jsx("td", { className: "text-muted-foreground border p-3 text-center", colSpan: 6, children: "No items added yet." }) }))] })] }) }), allowAdditionalItems && (_jsxs("div", { className: "bg-card text-card-foreground space-y-2 rounded-md border p-3", children: [_jsx("p", { className: "text-foreground text-xs font-semibold", children: "Add Item Row" }), _jsxs("div", { className: "grid gap-2 md:grid-cols-3", children: [_jsxs("div", { children: [_jsx("label", { className: "text-muted-foreground mb-0.5 block text-xs", children: "Date Acquired" }), _jsx(DateInput, { value: itemDraft.dateAcquired, onValueChange: dateAcquired => onItemDraftChange({ dateAcquired }), className: compactInputClassName })] }), _jsxs("div", { children: [_jsx("label", { className: "text-muted-foreground mb-0.5 block text-xs", children: "Property No." }), _jsx("input", { value: itemDraft.propertyNo, onChange: e => onItemDraftChange({ propertyNo: e.target.value, itemNo: e.target.value }), placeholder: "Property No.", className: compactInputClassName })] }), _jsxs("div", { className: "md:col-span-1", children: [_jsx("label", { className: "text-muted-foreground mb-0.5 block text-xs", children: "Description" }), _jsx("input", { value: itemDraft.description, onChange: e => onItemDraftChange({ description: e.target.value }), placeholder: "Description", className: compactInputClassName })] })] }), _jsxs("div", { className: "grid gap-2 md:grid-cols-2", children: [_jsxs("div", { children: [_jsx("label", { className: "text-muted-foreground mb-0.5 block text-xs", children: "Amount" }), _jsx("input", { type: "number", min: 0, value: itemDraft.amount, onChange: e => onItemDraftChange({ amount: e.target.value }), className: compactInputClassName })] }), _jsxs("div", { children: [_jsx("label", { className: "text-muted-foreground mb-0.5 block text-xs", children: "Property Condition" }), _jsxs("select", { value: itemDraft.conditionOfPPE, onChange: e => {
|
|
84
|
+
const condition = e.target.value;
|
|
85
|
+
onItemDraftChange({
|
|
86
|
+
conditionOfPPE: condition,
|
|
87
|
+
conditionOfInventory: condition,
|
|
88
|
+
});
|
|
89
|
+
}, className: compactInputClassName, children: [_jsx("option", { value: "", children: "Select condition" }), PROPERTY_CONDITIONS.map(condition => (_jsx("option", { value: condition, children: condition }, condition)))] })] })] }), _jsx("button", { onClick: onAddItem, className: "bg-primary rounded-md px-3 py-2 text-sm text-white", children: "Add Item" })] }))] })] }));
|
|
90
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type ItrStatus = "Submitted" | "Approved" | "For Delivery" | "Received";
|
|
2
|
+
export type ModalMode = "create" | "view" | "edit";
|
|
3
|
+
export declare const PROPERTY_CONDITIONS: readonly ["Serviceable", "Unserviceable"];
|
|
4
|
+
export type PropertyCondition = (typeof PROPERTY_CONDITIONS)[number];
|
|
5
|
+
export type ItemRow = {
|
|
6
|
+
id: string;
|
|
7
|
+
dateAcquired: string;
|
|
8
|
+
propertyNo: string;
|
|
9
|
+
itemNo: string;
|
|
10
|
+
icsNo: string;
|
|
11
|
+
icsDate: string;
|
|
12
|
+
description: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
conditionOfPPE: PropertyCondition | "";
|
|
15
|
+
conditionOfInventory: PropertyCondition | "";
|
|
16
|
+
};
|
|
17
|
+
export type StoredItrItem = {
|
|
18
|
+
id?: number;
|
|
19
|
+
lineNo?: number;
|
|
20
|
+
dateAcquired?: string;
|
|
21
|
+
itemNo?: string;
|
|
22
|
+
propertyNo?: string;
|
|
23
|
+
icsNo?: string;
|
|
24
|
+
icsDate?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
amount?: string;
|
|
27
|
+
conditionOfPPE?: string;
|
|
28
|
+
conditionOfInventory?: string;
|
|
29
|
+
};
|
|
30
|
+
export type StoredItrReport = {
|
|
31
|
+
id: string;
|
|
32
|
+
itrNo: string;
|
|
33
|
+
entityName?: string;
|
|
34
|
+
fundCluster?: string;
|
|
35
|
+
fromAccountableOfficer?: string;
|
|
36
|
+
fromAccountablePerson?: string;
|
|
37
|
+
fromDivisionSection?: string;
|
|
38
|
+
toAccountableOfficer?: string;
|
|
39
|
+
toAccountablePerson?: string;
|
|
40
|
+
toDivisionSection?: string;
|
|
41
|
+
transferDate?: string;
|
|
42
|
+
transferType?: string;
|
|
43
|
+
transferTypeOthers?: string;
|
|
44
|
+
reason?: string;
|
|
45
|
+
reasonForTransfer?: string;
|
|
46
|
+
documentTypeId?: number;
|
|
47
|
+
status: string;
|
|
48
|
+
items: StoredItrItem[];
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
};
|
|
52
|
+
export type BasicForm = {
|
|
53
|
+
entityName: string;
|
|
54
|
+
fundCluster: string;
|
|
55
|
+
fromAccountableOfficer: string;
|
|
56
|
+
fromAccountablePerson: string;
|
|
57
|
+
fromDivisionSection: string;
|
|
58
|
+
toAccountableOfficer: string;
|
|
59
|
+
toAccountablePerson: string;
|
|
60
|
+
toDivisionSection: string;
|
|
61
|
+
transferDate: string;
|
|
62
|
+
transferType: string;
|
|
63
|
+
transferTypeOthers: string;
|
|
64
|
+
reasonForTransfer: string;
|
|
65
|
+
};
|
|
66
|
+
export declare const TRANSFER_TYPES: readonly ["Donation", "Reassignment", "Relocate", "Others"];
|
|
67
|
+
export declare const EMPTY_BASIC_FORM: BasicForm;
|
|
68
|
+
export declare const EMPTY_ITEM_DRAFT: Omit<ItemRow, "id">;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const PROPERTY_CONDITIONS = ["Serviceable", "Unserviceable"];
|
|
2
|
+
export const TRANSFER_TYPES = ["Donation", "Reassignment", "Relocate", "Others"];
|
|
3
|
+
export const EMPTY_BASIC_FORM = {
|
|
4
|
+
entityName: "",
|
|
5
|
+
fundCluster: "",
|
|
6
|
+
fromAccountableOfficer: "",
|
|
7
|
+
fromAccountablePerson: "",
|
|
8
|
+
fromDivisionSection: "",
|
|
9
|
+
toAccountableOfficer: "",
|
|
10
|
+
toAccountablePerson: "",
|
|
11
|
+
toDivisionSection: "",
|
|
12
|
+
transferDate: "",
|
|
13
|
+
transferType: "",
|
|
14
|
+
transferTypeOthers: "",
|
|
15
|
+
reasonForTransfer: "",
|
|
16
|
+
};
|
|
17
|
+
export const EMPTY_ITEM_DRAFT = {
|
|
18
|
+
dateAcquired: "",
|
|
19
|
+
propertyNo: "",
|
|
20
|
+
itemNo: "",
|
|
21
|
+
icsNo: "",
|
|
22
|
+
icsDate: "",
|
|
23
|
+
description: "",
|
|
24
|
+
amount: "0",
|
|
25
|
+
conditionOfPPE: "",
|
|
26
|
+
conditionOfInventory: "",
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BasicForm, ItemRow, StoredItrItem, StoredItrReport } from "./types.js";
|
|
2
|
+
export declare function formatDateTime(value: string): string;
|
|
3
|
+
export declare function fmtDate(value?: string): string;
|
|
4
|
+
export declare function fmtAmount(value: string): string;
|
|
5
|
+
/** Build preview-ready item from a live ItemRow (used in create/edit form) */
|
|
6
|
+
export declare function itemRowToPreviewItem(row: Omit<ItemRow, "id"> | ItemRow): {
|
|
7
|
+
dateAcquired: string;
|
|
8
|
+
propertyNo: string;
|
|
9
|
+
description: string;
|
|
10
|
+
amount: string;
|
|
11
|
+
conditionOfPPE: "" | "Serviceable" | "Unserviceable";
|
|
12
|
+
};
|
|
13
|
+
/** Build preview-ready item from a stored item (used in view modal) */
|
|
14
|
+
export declare function storedItemToPreviewItem(item: StoredItrItem): {
|
|
15
|
+
dateAcquired: string;
|
|
16
|
+
propertyNo: string;
|
|
17
|
+
description: string;
|
|
18
|
+
amount: string;
|
|
19
|
+
conditionOfPPE: string;
|
|
20
|
+
};
|
|
21
|
+
/** Build a BasicForm from a stored record (used when opening edit modal) */
|
|
22
|
+
export declare function recordToBasicForm(record: StoredItrReport): BasicForm;
|
|
23
|
+
/** Build ItemRow[] from a stored record's items (used when opening edit modal) */
|
|
24
|
+
export declare function recordItemsToRows(items: StoredItrItem[]): ItemRow[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export function formatDateTime(value) {
|
|
2
|
+
return new Date(value).toLocaleString("en-PH", {
|
|
3
|
+
year: "numeric",
|
|
4
|
+
month: "short",
|
|
5
|
+
day: "2-digit",
|
|
6
|
+
hour: "2-digit",
|
|
7
|
+
minute: "2-digit",
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export function fmtDate(value) {
|
|
11
|
+
if (!value)
|
|
12
|
+
return "";
|
|
13
|
+
const d = new Date(value);
|
|
14
|
+
return isNaN(d.getTime()) ? value : d.toLocaleDateString("en-PH");
|
|
15
|
+
}
|
|
16
|
+
export function fmtAmount(value) {
|
|
17
|
+
const n = Number(value);
|
|
18
|
+
return Number.isNaN(n)
|
|
19
|
+
? value
|
|
20
|
+
: n.toLocaleString("en-PH", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
21
|
+
}
|
|
22
|
+
function normalizePropertyCondition(value) {
|
|
23
|
+
return value === "Serviceable" || value === "Unserviceable" ? value : "";
|
|
24
|
+
}
|
|
25
|
+
/** Build preview-ready item from a live ItemRow (used in create/edit form) */
|
|
26
|
+
export function itemRowToPreviewItem(row) {
|
|
27
|
+
return {
|
|
28
|
+
dateAcquired: row.dateAcquired,
|
|
29
|
+
propertyNo: row.propertyNo || row.itemNo,
|
|
30
|
+
description: row.description,
|
|
31
|
+
amount: row.amount,
|
|
32
|
+
conditionOfPPE: row.conditionOfPPE || row.conditionOfInventory,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Build preview-ready item from a stored item (used in view modal) */
|
|
36
|
+
export function storedItemToPreviewItem(item) {
|
|
37
|
+
return {
|
|
38
|
+
dateAcquired: item.dateAcquired ?? "",
|
|
39
|
+
propertyNo: item.propertyNo ?? item.itemNo ?? "",
|
|
40
|
+
description: item.description ?? "",
|
|
41
|
+
amount: item.amount ?? "0",
|
|
42
|
+
conditionOfPPE: item.conditionOfPPE ?? item.conditionOfInventory ?? "",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Build a BasicForm from a stored record (used when opening edit modal) */
|
|
46
|
+
export function recordToBasicForm(record) {
|
|
47
|
+
return {
|
|
48
|
+
entityName: record.entityName ?? "",
|
|
49
|
+
fundCluster: record.fundCluster ?? "",
|
|
50
|
+
fromAccountableOfficer: record.fromAccountablePerson ?? record.fromAccountableOfficer ?? "",
|
|
51
|
+
fromAccountablePerson: record.fromAccountablePerson ?? record.fromAccountableOfficer ?? "",
|
|
52
|
+
fromDivisionSection: record.fromDivisionSection ?? "",
|
|
53
|
+
toAccountableOfficer: record.toAccountablePerson ?? record.toAccountableOfficer ?? "",
|
|
54
|
+
toAccountablePerson: record.toAccountablePerson ?? record.toAccountableOfficer ?? "",
|
|
55
|
+
toDivisionSection: record.toDivisionSection ?? "",
|
|
56
|
+
transferDate: record.transferDate ? record.transferDate.slice(0, 10) : "",
|
|
57
|
+
transferType: record.transferType ?? "",
|
|
58
|
+
transferTypeOthers: record.transferTypeOthers ?? "",
|
|
59
|
+
reasonForTransfer: record.reasonForTransfer ?? record.reason ?? "",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Build ItemRow[] from a stored record's items (used when opening edit modal) */
|
|
63
|
+
export function recordItemsToRows(items) {
|
|
64
|
+
return items.map((item, i) => ({
|
|
65
|
+
id: `ITEM-${String(i + 1).padStart(3, "0")}`,
|
|
66
|
+
dateAcquired: item.dateAcquired ? item.dateAcquired.slice(0, 10) : "",
|
|
67
|
+
propertyNo: item.propertyNo ?? item.itemNo ?? "",
|
|
68
|
+
itemNo: item.itemNo ?? "",
|
|
69
|
+
icsNo: item.icsNo ?? "",
|
|
70
|
+
icsDate: item.icsDate ? item.icsDate.slice(0, 10) : "",
|
|
71
|
+
description: item.description ?? "",
|
|
72
|
+
amount: item.amount ?? "0",
|
|
73
|
+
conditionOfPPE: normalizePropertyCondition(item.conditionOfPPE ?? item.conditionOfInventory),
|
|
74
|
+
conditionOfInventory: normalizePropertyCondition(item.conditionOfInventory),
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PrBasicForm, PrItem, PrItemDraft } from "../types.js";
|
|
2
|
+
type PurchaseRequestCreateFormProps = {
|
|
3
|
+
activeTab: string;
|
|
4
|
+
onActiveTabChange: (tab: string) => void;
|
|
5
|
+
prNo: string;
|
|
6
|
+
onRefreshPrNo: () => void;
|
|
7
|
+
basicForm: PrBasicForm;
|
|
8
|
+
onBasicFieldChange: <K extends keyof PrBasicForm>(field: K, value: PrBasicForm[K]) => void;
|
|
9
|
+
items: PrItem[];
|
|
10
|
+
itemDraft: PrItemDraft;
|
|
11
|
+
onItemDraftFieldChange: <K extends keyof PrItemDraft>(field: K, value: PrItemDraft[K]) => void;
|
|
12
|
+
onAddItem: () => void;
|
|
13
|
+
onRemoveItem: (id: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function PurchaseRequestCreateForm({ activeTab, onActiveTabChange, prNo, onRefreshPrNo, basicForm, onBasicFieldChange, items, itemDraft, onItemDraftFieldChange, onAddItem, onRemoveItem, }: PurchaseRequestCreateFormProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ConfigurableFormLayout, } from "../../../internal/components/configurable-form-layout.js";
|
|
4
|
+
import { DateInput } from "../../../internal/components/ui/date-input.js";
|
|
5
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../internal/components/ui/tabs.js";
|
|
6
|
+
import { formatCurrency } from "../utils.js";
|
|
7
|
+
export function PurchaseRequestCreateForm({ activeTab, onActiveTabChange, prNo, onRefreshPrNo, basicForm, onBasicFieldChange, items, itemDraft, onItemDraftFieldChange, onAddItem, onRemoveItem, }) {
|
|
8
|
+
const fields = [
|
|
9
|
+
{
|
|
10
|
+
id: "date",
|
|
11
|
+
label: "Date",
|
|
12
|
+
render: () => (_jsx(DateInput, { value: basicForm.date, onChange: e => onBasicFieldChange("date", e.target.value), type: "date", className: "w-full rounded-md border px-3 py-2 text-sm" })),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "entityName",
|
|
16
|
+
label: "Entity Name",
|
|
17
|
+
render: () => (_jsx("input", { value: basicForm.entityName, onChange: e => onBasicFieldChange("entityName", e.target.value), placeholder: "Entity Name", className: "w-full rounded-md border px-3 py-2 text-sm" })),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "officeId",
|
|
21
|
+
label: "Office / Section",
|
|
22
|
+
render: () => (_jsx("input", { value: basicForm.officeId ?? "", readOnly: true, placeholder: "Office / Section", className: "w-full rounded-md border bg-slate-50 px-3 py-2 text-sm text-slate-700" })),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "fundCluster",
|
|
26
|
+
label: "Fund Cluster",
|
|
27
|
+
render: () => (_jsxs("select", { value: basicForm.fundCluster, onChange: e => onBasicFieldChange("fundCluster", e.target.value), className: "w-full rounded-md border px-3 py-2 text-sm", children: [_jsx("option", { value: "", children: "Select fund cluster (required)" }), _jsx("option", { children: "Regular Agency Fund" }), _jsx("option", { children: "Trust Fund" }), _jsx("option", { children: "Special Account" })] })),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "fundSource",
|
|
31
|
+
label: "Fund Source",
|
|
32
|
+
render: () => (_jsxs("select", { value: basicForm.fundSource, onChange: e => onBasicFieldChange("fundSource", e.target.value), className: "w-full rounded-md border px-3 py-2 text-sm", children: [_jsx("option", { value: "", children: "Select fund source (required)" }), _jsx("option", { children: "MOOE" }), _jsx("option", { children: "Capital Outlay" })] })),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "fundType",
|
|
36
|
+
label: "Fund Type",
|
|
37
|
+
render: () => (_jsxs("select", { value: basicForm.fundType, onChange: e => onBasicFieldChange("fundType", e.target.value), className: "w-full rounded-md border px-3 py-2 text-sm", children: [_jsx("option", { value: "", children: "Select fund type (required)" }), _jsx("option", { children: "General Fund" }), _jsx("option", { children: "Special Purpose Fund" })] })),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "responsibilityCenterCode",
|
|
41
|
+
label: "Responsibility Center Code",
|
|
42
|
+
render: () => (_jsx("input", { value: basicForm.responsibilityCenterCode, onChange: e => onBasicFieldChange("responsibilityCenterCode", e.target.value), placeholder: "Responsibility Center Code", className: "w-full rounded-md border px-3 py-2 text-sm" })),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "purpose",
|
|
46
|
+
label: "Purpose",
|
|
47
|
+
fullWidth: true,
|
|
48
|
+
render: () => (_jsx("textarea", { value: basicForm.purpose, onChange: e => onBasicFieldChange("purpose", e.target.value), placeholder: "Purpose", className: "w-full rounded-md border px-3 py-2 text-sm", rows: 3 })),
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
return (_jsxs(Tabs, { value: activeTab, onValueChange: onActiveTabChange, children: [_jsxs(TabsList, { className: "grid w-full grid-cols-2", children: [_jsx(TabsTrigger, { value: "basic", children: "Basic Info" }), _jsx(TabsTrigger, { value: "items", children: "Items" })] }), _jsx(TabsContent, { value: "basic", className: "mt-4", children: _jsx(ConfigurableFormLayout, { formKey: "pr-basic-info", fields: fields, header: _jsx("div", { className: "rounded-md border border-indigo-200 bg-indigo-50 p-4", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("p", { className: "text-muted-foreground text-xs font-medium", children: "Auto-Generated PR Number" }), _jsx("p", { className: "text-3xl font-semibold text-slate-700", children: prNo })] }), _jsx("button", { onClick: onRefreshPrNo, className: "rounded-md border bg-white px-3 py-1 text-xs", children: "Refresh" })] }) }) }) }), _jsxs(TabsContent, { value: "items", className: "mt-4 space-y-3", children: [_jsx("div", { className: "overflow-x-auto rounded-md border", children: _jsxs("table", { className: "min-w-full border-collapse text-xs", children: [_jsx("thead", { className: "bg-gray-50", children: _jsxs("tr", { children: [_jsx("th", { className: "border p-2 text-left", children: "Stock/Property No." }), _jsx("th", { className: "border p-2 text-left", children: "Unit" }), _jsx("th", { className: "border p-2 text-left", children: "Description" }), _jsx("th", { className: "border p-2 text-right", children: "Qty" }), _jsx("th", { className: "border p-2 text-right", children: "Unit Cost" }), _jsx("th", { className: "border p-2 text-right", children: "Total" }), _jsx("th", { className: "border p-2 text-left", children: "Action" })] }) }), _jsxs("tbody", { children: [items.map(item => (_jsxs("tr", { children: [_jsx("td", { className: "border p-2", children: item.stockNo }), _jsx("td", { className: "border p-2", children: item.unit }), _jsx("td", { className: "border p-2", children: item.description }), _jsx("td", { className: "border p-2 text-right", children: item.quantity }), _jsx("td", { className: "border p-2 text-right", children: formatCurrency(Number(item.unitCost) || 0) }), _jsx("td", { className: "border p-2 text-right", children: formatCurrency((Number(item.quantity) || 0) * (Number(item.unitCost) || 0)) }), _jsx("td", { className: "border p-2", children: _jsx("button", { onClick: () => onRemoveItem(item.id), className: "rounded border px-2 py-1 text-xs", children: "Remove" }) })] }, item.id))), items.length === 0 && (_jsx("tr", { children: _jsx("td", { className: "text-muted-foreground border p-3 text-center", colSpan: 7, children: "No items added yet." }) }))] })] }) }), _jsxs("div", { className: "grid gap-2 md:grid-cols-5", children: [_jsx("input", { value: itemDraft.stockNo, onChange: e => onItemDraftFieldChange("stockNo", e.target.value), placeholder: "Stock/Property No.", className: "rounded-md border px-3 py-2 text-sm" }), _jsx("input", { value: itemDraft.unit, onChange: e => onItemDraftFieldChange("unit", e.target.value), placeholder: "Unit", className: "rounded-md border px-3 py-2 text-sm" }), _jsx("input", { value: itemDraft.description, onChange: e => onItemDraftFieldChange("description", e.target.value), placeholder: "Description", className: "rounded-md border px-3 py-2 text-sm" }), _jsx("input", { type: "number", min: 1, value: itemDraft.quantity, onChange: e => onItemDraftFieldChange("quantity", e.target.value), placeholder: "Qty", className: "rounded-md border px-3 py-2 text-sm" }), _jsx("input", { type: "number", min: 0, value: itemDraft.unitCost, onChange: e => onItemDraftFieldChange("unitCost", e.target.value), placeholder: "Unit Cost", className: "rounded-md border px-3 py-2 text-sm" })] }), _jsx("button", { onClick: onAddItem, className: "rounded-md border bg-white px-3 py-2 text-sm hover:bg-slate-50", children: "+ Add Item" })] })] }));
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PrRecord, PrSignatories } from "../types.js";
|
|
2
|
+
type PrDocumentPreviewProps = {
|
|
3
|
+
record: PrRecord;
|
|
4
|
+
signatories?: PrSignatories;
|
|
5
|
+
};
|
|
6
|
+
export declare function PrDocumentPreview({ record, signatories }: PrDocumentPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { formatCurrency, formatPrDate, getItemTotal, getRecordTotal } from "../utils.js";
|
|
4
|
+
export function PrDocumentPreview({ record, signatories }) {
|
|
5
|
+
const items = record.items.slice(0, 12);
|
|
6
|
+
const fillerHeight = Math.max(150, (12 - items.length) * 36);
|
|
7
|
+
const officeSection = record.officeSection || record.officeName || record.officeId || "";
|
|
8
|
+
return (_jsx("div", { className: "psms-print-preview mx-auto w-full max-w-full overflow-x-auto", children: _jsx("div", { className: "mx-auto w-fit rounded-[18px] border border-slate-300 bg-[linear-gradient(180deg,#ffffff_0%,#fcfcfc_100%)] p-4 shadow-[0_18px_40px_-24px_rgba(15,23,42,0.35)]", children: _jsx("div", { "data-pdf-page": "true", "data-pdf-fit-one-page": "true", "data-pdf-orientation": "portrait", className: "mx-auto min-h-[1123px] w-[794px] bg-white font-serif text-[11px] text-black", children: _jsxs("div", { className: "px-8 py-8", children: [_jsx("h4", { className: "mb-8 text-center text-[15px] font-bold tracking-wide", children: "PURCHASE REQUEST" }), _jsx("table", { className: "w-full border-collapse", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsxs("td", { className: "border border-black px-2 py-1 font-bold", colSpan: 3, children: ["Entity Name:", record.entityName || ""] }), _jsxs("td", { className: "border border-black px-2 py-1 font-bold", colSpan: 3, children: ["Fund Cluster - ", record.fundCluster || ""] })] }), _jsxs("tr", { children: [_jsxs("td", { className: "border border-black px-2 py-1", colSpan: 2, children: [_jsx("div", { className: "font-bold", children: "Office/Section:" }), _jsx("div", { className: "min-h-5", children: officeSection })] }), _jsxs("td", { className: "border border-black px-2 py-1", colSpan: 2, children: [_jsx("div", { className: "font-bold", children: "PR No:" }), _jsx("div", { children: record.prNo }), _jsx("div", { className: "mt-1 font-bold", children: "Responsibility Center Code:" }), _jsx("div", { children: record.responsibilityCenterCode || "" })] }), _jsxs("td", { className: "border border-black px-2 py-1", colSpan: 2, children: [_jsx("div", { className: "font-bold", children: "Date:" }), _jsx("div", { children: formatPrDate(record.date || record.createdAt) })] })] }), _jsx("tr", { children: _jsx("td", { className: "border border-black py-1", colSpan: 6 }) })] }) }), _jsxs("table", { className: "w-full border-collapse", children: [_jsx("thead", { children: _jsxs("tr", { className: "text-center font-bold", children: [_jsx("th", { className: "border border-black px-2 py-1", children: "Stock/PropertyNo." }), _jsx("th", { className: "border border-black px-2 py-1", children: "Unit" }), _jsx("th", { className: "border border-black px-2 py-1", children: "Item Description" }), _jsx("th", { className: "border border-black px-2 py-1", children: "Quantity" }), _jsx("th", { className: "border border-black px-2 py-1", children: "Unit cost" }), _jsx("th", { className: "border border-black px-2 py-1", children: "Total Cost" })] }) }), _jsxs("tbody", { children: [items.map(item => (_jsxs("tr", { className: "h-9 align-top", children: [_jsx("td", { className: "border-x border-black px-2 py-1", children: item.stockNo || "" }), _jsx("td", { className: "border-x border-black px-2 py-1 text-center", children: item.unit || "" }), _jsx("td", { className: "border-x border-black px-2 py-1", children: item.description }), _jsx("td", { className: "border-x border-black px-2 py-1 text-center", children: item.quantity }), _jsx("td", { className: "border-x border-black px-2 py-1 text-right", children: formatCurrency(Number(item.unitCost) || 0) }), _jsx("td", { className: "border-x border-black px-2 py-1 text-right", children: formatCurrency(getItemTotal(item)) })] }, item.id))), _jsxs("tr", { style: { height: fillerHeight }, children: [_jsx("td", { className: "border-x border-b border-black px-2 align-top" }), _jsx("td", { className: "border-x border-b border-black px-2 align-top" }), _jsx("td", { className: "border-x border-b border-black px-2 pt-6 text-center align-top text-slate-600 italic", children: "***nothing follows***" }), _jsx("td", { className: "border-x border-b border-black px-2 align-top" }), _jsx("td", { className: "border-x border-b border-black px-2 align-top" }), _jsx("td", { className: "border-x border-b border-black px-2 align-top" })] }), _jsxs("tr", { className: "font-bold", children: [_jsx("td", { className: "border border-black px-2 py-2 text-right", colSpan: 5, children: "Total Amount" }), _jsx("td", { className: "border border-black px-2 py-2 text-right", children: formatCurrency(getRecordTotal(record)) })] })] })] }), _jsx("table", { className: "w-full border-collapse", children: _jsx("tbody", { children: _jsx("tr", { children: _jsxs("td", { className: "border border-black px-2 py-1", children: [_jsx("div", { className: "font-bold", children: "Purpose:" }), _jsx("div", { className: "min-h-16 pt-1", children: record.purpose || "" })] }) }) }) }), _jsx("table", { className: "w-full border-collapse", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "border border-black px-2 py-1", style: { width: "18%" } }), _jsx("td", { className: "border border-black px-2 py-1 font-bold", style: { width: "41%" }, children: "Requested by:" }), _jsx("td", { className: "border border-black px-2 py-1 font-bold", style: { width: "41%" }, children: "Approved by:" })] }), _jsxs("tr", { className: "h-10", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Signature" }), _jsx("td", { className: "border border-black px-2 py-4" }), _jsx("td", { className: "border border-black px-2 py-4" })] }), _jsxs("tr", { className: "h-9", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Printed Name" }), _jsx("td", { className: "border border-black px-2 py-3 text-center font-bold", children: signatories?.requestedBy?.name ?? "" }), _jsx("td", { className: "border border-black px-2 py-3 text-center font-bold", children: signatories?.approvedBy?.name ?? "" })] }), _jsxs("tr", { className: "h-7", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Designation" }), _jsx("td", { className: "border border-black px-2 py-1 text-center font-bold", children: signatories?.requestedBy?.designation ?? "" }), _jsx("td", { className: "border border-black px-2 py-1 text-center font-bold", children: signatories?.approvedBy?.designation ?? "" })] }), _jsxs("tr", { children: [_jsx("td", { className: "border border-black px-2 py-1" }), _jsx("td", { className: "border border-black px-2 py-1 text-center font-bold", colSpan: 2, children: "Certification as to Funds Availability" })] }), _jsxs("tr", { className: "h-10", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Signature" }), _jsx("td", { className: "border border-black px-2 py-4", colSpan: 2 })] }), _jsxs("tr", { className: "h-9", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Printed Name" }), _jsx("td", { className: "border border-black px-2 py-3 text-center font-bold", colSpan: 2, children: signatories?.fundsAvailability?.name ?? "" })] }), _jsxs("tr", { className: "h-7", children: [_jsx("td", { className: "border border-black px-2 py-1 font-bold whitespace-nowrap", children: "Designation" }), _jsx("td", { className: "border border-black px-2 py-1 text-center font-bold", colSpan: 2, children: signatories?.fundsAvailability?.designation ?? "" })] })] }) })] }) }) }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { PrRequestType, PrRequestTypeInput } from "../../gam/purchase-request/workflow.js";
|
|
2
|
+
export type PrStatus = "Pending" | "Approved" | "Returned";
|
|
3
|
+
export type PrItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
itemId?: number | null;
|
|
6
|
+
stockNo: string;
|
|
7
|
+
unit: string;
|
|
8
|
+
description: string;
|
|
9
|
+
quantity: string;
|
|
10
|
+
unitCost: string;
|
|
11
|
+
totalCost?: string;
|
|
12
|
+
};
|
|
13
|
+
export type PrRecord = {
|
|
14
|
+
id: string;
|
|
15
|
+
prNo: string;
|
|
16
|
+
documentTypeId: number | null;
|
|
17
|
+
purpose: string;
|
|
18
|
+
entityName: string;
|
|
19
|
+
fundCluster: string;
|
|
20
|
+
fundSource: string;
|
|
21
|
+
fundType: string;
|
|
22
|
+
officeId: string | null;
|
|
23
|
+
officeName?: string | null;
|
|
24
|
+
officeSection: string | null;
|
|
25
|
+
requestedByName?: string | null;
|
|
26
|
+
requestedByDesignation?: string | null;
|
|
27
|
+
requestType: PrRequestType | null;
|
|
28
|
+
requestSubtype?: string | null;
|
|
29
|
+
responsibilityCenterCode: string;
|
|
30
|
+
date: string;
|
|
31
|
+
items: PrItem[];
|
|
32
|
+
status: PrStatus;
|
|
33
|
+
revisionRequired: boolean;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt?: string;
|
|
36
|
+
};
|
|
37
|
+
export type PrSignatory = {
|
|
38
|
+
name?: string;
|
|
39
|
+
designation?: string;
|
|
40
|
+
};
|
|
41
|
+
export type PrSignatories = {
|
|
42
|
+
requestedBy?: PrSignatory;
|
|
43
|
+
approvedBy?: PrSignatory;
|
|
44
|
+
fundsAvailability?: PrSignatory;
|
|
45
|
+
};
|
|
46
|
+
export type PrBasicForm = {
|
|
47
|
+
documentTypeId?: number;
|
|
48
|
+
purpose: string;
|
|
49
|
+
entityName: string;
|
|
50
|
+
fundCluster: string;
|
|
51
|
+
fundSource: string;
|
|
52
|
+
fundType: string;
|
|
53
|
+
officeId?: string;
|
|
54
|
+
officeSection: string;
|
|
55
|
+
requestedByDesignation: string;
|
|
56
|
+
requestType: PrRequestTypeInput;
|
|
57
|
+
requestSubtype: string;
|
|
58
|
+
responsibilityCenterCode: string;
|
|
59
|
+
date: string;
|
|
60
|
+
};
|
|
61
|
+
export type PrItemDraft = {
|
|
62
|
+
registrationKey?: string | null;
|
|
63
|
+
itemId?: number | null;
|
|
64
|
+
stockNo: string;
|
|
65
|
+
unit: string;
|
|
66
|
+
description: string;
|
|
67
|
+
quantity: string;
|
|
68
|
+
unitCost: string;
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as XLSX from "xlsx-js-style";
|
|
2
|
+
import type { PrBasicForm, PrItem, PrItemDraft, PrRecord, PrSignatories, PrSignatory } from "./types.js";
|
|
3
|
+
export { getInventoryCategoryForPr, getPrSubtypeOptions, isPurchaseOrderEligiblePr, PR_OTHER_SUBTYPES, PR_REQUEST_TYPES, PR_SERVICE_SUBTYPES, requiresPrSubtype, shouldBypassPrForIar, } from "../../gam/purchase-request/workflow.js";
|
|
4
|
+
type CellKind = "title" | "meta" | "header" | "item-text" | "item-center" | "item-number" | "nothing" | "purpose-label" | "purpose-value" | "signature-label" | "signature-heading" | "signature-line" | "designation" | "total-label" | "total-value" | "blank";
|
|
5
|
+
export type PurchaseRequestSheetCell = {
|
|
6
|
+
value: string | number;
|
|
7
|
+
kind: CellKind;
|
|
8
|
+
};
|
|
9
|
+
export type PurchaseRequestSheetModel = {
|
|
10
|
+
rows: PurchaseRequestSheetCell[][];
|
|
11
|
+
merges: XLSX.Range[];
|
|
12
|
+
cols: {
|
|
13
|
+
wch: number;
|
|
14
|
+
}[];
|
|
15
|
+
rowHeights: {
|
|
16
|
+
hpt: number;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
export declare const PR_OFFICE_SECTION_OPTIONS: readonly ["FAD - Personnel Section", "FAD - General Services", "FAD - Accounting Section", "FAD - Property and Supply Section", "FAD - Records Section", "FAD - Cash Section", "Special Production Division", "Special Operation Division", "Planning Division", "Office Director"];
|
|
20
|
+
type PrOfficeAssignment = {
|
|
21
|
+
officeId?: string | null;
|
|
22
|
+
divisionId?: string | null;
|
|
23
|
+
};
|
|
24
|
+
type PrOfficeMetadata = {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
divisionId: string | null;
|
|
28
|
+
divisionName: string | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function resolvePrOfficeSectionDefault(user: PrOfficeAssignment | null | undefined, sessionOfficeId: string | null | undefined, offices: readonly PrOfficeMetadata[]): string;
|
|
31
|
+
export declare function getPrOfficeSectionOptions(currentValue?: string | null): string[];
|
|
32
|
+
export declare function shouldApplyPrOfficeSectionDefault(isEditingRecord: boolean, hasUserEdited: boolean, currentValue: string, assignedDefault: string): boolean;
|
|
33
|
+
export declare function generatePrNo(sequence?: number): string;
|
|
34
|
+
export declare function formatCurrency(value: number): string;
|
|
35
|
+
export declare function formatPrDate(value: string): string;
|
|
36
|
+
export declare function formatDateTime(value: string): string;
|
|
37
|
+
export declare function getItemTotal(item: Pick<PrItem, "quantity" | "unitCost">): number;
|
|
38
|
+
export declare function getRecordTotal(record: Pick<PrRecord, "items">): number;
|
|
39
|
+
export declare function getSelectablePrInventoryItems<T extends {
|
|
40
|
+
itemId?: number | null;
|
|
41
|
+
stockNo: string;
|
|
42
|
+
category: string;
|
|
43
|
+
stockStatus: string;
|
|
44
|
+
}>(inventoryItems: readonly T[], inventoryCategory: string | null, currentItems: readonly Pick<PrItem, "id" | "itemId" | "stockNo">[], editingItemId?: string | null): T[];
|
|
45
|
+
export type BuildPrItemResult = {
|
|
46
|
+
item: PrItem;
|
|
47
|
+
error: null;
|
|
48
|
+
} | {
|
|
49
|
+
item: null;
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function buildPrItemFromDraft(currentItems: readonly PrItem[], draft: PrItemDraft, editingItemId?: string | null): BuildPrItemResult;
|
|
53
|
+
type PrApprovalSummaryForSignatories = {
|
|
54
|
+
submittedByName?: string | null;
|
|
55
|
+
submittedByDesignationName?: string | null;
|
|
56
|
+
submittedByOfficeName?: string | null;
|
|
57
|
+
steps: Array<{
|
|
58
|
+
status: string;
|
|
59
|
+
approverUserName?: string | null;
|
|
60
|
+
approverDesignationName?: string | null;
|
|
61
|
+
approverOfficeName?: string | null;
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
export declare function resolvePrWorkflowSignatories(summary: PrApprovalSummaryForSignatories | null | undefined, requestor?: PrSignatory): PrSignatories;
|
|
65
|
+
export declare function buildPurchaseRequestSheetModel(record: PrRecord, signatories?: PrSignatories): PurchaseRequestSheetModel;
|
|
66
|
+
export declare function buildPurchaseRequestWorksheetData(record: PrRecord, signatories?: PrSignatories): (string | number)[][];
|
|
67
|
+
export declare function exportPurchaseRequestXlsx(record: PrRecord, signatories?: PrSignatories): void;
|
|
68
|
+
export declare function exportPurchaseRequestCsv(record: PrRecord): void;
|
|
69
|
+
export declare function buildPurchaseRequestCsv(record: PrRecord): string;
|
|
70
|
+
export declare function getExcelPreviewCellClassName(kind: CellKind): "border border-slate-400 bg-white text-center font-bold" | "border border-slate-400 bg-white font-semibold" | "border border-slate-500 bg-slate-100 text-center font-semibold" | "border border-slate-300 bg-white text-center" | "border border-slate-300 bg-white text-right" | "border border-slate-300 bg-white text-center italic text-slate-500" | "border border-slate-300 bg-white";
|
|
71
|
+
export declare const EMPTY_BASIC_FORM: PrBasicForm;
|
|
72
|
+
export declare const EMPTY_ITEM_DRAFT: PrItemDraft;
|