tally-xml-tdl 1.4.1

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.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -0
  3. package/index.d.ts +84 -0
  4. package/index.js +1 -0
  5. package/package.json +57 -0
  6. package/src/index.js +5 -0
  7. package/src/v1/client.js +59 -0
  8. package/src/v1/envelope.js +87 -0
  9. package/src/v1/index.d.ts +65 -0
  10. package/src/v1/index.js +12 -0
  11. package/src/v1/jsonToXml.js +20 -0
  12. package/src/v1/xmlToJson.js +19 -0
  13. package/src/v2/client.js +59 -0
  14. package/src/v2/envelope.js +87 -0
  15. package/src/v2/index.d.ts +65 -0
  16. package/src/v2/index.js +12 -0
  17. package/src/v2/jsonToXml.js +20 -0
  18. package/src/v2/xmlToJson.js +19 -0
  19. package/src/v3/client.js +105 -0
  20. package/src/v3/envelope.js +87 -0
  21. package/src/v3/index.d.ts +78 -0
  22. package/src/v3/index.js +14 -0
  23. package/src/v3/jsonToXml.js +20 -0
  24. package/src/v3/xmlToJson.js +19 -0
  25. package/src/v4/company/body.json +7 -0
  26. package/src/v4/company/index.js +12 -0
  27. package/src/v4/core/execute/executeBody.js +48 -0
  28. package/src/v4/core/execute/executeXml.js +13 -0
  29. package/src/v4/core/execute/fetchCollection.js +35 -0
  30. package/src/v4/core/execute/index.js +4 -0
  31. package/src/v4/core/index.js +31 -0
  32. package/src/v4/core/request/envelope.js +86 -0
  33. package/src/v4/core/request/index.js +6 -0
  34. package/src/v4/core/request/jsonToXml.js +19 -0
  35. package/src/v4/core/response/extract.js +17 -0
  36. package/src/v4/core/response/index.js +4 -0
  37. package/src/v4/core/response/validate.js +20 -0
  38. package/src/v4/core/response/xmlToJson.js +18 -0
  39. package/src/v4/core/transport/http.js +40 -0
  40. package/src/v4/core/transport/index.js +1 -0
  41. package/src/v4/import/index.js +7 -0
  42. package/src/v4/import/transaction/index.js +10 -0
  43. package/src/v4/import/transaction/last/body.xml +34 -0
  44. package/src/v4/import/transaction/last/index.js +12 -0
  45. package/src/v4/import/transaction/sales/body.xml +50 -0
  46. package/src/v4/import/transaction/sales/index.js +12 -0
  47. package/src/v4/index.d.ts +132 -0
  48. package/src/v4/index.js +15 -0
  49. package/src/v4/masters/accounting/currency/body.json +10 -0
  50. package/src/v4/masters/accounting/currency/index.js +12 -0
  51. package/src/v4/masters/accounting/group/body.json +8 -0
  52. package/src/v4/masters/accounting/group/index.js +12 -0
  53. package/src/v4/masters/accounting/index.js +16 -0
  54. package/src/v4/masters/accounting/ledger/body.json +8 -0
  55. package/src/v4/masters/accounting/ledger/index.js +12 -0
  56. package/src/v4/masters/accounting/voucherTypes/body.json +11 -0
  57. package/src/v4/masters/accounting/voucherTypes/index.js +12 -0
  58. package/src/v4/masters/index.js +10 -0
  59. package/src/v4/masters/inventory/batch/body.json +26 -0
  60. package/src/v4/masters/inventory/batch/index.js +12 -0
  61. package/src/v4/masters/inventory/godown/body.json +8 -0
  62. package/src/v4/masters/inventory/godown/index.js +12 -0
  63. package/src/v4/masters/inventory/index.js +19 -0
  64. package/src/v4/masters/inventory/stockCategory/body.json +8 -0
  65. package/src/v4/masters/inventory/stockCategory/index.js +12 -0
  66. package/src/v4/masters/inventory/stockItems/body copy.json +8 -0
  67. package/src/v4/masters/inventory/stockItems/body.json +26 -0
  68. package/src/v4/masters/inventory/stockItems/index.js +12 -0
  69. package/src/v4/masters/inventory/uom/body.json +13 -0
  70. package/src/v4/masters/inventory/uom/index.js +12 -0
  71. package/src/v4/reports/index.js +7 -0
  72. package/src/v4/reports/inventory/index.js +7 -0
  73. package/src/v4/reports/inventory/stockItems/body copy 2.json +34 -0
  74. package/src/v4/reports/inventory/stockItems/body copy.json +26 -0
  75. package/src/v4/reports/inventory/stockItems/body.json +34 -0
  76. package/src/v4/reports/inventory/stockItems/index.js +12 -0
  77. package/src/v4/transactions/index.js +15 -0
  78. package/src/v4/transactions/purchase/body.json +36 -0
  79. package/src/v4/transactions/purchase/index.js +12 -0
  80. package/src/v4/transactions/sale/body copy.json +36 -0
  81. package/src/v4/transactions/sale/body.json +40 -0
  82. package/src/v4/transactions/sale/index.js +12 -0
  83. package/src/v4/transactions/stockJournal/body.json +40 -0
  84. package/src/v4/transactions/stockJournal/index.js +12 -0
@@ -0,0 +1,86 @@
1
+ import { jsonToXml } from "./jsonToXml.js";
2
+
3
+ /**
4
+ * Creates a base Tally XML Envelope JavaScript Object.
5
+ *
6
+ * @param {object} [params]
7
+ * @param {string} [params.id=""] - Collection or Request ID
8
+ * @param {string} [params.type="COLLECTION"] - Request Type (default "COLLECTION")
9
+ * @param {object} [params.staticVariables] - Static variables for DESC
10
+ * @param {object} [params.tdlMessage] - Object to place inside TDLMESSAGE
11
+ * @returns {object} Tally Envelope JS Object
12
+ */
13
+ export const createEnvelope = ({
14
+ id = "",
15
+ type = "COLLECTION",
16
+ staticVariables = { SVEXPORTFORMAT: "$$SysName:XML" },
17
+ tdlMessage = {}
18
+ } = {}) => {
19
+ return {
20
+ ENVELOPE: {
21
+ HEADER: {
22
+ VERSION: 1,
23
+ TALLYREQUEST: "EXPORT",
24
+ TYPE: type,
25
+ ID: id
26
+ },
27
+ BODY: {
28
+ DESC: {
29
+ STATICVARIABLES: staticVariables,
30
+ TDL: {
31
+ TDLMESSAGE: tdlMessage
32
+ }
33
+ }
34
+ }
35
+ }
36
+ };
37
+ };
38
+
39
+ /**
40
+ * Creates a Tally Collection Request Envelope object.
41
+ *
42
+ * @param {object} params
43
+ * @param {string} params.name - Collection name (used for ID and COLLECTION NAME)
44
+ * @param {string} params.type - Tally Object Type (e.g. 'Group', 'Ledger', 'Company')
45
+ * @param {string|string[]} [params.fields] - Field names to FETCH
46
+ * @param {object} [params.filters] - Additional collection child nodes or filters
47
+ * @param {object} [params.staticVariables] - Static variables for DESC
48
+ * @returns {object} Tally Envelope JS Object
49
+ */
50
+ export const createCollectionEnvelope = ({
51
+ name,
52
+ type,
53
+ fields = [],
54
+ filters = {},
55
+ staticVariables = { SVEXPORTFORMAT: "$$SysName:XML" }
56
+ } = {}) => {
57
+ const fetchValue = Array.isArray(fields)
58
+ ? fields.join(",\n ")
59
+ : (fields || "");
60
+
61
+ const collectionDef = {
62
+ "@_NAME": name,
63
+ TYPE: type,
64
+ ...(fetchValue ? { FETCH: fetchValue } : {}),
65
+ ...filters
66
+ };
67
+
68
+ return createEnvelope({
69
+ id: name,
70
+ type: "COLLECTION",
71
+ staticVariables,
72
+ tdlMessage: {
73
+ COLLECTION: collectionDef
74
+ }
75
+ });
76
+ };
77
+
78
+ /**
79
+ * Helper to build an XML string directly for a collection query.
80
+ *
81
+ * @param {object} options - Options passed to createCollectionEnvelope
82
+ * @returns {string} XML string ready to send to Tally
83
+ */
84
+ export const buildCollectionXml = (options) => {
85
+ return jsonToXml(createCollectionEnvelope(options));
86
+ };
@@ -0,0 +1,6 @@
1
+ export { jsonToXml } from "./jsonToXml.js";
2
+ export {
3
+ createEnvelope,
4
+ createCollectionEnvelope,
5
+ buildCollectionXml
6
+ } from "./envelope.js";
@@ -0,0 +1,19 @@
1
+ import { XMLBuilder } from "fast-xml-parser";
2
+
3
+ /**
4
+ * Converts a JavaScript Object into a formatted XML string.
5
+ * Preserves XML attributes prefixed with `@_`.
6
+ *
7
+ * @param {object} jsonObj - The JavaScript object to serialize.
8
+ * @param {object} [options] - Optional XMLBuilder configurations.
9
+ * @returns {string} Formatted XML string.
10
+ */
11
+ export const jsonToXml = (jsonObj, options = {}) => {
12
+ const builder = new XMLBuilder({
13
+ ignoreAttributes: false,
14
+ format: true,
15
+ ...options
16
+ });
17
+
18
+ return builder.build(jsonObj);
19
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Extracts and unwraps the collection entities from a parsed Tally response object,
3
+ * stripping away all protocol envelope boilerplate (ENVELOPE, HEADER, DESC, CMPINFO).
4
+ *
5
+ * @param {object} res - Parsed Tally response object.
6
+ * @returns {object} The children of DATA.COLLECTION (e.g. { VOUCHER: [...] }, { GROUP: [...] }).
7
+ * @throws {Error} If no DATA.COLLECTION node is found in the response.
8
+ */
9
+ export const extractCollection = (res) => {
10
+ const collectionData = res?.ENVELOPE?.BODY?.DATA?.COLLECTION;
11
+ if (!collectionData) {
12
+ throw new Error("No DATA.COLLECTION found in Tally response");
13
+ }
14
+
15
+ return collectionData;
16
+ };
17
+
@@ -0,0 +1,4 @@
1
+ export { xmlToJson } from "./xmlToJson.js";
2
+ export { validateResponse } from "./validate.js";
3
+ export { extractCollection } from "./extract.js";
4
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Validates a parsed Tally response object.
3
+ * Checks for error status (STATUS === 0) and line errors.
4
+ *
5
+ * @param {object} res - Parsed Tally response object.
6
+ * @returns {object} The validated response object.
7
+ * @throws {Error} If Tally returned an error status or line error.
8
+ */
9
+ export const validateResponse = (res) => {
10
+ const headerStatus = res?.ENVELOPE?.HEADER?.STATUS;
11
+ if (headerStatus === 0 || headerStatus === "0" || Number(headerStatus) === 0) {
12
+ throw new Error(`Tally returned error status: ${JSON.stringify(res?.ENVELOPE?.BODY || res)}`);
13
+ }
14
+
15
+ if (res?.ENVELOPE?.BODY?.DATA?.LINEERROR) {
16
+ throw new Error(`Tally line error: ${JSON.stringify(res?.ENVELOPE?.BODY?.DATA?.LINEERROR)}`);
17
+ }
18
+
19
+ return res;
20
+ };
@@ -0,0 +1,18 @@
1
+ import { XMLParser } from "fast-xml-parser";
2
+
3
+ /**
4
+ * Converts XML string into a JavaScript Object.
5
+ * Preserves XML attributes using the `@_` prefix.
6
+ *
7
+ * @param {string} xml - The XML string to parse.
8
+ * @param {object} [options] - Optional XMLParser configurations.
9
+ * @returns {object} The parsed JavaScript object.
10
+ */
11
+ export const xmlToJson = (xml, options = {}) => {
12
+ const parser = new XMLParser({
13
+ ignoreAttributes: false,
14
+ ...options
15
+ });
16
+
17
+ return parser.parse(xml);
18
+ };
@@ -0,0 +1,40 @@
1
+ import { xmlToJson } from "../response/xmlToJson.js";
2
+
3
+ /**
4
+ * Sends a raw XML string to Tally via HTTP POST and returns the raw response text.
5
+ *
6
+ * @param {object} params
7
+ * @param {string} params.xml - The XML payload to send.
8
+ * @param {string} [params.url="http://localhost:9000"] - Tally HTTP endpoint URL.
9
+ * @returns {Promise<string>} Raw XML response text from Tally.
10
+ */
11
+ export const sendXml = async ({
12
+ xml,
13
+ url = "http://localhost:9000"
14
+ } = {}) => {
15
+ const res = await fetch(url, {
16
+ method: "POST",
17
+ headers: {
18
+ "Content-Type": "text/xml"
19
+ },
20
+ body: xml
21
+ });
22
+
23
+ return await res.text();
24
+ };
25
+
26
+ /**
27
+ * Sends an XML payload to Tally via HTTP POST and parses the response to JSON.
28
+ *
29
+ * @param {object} params
30
+ * @param {string} params.xml - The XML string to send.
31
+ * @param {string} [params.url="http://localhost:9000"] - Tally HTTP endpoint URL.
32
+ * @returns {Promise<object>} Parsed JSON response from Tally.
33
+ */
34
+ export const sendToTally = async ({
35
+ xml,
36
+ url = "http://localhost:9000"
37
+ } = {}) => {
38
+ const text = await sendXml({ xml, url });
39
+ return xmlToJson(text);
40
+ };
@@ -0,0 +1 @@
1
+ export { sendXml, sendToTally } from "./http.js";
@@ -0,0 +1,7 @@
1
+ import transaction from "./transaction/index.js";
2
+
3
+ export { transaction };
4
+
5
+ export default {
6
+ transaction
7
+ };
@@ -0,0 +1,10 @@
1
+ export { default as sales, body as salesBody, get as getSales } from "./sales/index.js";
2
+ export { default as last, body as lastBody, get as getLast } from "./last/index.js";
3
+
4
+ import sales from "./sales/index.js";
5
+ import last from "./last/index.js";
6
+
7
+ export default {
8
+ sales,
9
+ last
10
+ };
@@ -0,0 +1,34 @@
1
+ <ENVELOPE>
2
+ <HEADER>
3
+ <VERSION>1</VERSION>
4
+ <TALLYREQUEST>Export</TALLYREQUEST>
5
+ <TYPE>Collection</TYPE>
6
+ <ID>KeshavLastVoucher</ID>
7
+ </HEADER>
8
+
9
+ <BODY>
10
+ <DESC>
11
+ <STATICVARIABLES>
12
+ <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
13
+ </STATICVARIABLES>
14
+
15
+ <TDL>
16
+ <TDLMESSAGE>
17
+
18
+ <COLLECTION NAME="KeshavLastVoucher">
19
+ <TYPE>Voucher</TYPE>
20
+ <FILTER>LastVoucher</FILTER>
21
+ <FETCH>*</FETCH>
22
+ <FETCH>AllLedgerEntries.*</FETCH>
23
+ <FETCH>AllInventoryEntries.*</FETCH>
24
+ </COLLECTION>
25
+
26
+ <SYSTEM TYPE="Formulae" NAME="LastVoucher">
27
+ $MasterID = 181839
28
+ </SYSTEM>
29
+
30
+ </TDLMESSAGE>
31
+ </TDL>
32
+ </DESC>
33
+ </BODY>
34
+ </ENVELOPE>
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeXml } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = fs.readFileSync(path.join(__dirname, "body.xml"), "utf8");
8
+
9
+ export const get = (options) => executeXml(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,50 @@
1
+ <ENVELOPE>
2
+ <HEADER>
3
+ <TALLYREQUEST>Import Data</TALLYREQUEST>
4
+ </HEADER>
5
+
6
+ <BODY>
7
+ <IMPORTDATA>
8
+ <REQUESTDESC>
9
+ <REPORTNAME>Vouchers</REPORTNAME>
10
+ <STATICVARIABLES>
11
+ <SVCURRENTCOMPANY>Mani9</SVCURRENTCOMPANY>
12
+ </STATICVARIABLES>
13
+ </REQUESTDESC>
14
+
15
+ <REQUESTDATA>
16
+ <TALLYMESSAGE xmlns:UDF="TallyUDF">
17
+
18
+ <VOUCHER
19
+ VCHTYPE="Sales"
20
+ ACTION="Create"
21
+ OBJVIEW="Accounting Voucher View">
22
+
23
+ <DATE>20260917</DATE>
24
+ <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
25
+
26
+ <PARTYLEDGERNAME>Cash</PARTYLEDGERNAME>
27
+
28
+ <ALLLEDGERENTRIES.LIST>
29
+
30
+ <LEDGERNAME>Cash</LEDGERNAME>
31
+ <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
32
+ <AMOUNT>-1000.00</AMOUNT>
33
+
34
+ </ALLLEDGERENTRIES.LIST>
35
+
36
+ <ALLLEDGERENTRIES.LIST>
37
+
38
+ <LEDGERNAME>Sales</LEDGERNAME>
39
+ <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
40
+ <AMOUNT>1000.00</AMOUNT>
41
+
42
+ </ALLLEDGERENTRIES.LIST>
43
+
44
+ </VOUCHER>
45
+
46
+ </TALLYMESSAGE>
47
+ </REQUESTDATA>
48
+ </IMPORTDATA>
49
+ </BODY>
50
+ </ENVELOPE>
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeXml } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = fs.readFileSync(path.join(__dirname, "body.xml"), "utf8");
8
+
9
+ export const get = (options) => executeXml(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Converts an XML string into a JavaScript object.
3
+ * Attributes are prefixed with '@_'.
4
+ */
5
+ export function xmlToJson<T = any>(xml: string, options?: Record<string, any>): T;
6
+
7
+ /**
8
+ * Converts a JavaScript object into a formatted XML string.
9
+ */
10
+ export function jsonToXml(jsonObj: Record<string, any>, options?: Record<string, any>): string;
11
+
12
+ export interface CreateEnvelopeOptions {
13
+ id?: string;
14
+ type?: string;
15
+ staticVariables?: Record<string, any>;
16
+ tdlMessage?: Record<string, any>;
17
+ }
18
+
19
+ /**
20
+ * Creates a base Tally XML Envelope JavaScript Object.
21
+ */
22
+ export function createEnvelope(options?: CreateEnvelopeOptions): Record<string, any>;
23
+
24
+ export interface CreateCollectionEnvelopeOptions {
25
+ name: string;
26
+ type: string;
27
+ fields?: string | string[];
28
+ filters?: Record<string, any>;
29
+ staticVariables?: Record<string, any>;
30
+ }
31
+
32
+ /**
33
+ * Creates a Tally Collection Request Envelope object.
34
+ */
35
+ export function createCollectionEnvelope(options: CreateCollectionEnvelopeOptions): Record<string, any>;
36
+
37
+ /**
38
+ * Directly builds a Tally XML string for a collection request.
39
+ */
40
+ export function buildCollectionXml(options: CreateCollectionEnvelopeOptions): string;
41
+
42
+ export interface SendXmlOptions {
43
+ xml: string;
44
+ url?: string;
45
+ }
46
+
47
+ /**
48
+ * Sends a raw XML string to Tally via HTTP POST and returns the raw response text.
49
+ */
50
+ export function sendXml(options: SendXmlOptions): Promise<string>;
51
+
52
+ export interface SendToTallyOptions {
53
+ xml: string;
54
+ url?: string;
55
+ }
56
+
57
+ /**
58
+ * Sends an XML payload to Tally via HTTP POST and returns parsed JSON response.
59
+ */
60
+ export function sendToTally<T = any>(options: SendToTallyOptions): Promise<T>;
61
+
62
+ export interface FetchCollectionOptions {
63
+ name: string;
64
+ type: string;
65
+ fields?: string | string[];
66
+ filters?: Record<string, any>;
67
+ staticVariables?: Record<string, any>;
68
+ url?: string;
69
+ }
70
+
71
+ /**
72
+ * High-level helper to fetch any Tally collection directly.
73
+ */
74
+ export function fetchCollection<T = any>(options: FetchCollectionOptions): Promise<T>;
75
+
76
+ export interface ExecuteBodyOptions {
77
+ full?: boolean;
78
+ url?: string;
79
+ }
80
+
81
+ /**
82
+ * Executes a Tally request from a JSON body (either envelope or collection definition).
83
+ * If options.full is false (default), returns only the children of DATA.COLLECTION on success.
84
+ * If options.full is true, returns the raw full ENVELOPE JSON response.
85
+ */
86
+ export function executeBody<T = any>(body: Record<string, any>, options?: ExecuteBodyOptions): Promise<T>;
87
+
88
+ /**
89
+ * Validates a parsed Tally response object.
90
+ */
91
+ export function validateResponse<T = any>(res: T): T;
92
+
93
+ /**
94
+ * Extracts and unwraps the collection entities from a parsed Tally response object.
95
+ */
96
+ export function extractCollection<T = any>(res: any): T;
97
+
98
+ // Story modules
99
+ export * as request from "./core/request/index.js";
100
+ export * as transport from "./core/transport/index.js";
101
+ export * as response from "./core/response/index.js";
102
+ export * as execute from "./core/execute/index.js";
103
+ export * as core from "./core/index.js";
104
+
105
+ export interface DomainNodeCallable<T = any> {
106
+ (options?: ExecuteBodyOptions): Promise<T>;
107
+ body: Record<string, any>;
108
+ }
109
+
110
+ export namespace masters {
111
+ namespace accounting {
112
+ const group: DomainNodeCallable;
113
+ const voucherTypes: DomainNodeCallable;
114
+ }
115
+ namespace inventory {
116
+ const godown: DomainNodeCallable;
117
+ const stockCategory: DomainNodeCallable;
118
+ const uom: DomainNodeCallable;
119
+ }
120
+ }
121
+
122
+ export namespace transactions {
123
+ const purchase: DomainNodeCallable;
124
+ const purc: DomainNodeCallable;
125
+ const sale: DomainNodeCallable;
126
+ const stockJournal: DomainNodeCallable;
127
+ }
128
+
129
+ export const company: DomainNodeCallable;
130
+ export const trans: typeof transactions;
131
+ export const comp: typeof company;
132
+
@@ -0,0 +1,15 @@
1
+ export * from "./core/index.js";
2
+ export * as core from "./core/index.js";
3
+
4
+ // Domain Tree (Option B)
5
+ export * as masters from "./masters/index.js";
6
+ export * as transactions from "./transactions/index.js";
7
+ export * as reports from "./reports/index.js";
8
+ export * as importData from "./import/index.js";
9
+
10
+ export { default as company } from "./company/index.js";
11
+ export * as companyModule from "./company/index.js";
12
+
13
+ // Shorthand Aliases
14
+ export * as trans from "./transactions/index.js";
15
+ export { default as comp } from "./company/index.js";
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "KeshavCurrencies",
3
+ "type": "Currency",
4
+ "fields": [
5
+ "Name",
6
+ "Symbol",
7
+ "FormalName",
8
+ "DecimalPlaces"
9
+ ]
10
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeBody } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = JSON.parse(fs.readFileSync(path.join(__dirname, "body.json"), "utf8"));
8
+
9
+ export const get = (options) => executeBody(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "KeshavGroups",
3
+ "type": "Group",
4
+ "fields": [
5
+ "Name",
6
+ "Parent"
7
+ ]
8
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeBody } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = JSON.parse(fs.readFileSync(path.join(__dirname, "body.json"), "utf8"));
8
+
9
+ export const get = (options) => executeBody(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,16 @@
1
+ export { default as group, body as groupBody, get as getGroup } from "./group/index.js";
2
+ export { default as voucherTypes, body as voucherTypesBody, get as getVoucherTypes } from "./voucherTypes/index.js";
3
+ export { default as ledgers, body as ledgersBody, get as getLedgers } from "./Ledger/index.js";
4
+ export { default as currencies, body as currenciesBody, get as getCurrencies } from "./currency/index.js";
5
+
6
+ import group from "./group/index.js";
7
+ import voucherTypes from "./voucherTypes/index.js";
8
+ import ledgers from "./Ledger/index.js";
9
+ import currencies from "./currency/index.js";
10
+
11
+ export default {
12
+ group,
13
+ voucherTypes,
14
+ ledgers,
15
+ currencies
16
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "KeshavLedgers",
3
+ "type": "Ledger",
4
+ "fields": [
5
+ "Name",
6
+ "Parent"
7
+ ]
8
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeBody } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = JSON.parse(fs.readFileSync(path.join(__dirname, "body.json"), "utf8"));
8
+
9
+ export const get = (options) => executeBody(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "KeshavVoucherTypes",
3
+ "type": "VoucherType",
4
+ "fields": [
5
+ "Name",
6
+ "Parent",
7
+ "IsDeemedPositive",
8
+ "IsOptional",
9
+ "IsActive"
10
+ ]
11
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeBody } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = JSON.parse(fs.readFileSync(path.join(__dirname, "body.json"), "utf8"));
8
+
9
+ export const get = (options) => executeBody(body, options);
10
+ get.body = body;
11
+
12
+ export default get;
@@ -0,0 +1,10 @@
1
+ export * as accounting from "./accounting/index.js";
2
+ export * as inventory from "./inventory/index.js";
3
+
4
+ import accounting from "./accounting/index.js";
5
+ import inventory from "./inventory/index.js";
6
+
7
+ export default {
8
+ accounting,
9
+ inventory
10
+ };
@@ -0,0 +1,26 @@
1
+ {
2
+ "ENVELOPE": {
3
+ "HEADER": {
4
+ "VERSION": 1,
5
+ "TALLYREQUEST": "EXPORT",
6
+ "TYPE": "COLLECTION",
7
+ "ID": "KeshavBatches"
8
+ },
9
+ "BODY": {
10
+ "DESC": {
11
+ "STATICVARIABLES": {
12
+ "SVEXPORTFORMAT": "$$SysName:XML"
13
+ },
14
+ "TDL": {
15
+ "TDLMESSAGE": {
16
+ "COLLECTION": {
17
+ "@_NAME": "KeshavBatches",
18
+ "TYPE": "StockItem",
19
+ "FETCH": "Name,Parent,BatchAllocations.*"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { executeBody } from "../../../core/index.js";
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ export const body = JSON.parse(fs.readFileSync(path.join(__dirname, "body.json"), "utf8"));
8
+
9
+ export const get = (options) => executeBody(body, options);
10
+ get.body = body;
11
+
12
+ export default get;