View | Details | Raw Unified | Return to bug 22809
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_22809.perl (+61 lines)
Line 0 Link Here
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
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+55 lines)
Lines 233-237 INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title` Link Here
233
</tfoot>
233
</tfoot>
234
</table>', 'print', 'default');
234
</table>', 'print', 'default');
235
235
236
INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES
237
('circulation', 'ACCOUNT_DEBIT', '', 'Account fee', 0, 'Account fee', '<table>
238
  [% IF ( LibraryName ) %]
239
    <tr>
240
      <th colspan="5" class="centerednames">
241
        <h3>[% LibraryName | html %]</h3>
242
      </th>
243
    </tr>
244
  [% END %]
245
246
  <tr>
247
    <th colspan="5" class="centerednames">
248
      <h2><u>INVOICE</u></h2>
249
    </th>
250
  </tr>
251
  <tr>
252
    <th colspan="5" class="centerednames">
253
      <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
254
    </th>
255
  </tr>
256
  <tr>
257
    <th colspan="5" >
258
      Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
259
      Card number: [% patron.cardnumber | html %]<br />
260
    </th>
261
  </tr>
262
  <tr>
263
    <th>Date</th>
264
    <th>Description of charges</th>
265
    <th>Note</th>
266
    <th style="text-align:right;">Amount</th>
267
    <th style="text-align:right;">Amount outstanding</th>
268
  </tr>
269
270
  [% FOREACH account IN accounts %]
271
    <tr class="highlight">
272
      <td>[% account.date | $KohaDates%]</td>
273
      <td>
274
        [% PROCESS account_type_description account=account %]
275
        [%- IF account.description %], [% account.description | html %][% END %]
276
      </td>
277
      <td>[% account.note | html %]</td>
278
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
279
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
280
    </tr>
281
  [% END %]
282
283
  <tfoot>
284
    <tr>
285
      <td colspan="4">Total outstanding dues as on date: </td>
286
      [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
287
    </tr>
288
  </tfoot>
289
</table>', 'print', 'default');
290
236
INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
291
INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES
237
('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email');
292
('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt (-53 / +1 lines)
Lines 17-75 Link Here
17
<body id="printinvoice" class="pat">
17
<body id="printinvoice" class="pat">
18
18
19
<div id="receipt">
19
<div id="receipt">
20
<!-- The table with the account items -->
20
    [% letter.content | evaltt %]
21
<table>
22
[% IF ( LibraryName ) %]
23
  <tr>
24
    <th colspan="5" class="centerednames">
25
		<h3>[% LibraryName | html %]</h3>
26
	</th>
27
  </tr>
28
[% END %]
29
  <tr>
30
    <th colspan="5" class="centerednames">
31
		<h2><u>INVOICE</u></h2>
32
	</th>
33
  </tr>
34
  <tr>
35
    <th colspan="5" class="centerednames">
36
        <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2>
37
	</th>
38
  </tr>
39
  <tr>
40
    <th colspan="5" >
41
        Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br />
42
        Card number: [% patron.cardnumber | html %]<br />
43
	</th>
44
  </tr>
45
  <tr>
46
	<th>Date</th>
47
    <th>Description of charges</th>
48
    <th>Note</th>
49
    <th style="text-align:right;">Amount</th>
50
    <th style="text-align:right;">Amount outstanding</th>
51
 </tr>
52
53
  [% FOREACH account IN accounts %]
54
<tr class="highlight">
55
      <td>[% account.date | $KohaDates%]</td>
56
       <td>
57
        [% PROCESS account_type_description account=account %]
58
        [%- IF account.description %], [% account.description | html %][% END %]
59
      </td>
60
      <td>[% account.note | html %]</td>
61
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td>
62
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td>
63
    </tr>
64
65
  [% END %]
66
<tfoot>
67
  <tr>
68
    <td colspan="4">Total outstanding dues as on date: </td>
69
    [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td>
70
  </tr>
71
  </tfoot>
72
</table>
73
</div>
21
</div>
74
22
75
[% MACRO jsinclude BLOCK %]
23
[% MACRO jsinclude BLOCK %]
(-)a/members/printinvoice.pl (-7 / +16 lines)
Lines 55-61 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log Link Here
55
55
56
#get account details
56
#get account details
57
my $total = $patron->account->balance;
57
my $total = $patron->account->balance;
58
my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed;
58
my $accountline_object = Koha::Account::Lines->find($accountlines_id);
59
my $accountline = $accountline_object->unblessed;
59
60
60
my $totalcredit;
61
my $totalcredit;
61
if ( $total <= 0 ) {
62
if ( $total <= 0 ) {
Lines 85-96 my %row = ( Link Here
85
    'note'      => $accountline->{'note'},
86
    'note'      => $accountline->{'note'},
86
);
87
);
87
88
89
my @account_offsets = Koha::Account::Offsets->search( { debit_id => $accountline_object->id } );
90
91
my $letter = C4::Letters::getletter( 'circulation', 'ACCOUNT_DEBIT', C4::Context::mybranch, 'print', $patron->lang );
92
88
$template->param(
93
$template->param(
89
    patron         => $patron,
94
    letter  => $letter,
90
    finesview      => 1,
95
    patron  => $patron,
91
    total          => sprintf( "%.2f", $total ),
96
    library => C4::Context::mybranch,
92
    totalcredit    => $totalcredit,
97
    offsets => \@account_offsets,
93
    accounts       => [$accountline], # FIXME There is always only 1 row!
98
    debit   => $accountline_object,
99
100
    finesview   => 1,
101
    total       => sprintf( "%.2f", $total ),
102
    totalcredit => $totalcredit,
103
    accounts    => [$accountline],           # FIXME There is always only 1 row!
94
);
104
);
95
105
96
output_html_with_http_headers $input, $cookie, $template->output;
106
output_html_with_http_headers $input, $cookie, $template->output;
97
- 

Return to bug 22809