+ foreach my $section ( @sections ) {\r
+ if ($section->{'pretotal'}) {\r
+ $OUT .= '\begin{flushright}';\r
+ $OUT .= '\large\textsc{'. $section->{'pretotal'}. '}\\\\';\r
+ $OUT .= '\\end{flushright}';\r
+ }\r
+ $OUT .= '\pagebreak' if $section{'post_total'};\r
+ $OUT .= '\captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}}';\r
+ $OUT .= '\begin{longtable}{cllllllr}';\r
+ $OUT .= '\caption*{ ';\r
+ $OUT .= ($section->{'description'}) ? $section->{'description'}: 'Charges';\r
+ $OUT .= '}\\\\';\r
+ $OUT .= '\hline';\r
+ $OUT .= '\rule{0pt}{2.5ex}';\r
+ $OUT .= '\makebox[1.4cm]{\textbf{Ref}} & ';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{Description}}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm][r]{\textbf{Amount}} \\\\';\r
+ $OUT .= '\hline';\r
+ $OUT .= '\endfirsthead';\r
+ $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\\\';\r
+ $OUT .= '\hline';\r
+ $OUT .= '\rule{0pt}{2.5ex}';\r
+ $OUT .= '\makebox[1.4cm]{\textbf{Ref}} & ';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{Description}}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{}& ';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm][r]{\textbf{Amount}} \\\\';\r
+ $OUT .= '\hline';\r
+ $OUT .= '\endhead';\r
+ $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued on next page...}\\\\';\r
+ $OUT .= '\endfoot';\r
+ $OUT .= '\hline';\r