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 71-76 Link Here
71
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
73
                            <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
72
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
74
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></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>
75
                            <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>
76
                            [% INCLUDE 'transaction_types.inc' %]
77
                            [% IF Koha.Preference('UseCashRegisters') %]
78
                            <li>
79
                                [% IF Koha.Preference('RequireCashRegister') %]
80
                                    <label for="cash_register" class="required">
81
                                [% ELSE %]
82
                                    <label for="cash_register">
83
                                [% END %]
84
                                    Cash register:
85
                                </label>
86
87
                                [% IF Koha.Preference('RequireCashRegister') %]
88
                                    <select name="cash_register" id="cash_register" required>
89
                                [% ELSE %]
90
                                    <select name="cash_register" id="cash_register">
91
                                [% END %]
92
                                    <option id="noregister" disabled selected="selected" value="">-- Select an option--</option>
93
                                    [% PROCESS options_for_registers %]
94
                                </select>
95
96
                                [% IF Koha.Preference('RequireCashRegister') %]
97
                                    <span class="required">Required</span>
98
                                [% END %]
99
                            </li>
100
                            [% END %]
74
                        </ol>
101
                        </ol>
75
                    </fieldset>
102
                    </fieldset>
76
103
(-)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