LibreDTE / libredte-lib-core

LibreDTE: Biblioteca PHP (Núcleo)
https://lib-core.docs.libredte.cl
GNU Affero General Public License v3.0
196 stars 156 forks source link

Example 33 does not work #52

Closed charliecliff closed 6 years ago

charliecliff commented 6 years ago

Howdy.

I am running your Example 33 with Testing Data form the Chilean SII, and the XML that your project generates does not seem to be valid.

I am using a DTE file that I have gotten from the SII.

I am using a Digital Certificate .p12 File that I have used to assign Invoices in the past.

The Method: echo $AEC->generar(); will print an xml string to the console.

STEPS TO REPRODUCE

1) I then cut and paste that string into an XML File.

2) I then log into the mySII Web Page

3) I then upload the AEC in order to assign the DTE.

4) SII sends me an email with the following error response: RFS - Anotacion de Cesion Rechazada, Rechazado por Firma de Sobre

EXPECTED RESULT The AEC XML String that your project produces can be used to assign an Invoice in the SII Syste

estebandelaf commented 6 years ago

Maybe, the copy/pase process is your problem.

You should try save the file directly from PHP or maybe send from the same code to the SII.

Also review the codification of input XML and output XML.

charliecliff commented 6 years ago

When I uncomment the method: echo $AEC->enviar();

The Error message is: Error código 6

This error looks like it is saying that I do not own the invoice, which is untrue.

estebandelaf commented 6 years ago

The error is given by SII.

Are you in the correct enviroment? check that, by default is testing.

charliecliff commented 6 years ago

Where is the environment set?

estebandelaf commented 6 years ago

In the config.php file in examples folder. If you are in production, is:

\sasco\LibreDTE\Sii::setAmbiente(\sasco\LibreDTE\Sii::PRODUCCION);

charliecliff commented 6 years ago

Neat! 👍

I think that did it!

estebandelaf commented 6 years ago

great!