Bug 22809: Move "INVOICE" from template to a slip
[koha.git] / installer / data / mysql / atomicupdate / bug_22809.perl
1 $DBversion = 'XXX'; # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3     $dbh->do(q{
4 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES
5 ('circulation', 'ACCOUNT_DEBIT', '', 'Account fee', 0, 'Account fee', '<table>
6   [% IF ( LibraryName ) %]
7     <tr>
8       <th colspan="5" class="centerednames">
9         <h3>[% LibraryName | html %]</h3>
10       </th>
11     </tr>
12   [% END %]
13
14   <tr>
15     <th colspan="5" class="centerednames">
16       <h2><u>INVOICE</u></h2>
17     </th>
18   </tr>
19   <tr>
20     <th colspan="5" class="centerednames">
21       <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
22     </th>
23   </tr>
24   <tr>
25     <th colspan="5" >
26       Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
27       Card number: [% patron.cardnumber | html %]<br />
28     </th>
29   </tr>
30   <tr>
31     <th>Date</th>
32     <th>Description of charges</th>
33     <th>Note</th>
34     <th style="text-align:right;">Amount</th>
35     <th style="text-align:right;">Amount outstanding</th>
36   </tr>
37
38   [% FOREACH account IN accounts %]
39     <tr class="highlight">
40       <td>[% account.date | $KohaDates%]</td>
41       <td>
42         [% PROCESS account_type_description account=account %]
43         [%- IF account.description %], [% account.description | html %][% END %]
44       </td>
45       <td>[% account.note | html %]</td>
46       [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
47       [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
48     </tr>
49   [% END %]
50
51   <tfoot>
52     <tr>
53       <td colspan="4">Total outstanding dues as on date: </td>
54       [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
55     </tr>
56   </tfoot>
57 </table>', 'print', 'default');
58     });
59     SetVersion( $DBversion );
60     print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
61 }