DGFiP / Test-Compta-Demat

Ce logiciel permet de contrôler le respect des normes des fichiers d'écritures comptables (FEC) conformément aux dispositions de l'article A.47 A-1 du livre des procédures fiscales.
http://www.economie.gouv.fr/dgfip/controle-fiscal-et-lutte-contre-fraude
52 stars 20 forks source link

Issue with MontantDevise and Idevise #1

Closed LTETON closed 9 years ago

LTETON commented 9 years ago

Hello,

I tried to submit a file that is ok according to xsd format to Test Compta Demat, but the software told me there 's an issue about format.

The fact is that MontantDevise and Idevise aren't taking into account. When I leave them it's unconform, but when I totally delete them it's ok.

But it's a field that must be present according to A47A-I-VII.

Could you please tell me what's wrong with my file, why the software refused those line whereas they are supposed to be there according to the administration.

I put the content of my file just below:

Thanks a lot.

Laurent

<?xml version="1.0" encoding="iso-8859-15"?>

2013-07-31 OD Opérations diverses OD/2013/04/2 2013-04-01 ANNULAT° FACTURE BUDP1309 NC/2013/4/00018 2013-04-01 2014-02-26 401F0000053USD ARK INDUSTRIES LTD. 401 Fournisseurs 3074.16 USD 2358.48 60702000 ACHATS/REVENTES PIECES SANS TVA 2358.48 OD/2013/04/3 2013-04-01 DTC/2013/4/00019 DTC/2013/4/00019 2013-04-01 2014-02-26 401F0000089USD JE PISTONS 10.65 76600000 GAINS DE CHANGE 10.65 OD/2013/04/4 2013-04-01 DTC/2013/4/00020 DTC/2013/4/00020 2013-04-01 2014-02-26 401F0000089USD JE PISTONS 401 Fournisseurs 12.71 66600000 PERTES DE CHANGE 12.71

capture

pommedeterresautee commented 9 years ago

Hi, You should try to change order of the fields in the XML and follow the one from the XSD. Having checked the source code of the XML part of this tool, you should be careful. There are some buggy behaviors.

Kind regards, Michaël

LTETON commented 9 years ago

Hi Michaël thanks for your answer,

I have followed the XSD format given by the site impots.gouv, and there are no errors in this format. I have the same order in the XML that in the XSD. I've already checked the conformity between my XML and my XSD file. And there was no issue.

So I'm wondering were does the "error" given by the software comes from ?

Regards

Laurent

pommedeterresautee commented 9 years ago

It seems the extracted of XML you have posted is incorrectly rendered by Github.

If you put your XML between 3 ` (apostrophe) before and after it will block the rendering of XML and therefore I can see the real XML file.

Otherwise, send a link to the file (Dropbox for example) and I may check it easily.

Regards, Michaël

npotelle commented 9 years ago

Hello,

please post the errors mentionned in the report ; post the errors listed in the log (err_SirenFECAAAAMMJJ.log in folder \Test_Compta_Demat\testeur\log).

Thanks

pommedeterresautee commented 9 years ago

@npotelle according to my understanding of the way the soft works, XML errors are not reported in log. Only when the XML passes the xerces test, it is converted to CSV and then same CSV test are applied. So log may not report the real issue just the one regarding the converted file IF the XSD is respected.

LTETON commented 9 years ago

Hi,

First of all, thanks for your answers.

@npotelle,the log file are there: https://www.dropbox.com/s/n82n0af770g3ttd/err_500252606FEC20130731.dat.log?dl=0 https://www.dropbox.com/s/erom8kqkc1tsslo/log_500252606FEC20130731.dat.log?dl=0

and I put too the report pdf: https://www.dropbox.com/s/ic3zd6tstvge888/rapport_500252606FEC20130731.dat_154854.pdf?dl=0

@pommedeterresautee , please find the file on the following link: https://www.dropbox.com/s/3zi7hrukckw3b2b/500252606FEC20130731.xml?dl=0

Regards,

Laurent

pommedeterresautee commented 9 years ago

@LTETON I have made some basic tests and your XML passed the XSD test (using the Xerces compiled version embedded with this software by the tax administration).

Just for your information, in the header of the XML it is better to use <?xml version="1.0" encoding="iso-8859-1"?> instead of iso-8859-15 otherwise Xerces reports (even if it seems not compliant with article A 47 A 1 LPF, both encoding are very similar).

Fatal Error at (file stdin, line 1, char 45): unable to create converter for 'IS
O-8859-15' encoding

This message is not shown in the PDF report (as ANY real XML issue), and I am not even sure it breaks the audit, just Xerces not knowing 8859-15 (basically the same than 8859-1 encoding with an € character, check Wikipedia for more info).

And here I think you have one of the buggy behavior of the XML implementation we have already met when helping a foreign ERP editor being compliant with French tax law (yep, with FEC the freedom they enjoyed during the previous years is finished, they will finally need to buy a French tax code and a French commercial law code to fix stuff :-) ).

Process is as following : your XML is tested compliant to XSD file according to Xerces THEN it is automatically converted to CSV format to perform other tests already implemented for this format. For the ERP we have helped, we noticed that the converted version of the XML was not correct! So the error they were seeing in the PDF was not their fault (OK, they did strange things, but it was authorized by the XSD).

We are going to report this issue (and many others we have discovered when auditing client's FEC - both XML and CSV - to the tax administration) so we can help them to fix Alto 2 (unfortunately our previous meeting have been canceled but we should plan a new one in feb).

I hope these information will be useful to you!

Kind regards, Michaël

npotelle commented 9 years ago

@LTETON Yes, there is a known problem when the XML file is converted to Text file. As said in the log "il y a 20 champs au lieu des 18 champs attendus", 2 wrong fields are unfortunately created by the conversion process. Your problem is solved with the next version coming in few weeks. Your XML file is OK.

@pommedeterresautee good analyse ;-)

LTETON commented 9 years ago

Thanks a lot for your remarks!!

@pommedeterresautee, your analysis was very helpful!

@npotelle, thanks, I'm waiting for the next version of Test Compta Demat ;)

Regards, Laurent

pommedeterresautee commented 9 years ago

Tks to both of you!

@LTETON you re welcome! After auditing hundreds of FEC with my colleagues we start to be very used to format and tax issues revealed by a FEC :-) BTW if you use SAP, check EcritureNum numbering, it s a very annoying issue. Most of the other ERP are not a lot better regarding tax compliance. BTW. And check the language + Gaaps you are using, English and IFRS / US Gaaps are bad choice in a French accounting, French Commercial code is very clear about these points (in your example it seems to not be an issue). However it is good to finally see someone who cares enough about its FEC to go on Github ask the right question!!!! May be accounting will finally change thanks to the FEC.

@npotelle first thanks to have made this tool open source. I m a big fan of open source in general (I program a lot as a hobby) and I really enjoy the way tax administration is managing FEC (free tool, creation of FAQ to rapidly answer questions instead of plain old slow BOFiP...). Last time we were about to meet Mr. Chignot (may be the spell is not correct), he works (leads?) for the BVCI, but as I have the opportunity to speak with you here, is there a way I directly contact you so we discuss about the things we have discovered during the many FEC audit we have already performed? So you can fix the audit tool? Some are just little bug like this one, some other points may be a little harder to fix. We have even seen one bug in the full version of Alto 2 but can't go further because we have no access to the software of course. You can reach me on my email mbenesty [@] taj.fr

Kind regards, Michaël

npotelle commented 9 years ago

Bug solved in the new published release 1.0.5