[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3814] branches/1.3
- Subject: SF.net SVN: ledger-smb:[3814] branches/1.3
- From: ..hidden..
- Date: Sat, 08 Oct 2011 03:21:42 +0000
Revision: 3814
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3814&view=rev
Author: einhverfr
Date: 2011-10-08 03:21:41 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
Correcting a number of bugs with the invoice template rendering
Modified Paths:
--------------
branches/1.3/LedgerSMB/Form.pm
branches/1.3/LedgerSMB/Template/LaTeX.pm
branches/1.3/LedgerSMB/Template.pm
branches/1.3/bin/arapprn.pl
branches/1.3/templates/demo/invoice.tex
Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm 2011-10-07 23:50:23 UTC (rev 3813)
+++ branches/1.3/LedgerSMB/Form.pm 2011-10-08 03:21:41 UTC (rev 3814)
@@ -1048,12 +1048,6 @@
'order' => {
html => [ '<', '>', '\n', '\r' ],
txt => [ '\n', '\r' ],
- tex => [
- quotemeta('\\'), '&', '\n', '\r',
- '\$', '%', '_', '#',
- quotemeta('^'), '{', '}', '<',
- '>', 'Â'
- ]
},
html => {
'<' => '<',
@@ -1062,22 +1056,6 @@
'\r' => '<br />'
},
txt => { '\n' => "\n", '\r' => "\r" },
- tex => {
- '&' => '\&',
- '$' => '\$',
- '%' => '\%',
- '_' => '\_',
- '#' => '\#',
- quotemeta('^') => '\^\\',
- '{' => '\{',
- '}' => '\}',
- '<' => '$<$',
- '>' => '$>$',
- '\n' => '\newline ',
- '\r' => '\newline ',
- 'Â' => '\pounds ',
- quotemeta('\\') => '/'
- }
);
my $key;
Modified: branches/1.3/LedgerSMB/Template/LaTeX.pm
===================================================================
--- branches/1.3/LedgerSMB/Template/LaTeX.pm 2011-10-07 23:50:23 UTC (rev 3813)
+++ branches/1.3/LedgerSMB/Template/LaTeX.pm 2011-10-08 03:21:41 UTC (rev 3814)
@@ -102,7 +102,8 @@
$vars =~ s/â/--/g;
$vars =~ s/[ââ]/---/g;
$vars =~ s/"(.*)"/``$1''/gs;
- $vars =~ s/\n/\n\n/gm;
+ $vars =~ s/\n/\\\\/gm;
+ $vars =~ s/\\\\\\\\/\n\n/g;
}
return $vars;
}
Modified: branches/1.3/LedgerSMB/Template.pm
===================================================================
--- branches/1.3/LedgerSMB/Template.pm 2011-10-07 23:50:23 UTC (rev 3813)
+++ branches/1.3/LedgerSMB/Template.pm 2011-10-08 03:21:41 UTC (rev 3814)
@@ -259,7 +259,7 @@
} else {
$cleanvars = $format->can('preprocess')->($vars);
}
-
+ $cleanvars->{escape} = sub { return $format->escape(@_)};
if (UNIVERSAL::isa($self->{locale}, 'LedgerSMB::Locale')){
$cleanvars->{text} = sub { return $self->escape($self->{locale}->text(@_))};
}
Modified: branches/1.3/bin/arapprn.pl
===================================================================
--- branches/1.3/bin/arapprn.pl 2011-10-07 23:50:23 UTC (rev 3813)
+++ branches/1.3/bin/arapprn.pl 2011-10-08 03:21:41 UTC (rev 3814)
@@ -174,8 +174,6 @@
$form->{"projectnumber_$i"};
$form->{tempdescription} = $form->{"description_$i"};
- $form->format_string(
- qw(tempaccno tempaccount tempprojectnumber tempdescription));
push( @{ $form->{accno} }, $form->{tempaccno} );
push( @{ $form->{account} }, $form->{tempaccount} );
Modified: branches/1.3/templates/demo/invoice.tex
===================================================================
--- branches/1.3/templates/demo/invoice.tex 2011-10-07 23:50:23 UTC (rev 3813)
+++ branches/1.3/templates/demo/invoice.tex 2011-10-08 03:21:41 UTC (rev 3814)
@@ -14,13 +14,21 @@
\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+<?lsmb BLOCK multiline -?>
+\begin{minipage}{2in}
+\medskip
+\raggedright
+<?lsmb string ?>
+\end{minipage}
+<?lsmb- END -?>
+
\newsavebox{\ftr}
\sbox{\ftr}{
\parbox{\textwidth}{
\tiny
\rule[1.5em]{\textwidth}{0.5pt}
<?lsmb text('Payment due NET [_1] Days from date of Invoice.', terms) ?>
-<?lsmb text('Interest on overdue amounts will acrue at the rate of 12\% per annum starting from [_1] until paid in full. Items returned are subject to a 10\% restocking charge.', duedate) ?>
+<?lsmb text('Interest on overdue amounts will acrue at the rate of 12% per annum starting from [_1] until paid in full. Items returned are subject to a 10% restocking charge.', duedate) ?>
<?lsmb text('A return authorization must be obtained from [_1] before goods are returned. Returns must be shipped prepaid and properly insured. [_1] will not be responsible for damages during transit.', company) ?>
}
}
@@ -136,7 +144,7 @@
<?lsmb lc = loop.count - 1 ?>
<?lsmb runningnumber.${lc} ?> &
<?lsmb number.${lc} ?> &
- <?lsmb description.${lc} ?> &
+ <?lsmb INCLUDE multiline string = description.${lc} ?> &
<?lsmb deliverydate.${lc} ?> &
<?lsmb qty.${lc} ?> &
<?lsmb unit.${lc} ?> &
@@ -144,29 +152,31 @@
<?lsmb discountrate.${lc} ?> &
<?lsmb linetotal.${lc} ?> \\
<?lsmb END ?>
+\hline \hline
+\multicolumn{8}{r|}{<?lsmb text('Subtotal') ?>} & <?lsmb subtotal ?> \\*
+<?lsmb FOREACH tax ?>
+<?lsmb lc = loop.count - 1 ?>
+\multicolumn{8}{r|}{<?lsmb taxdescription.${lc}
+ ?> on <?lsmb taxbase.${lc} ?> }
+ & <?lsmb tax.${lc} ?> \\*
+<?lsmb END ?>
+<?lsmb IF paid ?>
+\multicolumn{8}{r|}{ <?lsmb text('Paid') ?> } & - <?lsmb paid ?> \\*
+<?lsmb END ?>
+<?lsmb IF total ?>
+ \hline
+ \hline
+\multicolumn{8}{r|}{<?lsmb text('Balance Due') ?>} & <?lsmb total ?>\\
+<?lsmb END ?>
+
\end{longtable}
\parbox{\textwidth}{
-\rule{\textwidth}{2pt}
\vspace{0.2cm}
\hfill
..hidden..@{}}
- & Subtotal & <?lsmb subtotal ?> \\
-<?lsmb FOREACH tax ?>
-<?lsmb lc = loop.count - 1 ?>
- & <?lsmb taxdescription.${lc} ?> on <?lsmb taxbase.${lc} ?> & <?lsmb tax.${lc} ?> \\
-<?lsmb END ?>
-<?lsmb IF paid ?>
- & <?lsmb text('Paid') ?> & - <?lsmb paid ?> \\
-<?lsmb END ?>
- \hline
-<?lsmb IF total ?>
- & <?lsmb text('Balance Due') ?> & <?lsmb total ?>
-<?lsmb END ?>
-\end{tabularx}
\vspace{0.3cm}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.