Page 1 of 1
Printing out invoices
Posted: Wed Jul 20, 2005 3:25 pm
by visionmaster
Hello together,
We are planning to implement an internal PHP/MySQL System to administer our invoices, reminders and of course a lot more... My problem is first of all the database structure. Any good tutorial site which explains an appropriate structure for invoices? Another problem, which I really have not found a solution for, is printing out the invoices on paper. Do I have to detour over pdf? (fpdf...) Or is XML the best way= Any helpful tips or example sites? Maybe a free CMS one can build on?
Thanks a lot!
Posted: Wed Jul 20, 2005 4:52 pm
by Burrito
as for the db structure, you *might* be able to find some invoice "templates" but I'd think you'd probably be better served creating your own...much more customizable that way.
as for the printing...you *could* use a pdf (that would give you the most consistent invoice no doubt), but I'd actully suggest using css and tweaking your page layout to suit your needs.
you can always create a different stylesheet for printing than you do for "on screen".
I know I've seen this question come up on this forum, I suggest you do a search for "invoice css" or the like....
Posted: Wed Jul 20, 2005 4:58 pm
by nielsene
I'd suggest using the PDF route rather than CSS. Invoices are meant to be a printed item; they're often filed and copied and sent all over the place as part of different companies payment process. PDFs are harder to manipulate by the end user and so often seem more "official". I wouldn't want an user's personal style sheet to mess up the formatting/display of an invoice, etc.
I've also known one or two companies that refuse print outs of a web page as an invoice, they want a real document.
Posted: Wed Jul 20, 2005 5:37 pm
by visionmaster
Burrito wrote:as for the printing...you *could* use a pdf (that would give you the most consistent invoice no doubt), but I'd actully suggest using css and tweaking your page layout to suit your needs.
you can always create a different stylesheet for printing than you do for "on screen".
I know I've seen this question come up on this forum, I suggest you do a search for "invoice css" or the like....
I have read of the possibility of including another stylesheet for printing means, but getting the page-breaks to be correct (invoices going over more than one page) seems to very difficult, if not impossible with css. Any experience with css? Advantages, disadvantages?
@nielsene The point of filing and copying pdf-files is indeed an important issue. So would you suggest to forget experementing with css and directly go to the html2pdf conversion solution? Any experience with a pdf-packages? (GPL?) How does the conversion actually work? Do I pass forward my text which is then inserted into placeholders in my pdf template?
Thanks for your help.
Posted: Wed Jul 20, 2005 5:42 pm
by nielsene
I've always made my PDFs via pdflatex. But that's because I like LaTeX and know it fairly well. So I'll have the PHP generate a temp file with all the LaTeX markup, including all the custom content for a given person. Then I exec pdflatex $tempFileName; twice (since sometimes LaTeX needs two passes to sync up all references). Then I'll put the finished pdf in a protected directory for download or email attachments, etc.