@keshavsoft/tallyextract 1.4.1 → 1.4.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/index.js +1 -1
- package/package.json +1 -1
- package/src/v5/api/Import/Templates/inventory.json +121 -0
- package/src/v5/api/Import/Templates/ledgers.json +28 -0
- package/src/v5/api/Import/Templates/template.json +224 -0
- package/src/v5/api/PrepareDataObject/ChangeCustomerDetails/index.js +47 -0
- package/src/v5/api/PrepareDataObject/ForInventory/entryFile.js +24 -0
- package/src/v5/api/PrepareDataObject/ForInventory/prepareInventory.js +85 -0
- package/src/v5/api/PrepareDataObject/ForLedger/entryFile.js +46 -0
- package/src/v5/api/PrepareDataObject/ForLedger/prepareLedger.js +24 -0
- package/src/v5/api/PrepareDataObject/entryFile.js +20 -0
- package/src/v5/api/PrepareDataObject/prepareClientData.js +58 -0
- package/src/v5/api/PrepareDataObject/prepareTallyJson/entryFile.js +25 -0
- package/src/v5/api/importVoucher.js +16 -0
- package/src/v5/api/index.js +5 -0
- package/src/v5/api/ledger.js +6 -0
- package/src/v5/api/stockItems.js +6 -0
- package/src/v5/api/utils/validateInput.js +36 -0
- package/src/v5/cli.js +11 -0
- package/src/v5/core/impotToTally.js +14 -0
- package/src/v5/core/sendToTally.js +21 -0
- package/src/v5/index.js +1 -0
- package/src/v5/utils/readJson.js +6 -0
- package/src/v6/api/Import/Templates/inventory.json +121 -0
- package/src/v6/api/Import/Templates/ledgers.json +27 -0
- package/src/v6/api/Import/Templates/template.json +224 -0
- package/src/v6/api/PrepareDataObject/ChangeCustomerDetails/index.js +47 -0
- package/src/v6/api/PrepareDataObject/ForInventory/entryFile.js +24 -0
- package/src/v6/api/PrepareDataObject/ForInventory/prepareInventory.js +85 -0
- package/src/v6/api/PrepareDataObject/ForLedger/entryFile.js +46 -0
- package/src/v6/api/PrepareDataObject/ForLedger/prepareGstLedgers.js +25 -0
- package/src/v6/api/PrepareDataObject/ForLedger/prepareLedger.js +25 -0
- package/src/v6/api/PrepareDataObject/entryFile.js +20 -0
- package/src/v6/api/PrepareDataObject/prepareClientData.js +58 -0
- package/src/v6/api/PrepareDataObject/prepareTallyJson/entryFile.js +25 -0
- package/src/v6/api/importVoucher.js +16 -0
- package/src/v6/api/index.js +5 -0
- package/src/v6/api/ledger.js +6 -0
- package/src/v6/api/stockItems.js +6 -0
- package/src/v6/api/utils/validateInput.js +36 -0
- package/src/v6/cli.js +11 -0
- package/src/v6/core/impotToTally.js +14 -0
- package/src/v6/core/sendToTally.js +21 -0
- package/src/v6/index.js +1 -0
- package/src/v6/utils/readJson.js +6 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { startFunc as ForLedger } from "./ForLedger/entryFile.js";
|
|
2
|
+
import { startFunc as ForInventory } from "./ForInventory/entryFile.js";
|
|
3
|
+
import changeCustomerDetails from "./ChangeCustomerDetails/index.js";
|
|
4
|
+
|
|
5
|
+
const startFunc = ({ inTallyJson, inClientData }) => {
|
|
6
|
+
try {
|
|
7
|
+
let data = inTallyJson;
|
|
8
|
+
|
|
9
|
+
const LocalClientData = inClientData;
|
|
10
|
+
|
|
11
|
+
const LocalInventoryItem = ForInventory({ inItemsJsonAsArray: LocalClientData.allinventoryentries });
|
|
12
|
+
|
|
13
|
+
const LocalLedgerItem = ForLedger({
|
|
14
|
+
inItemsJsonAsArray: LocalClientData.allinventoryentries,
|
|
15
|
+
inLedgerDetails: LocalClientData.customerDetails
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
changeCustomerDetails({
|
|
19
|
+
inTallyJson, inClientData
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// changeVoucherDate({
|
|
23
|
+
// inData: data,
|
|
24
|
+
// inDate: LocalClientData.customerDetails.InvoiceDate
|
|
25
|
+
// });
|
|
26
|
+
|
|
27
|
+
data.tallymessage[0].allinventoryentries = LocalInventoryItem;
|
|
28
|
+
data.tallymessage[0].ledgerentries = LocalLedgerItem;
|
|
29
|
+
|
|
30
|
+
return data;
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.error("Import Failed");
|
|
33
|
+
console.log(err.response?.data || err.message);
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const changeCustomerDetails1 = ({ inLedgerName, inData }) => {
|
|
38
|
+
const CommonLedgerName = inLedgerName;
|
|
39
|
+
|
|
40
|
+
inData.tallymessage[0].partyname = CommonLedgerName;
|
|
41
|
+
inData.tallymessage[0].basicbuyername = CommonLedgerName;
|
|
42
|
+
inData.tallymessage[0].partyledgername = CommonLedgerName;
|
|
43
|
+
inData.tallymessage[0].consigneemailingname = CommonLedgerName;
|
|
44
|
+
inData.tallymessage[0].partymailingname = CommonLedgerName;
|
|
45
|
+
inData.tallymessage[0].basicbasepartyname = CommonLedgerName;
|
|
46
|
+
inData.tallymessage[0].gstregistrationtype = "Regular";
|
|
47
|
+
inData.tallymessage[0].partygstin = "37BEVPS3045F1Z1";
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const changeVoucherDate = ({ inData, inDate }) => {
|
|
51
|
+
const localDate = inDate;
|
|
52
|
+
|
|
53
|
+
inData.tallymessage[0].date = localDate;
|
|
54
|
+
inData.tallymessage[0].vchstatusdate = localDate;
|
|
55
|
+
inData.tallymessage[0].effectivedate = localDate;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { startFunc };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
|
|
6
|
+
const startFunc = () => {
|
|
7
|
+
try {
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
const filePath = path.join(__dirname, "../../Import/Templates/template.json");
|
|
13
|
+
|
|
14
|
+
let template = fs.readFileSync(filePath, "utf8");
|
|
15
|
+
|
|
16
|
+
let data = JSON.parse(template);
|
|
17
|
+
|
|
18
|
+
return data;
|
|
19
|
+
} catch (err) {
|
|
20
|
+
console.error("Import Failed");
|
|
21
|
+
console.log(err.response?.data || err.message);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { startFunc };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sendToTally } from "../core/impotToTally.js";
|
|
2
|
+
import { startFunc as PrepareDataObject } from "./PrepareDataObject/entryFile.js";
|
|
3
|
+
|
|
4
|
+
import { validateImportVoucherInput } from "./utils/validateInput.js";
|
|
5
|
+
|
|
6
|
+
const importVoucher = async (inClientData) => {
|
|
7
|
+
validateImportVoucherInput(inClientData); // 🔥 early fail
|
|
8
|
+
|
|
9
|
+
const bodyToSend = PrepareDataObject({ inClientData });
|
|
10
|
+
|
|
11
|
+
return await sendToTally(bodyToSend);
|
|
12
|
+
|
|
13
|
+
return await true;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { importVoucher };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// utils/validateInput.js
|
|
2
|
+
const validateImportVoucherInput = (data) => {
|
|
3
|
+
if (!data || typeof data !== "object") {
|
|
4
|
+
throw new Error("Input must be an object");
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// 🔹 allinventoryentries
|
|
8
|
+
if (!Array.isArray(data.allinventoryentries)) {
|
|
9
|
+
throw new Error("allinventoryentries must be an array");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (data.allinventoryentries.length === 0) {
|
|
13
|
+
throw new Error("allinventoryentries cannot be empty");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// optional: validate one item structure
|
|
17
|
+
const item = data.allinventoryentries[0];
|
|
18
|
+
if (!item.ItemName || !item.Qty) {
|
|
19
|
+
throw new Error("Invalid inventory item structure");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 🔹 customerDetails
|
|
23
|
+
if (!data.customerDetails || typeof data.customerDetails !== "object") {
|
|
24
|
+
throw new Error("customerDetails must be an object");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!data.customerDetails.LedgerName) {
|
|
28
|
+
throw new Error("LedgerName is required in customerDetails");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!data.customerDetails.InvoiceDate) {
|
|
32
|
+
throw new Error("InvoiceDate is required in customerDetails");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { validateImportVoucherInput };
|
package/src/v5/cli.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export async function sendToTally(data, url = "http://localhost:9000") {
|
|
2
|
+
const res = await fetch(url, {
|
|
3
|
+
method: "POST",
|
|
4
|
+
headers: {
|
|
5
|
+
"Content-Type": "application/json",
|
|
6
|
+
"TallyRequest": "Import",
|
|
7
|
+
"Type": "Data",
|
|
8
|
+
"Id": "Vouchers"
|
|
9
|
+
},
|
|
10
|
+
body: JSON.stringify(data)
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return res.json();
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/v1/core/sendToTally.js
|
|
2
|
+
const BODY = {
|
|
3
|
+
static_variables: [
|
|
4
|
+
{ name: "svExportFormat", value: "jsonex" }
|
|
5
|
+
]
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export async function sendToTally(Id, url = "http://localhost:9000") {
|
|
9
|
+
const res = await fetch(url, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
"TallyRequest": "Export",
|
|
14
|
+
"Type": "Collection",
|
|
15
|
+
"Id": Id
|
|
16
|
+
},
|
|
17
|
+
body: JSON.stringify(BODY)
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return res.json();
|
|
21
|
+
};
|
package/src/v5/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api/index.js";
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"stockitemname": "",
|
|
3
|
+
"gstovrdnisrevchargeappl": "\u0004 Not Applicable",
|
|
4
|
+
"gstovrdntaxability": "Taxable",
|
|
5
|
+
"gstsourcetype": "Stock Item",
|
|
6
|
+
"gstitemsource": "",
|
|
7
|
+
"hsnsourcetype": "Stock Item",
|
|
8
|
+
"hsnitemsource": "",
|
|
9
|
+
"gstovrdntypeofsupply": "Goods",
|
|
10
|
+
"gstrateinferapplicability": "As per Masters/Company",
|
|
11
|
+
"gsthsnname": "540720",
|
|
12
|
+
"gsthsndescription": "Woven Fabric",
|
|
13
|
+
"gsthsninferapplicability": "As per Masters/Company",
|
|
14
|
+
"isdeemedpositive": false,
|
|
15
|
+
"isgstassessablevalueoverridden": false,
|
|
16
|
+
"strdisgstapplicable": false,
|
|
17
|
+
"contentnegispos": false,
|
|
18
|
+
"islastdeemedpositive": false,
|
|
19
|
+
"isautonegate": false,
|
|
20
|
+
"iscustomsclearance": false,
|
|
21
|
+
"istrackcomponent": false,
|
|
22
|
+
"istrackproduction": false,
|
|
23
|
+
"isprimaryitem": false,
|
|
24
|
+
"isscrap": false,
|
|
25
|
+
"rate": "100.00/Nos",
|
|
26
|
+
"amount": "1000.00",
|
|
27
|
+
"actualqty": " 10 Nos",
|
|
28
|
+
"billedqty": " 10 Nos",
|
|
29
|
+
"mrprate": "100.00/Nos",
|
|
30
|
+
"batchallocations": [
|
|
31
|
+
{
|
|
32
|
+
"godownname": "Main Location",
|
|
33
|
+
"batchname": "Primary Batch",
|
|
34
|
+
"indentno": "\u0004 Not Applicable",
|
|
35
|
+
"orderno": "\u0004 Not Applicable",
|
|
36
|
+
"trackingnumber": "\u0004 Not Applicable",
|
|
37
|
+
"dynamiccstiscleared": false,
|
|
38
|
+
"amount": "1000.00",
|
|
39
|
+
"actualqty": " 10 Nos",
|
|
40
|
+
"billedqty": " 10 Nos"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"accountingallocations": [
|
|
44
|
+
{
|
|
45
|
+
"oldauditentryids": [
|
|
46
|
+
{
|
|
47
|
+
"metadata": true,
|
|
48
|
+
"type": "Number"
|
|
49
|
+
},
|
|
50
|
+
"-1"
|
|
51
|
+
],
|
|
52
|
+
"ledgername": "GST SALES",
|
|
53
|
+
"classrate": "100.00000",
|
|
54
|
+
"gstclass": "\u0004 Not Applicable",
|
|
55
|
+
"isdeemedpositive": false,
|
|
56
|
+
"ledgerfromitem": false,
|
|
57
|
+
"removezeroentries": false,
|
|
58
|
+
"ispartyledger": false,
|
|
59
|
+
"gstoverridden": false,
|
|
60
|
+
"isgstassessablevalueoverridden": false,
|
|
61
|
+
"strdisgstapplicable": false,
|
|
62
|
+
"strdgstispartyledger": false,
|
|
63
|
+
"strdgstisdutyledger": false,
|
|
64
|
+
"contentnegispos": false,
|
|
65
|
+
"islastdeemedpositive": false,
|
|
66
|
+
"iscapvattaxaltered": false,
|
|
67
|
+
"iscapvatnotclaimed": false,
|
|
68
|
+
"amount": "1000.00"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"ratedetails": [
|
|
72
|
+
{
|
|
73
|
+
"gstratedutyhead": "CGST",
|
|
74
|
+
"gstratevaluationtype": "Based on Value",
|
|
75
|
+
"gstrate": " 2.50"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"gstratedutyhead": "SGST/UTGST",
|
|
79
|
+
"gstratevaluationtype": "Based on Value",
|
|
80
|
+
"gstrate": " 2.50"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"gstratedutyhead": "IGST",
|
|
84
|
+
"gstratevaluationtype": "Based on Value",
|
|
85
|
+
"gstrate": " 5"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"gstratedutyhead": "Cess",
|
|
89
|
+
"gstratevaluationtype": "\u0004 Not Applicable"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"gstratedutyhead": "State Cess",
|
|
93
|
+
"gstratevaluationtype": "Based on Value"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"ratedetails1": [
|
|
97
|
+
{
|
|
98
|
+
"gstratedutyhead": "CGST",
|
|
99
|
+
"gstratevaluationtype": "Based on Value",
|
|
100
|
+
"gstrate": " 9"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"gstratedutyhead": "SGST/UTGST",
|
|
104
|
+
"gstratevaluationtype": "Based on Value",
|
|
105
|
+
"gstrate": " 9"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"gstratedutyhead": "IGST",
|
|
109
|
+
"gstratevaluationtype": "Based on Value",
|
|
110
|
+
"gstrate": " 18"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"gstratedutyhead": "Cess",
|
|
114
|
+
"gstratevaluationtype": "\u0004 Not Applicable"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"gstratedutyhead": "State Cess",
|
|
118
|
+
"gstratevaluationtype": "Based on Value"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const startFunc = ({ inTallyJson, inClientData }) => {
|
|
2
|
+
try {
|
|
3
|
+
let data = inTallyJson;
|
|
4
|
+
|
|
5
|
+
const LocalClientData = inClientData;
|
|
6
|
+
|
|
7
|
+
changeCustomerDetails({
|
|
8
|
+
inLedgerName: LocalClientData.customerDetails.LedgerName,
|
|
9
|
+
inData: data,
|
|
10
|
+
inGstregistrationtype: LocalClientData.customerDetails.GstRegistrationType,
|
|
11
|
+
inPartygstin: LocalClientData.customerDetails.PartyGSTIN
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
changeVoucherDate({
|
|
15
|
+
inData: data,
|
|
16
|
+
inDate: LocalClientData.customerDetails.InvoiceDate
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error("Import Failed");
|
|
22
|
+
console.log(err.response?.data || err.message);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const changeCustomerDetails = ({ inLedgerName, inData, inGstregistrationtype, inPartygstin }) => {
|
|
27
|
+
const CommonLedgerName = inLedgerName;
|
|
28
|
+
|
|
29
|
+
inData.tallymessage[0].partyname = CommonLedgerName;
|
|
30
|
+
inData.tallymessage[0].basicbuyername = CommonLedgerName;
|
|
31
|
+
inData.tallymessage[0].partyledgername = CommonLedgerName;
|
|
32
|
+
inData.tallymessage[0].consigneemailingname = CommonLedgerName;
|
|
33
|
+
inData.tallymessage[0].partymailingname = CommonLedgerName;
|
|
34
|
+
inData.tallymessage[0].basicbasepartyname = CommonLedgerName;
|
|
35
|
+
inData.tallymessage[0].gstregistrationtype = inGstregistrationtype;
|
|
36
|
+
inData.tallymessage[0].partygstin = inPartygstin;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const changeVoucherDate = ({ inData, inDate }) => {
|
|
40
|
+
const localDate = inDate;
|
|
41
|
+
|
|
42
|
+
inData.tallymessage[0].date = localDate;
|
|
43
|
+
inData.tallymessage[0].vchstatusdate = localDate;
|
|
44
|
+
inData.tallymessage[0].effectivedate = localDate;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default startFunc;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { startFunc as prepareInventory } from "./prepareInventory.js";
|
|
4
|
+
// --------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Creates inventory entries array from items.json
|
|
7
|
+
const startFunc = ({ inItemsJsonAsArray }) => {
|
|
8
|
+
let LocalArray = [];
|
|
9
|
+
const LocalInItemsJsonAsArray = inItemsJsonAsArray;
|
|
10
|
+
|
|
11
|
+
return LocalInItemsJsonAsArray.map(element => {
|
|
12
|
+
return prepareInventory({
|
|
13
|
+
inItemName: element.ItemName,
|
|
14
|
+
inTaxPer: element.TaxPer,
|
|
15
|
+
inUom: element.Uom,
|
|
16
|
+
inRate: element.Rate,
|
|
17
|
+
inQty: element.Qty
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return CommonFileDataAsJson;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { startFunc };
|