How to modify the default invoice
Geert Janssens
geert.gnucash at kobaltwit.be
Tue Jun 7 13:13:09 EDT 2016
On Tuesday 07 June 2016 10:52:29 John Morris wrote:
> I, too, would like to be able to change the default invoice. I found
> several mentions of doing this online and I've made some headway, but
> I have not yet reached my goal. At this point, the invoice I have is
> tolerable, so I have been trying to make the invoice I have created
> be the invoice used when I click the Print Invoice button on an
> invoice. The discussion reported at
> <http://comments.gmane.org/gmane.comp.gnome.apps.gnucash.user/51015>
> suggests that GnuCash 2.6 would have the ability to select a
> customized invoice as the default invoice. This new feature was
> supposed to appear in the Business tab of the GnuCash preferences.
> Alas, while there is a dropdown menu there to select a default
> invoice, it does not include my customized invoice. What am I doing
> wrong?
You are misinterpreting the conversation you refer to unfortunately. And this is partly because
our report system has two kinds of reports, old style ones (like the Printable, Easy and Fancy
invoice reports) and new style ones (like the Tax Invoice report). And these two kinds are not
always explained sufficiently.
Here's the short history:
- when reports (including invoice reports) were introduced in gnucash, gnucash only had very
limited ability to render html. It didn't understand css at all. So to "style" reports, a style sheet
editor was added. All it did was use some html attributes to add color, an image, a different
font,... When the conversation you refer to talks about editing the style, that is via this style
sheet editor. You would edit the default set of customizable attributes, each report would open
using these attributes by default. The options available for customization are still limited.
- at some point gnucash switched to a more mature html engine which does understand css.
However up to today most reports still don't make use of it and the only options available for
customizing those reports are still what you find in the style sheet editor.
- then someone made an effort to rewrite a few reports in a guile based template system
(called eguile). With that rewrite these new reports also started to make use of css for their
styling. The Tax Invoice report is one of these.
- this effort was never completed for all reports and perhaps it's not needed for all reports. More
importantly nor was the css styling integrated in the current stylesheet editor. It's completely
independent. You can only select an alternative css stylesheet via a report option. The
drawback of this method is there is no way to set an alternative stylesheet as default. If you
want a css stylesheet to persist, you need to save it in a report configuration (or leave the
report permanently open as suggested before), however that's not yet the same as setting a
stylesheet as default.
- independently of this a new feature was added to choose the default report to use for printing
invoices. This setting knows about the 4 invoice reports we have, but unfortunately it is
unaware of any saved report configurations based on any of those (due to technical limitations
of the current code).
The last two additions both had/have the potential to solve your request of using a personalized
layout when printing invoices, but given the limitations I mentioned it's not quite there.
So unfortunately it is not possible right now to select a saved report configuration (with a
custom css file or otherwise) as the default report to print. The closest you can get is use one of
the other invoice reports (Printable, Easy or Fancy) and adapt the default stylesheet in the
stylesheet editor. Compared to the freedom of css in then Tax Invoice report, the possibilities
for customization are rather limited unfortunately.
While this is probably not what you were looking for, I hope it explained why that is currently
not possible within gnucash.
Regards,
Geert
More information about the gnucash-user
mailing list