@things-factory/operato-wms 4.3.534 → 4.3.536
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/bootstrap.js +1 -0
- package/client/pages/components/select-transport-vehicle-popup.js +268 -0
- package/client/pages/inbound/unload-product.js +9 -5
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +29 -3
- package/client/pages/order/arrival-notice/create-arrival-notice.js +30 -1
- package/client/pages/order/arrival-notice/edit-product-popup.js +17 -5
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +4 -0
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
- package/package.json +38 -38
- package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +6 -1
- package/translations/en.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
package/client/bootstrap.js
CHANGED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import '@things-factory/grist-ui'
|
|
2
|
+
|
|
3
|
+
import gql from 'graphql-tag'
|
|
4
|
+
import { css, html, LitElement } from 'lit-element'
|
|
5
|
+
|
|
6
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
7
|
+
import { client } from '@things-factory/shell'
|
|
8
|
+
import { ScrollbarStyles } from '@things-factory/styles'
|
|
9
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
10
|
+
|
|
11
|
+
class SelectTransportVehiclePopup extends localize(i18next)(LitElement) {
|
|
12
|
+
static get properties() {
|
|
13
|
+
return {
|
|
14
|
+
_searchFields: Array,
|
|
15
|
+
config: Object,
|
|
16
|
+
data: Object,
|
|
17
|
+
importHandler: Object
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static get styles() {
|
|
22
|
+
return [
|
|
23
|
+
ScrollbarStyles,
|
|
24
|
+
css`
|
|
25
|
+
:host {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
background-color: white;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
search-form {
|
|
33
|
+
overflow: visible;
|
|
34
|
+
}
|
|
35
|
+
.grist {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex: 1;
|
|
39
|
+
overflow-y: auto;
|
|
40
|
+
}
|
|
41
|
+
.grist-container {
|
|
42
|
+
overflow-y: hidden;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex: 1;
|
|
45
|
+
}
|
|
46
|
+
data-grist {
|
|
47
|
+
overflow-y: hidden;
|
|
48
|
+
flex: 1;
|
|
49
|
+
}
|
|
50
|
+
h2 {
|
|
51
|
+
padding: var(--subtitle-padding);
|
|
52
|
+
font: var(--subtitle-font);
|
|
53
|
+
color: var(--subtitle-text-color);
|
|
54
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
55
|
+
}
|
|
56
|
+
.grist h2 {
|
|
57
|
+
font: var(--grist-title-font);
|
|
58
|
+
}
|
|
59
|
+
.button-container {
|
|
60
|
+
padding: var(--button-container-padding);
|
|
61
|
+
margin: var(--button-container-margin);
|
|
62
|
+
text-align: var(--button-container-align);
|
|
63
|
+
background-color: var(--button-container-background);
|
|
64
|
+
height: var(--button-container-height);
|
|
65
|
+
}
|
|
66
|
+
`
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
render() {
|
|
71
|
+
return html`
|
|
72
|
+
<search-form
|
|
73
|
+
id="search-form"
|
|
74
|
+
.fields=${this._searchFields}
|
|
75
|
+
@submit=${() => this.vehicleGrist.fetch()}
|
|
76
|
+
></search-form>
|
|
77
|
+
|
|
78
|
+
<div class="grist-container">
|
|
79
|
+
<div class="grist">
|
|
80
|
+
<data-grist
|
|
81
|
+
id="vehicle"
|
|
82
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
83
|
+
.config=${this.config}
|
|
84
|
+
.fetchHandler=${this.fetchVehicles.bind(this)}
|
|
85
|
+
></data-grist>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="button-container">
|
|
90
|
+
<mwc-button
|
|
91
|
+
@click="${this.selectVehicle.bind(this)}"
|
|
92
|
+
label="${`${i18next.t('button.select')}`}"
|
|
93
|
+
raised
|
|
94
|
+
></mwc-button>
|
|
95
|
+
</div>
|
|
96
|
+
`
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get vehicleGrist() {
|
|
100
|
+
return this.shadowRoot.querySelector('data-grist#vehicle')
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get searchForm() {
|
|
104
|
+
return this.shadowRoot.querySelector('search-form')
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
firstUpdated() {
|
|
108
|
+
this._searchFields = [
|
|
109
|
+
{
|
|
110
|
+
label: i18next.t('field.reg_number'),
|
|
111
|
+
name: 'reg_number',
|
|
112
|
+
type: 'text',
|
|
113
|
+
props: { searchOper: 'i_like' }
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: i18next.t('field.size'),
|
|
117
|
+
type: 'text',
|
|
118
|
+
name: 'size',
|
|
119
|
+
props: { searchOper: 'i_like' }
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: i18next.t('field.status'),
|
|
123
|
+
name: 'status',
|
|
124
|
+
type: 'text',
|
|
125
|
+
props: { searchOper: 'i_like' }
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
this.config = {
|
|
130
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
131
|
+
list: {
|
|
132
|
+
fields: ['name', 'description', 'updatedAt']
|
|
133
|
+
},
|
|
134
|
+
rows: {
|
|
135
|
+
appendable: false,
|
|
136
|
+
selectable: { multiple: false }
|
|
137
|
+
},
|
|
138
|
+
columns: [
|
|
139
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
140
|
+
{
|
|
141
|
+
type: 'gutter',
|
|
142
|
+
gutterName: 'row-selector',
|
|
143
|
+
multiple: false
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: 'string',
|
|
147
|
+
name: 'id',
|
|
148
|
+
hidden: true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
type: 'string',
|
|
152
|
+
name: 'regNumber',
|
|
153
|
+
header: i18next.t('field.reg_number'),
|
|
154
|
+
width: 120
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'string',
|
|
158
|
+
name: 'description',
|
|
159
|
+
header: i18next.t('field.description'),
|
|
160
|
+
width: 180
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: 'string',
|
|
164
|
+
name: 'size',
|
|
165
|
+
header: i18next.t('field.size'),
|
|
166
|
+
width: 120
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'string',
|
|
170
|
+
name: 'status',
|
|
171
|
+
header: i18next.t('field.status'),
|
|
172
|
+
width: 220
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'string',
|
|
176
|
+
name: 'updatedAt',
|
|
177
|
+
header: i18next.t('field.updated_at'),
|
|
178
|
+
width: 180
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async fetchVehicles({ page, limit, sorters = [] }) {
|
|
185
|
+
const filters = this.searchForm.queryFilters
|
|
186
|
+
const pagination = { page, limit }
|
|
187
|
+
const sortings = sorters
|
|
188
|
+
|
|
189
|
+
const response = await client.query({
|
|
190
|
+
query: gql`
|
|
191
|
+
query transportVehicles($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
|
|
192
|
+
transportVehicles(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
193
|
+
items {
|
|
194
|
+
id
|
|
195
|
+
name
|
|
196
|
+
regNumber
|
|
197
|
+
description
|
|
198
|
+
size
|
|
199
|
+
status
|
|
200
|
+
updatedAt
|
|
201
|
+
}
|
|
202
|
+
total
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`,
|
|
206
|
+
variables: { filters, pagination, sortings }
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
if (!response.errors) {
|
|
210
|
+
return {
|
|
211
|
+
total: response.data.transportVehicles.total || 0,
|
|
212
|
+
records: response.data.transportVehicles.items || []
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// not sure should handle dbl click or not
|
|
218
|
+
// _dblClickHandler(columns, data, column, record, rowIndex, target) {
|
|
219
|
+
// if (this.selectMultipleProducts) return
|
|
220
|
+
// this.dispatchEvent(
|
|
221
|
+
// new CustomEvent('selected', {
|
|
222
|
+
// detail: {
|
|
223
|
+
// productDetailId: record.id,
|
|
224
|
+
// packingType: record.packingType,
|
|
225
|
+
// uom: record.uom,
|
|
226
|
+
// uomValue: record.uomValue,
|
|
227
|
+
// productName: `${record.name}(${record.description}(${record.sku}))`,
|
|
228
|
+
// isError: false,
|
|
229
|
+
// productBrand: record.brand,
|
|
230
|
+
// unitPrice: parseFloat(record.costPrice).toFixed(2),
|
|
231
|
+
// product: {
|
|
232
|
+
// id: record.productId,
|
|
233
|
+
// name: record.name,
|
|
234
|
+
// sku: record.sku,
|
|
235
|
+
// packingType: record.packingType,
|
|
236
|
+
// packingSize: record.packingSize,
|
|
237
|
+
// primaryUnit: record.uom,
|
|
238
|
+
// primaryValue: record.uomValue,
|
|
239
|
+
// costPrice: parseFloat(record.costPrice).toFixed(2)
|
|
240
|
+
// }
|
|
241
|
+
// }
|
|
242
|
+
// })
|
|
243
|
+
// )
|
|
244
|
+
// history.back()
|
|
245
|
+
// }
|
|
246
|
+
|
|
247
|
+
selectVehicle(record) {
|
|
248
|
+
const selectedVehicle = this.vehicleGrist.selected[0]
|
|
249
|
+
if (selectedVehicle) {
|
|
250
|
+
this.dispatchEvent(
|
|
251
|
+
new CustomEvent('selected', {
|
|
252
|
+
detail: {
|
|
253
|
+
id: selectedVehicle.id,
|
|
254
|
+
regNumber: selectedVehicle.regNumber,
|
|
255
|
+
size: selectedVehicle.size
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
)
|
|
259
|
+
history.back()
|
|
260
|
+
} else {
|
|
261
|
+
document.dispatchEvent(
|
|
262
|
+
new CustomEvent('notify', { detail: { message: i18next.t('text.no_vehicle_is_selected') } })
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
window.customElements.define('select-transport-vehicle-popup', SelectTransportVehiclePopup)
|
|
@@ -783,10 +783,14 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
783
783
|
return {
|
|
784
784
|
...worksheetDetailInfo,
|
|
785
785
|
validity:
|
|
786
|
-
worksheetDetailInfo.
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
worksheetDetailInfo.packQty > 0 //check new packQty after edit approved
|
|
787
|
+
? worksheetDetailInfo.actualPackQty === worksheetDetailInfo.packQty &&
|
|
788
|
+
(worksheetDetailInfo.palletQty
|
|
789
|
+
? worksheetDetailInfo.actualPalletQty === worksheetDetailInfo.palletQty
|
|
790
|
+
: true)
|
|
791
|
+
: worksheetDetailInfo.packQty === 0
|
|
792
|
+
? true // if 0
|
|
793
|
+
: false, // if undefined or null
|
|
790
794
|
sku: worksheetDetailInfo.product.sku
|
|
791
795
|
}
|
|
792
796
|
}),
|
|
@@ -1814,7 +1818,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1814
1818
|
!this.orderProductData.records
|
|
1815
1819
|
.filter(
|
|
1816
1820
|
task =>
|
|
1817
|
-
(task.palletQty ? task.actualPalletQty !== task.palletQty : false) || task.actualPackQty !== task.packQty
|
|
1821
|
+
task.packQty === 0 ? false : (task.palletQty ? task.actualPalletQty !== task.palletQty : false) || task.actualPackQty !== task.packQty
|
|
1818
1822
|
)
|
|
1819
1823
|
.every(task => task.issue)
|
|
1820
1824
|
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '@things-factory/grist-ui'
|
|
2
2
|
import '@things-factory/warehouse-ui'
|
|
3
3
|
import '../../components/attachment-viewer'
|
|
4
|
-
import '../../components/vas-templates'
|
|
5
4
|
import '../../components/popup-note'
|
|
5
|
+
import '../../components/vas-templates'
|
|
6
6
|
import '../../inbound/carton-label-popup'
|
|
7
7
|
import '../../inbound/pallet-label-popup'
|
|
8
8
|
import './edit-product-popup'
|
|
@@ -523,6 +523,9 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
|
|
|
523
523
|
|
|
524
524
|
<label>${i18next.t('label.eta_date')}</label>
|
|
525
525
|
<input name="etaDate" type="date" disabled />
|
|
526
|
+
|
|
527
|
+
<label ?hidden="${!this._warehouseTransport}">${i18next.t('label.transport_vehicle')}</label>
|
|
528
|
+
<input name="transportVehicle" ?hidden="${!this._warehouseTransport}" ?readonly=${this.determineStatus()} />
|
|
526
529
|
|
|
527
530
|
<label ?hidden="${!this._ownTransport}">${i18next.t('label.do_no')}</label>
|
|
528
531
|
<input name="deliveryOrderNo" ?hidden="${!this._ownTransport}" ?readonly=${this.determineStatus()} />
|
|
@@ -959,6 +962,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
|
|
|
959
962
|
deliveryOrderNo
|
|
960
963
|
status
|
|
961
964
|
truckNo
|
|
965
|
+
transportVehicle
|
|
962
966
|
refNo
|
|
963
967
|
refNo2
|
|
964
968
|
refNo3
|
|
@@ -1131,10 +1135,32 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
|
|
|
1131
1135
|
Array.from(form.querySelectorAll('input, textarea, select')).forEach(field => {
|
|
1132
1136
|
if (field.name === key && field.type === 'checkbox') {
|
|
1133
1137
|
field.checked = data[key]
|
|
1138
|
+
|
|
1139
|
+
if (field.name === 'ownTransport') {
|
|
1140
|
+
this._ownTransport = data[key];
|
|
1141
|
+
if (data[key] === true) {
|
|
1142
|
+
// If ownTransp ort is true, set warehouseTransport to false
|
|
1143
|
+
this._ownTransport = true;
|
|
1144
|
+
this._ownTransportInput.checked = true;
|
|
1145
|
+
this._warehouseTransport = false;
|
|
1146
|
+
this._warehouseTransportInput.checked = false;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// If ownTransport is true, warehouseTransport must be false
|
|
1150
|
+
if (!this._ownTransport) {
|
|
1151
|
+
this._warehouseTransport = true;
|
|
1152
|
+
this._warehouseTransportInput.checked = true;
|
|
1153
|
+
// If ownTransport is true, set warehouseTransport to false
|
|
1154
|
+
this._ownTransport = false;
|
|
1155
|
+
this._ownTransportInput.checked = false;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
|
|
1134
1160
|
} else if (field.name === key) {
|
|
1135
|
-
field.value = data[key]
|
|
1161
|
+
field.value = data[key];
|
|
1136
1162
|
}
|
|
1137
|
-
})
|
|
1163
|
+
});
|
|
1138
1164
|
}
|
|
1139
1165
|
}
|
|
1140
1166
|
|
|
@@ -2,6 +2,7 @@ import '@things-factory/biz-ui'
|
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
3
|
import '@things-factory/import-ui'
|
|
4
4
|
import '../../components/select-product-popup'
|
|
5
|
+
import '../../components/select-transport-vehicle-popup'
|
|
5
6
|
import '../../order/vas-order/popup/vas-create-popup'
|
|
6
7
|
|
|
7
8
|
import gql from 'graphql-tag'
|
|
@@ -52,7 +53,8 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
52
53
|
_bizplaceId: String,
|
|
53
54
|
_bizplaceName: String,
|
|
54
55
|
_showAddProducts: Boolean,
|
|
55
|
-
_vasExpanded: Boolean
|
|
56
|
+
_vasExpanded: Boolean,
|
|
57
|
+
_transportVehicle: String
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -328,6 +330,14 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
328
330
|
<label ?hidden="${!this._ownTransport}">${i18next.t('label.truck_no')}</label>
|
|
329
331
|
<input ?hidden="${!this._ownTransport}" name="truckNo" />
|
|
330
332
|
|
|
333
|
+
<label ?hidden="${!this._warehouseTransport}">${i18next.t('label.transport_vehicle')}</label>
|
|
334
|
+
<input
|
|
335
|
+
?hidden="${!this._warehouseTransport}"
|
|
336
|
+
name="transportVehicle"
|
|
337
|
+
value=${this._transportVehicle}
|
|
338
|
+
@click="${this._openTransportVehicleSelector.bind(this)}"
|
|
339
|
+
/>
|
|
340
|
+
|
|
331
341
|
<div attachment-wrap>
|
|
332
342
|
<label ?hidden="${!this._checkTransport}">${i18next.t('label.upload_documents')}</label>
|
|
333
343
|
<file-uploader
|
|
@@ -408,6 +418,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
408
418
|
this._strictProductSelection = false
|
|
409
419
|
this._showAddProducts = false
|
|
410
420
|
this._vasExpanded = false
|
|
421
|
+
this._transportVehicle = ''
|
|
411
422
|
}
|
|
412
423
|
|
|
413
424
|
get arrivalNoticeForm() {
|
|
@@ -755,6 +766,24 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
755
766
|
}
|
|
756
767
|
}
|
|
757
768
|
|
|
769
|
+
_openTransportVehicleSelector() {
|
|
770
|
+
openPopup(
|
|
771
|
+
html`
|
|
772
|
+
<select-transport-vehicle-popup
|
|
773
|
+
@selected="${e => {
|
|
774
|
+
// value of e might be wrong, need to recheck
|
|
775
|
+
this._transportVehicle = `${e.detail.regNumber}` + ` - ${e.detail.size}`
|
|
776
|
+
}}"
|
|
777
|
+
></select-transport-vehicle-popup>
|
|
778
|
+
`,
|
|
779
|
+
{
|
|
780
|
+
backdrop: true,
|
|
781
|
+
size: 'large',
|
|
782
|
+
title: i18next.t('title.transport_vehicle')
|
|
783
|
+
}
|
|
784
|
+
)
|
|
785
|
+
}
|
|
786
|
+
|
|
758
787
|
_openBulkProductSelection() {
|
|
759
788
|
if (this._bizplaceId) {
|
|
760
789
|
openPopup(
|
|
@@ -479,13 +479,15 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
479
479
|
|
|
480
480
|
if (changedColumn === 'uomValue' && (!uomValue || uomValue < 0))
|
|
481
481
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.uom_value') } }))
|
|
482
|
-
if (changedColumn === 'packQty' && (
|
|
482
|
+
if (changedColumn === 'packQty' && (packQty == null || packQty === '' || packQty < 0 || isNaN(packQty)))
|
|
483
483
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.pack_qty') } }))
|
|
484
484
|
if (changedColumn === 'uom' && !uom)
|
|
485
485
|
throw new Error(i18next.t('text.x_is_empty', { state: { x: i18next.t('label.uom') } }))
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
if (uomValue && uom) {
|
|
487
|
+
if (packQty !== 0)
|
|
488
488
|
calcedRecord.totalUomValue = `${(uomValue * packQty).toFixed(2)} ${uom}`
|
|
489
|
+
if (packQty === 0)
|
|
490
|
+
calcedRecord.totalUomValue = `0 ${uom}`
|
|
489
491
|
} else {
|
|
490
492
|
calcedRecord.totalUomValue = ''
|
|
491
493
|
}
|
|
@@ -504,7 +506,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
504
506
|
|
|
505
507
|
if (!uomValue)
|
|
506
508
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.uom_value') } }))
|
|
507
|
-
if (
|
|
509
|
+
if (packQty === undefined || packQty === null || packQty === '')
|
|
508
510
|
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.pack_qty') } }))
|
|
509
511
|
|
|
510
512
|
if (changedColumn === 'releaseQty') {
|
|
@@ -610,6 +612,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
610
612
|
|
|
611
613
|
async _addEditProducts(approveAdminAddEditProducts) {
|
|
612
614
|
try {
|
|
615
|
+
|
|
613
616
|
this._validateProducts()
|
|
614
617
|
|
|
615
618
|
let existingOrderProducts = []
|
|
@@ -752,8 +755,17 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
752
755
|
!record.uom ||
|
|
753
756
|
!record.packQty
|
|
754
757
|
).length
|
|
755
|
-
)
|
|
758
|
+
){
|
|
756
759
|
throw new Error(i18next.t('text.empty_value_in_add_product_list'))
|
|
760
|
+
}
|
|
761
|
+
this.editProductGrist.dirtyData.records.forEach(record => {
|
|
762
|
+
if (record.packQty === 0 && !record.remark) {
|
|
763
|
+
throw new Error(i18next.t('text.remark_is_empty_kindly_fill_in_to_proceed'));
|
|
764
|
+
}
|
|
765
|
+
if (isNaN(record.packQty)) {
|
|
766
|
+
throw new Error(i18next.t('text.pack_qty_is_empty_kindly_fill_in_to_proceed'))
|
|
767
|
+
}
|
|
768
|
+
});
|
|
757
769
|
}
|
|
758
770
|
|
|
759
771
|
async fetchUserRoleHandler() {
|
|
@@ -5,6 +5,7 @@ const warehouse_base_1 = require("@things-factory/warehouse-base");
|
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const sales_base_1 = require("@things-factory/sales-base");
|
|
7
7
|
const worksheet_base_1 = require("@things-factory/worksheet-base");
|
|
8
|
+
const integration_base_1 = require("@things-factory/integration-base");
|
|
8
9
|
exports.warehouseInventoryAdjustment = {
|
|
9
10
|
async warehouseInventoryAdjustment(_, { patches }, context) {
|
|
10
11
|
try {
|
|
@@ -54,6 +55,9 @@ exports.warehouseInventoryAdjustment = {
|
|
|
54
55
|
releaseGood: (0, typeorm_1.In)(releaseGoodId),
|
|
55
56
|
status: 'EXECUTING'
|
|
56
57
|
}, { status: 'DEACTIVATED' });
|
|
58
|
+
for (const invChange of _inventoryChanges) {
|
|
59
|
+
(0, integration_base_1.webhookHandler)(invChange.inventory, invChange.inventory.bizplace, integration_base_1.WebhookEvents.InventoryAdjusted);
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
return item;
|
|
59
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warehouse-intentory-adjustment.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts"],"names":[],"mappings":";;;AACA,mEAAyF;AACzF,qCAAyC;AACzC,2DAAwE;AACxE,mEAA2E;
|
|
1
|
+
{"version":3,"file":"warehouse-intentory-adjustment.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.536",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -62,53 +62,53 @@
|
|
|
62
62
|
"@operato/scene-tab": "^0.1.8",
|
|
63
63
|
"@operato/scene-table": "^0.1.8",
|
|
64
64
|
"@operato/scene-wheel-sorter": "^0.1.8",
|
|
65
|
-
"@things-factory/apptool-ui": "^4.3.
|
|
66
|
-
"@things-factory/attachment-ui": "^4.3.
|
|
67
|
-
"@things-factory/auth-ui": "^4.3.
|
|
68
|
-
"@things-factory/barcode-ui": "^4.3.
|
|
69
|
-
"@things-factory/biz-ui": "^4.3.
|
|
70
|
-
"@things-factory/board-service": "^4.3.
|
|
71
|
-
"@things-factory/board-ui": "^4.3.
|
|
72
|
-
"@things-factory/code-ui": "^4.3.
|
|
73
|
-
"@things-factory/context-ui": "^4.3.
|
|
74
|
-
"@things-factory/export-ui": "^4.3.
|
|
75
|
-
"@things-factory/export-ui-csv": "^4.3.
|
|
76
|
-
"@things-factory/export-ui-excel": "^4.3.
|
|
77
|
-
"@things-factory/fav-base": "^4.3.
|
|
78
|
-
"@things-factory/form-ui": "^4.3.
|
|
79
|
-
"@things-factory/geography": "^4.3.
|
|
80
|
-
"@things-factory/grist-ui": "^4.3.
|
|
81
|
-
"@things-factory/help": "^4.3.
|
|
82
|
-
"@things-factory/i18n-base": "^4.3.
|
|
83
|
-
"@things-factory/id-rule-base": "^4.3.
|
|
84
|
-
"@things-factory/import-ui": "^4.3.
|
|
85
|
-
"@things-factory/import-ui-excel": "^4.3.
|
|
86
|
-
"@things-factory/menu-ui": "^4.3.
|
|
87
|
-
"@things-factory/more-ui": "^4.3.
|
|
88
|
-
"@things-factory/notification": "^4.3.
|
|
65
|
+
"@things-factory/apptool-ui": "^4.3.535",
|
|
66
|
+
"@things-factory/attachment-ui": "^4.3.535",
|
|
67
|
+
"@things-factory/auth-ui": "^4.3.535",
|
|
68
|
+
"@things-factory/barcode-ui": "^4.3.535",
|
|
69
|
+
"@things-factory/biz-ui": "^4.3.535",
|
|
70
|
+
"@things-factory/board-service": "^4.3.535",
|
|
71
|
+
"@things-factory/board-ui": "^4.3.535",
|
|
72
|
+
"@things-factory/code-ui": "^4.3.535",
|
|
73
|
+
"@things-factory/context-ui": "^4.3.535",
|
|
74
|
+
"@things-factory/export-ui": "^4.3.535",
|
|
75
|
+
"@things-factory/export-ui-csv": "^4.3.535",
|
|
76
|
+
"@things-factory/export-ui-excel": "^4.3.535",
|
|
77
|
+
"@things-factory/fav-base": "^4.3.535",
|
|
78
|
+
"@things-factory/form-ui": "^4.3.535",
|
|
79
|
+
"@things-factory/geography": "^4.3.535",
|
|
80
|
+
"@things-factory/grist-ui": "^4.3.535",
|
|
81
|
+
"@things-factory/help": "^4.3.535",
|
|
82
|
+
"@things-factory/i18n-base": "^4.3.535",
|
|
83
|
+
"@things-factory/id-rule-base": "^4.3.535",
|
|
84
|
+
"@things-factory/import-ui": "^4.3.535",
|
|
85
|
+
"@things-factory/import-ui-excel": "^4.3.535",
|
|
86
|
+
"@things-factory/menu-ui": "^4.3.535",
|
|
87
|
+
"@things-factory/more-ui": "^4.3.535",
|
|
88
|
+
"@things-factory/notification": "^4.3.535",
|
|
89
89
|
"@things-factory/pdf": "^4.3.534",
|
|
90
|
-
"@things-factory/print-proxy-service": "^4.3.
|
|
91
|
-
"@things-factory/print-ui": "^4.3.
|
|
92
|
-
"@things-factory/product-base": "^4.3.
|
|
93
|
-
"@things-factory/resource-ui": "^4.3.
|
|
94
|
-
"@things-factory/sales-ui": "^4.3.
|
|
90
|
+
"@things-factory/print-proxy-service": "^4.3.535",
|
|
91
|
+
"@things-factory/print-ui": "^4.3.535",
|
|
92
|
+
"@things-factory/product-base": "^4.3.535",
|
|
93
|
+
"@things-factory/resource-ui": "^4.3.535",
|
|
94
|
+
"@things-factory/sales-ui": "^4.3.536",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.534",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.534",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.534",
|
|
98
98
|
"@things-factory/scene-form": "^4.3.534",
|
|
99
99
|
"@things-factory/scene-google-map": "^4.3.534",
|
|
100
100
|
"@things-factory/scene-graphql": "^4.3.534",
|
|
101
|
-
"@things-factory/scene-label": "^4.3.
|
|
101
|
+
"@things-factory/scene-label": "^4.3.535",
|
|
102
102
|
"@things-factory/scene-marker": "^4.3.534",
|
|
103
103
|
"@things-factory/scene-mqtt": "^4.3.534",
|
|
104
104
|
"@things-factory/scene-restful": "^4.3.534",
|
|
105
105
|
"@things-factory/scene-visualizer": "^4.3.534",
|
|
106
|
-
"@things-factory/setting-ui": "^4.3.
|
|
107
|
-
"@things-factory/system-ui": "^4.3.
|
|
108
|
-
"@things-factory/transport-base": "^4.3.
|
|
109
|
-
"@things-factory/tutorial-ui": "^4.3.
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
106
|
+
"@things-factory/setting-ui": "^4.3.535",
|
|
107
|
+
"@things-factory/system-ui": "^4.3.535",
|
|
108
|
+
"@things-factory/transport-base": "^4.3.535",
|
|
109
|
+
"@things-factory/tutorial-ui": "^4.3.535",
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.536",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.536"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@things-factory/builder": "^4.3.534",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"cypress-localstorage-commands": "^1.6.1",
|
|
118
118
|
"eslint-plugin-cypress": "^2.12.1"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "49cdab239e10ed9594af6de554f76de622af75af"
|
|
121
121
|
}
|
package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { InventoryChange, approveInventoryChanges } from '@things-factory/wareho
|
|
|
3
3
|
import { In, Not, IsNull } from 'typeorm'
|
|
4
4
|
import { OrderInventory, ReleaseGood } from '@things-factory/sales-base'
|
|
5
5
|
import { WorksheetDetail, Worksheet } from '@things-factory/worksheet-base'
|
|
6
|
+
import { webhookHandler,WebhookEvents } from '@things-factory/integration-base'
|
|
6
7
|
|
|
7
8
|
export const warehouseInventoryAdjustment = {
|
|
8
9
|
async warehouseInventoryAdjustment(_: any, { patches }, context: any) {
|
|
@@ -12,7 +13,7 @@ export const warehouseInventoryAdjustment = {
|
|
|
12
13
|
// Retrieve order inventory
|
|
13
14
|
const { tx }: { tx: EntityManager } = context.state
|
|
14
15
|
|
|
15
|
-
const _inventoryChanges = await tx.getRepository(InventoryChange).find({
|
|
16
|
+
const _inventoryChanges: any = await tx.getRepository(InventoryChange).find({
|
|
16
17
|
where: { id: In(patches.map(item => item.id)) },
|
|
17
18
|
relations: [
|
|
18
19
|
'inventory',
|
|
@@ -70,6 +71,10 @@ export const warehouseInventoryAdjustment = {
|
|
|
70
71
|
},
|
|
71
72
|
{ status: 'DEACTIVATED' }
|
|
72
73
|
)
|
|
74
|
+
|
|
75
|
+
for (const invChange of _inventoryChanges) {
|
|
76
|
+
webhookHandler(invChange.inventory, invChange.inventory.bizplace, WebhookEvents.InventoryAdjusted)
|
|
77
|
+
}
|
|
73
78
|
}
|
|
74
79
|
return item
|
|
75
80
|
} catch (error) {
|
package/translations/en.json
CHANGED
|
@@ -1192,6 +1192,7 @@
|
|
|
1192
1192
|
"label.transfer_qty": "transfer qty",
|
|
1193
1193
|
"label.transfer": "transfer",
|
|
1194
1194
|
"label.transport_type": "transport type",
|
|
1195
|
+
"label.transport_vehicle": "transport vehicle",
|
|
1195
1196
|
"label.transporter": "transporter",
|
|
1196
1197
|
"label.truck_no": "truck no.",
|
|
1197
1198
|
"label.type": "type",
|
|
@@ -1684,6 +1685,8 @@
|
|
|
1684
1685
|
"text.release_qty_not_matched": "release qty not matched",
|
|
1685
1686
|
"text.releaseGood_cancelled": "{releaseGood} cancelled",
|
|
1686
1687
|
"text.remark_is_empty": "remark is empty",
|
|
1688
|
+
"text.remark_is_empty_kindly_fill_in_to_proceed": "Remark is empty. Kindly fill in to proceed.",
|
|
1689
|
+
"text.pack_qty_is_empty_kindly_fill_in_to_proceed": "PackQty is empty. Kindly fill in to proceed.",
|
|
1687
1690
|
"text.remark_updated": "remark updated",
|
|
1688
1691
|
"text.replacement_pallet_not_match_criteria": "replacement pallet not match criteria",
|
|
1689
1692
|
"text.replenishment_created": "replenishment created",
|
package/translations/ko.json
CHANGED
|
@@ -1192,6 +1192,7 @@
|
|
|
1192
1192
|
"label.transfer_qty": "[ko]transfer qty",
|
|
1193
1193
|
"label.transfer": "재고 이동",
|
|
1194
1194
|
"label.transport_type": "운송 유형",
|
|
1195
|
+
"label.transport_vehicle": "[ko] transport vehicle",
|
|
1195
1196
|
"label.transporter": "[ko] transporter",
|
|
1196
1197
|
"label.truck_no": "트럭 번호",
|
|
1197
1198
|
"label.type": "유형",
|
|
@@ -1682,6 +1683,8 @@
|
|
|
1682
1683
|
"text.release_qty_must_be_at_least_1": "[ko] release qty must be at least 1",
|
|
1683
1684
|
"text.release_qty_not_matched": "[ko]release qty not matched",
|
|
1684
1685
|
"text.remark_is_empty": "비고가 없습니다",
|
|
1686
|
+
"text.remark_is_empty_kindly_fill_in_to_proceed": "[ko] Remark is empty. Kindly fill in to proceed.",
|
|
1687
|
+
"text.pack_qty_is_empty_kindly_fill_in_to_proceed": "[ko] PackQty is empty. Kindly fill in to proceed.",
|
|
1685
1688
|
"text.remark_updated": "비고가 업데이트 됐습니다",
|
|
1686
1689
|
"text.remove_order_permanently": "remove order permanently",
|
|
1687
1690
|
"text.replacement_pallet_not_match_criteria": "교체 파레트가 조건에 부합하지 않습니다",
|
package/translations/ms.json
CHANGED
|
@@ -1168,6 +1168,7 @@
|
|
|
1168
1168
|
"label.transfer_qty": "[ms]transfer qty",
|
|
1169
1169
|
"label.transfer": "pemindahan",
|
|
1170
1170
|
"label.transport_type": "jenis pengangkutan",
|
|
1171
|
+
"label.transport_vehicle": "[ms] transport vehicle",
|
|
1171
1172
|
"label.transporter": "[ms] transporter",
|
|
1172
1173
|
"label.truck_no": "nombor trak",
|
|
1173
1174
|
"label.type": "jenis",
|
|
@@ -1622,6 +1623,8 @@
|
|
|
1622
1623
|
"text.release_qty_must_be_at_least_1": "[ms] release qty must be at least 1",
|
|
1623
1624
|
"text.release_qty_not_matched": "stok pelepasan kuantiti tak sama",
|
|
1624
1625
|
"text.remark_is_empty": "disemak tidak diisi",
|
|
1626
|
+
"text.remark_is_empty_kindly_fill_in_to_proceed": "[ms] Remark is empty. Kindly fill in to proceed.",
|
|
1627
|
+
"text.pack_qty_is_empty_kindly_fill_in_to_proceed": "[ms]PackQty is empty. Kindly fill in to proceed.",
|
|
1625
1628
|
"text.remark_updated": "kenyataan dikemaskini",
|
|
1626
1629
|
"text.replacement_pallet_not_match_criteria": "gantian palet tidak sepadan dengan kriteria",
|
|
1627
1630
|
"text.replenishment_created": "[ms] replenishment created",
|
package/translations/zh.json
CHANGED
|
@@ -1134,6 +1134,7 @@
|
|
|
1134
1134
|
"label.transfer_qty": "[zh]transfer qty",
|
|
1135
1135
|
"label.transfer": "transfer",
|
|
1136
1136
|
"label.transport_type": "transport type",
|
|
1137
|
+
"label.transport_vehicle": "[zh] transport vehicle",
|
|
1137
1138
|
"label.transporter": "[zh] transporter",
|
|
1138
1139
|
"label.truck_no": "truck no.",
|
|
1139
1140
|
"label.type": "type",
|
|
@@ -1587,6 +1588,8 @@
|
|
|
1587
1588
|
"text.release_qty_must_be_at_least_1": "[zh] release qty must be at least 1",
|
|
1588
1589
|
"text.release_qty_not_matched": "[zh] release qty not matched",
|
|
1589
1590
|
"text.remark_is_empty": "remark is empty",
|
|
1591
|
+
"text.remark_is_empty_kindly_fill_in_to_proceed": "[zh] Remark is empty. Kindly fill in to proceed.",
|
|
1592
|
+
"text.pack_qty_is_empty_kindly_fill_in_to_proceed": "[zh] PackQty is empty. Kindly fill in to proceed.",
|
|
1590
1593
|
"text.remark_updated": "remark updated",
|
|
1591
1594
|
"text.replacement_pallet_not_match_criteria": "replacement pallet not match criteria",
|
|
1592
1595
|
"text.replenishment_created": "[zh] replenishment created",
|