kcommons 9.15.0 → 9.15.2
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { IASNItem } from "../typings/asn.typings";
|
|
2
2
|
import { INestedGRNItem } from "../typings/grn.typings";
|
|
3
|
+
import { INestedPOItem } from "../typings/po.typings";
|
|
4
|
+
import { IPOASNItemJunction } from "../typings/poAsnJunctionItems.typings";
|
|
5
|
+
import { IVendor } from "../typings/vendor.typings";
|
|
3
6
|
export declare class ASNItemWrapper implements IASNItem {
|
|
4
7
|
constructor(partial: IASNItem);
|
|
5
8
|
po_asn_item_junction_id: string;
|
|
@@ -28,3 +31,4 @@ export declare class ASNItemWrapper implements IASNItem {
|
|
|
28
31
|
parent_asn: null;
|
|
29
32
|
vendor: null;
|
|
30
33
|
}
|
|
34
|
+
export declare function convertPOItemToASNItem(poItem: INestedPOItem, vendor?: IVendor | null, poASNItemJunctions?: IPOASNItemJunction[] | null): IASNItem;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ASNItemWrapper = void 0;
|
|
4
|
+
exports.convertPOItemToASNItem = convertPOItemToASNItem;
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
4
6
|
class ASNItemWrapper {
|
|
5
7
|
constructor(partial) {
|
|
6
8
|
this.po_asn_item_junction_id = "";
|
|
@@ -32,3 +34,32 @@ class ASNItemWrapper {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
exports.ASNItemWrapper = ASNItemWrapper;
|
|
37
|
+
function convertPOItemToASNItem(poItem, vendor, poASNItemJunctions = []) {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
return new ASNItemWrapper({
|
|
40
|
+
id: (0, uuid_1.v4)(),
|
|
41
|
+
parent_asn_id: "",
|
|
42
|
+
dispatched_quantity: ((_a = poASNItemJunctions === null || poASNItemJunctions === void 0 ? void 0 : poASNItemJunctions.find((ele) => ele.item_id === (poItem === null || poItem === void 0 ? void 0 : poItem.item_id))) === null || _a === void 0 ? void 0 : _a.pending_quantity) || 0,
|
|
43
|
+
delivered_quantity: 0,
|
|
44
|
+
vendor_id: (vendor === null || vendor === void 0 ? void 0 : vendor.id) || "",
|
|
45
|
+
// po_item_id: item.id,
|
|
46
|
+
is_deleted: false,
|
|
47
|
+
deleted_at: null,
|
|
48
|
+
created_at: "",
|
|
49
|
+
updated_at: "",
|
|
50
|
+
company_id: (poItem === null || poItem === void 0 ? void 0 : poItem.company_id) || "",
|
|
51
|
+
item_description: (poItem === null || poItem === void 0 ? void 0 : poItem.item_description) || null,
|
|
52
|
+
code_sku: (poItem === null || poItem === void 0 ? void 0 : poItem.code_sku) || "",
|
|
53
|
+
item_id: poItem.item_id,
|
|
54
|
+
item_name: (poItem === null || poItem === void 0 ? void 0 : poItem.item_name) || "",
|
|
55
|
+
uom: (poItem === null || poItem === void 0 ? void 0 : poItem.uom) || "",
|
|
56
|
+
po_asn_item_junction_id: (_b = poASNItemJunctions === null || poASNItemJunctions === void 0 ? void 0 : poASNItemJunctions.find((ele) => ele.item_id === poItem.item_id)) === null || _b === void 0 ? void 0 : _b.id,
|
|
57
|
+
item: null,
|
|
58
|
+
company: null,
|
|
59
|
+
parent_asn: null,
|
|
60
|
+
// parent_po_item: null,
|
|
61
|
+
po_asn_item_junction: null,
|
|
62
|
+
vendor: null,
|
|
63
|
+
used_in_grn_items: null,
|
|
64
|
+
});
|
|
65
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kcommons",
|
|
3
|
-
"version": "9.15.
|
|
3
|
+
"version": "9.15.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"test": "echo \"Error: no test specified\""
|
|
12
12
|
},
|
|
13
13
|
"author": "",
|
|
14
|
-
"license": "ISC"
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"uuid": "^11.1.0"
|
|
17
|
+
}
|
|
15
18
|
}
|