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 1207-1212 tables: Link Here
1207
            - "Your authentication token is [% otp_token %]."
1207
            - "Your authentication token is [% otp_token %]."
1208
            - "It is valid one minute."
1208
            - "It is valid one minute."
1209
1209
1210
        - module: members
1211
          code: FEE_SUMMARY
1212
          branchcode: ""
1213
          name: "Fee Summary Slip"
1214
          is_html: 1
1215
          title: "Fee Summary for [% borrower.firstname %] [% borrower.surname %]"
1216
          message_transport_type: print
1217
          lang: default
1218
          content:
1219
            - "[% USE Koha %]"
1220
            - "[% USE Branches %]"
1221
            - "[% USE Price %]"
1222
            - "[% PROCESS 'accounts.inc' %]"
1223
            - "<table>"
1224
            - "  [% IF ( Koha.Preference('LibraryName') ) %]"
1225
            - "    <tr>"
1226
            - "      <th colspan='4' class='centerednames'>"
1227
            - "        <h1>[% Koha.Preference('LibraryName') | html %]</h1>"
1228
            - "      </th>"
1229
            - "    </tr>"
1230
            - "  [% END %]"
1231
            - ""
1232
            - "  <tr>"
1233
            - "    <th colspan='4' class='centerednames'>"
1234
            - "      <h2>[% Branches.GetName( borrower.branchcode ) | html %]</h2>"
1235
            - "    </th>"
1236
            - "  </tr>"
1237
            - ""
1238
            - "  <tr>"
1239
            - "    <th colspan='4' class='centerednames'>"
1240
            - "      <h3>Outstanding accounts</h3>"
1241
            - "    </th>"
1242
            - "  </tr>"
1243
            - ""
1244
            - "  [% IF borrower.account.outstanding_debits.total_outstanding %]"
1245
            - "  <tr>"
1246
            - "    <th colspan='4' class='centerednames'>"
1247
            - "      <h4>Debts</h4>"
1248
            - "    </th>"
1249
            - "  </tr>"
1250
            - "  <tr>"
1251
            - "    <th>Date</th>"
1252
            - "    <th>Charge</th>"
1253
            - "    <th>Amount</th>"
1254
            - "    <th>Outstanding</th>"
1255
            - "  </tr>"
1256
            - "  [% FOREACH debit IN borrower.account.outstanding_debits %]"
1257
            - "  <tr>"
1258
            - "    <td>[% debit.date | $KohaDates %]</td>"
1259
            - "    <td>"
1260
            - "      [% PROCESS account_type_description account=debit %]"
1261
            - "      [%- IF debit.description %], [% debit.description | html %][% END %]"
1262
            - "    </td>"
1263
            - "    <td class='debit'>[% debit.amount | $Price %]</td>"
1264
            - "    <td class='debit'>[% debit.amountoutstanding | $Price %]</td>"
1265
            - "  </tr>"
1266
            - "  [% END %]"
1267
            - "  [% END %]"
1268
            - ""
1269
            - "  [% IF borrower.account.outstanding_credits.total_outstanding %]"
1270
            - "  <tr>"
1271
            - "    <th colspan='4' class='centerednames'>"
1272
            - "      <h4>Credits</h4>"
1273
            - "    </th>"
1274
            - "  </tr>"
1275
            - "  <tr>"
1276
            - "    <th>Date</th>"
1277
            - "    <th>Credit</th>"
1278
            - "    <th>Amount</th>"
1279
            - "    <th>Outstanding</th>"
1280
            - "  </tr>"
1281
            - "  [% FOREACH credit IN borrower.account.outstanding_credits %]"
1282
            - "  <tr>"
1283
            - "    <td>[% credit.date | $KohaDates%]</td>"
1284
            - "    <td>"
1285
            - "      [% PROCESS account_type_description account=credit %]"
1286
            - "      [%- IF credit.description %], [% credit.description | html %][% END %]"
1287
            - "    </td>"
1288
            - "    <td class='credit'>[% credit.amount | $Price %]</td>"
1289
            - "    <td class='credit'>[% credit.amountoutstanding | $Price %]</td>"
1290
            - "  </tr>"
1291
            - "  [% END %]"
1292
            - "  [% END %]"
1293
            - ""
1294
            - "  <tfoot>"
1295
            - "    <tr>"
1296
            - "      <td colspan='3'>Total outstanding dues as on date: </td>"
1297
            - "      [% IF ( borrower.account.balance <= 0 ) %]<td class='credit'>[% ELSE %]<td class='debit'>[% END %][% borrower.account.balance | $Price %]</td>"
1298
            - "    </tr>"
1299
            - "  </tfoot>"
1300
            - "</table>"
1301
1210
        - module: orderacquisition
1302
        - module: orderacquisition
1211
          code: ACQORDER
1303
          code: ACQORDER
1212
          branchcode: ""
1304
          branchcode: ""
1213
- 

Return to bug 31713