@keshavsoft/tallyextract 1.4.3 → 1.7.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.
Files changed (48) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/src/{v4 → v7}/api/Import/Templates/ledgers.json +1 -2
  4. package/src/{v4/api/PrepareDataObject/prepareClientData.js → v7/api/PrepareDataObject/ChangeCustomerDetails/index.js} +7 -16
  5. package/src/{v4 → v7}/api/PrepareDataObject/ForInventory/prepareInventory.js +7 -3
  6. package/src/{v4 → v7}/api/PrepareDataObject/ForLedger/entryFile.js +3 -3
  7. package/src/v7/api/PrepareDataObject/ForLedger/prepareGstLedgers.js +29 -0
  8. package/src/v7/api/PrepareDataObject/ForLedger/prepareLedger.js +29 -0
  9. package/src/{v3 → v7}/api/PrepareDataObject/prepareClientData.js +9 -7
  10. package/src/v7/api/PrepareDataObject/prepareTallyJson/entryFile.js +29 -0
  11. package/src/{v4 → v7}/api/importVoucher.js +1 -1
  12. package/src/v3/api/Import/Templates/ledgers.json +0 -28
  13. package/src/v3/api/Import/Templates/main.json +0 -224
  14. package/src/v3/api/Import/ledgers.json +0 -17
  15. package/src/v3/api/Import/staticVariables.json +0 -12
  16. package/src/v3/api/PrepareDataObject/ForInventory/prepareInventory.js +0 -85
  17. package/src/v3/api/PrepareDataObject/ForLedger/entryFile.js +0 -46
  18. package/src/v3/api/PrepareDataObject/ForLedger/prepareLedger.js +0 -24
  19. package/src/v3/api/PrepareDataObject/prepareTallyJson/entryFile.js +0 -25
  20. package/src/v3/api/importVoucher.js +0 -14
  21. package/src/v4/api/Import/Templates/inventory.json +0 -121
  22. package/src/v4/api/Import/Templates/template.json +0 -224
  23. package/src/v4/api/PrepareDataObject/ForInventory/entryFile.js +0 -24
  24. package/src/v4/api/PrepareDataObject/ForLedger/prepareLedger.js +0 -24
  25. package/src/v4/api/PrepareDataObject/entryFile.js +0 -20
  26. package/src/v4/api/PrepareDataObject/prepareTallyJson/entryFile.js +0 -25
  27. package/src/v4/api/index.js +0 -5
  28. package/src/v4/api/ledger.js +0 -6
  29. package/src/v4/api/stockItems.js +0 -6
  30. package/src/v4/api/utils/validateInput.js +0 -36
  31. package/src/v4/cli.js +0 -11
  32. package/src/v4/core/impotToTally.js +0 -14
  33. package/src/v4/core/sendToTally.js +0 -21
  34. package/src/v4/index.js +0 -1
  35. package/src/v4/utils/readJson.js +0 -6
  36. /package/src/{v3 → v7}/api/Import/Templates/inventory.json +0 -0
  37. /package/src/{v3 → v7}/api/Import/Templates/template.json +0 -0
  38. /package/src/{v3 → v7}/api/PrepareDataObject/ForInventory/entryFile.js +0 -0
  39. /package/src/{v3 → v7}/api/PrepareDataObject/entryFile.js +0 -0
  40. /package/src/{v3 → v7}/api/index.js +0 -0
  41. /package/src/{v3 → v7}/api/ledger.js +0 -0
  42. /package/src/{v3 → v7}/api/stockItems.js +0 -0
  43. /package/src/{v3 → v7}/api/utils/validateInput.js +0 -0
  44. /package/src/{v3 → v7}/cli.js +0 -0
  45. /package/src/{v3 → v7}/core/impotToTally.js +0 -0
  46. /package/src/{v3 → v7}/core/sendToTally.js +0 -0
  47. /package/src/{v3 → v7}/index.js +0 -0
  48. /package/src/{v3 → v7}/utils/readJson.js +0 -0
package/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./src/v6/index.js";
1
+ export * from "./src/v7/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keshavsoft/tallyextract",
3
- "version": "1.4.3",
3
+ "version": "1.7.2",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,6 +23,5 @@
23
23
  "islastdeemedpositive": false,
24
24
  "iscapvattaxaltered": false,
25
25
  "iscapvatnotclaimed": false,
26
- "amount": "90.00",
27
- "vatexpamount": "90.00"
26
+ "amount": "90.00"
28
27
  }
@@ -1,22 +1,14 @@
1
- import { startFunc as ForLedger } from "./ForLedger/entryFile.js";
2
- import { startFunc as ForInventory } from "./ForInventory/entryFile.js";
3
-
4
1
  const startFunc = ({ inTallyJson, inClientData }) => {
5
2
  try {
6
3
  let data = inTallyJson;
7
4
 
8
5
  const LocalClientData = inClientData;
9
6
 
10
- const LocalInventoryItem = ForInventory({ inItemsJsonAsArray: LocalClientData.allinventoryentries });
11
-
12
- const LocalLedgerItem = ForLedger({
13
- inItemsJsonAsArray: LocalClientData.allinventoryentries,
14
- inLedgerDetails: LocalClientData.customerDetails
15
- });
16
-
17
7
  changeCustomerDetails({
18
8
  inLedgerName: LocalClientData.customerDetails.LedgerName,
19
- inData: data
9
+ inData: data,
10
+ inGstregistrationtype: LocalClientData.customerDetails.GstRegistrationType,
11
+ inPartygstin: LocalClientData.customerDetails.PartyGSTIN
20
12
  });
21
13
 
22
14
  changeVoucherDate({
@@ -24,9 +16,6 @@ const startFunc = ({ inTallyJson, inClientData }) => {
24
16
  inDate: LocalClientData.customerDetails.InvoiceDate
25
17
  });
26
18
 
27
- data.tallymessage[0].allinventoryentries = LocalInventoryItem;
28
- data.tallymessage[0].ledgerentries = LocalLedgerItem;
29
-
30
19
  return data;
31
20
  } catch (err) {
32
21
  console.error("Import Failed");
@@ -34,7 +23,7 @@ const startFunc = ({ inTallyJson, inClientData }) => {
34
23
  };
35
24
  };
36
25
 
37
- const changeCustomerDetails = ({ inLedgerName, inData }) => {
26
+ const changeCustomerDetails = ({ inLedgerName, inData, inGstregistrationtype, inPartygstin }) => {
38
27
  const CommonLedgerName = inLedgerName;
39
28
 
40
29
  inData.tallymessage[0].partyname = CommonLedgerName;
@@ -43,6 +32,8 @@ const changeCustomerDetails = ({ inLedgerName, inData }) => {
43
32
  inData.tallymessage[0].consigneemailingname = CommonLedgerName;
44
33
  inData.tallymessage[0].partymailingname = CommonLedgerName;
45
34
  inData.tallymessage[0].basicbasepartyname = CommonLedgerName;
35
+ inData.tallymessage[0].gstregistrationtype = inGstregistrationtype;
36
+ inData.tallymessage[0].partygstin = inPartygstin;
46
37
  };
47
38
 
48
39
  const changeVoucherDate = ({ inData, inDate }) => {
@@ -53,4 +44,4 @@ const changeVoucherDate = ({ inData, inDate }) => {
53
44
  inData.tallymessage[0].effectivedate = localDate;
54
45
  };
55
46
 
56
- export { startFunc };
47
+ export default startFunc;
@@ -3,17 +3,21 @@ import path from "path";
3
3
 
4
4
  import { fileURLToPath } from "url";
5
5
 
6
+ import inventoryJson from "../../Import/Templates/inventory.json" with {type: "json"};
7
+
6
8
  // Prepares single inventory entry
7
9
  const startFunc = ({ inItemName, inTaxPer, inUom, inRate, inQty }) => {
8
10
 
9
11
  const __filename = fileURLToPath(import.meta.url);
10
12
  const __dirname = path.dirname(__filename);
11
13
 
12
- const filePath = path.join(__dirname, "../../Import/Templates/inventory.json");
14
+ // const filePath = path.join(__dirname, "../../Import/Templates/inventory.json");
15
+
16
+ // let template = fs.readFileSync(filePath, "utf8");
13
17
 
14
- let template = fs.readFileSync(filePath, "utf8");
18
+ // let data = JSON.parse(template);
15
19
 
16
- let data = JSON.parse(template);
20
+ let data = structuredClone(inventoryJson);
17
21
 
18
22
  const LocalItemName = inItemName;
19
23
  const LocalUom = inUom;
@@ -1,7 +1,7 @@
1
1
  import path from "path";
2
2
  import { fileURLToPath } from "url";
3
3
  import { startFunc as prepareLedger } from "./prepareLedger.js";
4
-
4
+ import prepareGstLedgers from "./prepareGstLedgers.js";
5
5
  // Creates ledger entries for voucher
6
6
  const startFunc = ({ inItemsJsonAsArray, inLedgerDetails }) => {
7
7
  let LocalArray = [];
@@ -26,14 +26,14 @@ const startFunc = ({ inItemsJsonAsArray, inLedgerDetails }) => {
26
26
 
27
27
  LocalArray.push(LocalLedgerEntry);
28
28
 
29
- const LocalCGST = prepareLedger({
29
+ const LocalCGST = prepareGstLedgers({
30
30
  inLedgerName: "CGST Output",
31
31
  inAmount: `${(amountSum - onlyAmountSum) / 2}.00`
32
32
  });
33
33
 
34
34
  LocalArray.push(LocalCGST);
35
35
 
36
- const LocalSGST = prepareLedger({
36
+ const LocalSGST = prepareGstLedgers({
37
37
  inLedgerName: "SGST Output",
38
38
  inAmount: `${(amountSum - onlyAmountSum) / 2}.00`
39
39
  });
@@ -0,0 +1,29 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ import { fileURLToPath } from "url";
5
+
6
+ import ledgersJson from "../../Import/Templates/ledgers.json" with {type: "json"};
7
+
8
+ // Prepares single ledger entry
9
+ const startFunc = ({ inLedgerName, inAmount }) => {
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ // const filePath = path.join(__dirname, "../../Import/Templates/ledgers.json");
15
+
16
+ // let template = fs.readFileSync(filePath, "utf8");
17
+
18
+ // let data = JSON.parse(template);
19
+
20
+ let data = structuredClone(ledgersJson);
21
+
22
+ data.ledgername = inLedgerName;
23
+ data.amount = inAmount;
24
+ data.vatexpamount = inAmount;
25
+
26
+ return data;
27
+ };
28
+
29
+ export default startFunc;
@@ -0,0 +1,29 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ import { fileURLToPath } from "url";
5
+
6
+ import ledgersJson from "../../Import/Templates/ledgers.json" with {type: "json"};
7
+
8
+ // Prepares single ledger entry
9
+ const startFunc = ({ inLedgerName, inAmount }) => {
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ // const filePath = path.join(__dirname, "../../Import/Templates/ledgers.json");
15
+
16
+ // let template = fs.readFileSync(filePath, "utf8");
17
+
18
+ // let data = JSON.parse(template);
19
+
20
+ let data = structuredClone(ledgersJson);
21
+
22
+ data.ledgername = inLedgerName;
23
+ data.amount = inAmount;
24
+ data.isdeemedpositive = true;
25
+
26
+ return data;
27
+ };
28
+
29
+ export { startFunc };
@@ -1,5 +1,6 @@
1
1
  import { startFunc as ForLedger } from "./ForLedger/entryFile.js";
2
2
  import { startFunc as ForInventory } from "./ForInventory/entryFile.js";
3
+ import changeCustomerDetails from "./ChangeCustomerDetails/index.js";
3
4
 
4
5
  const startFunc = ({ inTallyJson, inClientData }) => {
5
6
  try {
@@ -15,14 +16,13 @@ const startFunc = ({ inTallyJson, inClientData }) => {
15
16
  });
16
17
 
17
18
  changeCustomerDetails({
18
- inLedgerName: LocalClientData.customerDetails.LedgerName,
19
- inData: data
19
+ inTallyJson, inClientData
20
20
  });
21
21
 
22
- changeVoucherDate({
23
- inData: data,
24
- inDate: LocalClientData.customerDetails.InvoiceDate
25
- });
22
+ // changeVoucherDate({
23
+ // inData: data,
24
+ // inDate: LocalClientData.customerDetails.InvoiceDate
25
+ // });
26
26
 
27
27
  data.tallymessage[0].allinventoryentries = LocalInventoryItem;
28
28
  data.tallymessage[0].ledgerentries = LocalLedgerItem;
@@ -34,7 +34,7 @@ const startFunc = ({ inTallyJson, inClientData }) => {
34
34
  };
35
35
  };
36
36
 
37
- const changeCustomerDetails = ({ inLedgerName, inData }) => {
37
+ const changeCustomerDetails1 = ({ inLedgerName, inData }) => {
38
38
  const CommonLedgerName = inLedgerName;
39
39
 
40
40
  inData.tallymessage[0].partyname = CommonLedgerName;
@@ -43,6 +43,8 @@ const changeCustomerDetails = ({ inLedgerName, inData }) => {
43
43
  inData.tallymessage[0].consigneemailingname = CommonLedgerName;
44
44
  inData.tallymessage[0].partymailingname = CommonLedgerName;
45
45
  inData.tallymessage[0].basicbasepartyname = CommonLedgerName;
46
+ inData.tallymessage[0].gstregistrationtype = "Regular";
47
+ inData.tallymessage[0].partygstin = "37BEVPS3045F1Z1";
46
48
  };
47
49
 
48
50
  const changeVoucherDate = ({ inData, inDate }) => {
@@ -0,0 +1,29 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ import { fileURLToPath } from "url";
5
+
6
+ import templateJson from "../../Import/Templates/template.json" with {type: "json"};
7
+
8
+ const startFunc = () => {
9
+ try {
10
+
11
+ // const __filename = fileURLToPath(import.meta.url);
12
+ // const __dirname = path.dirname(__filename);
13
+
14
+ // const filePath = path.join(__dirname, "../../Import/Templates/template.json");
15
+
16
+ // let template = fs.readFileSync(filePath, "utf8");
17
+
18
+ // let data = JSON.parse(template);
19
+
20
+ const data = structuredClone(templateJson);
21
+
22
+ return data;
23
+ } catch (err) {
24
+ console.error("Import Failed");
25
+ console.log(err.response?.data || err.message);
26
+ };
27
+ };
28
+
29
+ export { startFunc };
@@ -1,5 +1,5 @@
1
1
  import { sendToTally } from "../core/impotToTally.js";
2
- import { startFunc as PrepareDataObject } from "../api/PrepareDataObject/entryFile.js";
2
+ import { startFunc as PrepareDataObject } from "./PrepareDataObject/entryFile.js";
3
3
 
4
4
  import { validateImportVoucherInput } from "./utils/validateInput.js";
5
5
 
@@ -1,28 +0,0 @@
1
- {
2
- "oldauditentryids": [
3
- {
4
- "metadata": true,
5
- "type": "Number"
6
- },
7
- "-1"
8
- ],
9
- "roundtype": "\u0004 Not Applicable",
10
- "ledgername": "SGST Output",
11
- "methodtype": "GST",
12
- "gstclass": "\u0004 Not Applicable",
13
- "isdeemedpositive": false,
14
- "ledgerfromitem": false,
15
- "removezeroentries": true,
16
- "ispartyledger": false,
17
- "gstoverridden": false,
18
- "isgstassessablevalueoverridden": false,
19
- "strdisgstapplicable": false,
20
- "strdgstispartyledger": false,
21
- "strdgstisdutyledger": false,
22
- "contentnegispos": false,
23
- "islastdeemedpositive": false,
24
- "iscapvattaxaltered": false,
25
- "iscapvatnotclaimed": false,
26
- "amount": "90.00",
27
- "vatexpamount": "90.00"
28
- }
@@ -1,224 +0,0 @@
1
- {
2
- "static_variables": [
3
- {
4
- "name": "svVchImportFormat",
5
- "value": "json"
6
- },
7
- {
8
- "name": "svCurrentCompany",
9
- "value": "Mani9"
10
- }
11
- ],
12
- "tallymessage": [
13
- {
14
- "metadata": {
15
- "type": "Voucher",
16
- "vchtype": "Gst Sales E",
17
- "action": "Create",
18
- "objview": "Invoice Voucher View"
19
- },
20
- "address": [
21
- {
22
- "metadata": true,
23
- "type": "String"
24
- },
25
- "Tallarevu"
26
- ],
27
- "basicbuyeraddress": [
28
- {
29
- "metadata": true,
30
- "type": "String"
31
- },
32
- "Tallarevu"
33
- ],
34
- "oldauditentryids": [
35
- {
36
- "metadata": true,
37
- "type": "Number"
38
- },
39
- "-1"
40
- ],
41
- "date": "20260320",
42
- "vchstatusdate": "20260320",
43
- "gstregistrationtype": "Unregistered/Consumer",
44
- "vatdealertype": "Regular",
45
- "statename": "Andhra Pradesh",
46
- "countryofresidence": "India",
47
- "placeofsupply": "Andhra Pradesh",
48
- "vouchertypename": "Gst Sales E",
49
- "classname": "GST",
50
- "partyname": "{KeshavSoft}",
51
- "gstregistration": {
52
- "value": "Andhra Pradesh Registration",
53
- "taxtype": "GST",
54
- "taxregistration": "37ABPPN4785P1ZH"
55
- },
56
- "cmpgstin": "37ABPPN4785P1ZH",
57
- "partyledgername": "{KeshavSoft}",
58
- "basicbuyername": "{KeshavSoft}",
59
- "cmpgstregistrationtype": "Regular",
60
- "partymailingname": "{KeshavSoft}",
61
- "partypincode": "533001",
62
- "consigneemailingname": "{KeshavSoft}",
63
- "consigneepincode": "533001",
64
- "consigneestatename": "Andhra Pradesh",
65
- "cmpgststate": "Andhra Pradesh",
66
- "consigneecountryname": "India",
67
- "basicbasepartyname": "{KeshavSoft}",
68
- "numberingstyle": "Auto Retain",
69
- "cstformissuetype": "\u0004 Not Applicable",
70
- "cstformrecvtype": "\u0004 Not Applicable",
71
- "fbtpaymenttype": "Default",
72
- "persistedview": "Invoice Voucher View",
73
- "vchstatustaxadjustment": "Default",
74
- "vchstatusvouchertype": "Gst Sales E",
75
- "vchstatustaxunit": "Andhra Pradesh Registration",
76
- "vchgstclass": "\u0004 Not Applicable",
77
- "vchentrymode": "Item Invoice",
78
- "diffactualqty": false,
79
- "ismstfromsync": false,
80
- "isdeleted": false,
81
- "issecurityonwhenentered": false,
82
- "asoriginal": false,
83
- "audited": false,
84
- "iscommonparty": false,
85
- "forjobcosting": false,
86
- "isoptional": false,
87
- "effectivedate": "20260320",
88
- "useforexcise": false,
89
- "isforjobworkin": false,
90
- "allowconsumption": false,
91
- "useforinterest": false,
92
- "useforgainloss": false,
93
- "useforgodowntransfer": false,
94
- "useforcompound": false,
95
- "useforservicetax": false,
96
- "isreversechargeapplicable": false,
97
- "issystem": false,
98
- "isfetchedonly": false,
99
- "isgstoverridden": false,
100
- "iscancelled": false,
101
- "isonhold": false,
102
- "issummary": false,
103
- "isecommercesupply": false,
104
- "isboenotapplicable": false,
105
- "isgstsecsevenapplicable": false,
106
- "ignoreeinvvalidation": false,
107
- "cmpgstisothterritoryassessee": false,
108
- "partygstisothterritoryassessee": false,
109
- "irnjsonexported": false,
110
- "irncancelled": false,
111
- "ignoregstconflictinmig": false,
112
- "isopbaltransaction": false,
113
- "ignoregstformatvalidation": false,
114
- "iseligibleforitc": true,
115
- "ignoregstoptionaluncertain": false,
116
- "updatesummaryvalues": false,
117
- "isewaybillapplicable": false,
118
- "isdeletedretained": false,
119
- "isnull": false,
120
- "isexcisevoucher": false,
121
- "excisetaxoverride": false,
122
- "usefortaxunittransfer": false,
123
- "isexer1nopoverwrite": false,
124
- "isexf2nopoverwrite": false,
125
- "isexer3nopoverwrite": false,
126
- "ignoreposvalidation": false,
127
- "exciseopening": false,
128
- "useforfinalproduction": false,
129
- "istdsoverridden": false,
130
- "istcsoverridden": false,
131
- "istdstcscashvch": false,
132
- "includeadvpymtvch": false,
133
- "issubworkscontract": false,
134
- "isvatoverridden": false,
135
- "ignoreorigvchdate": false,
136
- "isvatpaidatcustoms": false,
137
- "isdeclaredtocustoms": false,
138
- "vatadvancepayment": false,
139
- "vatadvpay": false,
140
- "iscstdelcaredgoodssales": false,
141
- "isvatrestaxinv": false,
142
- "isservicetaxoverridden": false,
143
- "isisdvoucher": false,
144
- "isexciseoverridden": false,
145
- "isexcisesupplyvch": false,
146
- "gstnotexported": false,
147
- "ignoregstinvalidation": false,
148
- "isgstrefund": false,
149
- "ovrdnewaybillapplicability": false,
150
- "isvatprincipalaccount": false,
151
- "vchstatusisvchnumused": false,
152
- "vchgststatusisincluded": true,
153
- "vchgststatusisuncertain": false,
154
- "vchgststatusisexcluded": false,
155
- "vchgststatusisapplicable": true,
156
- "vchgststatusisgstr2breconciled": false,
157
- "vchgststatusisgstr2bonlyinportal": false,
158
- "vchgststatusisgstr2bonlyinbooks": false,
159
- "vchgststatusisgstr2bmismatch": false,
160
- "vchgststatusisgstr2bindiffperiod": false,
161
- "vchgststatusisreteffdateoverrdn": false,
162
- "vchgststatusisoverrdn": false,
163
- "vchgststatusisstatindiffdate": false,
164
- "vchgststatusisretindiffdate": false,
165
- "vchgststatusmainsectionexcluded": false,
166
- "vchgststatusisbranchtransferout": false,
167
- "vchgststatusissystemsummary": false,
168
- "vchstatusisunregisteredrcm": false,
169
- "vchstatusisoptional": false,
170
- "vchstatusiscancelled": false,
171
- "vchstatusisdeleted": false,
172
- "vchstatusisopeningbalance": false,
173
- "vchstatusisfetchedonly": false,
174
- "vchgststatusisoptionaluncertain": false,
175
- "vchstatusisreacceptforhsndone": false,
176
- "vchstatusisreaccephsnsixonedone": true,
177
- "paymentlinkhasmultiref": false,
178
- "isshippingwithinstate": false,
179
- "isoverseastouristtrans": false,
180
- "isdesignatedzoneparty": false,
181
- "hascashflow": false,
182
- "ispostdated": false,
183
- "usetrackingnumber": false,
184
- "isinvoice": true,
185
- "mfgjournal": false,
186
- "hasdiscounts": false,
187
- "aspayslip": false,
188
- "iscostcentre": false,
189
- "isstxnonrealizedvch": false,
190
- "isexcisemanufactureron": false,
191
- "isblankcheque": false,
192
- "isvoid": false,
193
- "orderlinestatus": false,
194
- "vatisagnstcancsales": false,
195
- "vatispurcexempted": false,
196
- "isvatrestaxinvoice": false,
197
- "vatisassesablecalcvch": false,
198
- "isvatdutypaid": true,
199
- "isdeliverysameasconsignee": false,
200
- "isdispatchsameasconsignor": false,
201
- "isdeletedvchretained": false,
202
- "vchonlyaddlinfoupdated": false,
203
- "changevchmode": false,
204
- "resetirnqrcode": false,
205
- "vouchernumberseries": "Default",
206
- "allinventoryentries": [],
207
- "ledgerentries": [],
208
- "gst": [
209
- {
210
- "purposetype": "GST",
211
- "stat": [
212
- {
213
- "purposetype": "GST",
214
- "statkey": "\u0004 Auto Stat Number",
215
- "isfetchedonly": false,
216
- "isdeleted": false,
217
- "tallycontentuser": []
218
- }
219
- ]
220
- }
221
- ]
222
- }
223
- ]
224
- }
@@ -1,17 +0,0 @@
1
- {
2
- "static_variables": [
3
- {
4
- "name": "svExportFormat",
5
- "value": "jsonex"
6
- },
7
- {
8
- "name": "svCurrentCompany",
9
- "value": "Mani9"
10
- }
11
- ],
12
- "fetch_List": [
13
- "Name",
14
- "Parent",
15
- "Closing Balance"
16
- ]
17
- }
@@ -1,12 +0,0 @@
1
- {
2
- "static_variables": [
3
- {
4
- "name": "svExportFormat",
5
- "value": "jsonex"
6
- },
7
- {
8
- "name": "svCurrentCompany",
9
- "value": "Mani"
10
- }
11
- ]
12
- }
@@ -1,85 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- import { fileURLToPath } from "url";
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
-
9
- const filePath = path.join(__dirname, "../../Import/Templates/inventory.json");
10
-
11
- // Prepares single inventory entry
12
- const startFunc = ({ inItemName, inTaxPer, inUom, inRate, inQty }) => {
13
- // const filePath = path.join("./Import/Templates", "inventory.json");
14
- let template = fs.readFileSync(filePath, "utf8");
15
-
16
- let data = JSON.parse(template);
17
-
18
- const LocalItemName = inItemName;
19
- const LocalUom = inUom;
20
- const LocalQty = inQty;
21
- const LocalRate = inRate;
22
-
23
- const LocalRateWithTax = LocalRate * (1 + (inTaxPer / 100));
24
- const LocalAmount = LocalRate * LocalQty;
25
-
26
- data.hsnitemsource = LocalItemName;
27
- data.gstitemsource = LocalItemName;
28
- data.stockitemname = LocalItemName;
29
-
30
- data.mrprate = `${LocalRateWithTax}.00/${LocalUom}`;
31
- data.inclvatrate = `${LocalRateWithTax}.00/${LocalUom}`;
32
-
33
-
34
- // --------------------------------------------------
35
- // Quantity & Amount
36
- // --------------------------------------------------
37
-
38
- data.amount = `${LocalAmount}.00`;
39
- data.rate = `${LocalRate}.00/${LocalUom}`;
40
- data.actualqty = `${LocalQty}.00 ${LocalUom}`;
41
- data.billedqty = `${LocalQty}.00 ${LocalUom}`;
42
-
43
-
44
- // --------------------------------------------------
45
- // Batch Allocation
46
- // --------------------------------------------------
47
-
48
- data.batchallocations[0].amount = LocalRate * LocalQty;
49
- data.batchallocations[0].actualqty = `${LocalQty}.00 ${LocalUom}`;
50
- data.batchallocations[0].billedqty = `${LocalQty}.00 ${LocalUom}`;
51
-
52
-
53
- // --------------------------------------------------
54
- // Accounting Allocation
55
- // --------------------------------------------------
56
-
57
- data.accountingallocations[0].classrate = `${LocalRate}.00`;
58
- data.accountingallocations[0].amount = `${LocalAmount}.00`;
59
-
60
- updateRateDetails(data.ratedetails, inTaxPer);
61
-
62
- return data;
63
- };
64
-
65
- // Update GST ratedetails safely
66
- const updateRateDetails = (ratedetails, taxPer) => {
67
- const half = (taxPer / 2).toFixed(2);
68
- const full = Number(taxPer).toFixed(2);
69
-
70
- ratedetails.forEach(row => {
71
- switch (row.gstratedutyhead) {
72
- case "CGST":
73
- row.gstrate = half;
74
- break;
75
- case "SGST/UTGST":
76
- row.gstrate = half;
77
- break;
78
- case "IGST":
79
- row.gstrate = full;
80
- break;
81
- }
82
- });
83
- };
84
-
85
- export { startFunc };