@things-factory/operato-pms 3.7.6 → 3.8.14

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