new short code #9025
Replies: 1 comment
-
I corresponded a bit with chat gpt and he says this To achieve the desired result within the JSON structure, you can use a simple template placeholder and then replace it with the formatted invoice number in your code. Here’s the modified code:
Then, in your code, you can replace $formatted_invoice_number with the actual formatted invoice number using the appropriate programming language. For example, in JavaScript:
By following this approach, you can dynamically replace the placeholder with the formatted invoice number within your existing JSON structure. now I’m interested in which file I can add this second code and in that way create a new $short_code |
Beta Was this translation helpful? Give feedback.
-
What version of Invoice Ninja are you running? ie v4.5 / v5
v4.5
What environment are you running?
Shared Hosting
Additional context
FORUM
How to display only the invoice number counter and the current year in the custom fields company?
For example, my invoice number is Rxx-1-1-2023, and I want to display only xx-2023 there. If I use the code $invoice_number, it will display the entire number, which I don’t want. Also, I don’t want to change the invoice format; I just need to display it in this shortened format in one place.
If I use the code:
HR00 {$counter}-{$year}
it doesn’t display anything, it just shows for example HR00 {}-{}
Beta Was this translation helpful? Give feedback.
All reactions