@lubos, I finally had some time to look into this issue of custom sales invoice templates further. I copied and pasted the entire block of code you posted in this topic 3 weeks ago under this heading:
into a new view template.
Without having made any changes to your code, I converted an existing invoice to that template, with fairly disastrous results. It generated a sales invoice (a) without the business logo, (b) without any vertical or horizontal border lines, and (3) with badly misaligned elements (such as currency symbols on wrong lines, customer and business information bunched towards the left side, etc.)
Although the functional elements were all there, such as an amount credited from Customer credits
, something is obviously very wrong.
I don’t fully understand your earlier explanation that there is no longer any “comprehensive” template for invoices. Do you mean that the code used in any set of circumstances is generated on the fly? While I cannot conceive of how you would accomplish that, I can understand that in such a situation you cannot offer up whatever code is being used as a starting place in the View Templates setting environment. But, this creates big difficulties for anyone who needs a modified invoice but wants the features built into Manager.
It seems to me you have two kinds of users to consider. The first wants to generate completely different invoices from what Manager produces. It is reasonable to expect them to have or hire the HTML skills to start from scratch (or nearly from scratch). But the second kind is interested only in small changes: a little more space here, a custom field there, or some specially required tax statement. Many of those users could struggle through some simple changes and be thrilled with the results if they just had a place to start that they knew produced what they were seeing as the default invoice template. Is that not possible?
Let me give you a simple example of why this bothers me so much. I had a customer who paid a deposit. I had to send a sales invoice for the deposit to satisfy their accounting needs. They paid the invoice, and I received the payment as Other income
and immediately transferred the deposit to Customer credits
because I had not yet done the work to earn the revenue. Today, I completed the work, creating a new sales invoice from all the billable time and expenses recorded in the intervening weeks. The only way I can have the customer credit show on the final invoice is to use the default sales invoice, because that feature no longer works on my customized view template. Accounting-wise that is satisfactory, but the resulting document doesn’t look like I want.
The other way I could have handled the situation would have been to leave the deposit in an income account after they paid the first invoice and add a deduction line to the final invoice. But that would have misrepresented the financial situation in the interim by categorizing their payment as revenue rather than as a liability.
As you can tell from the length of this post, a small matter causes me much frustration. You mentioned the possibility of building an invoice generator via which users could tick off features they wanted in their invoices. Is that a near-term possibility? And would it allow small format changes? If not, this is all feeling like things just went too far, effectively spoiling what had been a great solution to special invoicing needs.