@things-factory/integration-accounting 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 +15 -15
- package/dist-server/constants/account.js +0 -13
- package/dist-server/constants/account.js.map +0 -1
- package/dist-server/constants/index.js +0 -18
- package/dist-server/constants/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/goods-received/create-goods-received-note.js +0 -48
- package/dist-server/controllers/xilnex/apis/goods-received/create-goods-received-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/goods-received/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/goods-received/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/index.js +0 -26
- package/dist-server/controllers/xilnex/apis/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/cancel-purchase-order.js +0 -22
- package/dist-server/controllers/xilnex/apis/purchase-order/cancel-purchase-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/create-purchase-receive.js +0 -45
- package/dist-server/controllers/xilnex/apis/purchase-order/create-purchase-receive.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/get-purchase-order.js +0 -47
- package/dist-server/controllers/xilnex/apis/purchase-order/get-purchase-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/purchase-order/index.js +0 -20
- package/dist-server/controllers/xilnex/apis/purchase-order/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales/get-sale.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales/get-sale.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/create-sales-order.js +0 -78
- package/dist-server/controllers/xilnex/apis/sales-order/create-sales-order.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/index.js +0 -19
- package/dist-server/controllers/xilnex/apis/sales-order/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js +0 -24
- package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-return/create-sales-return.js +0 -49
- package/dist-server/controllers/xilnex/apis/sales-return/create-sales-return.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/sales-return/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/sales-return/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/shipment/create-shipment.js +0 -30
- package/dist-server/controllers/xilnex/apis/shipment/create-shipment.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/shipment/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/shipment/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stock-request/get-stock-request.js +0 -51
- package/dist-server/controllers/xilnex/apis/stock-request/get-stock-request.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stock-request/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/stock-request/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stocks/create-stock-adjust-record.js +0 -41
- package/dist-server/controllers/xilnex/apis/stocks/create-stock-adjust-record.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/stocks/index.js +0 -18
- package/dist-server/controllers/xilnex/apis/stocks/index.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/create-transfer-note.js +0 -43
- package/dist-server/controllers/xilnex/apis/transfer-note/create-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/delivery-transfer-note.js +0 -24
- package/dist-server/controllers/xilnex/apis/transfer-note/delivery-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/get-transfer-note.js +0 -49
- package/dist-server/controllers/xilnex/apis/transfer-note/get-transfer-note.js.map +0 -1
- package/dist-server/controllers/xilnex/apis/transfer-note/index.js +0 -20
- package/dist-server/controllers/xilnex/apis/transfer-note/index.js.map +0 -1
- package/dist-server/controllers/xilnex/index.js +0 -34
- package/dist-server/controllers/xilnex/index.js.map +0 -1
- package/dist-server/controllers/xilnex/platform-action.js +0 -41
- package/dist-server/controllers/xilnex/platform-action.js.map +0 -1
- package/dist-server/controllers/xilnex/xilnex.js +0 -96
- package/dist-server/controllers/xilnex/xilnex.js.map +0 -1
- package/dist-server/entities/account-webhook-order.js +0 -76
- package/dist-server/entities/account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-order.js +0 -15
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-orders.js +0 -14
- package/dist-server/graphql/resolvers/account-webhook-order/account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/create-account-webhook-order.js +0 -12
- package/dist-server/graphql/resolvers/account-webhook-order/create-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-order.js +0 -16
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-orders.js +0 -19
- package/dist-server/graphql/resolvers/account-webhook-order/delete-account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/index.js +0 -13
- package/dist-server/graphql/resolvers/account-webhook-order/index.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/update-account-webhook-order.js +0 -15
- package/dist-server/graphql/resolvers/account-webhook-order/update-account-webhook-order.js.map +0 -1
- package/dist-server/graphql/resolvers/account-webhook-order/update-multiple-account-webhook-orders.js +0 -30
- package/dist-server/graphql/resolvers/account-webhook-order/update-multiple-account-webhook-orders.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-list.js +0 -14
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-list.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-patch.js +0 -18
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order-patch.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order.js +0 -22
- package/dist-server/graphql/types/account-webhook-order/account-webhook-order.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/index.js +0 -35
- package/dist-server/graphql/types/account-webhook-order/index.js.map +0 -1
- package/dist-server/graphql/types/account-webhook-order/new-account-webhook-order.js +0 -16
- package/dist-server/graphql/types/account-webhook-order/new-account-webhook-order.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-accounting",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"test": "DEBUG=things-factory:* NODE_ENV=development npx mocha -r ts-node/register ./test/**/*spec.ts"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/apptool-ui": "^6.0.
|
|
28
|
-
"@things-factory/auth-ui": "^6.0.
|
|
29
|
-
"@things-factory/biz-base": "^6.0.
|
|
30
|
-
"@things-factory/code-ui": "^6.0.
|
|
31
|
-
"@things-factory/context-ui": "^6.0.
|
|
32
|
-
"@things-factory/grist-ui": "^6.0.
|
|
33
|
-
"@things-factory/i18n-base": "^6.0.
|
|
34
|
-
"@things-factory/integration-ui": "^6.0.
|
|
35
|
-
"@things-factory/more-ui": "^6.0.
|
|
36
|
-
"@things-factory/product-base": "^6.0.
|
|
37
|
-
"@things-factory/resource-ui": "^6.0.
|
|
38
|
-
"@things-factory/setting-ui": "^6.0.
|
|
39
|
-
"@things-factory/system-ui": "^6.0.
|
|
27
|
+
"@things-factory/apptool-ui": "^6.0.1",
|
|
28
|
+
"@things-factory/auth-ui": "^6.0.3",
|
|
29
|
+
"@things-factory/biz-base": "^6.0.3",
|
|
30
|
+
"@things-factory/code-ui": "^6.0.3",
|
|
31
|
+
"@things-factory/context-ui": "^6.0.1",
|
|
32
|
+
"@things-factory/grist-ui": "^6.0.1",
|
|
33
|
+
"@things-factory/i18n-base": "^6.0.1",
|
|
34
|
+
"@things-factory/integration-ui": "^6.0.3",
|
|
35
|
+
"@things-factory/more-ui": "^6.0.1",
|
|
36
|
+
"@things-factory/product-base": "^6.0.3",
|
|
37
|
+
"@things-factory/resource-ui": "^6.0.3",
|
|
38
|
+
"@things-factory/setting-ui": "^6.0.3",
|
|
39
|
+
"@things-factory/system-ui": "^6.0.1",
|
|
40
40
|
"debug": "^4.1.1",
|
|
41
41
|
"node-fetch": "^2.6.0"
|
|
42
42
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"nock": "^13.0.2",
|
|
51
51
|
"should": "^13.2.3"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "6d9a3aef103e6d8293bfce285662d15ec9c0d705"
|
|
54
54
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACCOUNT_SYNC_STATUS = exports.ACCOUNT_PLATFORM = void 0;
|
|
4
|
-
exports.ACCOUNT_PLATFORM = {
|
|
5
|
-
XILNEX: 'XILNEX',
|
|
6
|
-
XERO: 'XERO',
|
|
7
|
-
OTHERS: 'OTHERS'
|
|
8
|
-
};
|
|
9
|
-
exports.ACCOUNT_SYNC_STATUS = {
|
|
10
|
-
SUCCESS: 'SUCCESS',
|
|
11
|
-
FAILED: 'FAILED'
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../server/constants/account.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAA;AAEY,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACjB,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./account"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createGoodsReceivedNote = void 0;
|
|
4
|
-
function createGoodsReceivedNote() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'post',
|
|
7
|
-
path: '/goodsreceive',
|
|
8
|
-
denormalize(req, { accounting }) {
|
|
9
|
-
const { arrivalNotice, orderProducts } = req;
|
|
10
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
11
|
-
let totalReceivedQuantity = 0;
|
|
12
|
-
const curDate = new Date().toISOString();
|
|
13
|
-
let receivedItems = orderProducts.map(op => {
|
|
14
|
-
totalReceivedQuantity += op.actualPackQty;
|
|
15
|
-
return {
|
|
16
|
-
itemCode: op.product.sku,
|
|
17
|
-
quantityReceived: op.actualPackQty,
|
|
18
|
-
discountPercentage: 0,
|
|
19
|
-
uniqueId: '',
|
|
20
|
-
matrixBarcode: '',
|
|
21
|
-
itemRemark: 'NA',
|
|
22
|
-
enterQuantity: op.actualPackQty,
|
|
23
|
-
unitCost: op.unitPrice
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
let grn = {
|
|
27
|
-
receivingDate: curDate,
|
|
28
|
-
receiveType: arrivalNotice.orderSourceType == 'XILNEX_PO' ? 'Receive' : 'TRANSFERRECEIVE',
|
|
29
|
-
receivedStatus: 'Completed',
|
|
30
|
-
remark: arrivalNotice.remark || 'NA',
|
|
31
|
-
outlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH',
|
|
32
|
-
totalReceivedQuantity: totalReceivedQuantity,
|
|
33
|
-
poNumber: arrivalNotice.refNo,
|
|
34
|
-
invoiceNo: '-',
|
|
35
|
-
invoiceDate: curDate
|
|
36
|
-
};
|
|
37
|
-
if (arrivalNotice.orderSourceType == 'XILNEX_TRANSFER_NOTE') {
|
|
38
|
-
grn.refId = [arrivalNotice.refNo];
|
|
39
|
-
}
|
|
40
|
-
return { payload: { goodsReceive: Object.assign(Object.assign({}, grn), { receivedItems }) } };
|
|
41
|
-
},
|
|
42
|
-
normalize(res) {
|
|
43
|
-
return res;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
exports.createGoodsReceivedNote = createGoodsReceivedNote;
|
|
48
|
-
//# sourceMappingURL=create-goods-received-note.js.map
|
package/dist-server/controllers/xilnex/apis/goods-received/create-goods-received-note.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-goods-received-note.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/goods-received/create-goods-received-note.ts"],"names":[],"mappings":";;;AAAA,SAAgB,uBAAuB;IACrC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,eAAe;QACrB,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YAC7B,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;YAC5C,IAAI,WAAW,GAAQ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,EAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACxF,IAAI,qBAAqB,GAAG,CAAC,CAAA;YAC7B,MAAM,OAAO,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;YAEhD,IAAI,aAAa,GAAQ,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;gBAC9C,qBAAqB,IAAI,EAAE,CAAC,aAAa,CAAA;gBACzC,OAAO;oBACL,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG;oBACxB,gBAAgB,EAAE,EAAE,CAAC,aAAa;oBAClC,kBAAkB,EAAE,CAAC;oBACrB,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,EAAE;oBACjB,UAAU,EAAE,IAAI;oBAChB,aAAa,EAAE,EAAE,CAAC,aAAa;oBAC/B,QAAQ,EAAE,EAAE,CAAC,SAAS;iBACvB,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,IAAI,GAAG,GAAQ;gBACb,aAAa,EAAE,OAAO;gBACtB,WAAW,EAAE,aAAa,CAAC,eAAe,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB;gBACzF,cAAc,EAAE,WAAW;gBAC3B,MAAM,EAAE,aAAa,CAAC,MAAM,IAAI,IAAI;gBACpC,MAAM,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KAAI,aAAa;gBAC5C,qBAAqB,EAAE,qBAAqB;gBAC5C,QAAQ,EAAE,aAAa,CAAC,KAAK;gBAC7B,SAAS,EAAE,GAAG;gBACd,WAAW,EAAE,OAAO;aACrB,CAAA;YAED,IAAI,aAAa,CAAC,eAAe,IAAI,sBAAsB,EAAE;gBAC3D,GAAG,CAAC,KAAK,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;aAClC;YAED,OAAO,EAAE,OAAO,EAAE,EAAE,YAAY,kCAAO,GAAG,KAAE,aAAa,GAAE,EAAE,EAAE,CAAA;QACjE,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AA9CD,0DA8CC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-goods-received-note"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/goods-received/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA4C"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./goods-received"), exports);
|
|
18
|
-
__exportStar(require("./transfer-note"), exports);
|
|
19
|
-
__exportStar(require("./sales"), exports);
|
|
20
|
-
__exportStar(require("./sales-order"), exports);
|
|
21
|
-
__exportStar(require("./sales-return"), exports);
|
|
22
|
-
__exportStar(require("./stocks"), exports);
|
|
23
|
-
__exportStar(require("./purchase-order"), exports);
|
|
24
|
-
__exportStar(require("./stock-request"), exports);
|
|
25
|
-
__exportStar(require("./shipment"), exports);
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC;AAChC,kDAA+B;AAC/B,0CAAuB;AACvB,gDAA6B;AAC7B,iDAA8B;AAC9B,2CAAwB;AACxB,mDAAgC;AAChC,kDAA+B;AAC/B,6CAA0B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cancelPurchaseOrder = void 0;
|
|
4
|
-
function cancelPurchaseOrder() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'put',
|
|
7
|
-
path: '/PurchaseOrder/{orderId}/Cancel',
|
|
8
|
-
denormalize(req, { accounting }) {
|
|
9
|
-
const { purchaseOrder } = req;
|
|
10
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
11
|
-
return {
|
|
12
|
-
resource: { orderId: parseInt(purchaseOrder.refNo) },
|
|
13
|
-
payload: { purchaseOrder: { cancelOutlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH', cancelRemark: '-' } }
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
normalize(res) {
|
|
17
|
-
return res;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
exports.cancelPurchaseOrder = cancelPurchaseOrder;
|
|
22
|
-
//# sourceMappingURL=cancel-purchase-order.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-purchase-order.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/purchase-order/cancel-purchase-order.ts"],"names":[],"mappings":";;;AAAA,SAAgB,mBAAmB;IACjC,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,iCAAiC;QACvC,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YAC7B,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;YAC7B,IAAI,WAAW,GAAQ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,EAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YAExF,OAAO;gBACL,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;gBACpD,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,YAAY,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KAAI,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE;aACtG,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAA;AACH,CAAC;AAjBD,kDAiBC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPurchaseReceive = void 0;
|
|
4
|
-
function createPurchaseReceive() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'post',
|
|
7
|
-
path: '/PurchaseOrder/{orderId}/GRNs',
|
|
8
|
-
denormalize(req, { accounting }) {
|
|
9
|
-
const { arrivalNotice, orderProducts } = req;
|
|
10
|
-
const curDate = new Date().toISOString();
|
|
11
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
12
|
-
let totalReceivedQuantity = 0;
|
|
13
|
-
let receivedItems = orderProducts.map(op => {
|
|
14
|
-
totalReceivedQuantity += op.actualPackQty;
|
|
15
|
-
return {
|
|
16
|
-
itemCode: op.product.sku,
|
|
17
|
-
enterQuantity: op.actualPackQty,
|
|
18
|
-
enterCost: op.unitPrice
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
let purchaseReceive = {
|
|
22
|
-
terms: 0,
|
|
23
|
-
postingDate: curDate,
|
|
24
|
-
receiveDate: curDate,
|
|
25
|
-
receivingDate: curDate,
|
|
26
|
-
receivedStatus: 'Completed',
|
|
27
|
-
isUpdateItemCost: false,
|
|
28
|
-
remark: arrivalNotice.remark || 'NA',
|
|
29
|
-
outlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH',
|
|
30
|
-
poNumber: arrivalNotice.refNo,
|
|
31
|
-
invoiceNo: arrivalNotice.refNo2 || '-',
|
|
32
|
-
invoiceDate: curDate
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
resource: { orderId: parseInt(arrivalNotice.refNo) },
|
|
36
|
-
payload: { purchaseReceive: Object.assign(Object.assign({}, purchaseReceive), { receivedItems }) }
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
normalize(res) {
|
|
40
|
-
return res;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
exports.createPurchaseReceive = createPurchaseReceive;
|
|
45
|
-
//# sourceMappingURL=create-purchase-receive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-purchase-receive.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/purchase-order/create-purchase-receive.ts"],"names":[],"mappings":";;;AAAA,SAAgB,qBAAqB;IACnC,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,+BAA+B;QACrC,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YAC7B,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;YAC5C,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;YACxC,IAAI,WAAW,GAAQ,CAAA,UA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
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPurchaseOrder = void 0;
|
|
4
|
-
function getPurchaseOrder() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'get',
|
|
7
|
-
path: '/PurchaseOrder/{orderId}',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
const { orderId } = req;
|
|
10
|
-
return { resource: { orderId: parseInt(orderId) } };
|
|
11
|
-
},
|
|
12
|
-
normalize(res) {
|
|
13
|
-
const { data } = res;
|
|
14
|
-
let purchaseOrder = data.purchaseOrder;
|
|
15
|
-
let poItems = purchaseOrder.poItems;
|
|
16
|
-
let orderInfo = {
|
|
17
|
-
orderId: purchaseOrder.id,
|
|
18
|
-
fromOutlet: purchaseOrder.submitterOutlet,
|
|
19
|
-
toOutlet: purchaseOrder.producerOutlet,
|
|
20
|
-
etaDate: new Date().toISOString().slice(0, 10),
|
|
21
|
-
ownTransport: true,
|
|
22
|
-
importCargo: false,
|
|
23
|
-
container: false,
|
|
24
|
-
remark: purchaseOrder.remarks,
|
|
25
|
-
currency: purchaseOrder.currencyCode
|
|
26
|
-
};
|
|
27
|
-
let orderItems = poItems.map(poItem => {
|
|
28
|
-
return {
|
|
29
|
-
refItemId: poItem.id,
|
|
30
|
-
product: {
|
|
31
|
-
refCode: poItem.itemId,
|
|
32
|
-
sku: poItem.itemCode
|
|
33
|
-
},
|
|
34
|
-
batchId: (poItem === null || poItem === void 0 ? void 0 : poItem.batchNo) ? poItem.batchNo : '-',
|
|
35
|
-
confirmedQty: poItem.enterQuantity,
|
|
36
|
-
unitCost: poItem.enterCost,
|
|
37
|
-
palletQty: null,
|
|
38
|
-
manufactureDate: '',
|
|
39
|
-
taxAmount: poItem.taxAmount
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
return { orderInfo, orderItems };
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.getPurchaseOrder = getPurchaseOrder;
|
|
47
|
-
//# sourceMappingURL=get-purchase-order.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-purchase-order.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/purchase-order/get-purchase-order.ts"],"names":[],"mappings":";;;AAAA,SAAgB,gBAAgB;IAC9B,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,0BAA0B;QAChC,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YACvB,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAA;QACrD,CAAC;QACD,SAAS,CAAC,GAAG;YACX,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAA;YACpB,IAAI,aAAa,GAAQ,IAAI,CAAC,aAAa,CAAA;YAC3C,IAAI,OAAO,GAAQ,aAAa,CAAC,OAAO,CAAA;YAExC,IAAI,SAAS,GAAQ;gBACnB,OAAO,EAAE,aAAa,CAAC,EAAE;gBACzB,UAAU,EAAE,aAAa,CAAC,eAAe;gBACzC,QAAQ,EAAE,aAAa,CAAC,cAAc;gBACtC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;gBAC9C,YAAY,EAAE,IAAI;gBAClB,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,KAAK;gBAChB,MAAM,EAAE,aAAa,CAAC,OAAO;gBAC7B,QAAQ,EAAE,aAAa,CAAC,YAAY;aACrC,CAAA;YAED,IAAI,UAAU,GAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;gBACzC,OAAO;oBACL,SAAS,EAAE,MAAM,CAAC,EAAE;oBACpB,OAAO,EAAE;wBACP,OAAO,EAAE,MAAM,CAAC,MAAM;wBACtB,GAAG,EAAE,MAAM,CAAC,QAAQ;qBACrB;oBACD,OAAO,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,EAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;oBAC/C,YAAY,EAAE,MAAM,CAAC,aAAa;oBAClC,QAAQ,EAAE,MAAM,CAAC,SAAS;oBAC1B,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,EAAE;oBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;iBAC5B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;QAClC,CAAC;KACF,CAAA;AACH,CAAC;AA5CD,4CA4CC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-purchase-order"), exports);
|
|
18
|
-
__exportStar(require("./create-purchase-receive"), exports);
|
|
19
|
-
__exportStar(require("./cancel-purchase-order"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/purchase-order/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,4DAAyC;AACzC,0DAAuC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSale = void 0;
|
|
4
|
-
function getSale() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'get',
|
|
7
|
-
path: '/sales/{orderId}',
|
|
8
|
-
denormalize(req) {
|
|
9
|
-
const { orderId } = req;
|
|
10
|
-
return { resource: { orderId } };
|
|
11
|
-
},
|
|
12
|
-
normalize(res) {
|
|
13
|
-
return res.data;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
exports.getSale = getSale;
|
|
18
|
-
//# sourceMappingURL=get-sale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-sale.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales/get-sale.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO;IACrB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,WAAW,CAAC,GAAG;YACb,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YACvB,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,CAAA;QAClC,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAC,IAAI,CAAA;QACjB,CAAC;KACF,CAAA;AACH,CAAC;AAZD,0BAYC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-sale"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSalesOrder = void 0;
|
|
4
|
-
function createSalesOrder() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'post',
|
|
7
|
-
path: '/salesorder',
|
|
8
|
-
denormalize(req, { accounting }) {
|
|
9
|
-
var _a;
|
|
10
|
-
const { releaseGood, orderProducts } = req;
|
|
11
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
12
|
-
const matchedClient = accountInfo.clients.filter(client => client.clientPlatform == releaseGood.platformCode && client.clientCountry == releaseGood.platformCountry);
|
|
13
|
-
let discountAmt = (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.discountAmount)
|
|
14
|
-
? parseFloat(releaseGood.discountAmount.toString().replace('-', ''))
|
|
15
|
-
: 0;
|
|
16
|
-
let promotionAmt = (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.promotionAmount) || 0;
|
|
17
|
-
let taxAmt = (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.taxAmount) || 0;
|
|
18
|
-
let shippingFee = (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.shippingFee) || 0;
|
|
19
|
-
let paidAmt = (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.paidAmount) || 0;
|
|
20
|
-
let totalAmount = paidAmt + shippingFee + taxAmt + promotionAmt + discountAmt;
|
|
21
|
-
let discountPercentage = (discountAmt / totalAmount) * 100;
|
|
22
|
-
let taxPercentage = (taxAmt / totalAmount) * 100;
|
|
23
|
-
taxPercentage = Math.round(taxPercentage * 100) / 100;
|
|
24
|
-
let salesOrder = {
|
|
25
|
-
dateTime: new Date(),
|
|
26
|
-
clientId: ((_a = matchedClient[0]) === null || _a === void 0 ? void 0 : _a.clientId) || '',
|
|
27
|
-
billingAddress: {
|
|
28
|
-
street: releaseGood.billingAddress,
|
|
29
|
-
city: null,
|
|
30
|
-
state: null,
|
|
31
|
-
zipcode: null,
|
|
32
|
-
country: null
|
|
33
|
-
},
|
|
34
|
-
shipmentAddress: {
|
|
35
|
-
street: releaseGood.deliveryAddress1,
|
|
36
|
-
city: releaseGood.city,
|
|
37
|
-
state: releaseGood.state,
|
|
38
|
-
zipcode: releaseGood.postalCode,
|
|
39
|
-
country: releaseGood.country
|
|
40
|
-
},
|
|
41
|
-
customField1: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.refNo) || '-',
|
|
42
|
-
integrationCustomField1: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.refNo) || '-',
|
|
43
|
-
status: 'CONFIRMED',
|
|
44
|
-
outlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH',
|
|
45
|
-
confirmOutlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH',
|
|
46
|
-
remark: releaseGood.remark,
|
|
47
|
-
type: 'InvoiceSales',
|
|
48
|
-
taxPercentage,
|
|
49
|
-
collections: [
|
|
50
|
-
{
|
|
51
|
-
amount: (releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.paidAmount) || 0,
|
|
52
|
-
cardType: matchedClient[0].clientPayment,
|
|
53
|
-
reference: matchedClient[0].clientPayment,
|
|
54
|
-
remark: matchedClient[0].clientPayment,
|
|
55
|
-
method: 'other'
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
salesOrderItems: orderProducts.map(op => {
|
|
59
|
-
var _a;
|
|
60
|
-
return {
|
|
61
|
-
itemCode: (_a = op === null || op === void 0 ? void 0 : op.product) === null || _a === void 0 ? void 0 : _a.sku,
|
|
62
|
-
enterPrice: (op === null || op === void 0 ? void 0 : op.sellingPrice) / (op === null || op === void 0 ? void 0 : op.releaseQty),
|
|
63
|
-
quantity: op === null || op === void 0 ? void 0 : op.releaseQty
|
|
64
|
-
// discountPercentage
|
|
65
|
-
};
|
|
66
|
-
})
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
payload: { salesOrder }
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
normalize(res) {
|
|
73
|
-
return res.data.salesOrder;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
exports.createSalesOrder = createSalesOrder;
|
|
78
|
-
//# sourceMappingURL=create-sales-order.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-sales-order.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales-order/create-sales-order.ts"],"names":[],"mappings":";;;AAAA,SAAgB,gBAAgB;IAC9B,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,aAAa;QACnB,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;;YAC7B,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;YAC1C,IAAI,WAAW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Aa;wBACtC,MAAM,EAAE,OAAO;qBAChB;iBACF;gBACD,eAAe,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;;oBACtC,OAAO;wBACL,QAAQ,EAAE,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,OAAO,0CAAE,GAAG;wBAC1B,UAAU,EAAE,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,YAAY,KAAG,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU,CAAA;wBAC7C,QAAQ,EAAE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU;wBACxB,qBAAqB;qBACtB,CAAA;gBACH,CAAC,CAAC;aACH,CAAA;YAED,OAAO;gBACL,OAAO,EAAE,EAAE,UAAU,EAAE;aACxB,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAC,IAAI,CAAC,UAAU,CAAA;QAC5B,CAAC;KACF,CAAA;AACH,CAAC;AA5ED,4CA4EC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-sales-order"), exports);
|
|
18
|
-
__exportStar(require("./post-sales-order-to-sales-invoice"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales-order/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,sEAAmD"}
|
package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.postSalesOrderToSalesInvoice = void 0;
|
|
4
|
-
const accounting_api_1 = require("../../../accounting-api");
|
|
5
|
-
function postSalesOrderToSalesInvoice() {
|
|
6
|
-
return {
|
|
7
|
-
method: 'post',
|
|
8
|
-
path: '/salesorder/{orderId}/invoice/{outlet}',
|
|
9
|
-
denormalize(req, { accounting }) {
|
|
10
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
11
|
-
return {
|
|
12
|
-
resource: { orderId: req.orderId, outlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH' }
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
async normalize(res, { accounting }) {
|
|
16
|
-
let data = res.data;
|
|
17
|
-
const sale = await accounting_api_1.AccountingAPI.getSale(accounting, { orderId: data.salesId });
|
|
18
|
-
data.sale = Object.assign({}, sale.sale);
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.postSalesOrderToSalesInvoice = postSalesOrderToSalesInvoice;
|
|
24
|
-
//# sourceMappingURL=post-sales-order-to-sales-invoice.js.map
|
package/dist-server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-sales-order-to-sales-invoice.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales-order/post-sales-order-to-sales-invoice.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AAEvD,SAAgB,4BAA4B;IAC1C,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,wCAAwC;QAC9C,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YAC7B,IAAI,WAAW,GAAQ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,EAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACxF,OAAO;gBACL,QAAQ,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KAAI,aAAa,EAAE;aACjF,CAAA;QACH,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;YACjC,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;YAEnB,MAAM,IAAI,GAAG,MAAM,8BAAa,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;YAC/E,IAAI,CAAC,IAAI,qBAAQ,IAAI,CAAC,IAAI,CAAE,CAAA;YAE5B,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;AACH,CAAC;AAnBD,oEAmBC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSalesReturn = void 0;
|
|
4
|
-
function createSalesReturn() {
|
|
5
|
-
return {
|
|
6
|
-
method: 'post',
|
|
7
|
-
path: '/sales/salesreturn',
|
|
8
|
-
denormalize(req, { accounting }) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
const { releaseGood, orderProducts } = req;
|
|
11
|
-
let accountInfo = (accounting === null || accounting === void 0 ? void 0 : accounting.accountInfo) ? JSON.parse(accounting.accountInfo) : {};
|
|
12
|
-
const matchedClient = accountInfo.clients.filter(client => client.clientPlatform == releaseGood.platformCode && client.clientCountry == releaseGood.platformCountry);
|
|
13
|
-
let sale = {
|
|
14
|
-
id: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.refNo3,
|
|
15
|
-
dateTime: releaseGood.updatedAt,
|
|
16
|
-
term: 0,
|
|
17
|
-
status: 'CONFIRMED',
|
|
18
|
-
outlet: (accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.outlet) || 'MAIN BRANCH',
|
|
19
|
-
client: {
|
|
20
|
-
id: (_a = matchedClient[0]) === null || _a === void 0 ? void 0 : _a.clientId
|
|
21
|
-
},
|
|
22
|
-
salesPerson: (_b = matchedClient[0]) === null || _b === void 0 ? void 0 : _b.clientName,
|
|
23
|
-
recipientContact: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.phone1,
|
|
24
|
-
recipientName: releaseGood === null || releaseGood === void 0 ? void 0 : releaseGood.attentionTo,
|
|
25
|
-
items: orderProducts.map(op => {
|
|
26
|
-
return {
|
|
27
|
-
id: op === null || op === void 0 ? void 0 : op.refItemId,
|
|
28
|
-
unitPrice: op === null || op === void 0 ? void 0 : op.sellingPrice,
|
|
29
|
-
quantity: -(op === null || op === void 0 ? void 0 : op.releaseQty),
|
|
30
|
-
deliveryQuantity: 0,
|
|
31
|
-
discountAmount: 0,
|
|
32
|
-
remark: op === null || op === void 0 ? void 0 : op.remark,
|
|
33
|
-
enterPrice: op === null || op === void 0 ? void 0 : op.sellingPrice,
|
|
34
|
-
discountRemark: '',
|
|
35
|
-
totalDiscountAmount: 0
|
|
36
|
-
};
|
|
37
|
-
})
|
|
38
|
-
};
|
|
39
|
-
return {
|
|
40
|
-
payload: { sale }
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
normalize(res) {
|
|
44
|
-
return res.data;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.createSalesReturn = createSalesReturn;
|
|
49
|
-
//# sourceMappingURL=create-sales-return.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-sales-return.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales-return/create-sales-return.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB;IAC/B,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,oBAAoB;QAC1B,WAAW,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE;;YAC7B,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,GAAG,CAAA;YAC1C,IAAI,WAAW,GAAQ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,EAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACxF,MAAM,aAAa,GAAQ,WAAW,CAAC,OAAO,CAAC,MAAM,CACnD,MAAM,CAAC,EAAE,CACP,MAAM,CAAC,cAAc,IAAI,WAAW,CAAC,YAAY,IAAI,MAAM,CAAC,aAAa,IAAI,WAAW,CAAC,eAAe,CAC3G,CAAA;YACD,IAAI,IAAI,GAAQ;gBACd,EAAE,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM;gBACvB,QAAQ,EAAE,WAAW,CAAC,SAAS;gBAC/B,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,WAAW;gBACnB,MAAM,EAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KAAI,aAAa;gBAC5C,MAAM,EAAE;oBACN,EAAE,EAAE,MAAA,aAAa,CAAC,CAAC,CAAC,0CAAE,QAAQ;iBAC/B;gBACD,WAAW,EAAE,MAAA,aAAa,CAAC,CAAC,CAAC,0CAAE,UAAU;gBACzC,gBAAgB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM;gBACrC,aAAa,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW;gBACvC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;oBAC5B,OAAO;wBACL,EAAE,EAAE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,SAAS;wBACjB,SAAS,EAAE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,YAAY;wBAC3B,QAAQ,EAAE,CAAC,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU,CAAA;wBACzB,gBAAgB,EAAE,CAAC;wBACnB,cAAc,EAAE,CAAC;wBACjB,MAAM,EAAE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,MAAM;wBAClB,UAAU,EAAE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,YAAY;wBAC5B,cAAc,EAAE,EAAE;wBAClB,mBAAmB,EAAE,CAAC;qBACvB,CAAA;gBACH,CAAC,CAAC;aACH,CAAA;YAED,OAAO;gBACL,OAAO,EAAE,EAAE,IAAI,EAAE;aAClB,CAAA;QACH,CAAC;QACD,SAAS,CAAC,GAAG;YACX,OAAO,GAAG,CAAC,IAAI,CAAA;QACjB,CAAC;KACF,CAAA;AACH,CAAC;AA9CD,8CA8CC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-sales-return"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../server/controllers/xilnex/apis/sales-return/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC"}
|