Feature: #67 - Show subtotal on each page
See Pull Request #67
Description
If the products of an order do not fit on one page, the product table ends on each page but the last one with the subtotal of the products on this and the previous pages. The table header is repeated on each page as before. The last page ends with the summary of the order.
The subtotal is rendered with the new template Order/ of the
document, e.g. Invoice. The template gets the
following variables:
order: the orderItem order: the TypoScript settings ofSettings body.order products: the products on this and the previous pagessubtotal.andnet subtotal.: the sum of these productsgross
The label is provided by the language file of the extension
(EXT:), as the subtotal
of a page differs from the subtotal in the summary of the order.
The feature is enabled by default for the order and the invoice. The delivery note has no prices, so it is disabled there and the template is empty.
plugin.tx_cartpdf.invoicePdf.body.order.pageSubtotal = 1
module.tx_cartpdf.invoicePdf.body.order.pageSubtotal = 1
Impact
The product table is split into one table per page, also if the subtotal and the amount brought forward are disabled. The number of products per page is determined by writing the table on trial, so products of different height (e.g. with long titles or additional lines) are taken into account. The summary of the order is never split and never stands alone: if it does not fit below the last product, this product moves to the next page as well.
Own templates for Order/, Order/ and
Order/ keep working. A rowspan must not span several
products, as the products may be spread over two tables.
The subtotal row of the extension matches the product table of the extension:
five columns, the label spans the first four. If the own templates change the
number of columns or the style of the table, add an own
Order/ that matches them, e.g. by adapting the colspan.
With body. the tables end without the subtotal.