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

(-)a/installer/data/mysql/atomicupdate/bug_31713.pl (+101 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "31713",
5
    description => "Add FEE_SUMMARY slip notice",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        my $slip_content = <<~'END_CONTENT';
11
[% USE Koha %]
12
[% USE Branches %]
13
[% USE Price %]
14
[% PROCESS 'accounts.inc' %]
15
<table>
16
  [% IF ( Koha.Preference('LibraryName') ) %]
17
    <tr>
18
      <th colspan='4' class='centerednames'>
19
        <h1>[% Koha.Preference('LibraryName') | html %]</h1>
20
      </th>
21
    </tr>
22
  [% END %]
23
24
  <tr>
25
    <th colspan='4' class='centerednames'>
26
      <h2>[% Branches.GetName( borrower.branchcode ) | html %]</h2>
27
    </th>
28
  </tr>
29
30
  <tr>
31
    <th colspan='4' class='centerednames'>
32
      <h3>Outstanding accounts</h3>
33
    </th>
34
  </tr>
35
36
  [% IF borrower.account.outstanding_debits.total_outstanding %]
37
  <tr>
38
    <th colspan='4' class='centerednames'>
39
      <h4>Debts</h4>
40
    </th>
41
  </tr>
42
  <tr>
43
    <th>Date</th>
44
    <th>Charge</th>
45
    <th>Amount</th>
46
    <th>Outstanding</th>
47
  </tr>
48
  [% FOREACH debit IN borrower.account.outstanding_debits %]
49
  <tr>
50
    <td>[% debit.date | $KohaDates %]</td>
51
    <td>
52
      [% PROCESS account_type_description account=debit %]
53
      [%- IF debit.description %], [% debit.description | html %][% END %]
54
    </td>
55
    <td class='debit'>[% debit.amount | $Price %]</td>
56
    <td class='debit'>[% debit.amountoutstanding | $Price %]</td>
57
  </tr>
58
  [% END %]
59
  [% END %]
60
61
  [% IF borrower.account.outstanding_credits.total_outstanding %]
62
  <tr>
63
    <th colspan='4' class='centerednames'>
64
      <h4>Credits</h4>
65
    </th>
66
  </tr>
67
  <tr>
68
    <th>Date</th>
69
    <th>Credit</th>
70
    <th>Amount</th>
71
    <th>Outstanding</th>
72
  </tr>
73
  [% FOREACH credit IN borrower.account.outstanding_credits %]
74
  <tr>
75
    <td>[% credit.date | $KohaDates %]</td>
76
    <td>
77
      [% PROCESS account_type_description account=credit %]
78
      [%- IF credit.description %], [% credit.description | html %][% END %]
79
    </td>
80
    <td class='credit'>[% credit.amount | $Price %]</td>
81
    <td class='credit'>[% credit.amountoutstanding | $Price %]</td>
82
  </tr>
83
  [% END %]
84
  [% END %]
85
86
  <tfoot>
87
    <tr>
88
      <td colspan='3'>Total outstanding dues as on date: </td>
89
      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>
90
    </tr>
91
  </tfoot>
92
</table>
93
END_CONTENT
94
95
        $dbh->do(qq{
96
           INSERT IGNORE INTO letter ( module, code, branchcode, name, is_html, title, content, message_transport_type, lang)
97
           VALUES ( 'members', 'FEE_SUMMARY', '', 'Fee Summary Slip', 1, 'Fee Summary for [% borrower.firstname %] [% borrower.surname %]', "$slip_content", 'print', 'default' )
98
        });
99
        say $out "Notice added";
100
    },
101
};
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-1 / +92 lines)
Lines 1283-1288 tables: Link Here
1283
            - "Your authentication token is [% otp_token %]."
1283
            - "Your authentication token is [% otp_token %]."
1284
            - "It is valid one minute."
1284
            - "It is valid one minute."
1285
1285
1286
        - module: members
1287
          code: FEE_SUMMARY
1288
          branchcode: ""
1289
          name: "Fee Summary Slip"
1290
          is_html: 1
1291
          title: "Fee Summary for [% borrower.firstname %] [% borrower.surname %]"
1292
          message_transport_type: print
1293
          lang: default
1294
          content:
1295
            - "[% USE Koha %]"
1296
            - "[% USE Branches %]"
1297
            - "[% USE Price %]"
1298
            - "[% PROCESS 'accounts.inc' %]"
1299
            - "<table>"
1300
            - "  [% IF ( Koha.Preference('LibraryName') ) %]"
1301
            - "    <tr>"
1302
            - "      <th colspan='4' class='centerednames'>"
1303
            - "        <h1>[% Koha.Preference('LibraryName') | html %]</h1>"
1304
            - "      </th>"
1305
            - "    </tr>"
1306
            - "  [% END %]"
1307
            - ""
1308
            - "  <tr>"
1309
            - "    <th colspan='4' class='centerednames'>"
1310
            - "      <h2>[% Branches.GetName( borrower.branchcode ) | html %]</h2>"
1311
            - "    </th>"
1312
            - "  </tr>"
1313
            - ""
1314
            - "  <tr>"
1315
            - "    <th colspan='4' class='centerednames'>"
1316
            - "      <h3>Outstanding accounts</h3>"
1317
            - "    </th>"
1318
            - "  </tr>"
1319
            - ""
1320
            - "  [% IF borrower.account.outstanding_debits.total_outstanding %]"
1321
            - "  <tr>"
1322
            - "    <th colspan='4' class='centerednames'>"
1323
            - "      <h4>Debts</h4>"
1324
            - "    </th>"
1325
            - "  </tr>"
1326
            - "  <tr>"
1327
            - "    <th>Date</th>"
1328
            - "    <th>Charge</th>"
1329
            - "    <th>Amount</th>"
1330
            - "    <th>Outstanding</th>"
1331
            - "  </tr>"
1332
            - "  [% FOREACH debit IN borrower.account.outstanding_debits %]"
1333
            - "  <tr>"
1334
            - "    <td>[% debit.date | $KohaDates %]</td>"
1335
            - "    <td>"
1336
            - "      [% PROCESS account_type_description account=debit %]"
1337
            - "      [%- IF debit.description %], [% debit.description | html %][% END %]"
1338
            - "    </td>"
1339
            - "    <td class='debit'>[% debit.amount | $Price %]</td>"
1340
            - "    <td class='debit'>[% debit.amountoutstanding | $Price %]</td>"
1341
            - "  </tr>"
1342
            - "  [% END %]"
1343
            - "  [% END %]"
1344
            - ""
1345
            - "  [% IF borrower.account.outstanding_credits.total_outstanding %]"
1346
            - "  <tr>"
1347
            - "    <th colspan='4' class='centerednames'>"
1348
            - "      <h4>Credits</h4>"
1349
            - "    </th>"
1350
            - "  </tr>"
1351
            - "  <tr>"
1352
            - "    <th>Date</th>"
1353
            - "    <th>Credit</th>"
1354
            - "    <th>Amount</th>"
1355
            - "    <th>Outstanding</th>"
1356
            - "  </tr>"
1357
            - "  [% FOREACH credit IN borrower.account.outstanding_credits %]"
1358
            - "  <tr>"
1359
            - "    <td>[% credit.date | $KohaDates%]</td>"
1360
            - "    <td>"
1361
            - "      [% PROCESS account_type_description account=credit %]"
1362
            - "      [%- IF credit.description %], [% credit.description | html %][% END %]"
1363
            - "    </td>"
1364
            - "    <td class='credit'>[% credit.amount | $Price %]</td>"
1365
            - "    <td class='credit'>[% credit.amountoutstanding | $Price %]</td>"
1366
            - "  </tr>"
1367
            - "  [% END %]"
1368
            - "  [% END %]"
1369
            - ""
1370
            - "  <tfoot>"
1371
            - "    <tr>"
1372
            - "      <td colspan='3'>Total outstanding dues as on date: </td>"
1373
            - "      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>"
1374
            - "    </tr>"
1375
            - "  </tfoot>"
1376
            - "</table>"
1377
1286
        - module: orderacquisition
1378
        - module: orderacquisition
1287
          code: ACQORDER
1379
          code: ACQORDER
1288
          branchcode: ""
1380
          branchcode: ""
1289
- 

Return to bug 31713