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 74-79 Link Here
74
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
76
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
75
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
77
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
76
                            <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>
78
                            <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>
79
                            [% INCLUDE 'transaction_types.inc' %]
80
                            [% IF Koha.Preference('UseCashRegisters') %]
81
                            <li>
82
                                [% IF Koha.Preference('RequireCashRegister') %]
83
                                    <label for="cash_register" class="required">
84
                                [% ELSE %]
85
                                    <label for="cash_register">
86
                                [% END %]
87
                                    Cash register:
88
                                </label>
89
90
                                [% IF Koha.Preference('RequireCashRegister') %]
91
                                    <select name="cash_register" id="cash_register" required>
92
                                [% ELSE %]
93
                                    <select name="cash_register" id="cash_register">
94
                                [% END %]
95
                                    <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
96
                                    [% PROCESS options_for_registers %]
97
                                </select>
98
99
                                [% IF Koha.Preference('RequireCashRegister') %]
100
                                    <span class="required">Required</span>
101
                                [% END %]
102
                            </li>
103
                            [% END %]
77
                        </ol>
104
                        </ol>
78
                    </fieldset>
105
                    </fieldset>
79
106
(-)a/members/mancredit.pl (-13 / +16 lines)
Lines 86-106 if ($add) { Link Here
86
        my $item = Koha::Items->find( { barcode => $barcode } );
86
        my $item = Koha::Items->find( { barcode => $barcode } );
87
        $item_id = $item->itemnumber if $item;
87
        $item_id = $item->itemnumber if $item;
88
    }
88
    }
89
    my $description = $input->param('desc');
89
    my $description  = $input->param('desc');
90
    my $note        = $input->param('note');
90
    my $note         = $input->param('note');
91
    my $amount      = $input->param('amount') || 0;
91
    my $amount       = $input->param('amount') || 0;
92
    my $type        = $input->param('type');
92
    my $type         = $input->param('type');
93
    my $payment_type = $input->param('payment_type');
94
    my $cash_register_id = $input->param('cash_register');
93
95
94
    my $line = $patron->account->add_credit(
96
    my $line = $patron->account->add_credit(
95
        {
97
        {
96
            amount      => $amount,
98
            amount        => $amount,
97
            description => $description,
99
            description   => $description,
98
            item_id     => $item_id,
100
            item_id       => $item_id,
99
            library_id  => $library_id,
101
            library_id    => $library_id,
100
            note        => $note,
102
            note          => $note,
101
            type        => $type,
103
            type          => $type,
102
            user_id     => $logged_in_user->id,
104
            user_id       => $logged_in_user->id,
103
            interface   => C4::Context->interface
105
            interface     => C4::Context->interface,
106
            payment_type  => $payment_type,
107
            cash_register => $cash_register_id
104
        }
108
        }
105
    );
109
    );
106
110
107
- 

Return to bug 29987