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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (+27 lines)
Lines 2-12 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Registers %]
5
[% SET footerjs = 1 %]
6
[% SET footerjs = 1 %]
6
7
7
[% PROCESS 'accounts.inc' %]
8
[% PROCESS 'accounts.inc' %]
8
9
9
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
11
[% SET registers = Registers.all( { filters => { current_branch => 1 } } ) %]
10
<title>Create manual credit &rsaquo; Patrons &rsaquo; Koha</title>
12
<title>Create manual credit &rsaquo; Patrons &rsaquo; Koha</title>
11
[% INCLUDE 'doc-head-close.inc' %]
13
[% INCLUDE 'doc-head-close.inc' %]
12
</head>
14
</head>
Lines 69-74 Link Here
69
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
71
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
70
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
72
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
71
                            <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5.00</li>
73
                            <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5.00</li>
74
                            [% INCLUDE 'transaction_types.inc' %]
75
                            [% IF Koha.Preference('UseCashRegisters') %]
76
                            <li>
77
                                [% IF Koha.Preference('RequireCashRegister') %]
78
                                    <label for="cash_register" class="required">
79
                                [% ELSE %]
80
                                    <label for="cash_register">
81
                                [% END %]
82
                                    Cash register:
83
                                </label>
84
85
                                [% IF Koha.Preference('RequireCashRegister') %]
86
                                    <select name="cash_register" id="cash_register" required>
87
                                [% ELSE %]
88
                                    <select name="cash_register" id="cash_register">
89
                                [% END %]
90
                                    <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
91
                                    [% PROCESS options_for_registers %]
92
                                </select>
93
94
                                [% IF Koha.Preference('RequireCashRegister') %]
95
                                    <span class="required">Required</span>
96
                                [% END %]
97
                            </li>
98
                            [% END %]
72
                        </ol>
99
                        </ol>
73
                    </fieldset>
100
                    </fieldset>
74
101
(-)a/members/mancredit.pl (-13 / +16 lines)
Lines 85-105 if ($add) { Link Here
85
        my $item = Koha::Items->find( { barcode => $barcode } );
85
        my $item = Koha::Items->find( { barcode => $barcode } );
86
        $item_id = $item->itemnumber if $item;
86
        $item_id = $item->itemnumber if $item;
87
    }
87
    }
88
    my $description = $input->param('desc');
88
    my $description  = $input->param('desc');
89
    my $note        = $input->param('note');
89
    my $note         = $input->param('note');
90
    my $amount      = $input->param('amount') || 0;
90
    my $amount       = $input->param('amount') || 0;
91
    my $type        = $input->param('type');
91
    my $type         = $input->param('type');
92
    my $payment_type = $input->param('payment_type');
93
    my $cash_register_id = $input->param('cash_register');
92
94
93
    $patron->account->add_credit(
95
    $patron->account->add_credit(
94
        {
96
        {
95
            amount      => $amount,
97
            amount        => $amount,
96
            description => $description,
98
            description   => $description,
97
            item_id     => $item_id,
99
            item_id       => $item_id,
98
            library_id  => $library_id,
100
            library_id    => $library_id,
99
            note        => $note,
101
            note          => $note,
100
            type        => $type,
102
            type          => $type,
101
            user_id     => $logged_in_user->id,
103
            user_id       => $logged_in_user->id,
102
            interface   => C4::Context->interface
104
            interface     => C4::Context->interface,
105
            payment_type  => $payment_type,
106
            cash_register => $cash_register_id
103
        }
107
        }
104
    );
108
    );
105
109
106
- 

Return to bug 29987