@things-factory/operato-wms 4.1.29 → 4.1.32
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/order/release-order/b2b/b2b-order-list.js +41 -18
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +40 -18
- package/client/pages/outbound/packing-product.js +86 -81
- package/client/pages/report/outbound-order-details-report.js +64 -9
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +53 -48
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +3 -0
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
- package/package.json +5 -5
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +54 -48
- package/server/graphql/types/reports/outbound-order-details-report.ts +3 -0
- package/translations/en.json +10 -5
- package/translations/ko.json +7 -1
- package/translations/ms.json +7 -1
- package/translations/zh.json +7 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
import '../batch-picking-popup'
|
|
4
|
-
import '../batch-generate-single-picking-worksheet-popup'
|
|
5
4
|
|
|
6
5
|
import gql from 'graphql-tag'
|
|
7
6
|
import { css, html } from 'lit-element'
|
|
8
7
|
|
|
9
8
|
import { getCodeByName } from '@things-factory/code-base'
|
|
10
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
11
|
-
import { client, navigate, PageView } from '@things-factory/shell'
|
|
10
|
+
import { client, navigate, PageView, CustomAlert } from '@things-factory/shell'
|
|
12
11
|
import { openPopup } from '@things-factory/layout-base'
|
|
13
12
|
import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
|
|
14
13
|
import { isMobileDevice } from '@things-factory/utils'
|
|
@@ -73,7 +72,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
73
72
|
},
|
|
74
73
|
{
|
|
75
74
|
title: i18next.t('button.generate_worksheet'),
|
|
76
|
-
action: this.
|
|
75
|
+
action: this._generatePickingWorksheet.bind(this),
|
|
77
76
|
...CommonButtonStyles.activate
|
|
78
77
|
}
|
|
79
78
|
)
|
|
@@ -222,6 +221,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
222
221
|
pagination: { limit: 100, pages: [20, 50, 100, 200, 500] },
|
|
223
222
|
columns: [
|
|
224
223
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
224
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
225
225
|
{
|
|
226
226
|
type: 'gutter',
|
|
227
227
|
gutterName: 'button',
|
|
@@ -502,22 +502,45 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
502
502
|
)
|
|
503
503
|
}
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
title: i18next.t('title.
|
|
505
|
+
async _generatePickingWorksheet() {
|
|
506
|
+
try {
|
|
507
|
+
let releaseGoodNos = []
|
|
508
|
+
if (this.dataGrist.selected.length <= 0)
|
|
509
|
+
throw new Error(i18next.t('text.please_select_one_or_more_order_to_generate_worksheet'))
|
|
510
|
+
|
|
511
|
+
let readyToPick = this.dataGrist.selected.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
|
|
512
|
+
releaseGoodNos = readyToPick.map(record => record.name)
|
|
513
|
+
|
|
514
|
+
if (releaseGoodNos.length <= 0)
|
|
515
|
+
throw new Error(i18next.t('text.selected_release_order(s)_has_existing_worksheet'))
|
|
516
|
+
|
|
517
|
+
let result = await CustomAlert({
|
|
518
|
+
title: i18next.t('title.are_you_sure'),
|
|
519
|
+
text: i18next.t('text.generate_worksheet'),
|
|
520
|
+
confirmButton: { text: i18next.t('button.submit') },
|
|
521
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
if (!result.value) return
|
|
525
|
+
|
|
526
|
+
const response = await client.mutate({
|
|
527
|
+
mutation: gql`
|
|
528
|
+
mutation generateMultipleReleaseGoodWorksheet($releaseGoodNos: [String!]) {
|
|
529
|
+
generateMultipleReleaseGoodWorksheet(releaseGoodNos: $releaseGoodNos)
|
|
530
|
+
}
|
|
531
|
+
`,
|
|
532
|
+
variables: {
|
|
533
|
+
releaseGoodNos
|
|
534
|
+
}
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
if (!response.errors) {
|
|
538
|
+
navigate('single_outbound_worksheets')
|
|
539
|
+
this._showToast({ message: i18next.t('text.worksheet(s)_has_been_generated') })
|
|
519
540
|
}
|
|
520
|
-
)
|
|
541
|
+
} catch (e) {
|
|
542
|
+
this._showToast(e)
|
|
543
|
+
}
|
|
521
544
|
}
|
|
522
545
|
|
|
523
546
|
_compareValues(key, order = 'asc') {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
import '../batch-picking-popup'
|
|
4
|
-
import '../batch-generate-single-picking-worksheet-popup'
|
|
5
4
|
|
|
6
5
|
import gql from 'graphql-tag'
|
|
7
6
|
import { css, html } from 'lit-element'
|
|
@@ -12,7 +11,7 @@ import { GhostPrint } from '@operato/ghost-print'
|
|
|
12
11
|
import { getCodeByName } from '@things-factory/code-base'
|
|
13
12
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
14
13
|
import { openPopup } from '@things-factory/layout-base'
|
|
15
|
-
import { client, navigate, PageView, store } from '@things-factory/shell'
|
|
14
|
+
import { client, navigate, PageView, store, CustomAlert } from '@things-factory/shell'
|
|
16
15
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
17
16
|
import { isMobileDevice } from '@things-factory/utils'
|
|
18
17
|
|
|
@@ -91,7 +90,7 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
91
90
|
},
|
|
92
91
|
{
|
|
93
92
|
title: i18next.t('button.generate_worksheet'),
|
|
94
|
-
action: this.
|
|
93
|
+
action: this._generatePickingWorksheet.bind(this),
|
|
95
94
|
...CommonButtonStyles.activate
|
|
96
95
|
}
|
|
97
96
|
]
|
|
@@ -705,22 +704,45 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
|
|
|
705
704
|
}
|
|
706
705
|
}
|
|
707
706
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
title: i18next.t('title.
|
|
707
|
+
async _generatePickingWorksheet() {
|
|
708
|
+
try {
|
|
709
|
+
let releaseGoodNos = []
|
|
710
|
+
if (this.dataGrist.selected.length <= 0)
|
|
711
|
+
throw new Error(i18next.t('text.please_select_one_or_more_order_to_generate_worksheet'))
|
|
712
|
+
|
|
713
|
+
let readyToPick = this.dataGrist.selected.filter(itm => itm.status === ORDER_STATUS.PENDING_WORKSHEET.value)
|
|
714
|
+
releaseGoodNos = readyToPick.map(record => record.name)
|
|
715
|
+
|
|
716
|
+
if (releaseGoodNos.length <= 0)
|
|
717
|
+
throw new Error(i18next.t('text.selected_release_order(s)_has_existing_worksheet'))
|
|
718
|
+
|
|
719
|
+
let result = await CustomAlert({
|
|
720
|
+
title: i18next.t('title.are_you_sure'),
|
|
721
|
+
text: i18next.t('text.generate_worksheet'),
|
|
722
|
+
confirmButton: { text: i18next.t('button.submit') },
|
|
723
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
if (!result.value) return
|
|
727
|
+
|
|
728
|
+
const response = await client.mutate({
|
|
729
|
+
mutation: gql`
|
|
730
|
+
mutation generateMultipleReleaseGoodWorksheet($releaseGoodNos: [String!]) {
|
|
731
|
+
generateMultipleReleaseGoodWorksheet(releaseGoodNos: $releaseGoodNos)
|
|
732
|
+
}
|
|
733
|
+
`,
|
|
734
|
+
variables: {
|
|
735
|
+
releaseGoodNos
|
|
736
|
+
}
|
|
737
|
+
})
|
|
738
|
+
|
|
739
|
+
if (!response.errors) {
|
|
740
|
+
navigate('single_outbound_worksheets')
|
|
741
|
+
this._showToast({ message: i18next.t('text.worksheet(s)_has_been_generated') })
|
|
722
742
|
}
|
|
723
|
-
)
|
|
743
|
+
} catch (e) {
|
|
744
|
+
this._showToast(e)
|
|
745
|
+
}
|
|
724
746
|
}
|
|
725
747
|
|
|
726
748
|
_compareValues(key, order = 'asc') {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import '@things-factory/barcode-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
-
import './logistics-init/logistics-init-popup'
|
|
4
3
|
import '../components/worksheet-information-popup'
|
|
5
4
|
|
|
6
5
|
import gql from 'graphql-tag'
|
|
@@ -35,7 +34,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
35
34
|
_productName: String,
|
|
36
35
|
_logisticsInitiated: Boolean,
|
|
37
36
|
_selectedTaskStatus: String,
|
|
38
|
-
_worksheetInfo: Object
|
|
37
|
+
_worksheetInfo: Object,
|
|
38
|
+
_scanning: Boolean
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -215,19 +215,15 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
215
215
|
</form>
|
|
216
216
|
|
|
217
217
|
<form id="input-form" class="multi-column-form" @keypress="${this.packing.bind(this)}">
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
`}
|
|
228
|
-
</fieldset>
|
|
229
|
-
`
|
|
230
|
-
: ''}
|
|
218
|
+
<fieldset>
|
|
219
|
+
${this._enableProductScanning
|
|
220
|
+
? html` <label>${i18next.t('label.product_barcode')}</label>
|
|
221
|
+
<barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>`
|
|
222
|
+
: html`
|
|
223
|
+
<label>${i18next.t('label.packed_qty')}</label>
|
|
224
|
+
<input type="number" min="1" name="packedQty" />
|
|
225
|
+
`}
|
|
226
|
+
</fieldset>
|
|
231
227
|
</form>
|
|
232
228
|
|
|
233
229
|
<data-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.config} .data=${this.data}>
|
|
@@ -256,6 +252,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
256
252
|
this._productName = ''
|
|
257
253
|
this._selectedOrderInventory = null
|
|
258
254
|
this._selectedTaskStatus = null
|
|
255
|
+
this._scanning = false
|
|
259
256
|
}
|
|
260
257
|
|
|
261
258
|
updated(changedProps) {
|
|
@@ -274,10 +271,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
274
271
|
this._selectedOrderInventory = record
|
|
275
272
|
this._selectedTaskStatus = record.status
|
|
276
273
|
|
|
277
|
-
if (this.
|
|
278
|
-
|
|
279
|
-
else this._focusOnReleaseQtyInput()
|
|
280
|
-
}
|
|
274
|
+
if (this._enableProductScanning) this._focusOnProductBarcodeInput()
|
|
275
|
+
else this._focusOnReleaseQtyInput()
|
|
281
276
|
}
|
|
282
277
|
}
|
|
283
278
|
}
|
|
@@ -390,6 +385,13 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
390
385
|
product {
|
|
391
386
|
name
|
|
392
387
|
description
|
|
388
|
+
gtin
|
|
389
|
+
productDetails {
|
|
390
|
+
id
|
|
391
|
+
packingType
|
|
392
|
+
packingSize
|
|
393
|
+
gtin
|
|
394
|
+
}
|
|
393
395
|
}
|
|
394
396
|
qty
|
|
395
397
|
releaseQty
|
|
@@ -423,6 +425,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
423
425
|
if (!response.data?.packingWorksheet) return
|
|
424
426
|
|
|
425
427
|
const { worksheetInfo, worksheetDetailInfos } = response.data.packingWorksheet
|
|
428
|
+
this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
|
|
426
429
|
|
|
427
430
|
this.trackingNo = worksheetInfo.trackingNo
|
|
428
431
|
this.airwayBill = worksheetInfo.airwayBill
|
|
@@ -435,7 +438,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
435
438
|
this._bizplaceName = worksheetInfo.bizplaceName
|
|
436
439
|
this._worksheetInfo = worksheetInfo
|
|
437
440
|
|
|
438
|
-
this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
|
|
439
441
|
if (this._selectedOrderInventory) {
|
|
440
442
|
const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
|
|
441
443
|
if (record.packedQty == record.releaseQty) {
|
|
@@ -447,6 +449,11 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
447
449
|
|
|
448
450
|
this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
|
|
449
451
|
|
|
452
|
+
if (this._enableProductScanning) {
|
|
453
|
+
this._focusOnProductBarcodeInput()
|
|
454
|
+
} else {
|
|
455
|
+
this._focusOnReleaseQtyInput()
|
|
456
|
+
}
|
|
450
457
|
this.updateContext()
|
|
451
458
|
}
|
|
452
459
|
}
|
|
@@ -504,9 +511,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
504
511
|
}
|
|
505
512
|
|
|
506
513
|
printSellercraftAirwayBill() {
|
|
507
|
-
let
|
|
514
|
+
let convertedPdfUrl = ''
|
|
515
|
+
if (this.airwayBill.includes('partner.shopeemobile.com')) {
|
|
516
|
+
convertedPdfUrl = `/pdf/merge?urls=${this.airwayBill}`
|
|
517
|
+
} else {
|
|
518
|
+
let url = new URL(window.location)
|
|
519
|
+
convertedPdfUrl = `${url.origin}/proxy?url=${this.airwayBill}`
|
|
520
|
+
}
|
|
508
521
|
|
|
509
|
-
var convertedPdfUrl = `${url.origin}/proxy?url=${this.airwayBill}`
|
|
510
522
|
this._callPrintDialog(convertedPdfUrl)
|
|
511
523
|
}
|
|
512
524
|
|
|
@@ -609,7 +621,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
609
621
|
if (e.keyCode === 13) {
|
|
610
622
|
e.preventDefault()
|
|
611
623
|
try {
|
|
612
|
-
this._validatePacking()
|
|
624
|
+
await this._validatePacking()
|
|
613
625
|
|
|
614
626
|
let response
|
|
615
627
|
if (this._enableProductScanning) response = await this.productBarcodePacking()
|
|
@@ -618,10 +630,9 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
618
630
|
if (!response.errors) {
|
|
619
631
|
if (this._enableProductScanning) {
|
|
620
632
|
this.productBarcodeInput.value = ''
|
|
621
|
-
this.
|
|
633
|
+
this._selectedOrderInventory = null
|
|
622
634
|
} else {
|
|
623
635
|
this.releaseQtyInput.value = ''
|
|
624
|
-
this._focusOnReleaseQtyInput()
|
|
625
636
|
this._selectedTaskStatus = null
|
|
626
637
|
this._selectedOrderInventory = null
|
|
627
638
|
}
|
|
@@ -629,12 +640,25 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
629
640
|
this._fetchInventories(this.releaseGoodNo)
|
|
630
641
|
}
|
|
631
642
|
} catch (e) {
|
|
643
|
+
if (this._enableProductScanning) {
|
|
644
|
+
this.productBarcodeInput.value = ''
|
|
645
|
+
this._focusOnProductBarcodeInput()
|
|
646
|
+
} else {
|
|
647
|
+
this.releaseQtyInput.value = ''
|
|
648
|
+
this._focusOnReleaseQtyInput()
|
|
649
|
+
this._selectedTaskStatus = null
|
|
650
|
+
}
|
|
651
|
+
this._selectedOrderInventory = null
|
|
632
652
|
this._showToast(e)
|
|
653
|
+
} finally {
|
|
654
|
+
this._scanning = false
|
|
633
655
|
}
|
|
634
656
|
}
|
|
635
657
|
}
|
|
636
658
|
|
|
637
659
|
async productBarcodePacking() {
|
|
660
|
+
if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
|
|
661
|
+
this._scanning = true
|
|
638
662
|
return await client.mutate({
|
|
639
663
|
mutation: gql`
|
|
640
664
|
mutation scanProductPacking($worksheetDetailName: String!, $productBarcode: String!) {
|
|
@@ -649,6 +673,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
649
673
|
}
|
|
650
674
|
|
|
651
675
|
async commonPacking() {
|
|
676
|
+
if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
|
|
677
|
+
this._scanning = true
|
|
652
678
|
return await client.mutate({
|
|
653
679
|
mutation: gql`
|
|
654
680
|
mutation packing($worksheetDetailName: String!, $releaseQty: Int!) {
|
|
@@ -664,45 +690,47 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
664
690
|
|
|
665
691
|
async _validatePacking() {
|
|
666
692
|
// validate for order selection
|
|
667
|
-
if (
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
throw new Error(i18next.t('text.no_product_barcode_detected'))
|
|
674
|
-
}
|
|
675
|
-
} else {
|
|
676
|
-
if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
|
|
693
|
+
if (this._enableProductScanning) {
|
|
694
|
+
//if no input
|
|
695
|
+
if (!this.productBarcodeInput.value) {
|
|
696
|
+
this._focusOnProductBarcodeInput()
|
|
697
|
+
throw new Error(i18next.t('text.no_product_barcode_detected'))
|
|
698
|
+
}
|
|
677
699
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
700
|
+
//find product match with input barcode
|
|
701
|
+
const foundOrderInventory = this.data.records.filter(itm =>
|
|
702
|
+
itm.product.productDetails.filter(
|
|
703
|
+
detail =>
|
|
704
|
+
detail.gtin === this.productBarcodeInput.value.trim() &&
|
|
705
|
+
detail.packingType == itm.product.packingType &&
|
|
706
|
+
detail.packingSize == itm.product.packingSize
|
|
707
|
+
)
|
|
708
|
+
)
|
|
683
709
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
710
|
+
if (foundOrderInventory?.length > 0 && foundOrderInventory[0]?.status === WORKSHEET_STATUS.EXECUTING.value) {
|
|
711
|
+
this._selectedOrderInventory = foundOrderInventory[0]
|
|
712
|
+
} else if (foundOrderInventory?.length == 1 && foundOrderInventory[0]?.status === WORKSHEET_STATUS.DONE.value) {
|
|
713
|
+
throw new Error(i18next.t('text.scanned_product_status_is_done'))
|
|
714
|
+
} else {
|
|
715
|
+
throw new Error(i18next.t('text.incorrect_product_barcode'))
|
|
689
716
|
}
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
async _completeHandler() {
|
|
694
|
-
if (!this.data?.records?.length || this.data.records.some(record => !record.completed)) return
|
|
717
|
+
} else {
|
|
718
|
+
if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
|
|
695
719
|
|
|
696
|
-
|
|
697
|
-
title: i18next.t('title.packing'),
|
|
698
|
-
text: i18next.t('text.do_you_want_to_complete'),
|
|
699
|
-
confirmButton: { text: i18next.t('button.complete') },
|
|
700
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
701
|
-
})
|
|
720
|
+
if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
|
|
702
721
|
|
|
703
|
-
|
|
722
|
+
// Release qty existing
|
|
723
|
+
if (!parseInt(this.releaseQtyInput.value)) {
|
|
724
|
+
this._focusOnReleaseQtyInput()
|
|
725
|
+
throw new Error(i18next.t('text.release_qty_is_empty'))
|
|
726
|
+
}
|
|
704
727
|
|
|
705
|
-
|
|
728
|
+
// typed qty should be matched with release qty.
|
|
729
|
+
if (parseInt(this.releaseQtyInput.value) !== this._selectedOrderInventory.releaseQty) {
|
|
730
|
+
this._focusOnReleaseQtyInput()
|
|
731
|
+
throw new Error(i18next.t('text.wrong_release_qty'))
|
|
732
|
+
}
|
|
733
|
+
}
|
|
706
734
|
}
|
|
707
735
|
|
|
708
736
|
async _complete() {
|
|
@@ -726,29 +754,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
726
754
|
}
|
|
727
755
|
}
|
|
728
756
|
|
|
729
|
-
_showLogisticsInitPopup() {
|
|
730
|
-
if (this.checkShippingProviderAndDeliveryType() == true) {
|
|
731
|
-
this.initLogistics()
|
|
732
|
-
} else {
|
|
733
|
-
openPopup(
|
|
734
|
-
html`
|
|
735
|
-
<logistics-init-popup
|
|
736
|
-
.orderInformation="${this.orderInformation}"
|
|
737
|
-
@order-initialised="${() => {
|
|
738
|
-
this._logisticsInitiated = true
|
|
739
|
-
}}"
|
|
740
|
-
></logistics-init-popup>
|
|
741
|
-
`,
|
|
742
|
-
{
|
|
743
|
-
backdrop: true,
|
|
744
|
-
escapable: false,
|
|
745
|
-
size: 'medium',
|
|
746
|
-
title: i18next.t('title.ready_to_ship')
|
|
747
|
-
}
|
|
748
|
-
)
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
757
|
_openWorksheetInformation() {
|
|
753
758
|
openPopup(
|
|
754
759
|
html`
|
|
@@ -6,6 +6,7 @@ import gql from 'graphql-tag'
|
|
|
6
6
|
import { css, html } from 'lit-element'
|
|
7
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
8
8
|
|
|
9
|
+
import { getCodeByName } from '@things-factory/code-base'
|
|
9
10
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
11
|
import { client, gqlContext, PageView, store } from '@things-factory/shell'
|
|
11
12
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
@@ -45,6 +46,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
45
46
|
_searchFields: Object,
|
|
46
47
|
_config: Object,
|
|
47
48
|
_partners: Object,
|
|
49
|
+
__orderStatus: Object,
|
|
48
50
|
_gristData: Object,
|
|
49
51
|
data: Object
|
|
50
52
|
}
|
|
@@ -138,10 +140,14 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
138
140
|
date.setMonth(date.getMonth() - 1)
|
|
139
141
|
return date.toISOString().split('T')[0]
|
|
140
142
|
})(),
|
|
141
|
-
max:
|
|
143
|
+
max: (() => {
|
|
144
|
+
var max = new Date()
|
|
145
|
+
max.setMonth(max.getMonth() + 1)
|
|
146
|
+
return max.toISOString().split('T')[0]
|
|
147
|
+
})()
|
|
142
148
|
},
|
|
143
|
-
value: new Date().toISOString().split('T')[0]
|
|
144
|
-
handlers: { change: this._submit.bind(this) }
|
|
149
|
+
value: new Date().toISOString().split('T')[0]
|
|
150
|
+
// handlers: { change: this._submit.bind(this) }
|
|
145
151
|
},
|
|
146
152
|
{
|
|
147
153
|
label: i18next.t('field.product_info'),
|
|
@@ -160,6 +166,19 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
160
166
|
name: 'doNo',
|
|
161
167
|
type: 'text',
|
|
162
168
|
props: { searchOper: 'custom' }
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: i18next.t('field.status'),
|
|
172
|
+
name: 'status',
|
|
173
|
+
type: 'select',
|
|
174
|
+
options: [
|
|
175
|
+
{ name: 'all', value: '' },
|
|
176
|
+
...this._orderStatus.map(status => {
|
|
177
|
+
return { name: i18next.t(`label.${status.description}`), value: status.name }
|
|
178
|
+
})
|
|
179
|
+
],
|
|
180
|
+
value: 'DONE',
|
|
181
|
+
props: { searchOper: 'eq' }
|
|
163
182
|
}
|
|
164
183
|
]
|
|
165
184
|
}
|
|
@@ -221,6 +240,12 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
221
240
|
header: i18next.t('field.ref_no_3'),
|
|
222
241
|
width: 150
|
|
223
242
|
},
|
|
243
|
+
{
|
|
244
|
+
type: 'string',
|
|
245
|
+
name: 'status',
|
|
246
|
+
header: i18next.t('field.status'),
|
|
247
|
+
width: 120
|
|
248
|
+
},
|
|
224
249
|
{
|
|
225
250
|
type: 'datetime',
|
|
226
251
|
name: 'orderCreatedAt',
|
|
@@ -305,6 +330,18 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
305
330
|
header: i18next.t('field.uom'),
|
|
306
331
|
width: 100
|
|
307
332
|
},
|
|
333
|
+
{
|
|
334
|
+
type: 'float',
|
|
335
|
+
name: 'returnToLocationQty',
|
|
336
|
+
header: i18next.t('field.return_qty'),
|
|
337
|
+
width: 120
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
type: 'float',
|
|
341
|
+
name: 'returnToLocationUomValue',
|
|
342
|
+
header: i18next.t('field.return_uom_value'),
|
|
343
|
+
width: 120
|
|
344
|
+
},
|
|
308
345
|
{
|
|
309
346
|
type: 'float',
|
|
310
347
|
name: 'unitVolume',
|
|
@@ -437,6 +474,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
437
474
|
'refNo1',
|
|
438
475
|
'refNo2',
|
|
439
476
|
'refNo3',
|
|
477
|
+
'status',
|
|
440
478
|
'orderCreatedAt',
|
|
441
479
|
'pickingStart',
|
|
442
480
|
'pickingComplete',
|
|
@@ -451,6 +489,8 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
451
489
|
'qty',
|
|
452
490
|
'uomValue',
|
|
453
491
|
'uom',
|
|
492
|
+
'returnToLocationQty',
|
|
493
|
+
'returnToLocationUomValue',
|
|
454
494
|
'unitVolume',
|
|
455
495
|
'totalVolume',
|
|
456
496
|
'unitNettWeight',
|
|
@@ -477,7 +517,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
477
517
|
return {
|
|
478
518
|
columns: columns,
|
|
479
519
|
list,
|
|
480
|
-
pagination: { limit:
|
|
520
|
+
pagination: { limit: 100, pages: [100, 200, 500, 1000] },
|
|
481
521
|
rows: {
|
|
482
522
|
selectable: false,
|
|
483
523
|
insertable: false,
|
|
@@ -489,7 +529,14 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
489
529
|
async pageInitialized() {
|
|
490
530
|
this._gristData = { total: 0, totalWithOpeningBalance: 0, records: [] }
|
|
491
531
|
this._products = []
|
|
492
|
-
|
|
532
|
+
|
|
533
|
+
const [_orderStatusReq, _partnersReq] = await Promise.allSettled([
|
|
534
|
+
getCodeByName('RO_REQUESTS_STATUS'),
|
|
535
|
+
this._fetchPartners()
|
|
536
|
+
])
|
|
537
|
+
|
|
538
|
+
this._orderStatus = _orderStatusReq.status == 'fulfilled' ? _orderStatusReq.value : []
|
|
539
|
+
this._partners = _partnersReq.status == 'fulfilled' ? _partnersReq.value : []
|
|
493
540
|
|
|
494
541
|
this._searchFields = this.searchFields
|
|
495
542
|
this._config = this.reportConfig
|
|
@@ -539,6 +586,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
539
586
|
deliveryAddress
|
|
540
587
|
roNo
|
|
541
588
|
roType
|
|
589
|
+
status
|
|
542
590
|
refNo1
|
|
543
591
|
refNo2
|
|
544
592
|
refNo3
|
|
@@ -558,6 +606,8 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
558
606
|
packSize
|
|
559
607
|
qty
|
|
560
608
|
uomValue
|
|
609
|
+
returnToLocationQty
|
|
610
|
+
returnToLocationUomValue
|
|
561
611
|
uom
|
|
562
612
|
unitVolume
|
|
563
613
|
totalVolume
|
|
@@ -657,14 +707,18 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
657
707
|
_modifyDateRange(e) {
|
|
658
708
|
const fromDate = e.currentTarget.value
|
|
659
709
|
|
|
660
|
-
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
661
|
-
|
|
662
710
|
let min = new Date(fromDate)
|
|
663
|
-
let
|
|
664
|
-
|
|
711
|
+
let max = new Date(fromDate)
|
|
712
|
+
max.setMonth(max.getMonth() + 2)
|
|
665
713
|
|
|
666
714
|
min = min.toISOString().split('T')[0]
|
|
715
|
+
max = max.toISOString().split('T')[0]
|
|
716
|
+
|
|
717
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
718
|
+
|
|
719
|
+
if (this._toDateInput.value > max) this._toDateInput.value = max
|
|
667
720
|
|
|
721
|
+
this._toDateInput.max = max
|
|
668
722
|
this._toDateInput.min = min
|
|
669
723
|
this._submit()
|
|
670
724
|
}
|
|
@@ -686,6 +740,7 @@ class OutboundOrderDetailsReport extends connect(store)(localize(i18next)(PageVi
|
|
|
686
740
|
{ header: i18next.t('field.ref_no'), key: 'refNo1', width: 60, type: 'string' },
|
|
687
741
|
{ header: i18next.t('field.ref_no_2'), key: 'refNo2', width: 60, type: 'string' },
|
|
688
742
|
{ header: i18next.t('field.ref_no_3'), key: 'refNo3', width: 60, type: 'string' },
|
|
743
|
+
{ header: i18next.t('field.status'), key: 'status', width: 30, type: 'string' },
|
|
689
744
|
{ header: i18next.t('field.order_created_at'), key: 'orderCreatedAt', width: 30, type: 'string' },
|
|
690
745
|
{ header: i18next.t('field.picking_start'), key: 'pickingStart', width: 30, type: 'string' },
|
|
691
746
|
{ header: i18next.t('field.picking_complete'), key: 'pickingComplete', width: 30, type: 'string' },
|
|
@@ -14,6 +14,7 @@ exports.outboundOrderDetailsReport = {
|
|
|
14
14
|
let toDate = params.filters.find(data => data.name === 'toDate');
|
|
15
15
|
let roNo = params.filters.find(data => data.name === 'roNo');
|
|
16
16
|
let doNo = params.filters.find(data => data.name === 'doNo');
|
|
17
|
+
let status = params.filters.find(data => data.name === 'status');
|
|
17
18
|
if (userFilter) {
|
|
18
19
|
const user = await tx.getRepository(auth_base_1.User).findOne({
|
|
19
20
|
where: { id: userFilter.value },
|
|
@@ -40,75 +41,76 @@ exports.outboundOrderDetailsReport = {
|
|
|
40
41
|
if (doNo) {
|
|
41
42
|
extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `;
|
|
42
43
|
}
|
|
44
|
+
console.time('temp');
|
|
43
45
|
await tx.query(`
|
|
44
46
|
create temp table temp_outbound_order_report on commit drop as (
|
|
45
47
|
select * from (
|
|
46
|
-
select
|
|
47
|
-
do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
|
|
48
|
-
|
|
48
|
+
select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${bizplace.description}' AS "bizplace_description",
|
|
49
|
+
do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
|
|
50
|
+
do2."to", do2.contact_point_ref_id,
|
|
51
|
+
rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3", rg.status as "ro_status",
|
|
49
52
|
rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by,
|
|
50
53
|
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ih4.created_at as "shipped_at",
|
|
59
|
-
coalesce((select volume from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
60
|
-
order by created_at desc
|
|
61
|
-
fetch first 1 rows only),0) as unit_volume,
|
|
62
|
-
coalesce((select nett_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
63
|
-
order by created_at desc
|
|
64
|
-
fetch first 1 rows only),0) as unit_nett_weight,
|
|
65
|
-
coalesce((select gross_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
66
|
-
order by created_at desc
|
|
67
|
-
fetch first 1 rows only),0) as unit_gross_weight,
|
|
68
|
-
coalesce((select weight_unit from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
69
|
-
order by created_at desc
|
|
70
|
-
fetch first 1 rows only),'') as weight_unit
|
|
71
|
-
from (
|
|
72
|
-
select * from release_goods
|
|
73
|
-
where domain_id = $1 and bizplace_id = $2 and status ='DONE'
|
|
74
|
-
and created_at >= $3 and created_at <= $4
|
|
75
|
-
) rg
|
|
54
|
+
i.packing_type as "pack_type", i.packing_size as "pack_size", oi.release_qty AS "release_qty",
|
|
55
|
+
oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by, oi.shipped_at,
|
|
56
|
+
oi.release_qty as "qty", oi.release_uom_value as "uom_value", i.uom,
|
|
57
|
+
oi.return_to_location_qty, oi.return_to_location_uom_value,
|
|
58
|
+
i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date
|
|
59
|
+
from order_inventories oi
|
|
60
|
+
inner join release_goods rg on rg.id = oi.release_good_id
|
|
76
61
|
left join users u4 on u4.id = rg.accepted_by_id
|
|
77
|
-
inner join bizplaces b2 ON b2.id = rg.bizplace_id
|
|
78
|
-
inner join order_inventories oi on oi.release_good_id = rg.id
|
|
79
62
|
inner join inventories i on i.id = oi.inventory_id
|
|
80
63
|
inner join temp_products p on p.id = oi.product_id
|
|
81
|
-
left join worksheets w on w.release_good_id = rg.id and w."type" ='PICKING'
|
|
82
|
-
left join reduced_inventory_histories ih on ih.inventory_id = oi.inventory_id and ih.transaction_type ='PICKING' and ih.ref_order_id = rg.id::varchar
|
|
83
|
-
left join users u on u.id = ih.creator_id
|
|
84
|
-
left join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PACKING' and ih2.ref_order_id = rg.id::varchar
|
|
85
|
-
left join users u2 on u2.id = ih2.creator_id
|
|
86
|
-
left join reduced_inventory_histories ih3 on ih3.inventory_id = oi.inventory_id and ih3.transaction_type ='LOADING' and ih3.ref_order_id = rg.id::varchar
|
|
87
|
-
left join users u3 on u3.id = ih3.creator_id
|
|
88
|
-
left join reduced_inventory_histories ih4 on ih4.inventory_id = oi.inventory_id and ih4.transaction_type ='SHIPPING' and ih4.ref_order_id = rg.id::varchar
|
|
89
|
-
left join worksheets w2 on w2.release_good_id = rg.id and w2."type" ='PACKING'
|
|
90
|
-
left join worksheets w3 on w3.release_good_id = rg.id and w2."type" ='LOADING'
|
|
91
64
|
left join delivery_orders do2 on do2.id = oi.delivery_order_id
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
65
|
+
where exists (
|
|
66
|
+
select rg2.id from release_goods rg2
|
|
67
|
+
where rg2.domain_id = $1 and rg2.bizplace_id = $2
|
|
68
|
+
and rg2.created_at >= $3 and rg2.created_at <= $4 and rg2.id = oi.release_good_id
|
|
69
|
+
)
|
|
70
|
+
and oi.status <> 'REPLACED'
|
|
71
|
+
${status ? `and rg.status = '${status.value}' ` : ``}
|
|
96
72
|
) src
|
|
97
73
|
where 1=1
|
|
98
74
|
${extraQueryFilters}
|
|
99
75
|
)
|
|
100
76
|
`, [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]);
|
|
77
|
+
console.timeEnd('temp');
|
|
101
78
|
const total = await tx.query(`
|
|
102
79
|
select count(*) from temp_outbound_order_report
|
|
103
80
|
`);
|
|
81
|
+
console.time('result');
|
|
104
82
|
const result = await tx.query(`
|
|
105
83
|
select *,
|
|
106
84
|
round((qty * unit_volume)::numeric ,4) as total_volume,
|
|
107
85
|
round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
|
|
108
|
-
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
109
|
-
from
|
|
110
|
-
|
|
86
|
+
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
87
|
+
from (
|
|
88
|
+
select *,
|
|
89
|
+
w.started_at as picking_start,
|
|
90
|
+
w.ended_at as picking_complete,
|
|
91
|
+
coalesce(oi."to", concat(cp.address, cp.address_2)) as "delivery_address",
|
|
92
|
+
coalesce((select volume from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
93
|
+
order by created_at desc
|
|
94
|
+
fetch first 1 rows only),0) as unit_volume,
|
|
95
|
+
coalesce((select nett_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
96
|
+
order by created_at desc
|
|
97
|
+
fetch first 1 rows only),0) as unit_nett_weight,
|
|
98
|
+
coalesce((select gross_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
99
|
+
order by created_at desc
|
|
100
|
+
fetch first 1 rows only),0) as unit_gross_weight,
|
|
101
|
+
coalesce((select weight_unit from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
102
|
+
order by created_at desc
|
|
103
|
+
fetch first 1 rows only),'') as weight_unit
|
|
104
|
+
from temp_outbound_order_report oi
|
|
105
|
+
left join worksheet_details wd on wd.target_inventory_id = oi.id
|
|
106
|
+
left join worksheets w on w.id = wd.worksheet_id
|
|
107
|
+
left join contact_points cp on cp.id = oi.contact_point_ref_id
|
|
108
|
+
where (w.type= 'PICKING' OR w.type = 'BATCH_PICKING')
|
|
109
|
+
order by oi.ro_no, oi.product_sku
|
|
110
|
+
offset $1 limit $2
|
|
111
|
+
) src
|
|
111
112
|
`, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
|
|
113
|
+
console.timeEnd('result');
|
|
112
114
|
let items = result.map(itm => {
|
|
113
115
|
return {
|
|
114
116
|
bizplace: {
|
|
@@ -121,9 +123,10 @@ exports.outboundOrderDetailsReport = {
|
|
|
121
123
|
deliveryAddress: itm.delivery_address,
|
|
122
124
|
roNo: itm.ro_no,
|
|
123
125
|
roType: itm.ro_type,
|
|
126
|
+
status: itm.ro_status,
|
|
124
127
|
refNo1: itm.ref_no_1,
|
|
125
|
-
refNo2: itm.ref_no_2,
|
|
126
128
|
refNo3: itm.ref_no_3,
|
|
129
|
+
refNo2: itm.ref_no_2,
|
|
127
130
|
acceptedBy: itm.accepted_by,
|
|
128
131
|
acceptedAt: itm.accepted_at,
|
|
129
132
|
orderCreatedAt: itm.order_created_at,
|
|
@@ -141,6 +144,8 @@ exports.outboundOrderDetailsReport = {
|
|
|
141
144
|
qty: Math.abs(itm.qty),
|
|
142
145
|
uomValue: Math.abs(itm.uom_value),
|
|
143
146
|
uom: itm.uom,
|
|
147
|
+
returnToLocationQty: itm.return_to_location_qty,
|
|
148
|
+
returnToLocationUomValue: itm.return_to_location_uom_value,
|
|
144
149
|
unitVolume: itm.unit_volume,
|
|
145
150
|
totalVolume: itm.total_volume,
|
|
146
151
|
unitNettWeight: itm.unit_nett_weight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAChE,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAC5D,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,0BAA0B,GAAG;IACxC,KAAK,CAAC,0BAA0B,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACtE,IAAI;YACF,MAAM,EAAE,EAAE,EAAE,GAA0B,OAAO,CAAC,KAAK,CAAA;YACnD,IAAI,cAAc,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;YAC1D,IAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;YAClE,IAAI,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;YACpE,IAAI,M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ailsReport = (0, graphql_tag_1.default) `
|
|
|
13
13
|
deliveryAddress: String
|
|
14
14
|
roNo: String
|
|
15
15
|
roType: String
|
|
16
|
+
status: String
|
|
16
17
|
refNo1: String
|
|
17
18
|
refNo2: String
|
|
18
19
|
refNo3: String
|
|
@@ -27,6 +28,8 @@ exports.OutboundOrderDetailsReport = (0, graphql_tag_1.default) `
|
|
|
27
28
|
packSize: Int
|
|
28
29
|
qty: Int
|
|
29
30
|
uomValue: Float
|
|
31
|
+
returnToLocationQty: Int
|
|
32
|
+
returnToLocationUomValue: Float
|
|
30
33
|
uom: String
|
|
31
34
|
unitVolume: Float
|
|
32
35
|
totalVolume: Float
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,0BAA0B,GAAG,IAAA,qBAAG,EAAA
|
|
1
|
+
{"version":3,"file":"outbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-order-details-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,0BAA0B,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.32",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@things-factory/print-ui": "^4.1.28",
|
|
87
87
|
"@things-factory/product-base": "^4.1.28",
|
|
88
88
|
"@things-factory/resource-ui": "^4.1.28",
|
|
89
|
-
"@things-factory/sales-ui": "^4.1.
|
|
89
|
+
"@things-factory/sales-ui": "^4.1.31",
|
|
90
90
|
"@things-factory/scene-data-transform": "^4.1.28",
|
|
91
91
|
"@things-factory/scene-excel": "^4.1.28",
|
|
92
92
|
"@things-factory/scene-firebase": "^4.1.28",
|
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
"@things-factory/system-ui": "^4.1.28",
|
|
103
103
|
"@things-factory/transport-base": "^4.1.28",
|
|
104
104
|
"@things-factory/tutorial-ui": "^4.1.28",
|
|
105
|
-
"@things-factory/warehouse-base": "^4.1.
|
|
106
|
-
"@things-factory/worksheet-base": "^4.1.
|
|
105
|
+
"@things-factory/warehouse-base": "^4.1.31",
|
|
106
|
+
"@things-factory/worksheet-base": "^4.1.31"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@things-factory/builder": "^4.1.28"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "b7a603b009e2835b4f48861f8b1eaf2103805294"
|
|
112
112
|
}
|
|
@@ -16,6 +16,7 @@ export const outboundOrderDetailsReport = {
|
|
|
16
16
|
let toDate = params.filters.find(data => data.name === 'toDate')
|
|
17
17
|
let roNo = params.filters.find(data => data.name === 'roNo')
|
|
18
18
|
let doNo = params.filters.find(data => data.name === 'doNo')
|
|
19
|
+
let status = params.filters.find(data => data.name === 'status')
|
|
19
20
|
|
|
20
21
|
if (userFilter) {
|
|
21
22
|
const user: User = await tx.getRepository(User).findOne({
|
|
@@ -48,60 +49,35 @@ export const outboundOrderDetailsReport = {
|
|
|
48
49
|
extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
console.time('temp')
|
|
51
53
|
await tx.query(
|
|
52
54
|
`
|
|
53
55
|
create temp table temp_outbound_order_report on commit drop as (
|
|
54
56
|
select * from (
|
|
55
|
-
select
|
|
56
|
-
do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
|
|
57
|
-
|
|
57
|
+
select oi.id, '${bizplace.id}' AS "bizplace_id", '${bizplace.name}' AS "bizplace_name", '${bizplace.description}' AS "bizplace_description",
|
|
58
|
+
do2.name AS "delivery_order_no", do2.delivery_date as "delivery_order_date",
|
|
59
|
+
do2."to", do2.contact_point_ref_id,
|
|
60
|
+
rg.name AS "ro_no", rg."type" as "ro_type", rg.ref_no AS "ref_no_1", rg.ref_no_2 AS "ref_no_2", rg.ref_no_3 AS "ref_no_3", rg.status as "ro_status",
|
|
58
61
|
rg.created_at AS "order_created_at", rg.accepted_at, u4.name as accepted_by,
|
|
59
62
|
p.id as "product_id", p.sku as "product_sku", p.name AS "product_name", p.description AS "product_description", p.type as "product_type",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ih4.created_at as "shipped_at",
|
|
68
|
-
coalesce((select volume from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
69
|
-
order by created_at desc
|
|
70
|
-
fetch first 1 rows only),0) as unit_volume,
|
|
71
|
-
coalesce((select nett_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
72
|
-
order by created_at desc
|
|
73
|
-
fetch first 1 rows only),0) as unit_nett_weight,
|
|
74
|
-
coalesce((select gross_weight from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
75
|
-
order by created_at desc
|
|
76
|
-
fetch first 1 rows only),0) as unit_gross_weight,
|
|
77
|
-
coalesce((select weight_unit from product_details pd where pd.product_id = i.product_id and pd.packing_type = i.packing_type and pd.packing_size = i.packing_size
|
|
78
|
-
order by created_at desc
|
|
79
|
-
fetch first 1 rows only),'') as weight_unit
|
|
80
|
-
from (
|
|
81
|
-
select * from release_goods
|
|
82
|
-
where domain_id = $1 and bizplace_id = $2 and status ='DONE'
|
|
83
|
-
and created_at >= $3 and created_at <= $4
|
|
84
|
-
) rg
|
|
63
|
+
i.packing_type as "pack_type", i.packing_size as "pack_size", oi.release_qty AS "release_qty",
|
|
64
|
+
oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by, oi.shipped_at,
|
|
65
|
+
oi.release_qty as "qty", oi.release_uom_value as "uom_value", i.uom,
|
|
66
|
+
oi.return_to_location_qty, oi.return_to_location_uom_value,
|
|
67
|
+
i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date
|
|
68
|
+
from order_inventories oi
|
|
69
|
+
inner join release_goods rg on rg.id = oi.release_good_id
|
|
85
70
|
left join users u4 on u4.id = rg.accepted_by_id
|
|
86
|
-
inner join bizplaces b2 ON b2.id = rg.bizplace_id
|
|
87
|
-
inner join order_inventories oi on oi.release_good_id = rg.id
|
|
88
71
|
inner join inventories i on i.id = oi.inventory_id
|
|
89
72
|
inner join temp_products p on p.id = oi.product_id
|
|
90
|
-
left join worksheets w on w.release_good_id = rg.id and w."type" ='PICKING'
|
|
91
|
-
left join reduced_inventory_histories ih on ih.inventory_id = oi.inventory_id and ih.transaction_type ='PICKING' and ih.ref_order_id = rg.id::varchar
|
|
92
|
-
left join users u on u.id = ih.creator_id
|
|
93
|
-
left join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PACKING' and ih2.ref_order_id = rg.id::varchar
|
|
94
|
-
left join users u2 on u2.id = ih2.creator_id
|
|
95
|
-
left join reduced_inventory_histories ih3 on ih3.inventory_id = oi.inventory_id and ih3.transaction_type ='LOADING' and ih3.ref_order_id = rg.id::varchar
|
|
96
|
-
left join users u3 on u3.id = ih3.creator_id
|
|
97
|
-
left join reduced_inventory_histories ih4 on ih4.inventory_id = oi.inventory_id and ih4.transaction_type ='SHIPPING' and ih4.ref_order_id = rg.id::varchar
|
|
98
|
-
left join worksheets w2 on w2.release_good_id = rg.id and w2."type" ='PACKING'
|
|
99
|
-
left join worksheets w3 on w3.release_good_id = rg.id and w2."type" ='LOADING'
|
|
100
73
|
left join delivery_orders do2 on do2.id = oi.delivery_order_id
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
74
|
+
where exists (
|
|
75
|
+
select rg2.id from release_goods rg2
|
|
76
|
+
where rg2.domain_id = $1 and rg2.bizplace_id = $2
|
|
77
|
+
and rg2.created_at >= $3 and rg2.created_at <= $4 and rg2.id = oi.release_good_id
|
|
78
|
+
)
|
|
79
|
+
and oi.status <> 'REPLACED'
|
|
80
|
+
${status ? `and rg.status = '${status.value}' ` : ``}
|
|
105
81
|
) src
|
|
106
82
|
where 1=1
|
|
107
83
|
${extraQueryFilters}
|
|
@@ -110,22 +86,49 @@ export const outboundOrderDetailsReport = {
|
|
|
110
86
|
[context.state.domain.id, bizplace.id, fromDate.value, toDate.value]
|
|
111
87
|
)
|
|
112
88
|
|
|
89
|
+
console.timeEnd('temp')
|
|
113
90
|
const total: any = await tx.query(`
|
|
114
91
|
select count(*) from temp_outbound_order_report
|
|
115
92
|
`)
|
|
116
93
|
|
|
94
|
+
console.time('result')
|
|
117
95
|
const result: any = await tx.query(
|
|
118
96
|
`
|
|
119
97
|
select *,
|
|
120
98
|
round((qty * unit_volume)::numeric ,4) as total_volume,
|
|
121
99
|
round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
|
|
122
|
-
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
123
|
-
from
|
|
124
|
-
|
|
100
|
+
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
101
|
+
from (
|
|
102
|
+
select *,
|
|
103
|
+
w.started_at as picking_start,
|
|
104
|
+
w.ended_at as picking_complete,
|
|
105
|
+
coalesce(oi."to", concat(cp.address, cp.address_2)) as "delivery_address",
|
|
106
|
+
coalesce((select volume from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
107
|
+
order by created_at desc
|
|
108
|
+
fetch first 1 rows only),0) as unit_volume,
|
|
109
|
+
coalesce((select nett_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
110
|
+
order by created_at desc
|
|
111
|
+
fetch first 1 rows only),0) as unit_nett_weight,
|
|
112
|
+
coalesce((select gross_weight from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
113
|
+
order by created_at desc
|
|
114
|
+
fetch first 1 rows only),0) as unit_gross_weight,
|
|
115
|
+
coalesce((select weight_unit from product_details pd where pd.product_id = oi.product_id and pd.packing_type = oi.pack_type and pd.packing_size = oi.pack_size
|
|
116
|
+
order by created_at desc
|
|
117
|
+
fetch first 1 rows only),'') as weight_unit
|
|
118
|
+
from temp_outbound_order_report oi
|
|
119
|
+
left join worksheet_details wd on wd.target_inventory_id = oi.id
|
|
120
|
+
left join worksheets w on w.id = wd.worksheet_id
|
|
121
|
+
left join contact_points cp on cp.id = oi.contact_point_ref_id
|
|
122
|
+
where (w.type= 'PICKING' OR w.type = 'BATCH_PICKING')
|
|
123
|
+
order by oi.ro_no, oi.product_sku
|
|
124
|
+
offset $1 limit $2
|
|
125
|
+
) src
|
|
125
126
|
`,
|
|
126
127
|
[(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]
|
|
127
128
|
)
|
|
128
129
|
|
|
130
|
+
console.timeEnd('result')
|
|
131
|
+
|
|
129
132
|
let items = result.map(itm => {
|
|
130
133
|
return {
|
|
131
134
|
bizplace: {
|
|
@@ -138,9 +141,10 @@ export const outboundOrderDetailsReport = {
|
|
|
138
141
|
deliveryAddress: itm.delivery_address,
|
|
139
142
|
roNo: itm.ro_no,
|
|
140
143
|
roType: itm.ro_type,
|
|
144
|
+
status: itm.ro_status,
|
|
141
145
|
refNo1: itm.ref_no_1,
|
|
142
|
-
refNo2: itm.ref_no_2,
|
|
143
146
|
refNo3: itm.ref_no_3,
|
|
147
|
+
refNo2: itm.ref_no_2,
|
|
144
148
|
acceptedBy: itm.accepted_by,
|
|
145
149
|
acceptedAt: itm.accepted_at,
|
|
146
150
|
orderCreatedAt: itm.order_created_at,
|
|
@@ -158,6 +162,8 @@ export const outboundOrderDetailsReport = {
|
|
|
158
162
|
qty: Math.abs(itm.qty),
|
|
159
163
|
uomValue: Math.abs(itm.uom_value),
|
|
160
164
|
uom: itm.uom,
|
|
165
|
+
returnToLocationQty: itm.return_to_location_qty,
|
|
166
|
+
returnToLocationUomValue: itm.return_to_location_uom_value,
|
|
161
167
|
unitVolume: itm.unit_volume,
|
|
162
168
|
totalVolume: itm.total_volume,
|
|
163
169
|
unitNettWeight: itm.unit_nett_weight,
|
|
@@ -8,6 +8,7 @@ export const OutboundOrderDetailsReport = gql`
|
|
|
8
8
|
deliveryAddress: String
|
|
9
9
|
roNo: String
|
|
10
10
|
roType: String
|
|
11
|
+
status: String
|
|
11
12
|
refNo1: String
|
|
12
13
|
refNo2: String
|
|
13
14
|
refNo3: String
|
|
@@ -22,6 +23,8 @@ export const OutboundOrderDetailsReport = gql`
|
|
|
22
23
|
packSize: Int
|
|
23
24
|
qty: Int
|
|
24
25
|
uomValue: Float
|
|
26
|
+
returnToLocationQty: Int
|
|
27
|
+
returnToLocationUomValue: Float
|
|
25
28
|
uom: String
|
|
26
29
|
unitVolume: Float
|
|
27
30
|
totalVolume: Float
|
package/translations/en.json
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"delivery_order_form_invalid": "delivery order form invalid",
|
|
105
105
|
"field.accepted_at": "accepted at",
|
|
106
106
|
"field.accepted_by": "accepted by",
|
|
107
|
+
"field.actual_lot_qty": "actual lot qty",
|
|
107
108
|
"field.actual_pack_qty": "actual pack qty",
|
|
108
109
|
"field.actual_pallet_qty": "actual pallet qty",
|
|
109
110
|
"field.actual_qty": "actual qty",
|
|
@@ -293,6 +294,7 @@
|
|
|
293
294
|
"field.location": "location",
|
|
294
295
|
"field.loose_item": "loose item",
|
|
295
296
|
"field.lot_id": "lot id",
|
|
297
|
+
"field.lot_qty": "lot qty",
|
|
296
298
|
"field.low_on_stock": "low on stock",
|
|
297
299
|
"field.main_bizplace": "main customer",
|
|
298
300
|
"field.manifest_no": "manifest no",
|
|
@@ -750,6 +752,7 @@
|
|
|
750
752
|
"label.order_status_ready_to_unload": "ready to unload",
|
|
751
753
|
"label.order_status_received": "received",
|
|
752
754
|
"label.order_status_rejected": "rejected",
|
|
755
|
+
"label.order_status_sorting": "sorting",
|
|
753
756
|
"label.order_type": "order type",
|
|
754
757
|
"label.other_destination": "other destination",
|
|
755
758
|
"label.other": "other",
|
|
@@ -1110,15 +1113,14 @@
|
|
|
1110
1113
|
"text.invalid_form": "invalid form",
|
|
1111
1114
|
"text.invalid_format_of_location_id": "invalid format of location id",
|
|
1112
1115
|
"text.invalid_inventory": "invalid_inventory",
|
|
1113
|
-
"text.manufacture-date-cannot-be-later-than-today": "manufacture date cannot be later than today",
|
|
1114
1116
|
"text.invalid_no_of_random_item_value": "invalid no of random item value",
|
|
1115
1117
|
"text.invalid_pack_qty": "invalid pack qty",
|
|
1116
1118
|
"text.invalid_pallet_id": "invalid pallet id",
|
|
1117
1119
|
"text.invalid_pallet_qty": "invalid pallet qty",
|
|
1118
1120
|
"text.invalid_print_qty": "invalid print qty",
|
|
1119
1121
|
"text.invalid_product_combination": "invalid product combination",
|
|
1120
|
-
"text.invalid_quantity_input": "invalid quantity input",
|
|
1121
1122
|
"text.invalid_qty": "invalid quantity",
|
|
1123
|
+
"text.invalid_quantity_input": "invalid quantity input",
|
|
1122
1124
|
"text.invalid_release_date": "invalid release date",
|
|
1123
1125
|
"text.invalid_release_qty": "invalid release qty",
|
|
1124
1126
|
"text.invalid_return_location": "invalid return location",
|
|
@@ -1151,6 +1153,7 @@
|
|
|
1151
1153
|
"text.manifest_has_been_dispatched_and_closed": "manifest has been dispatched and closed",
|
|
1152
1154
|
"text.manifest_has_been_generated": "manifest has been generated",
|
|
1153
1155
|
"text.manifest_items_is_empty": "manifest items is empty",
|
|
1156
|
+
"text.manufacture-date-cannot-be-later-than-today": "manufacture date cannot be later than today",
|
|
1154
1157
|
"text.missing_zone_name": "missing zone name",
|
|
1155
1158
|
"text.new_batch_id_is_empty": "new batch no is empty",
|
|
1156
1159
|
"text.no_changes_to_be_submitted": "no changes to be submitted",
|
|
@@ -1197,6 +1200,7 @@
|
|
|
1197
1200
|
"text.please_select_a_truck": "select a truck",
|
|
1198
1201
|
"text.please_select_an_inventory": "please select an inventory",
|
|
1199
1202
|
"text.please_select_label_indicator": "please select label indicator",
|
|
1203
|
+
"text.please_select_one_or_more_order_to_generate_worksheet": "please select one or more order to generate worksheet",
|
|
1200
1204
|
"text.please_select_release_order": "please select release order",
|
|
1201
1205
|
"text.please_select_the_company": "please select the company",
|
|
1202
1206
|
"text.please_select_the_contact_type": "please select the contact type",
|
|
@@ -1280,8 +1284,10 @@
|
|
|
1280
1284
|
"text.selected_inventory_not_using_carton_label": "selected inventory not using carton label",
|
|
1281
1285
|
"text.selected_item_qty_is_less_than_order_release_qty": "selected item qty is less than order release qty",
|
|
1282
1286
|
"text.selected_item_qty_is_more_than_order_release_qty": "selected item qty is more than order release qty",
|
|
1287
|
+
"text.scanned_product_status_is_done": "scanned product status is done",
|
|
1283
1288
|
"text.selected_qty_is_less_than_expected": "selected qty is less than expected",
|
|
1284
1289
|
"text.selected_qty_is_more_than_expected": "selected qty is more than expected",
|
|
1290
|
+
"text.selected_release_order(s)_has_existing_worksheet": "selected release order(s) has existing worksheet",
|
|
1285
1291
|
"text.send_goods_received_note": "send GRN",
|
|
1286
1292
|
"text.set_order_to_ready_to_ship": "set order to ready to ship",
|
|
1287
1293
|
"text.shelf_is_not_allowed_as_an_indicator_for_partial_format": "shelf is not allowed as an indicator for partial format",
|
|
@@ -1357,6 +1363,7 @@
|
|
|
1357
1363
|
"text.warehouse_not_found": "warehouse not found!",
|
|
1358
1364
|
"text.worksheet_activated": "worksheet activated",
|
|
1359
1365
|
"text.worksheet_has_been_generated": "worksheet has been generated",
|
|
1366
|
+
"text.worksheet(s)_has_been_generated": "worksheet(s) has been generated",
|
|
1360
1367
|
"text.wrong_carton_id": "wrong carton id",
|
|
1361
1368
|
"text.wrong_lot_id": "wrong lot id",
|
|
1362
1369
|
"text.wrong_release_qty": "wrong release qty",
|
|
@@ -1685,7 +1692,5 @@
|
|
|
1685
1692
|
"title.worksheet_unloading": "worksheet unloading",
|
|
1686
1693
|
"title.worksheet_vas": "worksheet vas",
|
|
1687
1694
|
"title.worksheet": "worksheet",
|
|
1688
|
-
"vas_order_created": "vas order created"
|
|
1689
|
-
"field.lot_qty": "lot qty",
|
|
1690
|
-
"field.actual_lot_qty": "actual lot qty"
|
|
1695
|
+
"vas_order_created": "vas order created"
|
|
1691
1696
|
}
|
package/translations/ko.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"label.order_status_sorting": "[ko]sorting",
|
|
2
3
|
"button.print_internal_awb": "[ko]print internal awb",
|
|
3
4
|
"arrival_notice_created": "입고주문이 생성 되었습니다.",
|
|
4
5
|
"arrival_notice_updated": "[ko]arrival notice updated",
|
|
@@ -1876,10 +1877,15 @@
|
|
|
1876
1877
|
"title.undo_putaway": "[ko] undo putaway",
|
|
1877
1878
|
"field.lot_qty": "[ko] lot qty",
|
|
1878
1879
|
"field.actual_lot_qty": "[ko] actual lot qty",
|
|
1880
|
+
"text.scanned_product_status_is_done": "[ko] scanned product status is done",
|
|
1879
1881
|
"field.manufacture_date": "[ko] manufacture date",
|
|
1880
1882
|
"text.manufacture-date-cannot-be-later-than-today": "[ko] manufacture date cannot be later than today",
|
|
1881
1883
|
"text.please_select_an_inventory": "[ko] please select an inventory",
|
|
1882
1884
|
"text.carton_id_not_found": "[ko] carton id not found",
|
|
1883
1885
|
"text.lot_id_not_found": "[ko] lot id not found",
|
|
1884
|
-
"field.volume_m3": "[ko] volume (M3)"
|
|
1886
|
+
"field.volume_m3": "[ko] volume (M3)",
|
|
1887
|
+
"text.scanned_product_status_is_done": "[ko] scanned product status is done",
|
|
1888
|
+
"text.selected_release_order(s)_has_existing_worksheet": "[ko] selected release order(s) has existing worksheet",
|
|
1889
|
+
"text.please_select_one_or_more_order_to_generate_worksheet": "[ko] please select one or more order to generate worksheet",
|
|
1890
|
+
"text.worksheet(s)_has_been_generated": "[ko] worksheet(s) has been generated"
|
|
1885
1891
|
}
|
package/translations/ms.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"label.order_status_sorting": "[ms]sorting",
|
|
2
3
|
"button.print_internal_awb": "[ms]print internal awb",
|
|
3
4
|
"arrival_notice_created": "notis ketibaan telah dicipta",
|
|
4
5
|
"arrival_notice_updated": "notis ketibaan telah dikemaskinikan",
|
|
@@ -1746,10 +1747,15 @@
|
|
|
1746
1747
|
"title.undo_putaway": "[ms] undo putaway",
|
|
1747
1748
|
"field.lot_qty": "[ms] lot qty",
|
|
1748
1749
|
"field.actual_lot_qty": "[ms] actual lot qty",
|
|
1750
|
+
"text.scanned_product_status_is_done": "[ms] scanned product status is done",
|
|
1749
1751
|
"field.manufacture_date": "[ms] manufacture date",
|
|
1750
1752
|
"text.manufacture-date-cannot-be-later-than-today": "[ms] manufacture date cannot be later than today",
|
|
1751
1753
|
"text.please_select_an_inventory": "[ms] please select an inventory",
|
|
1752
1754
|
"text.carton_id_not_found": "[ms] carton id not found",
|
|
1753
1755
|
"text.lot_id_not_found": "[ms] lot id not found",
|
|
1754
|
-
"field.volume_m3": "[ms] volume (M3)"
|
|
1756
|
+
"field.volume_m3": "[ms] volume (M3)",
|
|
1757
|
+
"text.scanned_product_status_is_done": "[ms] scanned product status is done",
|
|
1758
|
+
"text.selected_release_order(s)_has_existing_worksheet": "[ms] selected release order(s) has existing worksheet",
|
|
1759
|
+
"text.please_select_one_or_more_order_to_generate_worksheet": "[ms] please select one or more order to generate worksheet",
|
|
1760
|
+
"text.worksheet(s)_has_been_generated": "[ms] worksheet(s) has been generated"
|
|
1755
1761
|
}
|
package/translations/zh.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"label.order_status_sorting": "[zh]sorting",
|
|
2
3
|
"button.print_internal_awb": "[zh]print internal awb",
|
|
3
4
|
"arrival_notice_created": "arrival notice created",
|
|
4
5
|
"button.activate": "activate",
|
|
@@ -1696,10 +1697,15 @@
|
|
|
1696
1697
|
"title.undo_putaway": "[zh] undo putaway",
|
|
1697
1698
|
"field.lot_qty": "[zh] lot qty",
|
|
1698
1699
|
"field.actual_lot_qty": "[zh] actual lot qty",
|
|
1700
|
+
"text.scanned_product_status_is_done": "[zh] scanned product status is done",
|
|
1699
1701
|
"field.manufacture_date": "[zh] manufacture date",
|
|
1700
1702
|
"text.manufacture-date-cannot-be-later-than-today": "[zh] manufacture date cannot be later than today",
|
|
1701
1703
|
"text.please_select_an_inventory": "[zh] please select an inventory",
|
|
1702
1704
|
"text.carton_id_not_found": "[zh] carton id not found",
|
|
1703
1705
|
"text.lot_id_not_found": "[zh] lot id not found",
|
|
1704
|
-
"field.volume_m3": "[zh] volume (M3)"
|
|
1706
|
+
"field.volume_m3": "[zh] volume (M3)",
|
|
1707
|
+
"text.scanned_product_status_is_done": "[zh] scanned product status is done",
|
|
1708
|
+
"text.selected_release_order(s)_has_existing_worksheet": "[zh] selected release order(s) has existing worksheet",
|
|
1709
|
+
"text.please_select_one_or_more_order_to_generate_worksheet": "[zh] please select one or more order to generate worksheet",
|
|
1710
|
+
"text.worksheet(s)_has_been_generated": "[zh] worksheet(s) has been generated"
|
|
1705
1711
|
}
|