Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qn: What about adding new services to the project. #149

Open
Alvezgr opened this issue Jul 29, 2022 · 8 comments
Open

Qn: What about adding new services to the project. #149

Alvezgr opened this issue Jul 29, 2022 · 8 comments

Comments

@Alvezgr
Copy link
Contributor

Alvezgr commented Jul 29, 2022

@WhyNotHugo I'm wondering what 'ill be the welcoming of adding new AFIP services to the project such as padrones or any other basic services.
The project today is very useful and with wsaa and wsfe is working and solving the main needs for general purpose, but I recently needed to use another service in AFIP and I'm asking if it's only my need or if 'ill be a nice to have.
I'm working in getting a person from one of the possible padrones that are in AFIP.
So I'm thinking on creating a Person model that will have AFIP persona data on it with some methods to fetch that data.
Whats are your thoughts about it?

@WhyNotHugo
Copy link
Owner

I think the ticket-fetching logic should work as-is. We also need to add the urls to clients.py.

There's a few different ws_sr_padron_a* services. Do you know how they related? Does each one add new fields on top of previous ones, or are they different methods? Which one do you have in mind?

@WhyNotHugo
Copy link
Owner

I'm generally open to adding other webservices to the project; most of it is designed in a way to make it easy to extend.

@Alvezgr
Copy link
Contributor Author

Alvezgr commented Apr 14, 2023

The main motivation that I had, to implement this was to automate what kind of receipt a person can receive depending on his vat condition and the taxpayer vat condition and also to fill the receipt PDF for a given DNI or CUIT, getting the name, last_name, vat condition and address directly from AFIP.

I end it up implementing with some helpers and cleaners around ws_sr_constancia_de_inscripcion and ws_sr_padron_a13 services, reaching to the conclusion that there is not a "clean" way to implement this into the library, due to:

  • validations/checks we must do.
  • ws_sr_padron_a13 does not work for Consumidor Final.
  • vat_condition, IVA Exento or IVA RI not always are explicit.

Any recomendation or hints will be great to validate the need for this and the following path to implement.

@WhyNotHugo
Copy link
Owner

ws_sr_padron_a13 at least allows confirming that a CUIT is valid, correct?

Saving the province in Receipt instances would be useful. Pretty much all tax reports require the province where the buyer lives. Is that exposed?

vat_condition, IVA Exento or IVA RI not always are explicit.

Is this available in some other version of ws_sr_padron_a*?

@Alvezgr
Copy link
Contributor Author

Alvezgr commented Apr 15, 2023

ws_sr_padron_a13 Will return:

  • Persona if a CUIT is valid and active.
  • Throw Fault: Persona inactiva if a CUIT is valid but inactive.
  • Fault: No existe persona con ese Id if a CUIT is not valid.

So I think you can just check for Fault: No existe persona con ese Id to validate or not a CUIT.

Is this available in some other version of ws_sr_padron_a*?

Yeah It is available (otherwise is: Consumidor Final) in ws_sr_constancia_de_inscripcion (known before as ws_sr_padron_a5).

PD: As you mention above the ticket-fetching logic is the same and the urls to clients.py were added in the commit 1b7b0f5.

@npazosmendez
Copy link
Contributor

Any luck getting name last_name and address for a DNI (Consumidor Final)? I was only able to get those for a CUIT, using ws_sr_constancia_inscripcion.

@Alvezgr
Copy link
Contributor Author

Alvezgr commented Sep 6, 2024

I started using the getIdPersonaListByDocumento method from the ws_sr_padron_a13 that returns an idPersona and then I use the ws_sr_constancia_de_inscripcion with that id. The thing is that afip does no have the documentation for this method in the developer manual, this method request for a documento instead of an idPersona.
Your request will look like:

payload = {
      "token": token,
      "sign": token,
      "cuitRepresentada": tax_payer_cuit,
      "documento": document_number
    }

A I said before, there is not a "clean" way to implement this.

@npazosmendez
Copy link
Contributor

Nice find, I will try that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants