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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-1 lines)
Lines 185-191 Link Here
185
[% END %]
185
[% END %]
186
186
187
[% MACRO jsinclude BLOCK %]
187
[% MACRO jsinclude BLOCK %]
188
    [% Asset.js("js/admin-menu.js") | $raw %]
189
    [% INCLUDE 'format_price.inc' %]
188
    [% INCLUDE 'format_price.inc' %]
190
    [% INCLUDE 'datatables.inc' %]
189
    [% INCLUDE 'datatables.inc' %]
191
    [% Asset.js("lib/jquery/plugins/jquery.jeditable.mini.js") | $raw %]
190
    [% Asset.js("lib/jquery/plugins/jquery.jeditable.mini.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt (-15 / +27 lines)
Lines 9-14 Link Here
9
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
<title>Koha &rsaquo; Cashup</title>
10
<title>Koha &rsaquo; Cashup</title>
11
[% INCLUDE 'doc-head-close.inc' %]
11
[% INCLUDE 'doc-head-close.inc' %]
12
[% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
12
</head>
13
</head>
13
14
14
<body id="register" class="pos">
15
<body id="register" class="pos">
Lines 53-58 Link Here
53
                    <th>
54
                    <th>
54
                        Receipt ID
55
                        Receipt ID
55
                    </th>
56
                    </th>
57
                    <th>
58
                        Transaction
59
                    </th>
56
                    <th>
60
                    <th>
57
                        Description of charges
61
                        Description of charges
58
                    </th>
62
                    </th>
Lines 69-90 Link Here
69
                <tbody>
73
                <tbody>
70
                    [% FOREACH accountline IN accountlines %]
74
                    [% FOREACH accountline IN accountlines %]
71
                        [% IF accountline.is_credit %]
75
                        [% IF accountline.is_credit %]
72
                            <tr class="credit">
73
                                <td>[% accountline.accountlines_id %]</td>
74
                                <td>
75
                                    [%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])
76
                                </td>
77
                                <td></td>
78
                                <td>
79
                                    [% accountline.amount * -1 | $Price %]
80
                                </td>
81
                                <td>
82
                                    <button class="printReceipt" data-accountline="[%- accountline.accountlines_id | html -%]"><i class="fa fa-print"></i> Print receipt</button>
83
                                </td>
84
                            </tr>
85
                            [% FOREACH credit IN accountline.credit_offsets %]
76
                            [% FOREACH credit IN accountline.credit_offsets %]
86
                            <tr>
77
                            <tr>
87
                                <td>[% accountline.accountlines_id %]</td>
78
                                <td>[% accountline.accountlines_id %]</td>
79
                                <td>{ "type": "credit", "description": "[%- PROCESS account_type_description account=accountline -%] ([% accountline.payment_type | html %])", "amount": "[% accountline.amount * -1 | $Price %]" }</td>
88
                                <td>[%- PROCESS account_type_description account=credit.debit -%]</td>
80
                                <td>[%- PROCESS account_type_description account=credit.debit -%]</td>
89
                                <td>[% credit.debit.amount | $Price %]</td>
81
                                <td>[% credit.debit.amount | $Price %]</td>
90
                                <td></td>
82
                                <td></td>
Lines 96-102 Link Here
96
                </tbody>
88
                </tbody>
97
                <tfoot>
89
                <tfoot>
98
                    <tr>
90
                    <tr>
99
                        <td colspan="3">Total income: </td>
91
                        <td colspan="4">Total income: </td>
100
                        <td>[% accountlines.total * -1 | $Price %]</td>
92
                        <td>[% accountlines.total * -1 | $Price %]</td>
101
                        <td></td>
93
                        <td></td>
102
                    </tr>
94
                    </tr>
Lines 113-119 Link Here
113
    </div><!-- /.row -->
105
    </div><!-- /.row -->
114
106
115
[% MACRO jsinclude BLOCK %]
107
[% MACRO jsinclude BLOCK %]
108
    [% INCLUDE 'datatables.inc' %]
109
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
116
    <script>
110
    <script>
111
        var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, {
112
            orderFixed: [ 0, 'asc'],
113
            columnDefs: [ {
114
                targets: [ 0, 1 ],
115
                visible: false
116
            }],
117
            rowGroup: {
118
                dataSrc: 0,
119
                startRender: function ( rows, group ) {
120
                    var details = JSON.parse(rows.data().pluck(1).pop());
121
                    return $('<tr class="'+details.type+'"/>')
122
                        .append( '<td colspan="2">'+group+' '+details.description+'</td>' )
123
                        .append( '<td>'+details.amount+'</td>' )
124
                        .append( '<td><button class="printReceipt" data-accountline="'+group+'"><i class="fa fa-print"></i> Print receipt</button></td>');
125
                },
126
                endRender: null,
127
            }
128
        }));
129
117
        $(".printReceipt").click(function() {
130
        $(".printReceipt").click(function() {
118
            var accountlines_id = $(this).data('accountline');
131
            var accountlines_id = $(this).data('accountline');
119
            var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank');
132
            var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank');
120
- 

Return to bug 23355