virajenterprise / CSV-to-Tally

this is single page HTML application ,any one can use this app for importing entries to tally software just export any voucher in xml format and than import this voucher in this app after reading voucher file app will produce one csv file in which you can put entries like excel and than import same file to app and than app will post these entries to tally if tally is running in background other wise it will prompt to download XML file and after downloading this file you can manually import this file to tally
Apache License 2.0
3 stars 1 forks source link

bugs #1

Open test2a opened 3 years ago

test2a commented 3 years ago

Saw your project. This is a great idea to bypass using any softwares and just using html to convert xml to csv and back.

i tried it, i got an xml and uploaded it. the csv i got was wrong. it did not have any data so this needs some work to solve. while you are at it, can you put a license to the repository so that i can properly help and contribute

virajenterprise commented 3 years ago

do you get blank CSV or CSV with headers only because I am getting proper CSV I am just struggling with post request to tally as when I am putting url in browser http://localhost:9000 it is getting response from tally service "Tally.ERP 9 Server is Running" but when I am doing same with XMLHttpRequest() from this html page it saws error "test.html:186 GET http://localhost:9000/ net::ERR_CONNECTION_RESET"

test2a commented 3 years ago

oh good. i am trying both. what i did was get accounting voucher xml from tally. i uploaded it. the log says "

"=> XML File Uploading... => XML File Uploaded... => XML File Processed Please Click Download CSV Button"

i click download and this csv gets downloaded.

the file is not proper imo

import(1).csv

test2a commented 3 years ago

thank you for the license file. i would have myself preferred AGPL 3.0 but this is fine. now i can work without much issues. thanks

virajenterprise commented 3 years ago

this file is correct now we can add data in this file and save CSV and when we will upload back this CSV file app can produce a XML which can be uploaded to Tally or We can post this entry directly to tally

test2a commented 3 years ago

"VoucherType|Sales|DebitCount|1|CreditCount|3,Date|Narration|DebitAccount-0|DebitAmount-0|CreditAccount|CreditAmount"

when i upload the csv, i should get an xml but this is the output in application log. i do not get an xml

test2a commented 3 years ago

can you give me an example csv file WITH data because i do not see where i would add items or invoice details. these columns are barebones

virajenterprise commented 3 years ago

I am sending CSV file with data to download XML file you need to do some changes in code you can see line no 162 please remove double slash from there and try again you will get xml file and please ignore log for now as I have not added much information in log import (18).csv

test2a commented 3 years ago

i do not see any text in line 162. that is empty

test2a commented 3 years ago

wait

virajenterprise commented 3 years ago

I have just edited code please redownload test.html it will work now

test2a commented 3 years ago

sure. let me do that now

test2a commented 3 years ago

i upload this csv file and click upload csv but nothing happens. is it supposed to push code directly to tally? let me try that but it is not giving a xml file output

test2a commented 3 years ago

nope. either i am missing something or the code is not working as intended. "Uncaught ReferenceError: testPost is not defined post https://test2a.github.io/CSV-to-Tally/:142 onload https://test2a.github.io/CSV-to-Tally/:135"

console says error

virajenterprise commented 3 years ago

oh sorry I missed one line in code there for it is sawing this error wait a min I am changing code

virajenterprise commented 3 years ago

try now this will work now

virajenterprise commented 3 years ago

you need to press upload CSV button then your browser will ask you for downloading file browser may so file as vulnerable as file is in XML format

test2a commented 3 years ago

ok good news. the xml works.

test2a commented 3 years ago

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9000/. (Reason: CORS request did not succeed)

but we can ignore that

test2a commented 3 years ago

this serves the payment and receipt entries no problem. what about more complex ones like sales? can it handle them?

test2a commented 3 years ago

cors on firefox at that. they had fixed it earlier but not sure why it still exists. lets ignore that for now

virajenterprise commented 3 years ago

Yes We can create this for more complex entries like stock entry, sales entry or any other entries currently I am focusing on how to post these directly to tally by XMLHttprequest() after solving this We can work for more complex entries

test2a commented 3 years ago

oh cool. can i send you an inventory sales ? you see it does not generate INVOICE NUMBER or date fields or in case of purchases, Supplier invoice number and date. also for inventory, no quantity or rate fields are getting generated

the file is xml actually. just rename the extension. that should open it. you see there are a lot of fields that are missing Accounting Voucher.txt .

test2a commented 3 years ago

https://help.tallysolutions.com/developer-reference/integration-capabilities/case-study-1/

maybe this will help?

virajenterprise commented 3 years ago

this is reference for creating xml file We need to break why when We are posting url to browser http://localhost:9000/ we are getting response from tally but unable to do same thing with XMLHttpRequest() may be facing problem in setting header or maybe because of CORS policy

test2a commented 3 years ago

Uncaught TypeError: Cannot read properties of undefined (reading 'split') at FileReader.fr.onload ((index):119) localhost:9000/:1 Failed to load resource: net::ERR_CONNECTION_RESET localhost:9000/:1 Failed to load resource: net::ERR_CONNECTION_RESET localhost:9000/:1 Failed to load resource: net::ERR_CONNECTION_RESET localhost:9000/:1 Failed to load resource: net::ERR_CONNECTION_RESET

on chrome this is the output showing in console. i guess it is both for chrome and firefox

test2a commented 3 years ago
 xhttp.send(xmlData);

this seems to be the problem line

virajenterprise commented 3 years ago

this is the line which is sending data to tally why it is sawing problem I don't know I was actually thinking about another way We can send data with html form post

virajenterprise commented 3 years ago

I thing We have to Go with download XML file option only as I have tried and worked on posting entry but unable to do CORS post request also I have tried with Firefox with CORS bypass extension it says XML Parsing Error: not well-formed

test2a commented 3 years ago

cool. i am fine with xml as it is trivial enough to import data into tally.

virajenterprise commented 3 years ago

I think issue is different as I have share this page on Github now this app is not cross origin request but still it is not posting data to tally it is still sawing error test.html:172 POST http://localhost:9000/ net::ERR_CONNECTION_RESET do you know any forum or any expert who do have idea about this kind of error

test2a commented 3 years ago

i usually turn to reddit to get these issues more eyeballs. more people mean more thoughts

test2a commented 3 years ago

can you try with https:// on localhost? it would give a certificate error but should proceed.

virajenterprise commented 3 years ago

can you try with https:// on localhost? it would give a certificate error but should proceed.

this also not working facing same problem thanks for idea of reddit I am posting this question there

test2a commented 3 years ago

please share the reddit link. i can ask someone

virajenterprise commented 3 years ago

please share the reddit link. i can ask someone

https://www.reddit.com/r/learnprogramming/comments/qg5mk7/xml_post_to_tally_erp_through_javascript/?utm_source=share&utm_medium=web2x&context=3

test2a commented 3 years ago

cool. you should explain the bug and give details. currently the title is not much of an error

virajenterprise commented 3 years ago

cool. you should explain the bug and give details. currently the title is not much of an error

Okay I will edit post and will try to explain more but what should be title which can describe error

test2a commented 3 years ago

Uncaught TypeError: csvData[1] is undefined onload https://test2a.github.io/CSV-to-Tally/:119 readCSV https://test2a.github.io/CSV-to-Tally/:106 onclick https://test2a.github.io/CSV-to-Tally/:1 CSV-to-Tally:119:25 Uncaught TypeError: csvData[1] is undefined onload https://test2a.github.io/CSV-to-Tally/:119 readCSV https://test2a.github.io/CSV-to-Tally/:106 onclick https://test2a.github.io/CSV-to-Tally/:1

is there an error on your side? i am getting this on the latest merge

virajenterprise commented 3 years ago

Uncaught TypeError: csvData[1] is undefined onload https://test2a.github.io/CSV-to-Tally/:119 readCSV https://test2a.github.io/CSV-to-Tally/:106 onclick https://test2a.github.io/CSV-to-Tally/:1 CSV-to-Tally:119:25 Uncaught TypeError: csvData[1] is undefined onload https://test2a.github.io/CSV-to-Tally/:119 readCSV https://test2a.github.io/CSV-to-Tally/:106 onclick https://test2a.github.io/CSV-to-Tally/:1

is there an error on your side? i am getting this on the latest merge

In which operation you have received this error in uploading XML or when you have uploaded CSV file?

test2a commented 3 years ago

second time when uploading csv file.

virajenterprise commented 3 years ago

I have also created Git pages of this app I have updated Repository but git pages are displaying page as per old repository how to update that ?

virajenterprise commented 3 years ago

second time when uploading csv file.

I have checked at my end and locally it is working perfectly can you please share CSV file you have uploaded in your second attempt

virajenterprise commented 3 years ago

second time when uploading csv file.

I have checked at my end and locally it is working perfectly can you please share CSV file you have uploaded in your second attempt

please send CSV so I can correct My code and I think it is not possible to post entry to Tally through JavaScript so I am thinking of Moving on with download xml option also starting work on other voucher type

test2a commented 3 years ago

here is the file import.csv i suspect it does not detect empty entries.

also, check these

import(5).csv data(1).txt txt is actually xml there is "undefined" for some reason.

go ahead with xml. i am fine with that

virajenterprise commented 3 years ago

here is the file import.csv i suspect it does not detect empty entries.

also, check these

import(5).csv data(1).txt txt is actually xml there is "undefined" for some reason.

go ahead with xml. i am fine with that Thanks will check and fix

test2a commented 3 years ago

i have an idea. what if we work on supporting "day book" xml like marg does. that way we could get single place for all kinds of vouchers with inventory even.

virajenterprise commented 3 years ago

here is the file import.csv i suspect it does not detect empty entries. also, check these import(5).csv data(1).txt txt is actually xml there is "undefined" for some reason. go ahead with xml. i am fine with that Thanks will check and fix

I have made changes in file please check now if its working or not please let me know if any other error occurs please re-upload XML and create new CSV and than try again

test2a commented 3 years ago

nope.

data.txt import.csv the csv is generated correctly but when i update the data, the xml generated has "undefined" which does not get imported

virajenterprise commented 3 years ago

nope.

data.txt import.csv the csv is generated correctly but when i update the data, the xml generated has "undefined" which does not get imported

I have updated codes with necessary changes this will solve this problem

test2a commented 3 years ago

thanks. did you look into daybook xml? i suppose that is our best bet to get all kinds of data