Removing .1 from Invoice PDF export

Is there a way I can remove the .1, .2, etc. from the Invoice # on the pdf export? i.e. for Invoice 4432.1, I would want the PDF export to have Invoice 4432. Is there a way to modify the [% invoice.controlnum %] or use a different shortcode in place of that to make it display 4432?

Let me know and thank you!

You can truncate the .1, .2, in the custom document template, but it might cause confusion later.

From CETEC’s Support site:

1 Like

Thanks Cesar, how can I truncate it in the custom document? I am having trouble doing this.

Thanks for the support.

I assume your invoice numbers are something like this: 100.1-1. Is this correct?

1 Like

Yes, correct. I think I figured out the method to do output as my org desires. Thanks again.

If I’m correct, using an invoice number without being fully qualified (line number, NOSI number) will only work if your orders have only one line, and you invoice in full every order. Otherwise, you’ll might end having duplicate Invoices (on paper).

I’m not well-versed in Template Toolkit, but I think you can use this code, if needed:

[% invnum = invoice.controlnum %]
[% WHILE invnum.substr(invnum.lenght - 1,1) != ‘.’ %]
[% invnum = invnum.substr(0,invnum.length - 1) %]
[% END %]
[% invnum = invnum.substr(0,invnum.length - 1) %]

Just replace [% invoice.controlnum %] with [% invnum %]

I am not experienced with TT either but I used the following:

[% invoice.controlnum.replace(‘..*’, ‘’) %]

I did not add any other conditions because our invoicing format will never change and this works as desired. We are fine with having “duplicate” invoices on paper as the system will have the unique numbers anyway.

:+1:t3: