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

(-)a/installer/data/mysql/atomicupdate/bug_37671.pl (+105 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "37671",
6
    description => "Add PAYOUT notice template for POS refund receipts",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        # Add new PAYOUT letter template for POS
12
        $dbh->do(
13
            q{
14
            INSERT INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type, lang, updated_on)
15
            VALUES (
16
                'pos', 'PAYOUT', '', 'Point of sale payout receipt', 1, 'Payout receipt',
17
                '[% USE KohaDates %]
18
[% USE Branches %]
19
[% USE Price %]
20
[% USE AuthorisedValues %]
21
[% PROCESS "accounts.inc" %]
22
<table>
23
[% IF ( LibraryName ) %]
24
 <tr>
25
    <th colspan="2" class="centerednames">
26
        <h3>[% LibraryName | html %]</h3>
27
    </th>
28
 </tr>
29
[% END %]
30
 <tr>
31
    <th colspan="2" class="centerednames">
32
        <h2>[% Branches.GetName( debit.branchcode ) | html %]</h2>
33
    </th>
34
 </tr>
35
<tr>
36
    <th colspan="2" class="centerednames">
37
        <h3>[% debit.date | $KohaDates %]</h3>
38
</tr>
39
<tr>
40
  <td>Transaction ID: </td>
41
  <td>[% debit.accountlines_id %]</td>
42
</tr>
43
<tr>
44
  <td>Operator ID: </td>
45
  <td>[% debit.manager_id %]</td>
46
</tr>
47
<tr>
48
  <td>Payout type: </td>
49
  <td>[% AuthorisedValues.GetByCode( "PAYMENT_TYPE", debit.payment_type ) | html %]</td>
50
</tr>
51
 <tr></tr>
52
 <tr>
53
    <th colspan="2" class="centerednames">
54
        <h2><u>Refund Payout Receipt</u></h2>
55
    </th>
56
 </tr>
57
 <tr></tr>
58
 [% IF debit.patron %]
59
 <tr>
60
    <th colspan="2">
61
        Paid to: [% debit.patron.firstname | html %] [% debit.patron.surname | html %]<br>
62
        Card number: [% debit.patron.cardnumber | html %]
63
    </th>
64
 </tr>
65
 <tr></tr>
66
 [% END %]
67
 <tr>
68
    <th colspan="2">Refund details</th>
69
  </tr>
70
  <tr>
71
    <th>Item / Original charge</th>
72
    <th>Refund amount</th>
73
  </tr>
74
75
  [% FOREACH credit IN debit.credits %]
76
    [% FOREACH offset IN credit.credit_offsets %]
77
      [% IF offset.debit && offset.debit.debit_type_code != 'PAYOUT' %]
78
        <tr>
79
            <td>
80
                [% PROCESS account_type_description account=offset.debit %]
81
                [% IF offset.debit.description %] - [% offset.debit.description | html %][% END %]
82
                [% IF offset.debit.itemnumber %]<br><i>[% offset.debit.item.biblio.title | html %]</i>[% END %]
83
                <br>Original charge: [% offset.debit.amount | $Price %]
84
            </td>
85
            <td>[% credit.amount * -1 | $Price %]</td>
86
        </tr>
87
      [% END %]
88
    [% END %]
89
  [% END %]
90
91
<tfoot>
92
  <tr class="highlight">
93
    <td>Total payout: </td>
94
    <td>[% debit.amount | $Price %]</td>
95
  </tr>
96
</tfoot>
97
</table>',
98
                'print', 'default', NOW()
99
            )
100
        }
101
        );
102
103
        say_success( $out, "Added new PAYOUT letter template for POS refunds" );
104
    },
105
};
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-2 / +93 lines)
Lines 1808-1813 tables: Link Here
1808
            - "[% USE KohaDates %]"
1808
            - "[% USE KohaDates %]"
1809
            - "[% USE Branches %]"
1809
            - "[% USE Branches %]"
1810
            - "[% USE Price %]"
1810
            - "[% USE Price %]"
1811
            - "[% USE AuthorisedValues %]"
1811
            - "[% PROCESS \"accounts.inc\" %]"
1812
            - "[% PROCESS \"accounts.inc\" %]"
1812
            - "<table>"
1813
            - "<table>"
1813
            - "[% IF ( LibraryName ) %]"
1814
            - "[% IF ( LibraryName ) %]"
Lines 1836-1842 tables: Link Here
1836
            - "</tr>"
1837
            - "</tr>"
1837
            - "<tr>"
1838
            - "<tr>"
1838
            - "  <td>Payment type: </td>"
1839
            - "  <td>Payment type: </td>"
1839
            - "  <td>[% credit.payment_type %]</td>"
1840
            - "  <td>[% AuthorisedValues.GetByCode( 'PAYMENT_TYPE', credit.payment_type ) | html %]</td>"
1840
            - "</tr>"
1841
            - "</tr>"
1841
            - " <tr></tr>"
1842
            - " <tr></tr>"
1842
            - " <tr>"
1843
            - " <tr>"
Lines 1949-1954 tables: Link Here
1949
            - "  </tfoot>"
1950
            - "  </tfoot>"
1950
            - "</table>"
1951
            - "</table>"
1951
1952
1953
        - module: pos
1954
          code: PAYOUT
1955
          branchcode: ""
1956
          name: "Point of sale payout receipt"
1957
          is_html: 1
1958
          title: "Payout receipt"
1959
          message_transport_type: print
1960
          lang: default
1961
          content:
1962
            - "[% USE KohaDates %]"
1963
            - "[% USE Branches %]"
1964
            - "[% USE Price %]"
1965
            - "[% USE AuthorisedValues %]"
1966
            - "[% PROCESS \"accounts.inc\" %]"
1967
            - "<table>"
1968
            - "[% IF ( LibraryName ) %]"
1969
            - " <tr>"
1970
            - "    <th colspan=\"2\" class=\"centerednames\">"
1971
            - "        <h3>[% LibraryName | html %]</h3>"
1972
            - "    </th>"
1973
            - " </tr>"
1974
            - "[% END %]"
1975
            - " <tr>"
1976
            - "    <th colspan=\"2\" class=\"centerednames\">"
1977
            - "        <h2>[% Branches.GetName( debit.branchcode ) | html %]</h2>"
1978
            - "    </th>"
1979
            - " </tr>"
1980
            - "<tr>"
1981
            - "    <th colspan=\"2\" class=\"centerednames\">"
1982
            - "        <h3>[% debit.date | $KohaDates %]</h3>"
1983
            - "</tr>"
1984
            - "<tr>"
1985
            - "  <td>Transaction ID: </td>"
1986
            - "  <td>[% debit.accountlines_id %]</td>"
1987
            - "</tr>"
1988
            - "<tr>"
1989
            - "  <td>Operator ID: </td>"
1990
            - "  <td>[% debit.manager_id %]</td>"
1991
            - "</tr>"
1992
            - "<tr>"
1993
            - "  <td>Payout type: </td>"
1994
            - "  <td>[% AuthorisedValues.GetByCode( \"PAYMENT_TYPE\", debit.payment_type ) | html %]</td>"
1995
            - "</tr>"
1996
            - " <tr></tr>"
1997
            - " <tr>"
1998
            - "    <th colspan=\"2\" class=\"centerednames\">"
1999
            - "        <h2><u>Refund Payout Receipt</u></h2>"
2000
            - "    </th>"
2001
            - " </tr>"
2002
            - " <tr></tr>"
2003
            - " [% IF debit.patron %]"
2004
            - " <tr>"
2005
            - "    <th colspan=\"2\">"
2006
            - "        Paid to: [% debit.patron.firstname | html %] [% debit.patron.surname | html %]<br>"
2007
            - "        Card number: [% debit.patron.cardnumber | html %]"
2008
            - "    </th>"
2009
            - " </tr>"
2010
            - " <tr></tr>"
2011
            - " [% END %]"
2012
            - " <tr>"
2013
            - "    <th colspan=\"2\">Refund details</th>"
2014
            - "  </tr>"
2015
            - "  <tr>"
2016
            - "    <th>Item / Original charge</th>"
2017
            - "    <th>Refund amount</th>"
2018
            - "  </tr>"
2019
            - ""
2020
            - "  [% FOREACH credit IN debit.credits %]"
2021
            - "    [% FOREACH offset IN credit.credit_offsets %]"
2022
            - "      [% IF offset.debit && offset.debit.debit_type_code != 'PAYOUT' %]"
2023
            - "        <tr>"
2024
            - "            <td>"
2025
            - "                [% PROCESS account_type_description account=offset.debit %]"
2026
            - "                [% IF offset.debit.description %] - [% offset.debit.description | html %][% END %]"
2027
            - "                [% IF offset.debit.itemnumber %]<br><i>[% offset.debit.item.biblio.title | html %]</i>[% END %]"
2028
            - "                <br>Original charge: [% offset.debit.amount | $Price %]"
2029
            - "            </td>"
2030
            - "            <td>[% credit.amount * -1 | $Price %]</td>"
2031
            - "        </tr>"
2032
            - "      [% END %]"
2033
            - "    [% END %]"
2034
            - "  [% END %]"
2035
            - ""
2036
            - "<tfoot>"
2037
            - "  <tr class=\"highlight\">"
2038
            - "    <td>Total payout: </td>"
2039
            - "    <td>[% debit.amount | $Price %]</td>"
2040
            - "  </tr>"
2041
            - "</tfoot>"
2042
            - "</table>"
2043
1952
        - module: reserves
2044
        - module: reserves
1953
          code: CANCEL_HOLD_ON_LOST
2045
          code: CANCEL_HOLD_ON_LOST
1954
          branchcode: ""
2046
          branchcode: ""
1955
- 

Return to bug 37671