@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,146 @@
|
|
|
1
|
+
import type { PrRequestType } from "./purchase-request/workflow.js";
|
|
2
|
+
export type PurchaseOrderStatus = "For Delivery" | "Delivered" | "Cancelled";
|
|
3
|
+
export type PurchaseOrderItem = {
|
|
4
|
+
itemId?: number | null;
|
|
5
|
+
stockNo?: string | null;
|
|
6
|
+
unit?: string | null;
|
|
7
|
+
description: string;
|
|
8
|
+
quantity: string;
|
|
9
|
+
unitCost: string;
|
|
10
|
+
totalCost?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type PurchaseOrderRecord = {
|
|
13
|
+
id: string;
|
|
14
|
+
poNo: string;
|
|
15
|
+
prNo: string;
|
|
16
|
+
supplier: string;
|
|
17
|
+
supplierAddress?: string | null;
|
|
18
|
+
supplierTin?: string | null;
|
|
19
|
+
modeOfProcurement?: string | null;
|
|
20
|
+
entityName: string;
|
|
21
|
+
fundCluster: string;
|
|
22
|
+
fundSource?: string | null;
|
|
23
|
+
fundType?: string | null;
|
|
24
|
+
responsibilityCenterCode?: string | null;
|
|
25
|
+
purpose?: string | null;
|
|
26
|
+
poDate: string;
|
|
27
|
+
placeOfDelivery?: string | null;
|
|
28
|
+
expectedDeliveryDate: string;
|
|
29
|
+
deliveryTerm?: string | null;
|
|
30
|
+
paymentTerm?: string | null;
|
|
31
|
+
amountInWords?: string | null;
|
|
32
|
+
supplierConforme?: string | null;
|
|
33
|
+
conformeDate?: string | null;
|
|
34
|
+
authorizedOfficial?: string | null;
|
|
35
|
+
fundsAvailable?: string | null;
|
|
36
|
+
orsBursNo?: string | null;
|
|
37
|
+
orsBursDate?: string | null;
|
|
38
|
+
orsBursAmount?: string | null;
|
|
39
|
+
chiefAccountantName?: string | null;
|
|
40
|
+
dateCreated: string;
|
|
41
|
+
totalAmount: string;
|
|
42
|
+
stocked: boolean;
|
|
43
|
+
status: PurchaseOrderStatus;
|
|
44
|
+
items: PurchaseOrderItem[];
|
|
45
|
+
createdById?: string | null;
|
|
46
|
+
requestorName?: string | null;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
};
|
|
50
|
+
export type DeliveryTrackingStatus = "For Delivery" | "Documents Uploaded" | "Received" | "IAR Created" | "Delivered";
|
|
51
|
+
export type DeliveryDocumentAttachment = {
|
|
52
|
+
fileName: string;
|
|
53
|
+
fileType: string;
|
|
54
|
+
fileSize: number;
|
|
55
|
+
referenceNo: string;
|
|
56
|
+
documentDate: string;
|
|
57
|
+
uploadedAt: string;
|
|
58
|
+
s3Key?: string | null;
|
|
59
|
+
url?: string | null;
|
|
60
|
+
bucket?: string | null;
|
|
61
|
+
};
|
|
62
|
+
export type DeliveryDocumentField = "salesInvoice" | "deliveryReceipts" | "receivedPurchaseOrder" | "billingStatement" | "extensionLetterRequest";
|
|
63
|
+
export type DeliveryDocumentGroup = {
|
|
64
|
+
field: DeliveryDocumentField;
|
|
65
|
+
label: string;
|
|
66
|
+
documents: DeliveryDocumentAttachment[];
|
|
67
|
+
required: boolean;
|
|
68
|
+
};
|
|
69
|
+
export type PurchaseOrderDeliveryRecord = {
|
|
70
|
+
id: string;
|
|
71
|
+
sourceType: "PO";
|
|
72
|
+
poNo: string;
|
|
73
|
+
prNo: string;
|
|
74
|
+
supplier: string;
|
|
75
|
+
entityName: string;
|
|
76
|
+
fundCluster: string;
|
|
77
|
+
responsibilityCenterCode?: string | null;
|
|
78
|
+
requestorName?: string | null;
|
|
79
|
+
deliveryDate: string;
|
|
80
|
+
status: DeliveryTrackingStatus;
|
|
81
|
+
documentsComplete: boolean;
|
|
82
|
+
salesInvoice?: DeliveryDocumentAttachment | null;
|
|
83
|
+
deliveryReceipt?: DeliveryDocumentAttachment | null;
|
|
84
|
+
deliveryReceipts?: DeliveryDocumentAttachment[];
|
|
85
|
+
receivedPurchaseOrder?: DeliveryDocumentAttachment | null;
|
|
86
|
+
billingStatement?: DeliveryDocumentAttachment | null;
|
|
87
|
+
extensionLetterRequest?: DeliveryDocumentAttachment | null;
|
|
88
|
+
items: PurchaseOrderItem[];
|
|
89
|
+
iarNo?: string | null;
|
|
90
|
+
iarCreatedAt?: string | null;
|
|
91
|
+
receivedAt?: string | null;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
};
|
|
95
|
+
export type PurchaseRequestForPo = {
|
|
96
|
+
prNo: string;
|
|
97
|
+
entityName: string;
|
|
98
|
+
fundCluster: string;
|
|
99
|
+
fundSource?: string | null;
|
|
100
|
+
fundType?: string | null;
|
|
101
|
+
responsibilityCenterCode?: string | null;
|
|
102
|
+
purpose?: string | null;
|
|
103
|
+
requestType?: PrRequestType | null;
|
|
104
|
+
requestSubtype?: string | null;
|
|
105
|
+
requestedByName?: string | null;
|
|
106
|
+
items: PurchaseOrderItem[];
|
|
107
|
+
};
|
|
108
|
+
export declare const PURCHASE_ORDER_MODULE_KEY = "supply-purchase-order";
|
|
109
|
+
export declare const PURCHASE_ORDER_DELIVERY_MODULE_KEY = "supply-delivery-tracking";
|
|
110
|
+
export declare const PURCHASE_ORDER_COLLECTION_KEY = "rows";
|
|
111
|
+
export declare function getPurchaseOrderTotal(items: PurchaseOrderItem[]): number;
|
|
112
|
+
export declare function formatPesoAmount(value: number | string): string;
|
|
113
|
+
export declare function buildPoNo(prNo: string): string;
|
|
114
|
+
export declare function buildPurchaseOrderFromPurchaseRequest(pr: PurchaseRequestForPo, params: {
|
|
115
|
+
supplier: string;
|
|
116
|
+
supplierAddress?: string | null;
|
|
117
|
+
supplierTin?: string | null;
|
|
118
|
+
modeOfProcurement?: string | null;
|
|
119
|
+
expectedDeliveryDate: string;
|
|
120
|
+
placeOfDelivery?: string | null;
|
|
121
|
+
deliveryTerm?: string | null;
|
|
122
|
+
paymentTerm?: string | null;
|
|
123
|
+
amountInWords?: string | null;
|
|
124
|
+
supplierConforme?: string | null;
|
|
125
|
+
conformeDate?: string | null;
|
|
126
|
+
authorizedOfficial?: string | null;
|
|
127
|
+
fundsAvailable?: string | null;
|
|
128
|
+
orsBursNo?: string | null;
|
|
129
|
+
orsBursDate?: string | null;
|
|
130
|
+
orsBursAmount?: string | null;
|
|
131
|
+
chiefAccountantName?: string | null;
|
|
132
|
+
createdById?: string | null;
|
|
133
|
+
now?: string;
|
|
134
|
+
}): PurchaseOrderRecord;
|
|
135
|
+
export declare function buildDeliveryRecordFromPurchaseOrder(order: PurchaseOrderRecord, now?: string): PurchaseOrderDeliveryRecord;
|
|
136
|
+
export declare function makeDeliveryAttachment(file: File, params: {
|
|
137
|
+
referenceNo: string;
|
|
138
|
+
documentDate: string;
|
|
139
|
+
s3Key?: string | null;
|
|
140
|
+
url?: string | null;
|
|
141
|
+
bucket?: string | null;
|
|
142
|
+
now?: string;
|
|
143
|
+
}): DeliveryDocumentAttachment;
|
|
144
|
+
export declare function getDeliveryReceipts(record: PurchaseOrderDeliveryRecord | undefined | null): DeliveryDocumentAttachment[];
|
|
145
|
+
export declare function getDeliveryDocumentGroups(record: PurchaseOrderDeliveryRecord | undefined | null): DeliveryDocumentGroup[];
|
|
146
|
+
export declare function hasCompleteDeliveryDocuments(record: PurchaseOrderDeliveryRecord | undefined | null): boolean;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export const PURCHASE_ORDER_MODULE_KEY = "supply-purchase-order";
|
|
2
|
+
export const PURCHASE_ORDER_DELIVERY_MODULE_KEY = "supply-delivery-tracking";
|
|
3
|
+
export const PURCHASE_ORDER_COLLECTION_KEY = "rows";
|
|
4
|
+
export function getPurchaseOrderTotal(items) {
|
|
5
|
+
return items.reduce((sum, item) => {
|
|
6
|
+
const explicitTotal = Number(item.totalCost);
|
|
7
|
+
if (Number.isFinite(explicitTotal) && explicitTotal > 0)
|
|
8
|
+
return sum + explicitTotal;
|
|
9
|
+
const quantity = Number(item.quantity) || 0;
|
|
10
|
+
const unitCost = Number(item.unitCost) || 0;
|
|
11
|
+
return sum + quantity * unitCost;
|
|
12
|
+
}, 0);
|
|
13
|
+
}
|
|
14
|
+
export function formatPesoAmount(value) {
|
|
15
|
+
const amount = typeof value === "string" ? Number(value) : value;
|
|
16
|
+
return new Intl.NumberFormat("en-PH", {
|
|
17
|
+
style: "currency",
|
|
18
|
+
currency: "PHP",
|
|
19
|
+
minimumFractionDigits: 2,
|
|
20
|
+
}).format(Number.isFinite(amount) ? amount : 0);
|
|
21
|
+
}
|
|
22
|
+
export function buildPoNo(prNo) {
|
|
23
|
+
const token = prNo
|
|
24
|
+
.trim()
|
|
25
|
+
.toUpperCase()
|
|
26
|
+
.replace(/[^A-Z0-9]+/g, "-")
|
|
27
|
+
.replace(/^-+|-+$/g, "")
|
|
28
|
+
.slice(-32);
|
|
29
|
+
return `PO-${token || Date.now()}`;
|
|
30
|
+
}
|
|
31
|
+
export function buildPurchaseOrderFromPurchaseRequest(pr, params) {
|
|
32
|
+
const now = params.now ?? new Date().toISOString();
|
|
33
|
+
const poNo = buildPoNo(pr.prNo);
|
|
34
|
+
const total = getPurchaseOrderTotal(pr.items);
|
|
35
|
+
return {
|
|
36
|
+
id: poNo,
|
|
37
|
+
poNo,
|
|
38
|
+
prNo: pr.prNo,
|
|
39
|
+
supplier: params.supplier.trim(),
|
|
40
|
+
supplierAddress: params.supplierAddress?.trim() || null,
|
|
41
|
+
supplierTin: params.supplierTin?.trim() || null,
|
|
42
|
+
modeOfProcurement: params.modeOfProcurement?.trim() || "Small Value Procurement",
|
|
43
|
+
entityName: pr.entityName,
|
|
44
|
+
fundCluster: pr.fundCluster,
|
|
45
|
+
fundSource: pr.fundSource,
|
|
46
|
+
fundType: pr.fundType,
|
|
47
|
+
responsibilityCenterCode: pr.responsibilityCenterCode,
|
|
48
|
+
purpose: pr.purpose,
|
|
49
|
+
poDate: now.slice(0, 10),
|
|
50
|
+
placeOfDelivery: params.placeOfDelivery?.trim() || "",
|
|
51
|
+
expectedDeliveryDate: params.expectedDeliveryDate,
|
|
52
|
+
deliveryTerm: params.deliveryTerm?.trim() || null,
|
|
53
|
+
paymentTerm: params.paymentTerm?.trim() || null,
|
|
54
|
+
amountInWords: params.amountInWords?.trim() || null,
|
|
55
|
+
supplierConforme: params.supplierConforme?.trim() || null,
|
|
56
|
+
conformeDate: params.conformeDate || null,
|
|
57
|
+
authorizedOfficial: params.authorizedOfficial?.trim() || null,
|
|
58
|
+
fundsAvailable: params.fundsAvailable?.trim() || null,
|
|
59
|
+
orsBursNo: params.orsBursNo?.trim() || null,
|
|
60
|
+
orsBursDate: params.orsBursDate || null,
|
|
61
|
+
orsBursAmount: params.orsBursAmount?.trim() || null,
|
|
62
|
+
chiefAccountantName: params.chiefAccountantName?.trim() || null,
|
|
63
|
+
dateCreated: now,
|
|
64
|
+
totalAmount: total.toFixed(2),
|
|
65
|
+
stocked: false,
|
|
66
|
+
status: "For Delivery",
|
|
67
|
+
items: pr.items.map(item => ({
|
|
68
|
+
itemId: item.itemId ?? null,
|
|
69
|
+
stockNo: item.stockNo ?? "",
|
|
70
|
+
unit: item.unit ?? "",
|
|
71
|
+
description: item.description,
|
|
72
|
+
quantity: String(item.quantity ?? "0"),
|
|
73
|
+
unitCost: String(item.unitCost ?? "0"),
|
|
74
|
+
totalCost: item.totalCost ?? (Number(item.quantity) * Number(item.unitCost)).toFixed(2),
|
|
75
|
+
})),
|
|
76
|
+
createdById: params.createdById ?? null,
|
|
77
|
+
requestorName: pr.requestedByName?.trim() || null,
|
|
78
|
+
createdAt: now,
|
|
79
|
+
updatedAt: now,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export function buildDeliveryRecordFromPurchaseOrder(order, now = new Date().toISOString()) {
|
|
83
|
+
return {
|
|
84
|
+
id: `DEL-${order.poNo}`,
|
|
85
|
+
sourceType: "PO",
|
|
86
|
+
poNo: order.poNo,
|
|
87
|
+
prNo: order.prNo,
|
|
88
|
+
supplier: order.supplier,
|
|
89
|
+
entityName: order.entityName,
|
|
90
|
+
fundCluster: order.fundCluster,
|
|
91
|
+
responsibilityCenterCode: order.responsibilityCenterCode,
|
|
92
|
+
requestorName: order.requestorName ?? null,
|
|
93
|
+
deliveryDate: order.expectedDeliveryDate,
|
|
94
|
+
status: "For Delivery",
|
|
95
|
+
documentsComplete: false,
|
|
96
|
+
salesInvoice: null,
|
|
97
|
+
deliveryReceipt: null,
|
|
98
|
+
deliveryReceipts: [],
|
|
99
|
+
receivedPurchaseOrder: null,
|
|
100
|
+
billingStatement: null,
|
|
101
|
+
extensionLetterRequest: null,
|
|
102
|
+
items: order.items,
|
|
103
|
+
iarNo: null,
|
|
104
|
+
iarCreatedAt: null,
|
|
105
|
+
createdAt: now,
|
|
106
|
+
updatedAt: now,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function makeDeliveryAttachment(file, params) {
|
|
110
|
+
return {
|
|
111
|
+
fileName: file.name,
|
|
112
|
+
fileType: file.type || "application/octet-stream",
|
|
113
|
+
fileSize: file.size,
|
|
114
|
+
referenceNo: params.referenceNo.trim(),
|
|
115
|
+
documentDate: params.documentDate,
|
|
116
|
+
uploadedAt: params.now ?? new Date().toISOString(),
|
|
117
|
+
s3Key: params.s3Key ?? null,
|
|
118
|
+
url: params.url ?? null,
|
|
119
|
+
bucket: params.bucket ?? null,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function getDeliveryReceipts(record) {
|
|
123
|
+
if (!record)
|
|
124
|
+
return [];
|
|
125
|
+
const uploadedReceipts = Array.isArray(record.deliveryReceipts)
|
|
126
|
+
? record.deliveryReceipts.filter(receipt => Boolean(receipt?.fileName))
|
|
127
|
+
: [];
|
|
128
|
+
if (uploadedReceipts.length > 0)
|
|
129
|
+
return uploadedReceipts;
|
|
130
|
+
return record.deliveryReceipt?.fileName ? [record.deliveryReceipt] : [];
|
|
131
|
+
}
|
|
132
|
+
export function getDeliveryDocumentGroups(record) {
|
|
133
|
+
return [
|
|
134
|
+
{
|
|
135
|
+
field: "salesInvoice",
|
|
136
|
+
label: "Sales Invoice",
|
|
137
|
+
documents: record?.salesInvoice?.fileName ? [record.salesInvoice] : [],
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
field: "deliveryReceipts",
|
|
142
|
+
label: "Delivery Receipts",
|
|
143
|
+
documents: getDeliveryReceipts(record),
|
|
144
|
+
required: false,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
field: "receivedPurchaseOrder",
|
|
148
|
+
label: "Received Purchase Order",
|
|
149
|
+
documents: record?.receivedPurchaseOrder?.fileName ? [record.receivedPurchaseOrder] : [],
|
|
150
|
+
required: true,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
field: "billingStatement",
|
|
154
|
+
label: "Billing Statement",
|
|
155
|
+
documents: record?.billingStatement?.fileName ? [record.billingStatement] : [],
|
|
156
|
+
required: false,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
field: "extensionLetterRequest",
|
|
160
|
+
label: "Letter Request for Extension",
|
|
161
|
+
documents: record?.extensionLetterRequest?.fileName ? [record.extensionLetterRequest] : [],
|
|
162
|
+
required: false,
|
|
163
|
+
},
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
export function hasCompleteDeliveryDocuments(record) {
|
|
167
|
+
if (!record)
|
|
168
|
+
return false;
|
|
169
|
+
if (record.documentsComplete)
|
|
170
|
+
return true;
|
|
171
|
+
const requiredGroups = getDeliveryDocumentGroups(record).filter(group => group.required);
|
|
172
|
+
return requiredGroups.length > 0 && requiredGroups.every(group => group.documents.length > 0);
|
|
173
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const PR_REQUEST_TYPES: readonly ["Supplies", "Others", "PPE", "Semi-Expandable", "Services"];
|
|
2
|
+
export type PrRequestType = (typeof PR_REQUEST_TYPES)[number];
|
|
3
|
+
export type PrRequestTypeInput = PrRequestType | "";
|
|
4
|
+
type PrRoutingInput = {
|
|
5
|
+
requestType?: PrRequestTypeInput | null;
|
|
6
|
+
requestSubtype?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const PR_OTHER_SUBTYPES: readonly ["Meals", "Common Use Supplies", "Transportation / Logistics", "Semi-Expandable", "Less valuable PPE"];
|
|
9
|
+
export declare const PR_SERVICE_SUBTYPES: readonly ["Rental", "Subscription", "Repair"];
|
|
10
|
+
export declare function getPrSubtypeOptions(requestType?: PrRequestTypeInput | null): never[] | readonly ["Meals", "Common Use Supplies", "Transportation / Logistics", "Semi-Expandable", "Less valuable PPE"] | readonly ["Rental", "Subscription", "Repair"];
|
|
11
|
+
export declare function requiresPrSubtype(requestType?: PrRequestTypeInput | null): requestType is "Others" | "Services";
|
|
12
|
+
export declare function getInventoryCategoryForPr(requestType?: PrRequestTypeInput | null): "Supplies" | "Semi-Expendable" | "PPE" | null;
|
|
13
|
+
export declare function isPurchaseOrderEligiblePr(input: PrRoutingInput): boolean;
|
|
14
|
+
export declare function shouldBypassPrForIar(input: PrRoutingInput): boolean;
|
|
15
|
+
export declare function isRepairServicePurchaseRequest(input: {
|
|
16
|
+
requestType?: string | null;
|
|
17
|
+
requestSubtype?: string | null;
|
|
18
|
+
}): boolean;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const PR_REQUEST_TYPES = [
|
|
2
|
+
"Supplies",
|
|
3
|
+
"Others",
|
|
4
|
+
"PPE",
|
|
5
|
+
"Semi-Expandable",
|
|
6
|
+
"Services",
|
|
7
|
+
];
|
|
8
|
+
export const PR_OTHER_SUBTYPES = [
|
|
9
|
+
"Meals",
|
|
10
|
+
"Common Use Supplies",
|
|
11
|
+
"Transportation / Logistics",
|
|
12
|
+
"Semi-Expandable",
|
|
13
|
+
"Less valuable PPE",
|
|
14
|
+
];
|
|
15
|
+
export const PR_SERVICE_SUBTYPES = ["Rental", "Subscription", "Repair"];
|
|
16
|
+
export function getPrSubtypeOptions(requestType) {
|
|
17
|
+
if (requestType === "Others")
|
|
18
|
+
return PR_OTHER_SUBTYPES;
|
|
19
|
+
if (requestType === "Services")
|
|
20
|
+
return PR_SERVICE_SUBTYPES;
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
export function requiresPrSubtype(requestType) {
|
|
24
|
+
return requestType === "Others" || requestType === "Services";
|
|
25
|
+
}
|
|
26
|
+
export function getInventoryCategoryForPr(requestType) {
|
|
27
|
+
if (requestType === "Supplies")
|
|
28
|
+
return "Supplies";
|
|
29
|
+
if (requestType === "Semi-Expandable")
|
|
30
|
+
return "Semi-Expendable";
|
|
31
|
+
if (requestType === "PPE")
|
|
32
|
+
return "PPE";
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
export function isPurchaseOrderEligiblePr(input) {
|
|
36
|
+
if (!input.requestType)
|
|
37
|
+
return true;
|
|
38
|
+
return PR_REQUEST_TYPES.includes(input.requestType);
|
|
39
|
+
}
|
|
40
|
+
export function shouldBypassPrForIar(input) {
|
|
41
|
+
return !isPurchaseOrderEligiblePr(input);
|
|
42
|
+
}
|
|
43
|
+
export function isRepairServicePurchaseRequest(input) {
|
|
44
|
+
return input.requestType === "Services" && input.requestSubtype?.trim().toLowerCase() === "repair";
|
|
45
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface RISRow {
|
|
2
|
+
stockNo: string;
|
|
3
|
+
unit: string;
|
|
4
|
+
description: string;
|
|
5
|
+
quantity: string;
|
|
6
|
+
stockYes: string;
|
|
7
|
+
stockNo_: string;
|
|
8
|
+
issueQuantity: string;
|
|
9
|
+
remarks: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RISFormData {
|
|
12
|
+
entityName: string;
|
|
13
|
+
fundCluster: string;
|
|
14
|
+
division: string;
|
|
15
|
+
office: string;
|
|
16
|
+
rcCode: string;
|
|
17
|
+
risNo: string;
|
|
18
|
+
purpose: string;
|
|
19
|
+
requestedBy: string;
|
|
20
|
+
approvedBy: string;
|
|
21
|
+
issuedBy: string;
|
|
22
|
+
receivedBy: string;
|
|
23
|
+
requestedByDesig: string;
|
|
24
|
+
approvedByDesig: string;
|
|
25
|
+
issuedByDesig: string;
|
|
26
|
+
receivedByDesig: string;
|
|
27
|
+
requestedByDate: string;
|
|
28
|
+
approvedByDate: string;
|
|
29
|
+
issuedByDate: string;
|
|
30
|
+
receivedByDate: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RISSignatory {
|
|
33
|
+
sig: string;
|
|
34
|
+
name: string;
|
|
35
|
+
desig: string;
|
|
36
|
+
date: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type IcsXlsxItem = {
|
|
2
|
+
quantity?: string;
|
|
3
|
+
unit?: string;
|
|
4
|
+
unitCost?: string;
|
|
5
|
+
totalCost?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
inventoryItemNo?: string;
|
|
8
|
+
estimatedUsefulLife?: string;
|
|
9
|
+
};
|
|
10
|
+
export type IcsXlsxValues = {
|
|
11
|
+
entityName?: string;
|
|
12
|
+
fundCluster?: string;
|
|
13
|
+
icsNo?: string;
|
|
14
|
+
purchaseOrderNo?: string;
|
|
15
|
+
purchaseRequestRef?: string;
|
|
16
|
+
supplierName?: string;
|
|
17
|
+
invoiceNo?: string;
|
|
18
|
+
deliveryReceiptNo?: string;
|
|
19
|
+
procurementRemarks?: string;
|
|
20
|
+
items?: IcsXlsxItem[];
|
|
21
|
+
receivedByName?: string;
|
|
22
|
+
receivedByPosition?: string;
|
|
23
|
+
receivedByDate?: string;
|
|
24
|
+
receivedFromName?: string;
|
|
25
|
+
receivedFromPosition?: string;
|
|
26
|
+
receivedFromDate?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function exportIcsXlsx(values: IcsXlsxValues): void;
|