Page 1 of 1
[Solved] Assign invoice number when opening Writer template
Posted: Wed Feb 22, 2023 10:16 pm
by alphonsobellinni
Setting up invoices. Would like to have invoice numbers automatically entered when opening template.
Also would like to be able to print two copies of invoices, one in color, one black and white.
Don't know what to look for.
Re: Invoice numbering
Posted: Thu Feb 23, 2023 8:25 am
by Zizi64
Setting up invoices. Would like to have invoice numbers automatically entered when opening template.
Also would like to be able to print two copies of invoices, one in color, one black and white.
Don't know what to look for.
One of the posible solutions: the Macros.
You must store the last VALID invoice number somewhere: Into a txt file, into a database, or into the invoice template itself (for example in the Custom Document Properties). You can get it by a macro and you can increase it by one. You must use real numeric value, or you must convert it to numeric value for the time of the increasing, if it were a string like "invoice number", like "Inv001".
When the invoice number becomes valid? I am sure not at the opening the invoice template, but (I suppose it) after you completed it and printed the desired copies.
I suppose it you can control the print procedure by macro to print a B&W and a color copy of the actual invoice (I have not any clue why you need it.)
Re: Invoice numbering
Posted: Thu Feb 23, 2023 4:20 pm
by alphonsobellinni
Thank you for the reply. I will try to make a macro. May be a few days before I have time to mess with it.
Reason for printing invoices in color and black & white: color copy for customer, black & white for our records.
Re: Invoice numbering
Posted: Thu Feb 23, 2023 5:22 pm
by John_Ha
Use mail merge from a spreadsheet where the number is incremented??
Re: Invoice numbering
Posted: Thu Feb 23, 2023 6:54 pm
by MrProgrammer
Hi, and welcome to the forum.
You might want to consider doing this with a package which performs invoicing, rather than
creating this yourself. Find packages via a web search. Here is one recent review from a respected publisher. You'll find many others.
Best Invoicing And Billing Software (February 2023)
Some of those are free; some aren't. But software you pay for may provide more value than its cost. For example, it may allow you to accept electronic payments for invoices, which would be difficult and risky to implement yourself, and the ability to pay electronically may attract additional customers. Only you can select the one which best meets your requirements.
alphonsobellinni wrote: ↑Wed Feb 22, 2023 10:16 pm
Would like to have invoice numbers automatically entered when opening template.
Writer has no place to store or retrieve the last-used invoice number so that a template can display the next one. You would need to develop a macro system to add that capability. These are often complex. Expect to spend a week or more creating your first macro, more if you're not already a programmer. You could search the forum to see if anyone has already done this. The obvious search term would be
invoice.
However, a
database will assign numbers automatically when the data is entered on the form which you've created for your invoice. The data will be stored in database tables. You will access it using
Base where you can create queries to select data from the tables then filter, summarize, sort, and/or group it. Base can generate reports from the queries using a layout which you specify. I think the layout could include a header with a logo. A database solution will be superior to anything which you would improvise in Writer or Calc, and probably won't require any macros.
[Example] Invoice Forms (without macros)
Board index » Getting started » Tutorials » Base
alphonsobellinni wrote: ↑Wed Feb 22, 2023 10:16 pm
Also would like to be able to print two copies of invoices, one in color, one black and white.
Many color printers supply a dialog where one can choose between color or black and white. I don't know if it's possible for a database report to create one copy in color and one in black and white.
If this solved your problem please go to your first post use the Edit ☐ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Re: Invoice numbering
Posted: Fri Feb 24, 2023 8:44 am
by Mountaineer
MrProgrammer wrote: ↑Thu Feb 23, 2023 6:54 pm
...
I don't know if it's possible for a database report to create one copy in color and one in black and white.
The easier approach is to repeat the report.
I created two solutions over the years.
One is a macro in a Calc-Sheet, wich saves as pdf, then prints 2-3 times and changing background colour of the cells between prints (only on right side to save ink).
Second is an external script using pdfTK to overlay the current pdf with several background pages.
Considering Base I would either use my second approach or just copy the report, change colour in the second and print one after the other by macro. (Basics are available in the Guide to Base, i use this for other reports)
Both systems used to replace traditional dot-matrix printers printing on layers of sheets.
In our traditional process the first "original" was sent out by mail, the second was archived, the third had to be signed by the person who handled the transport to document this. Now we usually work only with pdf and even customs declarations don't need actual printouts, but for different types of shippers "sign the yellow copy" for the goods you take just works with every shipper.
Re: Invoice numbering
Posted: Fri Feb 24, 2023 12:25 pm
by John_Ha
Print two mono copies, the customer one onto a pre-printed sheet with your coloured logo etc in drawer 1; and your one onto plain paper in drawer 2.