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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (+2 lines)
Lines 104-111 Link Here
104
                this.form.desc.value = this.options[this.selectedIndex].value;
104
                this.form.desc.value = this.options[this.selectedIndex].value;
105
                this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
105
                this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
106
            });
106
            });
107
            [% UNLESS amount.defined %]
107
            $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
108
            $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
108
            $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
109
            $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
110
            [% END %]
109
            $("#maninvoice #type").change(function(){
111
            $("#maninvoice #type").change(function(){
110
                $("#maninvoice #desc").val($(this).find("option:selected").text());
112
                $("#maninvoice #desc").val($(this).find("option:selected").text());
111
                $("#maninvoice #amount").val(type_fees[$(this).val()]);
113
                $("#maninvoice #amount").val(type_fees[$(this).val()]);
(-)a/members/maninvoice.pl (-5 / +7 lines)
Lines 109-114 if ($add) { Link Here
109
    # If barcode is passed, attempt to find the associated item
109
    # If barcode is passed, attempt to find the associated item
110
    my $failed;
110
    my $failed;
111
    my $item_id;
111
    my $item_id;
112
    my $olditem; # FIXME: When items and deleted_items are merged, we can remove this
112
    my $issue_id;
113
    my $issue_id;
113
    if ($barcode) {
114
    if ($barcode) {
114
        my $item = Koha::Items->find( { barcode => $barcode } );
115
        my $item = Koha::Items->find( { barcode => $barcode } );
Lines 116-124 if ($add) { Link Here
116
            $item_id = $item->itemnumber;
117
            $item_id = $item->itemnumber;
117
        }
118
        }
118
        else {
119
        else {
119
            $item = Koha::Old::Items->find( { barcode => $barcode } );
120
            $item = Koha::Old::Items->search( { barcode => $barcode },
120
            if ($item) {
121
                { order_by => { -desc => 'timestamp' }, rows => 1 } );
121
                $item_id = $item->itemnumber;
122
            if ($item->count) {
123
                $item_id = $item->next->itemnumber;
124
                $olditem = 1;
122
            }
125
            }
123
            else {
126
            else {
124
                $template->param( error => 'itemnumber' );
127
                $template->param( error => 'itemnumber' );
Lines 158-164 if ($add) { Link Here
158
                    interface   => 'intranet',
161
                    interface   => 'intranet',
159
                    library_id  => $library_id,
162
                    library_id  => $library_id,
160
                    type        => $debit_type,
163
                    type        => $debit_type,
161
                    item_id     => $item_id,
164
                    ( $olditem ? () : ( item_id => $item_id ) ),
162
                    issue_id    => $issue_id
165
                    issue_id    => $issue_id
163
                }
166
                }
164
            );
167
            );
165
- 

Return to bug 22393