tally-xml-tdl 1.6.2 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tally-xml-tdl",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Simple, clean TDL and XML extraction and manipulation tools for Tally",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/v6/body.json CHANGED
@@ -1,4 +1,8 @@
1
1
  {
2
+ "company": {
3
+ "staticVariables": "<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>",
4
+ "tdlMessage": "<TYPE>Company</TYPE><FETCH>$$Alias:Name</FETCH>"
5
+ },
2
6
  "uom": {
3
7
  "staticVariables": "<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>",
4
8
  "tdlMessage": "<TYPE>Unit</TYPE><FETCH>$$Alias:Name</FETCH>"
@@ -1,5 +1,5 @@
1
1
  export const buildXml = (body, {
2
- staticVariables,
2
+ staticVariables = "",
3
3
  tdlMessage
4
4
  }) => {
5
5
 
package/src/v6/index.js CHANGED
@@ -41,4 +41,21 @@ const clean = (options = {}) => {
41
41
  return executeXmlAndClean(xml, options);
42
42
  };
43
43
 
44
- export { get, clean };
44
+ const company = async () => {
45
+ const jsonId = "company";
46
+
47
+ const { tdlMessage } = bodyJson[jsonId];
48
+
49
+ const xml = buildXml(body, {
50
+ tdlMessage
51
+ });
52
+
53
+ return executeXmlAndClean(xml);
54
+
55
+ const fromExecuteXml = await executeXml(xml);
56
+ console.log("fclsromExecuteXml : ", fromExecuteXml.ENVELOPE.BODY.DATA.COLLECTION.COMPANY);
57
+
58
+ return fromExecuteXml.ENVELOPE.BODY.DATA.COLLECTION.COMPANY["@_NAME"];
59
+ };
60
+
61
+ export { get, clean, company };