@things-factory/operato-pms 4.3.591 → 4.3.601
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/pages/harvesting/harvesting-create-record.js +5 -2
- package/client/pages/loading/edit-loading-record.js +2 -0
- package/client/pages/report/report-daily-ffb-dispatch-and-production.js +19 -23
- package/dist-server/entities/daily-dispatch.js +2 -2
- package/dist-server/entities/daily-dispatch.js.map +1 -1
- package/dist-server/entities/ramp-block-history.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/delete-daily-dispatch.js +49 -1
- package/dist-server/graphql/resolvers/daily-dispatch/delete-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js +124 -112
- 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 +51 -2
- package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/delete-daily-harvest.js +5 -7
- package/dist-server/graphql/resolvers/daily-harvest/delete-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js +3 -3
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/delete-daily-loading.js +6 -0
- package/dist-server/graphql/resolvers/daily-loading/delete-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js +68 -52
- 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 +16 -22
- package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/report/daily-ffb-dispatch-production-reports.js +50 -19
- package/dist-server/graphql/resolvers/report/daily-ffb-dispatch-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/daily-production-reports.js +96 -67
- package/dist-server/graphql/resolvers/report/daily-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js +1 -0
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js +7 -2
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js +11 -5
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js +21 -9
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js +5 -2
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js +5 -2
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js +2 -0
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js.map +1 -1
- package/dist-server/utils/transaction-util.js +32 -53
- package/dist-server/utils/transaction-util.js.map +1 -1
- package/package.json +3 -3
- package/server/entities/daily-dispatch.ts +2 -2
- package/server/entities/ramp-block-history.ts +2 -5
- package/server/graphql/resolvers/daily-dispatch/delete-daily-dispatch.ts +69 -2
- package/server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.ts +179 -141
- package/server/graphql/resolvers/daily-dispatch/update-daily-dispatch.ts +68 -5
- package/server/graphql/resolvers/daily-harvest/delete-daily-harvest.ts +9 -26
- package/server/graphql/resolvers/daily-harvest/generate-daily-harvest.ts +3 -3
- package/server/graphql/resolvers/daily-loading/delete-daily-loading.ts +11 -1
- package/server/graphql/resolvers/daily-loading/generate-daily-loading.ts +95 -98
- package/server/graphql/resolvers/daily-loading/update-daily-loading.ts +44 -47
- package/server/graphql/resolvers/report/daily-ffb-dispatch-production-reports.ts +61 -26
- package/server/graphql/resolvers/report/daily-production-reports.ts +103 -72
- package/server/graphql/resolvers/report/daily-staff-harvest-reports.ts +5 -2
- package/server/graphql/resolvers/report/monthly-block-dispatch-reports.ts +20 -9
- package/server/graphql/resolvers/report/monthly-dispatch-summary-reports.ts +16 -12
- package/server/graphql/resolvers/report/monthly-ffb-sale-reports.ts +26 -12
- package/server/graphql/resolvers/report/monthly-production-reports.ts +5 -3
- package/server/graphql/resolvers/report/yearly-production-reports.ts +5 -2
- package/server/graphql/types/daily-loading-detail/daily-loading-detail-patch.ts +2 -0
- package/server/utils/transaction-util.ts +36 -56
- package/translations/en.json +1 -1
- package/translations/ja.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -1
- package/translations/zh.json +1 -1
|
@@ -80,7 +80,7 @@ export async function updateTransactionHistory(
|
|
|
80
80
|
|
|
81
81
|
await transactionRepo.update(
|
|
82
82
|
{ id: existingTransactionRecord.id },
|
|
83
|
-
{ fieldBunches: totalBunches, updater: user, updatedAt: new Date() }
|
|
83
|
+
{ fieldBunches: totalBunches, transactionDate, block, updater: user, updatedAt: new Date() }
|
|
84
84
|
)
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -104,70 +104,50 @@ export async function generateRampBlockHistories(
|
|
|
104
104
|
dailyDispatch?: DailyDispatch,
|
|
105
105
|
trxMgr?: EntityManager
|
|
106
106
|
): Promise<RampBlockHistory> {
|
|
107
|
-
console.log(block, domain, ramp, user)
|
|
108
107
|
const rampBlockHistoryRepo: Repository<RampBlockHistory> =
|
|
109
108
|
trxMgr?.getRepository(RampBlockHistory) || getRepository(RampBlockHistory)
|
|
110
109
|
|
|
111
110
|
if (!ramp?.id) throw new Error(`Can't find a matching ramp.`)
|
|
112
111
|
|
|
112
|
+
// Fetch the last ramp block history for the given block, ramp, and domain
|
|
113
113
|
const lastRampBlockHistory: RampBlockHistory = await rampBlockHistoryRepo.findOne({
|
|
114
114
|
where: { domain, ramp, block },
|
|
115
|
-
order: {
|
|
115
|
+
order: { createdAt: 'DESC' }
|
|
116
116
|
})
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.values([
|
|
152
|
-
{
|
|
153
|
-
domain,
|
|
154
|
-
block,
|
|
155
|
-
ramp,
|
|
156
|
-
transactionType,
|
|
157
|
-
transactionDate,
|
|
158
|
-
weight: rampWeight,
|
|
159
|
-
previousWeight,
|
|
160
|
-
currentWeight: parseFloat((previousWeight + rampWeight).toFixed(4)),
|
|
161
|
-
creator: user,
|
|
162
|
-
updater: user,
|
|
163
|
-
seq: () =>
|
|
164
|
-
`(select seq from ramp_block_histories where ramp_id = '${ramp.id}' and block_id = '${block.id}' and domain_id = '${domain.id}' order by seq desc limit 1) + 1`
|
|
165
|
-
}
|
|
166
|
-
])
|
|
167
|
-
.returning('*')
|
|
168
|
-
.execute()
|
|
169
|
-
}
|
|
170
|
-
|
|
118
|
+
// if (!lastRampBlockHistory) {
|
|
119
|
+
// throw new Error(
|
|
120
|
+
// `No opening quantity defined for block ${block.id} in ramp ${ramp.id}. Please set an opening quantity before creating dispatch records to avoid negative calculation in report.`
|
|
121
|
+
// )
|
|
122
|
+
// }
|
|
123
|
+
|
|
124
|
+
const previousWeight: number = lastRampBlockHistory.currentWeight
|
|
125
|
+
|
|
126
|
+
const res: any = await rampBlockHistoryRepo
|
|
127
|
+
.createQueryBuilder()
|
|
128
|
+
.insert()
|
|
129
|
+
.into(RampBlockHistory)
|
|
130
|
+
.values([
|
|
131
|
+
{
|
|
132
|
+
domain,
|
|
133
|
+
block,
|
|
134
|
+
ramp,
|
|
135
|
+
transactionType,
|
|
136
|
+
transactionDate,
|
|
137
|
+
weight: rampWeight,
|
|
138
|
+
previousWeight,
|
|
139
|
+
currentWeight: parseFloat((previousWeight + rampWeight).toFixed(4)),
|
|
140
|
+
dailyDispatch, // Include dailyDispatch object
|
|
141
|
+
creator: user,
|
|
142
|
+
updater: user,
|
|
143
|
+
seq: () =>
|
|
144
|
+
`(select seq from ramp_block_histories where ramp_id = '${ramp.id}' and block_id = '${block.id}' and domain_id = '${domain.id}' order by seq desc limit 1) + 1`
|
|
145
|
+
}
|
|
146
|
+
])
|
|
147
|
+
.returning('*')
|
|
148
|
+
.execute()
|
|
149
|
+
|
|
150
|
+
// Extract the newly created ramp block history
|
|
171
151
|
let newRampBlockHistory: RampBlockHistory = res.generatedMaps[0]
|
|
172
152
|
|
|
173
153
|
return newRampBlockHistory
|
package/translations/en.json
CHANGED
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"text.there_is_no_selected_items": "there is no selected items",
|
|
201
201
|
"text.total_bunch_weight_should_be_positive": "total bunch weight should be positive",
|
|
202
202
|
"text.total_bunches_loaded_should_be_positive": "total bunches loaded should be positive",
|
|
203
|
-
"text.
|
|
203
|
+
"text.total_no_of_bunches_should_be_positive_and_whole_number": "total no of bunches should be positive and whole number",
|
|
204
204
|
"text.total_tonnage_harvested_should_be_positive": "total tonnage harvested should be positive",
|
|
205
205
|
"text.tracked_inventory_setting": "tracked inventory setting",
|
|
206
206
|
"text.truck_is_not_selected": "truck not selected",
|
package/translations/ja.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"text.there_is_duplicated_staff_in_record": "there is duplicated staff in this record",
|
|
70
70
|
"text.total_bunch_weight_should_be_positive": "total bunch weight should be positive",
|
|
71
71
|
"text.total_bunches_loaded_should_be_positive": "total bunches loaded should be positive",
|
|
72
|
-
"text.
|
|
72
|
+
"text.total_no_of_bunches_should_be_positive_and_whole_number": "total no of bunches should be positive and whole number",
|
|
73
73
|
"text.total_tonnage_harvested_should_be_positive": "total tonnage harvested should be positive",
|
|
74
74
|
"text.tracked_inventory_setting": "tracked inventory setting",
|
|
75
75
|
"text.x_has_invalid_value": "{x} has invalid value",
|
package/translations/ko.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"text.there_is_duplicated_staff_in_record": "there is duplicated staff in this record",
|
|
70
70
|
"text.total_bunch_weight_should_be_positive": "total bunch weight should be positive",
|
|
71
71
|
"text.total_bunches_loaded_should_be_positive": "total bunches loaded should be positive",
|
|
72
|
-
"text.
|
|
72
|
+
"text.total_no_of_bunches_should_be_positive_and_whole_number": "total no of bunches should be positive and whole number",
|
|
73
73
|
"text.total_tonnage_harvested_should_be_positive": "total tonnage harvested should be positive",
|
|
74
74
|
"text.tracked_inventory_setting": "tracked inventory setting",
|
|
75
75
|
"text.x_has_invalid_value": "{x} has invalid value",
|
package/translations/ms.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"text.there_is_duplicated_staff_in_record": "there is duplicated staff in this record",
|
|
70
70
|
"text.total_bunch_weight_should_be_positive": "total bunch weight should be positive",
|
|
71
71
|
"text.total_bunches_loaded_should_be_positive": "total bunches loaded should be positive",
|
|
72
|
-
"text.
|
|
72
|
+
"text.total_no_of_bunches_should_be_positive_and_whole_number": "total no of bunches should be positive and whole number",
|
|
73
73
|
"text.total_tonnage_harvested_should_be_positive": "total tonnage harvested should be positive",
|
|
74
74
|
"text.tracked_inventory_setting": "tracked inventory setting",
|
|
75
75
|
"text.x_has_invalid_value": "{x} has invalid value",
|
package/translations/zh.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"text.there_is_duplicated_staff_in_record": "there is duplicated staff in this record",
|
|
70
70
|
"text.total_bunch_weight_should_be_positive": "total bunch weight should be positive",
|
|
71
71
|
"text.total_bunches_loaded_should_be_positive": "total bunches loaded should be positive",
|
|
72
|
-
"text.
|
|
72
|
+
"text.total_no_of_bunches_should_be_positive_and_whole_number": "total no of bunches should be positive and whole number",
|
|
73
73
|
"text.total_tonnage_harvested_should_be_positive": "total tonnage harvested should be positive",
|
|
74
74
|
"text.tracked_inventory_setting": "tracked inventory setting",
|
|
75
75
|
"text.x_has_invalid_value": "{x} has invalid value",
|