@things-factory/operato-hub 6.0.0 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -46
- package/dist-server/entities/email-attachment.js +0 -77
- package/dist-server/entities/email-attachment.js.map +0 -1
- package/dist-server/entities/email-recipient.js +0 -69
- package/dist-server/entities/email-recipient.js.map +0 -1
- package/dist-server/entities/email.js +0 -90
- package/dist-server/entities/email.js.map +0 -1
- package/dist-server/graphql/resolvers/email/index.js +0 -6
- package/dist-server/graphql/resolvers/email/index.js.map +0 -1
- package/dist-server/graphql/resolvers/email/send-emails.js +0 -197
- package/dist-server/graphql/resolvers/email/send-emails.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +0 -200
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/index.js +0 -7
- package/dist-server/graphql/resolvers/reports/index.js.map +0 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +0 -231
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/inbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/inbound-order-details-report.js +0 -59
- package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +0 -1
- package/dist-server/graphql/types/reports/index.js +0 -13
- package/dist-server/graphql/types/reports/index.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js +0 -14
- package/dist-server/graphql/types/reports/outbound-order-details-report-list.js.map +0 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +0 -76
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-contact-points.js +0 -105
- package/dist-server/routers/api/restful-apis/v1/company/add-contact-points.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-marketplace-order.js +0 -197
- package/dist-server/routers/api/restful-apis/v1/company/add-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js +0 -79
- package/dist-server/routers/api/restful-apis/v1/company/add-products.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/cancel-marketplace-order.js +0 -90
- package/dist-server/routers/api/restful-apis/v1/company/cancel-marketplace-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-bizplace-list.js +0 -49
- package/dist-server/routers/api/restful-apis/v1/company/get-bizplace-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-contact-point-list.js +0 -62
- package/dist-server/routers/api/restful-apis/v1/company/get-contact-point-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-order-shipping-list.js +0 -98
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-order-shipping-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-store-list.js +0 -51
- package/dist-server/routers/api/restful-apis/v1/company/get-marketplace-store-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-partner-list.js +0 -88
- package/dist-server/routers/api/restful-apis/v1/company/get-partner-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js +0 -99
- package/dist-server/routers/api/restful-apis/v1/company/get-product-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/index.js +0 -15
- package/dist-server/routers/api/restful-apis/v1/company/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-order-delivered.js +0 -62
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-order-delivered.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-shipping-order.js +0 -40
- package/dist-server/routers/api/restful-apis/v1/company/update-marketplace-shipping-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js +0 -70
- package/dist-server/routers/api/restful-apis/v1/middlewares/business-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/index.js +0 -40
- package/dist-server/routers/api/restful-apis/v1/middlewares/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js +0 -23
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/store-middleware.js +0 -32
- package/dist-server/routers/api/restful-apis/v1/middlewares/store-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/validation-middleware.js +0 -118
- package/dist-server/routers/api/restful-apis/v1/middlewares/validation-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/warehouse-middleware.js +0 -31
- package/dist-server/routers/api/restful-apis/v1/middlewares/warehouse-middleware.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/error-util.js +0 -71
- package/dist-server/routers/api/restful-apis/v1/utils/error-util.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/params.js +0 -563
- package/dist-server/routers/api/restful-apis/v1/utils/params.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/utils/validate-util.js +0 -66
- package/dist-server/routers/api/restful-apis/v1/utils/validate-util.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-inbound-order.js +0 -236
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js +0 -801
- package/dist-server/routers/api/restful-apis/v1/warehouse/add-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.js +0 -199
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-inbound-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-release-order.js +0 -192
- package/dist-server/routers/api/restful-apis/v1/warehouse/cancel-release-order.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-delivery-order-list.js +0 -138
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-delivery-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.js +0 -97
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-goods-received-note-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-details.js +0 -81
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-list.js +0 -94
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inbound-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js +0 -87
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-inventory-product-group-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js +0 -87
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-onhand-inventory-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js +0 -96
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-list.js +0 -110
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-list.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/index.js +0 -16
- package/dist-server/routers/api/restful-apis/v1/warehouse/index.js.map +0 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js +0 -71
- package/dist-server/routers/api/restful-apis/v1/warehouse/update-release-order-details.js.map +0 -1
- package/dist-server/routers/xilnex-router.js +0 -1104
- package/dist-server/routers/xilnex-router.js.map +0 -1
- package/dist-server/utils/report-query-util.js +0 -42
- package/dist-server/utils/report-query-util.js.map +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inboundOrderDetailsReport = void 0;
|
|
4
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
5
|
-
const biz_base_1 = require("@things-factory/biz-base");
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
exports.inboundOrderDetailsReport = {
|
|
8
|
-
async inboundOrderDetailsReport(_, params, context) {
|
|
9
|
-
try {
|
|
10
|
-
const { tx } = context.state;
|
|
11
|
-
let bizplaceFilter = { name: '', operator: '', value: '' };
|
|
12
|
-
let userFilter = params.filters.find(data => data.name === 'user');
|
|
13
|
-
let fromDate = params.filters.find(data => data.name === 'fromDate');
|
|
14
|
-
let toDate = params.filters.find(data => data.name === 'toDate');
|
|
15
|
-
let ganNo = params.filters.find(data => data.name === 'ganNo');
|
|
16
|
-
let grnNo = params.filters.find(data => data.name === 'grnNo');
|
|
17
|
-
let poNo = params.filters.find(data => data.name === 'poNo');
|
|
18
|
-
let doNo = params.filters.find(data => data.name === 'doNo');
|
|
19
|
-
if (userFilter) {
|
|
20
|
-
const user = await tx.getRepository(auth_base_1.User).findOne({
|
|
21
|
-
where: { id: userFilter.value },
|
|
22
|
-
relations: ['bizplaces']
|
|
23
|
-
});
|
|
24
|
-
const bizplace = user.bizplaces[0];
|
|
25
|
-
if (!bizplace)
|
|
26
|
-
throw 'Invalid input';
|
|
27
|
-
bizplaceFilter = { name: 'bizplace', operator: 'eq', value: bizplace.id };
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
bizplaceFilter = params.filters.find(data => data.name === 'bizplace');
|
|
31
|
-
}
|
|
32
|
-
if (!bizplaceFilter || !fromDate || !toDate)
|
|
33
|
-
throw 'Invalid input';
|
|
34
|
-
const bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
35
|
-
id: bizplaceFilter.value
|
|
36
|
-
});
|
|
37
|
-
await (0, utils_1.rawProductsQuery)(tx, params, bizplace);
|
|
38
|
-
let extraQueryFilters = '';
|
|
39
|
-
if (ganNo) {
|
|
40
|
-
extraQueryFilters = `${extraQueryFilters} and gan_no like '%${ganNo.value}%' `;
|
|
41
|
-
}
|
|
42
|
-
if (grnNo) {
|
|
43
|
-
extraQueryFilters = `${extraQueryFilters} and grn_no like '%${grnNo.value}%' `;
|
|
44
|
-
}
|
|
45
|
-
if (poNo) {
|
|
46
|
-
extraQueryFilters = `${extraQueryFilters} and purchase_order_name like '%${poNo.value}%' `;
|
|
47
|
-
}
|
|
48
|
-
if (doNo) {
|
|
49
|
-
extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `;
|
|
50
|
-
}
|
|
51
|
-
await tx.query(`
|
|
52
|
-
create temp table temp_inbound_order_report on commit drop as (
|
|
53
|
-
select * from (
|
|
54
|
-
select b2.id as "bizplace_id", b2.name as "bizplace_name", b2.description as "bizplace_description",
|
|
55
|
-
grn.name as "grn_no",
|
|
56
|
-
an.name as "gan_no", an.ref_no as "ref_no_1", an.ref_no_2 as "ref_no_2", an.ref_no_3 as "ref_no_3",
|
|
57
|
-
an.loose_item, an.import_cargo, an.container_no, an.container_size, an.own_transport,
|
|
58
|
-
u.name as "accepted_by", an.accepted_at,
|
|
59
|
-
an.created_at as "order_created_at",
|
|
60
|
-
w.started_at as "unload_start", w.ended_at as "unload_complete",
|
|
61
|
-
w2.started_at as "putaway_start", w2.ended_at as "putaway_complete",
|
|
62
|
-
an.delivery_order_no,
|
|
63
|
-
cp.id as "supplier_id",
|
|
64
|
-
cp.company_name as "supplier_name",
|
|
65
|
-
po.id as "purchase_order_id",
|
|
66
|
-
po.name as "purchase_order_name",
|
|
67
|
-
row_number() over(partition by an.name order by an.name, p.sku, ih.batch_id) as "order_line_item",
|
|
68
|
-
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",
|
|
69
|
-
ih.packing_type as "pack_type", op.packing_size as "pack_size",
|
|
70
|
-
ih.qty, ih.uom_value, ih.uom, ih.pallet_id, ih.carton_id, ih.batch_id, ih.batch_id_ref,
|
|
71
|
-
i.expiration_date, i.manufacture_date,
|
|
72
|
-
ih.unit_cost,
|
|
73
|
-
ih.created_at as "unloaded_at",u2.name as "unloaded_by",
|
|
74
|
-
ih2.created_at as "putaway_at", u3.name as "putaway_by",
|
|
75
|
-
coalesce((select volume from product_details pd where pd.id = i.product_detail_id
|
|
76
|
-
order by created_at desc
|
|
77
|
-
fetch first 1 rows only),0) as unit_volume,
|
|
78
|
-
coalesce((select nett_weight from product_details pd where pd.id = i.product_detail_id
|
|
79
|
-
order by created_at desc
|
|
80
|
-
fetch first 1 rows only),0) as unit_nett_weight,
|
|
81
|
-
coalesce((select gross_weight from product_details pd where pd.id = i.product_detail_id
|
|
82
|
-
order by created_at desc
|
|
83
|
-
fetch first 1 rows only),0) as unit_gross_weight,
|
|
84
|
-
coalesce((select weight_unit from product_details pd where pd.id = i.product_detail_id
|
|
85
|
-
order by created_at desc
|
|
86
|
-
fetch first 1 rows only),'') as weight_unit
|
|
87
|
-
from (
|
|
88
|
-
select * from arrival_notices
|
|
89
|
-
where domain_id = $1 and bizplace_id = $2 and status ='DONE'
|
|
90
|
-
and created_at >= $3 and created_at <= $4) an
|
|
91
|
-
left join goods_receival_notes grn on grn.arrival_notice_id = an.id
|
|
92
|
-
left join purchase_orders po on po.id = an.purchase_order_id
|
|
93
|
-
left join contact_points cp on cp.id = po.supplier_id
|
|
94
|
-
inner join bizplaces b2 on b2.id = an.bizplace_id
|
|
95
|
-
left join users u on u.id = an.accepted_by_id
|
|
96
|
-
inner join order_inventories oi on oi.arrival_notice_id = an.id
|
|
97
|
-
inner join inventories i on i.id = oi.inventory_id
|
|
98
|
-
left join worksheets w on w.arrival_notice_id = an.id and w."type" ='UNLOADING'
|
|
99
|
-
inner join reduced_inventory_histories ih on ih.inventory_id = oi.inventory_id and ih.transaction_type ='UNLOADING' and ih.ref_order_id = an.id::varchar
|
|
100
|
-
left join users u2 on u2.id = ih.creator_id
|
|
101
|
-
left join worksheets w2 on w2.arrival_notice_id = an.id and w2."type" ='PUTAWAY'
|
|
102
|
-
inner join reduced_inventory_histories ih2 on ih2.inventory_id = oi.inventory_id and ih2.transaction_type ='PUTAWAY' and ih2.ref_order_id = an.id::varchar
|
|
103
|
-
left join users u3 on u3.id = ih2.creator_id
|
|
104
|
-
inner join temp_products p on p.id = ih.product_id
|
|
105
|
-
inner join order_products op on op.arrival_notice_id = an.id and op.actual_pack_qty is not null and op.product_detail_id = ih.product_detail_id and
|
|
106
|
-
op.batch_id = ih.batch_id
|
|
107
|
-
order by an.name, p.sku, ih.batch_id
|
|
108
|
-
) src
|
|
109
|
-
where 1=1
|
|
110
|
-
${extraQueryFilters}
|
|
111
|
-
)
|
|
112
|
-
`, [context.state.domain.id, bizplace.id, fromDate.value, toDate.value]);
|
|
113
|
-
const total = await tx.query(`
|
|
114
|
-
select count(*) from temp_inbound_order_report
|
|
115
|
-
`);
|
|
116
|
-
const result = await tx.query(`
|
|
117
|
-
select *,
|
|
118
|
-
round((qty * unit_volume)::numeric ,4) as total_volume,
|
|
119
|
-
round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
|
|
120
|
-
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
121
|
-
from temp_inbound_order_report
|
|
122
|
-
offset $1 limit $2
|
|
123
|
-
`, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
|
|
124
|
-
let items = result.map(itm => {
|
|
125
|
-
let data = {
|
|
126
|
-
bizplace: {
|
|
127
|
-
description: itm.bizplace_description,
|
|
128
|
-
name: itm.bizplace_name
|
|
129
|
-
},
|
|
130
|
-
grnNo: itm.grn_no,
|
|
131
|
-
ganNo: itm.gan_no,
|
|
132
|
-
deliveryOrderNo: itm.delivery_order_no,
|
|
133
|
-
refNo1: itm.ref_no_1,
|
|
134
|
-
refNo2: itm.ref_no_2,
|
|
135
|
-
refNo3: itm.ref_no_3,
|
|
136
|
-
looseItem: itm.loose_item,
|
|
137
|
-
importCargo: itm.import_cargo,
|
|
138
|
-
containerNo: itm.container_no,
|
|
139
|
-
containerSize: itm.container_size,
|
|
140
|
-
ownTransport: itm.own_transport,
|
|
141
|
-
acceptedBy: itm.accepted_by,
|
|
142
|
-
acceptedAt: itm.accepted_at,
|
|
143
|
-
orderCreatedAt: itm.order_created_at,
|
|
144
|
-
unloadStart: itm.unload_start,
|
|
145
|
-
unloadComplete: itm.unload_complete,
|
|
146
|
-
putawayStart: itm.putaway_start,
|
|
147
|
-
putawayComplete: itm.putaway_complete,
|
|
148
|
-
orderLineItem: itm.order_line_item,
|
|
149
|
-
product: {
|
|
150
|
-
id: itm.product_id,
|
|
151
|
-
sku: itm.product_sku,
|
|
152
|
-
name: itm.product_name,
|
|
153
|
-
description: itm.product_description,
|
|
154
|
-
type: itm.product_type
|
|
155
|
-
},
|
|
156
|
-
purchaseOrderId: itm.purchase_order_id,
|
|
157
|
-
purchaseOrderNo: itm.purchase_order_name,
|
|
158
|
-
packType: itm.pack_type,
|
|
159
|
-
packSize: itm.pack_size,
|
|
160
|
-
qty: itm.qty,
|
|
161
|
-
uomValue: itm.uom_value,
|
|
162
|
-
uom: itm.uom,
|
|
163
|
-
unitVolume: itm.unit_volume,
|
|
164
|
-
unitCost: itm.unit_cost,
|
|
165
|
-
totalVolume: itm.total_volume,
|
|
166
|
-
unitNettWeight: itm.unit_nett_weight,
|
|
167
|
-
totalUnitNettWeight: itm.total_unit_nett_weight,
|
|
168
|
-
unitGrossWeight: itm.unit_gross_weight,
|
|
169
|
-
totalUnitGrossWeight: itm.total_unit_gross_weight,
|
|
170
|
-
weightUnit: itm.weight_unit,
|
|
171
|
-
palletId: itm.pallet_id,
|
|
172
|
-
cartonId: itm.carton_id,
|
|
173
|
-
batchId: itm.batch_id,
|
|
174
|
-
batchIdRef: itm.batch_id_ref,
|
|
175
|
-
expirationDate: itm.expiration_date,
|
|
176
|
-
manufactureDate: itm.manufacture_date,
|
|
177
|
-
unloadedAt: itm.unloaded_at,
|
|
178
|
-
unloadedBy: itm.unloaded_by,
|
|
179
|
-
putawayAt: itm.putaway_at,
|
|
180
|
-
putawayBy: itm.putaway_by
|
|
181
|
-
};
|
|
182
|
-
if (itm.supplier_id) {
|
|
183
|
-
data['supplier'] = {
|
|
184
|
-
id: itm.supplier_id,
|
|
185
|
-
name: itm.supplier_name
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
return data;
|
|
189
|
-
});
|
|
190
|
-
return {
|
|
191
|
-
items,
|
|
192
|
-
total: total[0].count
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
catch (error) {
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
//# sourceMappingURL=inbound-order-details-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/inbound-order-details-report.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,uDAAmD;AAGnD,0CAAiD;AAEpC,QAAA,yBAAyB,GAAG;IACvC,KAAK,CAAC,yBAAyB,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QACrE,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,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C,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Query = void 0;
|
|
4
|
-
const inbound_order_details_report_1 = require("./inbound-order-details-report");
|
|
5
|
-
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
6
|
-
exports.Query = Object.assign(Object.assign({}, inbound_order_details_report_1.inboundOrderDetailsReport), outbound_order_details_report_1.outboundOrderDetailsReport);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,mFAA4E;AAE/D,QAAA,KAAK,mCACb,wDAAyB,GACzB,0DAA0B,EAC9B"}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.outboundOrderDetailsReport = void 0;
|
|
4
|
-
const auth_base_1 = require("@things-factory/auth-base");
|
|
5
|
-
const biz_base_1 = require("@things-factory/biz-base");
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
exports.outboundOrderDetailsReport = {
|
|
8
|
-
async outboundOrderDetailsReport(_, params, context) {
|
|
9
|
-
try {
|
|
10
|
-
const { tx } = context.state;
|
|
11
|
-
let bizplaceFilter = { name: '', operator: '', value: '' };
|
|
12
|
-
let userFilter = params.filters.find(data => data.name === 'user');
|
|
13
|
-
let fromDate = params.filters.find(data => data.name === 'fromDate');
|
|
14
|
-
let toDate = params.filters.find(data => data.name === 'toDate');
|
|
15
|
-
let roNo = params.filters.find(data => data.name === 'roNo');
|
|
16
|
-
let doNo = params.filters.find(data => data.name === 'doNo');
|
|
17
|
-
let status = params.filters.find(data => data.name === 'status');
|
|
18
|
-
if (userFilter) {
|
|
19
|
-
const user = await tx.getRepository(auth_base_1.User).findOne({
|
|
20
|
-
where: { id: userFilter.value },
|
|
21
|
-
relations: ['bizplaces']
|
|
22
|
-
});
|
|
23
|
-
const bizplace = user.bizplaces[0];
|
|
24
|
-
if (!bizplace)
|
|
25
|
-
throw 'Invalid input';
|
|
26
|
-
bizplaceFilter = { name: 'bizplace', operator: 'eq', value: bizplace.id };
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
bizplaceFilter = params.filters.find(data => data.name === 'bizplace');
|
|
30
|
-
}
|
|
31
|
-
if (!bizplaceFilter || !fromDate || !toDate)
|
|
32
|
-
throw 'Invalid input';
|
|
33
|
-
const bizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
34
|
-
id: bizplaceFilter.value
|
|
35
|
-
});
|
|
36
|
-
await (0, utils_1.rawProductsQuery)(tx, params, bizplace);
|
|
37
|
-
let extraQueryFilters = '';
|
|
38
|
-
if (roNo) {
|
|
39
|
-
extraQueryFilters = `${extraQueryFilters} and ro_no like '%${roNo.value}%' `;
|
|
40
|
-
}
|
|
41
|
-
if (doNo) {
|
|
42
|
-
extraQueryFilters = `${extraQueryFilters} and delivery_order_no like '%${doNo.value}%' `;
|
|
43
|
-
}
|
|
44
|
-
console.time('temp');
|
|
45
|
-
await tx.query(`
|
|
46
|
-
create temp table temp_outbound_order_report on commit drop as (
|
|
47
|
-
select * from (
|
|
48
|
-
select oi.id,
|
|
49
|
-
oi.release_qty AS "release_qty", oi.picked_at, oi.picked_by, oi.packed_at, oi.packed_by, oi.loaded_at, oi.loaded_by,
|
|
50
|
-
oi.release_qty as "qty", oi.release_uom_value as "uom_value", oi.return_to_location_qty, oi.return_to_location_uom_value, oi.product_detail_id,
|
|
51
|
-
coalesce(do2.other_driver, td.name) as driver_name,
|
|
52
|
-
coalesce(do2.truck_no, tv.name, rg.truck_no) as vehicle_no,
|
|
53
|
-
do2.name AS "delivery_order_no", do2.delivery_date AS "delivery_order_delivery_date", do2."to", do2.contact_point_ref_id, do2.pallet_qty,
|
|
54
|
-
coalesce(do2.delivery_date_time, do2.delivery_date::timestamp, ms.dispatched_at, null) as "dispatched_at",
|
|
55
|
-
rg.bizplace_id, $5 AS "bizplace_name", $6 AS "bizplace_description",
|
|
56
|
-
coalesce( concat(do2.delivery_address_1, do2.delivery_address_2, do2.delivery_address_3, do2.delivery_address_4, do2.delivery_address_5, do2.postal_code, do2.country), concat(rg.delivery_address_1, rg.delivery_address_2, rg.delivery_address_3, rg.delivery_address_4, rg.delivery_address_5, rg.postal_code, rg.country)) as delivery_address,
|
|
57
|
-
so.container_no, so.container_size,
|
|
58
|
-
rg.export_option, 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",
|
|
59
|
-
u1.name as "order_created_by", rg.created_at AS "order_created_at",
|
|
60
|
-
rg.accepted_at, u4.name as accepted_by, rg.checked_remark_by, rg.checked_remark_at, coalesce(do2.own_collection, rg.own_transport) AS own_transport,
|
|
61
|
-
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", oi.packing_type as "packing_type", oi.packing_size as "packing_size",
|
|
62
|
-
i.uom, i.unit_cost,
|
|
63
|
-
i.id as inventory_id, i.pallet_id, i.carton_id, i.batch_id, i.batch_id_ref, i.expiration_date, i.manufacture_date,
|
|
64
|
-
coalesce(ms.name,'') as manifest_no, coalesce(rg.manifested_at, ms.created_at) as manifested_at, coalesce(u6.name, u5.name) as manifested_by
|
|
65
|
-
from release_goods rg
|
|
66
|
-
left join users u1 on u1.id = rg.creator_id
|
|
67
|
-
inner join order_inventories oi on rg.id = oi.release_good_id
|
|
68
|
-
left join shipping_orders so on so.id = rg.shipping_order_id
|
|
69
|
-
left join users u4 on u4.id = rg.accepted_by_id
|
|
70
|
-
left join manifests ms on ms.id = rg.manifest_id
|
|
71
|
-
left join users u5 on u5.id = ms.creator_id
|
|
72
|
-
left join users u6 on u6.id = rg.manifested_by_id
|
|
73
|
-
inner join inventories i on i.id = oi.inventory_id
|
|
74
|
-
inner join temp_products p on p.id = oi.product_id
|
|
75
|
-
left join delivery_orders do2 on do2.id = oi.delivery_order_id
|
|
76
|
-
left join transport_drivers td ON td.id = do2.transport_driver_id
|
|
77
|
-
left join transport_vehicles tv on tv.id = do2.transport_vehicle_id
|
|
78
|
-
where rg.bizplace_id = $2 and rg.domain_id = $1
|
|
79
|
-
and rg.created_at >= $3 and rg.created_at <= $4
|
|
80
|
-
and oi.status <> 'REPLACED'
|
|
81
|
-
${status ? `and rg.status = '${status.value}' ` : ``}
|
|
82
|
-
) src
|
|
83
|
-
where 1=1
|
|
84
|
-
${extraQueryFilters}
|
|
85
|
-
)
|
|
86
|
-
`, [context.state.domain.id, bizplace.id, fromDate.value, toDate.value, bizplace.name, bizplace.description]);
|
|
87
|
-
console.timeEnd('temp');
|
|
88
|
-
const total = await tx.query(`
|
|
89
|
-
select count(*) from temp_outbound_order_report
|
|
90
|
-
`);
|
|
91
|
-
await tx.query(`
|
|
92
|
-
create temp table temp_outbound_order_worksheet on commit drop as (
|
|
93
|
-
select oi.id, w.started_at, w.ended_at, w.type from temp_outbound_order_report oi
|
|
94
|
-
inner join worksheet_details wd on wd.target_inventory_id = oi.id
|
|
95
|
-
inner join worksheets w on w.id = wd.worksheet_id
|
|
96
|
-
)
|
|
97
|
-
`);
|
|
98
|
-
console.time('result');
|
|
99
|
-
const result = await tx.query(`
|
|
100
|
-
select *,
|
|
101
|
-
round((qty * unit_volume)::numeric ,4) as total_volume,
|
|
102
|
-
round((qty * unit_nett_weight)::numeric ,4) as total_unit_nett_weight,
|
|
103
|
-
round((qty * unit_gross_weight)::numeric ,4) as total_unit_gross_weight
|
|
104
|
-
from (
|
|
105
|
-
select oi.*,
|
|
106
|
-
wpick.started_at as picking_start, wpick.ended_at as picking_complete,
|
|
107
|
-
wpack.started_at as packing_start, wpack.ended_at as packing_complete,
|
|
108
|
-
wsort.started_at as sorting_start, wsort.ended_at as sorting_complete,
|
|
109
|
-
wload.started_at as loading_start, wload.ended_at as loading_complete,
|
|
110
|
-
coalesce(delivery_address, concat(cp.address, cp.address_2)) as "delivery_address",
|
|
111
|
-
coalesce((select volume from product_details pd where pd.id = oi.product_detail_id
|
|
112
|
-
order by created_at desc
|
|
113
|
-
fetch first 1 rows only),0) as unit_volume,
|
|
114
|
-
coalesce((select nett_weight from product_details pd where pd.id = oi.product_detail_id
|
|
115
|
-
order by created_at desc
|
|
116
|
-
fetch first 1 rows only),0) as unit_nett_weight,
|
|
117
|
-
coalesce((select gross_weight from product_details pd where pd.id = oi.product_detail_id
|
|
118
|
-
order by created_at desc
|
|
119
|
-
fetch first 1 rows only),0) as unit_gross_weight,
|
|
120
|
-
coalesce((select weight_unit from product_details pd where pd.id = oi.product_detail_id
|
|
121
|
-
order by created_at desc
|
|
122
|
-
fetch first 1 rows only),'') as weight_unit,
|
|
123
|
-
coalesce((select unit_cost from reduced_inventory_histories rih where
|
|
124
|
-
rih.ref_order_id::uuid = oi.id and
|
|
125
|
-
rih.inventory_id::uuid = oi.inventory_id and
|
|
126
|
-
rih.transaction_type = 'PICKING'
|
|
127
|
-
order by created_at desc
|
|
128
|
-
fetch first 1 rows only), oi.unit_cost, 0) as unit_cost
|
|
129
|
-
from temp_outbound_order_report oi
|
|
130
|
-
left join contact_points cp on cp.id = oi.contact_point_ref_id
|
|
131
|
-
left join temp_outbound_order_worksheet wpick on wpick.id = oi.id
|
|
132
|
-
and (wpick.type= 'PICKING' OR wpick.type = 'BATCH_PICKING')
|
|
133
|
-
left join temp_outbound_order_worksheet wpack on wpack.id = oi.id
|
|
134
|
-
and wpack.type= 'PACKING'
|
|
135
|
-
left join temp_outbound_order_worksheet wsort on wsort.id = oi.id
|
|
136
|
-
and wsort.type= 'SORTING'
|
|
137
|
-
left join temp_outbound_order_worksheet wload on wload.id = oi.id
|
|
138
|
-
and wload.type= 'LOADING'
|
|
139
|
-
order by oi.ro_no, oi.product_sku
|
|
140
|
-
offset $1 limit $2
|
|
141
|
-
) src
|
|
142
|
-
`, [(params.pagination.page - 1) * params.pagination.limit, params.pagination.limit]);
|
|
143
|
-
console.timeEnd('result');
|
|
144
|
-
let items = result.map(itm => {
|
|
145
|
-
return {
|
|
146
|
-
bizplace: {
|
|
147
|
-
id: itm.bizplace_id,
|
|
148
|
-
name: itm.bizplace_name,
|
|
149
|
-
description: itm.bizplace_description
|
|
150
|
-
},
|
|
151
|
-
doNo: itm.delivery_order_no,
|
|
152
|
-
doDeliveryDate: itm.delivery_order_delivery_date,
|
|
153
|
-
dispatchedAt: itm.dispatched_at,
|
|
154
|
-
deliveryAddress: itm.delivery_address,
|
|
155
|
-
manifestNo: itm.manifest_no,
|
|
156
|
-
roNo: itm.ro_no,
|
|
157
|
-
roType: itm.ro_type,
|
|
158
|
-
status: itm.ro_status,
|
|
159
|
-
refNo1: itm.ref_no_1,
|
|
160
|
-
refNo3: itm.ref_no_3,
|
|
161
|
-
refNo2: itm.ref_no_2,
|
|
162
|
-
acceptedBy: itm.accepted_by,
|
|
163
|
-
acceptedAt: itm.accepted_at,
|
|
164
|
-
orderCreatedBy: itm.order_created_by,
|
|
165
|
-
orderCreatedAt: itm.order_created_at,
|
|
166
|
-
pickingStart: itm.picking_start,
|
|
167
|
-
pickingComplete: itm.picking_complete,
|
|
168
|
-
packingStart: itm.packing_start,
|
|
169
|
-
packingComplete: itm.packing_complete,
|
|
170
|
-
sortingStart: itm.sorting_start,
|
|
171
|
-
sortingComplete: itm.sorting_complete,
|
|
172
|
-
loadingStart: itm.loading_start,
|
|
173
|
-
loadingComplete: itm.loading_complete,
|
|
174
|
-
product: {
|
|
175
|
-
id: itm.product_id,
|
|
176
|
-
sku: itm.product_sku,
|
|
177
|
-
name: itm.product_name,
|
|
178
|
-
description: itm.product_description,
|
|
179
|
-
type: itm.product_type
|
|
180
|
-
},
|
|
181
|
-
packType: itm.packing_type,
|
|
182
|
-
packSize: itm.packing_size,
|
|
183
|
-
qty: Math.abs(itm.qty),
|
|
184
|
-
uomValue: Math.abs(itm.uom_value),
|
|
185
|
-
uom: itm.uom,
|
|
186
|
-
unitCost: itm.unit_cost,
|
|
187
|
-
returnToLocationQty: itm.return_to_location_qty,
|
|
188
|
-
returnToLocationUomValue: itm.return_to_location_uom_value,
|
|
189
|
-
unitVolume: itm.unit_volume,
|
|
190
|
-
totalVolume: itm.total_volume,
|
|
191
|
-
unitNettWeight: itm.unit_nett_weight,
|
|
192
|
-
totalUnitNettWeight: itm.total_unit_nett_weight,
|
|
193
|
-
unitGrossWeight: itm.unit_gross_weight,
|
|
194
|
-
totalUnitGrossWeight: itm.total_unit_gross_weight,
|
|
195
|
-
weightUnit: itm.weight_unit,
|
|
196
|
-
palletId: itm.pallet_id,
|
|
197
|
-
cartonId: itm.carton_id,
|
|
198
|
-
batchId: itm.batch_id,
|
|
199
|
-
batchIdRef: itm.batch_id_ref,
|
|
200
|
-
expirationDate: itm.expiration_date,
|
|
201
|
-
manufactureDate: itm.manufacture_date,
|
|
202
|
-
pickedAt: itm.picked_at,
|
|
203
|
-
pickedBy: itm.picked_by,
|
|
204
|
-
packedAt: itm.packed_at,
|
|
205
|
-
packedBy: itm.packed_by,
|
|
206
|
-
checkedRemarkBy: itm.checked_remark_by,
|
|
207
|
-
checkedRemarkAt: itm.checked_remark_at,
|
|
208
|
-
loadedAt: itm.loaded_at,
|
|
209
|
-
loadedBy: itm.loaded_by,
|
|
210
|
-
manifestedAt: itm.manifested_at,
|
|
211
|
-
manifestedBy: itm.manifested_by,
|
|
212
|
-
exportOption: itm.export_option,
|
|
213
|
-
containerNo: itm.container_no,
|
|
214
|
-
containerSize: itm.container_size,
|
|
215
|
-
palletQty: itm.pallet_qty,
|
|
216
|
-
transportOption: itm.own_transport ? 'Own Transport' : 'Warehouse Transport',
|
|
217
|
-
vehicleNo: itm.vehicle_no,
|
|
218
|
-
driverName: itm.driver_name
|
|
219
|
-
};
|
|
220
|
-
});
|
|
221
|
-
return {
|
|
222
|
-
items,
|
|
223
|
-
total: total[0].count
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
catch (error) {
|
|
227
|
-
throw error;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
//# sourceMappingURL=outbound-order-details-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,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EAAE,GAAG,CAAC,SAAS;oBACvB,YAAY,EAAE,GAAG,CAAC,aAAa;oBAC/B,YAAY,EAAE,GAAG,CAAC,aAAa;oBAC/B,YAAY,EAAE,GAAG,CAAC,aAAa;oBAC/B,WAAW,EAAE,GAAG,CAAC,YAAY;oBAC7B,aAAa,EAAE,GAAG,CAAC,cAAc;oBACjC,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,eAAe,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,qBAAqB;oBAC5E,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,UAAU,EAAE,GAAG,CAAC,WAAW;iBAC5B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InboundOrderDetailsReportList = void 0;
|
|
7
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
-
exports.InboundOrderDetailsReportList = (0, graphql_tag_1.default) `
|
|
9
|
-
type InboundOrderDetailsReportList {
|
|
10
|
-
items: [InboundOrderDetailsReport]
|
|
11
|
-
total: Int
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
//# sourceMappingURL=inbound-order-details-report-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-order-details-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/inbound-order-details-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,6BAA6B,GAAG,IAAA,qBAAG,EAAA;;;;;CAK/C,CAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InboundOrderDetailsReport = void 0;
|
|
7
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
-
exports.InboundOrderDetailsReport = (0, graphql_tag_1.default) `
|
|
9
|
-
type InboundOrderDetailsReport {
|
|
10
|
-
bizplace: Bizplace
|
|
11
|
-
grnNo: String
|
|
12
|
-
ganNo: String
|
|
13
|
-
deliveryOrderNo: String
|
|
14
|
-
refNo1: String
|
|
15
|
-
refNo2: String
|
|
16
|
-
refNo3: String
|
|
17
|
-
looseItem: Boolean
|
|
18
|
-
importCargo: Boolean
|
|
19
|
-
containerNo: String
|
|
20
|
-
containerSize: String
|
|
21
|
-
ownTransport: Boolean
|
|
22
|
-
acceptedBy: String
|
|
23
|
-
acceptedAt: String
|
|
24
|
-
orderCreatedAt: String
|
|
25
|
-
unloadStart: String
|
|
26
|
-
unloadComplete: String
|
|
27
|
-
putawayStart: String
|
|
28
|
-
putawayComplete: String
|
|
29
|
-
orderLineItem: Int
|
|
30
|
-
product: Product
|
|
31
|
-
purchaseOrderId: String
|
|
32
|
-
purchaseOrderNo: String
|
|
33
|
-
contactPoint: ContactPoint
|
|
34
|
-
packType: String
|
|
35
|
-
packSize: Int
|
|
36
|
-
qty: Int
|
|
37
|
-
uomValue: Float
|
|
38
|
-
uom: String
|
|
39
|
-
unitCost: Float
|
|
40
|
-
unitVolume: Float
|
|
41
|
-
totalVolume: Float
|
|
42
|
-
unitNettWeight: Float
|
|
43
|
-
totalUnitNettWeight: Float
|
|
44
|
-
unitGrossWeight: Float
|
|
45
|
-
totalUnitGrossWeight: Float
|
|
46
|
-
weightUnit: String
|
|
47
|
-
palletId: String
|
|
48
|
-
cartonId: String
|
|
49
|
-
batchId: String
|
|
50
|
-
batchIdRef: String
|
|
51
|
-
expirationDate: String
|
|
52
|
-
manufactureDate: String
|
|
53
|
-
unloadedAt: String
|
|
54
|
-
unloadedBy: String
|
|
55
|
-
putawayAt: String
|
|
56
|
-
putawayBy: String
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
//# sourceMappingURL=inbound-order-details-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inbound-order-details-report.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/inbound-order-details-report.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,yBAAyB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD3C,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Types = exports.Query = void 0;
|
|
4
|
-
const inbound_order_details_report_1 = require("./inbound-order-details-report");
|
|
5
|
-
const inbound_order_details_report_list_1 = require("./inbound-order-details-report-list");
|
|
6
|
-
const outbound_order_details_report_1 = require("./outbound-order-details-report");
|
|
7
|
-
const outbound_order_details_report_list_1 = require("./outbound-order-details-report-list");
|
|
8
|
-
exports.Query = `
|
|
9
|
-
inboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): InboundOrderDetailsReportList @transaction
|
|
10
|
-
outboundOrderDetailsReport(filters: [Filter!], pagination: Pagination, sortings: [Sorting!]): OutboundOrderDetailsReportList @transaction
|
|
11
|
-
`;
|
|
12
|
-
exports.Types = [inbound_order_details_report_1.InboundOrderDetailsReport, inbound_order_details_report_list_1.InboundOrderDetailsReportList, outbound_order_details_report_1.OutboundOrderDetailsReport, outbound_order_details_report_list_1.OutboundOrderDetailsReportList];
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAC1E,2FAAmF;AACnF,mFAA4E;AAC5E,6FAAqF;AAExE,QAAA,KAAK,GAAG;;;CAGpB,CAAA;AAEY,QAAA,KAAK,GAAG,CAAC,wDAAyB,EAAE,iEAA6B,EAAE,0DAA0B,EAAE,mEAA8B,CAAC,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OutboundOrderDetailsReportList = void 0;
|
|
7
|
-
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
-
exports.OutboundOrderDetailsReportList = (0, graphql_tag_1.default) `
|
|
9
|
-
type OutboundOrderDetailsReportList {
|
|
10
|
-
items: [OutboundOrderDetailsReport]
|
|
11
|
-
total: Int
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
//# sourceMappingURL=outbound-order-details-report-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outbound-order-details-report-list.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/outbound-order-details-report-list.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,8BAA8B,GAAG,IAAA,qBAAG,EAAA;;;;;CAKhD,CAAA"}
|