@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.
Files changed (325) hide show
  1. package/FORM_CATALOG.md +44 -0
  2. package/README.md +165 -0
  3. package/dist/definitions.d.ts +1147 -0
  4. package/dist/definitions.js +60 -0
  5. package/dist/forms/iar.d.ts +172 -0
  6. package/dist/forms/iar.js +6 -0
  7. package/dist/forms/ics.d.ts +48 -0
  8. package/dist/forms/ics.js +6 -0
  9. package/dist/forms/iirup.d.ts +54 -0
  10. package/dist/forms/iirup.js +6 -0
  11. package/dist/forms/iirusp.d.ts +32 -0
  12. package/dist/forms/iirusp.js +6 -0
  13. package/dist/forms/itr.d.ts +42 -0
  14. package/dist/forms/itr.js +6 -0
  15. package/dist/forms/par.d.ts +84 -0
  16. package/dist/forms/par.js +6 -0
  17. package/dist/forms/ppelc.d.ts +34 -0
  18. package/dist/forms/ppelc.js +6 -0
  19. package/dist/forms/pr.d.ts +27 -0
  20. package/dist/forms/pr.js +6 -0
  21. package/dist/forms/property-card.d.ts +68 -0
  22. package/dist/forms/property-card.js +6 -0
  23. package/dist/forms/ptr.d.ts +54 -0
  24. package/dist/forms/ptr.js +6 -0
  25. package/dist/forms/regspi.d.ts +32 -0
  26. package/dist/forms/regspi.js +6 -0
  27. package/dist/forms/ris.d.ts +66 -0
  28. package/dist/forms/ris.js +6 -0
  29. package/dist/forms/rlsddp.d.ts +54 -0
  30. package/dist/forms/rlsddp.js +6 -0
  31. package/dist/forms/rlsddsp.d.ts +42 -0
  32. package/dist/forms/rlsddsp.js +6 -0
  33. package/dist/forms/rpci.d.ts +32 -0
  34. package/dist/forms/rpci.js +6 -0
  35. package/dist/forms/rpcppe.d.ts +32 -0
  36. package/dist/forms/rpcppe.js +6 -0
  37. package/dist/forms/rpcsp.d.ts +32 -0
  38. package/dist/forms/rpcsp.js +6 -0
  39. package/dist/forms/rrsp.d.ts +32 -0
  40. package/dist/forms/rrsp.js +6 -0
  41. package/dist/forms/rsmi.d.ts +32 -0
  42. package/dist/forms/rsmi.js +6 -0
  43. package/dist/forms/rsmp.d.ts +33 -0
  44. package/dist/forms/rsmp.js +6 -0
  45. package/dist/forms/rspi.d.ts +32 -0
  46. package/dist/forms/rspi.js +6 -0
  47. package/dist/forms/spc.d.ts +37 -0
  48. package/dist/forms/spc.js +6 -0
  49. package/dist/forms/splc.d.ts +41 -0
  50. package/dist/forms/splc.js +6 -0
  51. package/dist/forms/stock-card.d.ts +28 -0
  52. package/dist/forms/stock-card.js +6 -0
  53. package/dist/forms/wmr.d.ts +32 -0
  54. package/dist/forms/wmr.js +6 -0
  55. package/dist/gam/components/gam-report-workbench.d.ts +40 -0
  56. package/dist/gam/components/gam-report-workbench.js +2 -0
  57. package/dist/gam/components/grand-total-computation.d.ts +10 -0
  58. package/dist/gam/components/grand-total-computation.js +26 -0
  59. package/dist/gam/components/iar-preview.d.ts +30 -0
  60. package/dist/gam/components/iar-preview.js +150 -0
  61. package/dist/gam/components/ics-preview.d.ts +31 -0
  62. package/dist/gam/components/ics-preview.js +114 -0
  63. package/dist/gam/components/iirup-preview.d.ts +42 -0
  64. package/dist/gam/components/iirup-preview.js +237 -0
  65. package/dist/gam/components/itr-preview.d.ts +31 -0
  66. package/dist/gam/components/itr-preview.js +180 -0
  67. package/dist/gam/components/par-preview.d.ts +28 -0
  68. package/dist/gam/components/par-preview.js +95 -0
  69. package/dist/gam/components/ppelc-preview.d.ts +28 -0
  70. package/dist/gam/components/ppelc-preview.js +128 -0
  71. package/dist/gam/components/property-card-preview.d.ts +21 -0
  72. package/dist/gam/components/property-card-preview.js +117 -0
  73. package/dist/gam/components/ptr-preview.d.ts +36 -0
  74. package/dist/gam/components/ptr-preview.js +122 -0
  75. package/dist/gam/components/purchase-order-page-client.d.ts +66 -0
  76. package/dist/gam/components/purchase-order-page-client.js +179 -0
  77. package/dist/gam/components/reg-spi-preview.d.ts +28 -0
  78. package/dist/gam/components/reg-spi-preview.js +138 -0
  79. package/dist/gam/components/ris-form.d.ts +13 -0
  80. package/dist/gam/components/ris-form.js +20 -0
  81. package/dist/gam/components/ris-preview.d.ts +7 -0
  82. package/dist/gam/components/ris-preview.js +16 -0
  83. package/dist/gam/components/rlsddp-preview.d.ts +34 -0
  84. package/dist/gam/components/rlsddp-preview.js +251 -0
  85. package/dist/gam/components/rlsddsp-preview.d.ts +33 -0
  86. package/dist/gam/components/rlsddsp-preview.js +226 -0
  87. package/dist/gam/components/rpci-preview.d.ts +27 -0
  88. package/dist/gam/components/rpci-preview.js +123 -0
  89. package/dist/gam/components/rpcppe-preview.d.ts +28 -0
  90. package/dist/gam/components/rpcppe-preview.js +133 -0
  91. package/dist/gam/components/rpcsp-preview.d.ts +29 -0
  92. package/dist/gam/components/rpcsp-preview.js +81 -0
  93. package/dist/gam/components/rspi-preview.d.ts +23 -0
  94. package/dist/gam/components/rspi-preview.js +72 -0
  95. package/dist/gam/components/spc-preview.d.ts +23 -0
  96. package/dist/gam/components/spc-preview.js +149 -0
  97. package/dist/gam/components/splc-entry-form.d.ts +14 -0
  98. package/dist/gam/components/splc-entry-form.js +6 -0
  99. package/dist/gam/components/splc-preview.d.ts +27 -0
  100. package/dist/gam/components/splc-preview.js +192 -0
  101. package/dist/gam/components/stock-card-preview.d.ts +14 -0
  102. package/dist/gam/components/stock-card-preview.js +17 -0
  103. package/dist/gam/config/new-report-config.d.ts +1094 -0
  104. package/dist/gam/config/new-report-config.js +1478 -0
  105. package/dist/gam/purchase-order-flow.d.ts +146 -0
  106. package/dist/gam/purchase-order-flow.js +173 -0
  107. package/dist/gam/purchase-request/workflow.d.ts +19 -0
  108. package/dist/gam/purchase-request/workflow.js +45 -0
  109. package/dist/gam/types/ris-types.d.ts +37 -0
  110. package/dist/gam/types/ris-types.js +1 -0
  111. package/dist/gam/utils/export-ics-xlsx.d.ts +28 -0
  112. package/dist/gam/utils/export-ics-xlsx.js +273 -0
  113. package/dist/gam/utils/export-par-xlsx.d.ts +18 -0
  114. package/dist/gam/utils/export-par-xlsx.js +181 -0
  115. package/dist/gam/utils/export-preview-pdf.d.ts +13 -0
  116. package/dist/gam/utils/export-preview-pdf.js +270 -0
  117. package/dist/gam/utils/export-report-xlsx.d.ts +228 -0
  118. package/dist/gam/utils/export-report-xlsx.js +873 -0
  119. package/dist/gam/utils/line-totals.d.ts +6 -0
  120. package/dist/gam/utils/line-totals.js +18 -0
  121. package/dist/gam/utils/monetary-input.d.ts +6 -0
  122. package/dist/gam/utils/monetary-input.js +18 -0
  123. package/dist/gam/utils/print-element.d.ts +8 -0
  124. package/dist/gam/utils/print-element.js +157 -0
  125. package/dist/government-form.d.ts +16 -0
  126. package/dist/government-form.js +45 -0
  127. package/dist/index.d.ts +49 -0
  128. package/dist/index.js +50 -0
  129. package/dist/internal/components/configurable-form-layout.d.ts +20 -0
  130. package/dist/internal/components/configurable-form-layout.js +49 -0
  131. package/dist/internal/components/ui/badge.d.ts +7 -0
  132. package/dist/internal/components/ui/badge.js +34 -0
  133. package/dist/internal/components/ui/button.d.ts +10 -0
  134. package/dist/internal/components/ui/button.js +35 -0
  135. package/dist/internal/components/ui/calendar.d.ts +8 -0
  136. package/dist/internal/components/ui/calendar.js +77 -0
  137. package/dist/internal/components/ui/command.d.ts +19 -0
  138. package/dist/internal/components/ui/command.js +36 -0
  139. package/dist/internal/components/ui/date-input.d.ts +14 -0
  140. package/dist/internal/components/ui/date-input.js +33 -0
  141. package/dist/internal/components/ui/date-picker.d.ts +19 -0
  142. package/dist/internal/components/ui/date-picker.js +34 -0
  143. package/dist/internal/components/ui/dialog.d.ts +18 -0
  144. package/dist/internal/components/ui/dialog.js +38 -0
  145. package/dist/internal/components/ui/input-group.d.ts +18 -0
  146. package/dist/internal/components/ui/input-group.js +57 -0
  147. package/dist/internal/components/ui/input.d.ts +3 -0
  148. package/dist/internal/components/ui/input.js +12 -0
  149. package/dist/internal/components/ui/label.d.ts +3 -0
  150. package/dist/internal/components/ui/label.js +7 -0
  151. package/dist/internal/components/ui/popover.d.ts +9 -0
  152. package/dist/internal/components/ui/popover.js +23 -0
  153. package/dist/internal/components/ui/select.d.ts +17 -0
  154. package/dist/internal/components/ui/select.js +35 -0
  155. package/dist/internal/components/ui/switch.d.ts +5 -0
  156. package/dist/internal/components/ui/switch.js +8 -0
  157. package/dist/internal/components/ui/table.d.ts +10 -0
  158. package/dist/internal/components/ui/table.js +28 -0
  159. package/dist/internal/components/ui/tabs.d.ts +10 -0
  160. package/dist/internal/components/ui/tabs.js +29 -0
  161. package/dist/internal/components/ui/textarea.d.ts +3 -0
  162. package/dist/internal/components/ui/textarea.js +7 -0
  163. package/dist/internal/components/ui/tooltip.d.ts +6 -0
  164. package/dist/internal/components/ui/tooltip.js +17 -0
  165. package/dist/internal/contracts/modules/v1/reg-spi-reports/reg-spi-reports.schema.d.ts +112 -0
  166. package/dist/internal/contracts/modules/v1/reg-spi-reports/reg-spi-reports.schema.js +91 -0
  167. package/dist/internal/hooks/use-form-field-order.d.ts +7 -0
  168. package/dist/internal/hooks/use-form-field-order.js +43 -0
  169. package/dist/internal/lib/utils.d.ts +2 -0
  170. package/dist/internal/lib/utils.js +3 -0
  171. package/dist/inventory/components/inventory-item-form.d.ts +7 -0
  172. package/dist/inventory/components/inventory-item-form.js +5 -0
  173. package/dist/inventory/components/inventory-item-preview.d.ts +6 -0
  174. package/dist/inventory/components/inventory-item-preview.js +5 -0
  175. package/dist/inventory/iar.d.ts +4 -0
  176. package/dist/inventory/iar.js +4 -0
  177. package/dist/inventory/ics.d.ts +2 -0
  178. package/dist/inventory/ics.js +3 -0
  179. package/dist/inventory/iirup.d.ts +2 -0
  180. package/dist/inventory/iirup.js +3 -0
  181. package/dist/inventory/iirusp.d.ts +4 -0
  182. package/dist/inventory/iirusp.js +4 -0
  183. package/dist/inventory/index.d.ts +3 -0
  184. package/dist/inventory/index.js +4 -0
  185. package/dist/inventory/item.d.ts +3 -0
  186. package/dist/inventory/item.js +3 -0
  187. package/dist/inventory/itr.d.ts +4 -0
  188. package/dist/inventory/itr.js +4 -0
  189. package/dist/inventory/par.d.ts +2 -0
  190. package/dist/inventory/par.js +3 -0
  191. package/dist/inventory/po.d.ts +2 -0
  192. package/dist/inventory/po.js +2 -0
  193. package/dist/inventory/ppelc.d.ts +2 -0
  194. package/dist/inventory/ppelc.js +3 -0
  195. package/dist/inventory/pplc.d.ts +2 -0
  196. package/dist/inventory/pplc.js +4 -0
  197. package/dist/inventory/pr.d.ts +4 -0
  198. package/dist/inventory/pr.js +4 -0
  199. package/dist/inventory/property-card.d.ts +2 -0
  200. package/dist/inventory/property-card.js +3 -0
  201. package/dist/inventory/ptr.d.ts +2 -0
  202. package/dist/inventory/ptr.js +3 -0
  203. package/dist/inventory/regspi.d.ts +4 -0
  204. package/dist/inventory/regspi.js +4 -0
  205. package/dist/inventory/ris.d.ts +4 -0
  206. package/dist/inventory/ris.js +4 -0
  207. package/dist/inventory/rlsddp.d.ts +4 -0
  208. package/dist/inventory/rlsddp.js +4 -0
  209. package/dist/inventory/rlsddsp.d.ts +2 -0
  210. package/dist/inventory/rlsddsp.js +3 -0
  211. package/dist/inventory/rpci.d.ts +2 -0
  212. package/dist/inventory/rpci.js +3 -0
  213. package/dist/inventory/rpcppe.d.ts +2 -0
  214. package/dist/inventory/rpcppe.js +3 -0
  215. package/dist/inventory/rpcsp.d.ts +2 -0
  216. package/dist/inventory/rpcsp.js +3 -0
  217. package/dist/inventory/rrsp.d.ts +2 -0
  218. package/dist/inventory/rrsp.js +3 -0
  219. package/dist/inventory/rsmi.d.ts +4 -0
  220. package/dist/inventory/rsmi.js +4 -0
  221. package/dist/inventory/rsmp.d.ts +4 -0
  222. package/dist/inventory/rsmp.js +4 -0
  223. package/dist/inventory/rspi.d.ts +2 -0
  224. package/dist/inventory/rspi.js +3 -0
  225. package/dist/inventory/spc.d.ts +2 -0
  226. package/dist/inventory/spc.js +3 -0
  227. package/dist/inventory/splc.d.ts +3 -0
  228. package/dist/inventory/splc.js +4 -0
  229. package/dist/inventory/stock-card.d.ts +4 -0
  230. package/dist/inventory/stock-card.js +4 -0
  231. package/dist/inventory/types.d.ts +11 -0
  232. package/dist/inventory/types.js +1 -0
  233. package/dist/inventory/wmr.d.ts +4 -0
  234. package/dist/inventory/wmr.js +4 -0
  235. package/dist/lib/rpcsp-accountable-person.d.ts +1 -0
  236. package/dist/lib/rpcsp-accountable-person.js +10 -0
  237. package/dist/reports/iar/_components/create-form.d.ts +13 -0
  238. package/dist/reports/iar/_components/create-form.js +92 -0
  239. package/dist/reports/iar/_components/document-preview.d.ts +11 -0
  240. package/dist/reports/iar/_components/document-preview.js +131 -0
  241. package/dist/reports/iar/types.d.ts +97 -0
  242. package/dist/reports/iar/types.js +24 -0
  243. package/dist/reports/iirusp/_components/create-form.d.ts +17 -0
  244. package/dist/reports/iirusp/_components/create-form.js +118 -0
  245. package/dist/reports/iirusp/_components/document-preview.d.ts +8 -0
  246. package/dist/reports/iirusp/_components/document-preview.js +389 -0
  247. package/dist/reports/iirusp/types.d.ts +134 -0
  248. package/dist/reports/iirusp/types.js +29 -0
  249. package/dist/reports/iirusp/utils.d.ts +29 -0
  250. package/dist/reports/iirusp/utils.js +488 -0
  251. package/dist/reports/itr/_components/create-form.d.ts +28 -0
  252. package/dist/reports/itr/_components/create-form.js +90 -0
  253. package/dist/reports/itr/_components/document-preview.d.ts +6 -0
  254. package/dist/reports/itr/_components/document-preview.js +7 -0
  255. package/dist/reports/itr/types.d.ts +68 -0
  256. package/dist/reports/itr/types.js +27 -0
  257. package/dist/reports/itr/utils.d.ts +24 -0
  258. package/dist/reports/itr/utils.js +76 -0
  259. package/dist/reports/pr/_components/create-form.d.ts +16 -0
  260. package/dist/reports/pr/_components/create-form.js +52 -0
  261. package/dist/reports/pr/_components/document-preview.d.ts +7 -0
  262. package/dist/reports/pr/_components/document-preview.js +9 -0
  263. package/dist/reports/pr/types.d.ts +69 -0
  264. package/dist/reports/pr/types.js +1 -0
  265. package/dist/reports/pr/utils.d.ts +72 -0
  266. package/dist/reports/pr/utils.js +572 -0
  267. package/dist/reports/regspi/_components/create-form.d.ts +19 -0
  268. package/dist/reports/regspi/_components/create-form.js +33 -0
  269. package/dist/reports/regspi/_components/document-preview.d.ts +6 -0
  270. package/dist/reports/regspi/_components/document-preview.js +7 -0
  271. package/dist/reports/regspi/types.d.ts +29 -0
  272. package/dist/reports/regspi/types.js +24 -0
  273. package/dist/reports/regspi/utils.d.ts +48 -0
  274. package/dist/reports/regspi/utils.js +98 -0
  275. package/dist/reports/ris/_components/create-form.d.ts +36 -0
  276. package/dist/reports/ris/_components/create-form.js +149 -0
  277. package/dist/reports/ris/_components/document-preview.d.ts +8 -0
  278. package/dist/reports/ris/_components/document-preview.js +31 -0
  279. package/dist/reports/ris/types.d.ts +93 -0
  280. package/dist/reports/ris/types.js +1 -0
  281. package/dist/reports/rlsddp/_components/create-form.d.ts +11 -0
  282. package/dist/reports/rlsddp/_components/create-form.js +165 -0
  283. package/dist/reports/rlsddp/_components/document-preview.d.ts +8 -0
  284. package/dist/reports/rlsddp/_components/document-preview.js +15 -0
  285. package/dist/reports/rlsddp/types.d.ts +105 -0
  286. package/dist/reports/rlsddp/types.js +31 -0
  287. package/dist/reports/rrsp/components/rrsp-preview.d.ts +21 -0
  288. package/dist/reports/rrsp/components/rrsp-preview.js +155 -0
  289. package/dist/reports/rsmi/components/rsmi-create-form.d.ts +20 -0
  290. package/dist/reports/rsmi/components/rsmi-create-form.js +8 -0
  291. package/dist/reports/rsmi/components/rsmi-document-body.d.ts +15 -0
  292. package/dist/reports/rsmi/components/rsmi-document-body.js +12 -0
  293. package/dist/reports/rsmi/components/rsmi-types.d.ts +45 -0
  294. package/dist/reports/rsmi/components/rsmi-types.js +1 -0
  295. package/dist/reports/rsmi/components/rsmi-utils.d.ts +2 -0
  296. package/dist/reports/rsmi/components/rsmi-utils.js +18 -0
  297. package/dist/reports/rsmp/components/rsmp-create-modal.d.ts +5 -0
  298. package/dist/reports/rsmp/components/rsmp-create-modal.js +7 -0
  299. package/dist/reports/rsmp/components/rsmp-preview-modal.d.ts +11 -0
  300. package/dist/reports/rsmp/components/rsmp-preview-modal.js +47 -0
  301. package/dist/reports/rsmp/components/rsmp-types.d.ts +44 -0
  302. package/dist/reports/rsmp/components/rsmp-types.js +1 -0
  303. package/dist/reports/rsmp/components/rsmp-utils.d.ts +5 -0
  304. package/dist/reports/rsmp/components/rsmp-utils.js +41 -0
  305. package/dist/reports/rsmp/lib/rsmp-grouping.d.ts +14 -0
  306. package/dist/reports/rsmp/lib/rsmp-grouping.js +75 -0
  307. package/dist/reports/stock-card/_components/create-form.d.ts +13 -0
  308. package/dist/reports/stock-card/_components/create-form.js +39 -0
  309. package/dist/reports/stock-card/_components/document-preview.d.ts +7 -0
  310. package/dist/reports/stock-card/_components/document-preview.js +29 -0
  311. package/dist/reports/stock-card/types.d.ts +31 -0
  312. package/dist/reports/stock-card/types.js +1 -0
  313. package/dist/reports/stock-card/utils.d.ts +32 -0
  314. package/dist/reports/stock-card/utils.js +248 -0
  315. package/dist/reports/wmr/_components/create-form.d.ts +22 -0
  316. package/dist/reports/wmr/_components/create-form.js +61 -0
  317. package/dist/reports/wmr/_components/document-preview.d.ts +10 -0
  318. package/dist/reports/wmr/_components/document-preview.js +59 -0
  319. package/dist/reports/wmr/types.d.ts +45 -0
  320. package/dist/reports/wmr/types.js +1 -0
  321. package/dist/reports/wmr/utils.d.ts +32 -0
  322. package/dist/reports/wmr/utils.js +343 -0
  323. package/dist/styles.css +4492 -0
  324. package/extraction-manifest.json +620 -0
  325. package/package.json +197 -0
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { computeGrandTotal, computeLineTotal, fmtAmount } from "../utils/line-totals.js";
4
+ import { GrandTotalComputation } from "./grand-total-computation.js";
5
+ const FIXED_ROWS = 15;
6
+ const b = "1px solid #000";
7
+ const bThick = "2px solid #000";
8
+ function fmtDate(value) {
9
+ if (!value)
10
+ return "";
11
+ const d = new Date(value);
12
+ return isNaN(d.getTime()) ? value : d.toLocaleDateString("en-PH");
13
+ }
14
+ function fmtNum(value) {
15
+ const n = Number(value);
16
+ return Number.isNaN(n)
17
+ ? value
18
+ : n.toLocaleString("en-PH", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
19
+ }
20
+ function calcValue(shortageOverage, unitValue) {
21
+ const qty = Number(shortageOverage);
22
+ const val = Number(unitValue);
23
+ if (Number.isNaN(qty) || Number.isNaN(val))
24
+ return "";
25
+ const result = qty * val;
26
+ return result === 0 ? "" : fmtNum(String(result));
27
+ }
28
+ function Underline({ children, width }) {
29
+ return (_jsx("span", { style: {
30
+ display: "inline-block",
31
+ borderBottom: b,
32
+ minWidth: width ?? "80px",
33
+ textAlign: "center",
34
+ boxSizing: "border-box",
35
+ minHeight: "21px",
36
+ padding: "2px 2px 5px",
37
+ lineHeight: "14px",
38
+ verticalAlign: "bottom",
39
+ }, children: children }));
40
+ }
41
+ export function RpciPreview({ rpciNo: _rpciNo = "Auto-generated", typeOfInventory = "", asAtDate = "", fundCluster = "", nameOfAccountableOfficer = "", officialDesignation = "", entityName = "", dateOfAssumption = "", certifiedCorrectBy = "", approvedBy = "", verifiedBy = "", lines, }) {
42
+ const rows = Array.from({ length: FIXED_ROWS }, (_, i) => lines[i] ?? null);
43
+ const fs = "7.5pt";
44
+ const thStyle = {
45
+ border: b,
46
+ padding: "3px 4px",
47
+ fontSize: "7pt",
48
+ fontWeight: "bold",
49
+ textAlign: "center",
50
+ verticalAlign: "middle",
51
+ backgroundColor: "#fff",
52
+ lineHeight: 1.3,
53
+ };
54
+ const tdStyle = {
55
+ border: b,
56
+ padding: "1px 3px",
57
+ fontSize: fs,
58
+ verticalAlign: "top",
59
+ height: "17px",
60
+ };
61
+ return (_jsxs("div", { "data-pdf-page": "true", "data-pdf-fit-one-page": "true", "data-pdf-orientation": "landscape", style: {
62
+ width: "297mm",
63
+ minHeight: "210mm",
64
+ padding: "8mm 10mm",
65
+ fontFamily: "Arial, sans-serif",
66
+ fontSize: fs,
67
+ backgroundColor: "#fff",
68
+ boxSizing: "border-box",
69
+ position: "relative",
70
+ }, children: [_jsx("div", { style: {
71
+ position: "absolute",
72
+ top: "8mm",
73
+ right: "10mm",
74
+ fontStyle: "italic",
75
+ fontSize: "9pt",
76
+ }, children: "Appendix 66" }), _jsx("div", { style: {
77
+ textAlign: "center",
78
+ fontWeight: "bold",
79
+ fontSize: "11pt",
80
+ marginBottom: "3px",
81
+ marginTop: "2px",
82
+ }, children: "REPORT ON THE PHYSICAL COUNT OF INVENTORIES" }), _jsxs("div", { style: { textAlign: "center", marginBottom: "3px" }, children: [_jsx(Underline, { width: "180px", children: typeOfInventory || "\u00a0" }), _jsx("div", { style: { fontSize: "7pt", fontStyle: "italic" }, children: "(Type of Inventory Item)" })] }), _jsxs("div", { style: { textAlign: "center", marginBottom: "4px", fontSize: fs }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "As at " }), _jsx(Underline, { width: "110px", children: fmtDate(asAtDate) || "\u00a0" })] }), _jsxs("div", { style: { marginBottom: "3px", fontSize: fs }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Fund Cluster : " }), _jsx(Underline, { width: "150px", children: fundCluster || "\u00a0" })] }), _jsxs("div", { style: { marginBottom: "5px", fontSize: fs, lineHeight: 1.7 }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "For which " }), _jsx(Underline, { width: "110px", children: _jsx("span", { style: { fontStyle: "italic" }, children: nameOfAccountableOfficer || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Name of Accountable Officer)" }), _jsx("span", { children: " , " }), _jsx(Underline, { width: "90px", children: _jsx("span", { style: { fontStyle: "italic" }, children: officialDesignation || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Official Designation)" }), _jsx("span", { children: " , " }), _jsx(Underline, { width: "110px", children: _jsx("span", { style: { fontStyle: "italic" }, children: entityName || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Entity Name)" }), _jsx("span", { children: " is accountable, having assumed such accountability on " }), _jsx(Underline, { width: "90px", children: _jsx("span", { style: { fontStyle: "italic" }, children: dateOfAssumption ? fmtDate(dateOfAssumption) : "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Date of Assumption)" })] }), _jsxs("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed", border: bThick }, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "18%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "6%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "14%" } })] }), _jsx("thead", { children: _jsxs("tr", { style: { height: "60px" }, children: [_jsx("th", { style: thStyle, children: "Article" }), _jsx("th", { style: thStyle, children: "Description" }), _jsx("th", { style: thStyle, children: "Stock Number" }), _jsx("th", { style: thStyle, children: "Unit of Measure" }), _jsx("th", { style: thStyle, children: "Unit Value" }), _jsxs("th", { style: thStyle, children: ["Balance Per Card", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontStyle: "italic" }, children: "(Quantity)" })] }), _jsxs("th", { style: thStyle, children: ["On Hand Per Count", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontStyle: "italic" }, children: "(Quantity)" })] }), _jsxs("th", { style: thStyle, children: ["Shortage/Overage", _jsx("br", {}), "Quantity"] }), _jsxs("th", { style: thStyle, children: ["Shortage/Overage", _jsx("br", {}), "Value"] }), _jsxs("th", { style: thStyle, children: ["Total Value", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontSize: "6.5pt" }, children: "(On Hand Per Count \u00D7 Unit Value)" })] }), _jsx("th", { style: thStyle, children: "Remarks" })] }) }), _jsxs("tbody", { children: [rows.map((line, idx) => (_jsxs("tr", { children: [_jsx("td", { style: tdStyle, children: line?.article || "\u00a0" }), _jsx("td", { style: tdStyle, children: line?.description || "\u00a0" }), _jsx("td", { style: tdStyle, children: line?.stockNo || "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "center" }, children: line?.unitOfMeasure || "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.unitValue) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.balancePerCard) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.onHandPerCount) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.shortageOverage) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? calcValue(line.shortageOverage, line.unitValue) || "\u00a0" : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtAmount(computeLineTotal(line.onHandPerCount, line.unitValue)) : "\u00a0" }), _jsx("td", { style: tdStyle, children: line?.remarks || "\u00a0" })] }, idx))), _jsxs("tr", { children: [_jsx("td", { colSpan: 9, style: { ...tdStyle, textAlign: "right", fontWeight: "bold", height: "20px" }, children: "GRAND TOTAL" }), _jsx("td", { style: { ...tdStyle, textAlign: "right", fontWeight: "bold" }, children: fmtAmount(computeGrandTotal(lines.map(line => ({
83
+ physicalCountQty: line.onHandPerCount,
84
+ unitValue: line.unitValue,
85
+ })))) }), _jsx("td", { style: tdStyle, children: "\u00a0" })] }), _jsxs("tr", { children: [_jsxs("td", { colSpan: 4, style: {
86
+ border: b,
87
+ borderLeft: "none",
88
+ padding: "5px 8px",
89
+ verticalAlign: "top",
90
+ fontSize: fs,
91
+ }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Certified Correct by:" }), _jsx("div", { style: {
92
+ borderBottom: b,
93
+ boxSizing: "border-box",
94
+ height: "24px",
95
+ padding: "3px 2px 5px",
96
+ lineHeight: 1.1,
97
+ marginBottom: "4px",
98
+ }, children: certifiedCorrectBy || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of", _jsx("br", {}), "Inventory Committee Chair and", _jsx("br", {}), "Members"] })] }), _jsxs("td", { colSpan: 4, style: { border: b, padding: "5px 8px", verticalAlign: "top", fontSize: fs }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Approved by:" }), _jsx("div", { style: {
99
+ borderBottom: b,
100
+ boxSizing: "border-box",
101
+ height: "24px",
102
+ padding: "3px 2px 5px",
103
+ lineHeight: 1.1,
104
+ marginBottom: "4px",
105
+ }, children: approvedBy || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of Head of", _jsx("br", {}), "Agency/Entity or Authorized Representative"] })] }), _jsxs("td", { colSpan: 3, style: {
106
+ border: b,
107
+ borderRight: "none",
108
+ padding: "5px 8px",
109
+ verticalAlign: "top",
110
+ fontSize: fs,
111
+ }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Verified by:" }), _jsx("div", { style: {
112
+ borderBottom: b,
113
+ boxSizing: "border-box",
114
+ height: "24px",
115
+ padding: "3px 2px 5px",
116
+ lineHeight: 1.1,
117
+ marginBottom: "4px",
118
+ }, children: verifiedBy || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of COA", _jsx("br", {}), "Representative"] })] })] })] })] }), _jsx(GrandTotalComputation, { lines: lines.map(line => ({
119
+ label: line.article,
120
+ physicalCountQty: line.onHandPerCount,
121
+ unitValue: line.unitValue,
122
+ })) })] }));
123
+ }
@@ -0,0 +1,28 @@
1
+ type RpcppeLine = {
2
+ article?: string;
3
+ description?: string;
4
+ propertyNumber?: string;
5
+ unitOfMeasure?: string;
6
+ unitValue: string;
7
+ quantityPerPropertyCard: string;
8
+ quantityPerPhysicalCount: string;
9
+ shortageOverageQuantity: string;
10
+ shortageOverageValue: string;
11
+ remarks?: string;
12
+ };
13
+ export type RpcppePreviewProps = {
14
+ rpcppeNo?: string;
15
+ typeOfPropertyPlantEquipment?: string;
16
+ fundCluster?: string;
17
+ nameOfAccountableOfficer?: string;
18
+ officialDesignation?: string;
19
+ entityName?: string;
20
+ asOfDate?: string;
21
+ dateOfAssumption?: string;
22
+ inventoryCommitteeSignature?: string;
23
+ headOfAgencySignature?: string;
24
+ coaRepresentativeSignature?: string;
25
+ lines: RpcppeLine[];
26
+ };
27
+ export declare function RpcppePreview({ rpcppeNo: _rpcppeNo, typeOfPropertyPlantEquipment, fundCluster, nameOfAccountableOfficer, officialDesignation, entityName, asOfDate, dateOfAssumption, inventoryCommitteeSignature, headOfAgencySignature, coaRepresentativeSignature, lines, }: RpcppePreviewProps): import("react/jsx-runtime").JSX.Element;
28
+ export {};
@@ -0,0 +1,133 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { computeGrandTotal, computeLineTotal, fmtAmount } from "../utils/line-totals.js";
4
+ import { GrandTotalComputation } from "./grand-total-computation.js";
5
+ const FIXED_ROWS = 15;
6
+ const b = "1px solid #000";
7
+ const bThick = "2px solid #000";
8
+ function fmtDate(value) {
9
+ if (!value)
10
+ return "";
11
+ const d = new Date(value);
12
+ return isNaN(d.getTime()) ? value : d.toLocaleDateString("en-PH");
13
+ }
14
+ function fmtNum(value) {
15
+ const n = Number(value);
16
+ return Number.isNaN(n)
17
+ ? value
18
+ : n.toLocaleString("en-PH", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
19
+ }
20
+ function isPendingPhysicalCount(line) {
21
+ return (line.remarks ?? "").includes("physical count pending Inventory Committee confirmation");
22
+ }
23
+ function Underline({ children, width }) {
24
+ return (_jsx("span", { style: {
25
+ boxSizing: "border-box",
26
+ display: "inline-block",
27
+ borderBottom: b,
28
+ minWidth: width ?? "80px",
29
+ height: "19px",
30
+ padding: "2px 2px 5px",
31
+ textAlign: "center",
32
+ lineHeight: 1.15,
33
+ verticalAlign: "bottom",
34
+ }, children: children }));
35
+ }
36
+ export function RpcppePreview({ rpcppeNo: _rpcppeNo = "Auto-generated", typeOfPropertyPlantEquipment = "", fundCluster = "", nameOfAccountableOfficer = "", officialDesignation = "", entityName = "", asOfDate = "", dateOfAssumption = "", inventoryCommitteeSignature = "", headOfAgencySignature = "", coaRepresentativeSignature = "", lines, }) {
37
+ const rows = Array.from({ length: FIXED_ROWS }, (_, i) => lines[i] ?? null);
38
+ const hasPendingPhysicalCounts = lines.some(isPendingPhysicalCount);
39
+ const fs = "7.5pt";
40
+ const thStyle = {
41
+ border: b,
42
+ padding: "4px 4px",
43
+ fontSize: "7pt",
44
+ fontWeight: "bold",
45
+ textAlign: "center",
46
+ verticalAlign: "middle",
47
+ backgroundColor: "#fff",
48
+ lineHeight: 1.2,
49
+ };
50
+ const tdStyle = {
51
+ border: b,
52
+ padding: "3px",
53
+ fontSize: fs,
54
+ lineHeight: 1.2,
55
+ verticalAlign: "middle",
56
+ height: "22px",
57
+ };
58
+ return (_jsxs("div", { "data-pdf-page": "true", "data-pdf-fit-one-page": "true", "data-pdf-orientation": "landscape", style: {
59
+ width: "297mm",
60
+ minHeight: "210mm",
61
+ padding: "8mm 10mm",
62
+ fontFamily: "Arial, sans-serif",
63
+ fontSize: fs,
64
+ backgroundColor: "#fff",
65
+ boxSizing: "border-box",
66
+ position: "relative",
67
+ }, children: [_jsx("div", { style: {
68
+ position: "absolute",
69
+ top: "8mm",
70
+ right: "10mm",
71
+ fontStyle: "italic",
72
+ fontSize: "9pt",
73
+ }, children: "Appendix 71" }), _jsx("div", { style: {
74
+ textAlign: "center",
75
+ fontWeight: "bold",
76
+ fontSize: "11pt",
77
+ marginBottom: "3px",
78
+ marginTop: "2px",
79
+ lineHeight: 1.3,
80
+ }, children: "REPORT ON THE PHYSICAL COUNT OF PROPERTY, PLANT AND EQUIPMENT" }), _jsxs("div", { style: { textAlign: "center", marginBottom: "3px" }, children: [_jsx(Underline, { width: "200px", children: typeOfPropertyPlantEquipment || "\u00a0" }), _jsx("div", { style: { fontSize: "7pt", fontStyle: "italic" }, children: "(Type of Property, Plant and Equipment)" })] }), _jsxs("div", { style: { textAlign: "center", marginBottom: "4px", fontSize: fs }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "As at " }), _jsx(Underline, { width: "110px", children: asOfDate ? fmtDate(asOfDate) : "\u00a0" })] }), _jsxs("div", { style: { marginBottom: "3px", fontSize: fs }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Fund Cluster : " }), _jsx(Underline, { width: "150px", children: fundCluster || "\u00a0" })] }), _jsxs("div", { style: { marginBottom: "5px", fontSize: fs, lineHeight: 1.7 }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "For which " }), _jsx(Underline, { width: "110px", children: _jsx("span", { style: { fontStyle: "italic" }, children: nameOfAccountableOfficer || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Name of Accountable Officer)" }), _jsx("span", { children: " , " }), _jsx(Underline, { width: "90px", children: _jsx("span", { style: { fontStyle: "italic" }, children: officialDesignation || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Official Designation)" }), _jsx("span", { children: " , " }), _jsx(Underline, { width: "110px", children: _jsx("span", { style: { fontStyle: "italic" }, children: entityName || "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Entity Name)" }), _jsx("span", { children: " is accountable, having assumed such accountability on " }), _jsx(Underline, { width: "90px", children: _jsx("span", { style: { fontStyle: "italic" }, children: dateOfAssumption ? fmtDate(dateOfAssumption) : "\u00a0" }) }), _jsx("span", { style: { fontStyle: "italic", fontSize: "7pt" }, children: " (Date of Assumption)" })] }), _jsxs("table", { style: {
81
+ width: "100%",
82
+ borderCollapse: "collapse",
83
+ tableLayout: "fixed",
84
+ border: bThick,
85
+ }, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "18%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "6%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "12%" } })] }), _jsx("thead", { children: _jsxs("tr", { style: { height: "77px" }, children: [_jsx("th", { style: thStyle, children: "ARTICLE" }), _jsx("th", { style: thStyle, children: "DESCRIPTION" }), _jsx("th", { style: thStyle, children: "PROPERTY NUMBER" }), _jsx("th", { style: thStyle, children: "UNIT OF MEASURE" }), _jsx("th", { style: thStyle, children: "UNIT VALUE" }), _jsxs("th", { style: thStyle, children: ["QUANTITY", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontSize: "6.5pt" }, children: "per" }), _jsx("br", {}), "PROPERTY CARD", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontStyle: "italic" }, children: "(Quantity)" })] }), _jsxs("th", { style: thStyle, children: ["QUANTITY", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontSize: "6.5pt" }, children: "per" }), _jsx("br", {}), "PHYSICAL COUNT", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontStyle: "italic" }, children: "(Quantity)" })] }), _jsxs("th", { style: thStyle, children: ["SHORTAGE/OVERAGE", _jsx("br", {}), "Quantity"] }), _jsxs("th", { style: thStyle, children: ["SHORTAGE/OVERAGE", _jsx("br", {}), "Value"] }), _jsxs("th", { style: thStyle, children: ["TOTAL VALUE", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal", fontSize: "6.5pt" }, children: "(Physical Count Qty \u00D7 Unit Value)" })] }), _jsx("th", { style: thStyle, children: "ACCOUNTABLE PERSON" })] }) }), _jsxs("tbody", { children: [rows.map((line, idx) => {
86
+ const isPending = line ? isPendingPhysicalCount(line) : false;
87
+ return (_jsxs("tr", { children: [_jsx("td", { style: tdStyle, children: line?.article || "\u00a0" }), _jsx("td", { style: tdStyle, children: line?.description || "\u00a0" }), _jsx("td", { style: tdStyle, children: line?.propertyNumber || "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "center" }, children: line?.unitOfMeasure || "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.unitValue) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line ? fmtNum(line.quantityPerPropertyCard) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line && !isPending ? fmtNum(line.quantityPerPhysicalCount) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line && !isPending ? fmtNum(line.shortageOverageQuantity) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line && !isPending ? fmtNum(line.shortageOverageValue) : "\u00a0" }), _jsx("td", { style: { ...tdStyle, textAlign: "right" }, children: line && !isPending
88
+ ? fmtAmount(computeLineTotal(line.quantityPerPhysicalCount, line.unitValue))
89
+ : "\u00a0" }), _jsx("td", { style: tdStyle, children: line ? nameOfAccountableOfficer || "\u00a0" : "\u00a0" })] }, idx));
90
+ }), _jsxs("tr", { children: [_jsx("td", { colSpan: 9, style: { ...tdStyle, textAlign: "right", fontWeight: "bold", height: "20px" }, children: "GRAND TOTAL" }), _jsx("td", { style: { ...tdStyle, textAlign: "right", fontWeight: "bold" }, children: hasPendingPhysicalCounts
91
+ ? "\u00a0"
92
+ : fmtAmount(computeGrandTotal(lines.map(line => ({
93
+ physicalCountQty: line.quantityPerPhysicalCount,
94
+ unitValue: line.unitValue,
95
+ })))) }), _jsx("td", { style: tdStyle, children: "\u00a0" })] }), _jsxs("tr", { children: [_jsxs("td", { colSpan: 4, style: {
96
+ border: b,
97
+ borderLeft: "none",
98
+ padding: "5px 8px",
99
+ verticalAlign: "top",
100
+ fontSize: fs,
101
+ }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Certified Correct by:" }), _jsx("div", { style: {
102
+ boxSizing: "border-box",
103
+ height: "24px",
104
+ padding: "3px 2px 5px",
105
+ borderBottom: b,
106
+ lineHeight: 1.1,
107
+ marginBottom: "5px",
108
+ }, children: inventoryCommitteeSignature || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of", _jsx("br", {}), "Inventory Committee Chair and", _jsx("br", {}), "Members"] })] }), _jsxs("td", { colSpan: 4, style: { border: b, padding: "5px 8px", verticalAlign: "top", fontSize: fs }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Approved by:" }), _jsx("div", { style: {
109
+ boxSizing: "border-box",
110
+ height: "24px",
111
+ padding: "3px 2px 5px",
112
+ borderBottom: b,
113
+ lineHeight: 1.1,
114
+ marginBottom: "5px",
115
+ }, children: headOfAgencySignature || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of Head of", _jsx("br", {}), "Agency/Entity or Authorized Representative"] })] }), _jsxs("td", { colSpan: 3, style: {
116
+ border: b,
117
+ borderRight: "none",
118
+ padding: "5px 8px",
119
+ verticalAlign: "top",
120
+ fontSize: fs,
121
+ }, children: [_jsx("div", { style: { marginBottom: "16px" }, children: "Verified by:" }), _jsx("div", { style: {
122
+ boxSizing: "border-box",
123
+ height: "24px",
124
+ padding: "3px 2px 5px",
125
+ borderBottom: b,
126
+ lineHeight: 1.1,
127
+ marginBottom: "5px",
128
+ }, children: coaRepresentativeSignature || "\u00a0" }), _jsxs("div", { style: { fontSize: "6.5pt", textAlign: "center" }, children: ["Signature over Printed Name of COA", _jsx("br", {}), "Representative"] })] })] })] })] }), !hasPendingPhysicalCounts ? (_jsx(GrandTotalComputation, { lines: lines.map(line => ({
129
+ label: line.article,
130
+ physicalCountQty: line.quantityPerPhysicalCount,
131
+ unitValue: line.unitValue,
132
+ })) })) : null] }));
133
+ }
@@ -0,0 +1,29 @@
1
+ type RpcspLine = {
2
+ article?: string;
3
+ description?: string;
4
+ semiExpendablePropertyNo?: string;
5
+ unitOfMeasure?: string;
6
+ unitValue: string;
7
+ balancePerCardQty: string;
8
+ onHandPerCardQty: string;
9
+ shortageOverageQty: string;
10
+ shortageOverageValue: string;
11
+ remarks?: string;
12
+ };
13
+ type RpcspPreviewProps = {
14
+ fundCluster?: string;
15
+ forWhich?: string;
16
+ nameOfAccountableOfficer?: string;
17
+ officialDesignation?: string;
18
+ entityName?: string;
19
+ dateOfAssumption?: string;
20
+ certifiedCorrectBy?: string;
21
+ approvedBy?: string;
22
+ verifiedBy?: string;
23
+ rpcspNo?: string;
24
+ lines: RpcspLine[];
25
+ };
26
+ export declare const RPCSP_PREVIEW_ROW_COUNT = 35;
27
+ export declare function buildRpcspPreviewRows<T>(lines: T[]): Array<T | null>;
28
+ export declare function RpcspPreview({ fundCluster, forWhich, nameOfAccountableOfficer, officialDesignation, entityName, dateOfAssumption, certifiedCorrectBy, approvedBy, verifiedBy, rpcspNo, lines, }: RpcspPreviewProps): import("react/jsx-runtime").JSX.Element;
29
+ export {};
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { resolveRpcspAccountablePerson } from "../../lib/rpcsp-accountable-person.js";
4
+ import { computeGrandTotal, computeLineTotal, fmtAmount } from "../utils/line-totals.js";
5
+ import { GrandTotalComputation } from "./grand-total-computation.js";
6
+ export const RPCSP_PREVIEW_ROW_COUNT = 35;
7
+ export function buildRpcspPreviewRows(lines) {
8
+ return Array.from({ length: Math.max(RPCSP_PREVIEW_ROW_COUNT, lines.length) }, (_, index) => lines[index] ?? null);
9
+ }
10
+ 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
+ function fmtNum(value) {
17
+ const n = Number(value);
18
+ return Number.isNaN(n)
19
+ ? value
20
+ : n.toLocaleString("en-PH", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
21
+ }
22
+ export function RpcspPreview({ fundCluster = "", forWhich = "", nameOfAccountableOfficer = "", officialDesignation = "", entityName = "", dateOfAssumption = "", certifiedCorrectBy = "", approvedBy = "", verifiedBy = "", rpcspNo = "Auto-generated", lines, }) {
23
+ const rows = buildRpcspPreviewRows(lines);
24
+ const cell = "rpcsp-cell";
25
+ const th = "rpcsp-heading";
26
+ return (_jsxs("div", { className: "rpcsp-page", "data-pdf-page": "true", "data-pdf-orientation": "portrait", style: {
27
+ width: "210mm",
28
+ minHeight: "297mm",
29
+ padding: "7mm 9mm",
30
+ fontFamily: "Arial, sans-serif",
31
+ fontSize: "7.5pt",
32
+ lineHeight: 1.4,
33
+ color: "#000",
34
+ backgroundColor: "#fff",
35
+ boxSizing: "border-box",
36
+ }, children: [_jsx("style", { children: `
37
+ /* Keep app-theme row backgrounds from painting over document text during capture. */
38
+ .rpcsp-page table, .rpcsp-page thead, .rpcsp-page tbody,
39
+ .rpcsp-page tr, .rpcsp-page td { background-color: transparent; color: #000; }
40
+ .rpcsp-page th { background-color: #f0f0f0; color: #000; }
41
+ .rpcsp-page td, .rpcsp-page th { overflow-wrap: anywhere; }
42
+ .rpcsp-page .rpcsp-cell, .rpcsp-page .rpcsp-heading {
43
+ border: 0; border-right: 1px solid #777; border-bottom: 1px solid #777;
44
+ padding: 3px 4px; font-size: 6pt; line-height: 1.4;
45
+ vertical-align: middle; color: #000; white-space: normal;
46
+ }
47
+ .rpcsp-page .rpcsp-heading { font-weight: 600; text-align: center; }
48
+ ` }), _jsx("div", { style: { textAlign: "center", marginBottom: "3px" }, children: _jsx("div", { style: { fontSize: "10pt", fontWeight: "bold", letterSpacing: "0.5px" }, children: "REPORT ON THE PHYSICAL COUNT OF SEMI-EXPENDABLE PROPERTY (RPCSP)" }) }), _jsx("table", { style: { width: "100%", borderCollapse: "collapse", marginBottom: "4mm", fontSize: "6pt" }, children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsxs("td", { style: { width: "50%", padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Entity Name: " }), _jsx("span", { children: entityName || "\u00a0" })] }), _jsxs("td", { style: { width: "50%", padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Fund Cluster: " }), _jsx("span", { children: fundCluster || "\u00a0" })] })] }), _jsxs("tr", { children: [_jsxs("td", { style: { padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "For which: " }), _jsx("span", { children: forWhich || "\u00a0" })] }), _jsxs("td", { style: { padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "RPCSP No.: " }), _jsx("span", { children: rpcspNo })] })] }), _jsxs("tr", { children: [_jsxs("td", { style: { padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Name of Accountable Officer: " }), _jsx("span", { children: nameOfAccountableOfficer || "\u00a0" })] }), _jsxs("td", { style: { padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Official Designation: " }), _jsx("span", { children: officialDesignation || "\u00a0" })] })] }), _jsx("tr", { children: _jsxs("td", { colSpan: 2, style: { padding: "1px 2px" }, children: [_jsx("span", { style: { fontWeight: "bold" }, children: "Date of Assumption: " }), _jsx("span", { children: fmtDate(dateOfAssumption) || "\u00a0" })] }) })] }) }), _jsx("div", { children: _jsxs("table", { style: {
49
+ width: "100%",
50
+ borderCollapse: "separate",
51
+ borderSpacing: 0,
52
+ borderTop: "1px solid #777",
53
+ borderLeft: "1px solid #777",
54
+ tableLayout: "fixed",
55
+ }, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "18%" } }), _jsx("col", { style: { width: "12%" } }), _jsx("col", { style: { width: "7%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "8%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "9%" } })] }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: th, scope: "col", children: "Article" }), _jsx("th", { className: th, scope: "col", children: "Description" }), _jsx("th", { className: th, scope: "col", children: "Semi-expendable Property No." }), _jsx("th", { className: th, scope: "col", children: "Unit of Measure" }), _jsx("th", { className: th, scope: "col", children: "Unit Value" }), _jsxs("th", { className: th, scope: "col", children: ["Balance per Card", _jsx("br", {}), "Qty"] }), _jsxs("th", { className: th, scope: "col", children: ["Balance per Card", _jsx("br", {}), "On Hand Per Card Qty"] }), _jsxs("th", { className: th, scope: "col", children: ["Shortage/Overage", _jsx("br", {}), "Qty"] }), _jsxs("th", { className: th, scope: "col", children: ["Shortage/Overage", _jsx("br", {}), "Value"] }), _jsxs("th", { className: th, scope: "col", children: ["Total Value", _jsx("br", {}), _jsx("span", { style: { fontWeight: "normal" }, children: "(On Hand Qty \u00D7 Unit Value)" })] }), _jsx("th", { className: th, scope: "col", children: "Accountable Person" })] }) }), _jsxs("tbody", { children: [rows.map((line, idx) => (_jsxs("tr", { style: { height: "12px" }, children: [_jsx("td", { className: cell, children: line?.article || "\u00a0" }), _jsx("td", { className: cell, children: line?.description || "\u00a0" }), _jsx("td", { className: cell, children: line?.semiExpendablePropertyNo || "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "center" }, children: line?.unitOfMeasure || "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtNum(line.unitValue) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtNum(line.balancePerCardQty) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtNum(line.onHandPerCardQty) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtNum(line.shortageOverageQty) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtNum(line.shortageOverageValue) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right" }, children: line ? fmtAmount(computeLineTotal(line.onHandPerCardQty, line.unitValue)) : "" }), _jsx("td", { className: cell, children: line
56
+ ? resolveRpcspAccountablePerson(line.remarks, nameOfAccountableOfficer) ||
57
+ "\u00a0"
58
+ : "\u00a0" })] }, idx))), _jsxs("tr", { style: { height: "14px" }, children: [_jsx("td", { className: cell, colSpan: 9, style: { textAlign: "right", fontWeight: "bold" }, children: "GRAND TOTAL" }), _jsx("td", { className: cell, style: { textAlign: "right", fontWeight: "bold" }, children: fmtAmount(computeGrandTotal(lines.map(line => ({
59
+ physicalCountQty: line.onHandPerCardQty,
60
+ unitValue: line.unitValue,
61
+ })))) }), _jsx("td", { className: cell, children: "" })] })] })] }) }), _jsx("table", { style: { width: "100%", borderCollapse: "collapse", marginTop: "6px", fontSize: "6pt" }, children: _jsx("tbody", { children: _jsxs("tr", { children: [_jsxs("td", { style: { width: "33%", padding: "2px 4px", verticalAlign: "top" }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: "Certified Correct by:" }), _jsx("div", { style: { marginTop: "4px" }, children: certifiedCorrectBy || "\u00a0" }), _jsx("div", { style: {
62
+ marginTop: "10px",
63
+ borderTop: "1px solid #000",
64
+ paddingTop: "2px",
65
+ lineHeight: 1.1,
66
+ }, children: "Accountable Officer" })] }), _jsxs("td", { style: { width: "33%", padding: "2px 4px", verticalAlign: "top" }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: "Approved by:" }), _jsx("div", { style: { marginTop: "4px" }, children: approvedBy || "\u00a0" }), _jsx("div", { style: {
67
+ marginTop: "10px",
68
+ borderTop: "1px solid #000",
69
+ paddingTop: "2px",
70
+ lineHeight: 1.1,
71
+ }, children: "Head of Agency/Authorized Representative" })] }), _jsxs("td", { style: { width: "33%", padding: "2px 4px", verticalAlign: "top" }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: "Verified by:" }), _jsx("div", { style: { marginTop: "4px" }, children: verifiedBy || "\u00a0" }), _jsx("div", { style: {
72
+ marginTop: "10px",
73
+ borderTop: "1px solid #000",
74
+ paddingTop: "2px",
75
+ lineHeight: 1.1,
76
+ }, children: "Auditor" })] })] }) }) }), _jsx(GrandTotalComputation, { lines: lines.map(line => ({
77
+ label: line.article,
78
+ physicalCountQty: line.onHandPerCardQty,
79
+ unitValue: line.unitValue,
80
+ })) })] }));
81
+ }
@@ -0,0 +1,23 @@
1
+ type RspiLine = {
2
+ icsNo?: string;
3
+ responsibilityCenterCode?: string;
4
+ semiExpendablePropertyNo?: string;
5
+ itemDescription?: string;
6
+ unit?: string;
7
+ quantityIssued: string;
8
+ unitCost: string;
9
+ amount: string;
10
+ };
11
+ type RspiPreviewProps = {
12
+ entityName?: string;
13
+ fundCluster?: string;
14
+ serialNo?: string;
15
+ reportDate?: string;
16
+ certifiedBy?: string;
17
+ postedBy?: string;
18
+ certificationDate?: string;
19
+ rspiNo?: string;
20
+ lines: RspiLine[];
21
+ };
22
+ export declare function RspiPreview({ entityName, fundCluster, serialNo, reportDate, certifiedBy, postedBy, certificationDate, rspiNo, lines, }: RspiPreviewProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ const FIXED_ROWS = 10;
4
+ function fmtDate(value) {
5
+ if (!value)
6
+ return "";
7
+ const d = new Date(value);
8
+ return isNaN(d.getTime()) ? value : d.toLocaleDateString("en-PH");
9
+ }
10
+ function fmtNum(value) {
11
+ const n = Number(value);
12
+ return Number.isNaN(n)
13
+ ? value
14
+ : n.toLocaleString("en-PH", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
15
+ }
16
+ export function RspiPreview({ entityName = "", fundCluster = "", serialNo = "", reportDate = "", certifiedBy = "", postedBy = "", certificationDate = "", rspiNo = "Auto-generated", lines, }) {
17
+ const rows = Array.from({ length: FIXED_ROWS }, (_, i) => lines[i] ?? null);
18
+ const totalAmount = lines.reduce((sum, l) => sum + (Number(l.amount) || 0), 0);
19
+ const cell = "border border-gray-400 px-[5px] py-[3px] text-[7pt] leading-[1.3] align-middle whitespace-normal break-words";
20
+ const th = "border border-gray-400 px-[5px] py-[4px] text-[7pt] leading-[1.3] font-semibold text-center whitespace-normal break-words";
21
+ const headerLabelStyle = {
22
+ display: "inline-block",
23
+ fontWeight: "bold",
24
+ lineHeight: "10pt",
25
+ verticalAlign: "top",
26
+ };
27
+ const headerValueStyle = {
28
+ display: "inline-block",
29
+ position: "relative",
30
+ zIndex: 1,
31
+ maxWidth: "100%",
32
+ lineHeight: "10pt",
33
+ verticalAlign: "top",
34
+ backgroundColor: "transparent",
35
+ };
36
+ return (_jsxs("div", { className: "rspi-a4-page", "data-pdf-page": "true", "data-pdf-fit-one-page": "true", style: {
37
+ width: "210mm",
38
+ minHeight: "297mm",
39
+ padding: "12mm 14mm",
40
+ fontFamily: "Arial, sans-serif",
41
+ fontSize: "7.5pt",
42
+ backgroundColor: "#fff",
43
+ boxSizing: "border-box",
44
+ }, children: [_jsx("div", { style: { textAlign: "center", marginBottom: "6px" }, children: _jsx("div", { style: { fontSize: "10pt", fontWeight: "bold", letterSpacing: "0.5px" }, children: "REPORT OF SEMI-EXPENDABLE PROPERTY ISSUED (RSPI)" }) }), _jsx("table", { style: {
45
+ width: "100%",
46
+ borderCollapse: "collapse",
47
+ tableLayout: "fixed",
48
+ marginBottom: "8px",
49
+ fontSize: "7pt",
50
+ lineHeight: 1.35,
51
+ }, children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsxs("td", { style: {
52
+ width: "50%",
53
+ padding: "2px 4px",
54
+ verticalAlign: "top",
55
+ overflowWrap: "anywhere",
56
+ }, children: [_jsx("span", { style: headerLabelStyle, children: "Entity Name:\u00A0" }), _jsx("span", { style: headerValueStyle, children: entityName || "\u00a0" })] }), _jsxs("td", { style: {
57
+ width: "50%",
58
+ padding: "2px 4px",
59
+ verticalAlign: "top",
60
+ overflowWrap: "anywhere",
61
+ }, children: [_jsx("span", { style: headerLabelStyle, children: "Fund Cluster:\u00A0" }), _jsx("span", { style: headerValueStyle, children: fundCluster || "\u00a0" })] })] }), _jsxs("tr", { children: [_jsxs("td", { style: { padding: "2px 4px", verticalAlign: "top", overflowWrap: "anywhere" }, children: [_jsx("span", { style: headerLabelStyle, children: "Serial No.:\u00A0" }), _jsx("span", { style: headerValueStyle, children: serialNo || "\u00a0" })] }), _jsxs("td", { style: { padding: "2px 4px", verticalAlign: "top", overflowWrap: "anywhere" }, children: [_jsx("span", { style: headerLabelStyle, children: "Date:\u00A0" }), _jsx("span", { style: headerValueStyle, children: fmtDate(reportDate) || "\u00a0" })] })] }), _jsx("tr", { children: _jsxs("td", { colSpan: 2, style: { padding: "2px 4px", verticalAlign: "top", overflowWrap: "anywhere" }, children: [_jsx("span", { style: headerLabelStyle, children: "RSPI No.:\u00A0" }), _jsx("span", { style: headerValueStyle, children: rspiNo })] }) })] }) }), _jsx("div", { style: { overflow: "visible" }, children: _jsxs("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "13%" } }), _jsx("col", { style: { width: "12%" } }), _jsx("col", { style: { width: "14%" } }), _jsx("col", { style: { width: "25%" } }), _jsx("col", { style: { width: "6%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "9%" } }), _jsx("col", { style: { width: "12%" } })] }), _jsxs("thead", { children: [_jsxs("tr", { style: { height: "22px" }, children: [_jsx("th", { className: th, colSpan: 6, style: { backgroundColor: "#f0f0f0" }, children: "To be filled by the Property and/or Supply Division/Unit" }), _jsx("th", { className: th, colSpan: 2, style: { backgroundColor: "#e8e8e8" }, children: "To be filled out by the Accounting Division/Unit" })] }), _jsxs("tr", { style: { height: "34px" }, children: [_jsx("th", { className: th, children: "ICS No." }), _jsx("th", { className: th, children: "Responsibility Center Code" }), _jsx("th", { className: th, children: "Semi-expendable Property No." }), _jsx("th", { className: th, children: "Item Description" }), _jsx("th", { className: th, children: "Unit" }), _jsx("th", { className: th, children: "Quantity Issued" }), _jsx("th", { className: th, children: "Unit Cost" }), _jsx("th", { className: th, children: "Amount" })] })] }), _jsxs("tbody", { children: [rows.map((line, idx) => (_jsxs("tr", { style: { height: "21px" }, children: [_jsx("td", { className: cell, children: line?.icsNo || "\u00a0" }), _jsx("td", { className: cell, children: line?.responsibilityCenterCode || "\u00a0" }), _jsx("td", { className: cell, children: line?.semiExpendablePropertyNo || "\u00a0" }), _jsx("td", { className: cell, children: line?.itemDescription || "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "center" }, children: line?.unit || "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right", whiteSpace: "nowrap" }, children: line ? fmtNum(line.quantityIssued) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right", whiteSpace: "nowrap" }, children: line ? fmtNum(line.unitCost) : "\u00a0" }), _jsx("td", { className: cell, style: { textAlign: "right", whiteSpace: "nowrap" }, children: line ? fmtNum(line.amount) : "\u00a0" })] }, idx))), _jsxs("tr", { children: [_jsx("td", { className: cell, colSpan: 7, style: { textAlign: "right", fontWeight: "bold" }, children: "TOTAL" }), _jsx("td", { className: cell, style: { textAlign: "right", fontWeight: "bold", whiteSpace: "nowrap" }, children: fmtNum(String(totalAmount)) })] })] })] }) }), _jsx("table", { style: { width: "100%", borderCollapse: "collapse", marginTop: "16px", fontSize: "7pt" }, children: _jsx("tbody", { children: _jsxs("tr", { children: [_jsxs("td", { style: { width: "50%", padding: "2px 4px", verticalAlign: "top" }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: "Certify:" }), _jsx("div", { style: { marginTop: "4px" }, children: certifiedBy || "\u00a0" }), _jsx("div", { style: {
62
+ marginTop: "18px",
63
+ borderTop: "1px solid #000",
64
+ paddingTop: "4px",
65
+ lineHeight: 1.2,
66
+ }, children: "Administrative Officer II / Designated Supply Officer" })] }), _jsxs("td", { style: { width: "50%", padding: "2px 4px", verticalAlign: "top" }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: "Posted by:" }), _jsx("div", { style: { marginTop: "4px" }, children: postedBy || "\u00a0" }), _jsx("div", { style: {
67
+ marginTop: "18px",
68
+ borderTop: "1px solid #000",
69
+ paddingTop: "4px",
70
+ lineHeight: 1.2,
71
+ }, children: "Senior Bookkeeper" }), _jsxs("div", { style: { marginTop: "8px" }, children: [_jsx("span", { style: headerLabelStyle, children: "Date:\u00A0" }), _jsx("span", { style: headerValueStyle, children: fmtDate(certificationDate) || "\u00a0" })] })] })] }) }) })] }));
72
+ }
@@ -0,0 +1,23 @@
1
+ type SpcEntryRow = {
2
+ entryDate: string;
3
+ reference: string;
4
+ receiptQty: string;
5
+ receiptUnitCost: string;
6
+ receiptTotalCost: string;
7
+ itemNo: string;
8
+ issueTransferDisposalQty: string;
9
+ issueTransferDisposalOfficeOfficer: string;
10
+ balanceQty: string;
11
+ amount: string;
12
+ remarks: string;
13
+ };
14
+ export type SpcPreviewProps = {
15
+ entityName: string;
16
+ fundCluster: string;
17
+ semiExpendableProperty: string;
18
+ semiExpendablePropertyNumber?: string;
19
+ description: string;
20
+ entries: SpcEntryRow[];
21
+ };
22
+ export declare function SpcPreview({ entityName, fundCluster, semiExpendableProperty, semiExpendablePropertyNumber, description, entries, }: SpcPreviewProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};