Printing CUIT/CUIL in the invoice

Hi all, I’m addapting a dolibarr’s invoice to the one used in my company. I read the guide in http://wiki.dolibarr.org/index.php/Create_document_model and made a few modifications without problem, but I’m having problems trying to add new info.

How can I get the CUIT/CUIL of the client (receiver of the invoice) to put it in the invoice model? Or better, is there some examples/tutorial about it? I’ve read the docs about document models, about business objects and more, but I’m not sure where to get the info from… I’m using $object->client->nom for the name, where can I see the client class? :confused: I’m not an experienced php programer, sorry if it’s too basic…

Thanks in advance!

Ok, I got to the Societe class, wich is where dolibarr gets the client info to print in the invoice, but I still don’t know what class member correspond to the CUIT/CUIL, or how should I get it… Any ideas?

I think I got it, the CUIT is the id “idprof1” in the societe class. So, it works with:

$cuit = $outputlangs->convToOutputCharset($object->client->idprof1);
$pdf->MultiCell(…, $cuit);

Thanks anyway! …if there’s someone reading… :confused:

No te hubiera sido más fácil usar la constante MAIN_PROFID1_IN_ADDRESS en la configuración de Dolibarr?

No se cómo usarla… lo que usé esta funcionando por ahora, pero si te parece que usar la constante es mejor comentame cómo funcionaría y lo pruebo, nada mejor que aprender algunos trucos cuando se está empezando con algo.

Gracias por el interés!

Menú Inicio->Configuración->Varios

Añade MAIN_PROFID1_IN_ADDRESS con valor 1 para el CUIT/CUIL y cuando generes los documentos ya te aparecerá.

Efectivamente funciona también. No me fijé en el código a ver que parte tiene en cuenta esa constante ya que por ahora está funcionando con el código que mostré antes. Si tengo tiempo lo veré luego.

Pero me interesa saber sobre las constantes que se pueden usar, la verdad que no vi nada de eso en la documentación y no lo pude encontrar buscando… hay alguna página en la wiki? Alguna parte del código donde debería ver la lista de constantes posibles?

Saludos, y gracias por la ayuda simnandez!

Aquí los tienes:
http://wiki.dolibarr.org/index.php/Configuración_Varios