Get doc.name minus the prefix

I am working on a custom print format. I have the naming series for invoices setup as “INV-.YY.MM.DD.-.###”. This is fine for the system and for differentiating things on our end, but on the invoice being printed or sent to the client I would like it to just show the doc.name without the prefix “INV-”. Is there a way I can get the print format to fetch or display it without the prefix?

naming_series[3:]

I tried it like this: {{ doc.name[3:] }} but it returns an error.

{{ doc.name[3:] }}

works flawlessly for me.
what exactly is the error?

I figured it out. It was throwing an error for a different custom html object that I added yesterday.
Your above code works perfectly. I just changed it to be {{ doc.name[4:] }} so it will elimenate the - too. Thanks for the help!
Strange part is yesterday the html object worked fine. Here’s the code, maybe someone can help. It throws an error saying " AttributeError: ‘NoneType’ object has no attribute ‘get’ "
The code should grab the tax with the currency symbol
{{ doc.get_formatted(“doc.total_taxes_and_charges”) }}

total_taxes_and_charges is probably empty. a noneType.
check it like

{% if doc.total_taxes_and_charges %}{{ doc.total_taxes_and_charges }}
{% endif %}

The taxes are applied to every invoice, so the tax should never be empty. I get putting the % if % etc. if it could be an empty field, but it will never be empty. Also the issue I was having before was that the currency symbol wasn’t showing so I needed to add the doc.get_formatted to get the value with the currency symbol.
{{ doc.get_formatted(“total_taxes_and_charges”) }} works, where before I had it as {{ doc.get_formatted(“doc.total_taxes_and_charges”) }} . The extra doc. was what appears to have been causing the error.
Thanks for all the help!