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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt (-1 / +19 lines)
Lines 25-33 Link Here
25
                        can record payments.
25
                        can record payments.
26
                    </div>
26
                    </div>
27
                    [% ELSE %]
27
                    [% ELSE %]
28
29
                    [% IF ( error_cashup_permission ) %]
30
                    <div id="error_message" class="dialog alert">
31
                        You do not have permission to perform cashup actions.
32
                    </div>
33
                    [% END %]
34
35
                    [% IF CAN_user_cash_management_cashup %]
28
                    <div id="toolbar" class="btn-toolbar">
36
                    <div id="toolbar" class="btn-toolbar">
29
                        <button type="button" class="cashup_all btn btn-default" data-toggle="modal" data-target="#confirmCashupAllModal"><i class="fa fa-money"></i> Cashup all</button>
37
                        <button type="button" class="cashup_all btn btn-default" data-toggle="modal" data-target="#confirmCashupAllModal"><i class="fa fa-money"></i> Cashup all</button>
30
                    </div>
38
                    </div>
39
                    [% END %]
31
40
32
                    <h1>Library transaction details for [% library.branchname | html %]</h1>
41
                    <h1>Library transaction details for [% library.branchname | html %]</h1>
33
42
Lines 47-53 Link Here
47
                            <th>Bankable</th>
56
                            <th>Bankable</th>
48
                            <th>Income (cash)</th>
57
                            <th>Income (cash)</th>
49
                            <th>Outgoing (cash)</th>
58
                            <th>Outgoing (cash)</th>
59
                            [% IF CAN_user_cash_management_cashup %]
50
                            <th>Actions</th>
60
                            <th>Actions</th>
61
                            [% END %]
51
                        </thead>
62
                        </thead>
52
                        <tbody>
63
                        <tbody>
53
                            [% SET bankable = 0, ctotal = 0, dtotal = 0, cctotal = 0, cdtotal = 0 %]
64
                            [% SET bankable = 0, ctotal = 0, dtotal = 0, cctotal = 0, cdtotal = 0 %]
Lines 81-89 Link Here
81
                                    [% rdtotal | $Price %] ([% rcdtotal | $Price %])
92
                                    [% rdtotal | $Price %] ([% rcdtotal | $Price %])
82
                                    [% SET dtotal = dtotal + rdtotal %]
93
                                    [% SET dtotal = dtotal + rdtotal %]
83
                                    [% SET cdtotal = cdtotal + rcdtotal %]
94
                                    [% SET cdtotal = cdtotal + rcdtotal %]
95
                                </td>
96
                                [% IF CAN_user_cash_management_cashup %]
84
                                <td>
97
                                <td>
85
                                    <button type="button" class="cashup_individual btn btn-default" data-toggle="modal" data-target="#confirmCashupModal" data-register="[% register.description | html %]" data-bankable="[% rbankable | $Price %]" data-float="[% register.starting_float | $Price %]" data-registerid="[% register.id | html %]"><i class="fa fa-money"></i> Record cashup</button>
98
                                    <button type="button" class="cashup_individual btn btn-default" data-toggle="modal" data-target="#confirmCashupModal" data-register="[% register.description | html %]" data-bankable="[% rbankable | $Price %]" data-float="[% register.starting_float | $Price %]" data-registerid="[% register.id | html %]"><i class="fa fa-money"></i> Record cashup</button>
86
                                </td>
99
                                </td>
100
                                [% END %]
87
                            </tr>
101
                            </tr>
88
                            [% END %]
102
                            [% END %]
89
                        </tbody>
103
                        </tbody>
Lines 93-99 Link Here
93
                                <td>[% bankable | $Price %]</td>
107
                                <td>[% bankable | $Price %]</td>
94
                                <td>[% ctotal | $Price %] ([% cctotal | $Price %])</td>
108
                                <td>[% ctotal | $Price %] ([% cctotal | $Price %])</td>
95
                                <td>[% dtotal | $Price %] ([% cdtotal | $Price %])</td>
109
                                <td>[% dtotal | $Price %] ([% cdtotal | $Price %])</td>
96
                                <td><button type="button" class="cashup_all btn btn-default" data-toggle="modal" data-target="#confirmCashupAllModal"><i class="fa fa-money"></i> Cashup all</button></td>
110
                                [% IF CAN_user_cash_management_cashup %]
111
                                <td>
112
                                    <button type="button" class="cashup_all btn btn-default" data-toggle="modal" data-target="#confirmCashupAllModal"><i class="fa fa-money"></i> Cashup all</button>
113
                                </td>
114
                                [% END %]
97
                            </tr>
115
                            </tr>
98
                        </tfoot>
116
                        </tfoot>
99
                    </table>
117
                    </table>
(-)a/pos/registers.pl (-13 / +17 lines)
Lines 55-72 else { Link Here
55
55
56
my $op = $input->param('op') // '';
56
my $op = $input->param('op') // '';
57
if ( $op eq 'cashup' ) {
57
if ( $op eq 'cashup' ) {
58
    my $registerid = $input->param('registerid');
58
    if ( $logged_in_user->has_permission( { cash_management => 'cashup' } ) ) {
59
    if ($registerid) {
59
        my $registerid = $input->param('registerid');
60
        my $register = Koha::Cash::Registers->find( { id => $registerid } );
60
        if ($registerid) {
61
        $register->add_cashup(
61
            my $register = Koha::Cash::Registers->find( { id => $registerid } );
62
            {
63
                manager_id => $logged_in_user->id,
64
                amount     => $register->outstanding_accountlines->total
65
            }
66
        );
67
    }
68
    else {
69
        for my $register ( $registers->as_list ) {
70
            $register->add_cashup(
62
            $register->add_cashup(
71
                {
63
                {
72
                    manager_id => $logged_in_user->id,
64
                    manager_id => $logged_in_user->id,
Lines 74-79 if ( $op eq 'cashup' ) { Link Here
74
                }
66
                }
75
            );
67
            );
76
        }
68
        }
69
        else {
70
            for my $register ( $registers->as_list ) {
71
                $register->add_cashup(
72
                    {
73
                        manager_id => $logged_in_user->id,
74
                        amount     => $register->outstanding_accountlines->total
75
                    }
76
                );
77
            }
78
        }
79
    }
80
    else {
81
        $template->param( error_cashup_permission => 1 );
77
    }
82
    }
78
}
83
}
79
84
80
- 

Return to bug 26023