@things-factory/operato-pms 3.8.0 → 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.
- package/client/bootstrap.js +20 -7
- package/client/component/block-selector-popup.js +125 -24
- package/client/component/driver-selector-popup.js +223 -0
- package/client/component/mill-selector-popup.js +200 -0
- package/client/component/tracked-plantation-setting.js +113 -0
- package/client/component/truck-selector-popup.js +202 -0
- package/client/menu.js +34 -2
- package/client/pages/constants/index.js +1 -0
- package/client/pages/constants/organization.js +5 -0
- package/client/pages/dispatchment/daily-dispatch-detail.js +57 -18
- package/client/pages/dispatchment/dispatchment-create-record.js +140 -13
- package/client/pages/dispatchment/dispatchment-list.js +26 -34
- package/client/pages/harvesting/daily-harvesting-detail.js +55 -18
- package/client/pages/harvesting/edit-harvesting-record.js +89 -23
- package/client/pages/harvesting/harvesting-create-record.js +102 -16
- package/client/pages/harvesting/harvesting-list.js +58 -12
- package/client/pages/inventory/inventory-field-bunches.js +6 -4
- package/client/pages/loading/daily-loading-detail.js +47 -93
- package/client/pages/loading/edit-loading-record.js +75 -294
- package/client/pages/loading/loading-create-record.js +52 -329
- package/client/pages/loading/loading-list.js +20 -83
- package/client/pages/master/block.js +1 -0
- package/client/pages/master/company.js +26 -13
- package/client/pages/master/home.js +67 -65
- package/client/pages/master/ramp.js +1 -0
- package/client/pages/master/staff.js +54 -3
- package/client/pages/master/truck.js +416 -0
- package/client/pages/report/home.js +72 -65
- package/client/pages/report/report-daily-ffb-dispatch-and-production.js +393 -0
- package/client/pages/report/report-daily-production.js +38 -6
- package/client/pages/report/report-daily-staff-harvest.js +50 -5
- package/client/pages/report/report-ffb-tonnage-between-individual-block.js +393 -0
- package/client/pages/report/report-monthly-ffb-sale.js +413 -0
- package/client/pages/report/report-monthly-production.js +33 -4
- package/client/pages/report/report-yearly-production.js +24 -8
- package/client/pages/setting/home.js +107 -0
- package/client/pages/setting/plantation-setting.js +109 -0
- package/client/route.js +25 -0
- package/dist-server/constants/index.js +1 -0
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/organization.js +9 -0
- package/dist-server/constants/organization.js.map +1 -0
- package/dist-server/controllers/render-dispatchment.js +1 -1
- package/dist-server/controllers/render-dispatchment.js.map +1 -1
- package/dist-server/entities/daily-dispatch.js +19 -4
- package/dist-server/entities/daily-dispatch.js.map +1 -1
- package/dist-server/entities/daily-harvest-detail.js +9 -11
- package/dist-server/entities/daily-harvest-detail.js.map +1 -1
- package/dist-server/entities/daily-harvest.js +16 -6
- package/dist-server/entities/daily-harvest.js.map +1 -1
- package/dist-server/entities/daily-loading-detail.js +14 -6
- package/dist-server/entities/daily-loading-detail.js.map +1 -1
- package/dist-server/entities/daily-loading.js +3 -11
- package/dist-server/entities/daily-loading.js.map +1 -1
- package/dist-server/entities/index.js +7 -1
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/entities/organization-staff.js +5 -1
- package/dist-server/entities/organization-staff.js.map +1 -1
- package/dist-server/entities/plantation-inventory.js +4 -10
- package/dist-server/entities/plantation-inventory.js.map +1 -1
- package/dist-server/entities/plantation-setting.js +76 -0
- package/dist-server/entities/plantation-setting.js.map +1 -0
- package/dist-server/entities/truck.js +77 -0
- package/dist-server/entities/truck.js.map +1 -0
- package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js +13 -2
- package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js +25 -11
- package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js +3 -2
- package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js +3 -1
- package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js +21 -2
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js +8 -2
- package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js +4 -6
- package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js +20 -54
- package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js +17 -105
- package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/dashboard-query.js +82 -0
- package/dist-server/graphql/resolvers/dashboard/dashboard-query.js.map +1 -0
- package/dist-server/graphql/resolvers/dashboard/index.js +8 -0
- package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -0
- package/dist-server/graphql/resolvers/index.js +9 -6
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js +7 -3
- package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js.map +1 -1
- package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js +12 -0
- package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js +13 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js +16 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/index.js +15 -0
- package/dist-server/graphql/resolvers/plantation-setting/index.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js +33 -0
- package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js +31 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js +16 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/report/daily-production-reports.js +46 -33
- package/dist-server/graphql/resolvers/report/daily-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js +21 -10
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/index.js +4 -1
- package/dist-server/graphql/resolvers/report/index.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js +89 -0
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js +89 -0
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js +87 -0
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js +46 -31
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js +38 -28
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/truck/delete-trucks.js +18 -0
- package/dist-server/graphql/resolvers/truck/delete-trucks.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/index.js +12 -0
- package/dist-server/graphql/resolvers/truck/index.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/truck-query.js +46 -0
- package/dist-server/graphql/resolvers/truck/truck-query.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/update-multiple-truck.js +40 -0
- package/dist-server/graphql/resolvers/truck/update-multiple-truck.js.map +1 -0
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/index.js +6 -1
- package/dist-server/graphql/types/daily-dispatch/index.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js +5 -2
- package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/daily-harvest.js +3 -0
- package/dist-server/graphql/types/daily-harvest/daily-harvest.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js +4 -1
- package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/daily-loading-patch.js +0 -2
- package/dist-server/graphql/types/daily-loading/daily-loading-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/daily-loading.js +0 -2
- package/dist-server/graphql/types/daily-loading/daily-loading.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/new-daily-loading.js +0 -2
- package/dist-server/graphql/types/daily-loading/new-daily-loading.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js +6 -3
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js +3 -0
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js +6 -3
- package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js.map +1 -1
- package/dist-server/graphql/types/dashboard/bunches-count.js +15 -0
- package/dist-server/graphql/types/dashboard/bunches-count.js.map +1 -0
- package/dist-server/graphql/types/dashboard/index.js +32 -0
- package/dist-server/graphql/types/dashboard/index.js.map +1 -0
- package/dist-server/graphql/types/dashboard/productions-overview.js +15 -0
- package/dist-server/graphql/types/dashboard/productions-overview.js.map +1 -0
- package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js +14 -0
- package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js.map +1 -0
- package/dist-server/graphql/types/dashboard/tonnage-production.js +17 -0
- package/dist-server/graphql/types/dashboard/tonnage-production.js.map +1 -0
- package/dist-server/graphql/types/dashboard/yield-production.js +17 -0
- package/dist-server/graphql/types/dashboard/yield-production.js.map +1 -0
- package/dist-server/graphql/types/index.js +9 -6
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/organization-staff/organization-staff-patch.js +2 -0
- package/dist-server/graphql/types/organization-staff/organization-staff-patch.js.map +1 -1
- package/dist-server/graphql/types/organization-staff/organization-staff.js +3 -0
- package/dist-server/graphql/types/organization-staff/organization-staff.js.map +1 -1
- package/dist-server/graphql/types/plantation-setting/index.js +36 -0
- package/dist-server/graphql/types/plantation-setting/index.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js +16 -0
- package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js +14 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js +18 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting.js +22 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting.js.map +1 -0
- package/dist-server/graphql/types/report/index.js +20 -0
- package/dist-server/graphql/types/report/index.js.map +1 -1
- package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report.js +19 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js +25 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report.js +24 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report.js.map +1 -0
- package/dist-server/graphql/types/truck/index.js +33 -0
- package/dist-server/graphql/types/truck/index.js.map +1 -0
- package/dist-server/graphql/types/truck/new-truck.js +14 -0
- package/dist-server/graphql/types/truck/new-truck.js.map +1 -0
- package/dist-server/graphql/types/truck/truck-list.js +14 -0
- package/dist-server/graphql/types/truck/truck-list.js.map +1 -0
- package/dist-server/graphql/types/truck/truck-patch.js +17 -0
- package/dist-server/graphql/types/truck/truck-patch.js.map +1 -0
- package/dist-server/graphql/types/truck/truck.js +22 -0
- package/dist-server/graphql/types/truck/truck.js.map +1 -0
- package/package.json +2 -2
- package/server/constants/index.ts +1 -0
- package/server/constants/organization.ts +5 -0
- package/server/controllers/render-dispatchment.ts +1 -1
- package/server/entities/daily-dispatch.ts +21 -5
- package/server/entities/daily-harvest-detail.ts +10 -11
- package/server/entities/daily-harvest.ts +16 -7
- package/server/entities/daily-loading-detail.ts +14 -6
- package/server/entities/daily-loading.ts +7 -11
- package/server/entities/index.ts +6 -0
- package/server/entities/organization-staff.ts +6 -1
- package/server/entities/plantation-inventory.ts +6 -10
- package/server/entities/plantation-setting.ts +60 -0
- package/server/entities/truck.ts +58 -0
- package/server/graphql/resolvers/daily-dispatch/daily-dispatch-query.ts +15 -2
- package/server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.ts +40 -14
- package/server/graphql/resolvers/daily-dispatch/update-daily-dispatch.ts +6 -2
- package/server/graphql/resolvers/daily-harvest/daily-harvest-query.ts +7 -2
- package/server/graphql/resolvers/daily-harvest/generate-daily-harvest.ts +50 -4
- package/server/graphql/resolvers/daily-harvest/update-daily-harvest.ts +12 -2
- package/server/graphql/resolvers/daily-loading/daily-loading-query.ts +6 -6
- package/server/graphql/resolvers/daily-loading/generate-daily-loading.ts +27 -109
- package/server/graphql/resolvers/daily-loading/update-daily-loading.ts +27 -213
- package/server/graphql/resolvers/dashboard/dashboard-query.ts +96 -0
- package/server/graphql/resolvers/dashboard/index.ts +5 -0
- package/server/graphql/resolvers/index.ts +10 -6
- package/server/graphql/resolvers/organization-staff/organization-staff-query.ts +13 -4
- package/server/graphql/resolvers/plantation-setting/create-plantation-setting.ts +16 -0
- package/server/graphql/resolvers/plantation-setting/delete-plantation-setting.ts +13 -0
- package/server/graphql/resolvers/plantation-setting/delete-plantation-settings.ts +16 -0
- package/server/graphql/resolvers/plantation-setting/index.ts +19 -0
- package/server/graphql/resolvers/plantation-setting/plantation-setting-query.ts +38 -0
- package/server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.ts +46 -0
- package/server/graphql/resolvers/plantation-setting/update-plantation-setting.ts +19 -0
- package/server/graphql/resolvers/report/daily-production-reports.ts +55 -44
- package/server/graphql/resolvers/report/daily-staff-harvest-reports.ts +28 -20
- package/server/graphql/resolvers/report/index.ts +7 -1
- package/server/graphql/resolvers/report/monthly-block-dispatch-reports.ts +112 -0
- package/server/graphql/resolvers/report/monthly-dispatch-summary-reports.ts +110 -0
- package/server/graphql/resolvers/report/monthly-ffb-sale-reports.ts +107 -0
- package/server/graphql/resolvers/report/monthly-production-reports.ts +54 -40
- package/server/graphql/resolvers/report/yearly-production-reports.ts +43 -38
- package/server/graphql/resolvers/truck/delete-trucks.ts +21 -0
- package/server/graphql/resolvers/truck/index.ts +12 -0
- package/server/graphql/resolvers/truck/truck-query.ts +52 -0
- package/server/graphql/resolvers/truck/update-multiple-truck.ts +55 -0
- package/server/graphql/types/daily-dispatch/daily-dispatch-patch.ts +4 -1
- package/server/graphql/types/daily-dispatch/daily-dispatch.ts +4 -1
- package/server/graphql/types/daily-dispatch/index.ts +6 -1
- package/server/graphql/types/daily-dispatch/new-daily-dispatch.ts +4 -1
- package/server/graphql/types/daily-harvest/daily-harvest-patch.ts +5 -2
- package/server/graphql/types/daily-harvest/daily-harvest.ts +3 -0
- package/server/graphql/types/daily-harvest/new-daily-harvest.ts +4 -1
- package/server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.ts +1 -0
- package/server/graphql/types/daily-harvest-detail/daily-harvest-detail.ts +1 -0
- package/server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.ts +1 -0
- package/server/graphql/types/daily-loading/daily-loading-patch.ts +0 -2
- package/server/graphql/types/daily-loading/daily-loading.ts +0 -2
- package/server/graphql/types/daily-loading/new-daily-loading.ts +0 -2
- package/server/graphql/types/daily-loading-detail/daily-loading-detail-patch.ts +6 -3
- package/server/graphql/types/daily-loading-detail/daily-loading-detail.ts +3 -0
- package/server/graphql/types/daily-loading-detail/new-daily-loading-detail.ts +6 -3
- package/server/graphql/types/dashboard/bunches-count.ts +9 -0
- package/server/graphql/types/dashboard/index.ts +17 -0
- package/server/graphql/types/dashboard/productions-overview.ts +9 -0
- package/server/graphql/types/dashboard/tonnage-bunches-inventories.ts +8 -0
- package/server/graphql/types/dashboard/tonnage-production.ts +11 -0
- package/server/graphql/types/dashboard/yield-production.ts +11 -0
- package/server/graphql/types/index.ts +10 -6
- package/server/graphql/types/organization-staff/organization-staff-patch.ts +2 -0
- package/server/graphql/types/organization-staff/organization-staff.ts +3 -0
- package/server/graphql/types/plantation-setting/index.ts +21 -0
- package/server/graphql/types/plantation-setting/new-plantation-setting.ts +10 -0
- package/server/graphql/types/plantation-setting/plantation-setting-list.ts +8 -0
- package/server/graphql/types/plantation-setting/plantation-setting-patch.ts +12 -0
- package/server/graphql/types/plantation-setting/plantation-setting.ts +16 -0
- package/server/graphql/types/report/index.ts +20 -0
- package/server/graphql/types/report/monthly-block-dispatch-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-block-dispatch-report.ts +13 -0
- package/server/graphql/types/report/monthly-dispatch-summary-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-dispatch-summary-report.ts +19 -0
- package/server/graphql/types/report/monthly-ffb-sale-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-ffb-sale-report.ts +18 -0
- package/server/graphql/types/truck/index.ts +18 -0
- package/server/graphql/types/truck/new-truck.ts +8 -0
- package/server/graphql/types/truck/truck-list.ts +8 -0
- package/server/graphql/types/truck/truck-patch.ts +11 -0
- package/server/graphql/types/truck/truck.ts +16 -0
- package/things-factory.config.js +27 -1
- package/translations/en.json +78 -16
- package/translations/ko.json +77 -48
- package/translations/ms.json +74 -45
- package/translations/zh.json +77 -48
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ListParam } from '@things-factory/shell'
|
|
2
1
|
import { EntityManager } from 'typeorm'
|
|
3
2
|
|
|
3
|
+
import { ListParam } from '@things-factory/shell'
|
|
4
|
+
|
|
4
5
|
export const monthlyProductionReports = {
|
|
5
6
|
async monthlyProductionReports(_: any, params: ListParam, context: any) {
|
|
6
7
|
try {
|
|
@@ -25,79 +26,92 @@ export const monthlyProductionReports = {
|
|
|
25
26
|
String(toDate.getDate()).padStart(2, '0')
|
|
26
27
|
].join('-')
|
|
27
28
|
|
|
29
|
+
await tx.query(`
|
|
30
|
+
CREATE TEMP TABLE temp_blocks on commit drop AS (
|
|
31
|
+
WITH RECURSIVE b AS (
|
|
32
|
+
SELECT b.id AS block_id, * FROM blocks b
|
|
33
|
+
WHERE b.deleted_at IS null
|
|
34
|
+
UNION ALL
|
|
35
|
+
SELECT b.id AS block_id, cb.* FROM blocks cb
|
|
36
|
+
INNER JOIN b ON b.id = cb.parent_block_id
|
|
37
|
+
WHERE cb.deleted_at IS null
|
|
38
|
+
)
|
|
39
|
+
SELECT block_id, id, name FROM b GROUP BY block_id, id, name ORDER BY block_id, id, name
|
|
40
|
+
);
|
|
41
|
+
`)
|
|
42
|
+
|
|
28
43
|
await tx.query(
|
|
29
44
|
`
|
|
30
|
-
create temp table temp_monthly_production_data as (
|
|
45
|
+
create temp table temp_monthly_production_data on commit drop as (
|
|
31
46
|
select b.id, b.name as "block",
|
|
32
47
|
coalesce(harvest.total_harvester, 0) as "totalHarvester",
|
|
33
48
|
coalesce(harvest.out_turn,0) as "totalOutTurn",
|
|
34
49
|
coalesce(harvest.days_worked,0) as "daysWorked",
|
|
35
|
-
round(coalesce((harvest.
|
|
36
|
-
round(coalesce((
|
|
37
|
-
round(
|
|
38
|
-
round(case when loading.
|
|
39
|
-
round(
|
|
40
|
-
round(coalesce((harvest.
|
|
41
|
-
round(coalesce((
|
|
42
|
-
|
|
43
|
-
coalesce(block_details.total_hectarage::
|
|
44
|
-
round(coalesce((
|
|
45
|
-
round(coalesce((harvest.
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
coalesce(block_details.total_stand::text, '-') as "totalStand"
|
|
50
|
+
round(coalesce((harvest.total_bunch_harvested),0)::DECIMAL, 1)::text as "totalBunchHarvested",
|
|
51
|
+
round(coalesce((loading.total_weight_loaded),0)::DECIMAL, 4)::TEXT as "production",
|
|
52
|
+
round(case when loading.total_weight_loaded <> 0 then (loading.total_bunch_loaded / loading.total_weight_loaded) else '0' end::DECIMAL, 4)::TEXT as "bunchesPerTon",
|
|
53
|
+
round(case when loading.total_bunch_loaded <> 0 then (loading.total_weight_loaded / loading.total_bunch_loaded) else '0' end::DECIMAL, 4)::TEXT as "bunchesWt",
|
|
54
|
+
round(coalesce((harvest.total_bunch_harvested / harvest.total_harvest_coverage),0)::DECIMAL, 4)::TEXT as "bunchesPerHectar",
|
|
55
|
+
round(coalesce((harvest.total_harvest_coverage / block_details.total_hectarage),0)::DECIMAL, 4)::TEXT as "harvestingRd",
|
|
56
|
+
round(coalesce((loading.total_weight_loaded / harvest.out_turn),0)::DECIMAL, 4)::TEXT as "productivities",
|
|
57
|
+
coalesce(block_details.total_hectarage::text, '') as "hectarage",
|
|
58
|
+
round(coalesce((loading.total_bunch_loaded / block_details.total_hectarage),0)::DECIMAL, 4)::TEXT as "yieldPerHectar",
|
|
59
|
+
round(coalesce((harvest.total_harvest_coverage / harvest.days_worked),0)::DECIMAL, 4)::TEXT as "coveragePerDay",
|
|
60
|
+
round(coalesce((harvest.total_bunch_harvested / block_details.total_stand),0)::DECIMAL, 4)::TEXT as "bunchesPerPalm",
|
|
61
|
+
coalesce(block_details.year_planted::text, '') as "yearPlanted",
|
|
62
|
+
coalesce(block_details.total_stand::text, '') as "totalStand",
|
|
63
|
+
'' as "rainfall"
|
|
50
64
|
from blocks b
|
|
51
65
|
left join(
|
|
52
|
-
select
|
|
66
|
+
select blk.block_id,
|
|
53
67
|
count(distinct dhd.organization_staff_id) as total_harvester,
|
|
54
68
|
count(dhd.id) as out_turn,
|
|
55
69
|
count(distinct concat(dh.block_id, dh.harvest_date)) as days_worked,
|
|
56
70
|
sum(dhd.total_bunch_harvested) as total_bunch_harvested,
|
|
57
71
|
sum(dh.coverage) as total_harvest_coverage
|
|
58
72
|
from daily_harvests dh
|
|
73
|
+
inner join temp_blocks blk on blk.id = dh.block_id
|
|
59
74
|
inner join daily_harvest_details dhd on dhd.daily_harvest_id = dh.id
|
|
60
75
|
where dh.harvest_date::timestamp between $1::timestamp and $2::timestamp
|
|
61
|
-
group by
|
|
76
|
+
group by blk.block_id
|
|
62
77
|
) as harvest on harvest.block_id = b.id
|
|
63
78
|
left join(
|
|
64
|
-
select
|
|
79
|
+
select blk.block_id, sum(total_weight) as total_weight_loaded, sum(total_bunch) as total_bunch_loaded
|
|
65
80
|
from daily_loadings dl
|
|
81
|
+
inner join temp_blocks blk on blk.id = dl.block_id
|
|
66
82
|
inner join daily_loading_details dld on dld.daily_loading_id = dl.id
|
|
67
83
|
where dl.loading_date::timestamp between $1::timestamp and $2::timestamp
|
|
68
|
-
group by
|
|
84
|
+
group by blk.block_id
|
|
69
85
|
) as loading on loading.block_id = b.id
|
|
70
86
|
left join(
|
|
71
|
-
SELECT DISTINCT ON (block_id)
|
|
72
|
-
*
|
|
87
|
+
SELECT DISTINCT ON (blk.block_id) bd.*
|
|
73
88
|
FROM block_details bd
|
|
89
|
+
inner join temp_blocks blk on blk.id = bd.block_id
|
|
74
90
|
where valid_from::timestamp <= $1::timestamp
|
|
75
|
-
ORDER
|
|
91
|
+
ORDER BY blk.block_id, valid_from desc
|
|
76
92
|
) block_details on block_details.block_id = b.id
|
|
77
93
|
order by b.name
|
|
78
94
|
)`,
|
|
79
95
|
[fromDateString, toDateString]
|
|
80
96
|
)
|
|
81
97
|
|
|
82
|
-
const result: any = await tx.query(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
`
|
|
86
|
-
)
|
|
98
|
+
const result: any = await tx.query(`
|
|
99
|
+
select * from temp_monthly_production_data dt
|
|
100
|
+
`)
|
|
87
101
|
|
|
88
|
-
const total: any = await tx.query(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`
|
|
92
|
-
)
|
|
102
|
+
const total: any = await tx.query(`
|
|
103
|
+
select count(*) from temp_monthly_production_data
|
|
104
|
+
`)
|
|
93
105
|
|
|
94
|
-
await tx.query(
|
|
95
|
-
`
|
|
96
|
-
drop table temp_monthly_production_data
|
|
97
|
-
`
|
|
98
|
-
)
|
|
99
106
|
|
|
100
|
-
return {
|
|
107
|
+
return {
|
|
108
|
+
items: result.map(itm => {
|
|
109
|
+
return {
|
|
110
|
+
...itm,
|
|
111
|
+
avgOutTurn: ((parseFloat(itm.totalOutTurn) / parseFloat(itm.daysWorked)) || 0).toFixed(4)
|
|
112
|
+
}
|
|
113
|
+
}), total: total[0].count
|
|
114
|
+
}
|
|
101
115
|
} catch (error) {
|
|
102
116
|
throw error
|
|
103
117
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ListParam } from '@things-factory/shell'
|
|
2
1
|
import { EntityManager } from 'typeorm'
|
|
3
2
|
|
|
3
|
+
import { ListParam } from '@things-factory/shell'
|
|
4
|
+
|
|
4
5
|
export const yearlyProductionReports = {
|
|
5
6
|
async yearlyProductionReports(_: any, params: ListParam, context: any) {
|
|
6
7
|
try {
|
|
@@ -15,80 +16,84 @@ export const yearlyProductionReports = {
|
|
|
15
16
|
|
|
16
17
|
let nextYearDateString = [String(fromDate.getFullYear() + 1).toString(), '01', '01'].join('-')
|
|
17
18
|
|
|
19
|
+
await tx.query(`
|
|
20
|
+
CREATE TEMP TABLE temp_blocks on commit drop AS (
|
|
21
|
+
WITH RECURSIVE b AS (
|
|
22
|
+
SELECT b.id AS block_id, * FROM blocks b
|
|
23
|
+
WHERE b.deleted_at IS null
|
|
24
|
+
UNION ALL
|
|
25
|
+
SELECT b.id AS block_id, cb.* FROM blocks cb
|
|
26
|
+
INNER JOIN b ON b.id = cb.parent_block_id
|
|
27
|
+
WHERE cb.deleted_at IS null
|
|
28
|
+
)
|
|
29
|
+
SELECT block_id, id, name FROM b GROUP BY block_id, id, name ORDER BY block_id, id, name
|
|
30
|
+
);
|
|
31
|
+
`)
|
|
32
|
+
|
|
18
33
|
await tx.query(
|
|
19
34
|
`
|
|
20
|
-
create temp table temp_yearly_production_data as (
|
|
35
|
+
create temp table temp_yearly_production_data on commit drop as (
|
|
21
36
|
select
|
|
22
37
|
b.name as "block",
|
|
23
38
|
coalesce(bd.year_planted::varchar, '-') as "yearPlanted",
|
|
24
|
-
'
|
|
25
|
-
coalesce(last_trans.total_ffb, 0) as "totalLastFfb",
|
|
26
|
-
'
|
|
27
|
-
coalesce(trans.total_ffb, 0) as "totalFfb",
|
|
28
|
-
case when last_bd.matured_hectarage is not null then coalesce(last_trans.total_ffb, 0) / last_bd.matured_hectarage else 0 end as "lastYieldPerHectarage",
|
|
29
|
-
case when bd.matured_hectarage is not null then coalesce(trans.total_ffb, 0) / bd.matured_hectarage else 0 end as "yieldPerHectarage",
|
|
39
|
+
'' as "estimatedLastFfb",
|
|
40
|
+
round(coalesce(last_trans.total_ffb, 0)::DECIMAL, 4)::TEXT as "totalLastFfb",
|
|
41
|
+
'' as "estimatedFfb",
|
|
42
|
+
round(coalesce(trans.total_ffb, 0)::DECIMAL, 4)::TEXT as "totalFfb",
|
|
43
|
+
round((case when last_bd.matured_hectarage is not null AND last_bd.matured_hectarage <> 0 then coalesce(last_trans.total_ffb, 0) / last_bd.matured_hectarage else 0 end)::DECIMAL, 4)::TEXT as "lastYieldPerHectarage",
|
|
44
|
+
round((case when bd.matured_hectarage is not null AND bd.matured_hectarage <> 0 then coalesce(trans.total_ffb, 0) / bd.matured_hectarage else 0 end)::DECIMAL, 4)::TEXT as "yieldPerHectarage",
|
|
30
45
|
coalesce(bd.matured_hectarage, 0) as "maturedHectarage",
|
|
31
46
|
coalesce(harvest.total_coverage, 0) as "totalCoverage",
|
|
32
|
-
case when bd.matured_hectarage is not null then coalesce(harvest.total_coverage, 0)/ bd.matured_hectarage else 0 end as "totalHarvestingRd",
|
|
33
|
-
(1 - abs(case when last_trans.total_ffb is not null then coalesce(trans.total_ffb, 0)/last_trans.total_ffb else 1 end)) * 100 as "actualAgainstLast"
|
|
47
|
+
round((case when bd.matured_hectarage is not null AND bd.matured_hectarage <> 0 then coalesce(harvest.total_coverage, 0)/ bd.matured_hectarage else 0 end)::DECIMAL, 4)::TEXT as "totalHarvestingRd",
|
|
48
|
+
round(((1 - abs(case when last_trans.total_ffb is not null AND last_trans.total_ffb <> 0 then coalesce(trans.total_ffb, 0)/last_trans.total_ffb else 1 end)) * 100)::DECIMAL, 4)::TEXT as "actualAgainstLast"
|
|
34
49
|
from blocks b
|
|
35
50
|
left join (
|
|
36
|
-
SELECT DISTINCT ON (block_id)
|
|
37
|
-
*
|
|
51
|
+
SELECT DISTINCT ON (block_id) *
|
|
38
52
|
FROM block_details bd
|
|
39
53
|
where valid_from < $3::timestamp
|
|
40
54
|
ORDER BY block_id, valid_from desc
|
|
41
55
|
) bd on bd.block_id = b.id
|
|
42
56
|
left join (
|
|
43
|
-
SELECT DISTINCT ON (block_id)
|
|
44
|
-
*
|
|
57
|
+
SELECT DISTINCT ON (block_id) *
|
|
45
58
|
FROM block_details bd
|
|
46
59
|
where valid_from < $2::timestamp
|
|
47
60
|
ORDER BY block_id, valid_from desc
|
|
48
61
|
) last_bd on last_bd.block_id = b.id
|
|
49
62
|
left join (
|
|
50
|
-
select
|
|
51
|
-
from record_transactions t
|
|
63
|
+
select blk.block_id, sum(ramp_weight) as total_ffb
|
|
64
|
+
from record_transactions t
|
|
65
|
+
inner join temp_blocks blk on blk.id = t.block_id
|
|
52
66
|
where transaction_type = 'LOADING'
|
|
53
67
|
and transaction_date::timestamp between $2::timestamp and $3::timestamp
|
|
54
|
-
group by block_id
|
|
68
|
+
group by blk.block_id
|
|
55
69
|
) trans on trans.block_id = b.id
|
|
56
70
|
left join (
|
|
57
|
-
select
|
|
71
|
+
select blk.block_id, sum(ramp_weight) as total_ffb
|
|
58
72
|
from record_transactions t
|
|
73
|
+
inner join temp_blocks blk on blk.id = t.block_id
|
|
59
74
|
where transaction_type = 'LOADING'
|
|
60
75
|
and transaction_date::timestamp between $1::timestamp and $2::timestamp
|
|
61
|
-
group by block_id
|
|
76
|
+
group by blk.block_id
|
|
62
77
|
) last_trans on last_trans.block_id = b.id
|
|
63
78
|
left join (
|
|
64
|
-
select
|
|
79
|
+
select blk.block_id, sum(coverage) as total_coverage
|
|
65
80
|
from daily_harvests dh
|
|
81
|
+
inner join temp_blocks blk on blk.id = dh.block_id
|
|
66
82
|
where harvest_date::timestamp between $2::timestamp and $3::timestamp
|
|
67
|
-
group by block_id
|
|
83
|
+
group by blk.block_id
|
|
68
84
|
) harvest on harvest.block_id = b.id
|
|
69
|
-
where b.has_children = false
|
|
70
85
|
order by b.name
|
|
71
86
|
)`,
|
|
72
87
|
[pastYearDateString, thisYearDateString, nextYearDateString]
|
|
73
88
|
)
|
|
74
89
|
|
|
75
|
-
const result: any = await tx.query(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`
|
|
79
|
-
)
|
|
90
|
+
const result: any = await tx.query(`
|
|
91
|
+
select * from temp_yearly_production_data dt
|
|
92
|
+
`)
|
|
80
93
|
|
|
81
|
-
const total: any = await tx.query(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
await tx.query(
|
|
88
|
-
`
|
|
89
|
-
drop table temp_yearly_production_data
|
|
90
|
-
`
|
|
91
|
-
)
|
|
94
|
+
const total: any = await tx.query(`
|
|
95
|
+
select count(*) from temp_yearly_production_data
|
|
96
|
+
`)
|
|
92
97
|
|
|
93
98
|
return { items: result, total: total[0].count }
|
|
94
99
|
} catch (error) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { In } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { Truck } from '../../../entities'
|
|
4
|
+
|
|
5
|
+
export const deleteTrucks = {
|
|
6
|
+
async deleteTrucks(_: any, { ids }, context: any) {
|
|
7
|
+
const { domain, tx } = context.state
|
|
8
|
+
|
|
9
|
+
await tx.getRepository(Truck).update(
|
|
10
|
+
{
|
|
11
|
+
domain,
|
|
12
|
+
id: In(ids)
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
deletedAt: new Date()
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
return true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { deleteTrucks } from './delete-trucks'
|
|
2
|
+
import { Query, Truck } from './truck-query'
|
|
3
|
+
import { updateMultipleTruck } from './update-multiple-truck'
|
|
4
|
+
|
|
5
|
+
export const TruckResolver = {
|
|
6
|
+
Truck,
|
|
7
|
+
Query,
|
|
8
|
+
Mutation: {
|
|
9
|
+
...updateMultipleTruck,
|
|
10
|
+
...deleteTrucks
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EntityManager, getRepository } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
import { User } from '@things-factory/auth-base'
|
|
4
|
+
import { buildQuery, Domain, ListParam } from '@things-factory/shell'
|
|
5
|
+
|
|
6
|
+
import { Truck as TruckEntity } from '../../../entities'
|
|
7
|
+
|
|
8
|
+
export const Query = {
|
|
9
|
+
async truck(_: any, { name }, context: any) {
|
|
10
|
+
const { domain, tx } = context.state
|
|
11
|
+
const repository = await tx.getRepository(TruckEntity)
|
|
12
|
+
|
|
13
|
+
return await repository.findOne({
|
|
14
|
+
where: { domain, name },
|
|
15
|
+
relations: ['domain', 'organization', 'creator', 'updater']
|
|
16
|
+
})
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
async trucks(_: any, params: ListParam, context: any) {
|
|
20
|
+
const { tx }: { tx: EntityManager } = context.state
|
|
21
|
+
|
|
22
|
+
const queryBuilder = await tx.getRepository(TruckEntity).createQueryBuilder()
|
|
23
|
+
buildQuery(queryBuilder, params, context)
|
|
24
|
+
|
|
25
|
+
queryBuilder
|
|
26
|
+
.leftJoinAndSelect('Truck.domain', 'Domain')
|
|
27
|
+
.leftJoinAndSelect('Truck.organization', 'Organization')
|
|
28
|
+
.leftJoinAndSelect('Truck.creator', 'Creator')
|
|
29
|
+
.leftJoinAndSelect('Truck.updater', 'Updater')
|
|
30
|
+
|
|
31
|
+
if (params.filters?.length > 0) queryBuilder.andWhere('Truck.deletedAt IS NULL')
|
|
32
|
+
else queryBuilder.where('Truck.deletedAt IS NULL')
|
|
33
|
+
|
|
34
|
+
const [items, total] = await queryBuilder.getManyAndCount()
|
|
35
|
+
|
|
36
|
+
return { items, total }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const Truck = {
|
|
41
|
+
async domain(truck) {
|
|
42
|
+
return await getRepository(Domain).findOne(truck.domainId)
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
async creator(truck) {
|
|
46
|
+
return await getRepository(User).findOne(truck.creatorId)
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
async updater(truck) {
|
|
50
|
+
return await getRepository(User).findOne(truck.updaterId)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Organization, Truck } from '../../../entities'
|
|
2
|
+
|
|
3
|
+
export const updateMultipleTruck = {
|
|
4
|
+
async updateMultipleTruck(_: any, { patches }, context: any) {
|
|
5
|
+
const { domain, user, tx } = context.state
|
|
6
|
+
|
|
7
|
+
let results = []
|
|
8
|
+
const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')
|
|
9
|
+
const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')
|
|
10
|
+
const truckRepo = tx.getRepository(Truck)
|
|
11
|
+
|
|
12
|
+
if (_createRecords.length > 0) {
|
|
13
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
14
|
+
const newRecord = _createRecords[i]
|
|
15
|
+
|
|
16
|
+
const organization = await tx.getRepository(Organization).findOneOrFail({
|
|
17
|
+
where: { id: newRecord?.organization?.id }
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const result = await truckRepo.save({
|
|
21
|
+
...newRecord,
|
|
22
|
+
domain: domain,
|
|
23
|
+
creator: user,
|
|
24
|
+
updater: user
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
results.push({ ...result, cuFlag: '+' })
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (_updateRecords.length > 0) {
|
|
32
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
33
|
+
let newRecord = _updateRecords[i]
|
|
34
|
+
const truck = await truckRepo.findOne({ domain, id: newRecord.id })
|
|
35
|
+
|
|
36
|
+
if (newRecord?.organization?.id) {
|
|
37
|
+
const organization = await tx.getRepository(Organization).findOneOrFail({
|
|
38
|
+
where: { id: newRecord?.organization?.id }
|
|
39
|
+
})
|
|
40
|
+
newRecord = { ...newRecord, organization }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const result = await truckRepo.save({
|
|
44
|
+
...truck,
|
|
45
|
+
...newRecord,
|
|
46
|
+
updater: user
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
results.push({ ...result, cuFlag: 'M' })
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return results
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -5,10 +5,13 @@ export const DailyDispatchPatch = gql`
|
|
|
5
5
|
id: String
|
|
6
6
|
name: String
|
|
7
7
|
description: String
|
|
8
|
+
transport: ObjectRef
|
|
8
9
|
transportNo: String
|
|
10
|
+
chitNo: String
|
|
11
|
+
percentage: Float
|
|
9
12
|
driverIdentification: String
|
|
10
13
|
totalTonnageRelease: Float
|
|
11
|
-
dispatchTo:
|
|
14
|
+
dispatchTo: ObjectRef
|
|
12
15
|
dispatchAt: String
|
|
13
16
|
externalDriver: String
|
|
14
17
|
driver: ObjectRef
|
|
@@ -6,8 +6,11 @@ export const DailyDispatch = gql`
|
|
|
6
6
|
name: String
|
|
7
7
|
domain: Domain
|
|
8
8
|
dispatchAt: String
|
|
9
|
-
dispatchTo:
|
|
9
|
+
dispatchTo: Organization
|
|
10
10
|
driverIdentification: String
|
|
11
|
+
chitNo: String
|
|
12
|
+
percentage: Float
|
|
13
|
+
transport: Truck
|
|
11
14
|
transportNo: String
|
|
12
15
|
driver: OrganizationStaff
|
|
13
16
|
externalDriver: String
|
|
@@ -8,7 +8,12 @@ export * from './new-daily-dispatch'
|
|
|
8
8
|
export const DailyDispatchResolver = gql`
|
|
9
9
|
extend type Mutation {
|
|
10
10
|
generateDailyDispatch(dailyDispatch: NewDailyDispatch!): DailyDispatch @transaction
|
|
11
|
-
updateDailyDispatch(
|
|
11
|
+
updateDailyDispatch(
|
|
12
|
+
name: String!
|
|
13
|
+
chitNo: String
|
|
14
|
+
percentage: Float
|
|
15
|
+
dailyDispatchDetails: [DailyDispatchDetailPatch]
|
|
16
|
+
): DailyDispatch @transaction
|
|
12
17
|
deleteDailyDispatch(name: String!): Boolean @transaction
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -4,10 +4,13 @@ export const NewDailyDispatch = gql`
|
|
|
4
4
|
input NewDailyDispatch {
|
|
5
5
|
name: String
|
|
6
6
|
description: String
|
|
7
|
+
transport: ObjectRef
|
|
7
8
|
transportNo: String
|
|
8
9
|
driverIdentification: String
|
|
9
10
|
totalTonnageRelease: Float
|
|
10
|
-
dispatchTo:
|
|
11
|
+
dispatchTo: ObjectRef!
|
|
12
|
+
chitNo: String
|
|
13
|
+
percentage: Float
|
|
11
14
|
dispatchAt: String!
|
|
12
15
|
driver: ObjectRef
|
|
13
16
|
externalDriver: String
|
|
@@ -3,9 +3,12 @@ import gql from 'graphql-tag'
|
|
|
3
3
|
export const DailyHarvestPatch = gql`
|
|
4
4
|
input DailyHarvestPatch {
|
|
5
5
|
name: String
|
|
6
|
-
harvestDate: String
|
|
7
|
-
harvestingRound: Int
|
|
6
|
+
harvestDate: String
|
|
7
|
+
harvestingRound: Int
|
|
8
8
|
totalBunchHarvested: Float
|
|
9
|
+
yesterdayBalanceBunchInField: Float
|
|
10
|
+
balanceBunchInField: Float
|
|
11
|
+
collectedBunch: Float
|
|
9
12
|
block: String!
|
|
10
13
|
coverage: Float
|
|
11
14
|
rainfall: String
|
|
@@ -9,6 +9,9 @@ export const DailyHarvest = gql`
|
|
|
9
9
|
dailyHarvestDetails: [DailyHarvestDetail]
|
|
10
10
|
harvestDate: String
|
|
11
11
|
totalBunchHarvested: Float
|
|
12
|
+
yesterdayBalanceBunchInField: Float
|
|
13
|
+
balanceBunchInField: Float
|
|
14
|
+
collectedBunch: Float
|
|
12
15
|
harvestingRound: Int
|
|
13
16
|
coverage: Float
|
|
14
17
|
rainfall: String
|
|
@@ -3,8 +3,11 @@ import gql from 'graphql-tag'
|
|
|
3
3
|
export const NewDailyHarvest = gql`
|
|
4
4
|
input NewDailyHarvest {
|
|
5
5
|
harvestDate: String!
|
|
6
|
-
harvestingRound: Int
|
|
6
|
+
harvestingRound: Int
|
|
7
7
|
block: String!
|
|
8
|
+
balanceBunchInField: Float
|
|
9
|
+
yesterdayBalanceBunchInField: Float
|
|
10
|
+
collectedBunch: Float
|
|
8
11
|
coverage: Float
|
|
9
12
|
rainfall: String
|
|
10
13
|
dailyHarvestDetails: [NewDailyHarvestDetail]
|
|
@@ -3,9 +3,12 @@ import gql from 'graphql-tag'
|
|
|
3
3
|
export const DailyLoadingDetailPatch = gql`
|
|
4
4
|
input DailyLoadingDetailPatch {
|
|
5
5
|
name: String
|
|
6
|
-
organizationStaff: ObjectRef
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
organizationStaff: ObjectRef
|
|
7
|
+
truck: ObjectRef
|
|
8
|
+
block: ObjectRef
|
|
9
|
+
ramp: ObjectRef
|
|
10
|
+
totalBunchLoaded: Int
|
|
11
|
+
totalBunchWeight: Float
|
|
9
12
|
remark: String
|
|
10
13
|
}
|
|
11
14
|
`
|
|
@@ -2,9 +2,12 @@ import gql from 'graphql-tag'
|
|
|
2
2
|
|
|
3
3
|
export const NewDailyLoadingDetail = gql`
|
|
4
4
|
input NewDailyLoadingDetail {
|
|
5
|
-
organizationStaff: ObjectRef
|
|
6
|
-
totalBunchLoaded: Int
|
|
7
|
-
totalBunchWeight: Float
|
|
5
|
+
organizationStaff: ObjectRef
|
|
6
|
+
totalBunchLoaded: Int
|
|
7
|
+
totalBunchWeight: Float
|
|
8
|
+
truck: ObjectRef
|
|
9
|
+
block: ObjectRef
|
|
10
|
+
ramp: ObjectRef
|
|
8
11
|
remark: String
|
|
9
12
|
}
|
|
10
13
|
`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
|
|
3
|
+
export * from './tonnage-production'
|
|
4
|
+
export * from './yield-production'
|
|
5
|
+
export * from './tonnage-bunches-inventories'
|
|
6
|
+
export * from './bunches-count'
|
|
7
|
+
export * from './productions-overview'
|
|
8
|
+
|
|
9
|
+
export const DashboardResolver = gql`
|
|
10
|
+
extend type Query {
|
|
11
|
+
monthlyTonnageProductions(blockId: String, yearAndMonth: String!): [TonnageProduction] @transaction
|
|
12
|
+
monthlyYields(blockId: String, yearAndMonth: String!): [YieldProduction] @transaction
|
|
13
|
+
tonnageAndBunchesInventories(something: String): TonnageBunchesInventories @transaction
|
|
14
|
+
weeklyBunchesCount(targetDate: String): [BunchesCount] @transaction
|
|
15
|
+
productionsOverview(something: String): ProductionsOverview @transaction
|
|
16
|
+
}
|
|
17
|
+
`
|