tally-xml-tdl 1.21.3 → 1.22.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.
- package/package.json +1 -1
- package/src/index.js +2 -43
- package/src/v21/tdlMessage.json +2 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,43 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
-
|
|
5
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
|
|
7
|
-
// 1. Discover all version directories (v1, v2, ... vN) sorted highest first
|
|
8
|
-
const versionFolders = readdirSync(__dirname, { withFileTypes: true })
|
|
9
|
-
.filter(entry => entry.isDirectory() && /^v\d+$/.test(entry.name))
|
|
10
|
-
.map(entry => ({ name: entry.name, n: Number(entry.name.slice(1)) }))
|
|
11
|
-
.sort((a, b) => b.n - a.n);
|
|
12
|
-
|
|
13
|
-
const latestVersion = versionFolders[0]?.name || "v17";
|
|
14
|
-
|
|
15
|
-
let company;
|
|
16
|
-
let masters;
|
|
17
|
-
let vouchers;
|
|
18
|
-
|
|
19
|
-
const versionIndexPath = resolve(__dirname, latestVersion, "index.js");
|
|
20
|
-
|
|
21
|
-
if (existsSync(versionIndexPath)) {
|
|
22
|
-
const versionModule = await import(pathToFileURL(versionIndexPath).href);
|
|
23
|
-
company = versionModule.company ?? versionModule.default;
|
|
24
|
-
masters = versionModule.masters;
|
|
25
|
-
vouchers = versionModule.vouchers;
|
|
26
|
-
} else {
|
|
27
|
-
const mainUrl = pathToFileURL(resolve(__dirname, latestVersion, "main.js")).href;
|
|
28
|
-
const mastersUrl = pathToFileURL(resolve(__dirname, latestVersion, "masters", "index.js")).href;
|
|
29
|
-
const vouchersUrl = pathToFileURL(resolve(__dirname, latestVersion, "vouchers", "index.js")).href;
|
|
30
|
-
|
|
31
|
-
const [mainModule, mastersModule, vouchersModule] = await Promise.all([
|
|
32
|
-
import(mainUrl),
|
|
33
|
-
import(mastersUrl),
|
|
34
|
-
import(vouchersUrl)
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
company = mainModule.company ?? mainModule.default;
|
|
38
|
-
masters = mastersModule;
|
|
39
|
-
vouchers = vouchersModule;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { company, masters, vouchers, latestVersion as version };
|
|
43
|
-
export default company;
|
|
1
|
+
export * from "./v22/index.js";
|
|
2
|
+
export { default } from "./v22/index.js";
|
package/src/v21/tdlMessage.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"ledgerNamesWithDetails": "<TYPE>Ledger</TYPE><FETCH>$$Alias:Name</FETCH><FETCH>GSTRegistrationType</FETCH><FETCH>GSTIN</FETCH>",
|
|
13
13
|
"ledgerNamesMoreDetails": "<TYPE>Ledger</TYPE><FETCH>$$Alias:Name</FETCH><FETCH>LEDGSTREGDETAILS.LIST</FETCH>",
|
|
14
14
|
"stockGroups": "<TYPE>StockGroup</TYPE><FETCH>$$Alias:Name</FETCH>",
|
|
15
|
-
"stockGroupsAndParent": "<TYPE>StockGroup</TYPE><FETCH>$$Alias:Name</FETCH><FETCH>Parent</FETCH>"
|
|
15
|
+
"stockGroupsAndParent": "<TYPE>StockGroup</TYPE><FETCH>$$Alias:Name</FETCH><FETCH>Parent</FETCH>",
|
|
16
|
+
"stockItemsWithBatches": "<TYPE>StockItem</TYPE><FETCH>$$Alias:Name</FETCH><FETCH>BaseUnits</FETCH><FETCH>BatchAllocations.*</FETCH>"
|
|
16
17
|
}
|
|
17
18
|
}
|