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

(-)a/installer/data/mysql/atomicupdate/bug_37671.pl (+92 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
 <tr>
59
    <th>Refund details</th>
60
    <th>Amount</th>
61
  </tr>
62
63
  [% FOREACH credit IN debit.credits %]
64
    <tr>
65
        <td>[% PROCESS account_type_description account=credit %]</td>
66
        <td>[% credit.amount * -1 | $Price %]</td>
67
    </tr>
68
    [% FOREACH offset IN credit.debit_offsets %]
69
      [% IF offset.debit %]
70
        <tr>
71
            <td>&nbsp;&nbsp;Refund for: [% PROCESS account_type_description account=offset.debit %] [% IF offset.debit.description %]([% offset.debit.description | html %])[% END %] [% IF offset.debit.itemnumber %]([% offset.debit.item.biblio.title | html %])[% END %]</td>
72
            <td>[% offset.amount | $Price %]</td>
73
        </tr>
74
      [% END %]
75
    [% END %]
76
  [% END %]
77
78
<tfoot>
79
  <tr class="highlight">
80
    <td>Total payout: </td>
81
    <td>[% debit.amount | $Price %]</td>
82
  </tr>
83
</tfoot>
84
</table>',
85
                'print', 'default', NOW()
86
            )
87
        }
88
        );
89
90
        say_success( $out, "Added new PAYOUT letter template for POS refunds" );
91
    },
92
};
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-2 / +80 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
            - " <tr>"
2004
            - "    <th>Refund details</th>"
2005
            - "    <th>Amount</th>"
2006
            - "  </tr>"
2007
            - ""
2008
            - "  [% FOREACH credit IN debit.credits %]"
2009
            - "    <tr>"
2010
            - "        <td>[% PROCESS account_type_description account=credit %]</td>"
2011
            - "        <td>[% credit.amount * -1 | $Price %]</td>"
2012
            - "    </tr>"
2013
            - "    [% FOREACH offset IN credit.debit_offsets %]"
2014
            - "      [% IF offset.debit %]"
2015
            - "        <tr>"
2016
            - "            <td>&nbsp;&nbsp;Refund for: [% PROCESS account_type_description account=offset.debit %] [% IF offset.debit.description %]([% offset.debit.description | html %])[% END %] [% IF offset.debit.itemnumber %]([% offset.debit.item.biblio.title | html %])[% END %]</td>"
2017
            - "            <td>[% offset.amount | $Price %]</td>"
2018
            - "        </tr>"
2019
            - "      [% END %]"
2020
            - "    [% END %]"
2021
            - "  [% END %]"
2022
            - ""
2023
            - "<tfoot>"
2024
            - '  <tr class="highlight">'
2025
            - "    <td>Total payout: </td>"
2026
            - "    <td>[% debit.amount | $Price %]</td>"
2027
            - "  </tr>"
2028
            - "</tfoot>"
2029
            - "</table>"
2030
1952
        - module: reserves
2031
        - module: reserves
1953
          code: CANCEL_HOLD_ON_LOST
2032
          code: CANCEL_HOLD_ON_LOST
1954
          branchcode: ""
2033
          branchcode: ""
1955
- 

Return to bug 37671