@things-factory/worksheet-base 4.3.129 → 4.3.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist-server/controllers/outbound/loading-worksheet-controller.js +8 -1
  2. package/dist-server/controllers/outbound/loading-worksheet-controller.js.map +1 -1
  3. package/dist-server/controllers/outbound/packing-worksheet-controller.js +8 -8
  4. package/dist-server/controllers/outbound/packing-worksheet-controller.js.map +1 -1
  5. package/dist-server/controllers/outbound/picking-worksheet-controller.js +0 -2
  6. package/dist-server/controllers/outbound/picking-worksheet-controller.js.map +1 -1
  7. package/dist-server/controllers/pos/index.js +18 -0
  8. package/dist-server/controllers/pos/index.js.map +1 -0
  9. package/dist-server/controllers/pos/xilnex-controller.js +183 -0
  10. package/dist-server/controllers/pos/xilnex-controller.js.map +1 -0
  11. package/dist-server/graphql/resolvers/worksheet/confirm-cancellation-release-order.js +33 -35
  12. package/dist-server/graphql/resolvers/worksheet/confirm-cancellation-release-order.js.map +1 -1
  13. package/dist-server/graphql/resolvers/worksheet/loading/complete-loading.js +11 -0
  14. package/dist-server/graphql/resolvers/worksheet/loading/complete-loading.js.map +1 -1
  15. package/dist-server/graphql/resolvers/worksheet/packing/complete-packing.js +22 -0
  16. package/dist-server/graphql/resolvers/worksheet/packing/complete-packing.js.map +1 -1
  17. package/dist-server/graphql/resolvers/worksheet/picking/activate-batch-picking.js +32 -14
  18. package/dist-server/graphql/resolvers/worksheet/picking/activate-batch-picking.js.map +1 -1
  19. package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js +7 -1
  20. package/dist-server/graphql/resolvers/worksheet/picking/complete-batch-picking.js.map +1 -1
  21. package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js +39 -42
  22. package/dist-server/graphql/resolvers/worksheet/picking/complete-picking.js.map +1 -1
  23. package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading-partially.js +13 -0
  24. package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading-partially.js.map +1 -1
  25. package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading.js +11 -0
  26. package/dist-server/graphql/resolvers/worksheet/unloading/complete-unloading.js.map +1 -1
  27. package/package.json +18 -19
  28. package/server/controllers/outbound/loading-worksheet-controller.ts +11 -4
  29. package/server/controllers/outbound/packing-worksheet-controller.ts +14 -16
  30. package/server/controllers/outbound/picking-worksheet-controller.ts +0 -2
  31. package/server/controllers/pos/index.ts +1 -0
  32. package/server/controllers/pos/xilnex-controller.ts +218 -0
  33. package/server/graphql/resolvers/worksheet/confirm-cancellation-release-order.ts +34 -38
  34. package/server/graphql/resolvers/worksheet/loading/complete-loading.ts +14 -0
  35. package/server/graphql/resolvers/worksheet/packing/complete-packing.ts +24 -0
  36. package/server/graphql/resolvers/worksheet/picking/activate-batch-picking.ts +35 -17
  37. package/server/graphql/resolvers/worksheet/picking/complete-batch-picking.ts +8 -1
  38. package/server/graphql/resolvers/worksheet/picking/complete-picking.ts +45 -47
  39. package/server/graphql/resolvers/worksheet/unloading/complete-unloading-partially.ts +19 -1
  40. package/server/graphql/resolvers/worksheet/unloading/complete-unloading.ts +14 -0
  41. package/LICENSE.md +0 -21
@@ -1,8 +1,8 @@
1
1
  import { EntityManager, In } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
- // import { logger } from '@things-factory/env'
5
- // import { Account, AccountingAPI } from '@things-factory/integration-accounting'
4
+ import { logger } from '@things-factory/env'
5
+ import { Account, AccountingAPI } from '@things-factory/integration-accounting'
6
6
  import {
7
7
  DeliveryOrder,
8
8
  ORDER_INVENTORY_STATUS,
@@ -30,8 +30,6 @@ export const confirmCancellationReleaseOrder = {
30
30
  'orderInventories',
31
31
  'orderInventories.inventory',
32
32
  'orderInventories.inventory.location',
33
- 'orderInventories.inventory.product',
34
- 'orderInventories.inventory.productDetail',
35
33
  'orderVass'
36
34
  ]
37
35
  })
@@ -196,40 +194,38 @@ export const confirmCancellationReleaseOrder = {
196
194
  releaseGood.updater = user
197
195
  await tx.getRepository(ReleaseGood).save(releaseGood)
198
196
 
199
- // if (releaseGood?.refNo3 && releaseGood?.type == 'b2c') {
200
- // const account: Account = await tx
201
- // .getRepository(Account)
202
- // .findOne({ domain: releaseGood.bizplace.domain, status: 'active' })
203
-
204
- // // Xilnex create shipment and create sales return if sales invoice is completed
205
- // const createSalesReturn = async account => {
206
- // if (account) {
207
- // await getManager().transaction(async txMgr => {
208
- // if (account.platform == 'xilnex') {
209
- // try {
210
- // await AccountingAPI.createShipment(account, {
211
- // releaseGood,
212
- // orderProducts: releaseGood.orderProducts
213
- // })
214
- // } catch (error) {
215
- // logger.error(`confirm-cancellation-release-order[createShipment]: ${error}`)
216
- // }
217
-
218
- // try {
219
- // await AccountingAPI.createSalesReturn(account, {
220
- // releaseGood,
221
- // orderProducts: releaseGood.orderProducts
222
- // })
223
- // } catch (error) {
224
- // logger.error(`confirm-cancellation-release-order[createSalesReturn]: ${error}`)
225
- // }
226
- // }
227
- // })
228
- // }
229
- // }
230
-
231
- // createSalesReturn(account)
232
- // }
197
+ if (releaseGood?.refNo3 && releaseGood?.type == 'b2c') {
198
+ const account: Account = await tx
199
+ .getRepository(Account)
200
+ .findOne({ domain: releaseGood.bizplace.domain, status: 'active' })
201
+
202
+ // Xilnex create shipment and create sales return if sales invoice is completed
203
+ const createSalesReturn = async account => {
204
+ if (account) {
205
+ if (account.platform == 'xilnex') {
206
+ try {
207
+ await AccountingAPI.createShipment(account, {
208
+ releaseGood,
209
+ orderProducts: releaseGood.orderProducts
210
+ })
211
+ } catch (error) {
212
+ logger.error(`confirm-cancellation-release-order[createShipment]: ${error}`)
213
+ }
214
+
215
+ try {
216
+ await AccountingAPI.createSalesReturn(account, {
217
+ releaseGood,
218
+ orderProducts: releaseGood.orderProducts
219
+ })
220
+ } catch (error) {
221
+ logger.error(`confirm-cancellation-release-order[createSalesReturn]: ${error}`)
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+ createSalesReturn(account)
228
+ }
233
229
 
234
230
  return
235
231
  }
@@ -2,6 +2,7 @@ import { EntityManager } from 'typeorm'
2
2
 
3
3
  import { ApplicationType, User } from '@things-factory/auth-base'
4
4
  import { Bizplace, Company } from '@things-factory/biz-base'
5
+ import { Account } from '@things-factory/integration-accounting'
5
6
  import { FulfillmentCenter } from '@things-factory/integration-fulfillment'
6
7
  import { Sftp, SftpAPI } from '@things-factory/integration-sftp'
7
8
  import { ORDER_INVENTORY_STATUS, ORDER_STATUS, OrderInventory, ReleaseGood } from '@things-factory/sales-base'
@@ -10,6 +11,7 @@ import { InventoryItem } from '@things-factory/warehouse-base'
10
11
 
11
12
  import { WORKSHEET_TYPE } from '../../../../constants'
12
13
  import { LoadingWorksheetController, ReturningWorksheetController } from '../../../../controllers'
14
+ import { XilnexController } from '../../../../controllers/pos'
13
15
  import { Worksheet, WorksheetDetail } from '../../../../entities'
14
16
 
15
17
  export const completeLoadingResolver = {
@@ -98,6 +100,18 @@ export async function completeLoading(
98
100
  }
99
101
  break
100
102
 
103
+ case ApplicationType.XILNEX:
104
+ const xilnex: Account = await tx
105
+ .getRepository(Account)
106
+ .findOne({ where: { domain: releaseGood.bizplace.domain, status: 'active', platform: 'xilnex' } })
107
+
108
+ if (xilnex) {
109
+ const xilnexCtrl: XilnexController = new XilnexController(tx, domain, user)
110
+ await xilnexCtrl.deliveryTransferNote(tx, xilnex, releaseGood.id)
111
+ }
112
+
113
+ break
114
+
101
115
  default:
102
116
  break
103
117
  }
@@ -2,9 +2,13 @@ import { EntityManager } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { Bizplace, getMyBizplace } from '@things-factory/biz-base'
5
+ import { logger } from '@things-factory/env'
6
+ import { Account } from '@things-factory/integration-accounting'
7
+ import { ReleaseGood } from '@things-factory/sales-base'
5
8
  import { Domain } from '@things-factory/shell'
6
9
 
7
10
  import { PackingWorksheetController } from '../../../../controllers/'
11
+ import { XilnexController } from '../../../../controllers/pos'
8
12
  import { WorksheetController } from '../../../../controllers/worksheet-controller'
9
13
 
10
14
  export const completePackingResolver = {
@@ -12,6 +16,26 @@ export const completePackingResolver = {
12
16
  const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
13
17
  await completePacking(tx, domain, user, releaseGoodNo)
14
18
 
19
+ const releaseGood: ReleaseGood = await tx.getRepository(ReleaseGood).findOne({
20
+ where: { name: releaseGoodNo, domain },
21
+ relations: ['bizplace', 'bizplace.domain']
22
+ })
23
+
24
+ if (releaseGood.type == 'b2c') {
25
+ const xilnex: Account = await tx
26
+ .getRepository(Account)
27
+ .findOne({ where: { domain: releaseGood.bizplace.domain, status: 'active', platform: 'xilnex' } })
28
+
29
+ if (xilnex) {
30
+ try {
31
+ const xilnexCtrl: XilnexController = new XilnexController(tx, domain, user)
32
+ await xilnexCtrl.createShipment(tx, xilnex, releaseGood.id)
33
+ } catch (error) {
34
+ logger.error(`worksheet-base[completePacking]: ${error}`)
35
+ }
36
+ }
37
+ }
38
+
15
39
  const bizplace: Bizplace = await getMyBizplace(domain, user)
16
40
  const worksheetController: WorksheetController = new WorksheetController(tx, domain, user)
17
41
  await worksheetController.notifyToCustomer(bizplace, {
@@ -1,4 +1,4 @@
1
- import { EntityManager } from 'typeorm'
1
+ import { EntityManager, getConnection } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { MarketplaceStore } from '@things-factory/integration-marketplace'
@@ -6,6 +6,7 @@ import { Domain } from '@things-factory/shell'
6
6
 
7
7
  import { EcommerceController, PickingWorksheetController } from '../../../../controllers'
8
8
  import { Worksheet } from '../../../../entities'
9
+ import { logger } from '@things-factory/env'
9
10
 
10
11
  export const activateBatchPickingResolver = {
11
12
  async activateBatchPicking(_: any, { worksheetNo }, context: any) {
@@ -20,21 +21,38 @@ export async function activateBatchPicking(
20
21
  user: User,
21
22
  worksheetNo: string
22
23
  ): Promise<Worksheet> {
23
- const worksheetController: PickingWorksheetController = new PickingWorksheetController(tx, domain, user)
24
- const worksheet = await worksheetController.activateBatchPicking(worksheetNo)
25
- const worksheetDetails = worksheet.worksheetDetails
26
- const companyDomain: Domain = worksheet?.bizplace.company.domain
27
-
28
- // find for any existing marketplace store connections
29
- const marketplaceStores: MarketplaceStore[] = await tx.getRepository(MarketplaceStore).find({
30
- where: { domain: companyDomain, status: 'ACTIVE', isAutoUpdateStockQty: true },
31
- relations: ['marketplaceDistributors']
32
- })
33
-
34
- if (marketplaceStores?.length && marketplaceStores.some(store => store.isAutoUpdateStockQty)) {
35
- let orderInventories: any[] = worksheetDetails.map(wsd => wsd.targetInventory)
36
- const ecommerceCtrl: EcommerceController = new EcommerceController(tx, domain, user)
37
- await ecommerceCtrl.updateProductVariationStock(marketplaceStores, orderInventories, companyDomain)
24
+ try {
25
+ const worksheetController: PickingWorksheetController = new PickingWorksheetController(tx, domain, user)
26
+ const worksheet = await worksheetController.activateBatchPicking(worksheetNo)
27
+ const worksheetDetails = worksheet.worksheetDetails
28
+ const companyDomain: Domain = worksheet?.bizplace.company.domain
29
+
30
+ // find for any existing marketplace store connections
31
+ const marketplaceStores: MarketplaceStore[] = await tx.getRepository(MarketplaceStore).find({
32
+ where: { domain: companyDomain, status: 'ACTIVE', isAutoUpdateStockQty: true },
33
+ relations: ['marketplaceDistributors']
34
+ })
35
+
36
+ const updateMarketplaceProductVariationStock = async (worksheetDetails, domain, user, marketplaceStores, companyDomain) => {
37
+ try {
38
+ await getConnection().transaction(async (tx2: EntityManager) => {
39
+ let orderInventories: any[] = worksheetDetails.map(wsd => wsd.targetInventory)
40
+ const ecommerceCtrl: EcommerceController = new EcommerceController(tx2, domain, user)
41
+ await ecommerceCtrl.updateProductVariationStock(marketplaceStores, orderInventories, companyDomain)
42
+ })
43
+ } catch (error) {
44
+ logger.error(`activate-batch-picking[activateBatchPicking]: ${worksheetNo + ':' + error}`)
45
+ }
46
+ }
47
+
48
+ if (marketplaceStores?.length && marketplaceStores.some(store => store.isAutoUpdateStockQty)) {
49
+ updateMarketplaceProductVariationStock(worksheetDetails, domain, user, marketplaceStores, companyDomain)
50
+ }
51
+
52
+ return worksheet
53
+
54
+ } catch (error) {
55
+ logger.error(`activate-batch-picking[activateBatchPicking]: ${worksheetNo + ':' + error}`)
56
+ throw new Error('Something went wrong. Please contact support.')
38
57
  }
39
- return worksheet
40
58
  }
@@ -6,6 +6,7 @@ import { MarketplaceStore } from '@things-factory/integration-marketplace'
6
6
  import { Sellercraft, SellercraftStatus } from '@things-factory/integration-sellercraft'
7
7
  import { MarketplaceOrder } from '@things-factory/marketplace-base'
8
8
  import { OrderInventory, ReleaseGood } from '@things-factory/sales-base'
9
+ import { Setting } from '@things-factory/setting-base'
9
10
  import { Domain } from '@things-factory/shell'
10
11
 
11
12
  import {
@@ -88,7 +89,13 @@ export async function completeBatchPicking(
88
89
  }
89
90
  }
90
91
 
91
- sellercraftCtrl.initiateOrderShipment(sellercraft, foundReleaseGood)
92
+ const rtsTriggerLevel: Setting = await tx.getRepository(Setting).findOne({
93
+ where: { domain, category: 'id-rule', name: 'rts-trigger-level' }
94
+ })
95
+
96
+ if (rtsTriggerLevel && parseInt(rtsTriggerLevel?.value || 0) == 1) {
97
+ sellercraftCtrl.initiateOrderShipment(sellercraft, foundReleaseGood)
98
+ }
92
99
  }
93
100
  break
94
101
 
@@ -2,8 +2,8 @@ import { EntityManager, getManager } from 'typeorm'
2
2
 
3
3
  import { ApplicationType, User } from '@things-factory/auth-base'
4
4
  import { Bizplace, ContactPoint, getMyBizplace } from '@things-factory/biz-base'
5
- // import { logger } from '@things-factory/env'
6
- // import { Account, AccountingAPI } from '@things-factory/integration-accounting'
5
+ import { logger } from '@things-factory/env'
6
+ import { Account, AccountingAPI } from '@things-factory/integration-accounting'
7
7
  import { LastMileAPI, LastMileDelivery } from '@things-factory/integration-lmd'
8
8
  import { MarketplaceStore, MarketplaceTransporter } from '@things-factory/integration-marketplace'
9
9
  import { Sellercraft, SellercraftStatus } from '@things-factory/integration-sellercraft'
@@ -255,51 +255,49 @@ export async function completePicking(
255
255
  break
256
256
  }
257
257
 
258
- // const account: Account = await tx
259
- // .getRepository(Account)
260
- // .findOne({ domain: releaseGood.bizplace.domain, status: 'active' })
261
-
262
- // // Xilnex Create Sales Order and Post Sales Order to Sales Invoice
263
- // const createSalesOrder = async account => {
264
- // if (account) {
265
- // try {
266
- // await getManager().transaction(async txMgr => {
267
- // if (account.platform == 'xilnex') {
268
- // const salesOrder: any = await AccountingAPI.createSalesOrder(account, {
269
- // releaseGood,
270
- // orderProducts: releaseGood.orderProducts
271
- // })
272
-
273
- // if (salesOrder) {
274
- // const salesInvoice: any = await AccountingAPI.postSalesOrderToSalesInvoice(account, {
275
- // orderId: salesOrder?.id || null
276
- // })
277
-
278
- // const salesOrderItems: any = salesInvoice.sale.items
279
- // await Promise.all(
280
- // releaseGood.orderProducts.map(async op => {
281
- // const matchedProduct: any = salesOrderItems.find(soi => soi.itemId == op.productDetail.refCode)
282
- // if (matchedProduct) {
283
- // await tx.getRepository(OrderProduct).update({ id: op.id }, { refItemId: matchedProduct.id })
284
- // }
285
- // })
286
- // )
287
-
288
- // await txMgr
289
- // .getRepository(ReleaseGood)
290
- // .update({ id: releaseGood.id }, { refNo3: salesInvoice.salesId, updater: releaseGood.updater })
291
- // }
292
- // }
293
- // })
294
- // } catch (error) {
295
- // logger.error(`complete-picking[createSalesOrder]: ${error}`)
296
- // }
297
- // }
298
- // }
299
-
300
- // if (releaseGood.type == 'b2c') {
301
- // createSalesOrder(account)
302
- // }
258
+ const account: Account = await tx
259
+ .getRepository(Account)
260
+ .findOne({ domain: releaseGood.bizplace.domain, status: 'active' })
261
+
262
+ // Xilnex Create Sales Order and Post Sales Order to Sales Invoice
263
+ const createSalesOrder = async (account, tx) => {
264
+ if (account) {
265
+ try {
266
+ if (account.platform == 'xilnex') {
267
+ const salesOrder: any = await AccountingAPI.createSalesOrder(account, {
268
+ releaseGood,
269
+ orderProducts: releaseGood.orderProducts
270
+ })
271
+
272
+ if (salesOrder) {
273
+ const salesInvoice: any = await AccountingAPI.postSalesOrderToSalesInvoice(account, {
274
+ orderId: salesOrder?.id || null
275
+ })
276
+
277
+ const salesOrderItems: any = salesInvoice.sale.items
278
+ await Promise.all(
279
+ releaseGood.orderProducts.map(async op => {
280
+ const matchedProduct: any = salesOrderItems.find(soi => soi.itemId == op.productDetail.refCode)
281
+ if (matchedProduct) {
282
+ await tx.getRepository(OrderProduct).update({ id: op.id }, { refItemId: matchedProduct.id })
283
+ }
284
+ })
285
+ )
286
+
287
+ await tx
288
+ .getRepository(ReleaseGood)
289
+ .update({ id: releaseGood.id }, { collectionOrderNo: salesInvoice.salesId, updater: releaseGood.updater })
290
+ }
291
+ }
292
+ } catch (error) {
293
+ logger.error(`complete-picking[createSalesOrder]: ${error}`)
294
+ }
295
+ }
296
+ }
297
+
298
+ if (releaseGood.type == 'b2c') {
299
+ await createSalesOrder(account, tx)
300
+ }
303
301
 
304
302
  if (releaseGood.packingOption) {
305
303
  const packingWSCtrl: PackingWorksheetController = new PackingWorksheetController(tx, domain, user)
@@ -1,13 +1,31 @@
1
+ import { EntityManager } from 'typeorm'
2
+
1
3
  import { User } from '@things-factory/auth-base'
4
+ import { Account } from '@things-factory/integration-accounting'
5
+ import { ArrivalNotice } from '@things-factory/sales-base'
2
6
  import { Domain } from '@things-factory/shell'
3
- import { EntityManager } from 'typeorm'
7
+
4
8
  import { UnloadingWorksheetController } from '../../../../controllers'
9
+ import { XilnexController } from '../../../../controllers/pos'
5
10
  import { WorksheetDetail } from '../../../../entities'
6
11
 
7
12
  export const completeUnloadingPartiallyResolver = {
8
13
  async completeUnloadingPartially(_: any, { arrivalNoticeNo, worksheetDetail }, context: any) {
9
14
  const { tx, domain, user }: { tx: EntityManager; domain: Domain; user: User } = context.state
10
15
  await completeUnloadingPartially(tx, domain, user, arrivalNoticeNo, worksheetDetail)
16
+
17
+ const arrivalNotice: ArrivalNotice = await tx
18
+ .getRepository(ArrivalNotice)
19
+ .findOne({ where: { name: arrivalNoticeNo, domain }, relations: ['domain', 'bizplace', 'bizplace.domain'] })
20
+
21
+ const xilnex: Account = await tx
22
+ .getRepository(Account)
23
+ .findOne({ where: { domain: arrivalNotice.bizplace.domain, status: 'active', platform: 'xilnex' } })
24
+
25
+ if (xilnex) {
26
+ const xilnexCtrl: XilnexController = new XilnexController(tx, domain, user)
27
+ await xilnexCtrl.createPartialUnloadInboundDocument(tx, xilnex, arrivalNotice, worksheetDetail)
28
+ }
11
29
  }
12
30
  }
13
31
 
@@ -2,12 +2,14 @@ import { EntityManager, In } from 'typeorm'
2
2
 
3
3
  import { User } from '@things-factory/auth-base'
4
4
  import { Bizplace } from '@things-factory/biz-base'
5
+ import { Account } from '@things-factory/integration-accounting'
5
6
  import { ArrivalNotice, generateGoodsReceivalNote } from '@things-factory/sales-base'
6
7
  import { Domain } from '@things-factory/shell'
7
8
  import { Inventory, INVENTORY_STATUS } from '@things-factory/warehouse-base'
8
9
 
9
10
  import { WORKSHEET_STATUS } from '../../../../constants'
10
11
  import { PutawayWorksheetController, UnloadingWorksheetController } from '../../../../controllers'
12
+ import { XilnexController } from '../../../../controllers/pos'
11
13
  import { Worksheet, WorksheetDetail } from '../../../../entities'
12
14
 
13
15
  export const completeUnloadingResolver = {
@@ -37,6 +39,8 @@ export const completeUnloadingResolver = {
37
39
  where: { domain, refOrderId: arrivalNotice.id, status: In([INVENTORY_STATUS.UNLOADED, INVENTORY_STATUS.CHECKED]) }
38
40
  })
39
41
 
42
+ const inventoryIds: string[] = inventories.map(iv => iv.id)
43
+
40
44
  putawayWorksheet = await putawayWSCtrl.generatePutawayWorksheet(arrivalNotice.name, inventories)
41
45
 
42
46
  if (putawayWorksheet.status === WORKSHEET_STATUS.DEACTIVATED) {
@@ -46,6 +50,16 @@ export const completeUnloadingResolver = {
46
50
  const bizplaceId: Bizplace = arrivalNotice.bizplace.id
47
51
  await generateGoodsReceivalNote({ refNo: arrivalNoticeNo, customer: bizplaceId }, domain, user, tx)
48
52
 
53
+ const customerDomain: Domain = arrivalNotice.bizplace.domain
54
+ const xilnex: Account = await tx
55
+ .getRepository(Account)
56
+ .findOne({ where: { domain: customerDomain, status: 'active', platform: 'xilnex' } })
57
+
58
+ if (xilnex) {
59
+ const xilnexCtrl: XilnexController = new XilnexController(tx, domain, user)
60
+ await xilnexCtrl.createInboundDocument(tx, xilnex, arrivalNotice.id, inventoryIds)
61
+ }
62
+
49
63
  const worksheetController: UnloadingWorksheetController = new UnloadingWorksheetController(tx, domain, user)
50
64
  worksheetController.notifyToOfficeAdmin({
51
65
  title: `Unloading Completed (${arrivalNotice.bizplace.name}, ${arrivalNotice.name})`,
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Hatiolab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.