Johennes / aliexpress-invoice-generator

Firefox & Chrome extension for generating PDF invoices from AliExpress order detail websites
GNU General Public License v3.0
12 stars 4 forks source link

Feature request: Set the filename for the invoice #7

Open Joshfindit opened 2 years ago

Joshfindit commented 2 years ago

The current format is nicely informative, but we would like to change it by adding:

Example:

Aliexpress-invoice-2021-11-05-1554-644########289.$25USD.pdf

We'd be open to any sort of templating format such as passing the JS template string directly in to `background.js'

`Aliexpress-invoice-${getFilenameComponent(date)}-${getFilenameComponent(number)}.$${order.cost}${order.currency}.pdf`
Johennes commented 2 years ago

Thanks for reporting this @Joshfindit. That's an interesting idea and shouldn't be too hard to implement. I also like the template idea. To make editing a little easier maybe we could agree on a set of format specifiers such as

%i  Invoice number
%d  Invoice Date
%a  Total amount (in charged currency)
%s  Charged currency code
...

That way for your case the template would be

Aliexpress-invoice-%d-%n-%a-%s.pdf

What do you think?