FALEX77 Posted August 20, 2014 Share Posted August 20, 2014 Buenas tardes Estoy terminando un proyecto en prestashop 1.6 y tengo un inconveniente con el numero de las facturas que se generan , por cuestiones legales en mi país (Colombia) me exigen que las facturas no deben llevar ceros (00001) a la izquierda solo debe llevar el numero de la factura (1) agradezco quien me pueda colaborar para modificar. Link to comment Share on other sites More sharing options...
Fernando91 Posted August 21, 2014 Share Posted August 21, 2014 Classes/pdf/HTMLTemplateInvoice.php quitas esto antes $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); despues $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf( $order_invoice->number); Link to comment Share on other sites More sharing options...
FALEX77 Posted August 23, 2014 Author Share Posted August 23, 2014 Classes/pdf/HTMLTemplateInvoice.php quitas esto antes $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); despues $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf( $order_invoice->number); Muchas gracias por tu solución, ya lo pude lograr Link to comment Share on other sites More sharing options...
flowart Posted October 28, 2014 Share Posted October 28, 2014 Y si solo quiero que aparezca "000" seguido del número? en vez de "00000" Link to comment Share on other sites More sharing options...
tuk66 Posted October 30, 2014 Share Posted October 30, 2014 Cambie esto sprintf('%06d', $order_invoice->number); a sprintf('%04d', $order_invoice->number); Link to comment Share on other sites More sharing options...
juancopi81 Posted July 9, 2015 Share Posted July 9, 2015 Hola, Gracias por tu respuesta. Quería preguntarte si sabes cómo hacerlo en Prestashop 1.6. Veo el código un poco diferente: En public function __construct(OrderInvoice $order_invoice, $smarty) Encuentro: $this->title = sprintf(HTMLTemplateInvoice::l('Invoice #%1$s%2$06d'), $prefix, $order_invoice->number); Y en public function getFilename() return Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order_invoice->number).'.pdf'; Gracias! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now