@things-factory/operato-pms 3.7.5 → 3.8.13

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 (305) hide show
  1. package/client/bootstrap.js +20 -7
  2. package/client/component/block-selector-popup.js +125 -24
  3. package/client/component/driver-selector-popup.js +223 -0
  4. package/client/component/mill-selector-popup.js +200 -0
  5. package/client/component/tracked-plantation-setting.js +113 -0
  6. package/client/component/truck-selector-popup.js +202 -0
  7. package/client/menu.js +34 -2
  8. package/client/pages/constants/index.js +1 -0
  9. package/client/pages/constants/organization.js +5 -0
  10. package/client/pages/dispatchment/daily-dispatch-detail.js +57 -18
  11. package/client/pages/dispatchment/dispatchment-create-record.js +140 -13
  12. package/client/pages/dispatchment/dispatchment-list.js +26 -34
  13. package/client/pages/harvesting/daily-harvesting-detail.js +55 -18
  14. package/client/pages/harvesting/edit-harvesting-record.js +89 -23
  15. package/client/pages/harvesting/harvesting-create-record.js +102 -16
  16. package/client/pages/harvesting/harvesting-list.js +58 -12
  17. package/client/pages/inventory/inventory-field-bunches.js +6 -4
  18. package/client/pages/loading/daily-loading-detail.js +47 -93
  19. package/client/pages/loading/edit-loading-record.js +75 -294
  20. package/client/pages/loading/loading-create-record.js +52 -329
  21. package/client/pages/loading/loading-list.js +20 -83
  22. package/client/pages/master/block.js +1 -0
  23. package/client/pages/master/company.js +26 -13
  24. package/client/pages/master/home.js +67 -65
  25. package/client/pages/master/ramp.js +1 -0
  26. package/client/pages/master/staff.js +54 -3
  27. package/client/pages/master/truck.js +416 -0
  28. package/client/pages/report/home.js +72 -65
  29. package/client/pages/report/report-daily-ffb-dispatch-and-production.js +393 -0
  30. package/client/pages/report/report-daily-production.js +38 -6
  31. package/client/pages/report/report-daily-staff-harvest.js +50 -5
  32. package/client/pages/report/report-ffb-tonnage-between-individual-block.js +393 -0
  33. package/client/pages/report/report-monthly-ffb-sale.js +413 -0
  34. package/client/pages/report/report-monthly-production.js +33 -4
  35. package/client/pages/report/report-yearly-production.js +24 -8
  36. package/client/pages/setting/home.js +107 -0
  37. package/client/pages/setting/plantation-setting.js +109 -0
  38. package/client/route.js +25 -0
  39. package/dist-server/constants/index.js +1 -0
  40. package/dist-server/constants/index.js.map +1 -1
  41. package/dist-server/constants/organization.js +9 -0
  42. package/dist-server/constants/organization.js.map +1 -0
  43. package/dist-server/controllers/render-dispatchment.js +1 -1
  44. package/dist-server/controllers/render-dispatchment.js.map +1 -1
  45. package/dist-server/entities/daily-dispatch.js +19 -4
  46. package/dist-server/entities/daily-dispatch.js.map +1 -1
  47. package/dist-server/entities/daily-harvest-detail.js +9 -11
  48. package/dist-server/entities/daily-harvest-detail.js.map +1 -1
  49. package/dist-server/entities/daily-harvest.js +16 -6
  50. package/dist-server/entities/daily-harvest.js.map +1 -1
  51. package/dist-server/entities/daily-loading-detail.js +14 -6
  52. package/dist-server/entities/daily-loading-detail.js.map +1 -1
  53. package/dist-server/entities/daily-loading.js +3 -11
  54. package/dist-server/entities/daily-loading.js.map +1 -1
  55. package/dist-server/entities/index.js +7 -1
  56. package/dist-server/entities/index.js.map +1 -1
  57. package/dist-server/entities/organization-staff.js +5 -1
  58. package/dist-server/entities/organization-staff.js.map +1 -1
  59. package/dist-server/entities/plantation-inventory.js +4 -10
  60. package/dist-server/entities/plantation-inventory.js.map +1 -1
  61. package/dist-server/entities/plantation-setting.js +76 -0
  62. package/dist-server/entities/plantation-setting.js.map +1 -0
  63. package/dist-server/entities/truck.js +77 -0
  64. package/dist-server/entities/truck.js.map +1 -0
  65. package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js +13 -2
  66. package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js.map +1 -1
  67. package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js +25 -11
  68. package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js.map +1 -1
  69. package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js +3 -2
  70. package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js.map +1 -1
  71. package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js +3 -1
  72. package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js.map +1 -1
  73. package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js +21 -2
  74. package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js.map +1 -1
  75. package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js +8 -2
  76. package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js.map +1 -1
  77. package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js +4 -6
  78. package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js.map +1 -1
  79. package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js +20 -54
  80. package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js.map +1 -1
  81. package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js +17 -105
  82. package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js.map +1 -1
  83. package/dist-server/graphql/resolvers/dashboard/dashboard-query.js +82 -0
  84. package/dist-server/graphql/resolvers/dashboard/dashboard-query.js.map +1 -0
  85. package/dist-server/graphql/resolvers/dashboard/index.js +8 -0
  86. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -0
  87. package/dist-server/graphql/resolvers/index.js +9 -6
  88. package/dist-server/graphql/resolvers/index.js.map +1 -1
  89. package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js +7 -3
  90. package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js.map +1 -1
  91. package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js +12 -0
  92. package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js.map +1 -0
  93. package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js +13 -0
  94. package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js.map +1 -0
  95. package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js +16 -0
  96. package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js.map +1 -0
  97. package/dist-server/graphql/resolvers/plantation-setting/index.js +15 -0
  98. package/dist-server/graphql/resolvers/plantation-setting/index.js.map +1 -0
  99. package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js +33 -0
  100. package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js.map +1 -0
  101. package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js +31 -0
  102. package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js.map +1 -0
  103. package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js +16 -0
  104. package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js.map +1 -0
  105. package/dist-server/graphql/resolvers/report/daily-production-reports.js +46 -33
  106. package/dist-server/graphql/resolvers/report/daily-production-reports.js.map +1 -1
  107. package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js +21 -10
  108. package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js.map +1 -1
  109. package/dist-server/graphql/resolvers/report/index.js +4 -1
  110. package/dist-server/graphql/resolvers/report/index.js.map +1 -1
  111. package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js +89 -0
  112. package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js.map +1 -0
  113. package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js +89 -0
  114. package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js.map +1 -0
  115. package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js +87 -0
  116. package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js.map +1 -0
  117. package/dist-server/graphql/resolvers/report/monthly-production-reports.js +46 -31
  118. package/dist-server/graphql/resolvers/report/monthly-production-reports.js.map +1 -1
  119. package/dist-server/graphql/resolvers/report/yearly-production-reports.js +38 -28
  120. package/dist-server/graphql/resolvers/report/yearly-production-reports.js.map +1 -1
  121. package/dist-server/graphql/resolvers/truck/delete-trucks.js +18 -0
  122. package/dist-server/graphql/resolvers/truck/delete-trucks.js.map +1 -0
  123. package/dist-server/graphql/resolvers/truck/index.js +12 -0
  124. package/dist-server/graphql/resolvers/truck/index.js.map +1 -0
  125. package/dist-server/graphql/resolvers/truck/truck-query.js +46 -0
  126. package/dist-server/graphql/resolvers/truck/truck-query.js.map +1 -0
  127. package/dist-server/graphql/resolvers/truck/update-multiple-truck.js +40 -0
  128. package/dist-server/graphql/resolvers/truck/update-multiple-truck.js.map +1 -0
  129. package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js +4 -1
  130. package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js.map +1 -1
  131. package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js +4 -1
  132. package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js.map +1 -1
  133. package/dist-server/graphql/types/daily-dispatch/index.js +6 -1
  134. package/dist-server/graphql/types/daily-dispatch/index.js.map +1 -1
  135. package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js +4 -1
  136. package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js.map +1 -1
  137. package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js +5 -2
  138. package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js.map +1 -1
  139. package/dist-server/graphql/types/daily-harvest/daily-harvest.js +3 -0
  140. package/dist-server/graphql/types/daily-harvest/daily-harvest.js.map +1 -1
  141. package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js +4 -1
  142. package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js.map +1 -1
  143. package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js +1 -0
  144. package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js.map +1 -1
  145. package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js +1 -0
  146. package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js.map +1 -1
  147. package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js +1 -0
  148. package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js.map +1 -1
  149. package/dist-server/graphql/types/daily-loading/daily-loading-patch.js +0 -2
  150. package/dist-server/graphql/types/daily-loading/daily-loading-patch.js.map +1 -1
  151. package/dist-server/graphql/types/daily-loading/daily-loading.js +0 -2
  152. package/dist-server/graphql/types/daily-loading/daily-loading.js.map +1 -1
  153. package/dist-server/graphql/types/daily-loading/new-daily-loading.js +0 -2
  154. package/dist-server/graphql/types/daily-loading/new-daily-loading.js.map +1 -1
  155. package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js +6 -3
  156. package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js.map +1 -1
  157. package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js +3 -0
  158. package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js.map +1 -1
  159. package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js +6 -3
  160. package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js.map +1 -1
  161. package/dist-server/graphql/types/dashboard/bunches-count.js +15 -0
  162. package/dist-server/graphql/types/dashboard/bunches-count.js.map +1 -0
  163. package/dist-server/graphql/types/dashboard/index.js +32 -0
  164. package/dist-server/graphql/types/dashboard/index.js.map +1 -0
  165. package/dist-server/graphql/types/dashboard/productions-overview.js +15 -0
  166. package/dist-server/graphql/types/dashboard/productions-overview.js.map +1 -0
  167. package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js +14 -0
  168. package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js.map +1 -0
  169. package/dist-server/graphql/types/dashboard/tonnage-production.js +17 -0
  170. package/dist-server/graphql/types/dashboard/tonnage-production.js.map +1 -0
  171. package/dist-server/graphql/types/dashboard/yield-production.js +17 -0
  172. package/dist-server/graphql/types/dashboard/yield-production.js.map +1 -0
  173. package/dist-server/graphql/types/index.js +9 -6
  174. package/dist-server/graphql/types/index.js.map +1 -1
  175. package/dist-server/graphql/types/organization-staff/organization-staff-patch.js +2 -0
  176. package/dist-server/graphql/types/organization-staff/organization-staff-patch.js.map +1 -1
  177. package/dist-server/graphql/types/organization-staff/organization-staff.js +3 -0
  178. package/dist-server/graphql/types/organization-staff/organization-staff.js.map +1 -1
  179. package/dist-server/graphql/types/plantation-setting/index.js +36 -0
  180. package/dist-server/graphql/types/plantation-setting/index.js.map +1 -0
  181. package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js +16 -0
  182. package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js.map +1 -0
  183. package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js +14 -0
  184. package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js.map +1 -0
  185. package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js +18 -0
  186. package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js.map +1 -0
  187. package/dist-server/graphql/types/plantation-setting/plantation-setting.js +22 -0
  188. package/dist-server/graphql/types/plantation-setting/plantation-setting.js.map +1 -0
  189. package/dist-server/graphql/types/report/index.js +20 -0
  190. package/dist-server/graphql/types/report/index.js.map +1 -1
  191. package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js +14 -0
  192. package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js.map +1 -0
  193. package/dist-server/graphql/types/report/monthly-block-dispatch-report.js +19 -0
  194. package/dist-server/graphql/types/report/monthly-block-dispatch-report.js.map +1 -0
  195. package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js +14 -0
  196. package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js.map +1 -0
  197. package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js +25 -0
  198. package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js.map +1 -0
  199. package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js +14 -0
  200. package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js.map +1 -0
  201. package/dist-server/graphql/types/report/monthly-ffb-sale-report.js +24 -0
  202. package/dist-server/graphql/types/report/monthly-ffb-sale-report.js.map +1 -0
  203. package/dist-server/graphql/types/truck/index.js +33 -0
  204. package/dist-server/graphql/types/truck/index.js.map +1 -0
  205. package/dist-server/graphql/types/truck/new-truck.js +14 -0
  206. package/dist-server/graphql/types/truck/new-truck.js.map +1 -0
  207. package/dist-server/graphql/types/truck/truck-list.js +14 -0
  208. package/dist-server/graphql/types/truck/truck-list.js.map +1 -0
  209. package/dist-server/graphql/types/truck/truck-patch.js +17 -0
  210. package/dist-server/graphql/types/truck/truck-patch.js.map +1 -0
  211. package/dist-server/graphql/types/truck/truck.js +22 -0
  212. package/dist-server/graphql/types/truck/truck.js.map +1 -0
  213. package/package.json +29 -29
  214. package/server/constants/index.ts +1 -0
  215. package/server/constants/organization.ts +5 -0
  216. package/server/controllers/render-dispatchment.ts +1 -1
  217. package/server/entities/daily-dispatch.ts +21 -5
  218. package/server/entities/daily-harvest-detail.ts +10 -11
  219. package/server/entities/daily-harvest.ts +16 -7
  220. package/server/entities/daily-loading-detail.ts +14 -6
  221. package/server/entities/daily-loading.ts +7 -11
  222. package/server/entities/index.ts +6 -0
  223. package/server/entities/organization-staff.ts +6 -1
  224. package/server/entities/plantation-inventory.ts +6 -10
  225. package/server/entities/plantation-setting.ts +60 -0
  226. package/server/entities/truck.ts +58 -0
  227. package/server/graphql/resolvers/daily-dispatch/daily-dispatch-query.ts +15 -2
  228. package/server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.ts +40 -14
  229. package/server/graphql/resolvers/daily-dispatch/update-daily-dispatch.ts +6 -2
  230. package/server/graphql/resolvers/daily-harvest/daily-harvest-query.ts +7 -2
  231. package/server/graphql/resolvers/daily-harvest/generate-daily-harvest.ts +50 -4
  232. package/server/graphql/resolvers/daily-harvest/update-daily-harvest.ts +12 -2
  233. package/server/graphql/resolvers/daily-loading/daily-loading-query.ts +6 -6
  234. package/server/graphql/resolvers/daily-loading/generate-daily-loading.ts +27 -109
  235. package/server/graphql/resolvers/daily-loading/update-daily-loading.ts +27 -213
  236. package/server/graphql/resolvers/dashboard/dashboard-query.ts +96 -0
  237. package/server/graphql/resolvers/dashboard/index.ts +5 -0
  238. package/server/graphql/resolvers/index.ts +10 -6
  239. package/server/graphql/resolvers/organization-staff/organization-staff-query.ts +13 -4
  240. package/server/graphql/resolvers/plantation-setting/create-plantation-setting.ts +16 -0
  241. package/server/graphql/resolvers/plantation-setting/delete-plantation-setting.ts +13 -0
  242. package/server/graphql/resolvers/plantation-setting/delete-plantation-settings.ts +16 -0
  243. package/server/graphql/resolvers/plantation-setting/index.ts +19 -0
  244. package/server/graphql/resolvers/plantation-setting/plantation-setting-query.ts +38 -0
  245. package/server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.ts +46 -0
  246. package/server/graphql/resolvers/plantation-setting/update-plantation-setting.ts +19 -0
  247. package/server/graphql/resolvers/report/daily-production-reports.ts +55 -44
  248. package/server/graphql/resolvers/report/daily-staff-harvest-reports.ts +28 -20
  249. package/server/graphql/resolvers/report/index.ts +7 -1
  250. package/server/graphql/resolvers/report/monthly-block-dispatch-reports.ts +112 -0
  251. package/server/graphql/resolvers/report/monthly-dispatch-summary-reports.ts +110 -0
  252. package/server/graphql/resolvers/report/monthly-ffb-sale-reports.ts +107 -0
  253. package/server/graphql/resolvers/report/monthly-production-reports.ts +54 -40
  254. package/server/graphql/resolvers/report/yearly-production-reports.ts +43 -38
  255. package/server/graphql/resolvers/truck/delete-trucks.ts +21 -0
  256. package/server/graphql/resolvers/truck/index.ts +12 -0
  257. package/server/graphql/resolvers/truck/truck-query.ts +52 -0
  258. package/server/graphql/resolvers/truck/update-multiple-truck.ts +55 -0
  259. package/server/graphql/types/daily-dispatch/daily-dispatch-patch.ts +4 -1
  260. package/server/graphql/types/daily-dispatch/daily-dispatch.ts +4 -1
  261. package/server/graphql/types/daily-dispatch/index.ts +6 -1
  262. package/server/graphql/types/daily-dispatch/new-daily-dispatch.ts +4 -1
  263. package/server/graphql/types/daily-harvest/daily-harvest-patch.ts +5 -2
  264. package/server/graphql/types/daily-harvest/daily-harvest.ts +3 -0
  265. package/server/graphql/types/daily-harvest/new-daily-harvest.ts +4 -1
  266. package/server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.ts +1 -0
  267. package/server/graphql/types/daily-harvest-detail/daily-harvest-detail.ts +1 -0
  268. package/server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.ts +1 -0
  269. package/server/graphql/types/daily-loading/daily-loading-patch.ts +0 -2
  270. package/server/graphql/types/daily-loading/daily-loading.ts +0 -2
  271. package/server/graphql/types/daily-loading/new-daily-loading.ts +0 -2
  272. package/server/graphql/types/daily-loading-detail/daily-loading-detail-patch.ts +6 -3
  273. package/server/graphql/types/daily-loading-detail/daily-loading-detail.ts +3 -0
  274. package/server/graphql/types/daily-loading-detail/new-daily-loading-detail.ts +6 -3
  275. package/server/graphql/types/dashboard/bunches-count.ts +9 -0
  276. package/server/graphql/types/dashboard/index.ts +17 -0
  277. package/server/graphql/types/dashboard/productions-overview.ts +9 -0
  278. package/server/graphql/types/dashboard/tonnage-bunches-inventories.ts +8 -0
  279. package/server/graphql/types/dashboard/tonnage-production.ts +11 -0
  280. package/server/graphql/types/dashboard/yield-production.ts +11 -0
  281. package/server/graphql/types/index.ts +10 -6
  282. package/server/graphql/types/organization-staff/organization-staff-patch.ts +2 -0
  283. package/server/graphql/types/organization-staff/organization-staff.ts +3 -0
  284. package/server/graphql/types/plantation-setting/index.ts +21 -0
  285. package/server/graphql/types/plantation-setting/new-plantation-setting.ts +10 -0
  286. package/server/graphql/types/plantation-setting/plantation-setting-list.ts +8 -0
  287. package/server/graphql/types/plantation-setting/plantation-setting-patch.ts +12 -0
  288. package/server/graphql/types/plantation-setting/plantation-setting.ts +16 -0
  289. package/server/graphql/types/report/index.ts +20 -0
  290. package/server/graphql/types/report/monthly-block-dispatch-report-list.ts +7 -0
  291. package/server/graphql/types/report/monthly-block-dispatch-report.ts +13 -0
  292. package/server/graphql/types/report/monthly-dispatch-summary-report-list.ts +7 -0
  293. package/server/graphql/types/report/monthly-dispatch-summary-report.ts +19 -0
  294. package/server/graphql/types/report/monthly-ffb-sale-report-list.ts +7 -0
  295. package/server/graphql/types/report/monthly-ffb-sale-report.ts +18 -0
  296. package/server/graphql/types/truck/index.ts +18 -0
  297. package/server/graphql/types/truck/new-truck.ts +8 -0
  298. package/server/graphql/types/truck/truck-list.ts +8 -0
  299. package/server/graphql/types/truck/truck-patch.ts +11 -0
  300. package/server/graphql/types/truck/truck.ts +16 -0
  301. package/things-factory.config.js +27 -1
  302. package/translations/en.json +78 -16
  303. package/translations/ko.json +77 -48
  304. package/translations/ms.json +74 -45
  305. package/translations/zh.json +77 -48
@@ -0,0 +1,393 @@
1
+ import '@things-factory/form-ui'
2
+ import '@things-factory/grist-ui'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html } from 'lit-element'
6
+ import { connect } from 'pwa-helpers/connect-mixin'
7
+
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client, PageView, store } from '@things-factory/shell'
10
+ import { ScrollbarStyles } from '@things-factory/styles'
11
+ import { isMobileDevice } from '@things-factory/utils'
12
+
13
+ class ReportDailyFfbDispatchAndProduction extends connect(store)(localize(i18next)(PageView)) {
14
+ static get styles() {
15
+ return [
16
+ ScrollbarStyles,
17
+ css`
18
+ :host {
19
+ display: flex;
20
+ flex-direction: column;
21
+ overflow: hidden;
22
+ }
23
+
24
+ search-form {
25
+ overflow: visible;
26
+ }
27
+
28
+ data-grist {
29
+ overflow-y: auto;
30
+ flex: 1;
31
+ }
32
+ `
33
+ ]
34
+ }
35
+
36
+ static get properties() {
37
+ return {
38
+ _searchFields: Object,
39
+ _config: Object,
40
+ _gristData: Object,
41
+ _blocks: Object,
42
+ _month: String,
43
+ data: Object
44
+ }
45
+ }
46
+
47
+ get context() {
48
+ let fileName = `${i18next.t('title.ffb_tonnage_between_individual_block')}`
49
+ return {
50
+ title: i18next.t('title.ffb_tonnage_between_individual_block'),
51
+ printable: {
52
+ accept: ['preview'],
53
+ content: this
54
+ },
55
+ exportable: {
56
+ name: fileName,
57
+ data: this._exportableData.bind(this)
58
+ }
59
+ }
60
+ }
61
+
62
+ get dataGrist() {
63
+ return this.shadowRoot.querySelector('data-grist')
64
+ }
65
+
66
+ get searchForm() {
67
+ return this.shadowRoot.querySelector('search-form')
68
+ }
69
+
70
+ get _monthInput() {
71
+ return this.searchForm.shadowRoot.querySelector('input[name=month]')
72
+ }
73
+
74
+ constructor() {
75
+ super()
76
+ this._month = ''
77
+ }
78
+
79
+ render() {
80
+ return html`
81
+ <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
82
+
83
+ <data-grist
84
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
85
+ .config=${this._config}
86
+ .fetchHandler="${this.fetchHandler.bind(this)}"
87
+ ></data-grist>
88
+ `
89
+ }
90
+
91
+ get searchFields() {
92
+ return [
93
+ {
94
+ label: i18next.t('field.month'),
95
+ name: 'month',
96
+ type: 'month',
97
+ props: {
98
+ searchOper: 'eq',
99
+ min: '2019-01'
100
+ },
101
+ handlers: { change: this._dateChange.bind(this) },
102
+ value: (() => {
103
+ let date = new Date()
104
+ return date.getFullYear().toString() + '-' + (date.getMonth() + 1).toString().padStart(2, 0)
105
+ // return new Date()
106
+ })()
107
+ }
108
+ ]
109
+ }
110
+
111
+ get reportConfig() {
112
+ return {
113
+ pagination: { limit: 250, pages: [50, 100, 250, 500] },
114
+ rows: {
115
+ selectable: false,
116
+ insertable: false,
117
+ appendable: false
118
+ }
119
+ }
120
+ }
121
+
122
+ get sectionOneColumns() {
123
+ return [
124
+ {
125
+ type: 'string',
126
+ name: 'date',
127
+ header: i18next.t('field.date'),
128
+ record: { editable: false, align: 'left' },
129
+ imex: {
130
+ header: i18next.t('field.date'),
131
+ key: 'date',
132
+ width: 20,
133
+ type: 'string'
134
+ },
135
+ width: 120
136
+ },
137
+ {
138
+ type: 'string',
139
+ name: 'runningNo',
140
+ header: i18next.t('field.no'),
141
+ record: { editable: false, align: 'left' },
142
+ imex: {
143
+ header: i18next.t('field.no'),
144
+ key: 'runningNo',
145
+ width: 10,
146
+ type: 'string'
147
+ },
148
+ width: 60
149
+ },
150
+ {
151
+ type: 'string',
152
+ name: 'dispatchTo',
153
+ header: i18next.t('field.dispatch_to'),
154
+ record: { editable: false, align: 'left' },
155
+ imex: {
156
+ header: i18next.t('field.dispatch_to'),
157
+ key: 'dispatchTo',
158
+ width: 50,
159
+ type: 'string'
160
+ },
161
+ width: 200
162
+ },
163
+ {
164
+ type: 'string',
165
+ name: 'lorryNo',
166
+ header: i18next.t('field.lorry_no'),
167
+ record: { editable: false, align: 'left' },
168
+ imex: {
169
+ header: i18next.t('field.lorry_no'),
170
+ key: 'lorryNo',
171
+ width: 50,
172
+ type: 'string'
173
+ },
174
+ width: 200
175
+ }
176
+ ]
177
+ }
178
+
179
+ get sectionTwoColumns() {
180
+ return this._blocks.sort(this._compareValues('name', 'asc')).map(blk => {
181
+ return {
182
+ type: 'number',
183
+ name: blk.name,
184
+ header: blk.name,
185
+ record: { editable: false, align: 'center' },
186
+ imex: {
187
+ header: blk.name,
188
+ key: blk.name,
189
+ width: 30,
190
+ type: 'decimal'
191
+ },
192
+ width: 120
193
+ }
194
+ })
195
+ }
196
+
197
+ get sectionThreeColumns() {
198
+ return [
199
+ {
200
+ type: 'string',
201
+ name: 'today',
202
+ header: i18next.t('field.today'),
203
+ record: { editable: false, align: 'center' },
204
+ imex: {
205
+ header: i18next.t('field.today'),
206
+ key: 'today',
207
+ width: 30,
208
+ type: 'string'
209
+ },
210
+ width: 120
211
+ },
212
+ {
213
+ type: 'string',
214
+ name: 'todate',
215
+ header: i18next.t('field.to_date'),
216
+ record: { editable: false, align: 'center' },
217
+ imex: {
218
+ header: i18next.t('field.to_date'),
219
+ key: 'todate',
220
+ width: 30,
221
+ type: 'string'
222
+ },
223
+ width: 120
224
+ }
225
+ ]
226
+ }
227
+
228
+ async pageInitialized() {
229
+ let blocks = [...(await this._fetchBlocks())]
230
+ this._blocks = blocks
231
+ this._gristData = { total: 0, records: [] }
232
+ this._searchFields = this.searchFields
233
+ this._config = {
234
+ ...this.reportConfig,
235
+ columns: [...this.sectionOneColumns, ...this.sectionTwoColumns, ...this.sectionThreeColumns]
236
+ }
237
+ }
238
+
239
+ pageUpdated(changes, lifecycle) {
240
+ if (this.active) {
241
+ this.dataGrist.fetch()
242
+ }
243
+ }
244
+
245
+ async fetchHandler({ page, limit, sorters = [] }) {
246
+ try {
247
+ const filters = this.searchForm.queryFilters
248
+ const pagination = { page, limit }
249
+ const sortings = sorters
250
+
251
+ const response = await client.query({
252
+ query: gql`
253
+ query monthlyBlockDispatchReports($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
254
+ monthlyBlockDispatchReports(filters: $filters, pagination: $pagination, sortings: $sortings) {
255
+ items {
256
+ no
257
+ date
258
+ blockData
259
+ lorryNo
260
+ dispatchTo
261
+ today
262
+ todate
263
+ }
264
+ total
265
+ }
266
+ }
267
+ `,
268
+ variables: { filters, pagination, sortings }
269
+ })
270
+
271
+ const data = {
272
+ records:
273
+ response.data.monthlyBlockDispatchReports.items.map((item, idx) => {
274
+ let blockData = JSON.parse(item.blockData)
275
+ return {
276
+ ...item,
277
+ ...blockData,
278
+ runningNo: idx + 1
279
+ }
280
+ }) || [],
281
+ total: response.data.monthlyBlockDispatchReports.total
282
+ }
283
+
284
+ this._gristData = {
285
+ ...data
286
+ }
287
+
288
+ this.updateContext()
289
+
290
+ return data
291
+ } catch (e) {
292
+ console.log(e)
293
+ }
294
+ }
295
+
296
+ async _fetchBlocks() {
297
+ const filters = []
298
+ const pagination = { page: 1, limit: 99999999 }
299
+
300
+ const response = await client.query({
301
+ query: gql`
302
+ query ramps($filters: [Filter], $pagination: Pagination) {
303
+ ramps(filters: $filters, pagination: $pagination) {
304
+ items {
305
+ id
306
+ name
307
+ block {
308
+ id
309
+ name
310
+ }
311
+ }
312
+ }
313
+ }
314
+ `,
315
+ variables: { filters, pagination }
316
+ })
317
+
318
+ if (!response.errors) {
319
+ return response.data.ramps.items.map(ramp => {
320
+ return {
321
+ id: ramp.block.id,
322
+ name: ramp.block.name
323
+ }
324
+ })
325
+ }
326
+ }
327
+
328
+ _dateChange() {
329
+ const monthNames = [
330
+ 'January',
331
+ 'February',
332
+ 'March',
333
+ 'April',
334
+ 'May',
335
+ 'June',
336
+ 'July',
337
+ 'August',
338
+ 'September',
339
+ 'October',
340
+ 'November',
341
+ 'December'
342
+ ]
343
+ let selectedDate = this._monthInput.valueAsDate
344
+ this._month = `${monthNames[selectedDate.getMonth()]} ${selectedDate.getFullYear().toString()}`
345
+ }
346
+
347
+ async _exportableData() {
348
+ if (this._gristData.records.length > 0) {
349
+ var headerSetting = this._config.columns
350
+ .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
351
+ .map(column => {
352
+ return column.imex
353
+ })
354
+
355
+ let data = await this.fetchHandler({ page: 1, limit: 9999999 })
356
+ return { header: headerSetting, data: data.records }
357
+ } else {
358
+ throw new Error('No Data to Export')
359
+ }
360
+ }
361
+
362
+ _compareValues(key, order = 'asc') {
363
+ return function innerSort(a, b) {
364
+ if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
365
+ return 0
366
+ }
367
+
368
+ const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
369
+ const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
370
+
371
+ let comparison = 0
372
+ if (varA > varB) {
373
+ comparison = 1
374
+ } else if (varA < varB) {
375
+ comparison = -1
376
+ }
377
+ return order === 'desc' ? comparison * -1 : comparison
378
+ }
379
+ }
380
+
381
+ _showToast({ type, message }) {
382
+ document.dispatchEvent(
383
+ new CustomEvent('notify', {
384
+ detail: {
385
+ type,
386
+ message
387
+ }
388
+ })
389
+ )
390
+ }
391
+ }
392
+
393
+ window.customElements.define('report-daily-ffb-dispatch-and-production', ReportDailyFfbDispatchAndProduction)
@@ -1,13 +1,15 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
- import { i18next, localize } from '@things-factory/i18n-base'
4
- import { client, PageView, store } from '@things-factory/shell'
5
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
- import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
3
+
7
4
  import gql from 'graphql-tag'
8
5
  import { css, html } from 'lit-element'
9
6
  import { connect } from 'pwa-helpers/connect-mixin'
10
7
 
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client, PageView, store } from '@things-factory/shell'
10
+ import { ScrollbarStyles } from '@things-factory/styles'
11
+ import { isMobileDevice } from '@things-factory/utils'
12
+
11
13
  class ReportDailyProduction extends connect(store)(localize(i18next)(PageView)) {
12
14
  static get styles() {
13
15
  return [
@@ -37,11 +39,14 @@ class ReportDailyProduction extends connect(store)(localize(i18next)(PageView))
37
39
  _config: Object,
38
40
  _gristData: Object,
39
41
  _blocks: Object,
42
+ _block: String,
43
+ _month: String,
40
44
  data: Object
41
45
  }
42
46
  }
43
47
 
44
48
  get context() {
49
+ let fileName = `${i18next.t('title.daily_production_report')} (Block ${this._block} ${this._month})`
45
50
  return {
46
51
  title: i18next.t('title.daily_production_report'),
47
52
  printable: {
@@ -49,7 +54,7 @@ class ReportDailyProduction extends connect(store)(localize(i18next)(PageView))
49
54
  content: this
50
55
  },
51
56
  exportable: {
52
- name: i18next.t('title.daily_production_report'),
57
+ name: fileName,
53
58
  data: this._exportableData.bind(this)
54
59
  }
55
60
  }
@@ -71,6 +76,12 @@ class ReportDailyProduction extends connect(store)(localize(i18next)(PageView))
71
76
  return this.searchForm.shadowRoot.querySelector('input[name=month]')
72
77
  }
73
78
 
79
+ constructor() {
80
+ super()
81
+ this._block = ''
82
+ this._month = ''
83
+ }
84
+
74
85
  render() {
75
86
  return html`
76
87
  <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
@@ -360,13 +371,28 @@ class ReportDailyProduction extends connect(store)(localize(i18next)(PageView))
360
371
  this._config = this.reportConfig
361
372
  }
362
373
 
363
- async pageUpdated(changes, lifecycle) {
374
+ pageUpdated(changes, lifecycle) {
364
375
  if (this.active) {
365
376
  this.dataGrist.fetch()
366
377
  }
367
378
  }
368
379
 
369
380
  async fetchHandler({ page, limit, sorters = [] }) {
381
+ const monthNames = [
382
+ 'January',
383
+ 'February',
384
+ 'March',
385
+ 'April',
386
+ 'May',
387
+ 'June',
388
+ 'July',
389
+ 'August',
390
+ 'September',
391
+ 'October',
392
+ 'November',
393
+ 'December'
394
+ ]
395
+
370
396
  try {
371
397
  const filters = this.searchForm.queryFilters
372
398
  const pagination = { page, limit }
@@ -418,6 +444,12 @@ class ReportDailyProduction extends connect(store)(localize(i18next)(PageView))
418
444
  ...data
419
445
  }
420
446
 
447
+ let selectedDate = this._monthInput.valueAsDate
448
+
449
+ this._block = this._blockSelector.options[this._blockSelector.selectedIndex].text
450
+ this._month = `${monthNames[selectedDate.getMonth()]} ${selectedDate.getFullYear().toString()}`
451
+ this.updateContext()
452
+
421
453
  return data
422
454
  } catch (e) {
423
455
  console.log(e)
@@ -1,12 +1,14 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
- import { i18next, localize } from '@things-factory/i18n-base'
4
- import { client, PageView, store } from '@things-factory/shell'
5
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
3
+
6
4
  import gql from 'graphql-tag'
7
5
  import { css, html } from 'lit-element'
8
6
  import { connect } from 'pwa-helpers/connect-mixin'
9
7
 
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client, PageView, store } from '@things-factory/shell'
10
+ import { isMobileDevice } from '@things-factory/utils'
11
+
10
12
  class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)) {
11
13
  static get styles() {
12
14
  return css`
@@ -28,11 +30,15 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
28
30
  _searchFields: Object,
29
31
  _config: Object,
30
32
  _gristData: Object,
33
+ _block: String,
34
+ _month: String,
31
35
  data: Object
32
36
  }
33
37
  }
34
38
 
35
39
  get context() {
40
+ let fileName = `${i18next.t('title.daily_staff_harvest')} (Block ${this._block} ${this._month})`
41
+
36
42
  return {
37
43
  title: i18next.t('title.daily_staff_harvest'),
38
44
  printable: {
@@ -40,7 +46,7 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
40
46
  content: this
41
47
  },
42
48
  exportable: {
43
- name: i18next.t('title.daily_staff_harvest'),
49
+ name: fileName,
44
50
  data: this._exportableData.bind(this)
45
51
  }
46
52
  }
@@ -62,6 +68,12 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
62
68
  return this.searchForm.shadowRoot.querySelector('input[name=month]')
63
69
  }
64
70
 
71
+ constructor() {
72
+ super()
73
+ this._block = ''
74
+ this._month = ''
75
+ }
76
+
65
77
  render() {
66
78
  return html`
67
79
  <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
@@ -144,13 +156,28 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
144
156
  this._updateGrist()
145
157
  }
146
158
 
147
- async pageUpdated(changes, lifecycle) {
159
+ pageUpdated(changes, lifecycle) {
148
160
  if (this.active) {
149
161
  this.dataGrist.fetch()
150
162
  }
151
163
  }
152
164
 
153
165
  async fetchHandler({ page, limit, sorters = [] }) {
166
+ const monthNames = [
167
+ 'January',
168
+ 'February',
169
+ 'March',
170
+ 'April',
171
+ 'May',
172
+ 'June',
173
+ 'July',
174
+ 'August',
175
+ 'September',
176
+ 'October',
177
+ 'November',
178
+ 'December'
179
+ ]
180
+
154
181
  try {
155
182
  const filters = this.searchForm.queryFilters
156
183
  const pagination = { page, limit }
@@ -183,6 +210,11 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
183
210
  ...data
184
211
  }
185
212
 
213
+ let selectedDate = this._monthInput.valueAsDate
214
+
215
+ this._block = this._blockSelector.options[this._blockSelector.selectedIndex].text
216
+ this._month = `${monthNames[selectedDate.getMonth()]} ${selectedDate.getFullYear().toString()}`
217
+ this.updateContext()
186
218
  return data
187
219
  } catch (e) {
188
220
  console.log(e)
@@ -209,6 +241,19 @@ class ReportDailyStaffHarvest extends connect(store)(localize(i18next)(PageView)
209
241
  }
210
242
  })
211
243
 
244
+ let yearMonth = (this.searchForm.queryFilters.find(x => x.name == 'month')?.value || this._monthSearch).split('-')
245
+ let columns = [...this.reportConfig.columns]
246
+ for (
247
+ let start = new Date(yearMonth[0], yearMonth[1] - 1, 1);
248
+ start < new Date(yearMonth[0], yearMonth[1], 1);
249
+ start.setDate(start.getDate() + 1)
250
+ ) {
251
+ let day = start.getDate().toString()
252
+
253
+ for (let index = 0; index < massagedData.length; index++) {
254
+ massagedData[index][day] = massagedData[index][day] ? massagedData[index][day] : '-'
255
+ }
256
+ }
212
257
  return massagedData
213
258
  }
214
259