@things-factory/worksheet-base 4.0.0-y.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/controllers/ecommerce/ecommerce-controller.js +23 -9
- package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
- package/dist-server/controllers/ecommerce/index.js +1 -0
- package/dist-server/controllers/ecommerce/index.js.map +1 -1
- package/dist-server/controllers/ecommerce/sellercraft-controller.js +168 -0
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -0
- package/dist-server/controllers/inbound/unloading-worksheet-controller.js +6 -5
- package/dist-server/controllers/inbound/unloading-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js +43 -8
- package/dist-server/controllers/inspect/cycle-count-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/packing-worksheet-controller.js +16 -1
- package/dist-server/controllers/outbound/packing-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/outbound/picking-worksheet-controller.js +17 -9
- package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/render-grn.js +192 -0
- package/dist-server/controllers/render-grn.js.map +1 -0
- package/dist-server/controllers/render-job-sheet.js +51 -35
- package/dist-server/controllers/render-job-sheet.js.map +1 -1
- package/dist-server/controllers/render-kimeda-grn.js +12 -5
- package/dist-server/controllers/render-kimeda-grn.js.map +1 -1
- package/dist-server/controllers/render-ro-do.js +19 -5
- package/dist-server/controllers/render-ro-do.js.map +1 -1
- package/dist-server/controllers/render-seebuu-grn.js +9 -3
- package/dist-server/controllers/render-seebuu-grn.js.map +1 -1
- package/dist-server/controllers/vas/vas-worksheet-controller.js +75 -14
- package/dist-server/controllers/vas/vas-worksheet-controller.js.map +1 -1
- package/dist-server/controllers/worksheet-controller.js +61 -8
- package/dist-server/controllers/worksheet-controller.js.map +1 -1
- package/dist-server/graphql/resolvers/pallet/pallet-outbound.js +1 -1
- package/dist-server/graphql/resolvers/pallet/pallet-outbound.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-adjustment.js +23 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-adjustment.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet.js +4 -2
- package/dist-server/graphql/resolvers/worksheet/cycle-count-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/fetch-sellercraft-airway-bill.js +25 -0
- package/dist-server/graphql/resolvers/worksheet/fetch-sellercraft-airway-bill.js.map +1 -0
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/index.js +5 -4
- package/dist-server/graphql/resolvers/worksheet/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/not-tally-target-inventories.js +2 -2
- package/dist-server/graphql/resolvers/worksheet/not-tally-target-inventories.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing/activate-packing.js +13 -1
- package/dist-server/graphql/resolvers/worksheet/packing/activate-packing.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing/complete-packing.js +24 -38
- package/dist-server/graphql/resolvers/worksheet/packing/complete-packing.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing/packing.js +13 -1
- package/dist-server/graphql/resolvers/worksheet/packing/packing.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing/scan-product-packing.js +13 -1
- package/dist-server/graphql/resolvers/worksheet/packing/scan-product-packing.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/packing-worksheet.js +60 -19
- package/dist-server/graphql/resolvers/worksheet/packing-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/activate-batch-picking.js +20 -1
- package/dist-server/graphql/resolvers/worksheet/picking/activate-batch-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/activate-picking.js +24 -14
- package/dist-server/graphql/resolvers/worksheet/picking/activate-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/assign-picking-inventories.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/picking/assign-picking-inventories.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js +19 -0
- package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js +124 -149
- package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking/undo-picking-assignment.js +4 -4
- package/dist-server/graphql/resolvers/worksheet/picking/undo-picking-assignment.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/picking-worksheet.js +2 -1
- package/dist-server/graphql/resolvers/worksheet/picking-worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/recommend-putway-location.js +1 -1
- package/dist-server/graphql/resolvers/worksheet/recommend-putway-location.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/replace-picking-pallets.js +13 -4
- package/dist-server/graphql/resolvers/worksheet/replace-picking-pallets.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading.js +21 -2
- package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/unloading-return/complete-unload-returning.js +18 -1
- package/dist-server/graphql/resolvers/worksheet/unloading-return/complete-unload-returning.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/common-utils.js +302 -11
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/common-utils.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/interfaces/index.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/interfaces/repackaging.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/complete-repackaging.js +137 -31
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/complete-repackaging.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/repackaging.js +157 -42
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/repackaging.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/undo-repackaging.js +35 -21
- package/dist-server/graphql/resolvers/worksheet/vas-transactions/repackaging/undo-repackaging.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheet.js +33 -27
- package/dist-server/graphql/resolvers/worksheet/worksheet.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet/worksheets.js +39 -10
- package/dist-server/graphql/resolvers/worksheet/worksheets.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/generate-batch-picking-worksheet-details-by-bulk.js +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/generate-batch-picking-worksheet-details-by-bulk.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.js +3 -2
- package/dist-server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.js.map +1 -1
- package/dist-server/graphql/resolvers/worksheet-detail/worksheet-details-by-product-group.js +3 -2
- package/dist-server/graphql/resolvers/worksheet-detail/worksheet-details-by-product-group.js.map +1 -1
- package/dist-server/graphql/types/index.js +2 -1
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/pallet/index.js +10 -0
- package/dist-server/graphql/types/pallet/index.js.map +1 -0
- package/dist-server/graphql/types/worksheet/airwaybill.js +10 -0
- package/dist-server/graphql/types/worksheet/airwaybill.js.map +1 -0
- package/dist-server/graphql/types/worksheet/index.js +10 -2
- package/dist-server/graphql/types/worksheet/index.js.map +1 -1
- package/dist-server/graphql/types/worksheet/worksheet-info.js +2 -0
- package/dist-server/graphql/types/worksheet/worksheet-info.js.map +1 -1
- package/dist-server/graphql/types/worksheet-detail/index.js +2 -1
- package/dist-server/graphql/types/worksheet-detail/index.js.map +1 -1
- package/dist-server/graphql/types/worksheet-detail/inventory-detail.js +1 -0
- package/dist-server/graphql/types/worksheet-detail/inventory-detail.js.map +1 -1
- package/dist-server/routes.js +10 -6
- package/dist-server/routes.js.map +1 -1
- package/dist-server/utils/inventory-util.js +7 -3
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +16 -15
- package/server/controllers/ecommerce/ecommerce-controller.ts +37 -10
- package/server/controllers/ecommerce/index.ts +1 -0
- package/server/controllers/ecommerce/sellercraft-controller.ts +223 -0
- package/server/controllers/inbound/unloading-worksheet-controller.ts +16 -13
- package/server/controllers/index.ts +1 -0
- package/server/controllers/inspect/cycle-count-worksheet-controller.ts +108 -43
- package/server/controllers/outbound/packing-worksheet-controller.ts +21 -4
- package/server/controllers/outbound/picking-worksheet-controller.ts +26 -11
- package/server/controllers/render-grn.ts +218 -0
- package/server/controllers/render-job-sheet.ts +51 -39
- package/server/controllers/render-kimeda-grn.ts +16 -12
- package/server/controllers/render-ro-do.ts +22 -6
- package/server/controllers/render-seebuu-grn.ts +12 -12
- package/server/controllers/vas/vas-worksheet-controller.ts +104 -23
- package/server/controllers/worksheet-controller.ts +87 -22
- package/server/graphql/resolvers/pallet/pallet-outbound.ts +2 -1
- package/server/graphql/resolvers/worksheet/cycle-count-adjustment.ts +30 -2
- package/server/graphql/resolvers/worksheet/cycle-count-worksheet.ts +7 -4
- package/server/graphql/resolvers/worksheet/fetch-sellercraft-airway-bill.ts +30 -0
- package/server/graphql/resolvers/worksheet/generate-worksheet/generate-cycle-count-worksheet.ts +18 -3
- package/server/graphql/resolvers/worksheet/index.ts +6 -4
- package/server/graphql/resolvers/worksheet/not-tally-target-inventories.ts +4 -2
- package/server/graphql/resolvers/worksheet/packing/activate-packing.ts +20 -3
- package/server/graphql/resolvers/worksheet/packing/complete-packing.ts +30 -49
- package/server/graphql/resolvers/worksheet/packing/packing.ts +22 -3
- package/server/graphql/resolvers/worksheet/packing/scan-product-packing.ts +22 -3
- package/server/graphql/resolvers/worksheet/packing-worksheet.ts +71 -20
- package/server/graphql/resolvers/worksheet/picking/activate-batch-picking.ts +32 -3
- package/server/graphql/resolvers/worksheet/picking/activate-picking.ts +31 -17
- package/server/graphql/resolvers/worksheet/picking/assign-picking-inventories.ts +4 -3
- package/server/graphql/resolvers/worksheet/picking/complete-batch-picking.ts +31 -3
- package/server/graphql/resolvers/worksheet/picking/complete-picking.ts +143 -175
- package/server/graphql/resolvers/worksheet/picking/undo-picking-assignment.ts +5 -4
- package/server/graphql/resolvers/worksheet/picking-worksheet.ts +5 -2
- package/server/graphql/resolvers/worksheet/recommend-putway-location.ts +1 -1
- package/server/graphql/resolvers/worksheet/replace-picking-pallets.ts +22 -9
- package/server/graphql/resolvers/worksheet/unloading/complete-unloading.ts +27 -4
- package/server/graphql/resolvers/worksheet/unloading-return/complete-unload-returning.ts +23 -2
- package/server/graphql/resolvers/worksheet/vas-transactions/common-utils.ts +452 -14
- package/server/graphql/resolvers/worksheet/vas-transactions/interfaces/index.ts +36 -1
- package/server/graphql/resolvers/worksheet/vas-transactions/interfaces/repackaging.ts +8 -2
- package/server/graphql/resolvers/worksheet/vas-transactions/repackaging/complete-repackaging.ts +185 -56
- package/server/graphql/resolvers/worksheet/vas-transactions/repackaging/repackaging.ts +210 -54
- package/server/graphql/resolvers/worksheet/vas-transactions/repackaging/undo-repackaging.ts +64 -32
- package/server/graphql/resolvers/worksheet/worksheet.ts +67 -62
- package/server/graphql/resolvers/worksheet/worksheets.ts +51 -13
- package/server/graphql/resolvers/worksheet-detail/generate-batch-picking-worksheet-details-by-bulk.ts +1 -0
- package/server/graphql/resolvers/worksheet-detail/generate-release-good-worksheet-details.ts +2 -1
- package/server/graphql/resolvers/worksheet-detail/worksheet-details-by-product-group.ts +2 -1
- package/server/graphql/types/index.ts +2 -1
- package/server/graphql/types/pallet/index.ts +6 -0
- package/server/graphql/types/worksheet/airwaybill.ts +7 -0
- package/server/graphql/types/worksheet/index.ts +10 -2
- package/server/graphql/types/worksheet/worksheet-info.ts +2 -0
- package/server/graphql/types/worksheet-detail/index.ts +2 -1
- package/server/graphql/types/worksheet-detail/inventory-detail.ts +1 -0
- package/server/routes.ts +11 -6
- package/server/utils/inventory-util.ts +14 -5
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import FormData from 'form-data'
|
|
2
|
+
import fetch from 'node-fetch'
|
|
3
|
+
import { getRepository, IsNull, Not } from 'typeorm'
|
|
4
|
+
|
|
5
|
+
import { Attachment, STORAGE } from '@things-factory/attachment-base'
|
|
6
|
+
import { Partner } from '@things-factory/auth-base'
|
|
7
|
+
import { Bizplace, ContactPoint } from '@things-factory/biz-base'
|
|
8
|
+
import { config } from '@things-factory/env'
|
|
9
|
+
import { ArrivalNotice, GoodsReceivalNote, ORDER_STATUS, OrderProduct } from '@things-factory/sales-base'
|
|
10
|
+
import { Domain } from '@things-factory/shell'
|
|
11
|
+
import { ReducedInventoryHistory } from '@things-factory/warehouse-base'
|
|
12
|
+
|
|
13
|
+
import { TEMPLATE_TYPE, WORKSHEET_TYPE } from '../constants'
|
|
14
|
+
import { Worksheet } from '../entities'
|
|
15
|
+
import { DateTimeConverter } from '../utils/datetime-util'
|
|
16
|
+
|
|
17
|
+
const REPORT_API_URL = config.get('reportApiUrl', 'http://localhost:8888/rest/report/show_html')
|
|
18
|
+
|
|
19
|
+
export async function renderGRN({ grnNo, timezoneOffSet }, context: any) {
|
|
20
|
+
// 1. find domain
|
|
21
|
+
const domain: Domain = await getRepository(Domain).findOne({
|
|
22
|
+
where: { id: context.state.domain.id }
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// 2. find grn
|
|
26
|
+
const foundGRN: GoodsReceivalNote = await getRepository(GoodsReceivalNote).findOne({
|
|
27
|
+
where: { domain, name: grnNo },
|
|
28
|
+
relations: ['domain', 'bizplace', 'bizplace.domain', 'bizplace.company', 'arrivalNotice']
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// 3. find GAN
|
|
32
|
+
const foundGAN: ArrivalNotice = foundGRN.arrivalNotice
|
|
33
|
+
const ownRefNo = foundGAN.refNo
|
|
34
|
+
|
|
35
|
+
// 4. find customer bizplace
|
|
36
|
+
const partnerBiz: Bizplace = foundGRN.bizplace
|
|
37
|
+
|
|
38
|
+
const partnerDomain: Partner = await getRepository(Partner).findOne({
|
|
39
|
+
where: { partnerDomain: partnerBiz.domain, domain },
|
|
40
|
+
relations: ['domain']
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const domainOwner: Domain = partnerDomain.domain
|
|
44
|
+
const domainBizplace: Bizplace = await getRepository(Bizplace).findOne({
|
|
45
|
+
where: { domain: domainOwner },
|
|
46
|
+
relations: ['company']
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const qbReducedInventory = getRepository(ReducedInventoryHistory)
|
|
50
|
+
.createQueryBuilder(`ivh`)
|
|
51
|
+
.select(`product_id`, `productId`)
|
|
52
|
+
.addSelect(`batch_id`, `batchId`)
|
|
53
|
+
.addSelect(`reusable_pallet_id`, `reusablePalletId`)
|
|
54
|
+
.addSelect(`packing_type`, `packingType`)
|
|
55
|
+
.addSelect(`sum(qty)`, `qty`)
|
|
56
|
+
.addSelect(`sum(uom_value)`, `uomValue`)
|
|
57
|
+
.addSelect(`uom`, `uom`)
|
|
58
|
+
.addSelect(`count(distinct pallet_id)`, `pallet`)
|
|
59
|
+
.addSelect(`string_agg(distinct expiration_date::varchar,', ' order by expiration_date::varchar)`, `expiryDate`)
|
|
60
|
+
.addSelect(`string_agg(distinct pallet_id::varchar,', ' order by pallet_id::varchar)`, `palletId`)
|
|
61
|
+
.where(`ivh.domain_id = :domainId`, { domainId: domain.id })
|
|
62
|
+
.andWhere(`ivh.ref_order_id = :refOrderId`, { refOrderId: foundGAN.id })
|
|
63
|
+
.andWhere(`ivh.transaction_type = 'UNLOADING'`)
|
|
64
|
+
.groupBy(`reusable_pallet_id`)
|
|
65
|
+
.addGroupBy(`product_id`)
|
|
66
|
+
.addGroupBy(`batch_id`)
|
|
67
|
+
.addGroupBy(`packing_type`)
|
|
68
|
+
.addGroupBy(`uom`)
|
|
69
|
+
.getRawMany()
|
|
70
|
+
|
|
71
|
+
// 5. find domain contact point
|
|
72
|
+
const foundCP: ContactPoint = await getRepository(ContactPoint).findOne({
|
|
73
|
+
where: { domain, bizplace: domainBizplace }
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// 5. find domain contact point
|
|
77
|
+
const foundPartnerCP: ContactPoint = await getRepository(ContactPoint).findOne({
|
|
78
|
+
where: { domain, bizplace: partnerBiz }
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// 6. find unloading worksheet
|
|
82
|
+
const foundWS: Worksheet = await getRepository(Worksheet).findOne({
|
|
83
|
+
where: { domain, arrivalNotice: foundGAN, type: WORKSHEET_TYPE.UNLOADING, status: ORDER_STATUS.DONE },
|
|
84
|
+
relations: ['worksheetDetails', 'updater']
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
// find putaway worksheet
|
|
88
|
+
const foundPutawayWS: Worksheet = await getRepository(Worksheet).findOne({
|
|
89
|
+
where: { domain, arrivalNotice: foundGAN, type: WORKSHEET_TYPE.PUTAWAY, status: ORDER_STATUS.DONE },
|
|
90
|
+
relations: ['worksheetDetails', 'updater']
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const targetProducts: OrderProduct[] = await getRepository(OrderProduct).find({
|
|
94
|
+
where: { domain, arrivalNotice: foundGAN, actualPalletQty: Not(IsNull()), actualPackQty: Not(IsNull()) },
|
|
95
|
+
relations: ['product']
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// 7. find grn template based on category
|
|
99
|
+
const foundTemplate: Attachment = await getRepository(Attachment).findOne({
|
|
100
|
+
where: { domain, category: TEMPLATE_TYPE.GRN_TEMPLATE }
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// 8. find grn logo
|
|
104
|
+
const foundLogo: Attachment = await getRepository(Attachment).findOne({
|
|
105
|
+
where: {
|
|
106
|
+
domain,
|
|
107
|
+
category: TEMPLATE_TYPE.LOGO
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// 9. find signature
|
|
112
|
+
const foundSignature: Attachment = await getRepository(Attachment).findOne({
|
|
113
|
+
where: {
|
|
114
|
+
domain,
|
|
115
|
+
category: TEMPLATE_TYPE.SIGNATURE
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const foundCop: Attachment = await getRepository(Attachment).findOne({
|
|
120
|
+
where: {
|
|
121
|
+
domain,
|
|
122
|
+
category: TEMPLATE_TYPE.COP
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const inboundInventories: any[] = await qbReducedInventory
|
|
127
|
+
|
|
128
|
+
const template = await STORAGE.readFile(foundTemplate.path, 'utf-8')
|
|
129
|
+
|
|
130
|
+
let logo = null
|
|
131
|
+
if (foundLogo?.path) {
|
|
132
|
+
logo = 'data:' + foundLogo.mimetype + ';base64,' + (await STORAGE.readFile(foundLogo.path, 'base64'))
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let signature = null
|
|
136
|
+
if (foundSignature?.path) {
|
|
137
|
+
signature = 'data:' + foundSignature.mimetype + ';base64,' + (await STORAGE.readFile(foundSignature.path, 'base64'))
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
let cop = null
|
|
141
|
+
if (foundCop?.path) {
|
|
142
|
+
cop = 'data:' + foundSignature.mimetype + ';base64,' + (await STORAGE.readFile(foundCop.path, 'base64'))
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const data = {
|
|
146
|
+
logo_url: logo,
|
|
147
|
+
sign_url: signature,
|
|
148
|
+
cop_url: cop,
|
|
149
|
+
customer_biz: partnerBiz.name,
|
|
150
|
+
customer_address: partnerBiz.address,
|
|
151
|
+
company_domain: domainBizplace.company.name,
|
|
152
|
+
company_phone: foundCP.phone,
|
|
153
|
+
company_email: foundCP.email,
|
|
154
|
+
company_brn: domainBizplace.company.brn,
|
|
155
|
+
company_address: domainBizplace.company.address,
|
|
156
|
+
warehouse_address: foundCP.address,
|
|
157
|
+
warehouse_address2: foundCP.address2,
|
|
158
|
+
warehouse_postcode: foundCP.postCode,
|
|
159
|
+
warehouse_city: foundCP.city,
|
|
160
|
+
warehouse_state: foundCP.state,
|
|
161
|
+
warehouse_phone: foundCP.phone,
|
|
162
|
+
warehouse_fax: foundCP.fax,
|
|
163
|
+
warehouse_email: foundCP.email,
|
|
164
|
+
order_no: foundGRN.name,
|
|
165
|
+
gan_no: foundGAN.name,
|
|
166
|
+
gan_accepted_at: foundGAN.acceptedAt ? DateTimeConverter.datetime(foundGAN.acceptedAt, timezoneOffSet) : '',
|
|
167
|
+
unload_date: DateTimeConverter.date(foundWS.endedAt),
|
|
168
|
+
ref_no: ownRefNo ? `${foundGAN.name} / ${foundGAN.refNo}` : `${foundGAN.name}`,
|
|
169
|
+
received_date: DateTimeConverter.date(foundWS.endedAt),
|
|
170
|
+
truck_no: foundGAN.truckNo || '',
|
|
171
|
+
container_no: foundGAN.containerNo || '',
|
|
172
|
+
delivery_order_no: foundGAN.deliveryOrderNo ? foundGAN.deliveryOrderNo : '',
|
|
173
|
+
account_no: foundPartnerCP ? foundPartnerCP.accountNo : '',
|
|
174
|
+
unloaded_by: foundWS ? foundWS.updater.name : '',
|
|
175
|
+
putaway_by: foundPutawayWS ? foundPutawayWS.updater.name : '',
|
|
176
|
+
product_list: targetProducts.map((item, idx) => {
|
|
177
|
+
let unloadInvHistory = inboundInventories.find(
|
|
178
|
+
ih =>
|
|
179
|
+
ih.productId == item.product.id &&
|
|
180
|
+
ih.batchId == item.batchId &&
|
|
181
|
+
ih.packingType == item.packingType &&
|
|
182
|
+
ih.uom == item.uom
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
list_no: idx + 1,
|
|
187
|
+
product_sku: `${item.product.sku}`,
|
|
188
|
+
product_name: `${item.product.name}(${item.product.description})`,
|
|
189
|
+
product_desc: item.product.description,
|
|
190
|
+
product_nameOnly: item.product.name,
|
|
191
|
+
product_type: item.packingType,
|
|
192
|
+
product_size: item.packingSize,
|
|
193
|
+
product_batch: item.batchId,
|
|
194
|
+
pallet_qty: item.actualPalletQty,
|
|
195
|
+
product_qty: unloadInvHistory.qty || item.actualPackQty,
|
|
196
|
+
product_unit_uom_value: `${Math.round(item.uomValue * 100) / 100}`,
|
|
197
|
+
product_total_uom_value: `${
|
|
198
|
+
Math.round((unloadInvHistory.uomValue || item.uomValue * item.actualPackQty) * 100) / 100
|
|
199
|
+
}`,
|
|
200
|
+
product_uom: `${unloadInvHistory.uom || item.uom}`,
|
|
201
|
+
expiry_date: unloadInvHistory.expiryDate || ``,
|
|
202
|
+
reusable_pallet_id: unloadInvHistory.reusablePalletId || ``,
|
|
203
|
+
remark: (item.remark ? item.remark : '') + (item.issue ? ' [Issue]: ' + item.issue : '')
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const formData = new FormData()
|
|
209
|
+
formData.append('template', template)
|
|
210
|
+
formData.append('jsonString', JSON.stringify(data))
|
|
211
|
+
|
|
212
|
+
const response = await fetch(REPORT_API_URL, {
|
|
213
|
+
method: 'POST',
|
|
214
|
+
body: formData
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
return await response.text()
|
|
218
|
+
}
|
|
@@ -79,7 +79,7 @@ export async function renderJobSheet({ ganNo, timezoneOffSet }, context) {
|
|
|
79
79
|
return await getManager().transaction(async (trxMgr: EntityManager) => {
|
|
80
80
|
await trxMgr.query(
|
|
81
81
|
`
|
|
82
|
-
create temp table temp_invHistory as (
|
|
82
|
+
create temp table temp_invHistory on commit drop as (
|
|
83
83
|
select i2.id as inventory_id, i2.pallet_id, i2.product_id, i2.packing_type, i2.batch_id,
|
|
84
84
|
ih.id as inventory_history_id, ih.seq, ih.status, ih.transaction_type, ih.qty, ih.opening_qty, ih.uom_value, ih.opening_uom_value,
|
|
85
85
|
ih.created_at
|
|
@@ -95,52 +95,63 @@ export async function renderJobSheet({ ganNo, timezoneOffSet }, context) {
|
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
const invItems: any[] = await trxMgr.query(
|
|
98
|
-
`
|
|
99
|
-
SELECT
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
`
|
|
99
|
+
SELECT rn,
|
|
100
|
+
inv_id,
|
|
101
|
+
case when rn = 1 then "packingType" else null end as "packingType",
|
|
102
|
+
case when rn = 1 then "createdAt" else null end as "createdAt",
|
|
103
|
+
case when rn = 1 then "productName" else null end as "productName",
|
|
104
|
+
case when rn = 1 then "unloadedQty" else null end as "unloadedQty",
|
|
105
|
+
case when rn = 1 then "outboundAt" else null end as "outboundAt",
|
|
106
|
+
"doName",
|
|
107
|
+
case when rn = 1 then "palletId" else null end as "palletId",
|
|
108
|
+
qty,
|
|
109
|
+
case when rn = 1 then "ownTransport" else null end as "ownTransport",
|
|
110
|
+
case when rn = 1 then "vasName" else null end as "vasName"
|
|
111
|
+
from
|
|
112
|
+
(
|
|
113
|
+
SELECT
|
|
114
|
+
row_number() over(partition by pallet_id order by inv.pallet_id, product.name asc) as rn,
|
|
115
|
+
inv.id AS "inv_id", inv.packing_type AS "packingType", inv.created_at AS "createdAt", product.name AS "productName",
|
|
116
|
+
(
|
|
117
|
+
select distinct on(pallet_id) COALESCE(qty, 0) AS unloadedQty from temp_invHistory invh
|
|
118
|
+
where invh.status = 'UNLOADED' and invh.inventory_id = inv.id
|
|
119
|
+
order by pallet_id, seq asc
|
|
120
|
+
) AS "unloadedQty",
|
|
121
|
+
(
|
|
122
|
+
select distinct on(pallet_id) COALESCE(created_at, null) AS outboundAt from temp_invHistory invh
|
|
123
|
+
where invh.status = 'TERMINATED' and invh.inventory_id = inv.id
|
|
124
|
+
order by pallet_id, seq desc
|
|
125
|
+
) AS "outboundAt",
|
|
126
|
+
STRING_AGG (case when do2.name is not null then (CONCAT(do2.delivery_date, ' (', orderInv.release_qty, ') ', do2.name, ', ', case when do2.own_collection = true then 'TPT N' else 'TPT Y' end )) else null end, ', ') AS "doName",
|
|
127
|
+
case when plt.name is not null then (CONCAT(inv.pallet_id, ' (', plt.name, ')')) else inv.pallet_id end AS "palletId",
|
|
128
|
+
SUM(orderInv.release_qty) as "qty",
|
|
129
|
+
do2.own_collection AS "ownTransport",
|
|
130
|
+
STRING_AGG (vas.name, ', ') AS "vasName"
|
|
131
|
+
FROM inventories inv
|
|
132
|
+
LEFT JOIN order_inventories orderInv ON orderInv.inventory_id = inv.id AND orderInv.release_good_id is not null and orderInv.status <> 'CANCELLED' AND orderinv.picked_qty > 0
|
|
133
|
+
LEFT JOIN order_vass orderVass ON orderVass.inventory_id = inv.id
|
|
134
|
+
LEFT JOIN vass vas ON vas.id = orderVass.vas_id
|
|
135
|
+
LEFT JOIN pallets plt on plt.id = inv.reusable_pallet_id
|
|
136
|
+
LEFT JOIN delivery_orders do2 ON do2.id = orderInv.delivery_order_id
|
|
137
|
+
LEFT JOIN products product ON product.id=inv.product_id
|
|
138
|
+
inner join order_inventories oi on oi.inventory_id = inv.id
|
|
139
|
+
where oi.arrival_notice_id = $1
|
|
140
|
+
AND inv.domain_id = $2
|
|
141
|
+
GROUP BY inv.id, product.name, do2.own_collection, plt.name
|
|
142
|
+
ORDER BY inv.pallet_id, product.name asc
|
|
143
|
+
) foo
|
|
127
144
|
`,
|
|
128
145
|
[foundGAN.id, domain.id]
|
|
129
146
|
)
|
|
130
147
|
|
|
131
|
-
await trxMgr.query(
|
|
132
|
-
`
|
|
133
|
-
drop table temp_invHistory
|
|
134
|
-
`
|
|
135
|
-
)
|
|
136
|
-
|
|
137
148
|
const sumPackQty = targetProducts.map((op: OrderProduct) => op.actualPackQty).reduce((a, b) => a + b, 0)
|
|
138
149
|
|
|
139
150
|
let sumPalletQty = 0
|
|
140
151
|
if (foundJS?.sumPalletQty) {
|
|
141
152
|
sumPalletQty = foundJS.sumPalletQty
|
|
142
153
|
}
|
|
143
|
-
|
|
154
|
+
let index = 0
|
|
144
155
|
const data = {
|
|
145
156
|
logo_url: logo,
|
|
146
157
|
customer_biz: partnerBiz.company.name,
|
|
@@ -163,9 +174,10 @@ export async function renderJobSheet({ ganNo, timezoneOffSet }, context) {
|
|
|
163
174
|
created_on: DateTimeConverter.date(foundJS.createdAt),
|
|
164
175
|
job_no: foundJS ? foundJS.name : null,
|
|
165
176
|
ref_no: foundGAN.name,
|
|
166
|
-
product_list: invItems.map(
|
|
177
|
+
product_list: invItems.map(item => {
|
|
178
|
+
index = item.rn == 1 ? index + 1 : index
|
|
167
179
|
return {
|
|
168
|
-
idx:
|
|
180
|
+
idx: item.rn == 1 ? index : '',
|
|
169
181
|
pallet_id: item.palletId,
|
|
170
182
|
product_name: item.productName,
|
|
171
183
|
product_type: item.packingType,
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
+
import FormData from 'form-data'
|
|
2
|
+
import fetch from 'node-fetch'
|
|
3
|
+
import { getRepository, IsNull, Not } from 'typeorm'
|
|
4
|
+
|
|
1
5
|
import { Attachment, STORAGE } from '@things-factory/attachment-base'
|
|
2
6
|
import { Partner } from '@things-factory/auth-base'
|
|
3
7
|
import { Bizplace, ContactPoint } from '@things-factory/biz-base'
|
|
4
8
|
import { config } from '@things-factory/env'
|
|
5
|
-
import {
|
|
6
|
-
ArrivalNotice,
|
|
7
|
-
GoodsReceivalNote,
|
|
8
|
-
OrderProduct,
|
|
9
|
-
ORDER_PRODUCT_STATUS,
|
|
10
|
-
ORDER_STATUS
|
|
11
|
-
} from '@things-factory/sales-base'
|
|
9
|
+
import { ArrivalNotice, GoodsReceivalNote, ORDER_STATUS, OrderProduct } from '@things-factory/sales-base'
|
|
12
10
|
import { Domain } from '@things-factory/shell'
|
|
13
|
-
|
|
14
|
-
import fetch from 'node-fetch'
|
|
15
|
-
import { getRepository, IsNull, Not } from 'typeorm'
|
|
11
|
+
|
|
16
12
|
import { TEMPLATE_TYPE, WORKSHEET_TYPE } from '../constants'
|
|
17
13
|
import { Worksheet } from '../entities'
|
|
18
14
|
import { DateTimeConverter } from '../utils/datetime-util'
|
|
19
15
|
|
|
20
16
|
const REPORT_API_URL = config.get('reportApiUrl', 'http://localhost:8888/rest/report/show_html')
|
|
21
17
|
|
|
22
|
-
export async function renderKimedaGRN({ grnNo }, context: any) {
|
|
18
|
+
export async function renderKimedaGRN({ grnNo, timezoneOffSet }, context: any) {
|
|
23
19
|
// 1. find domain
|
|
24
20
|
const domain: Domain = await getRepository(Domain).findOne({
|
|
25
21
|
where: { id: context.state.domain.id }
|
|
@@ -39,7 +35,7 @@ export async function renderKimedaGRN({ grnNo }, context: any) {
|
|
|
39
35
|
const partnerBiz: Bizplace = foundGRN.bizplace
|
|
40
36
|
|
|
41
37
|
const partnerDomain: Partner = await getRepository(Partner).findOne({
|
|
42
|
-
where: { partnerDomain: partnerBiz.domain },
|
|
38
|
+
where: { partnerDomain: partnerBiz.domain, domain },
|
|
43
39
|
relations: ['domain']
|
|
44
40
|
})
|
|
45
41
|
|
|
@@ -54,6 +50,11 @@ export async function renderKimedaGRN({ grnNo }, context: any) {
|
|
|
54
50
|
where: { domain, bizplace: domainBizplace }
|
|
55
51
|
})
|
|
56
52
|
|
|
53
|
+
// 5. find domain contact point
|
|
54
|
+
const foundPartnerCP: ContactPoint = await getRepository(ContactPoint).findOne({
|
|
55
|
+
where: { domain, bizplace: partnerBiz }
|
|
56
|
+
})
|
|
57
|
+
|
|
57
58
|
// 6. find unloading worksheet
|
|
58
59
|
const foundWS: Worksheet = await getRepository(Worksheet).findOne({
|
|
59
60
|
where: { domain, arrivalNotice: foundGAN, type: WORKSHEET_TYPE.UNLOADING, status: ORDER_STATUS.DONE },
|
|
@@ -129,11 +130,14 @@ export async function renderKimedaGRN({ grnNo }, context: any) {
|
|
|
129
130
|
company_address: domainBizplace.company.address,
|
|
130
131
|
order_no: foundGRN.name,
|
|
131
132
|
gan_no: foundGAN.name,
|
|
133
|
+
gan_accepted_at: foundGAN.acceptedAt ? DateTimeConverter.datetime(foundGAN.acceptedAt, timezoneOffSet) : '',
|
|
132
134
|
unload_date: DateTimeConverter.date(foundWS.endedAt),
|
|
133
135
|
ref_no: ownRefNo ? `${foundGAN.name} / ${foundGAN.refNo}` : `${foundGAN.name}`,
|
|
134
136
|
received_date: DateTimeConverter.date(foundWS.endedAt),
|
|
135
137
|
truck_no: foundGAN.truckNo || '',
|
|
136
138
|
container_no: foundGAN.containerNo || '',
|
|
139
|
+
delivery_order_no: foundGAN.deliveryOrderNo ? foundGAN.deliveryOrderNo : '',
|
|
140
|
+
account_no: foundPartnerCP ? foundPartnerCP.accountNo : '',
|
|
137
141
|
unloaded_by: foundWS ? foundWS.updater.name : '',
|
|
138
142
|
putaway_by: foundPutawayWS ? foundPutawayWS.updater.name : '',
|
|
139
143
|
product_list: targetProducts.map((item, idx) => {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import FormData from 'form-data'
|
|
2
|
+
import fetch from 'node-fetch'
|
|
3
|
+
import { Equal, getRepository, In } from 'typeorm'
|
|
4
|
+
|
|
1
5
|
import { Attachment, STORAGE } from '@things-factory/attachment-base'
|
|
2
6
|
import { Partner } from '@things-factory/auth-base'
|
|
3
7
|
import { Bizplace, ContactPoint } from '@things-factory/biz-base'
|
|
4
8
|
import { config } from '@things-factory/env'
|
|
5
|
-
import { DeliveryOrder,
|
|
9
|
+
import { DeliveryOrder, ORDER_STATUS, OrderInventory, ReleaseGood } from '@things-factory/sales-base'
|
|
6
10
|
import { Domain } from '@things-factory/shell'
|
|
7
11
|
import { Inventory, Pallet } from '@things-factory/warehouse-base'
|
|
8
|
-
|
|
9
|
-
import fetch from 'node-fetch'
|
|
10
|
-
import { Equal, getRepository, In } from 'typeorm'
|
|
12
|
+
|
|
11
13
|
import { TEMPLATE_TYPE, WORKSHEET_STATUS, WORKSHEET_TYPE } from '../constants'
|
|
12
14
|
import { Worksheet, WorksheetDetail } from '../entities'
|
|
13
15
|
|
|
@@ -46,7 +48,7 @@ export async function renderRODO({ doNo }, context: any) {
|
|
|
46
48
|
const ownRefNo = foundRO.refNo
|
|
47
49
|
|
|
48
50
|
const partnerDomain: Partner = await getRepository(Partner).findOne({
|
|
49
|
-
where: { partnerDomain: partnerBiz.domain },
|
|
51
|
+
where: { partnerDomain: partnerBiz.domain, domain },
|
|
50
52
|
relations: ['domain']
|
|
51
53
|
})
|
|
52
54
|
|
|
@@ -202,12 +204,25 @@ export async function renderRODO({ doNo }, context: any) {
|
|
|
202
204
|
company_domain: domainBizplace.company.name,
|
|
203
205
|
company_brn: domainBizplace.company.brn,
|
|
204
206
|
company_address: domainBizplace.company.address,
|
|
207
|
+
company_email: foundWarehouseCP.email ? foundWarehouseCP.email : null,
|
|
205
208
|
company_phone: foundWarehouseCP ? foundWarehouseCP.phone : null,
|
|
209
|
+
warehouse_address: foundWarehouseCP ? foundWarehouseCP.address : null,
|
|
210
|
+
warehouse_address2: foundWarehouseCP ? foundWarehouseCP.address2 : null,
|
|
211
|
+
warehouse_postcode: foundWarehouseCP ? foundWarehouseCP.postCode : null,
|
|
212
|
+
warehouse_city: foundWarehouseCP ? foundWarehouseCP.city : null,
|
|
213
|
+
warehouse_state: foundWarehouseCP ? foundWarehouseCP.state : null,
|
|
206
214
|
warehouse_phone: foundWarehouseCP ? foundWarehouseCP.phone : null,
|
|
207
|
-
|
|
215
|
+
warehouse_fax: foundWarehouseCP ? foundWarehouseCP.fax : null,
|
|
216
|
+
warehouse_email: foundWarehouseCP ? foundWarehouseCP.email : null,
|
|
208
217
|
customer_name: foundCP ? foundCP.name : null,
|
|
209
218
|
customer_delivery_address: foundCP ? foundCP.address : null,
|
|
210
219
|
customer_billing_address: foundCP ? foundCP.billingAddress : null,
|
|
220
|
+
new_delivery_address: foundRO?.deliveryAddress1 || null,
|
|
221
|
+
new_delivery_address2: foundRO?.deliveryAddress2 || null,
|
|
222
|
+
new_billing_address: foundRO?.billingAddress || null,
|
|
223
|
+
new_attention_to: foundRO?.attentionTo || null,
|
|
224
|
+
new_attention_company: foundRO?.attentionCompany || null,
|
|
225
|
+
new_phone_no: foundRO?.phone1 || null,
|
|
211
226
|
customer_phone: foundCP ? foundCP.phone : null,
|
|
212
227
|
customer_fax: foundCP ? foundCP.fax : null,
|
|
213
228
|
customer_email: foundCP ? foundCP.email : null,
|
|
@@ -215,6 +230,7 @@ export async function renderRODO({ doNo }, context: any) {
|
|
|
215
230
|
own_collection: ownTransportFlag ? '[SELF-COLLECTION]' : `[${domain.brandName} TRANSPORT]`,
|
|
216
231
|
destination: foundDO.to || '',
|
|
217
232
|
ro_no: foundRO.name,
|
|
233
|
+
ro_created_at: foundRO.createdAt ? foundRO.createdAt : '',
|
|
218
234
|
ref_no: ownRefNo ? `${foundRO.name} / ${foundRO.refNo}` : `${foundRO.name}`,
|
|
219
235
|
ref_no_only: ownRefNo ? `${foundRO.refNo}` : '',
|
|
220
236
|
ref_no2: foundRO.refNo2 ? `${foundRO.refNo2}` : '',
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
+
import FormData from 'form-data'
|
|
2
|
+
import fetch from 'node-fetch'
|
|
3
|
+
import { EntityManager, getManager, getRepository } from 'typeorm'
|
|
4
|
+
|
|
1
5
|
import { Attachment, STORAGE } from '@things-factory/attachment-base'
|
|
2
6
|
import { Partner } from '@things-factory/auth-base'
|
|
3
7
|
import { Bizplace, ContactPoint } from '@things-factory/biz-base'
|
|
4
8
|
import { config } from '@things-factory/env'
|
|
5
|
-
import {
|
|
6
|
-
ArrivalNotice,
|
|
7
|
-
GoodsReceivalNote,
|
|
8
|
-
OrderProduct,
|
|
9
|
-
OrderInventory,
|
|
10
|
-
ORDER_PRODUCT_STATUS,
|
|
11
|
-
ORDER_STATUS
|
|
12
|
-
} from '@things-factory/sales-base'
|
|
13
|
-
import { Inventory } from '@things-factory/warehouse-base'
|
|
9
|
+
import { ArrivalNotice, GoodsReceivalNote, ORDER_STATUS } from '@things-factory/sales-base'
|
|
14
10
|
import { Domain } from '@things-factory/shell'
|
|
15
|
-
|
|
16
|
-
import fetch from 'node-fetch'
|
|
17
|
-
import { getRepository, getManager, EntityManager } from 'typeorm'
|
|
11
|
+
|
|
18
12
|
import { TEMPLATE_TYPE, WORKSHEET_TYPE } from '../constants'
|
|
19
13
|
import { Worksheet } from '../entities'
|
|
20
14
|
import { DateTimeConverter } from '../utils/datetime-util'
|
|
@@ -74,6 +68,8 @@ export async function renderSeebuuGRN({ grnNo }, context: any) {
|
|
|
74
68
|
`
|
|
75
69
|
select op.id, op."name", op.description, op."type", op.batch_id, op.adjusted_batch_id, op.adjusted_pallet_qty, op.packing_type,
|
|
76
70
|
ih.uom, op.uom_value, ih.qty, op.pallet_qty, op.actual_pallet_qty, op.total_uom_value, op.release_qty,
|
|
71
|
+
coalesce((select nett_weight from product_details prdw where prdw.product_id = op.product_id and prdw.packing_type = op.packing_type and prdw.packing_size = op.packing_size order by nett_weight desc limit 1),0) as unit_nett_weight,
|
|
72
|
+
coalesce((select gross_weight from product_details prdw where prdw.product_id = op.product_id and prdw.packing_type = op.packing_type and prdw.packing_size = op.packing_size order by nett_weight desc limit 1),0) as unit_gross_weight,
|
|
77
73
|
op.unit_price, op.unpack_uom_value, op.unpack_qty, op.discount_amt, op.tax_rate, op.misc_amt,
|
|
78
74
|
op.adjusted_packing_type, op.manufacture_year, op.adjusted_uom, op.adjusted_uom_value, op.adjusted_pack_qty, op.adjusted_total_uom_value,
|
|
79
75
|
op.batch_id_ref, op.adjusted_batch_id_ref,
|
|
@@ -178,6 +174,10 @@ export async function renderSeebuuGRN({ grnNo }, context: any) {
|
|
|
178
174
|
product_batch: item.batch_id,
|
|
179
175
|
product_qty: item.qty,
|
|
180
176
|
product_uom_value: `${Math.round(item.uom_value * 100) / 100} ${item.uom}`,
|
|
177
|
+
product_unit_nett_weight: parseFloat(item.unit_nett_weight),
|
|
178
|
+
product_total_nett_weight: parseFloat(item.unit_nett_weight) * parseFloat(item.qty),
|
|
179
|
+
product_unit_gross_weight: parseFloat(item.unit_gross_weight),
|
|
180
|
+
product_total_gross_weight: parseFloat(item.unit_gross_weight) * parseFloat(item.qty),
|
|
181
181
|
pallet_qty: item.actual_pallet_qty,
|
|
182
182
|
expiry_date: item.expiration_date,
|
|
183
183
|
remark: (item.remark ? item.remark : '') + (item.issue ? ' [Issue]: ' + item.issue : '')
|