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

(-)a/acqui/addorder.pl (+5 lines)
Lines 299-304 if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { Link Here
299
        $order->store;
299
        $order->store;
300
    }
300
    }
301
301
302
    my @items   = $input->multi_param('itemnumber');
303
    foreach my $item ( @items ) {
304
        $order->add_item($item);
305
    }
306
302
    # now, add items if applicable
307
    # now, add items if applicable
303
    if ($basket->effective_create_items eq 'ordering') {
308
    if ($basket->effective_create_items eq 'ordering') {
304
309
(-)a/acqui/neworderempty.pl (+9 lines)
Lines 185-190 if ( not $ordernumber ) { # create order Link Here
185
185
186
    if ( $biblionumber ) {
186
    if ( $biblionumber ) {
187
        $data = GetBiblioData($biblionumber);
187
        $data = GetBiblioData($biblionumber);
188
189
        # get existing items not previously ordered in existing record
190
        my @all_items = GetItemsInfo( $biblionumber );
191
        my @items;
192
        foreach my $item ( @all_items ){
193
            my $acqitem = Koha::Database->new->schema->resultset('AqordersItem')->find($item->{itemnumber});
194
            push @items, $item  unless( $acqitem );
195
        }
196
        $template->param( existingitems => \@items );
188
    }
197
    }
189
    # get suggestion fields if applicable. If it's a subscription renewal, then the biblio already exists
198
    # get suggestion fields if applicable. If it's a subscription renewal, then the biblio already exists
190
    # otherwise, retrieve suggestion information.
199
    # otherwise, retrieve suggestion information.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +75 lines)
Lines 246-251 Link Here
246
        </fieldset>
246
        </fieldset>
247
    [% END %]
247
    [% END %]
248
248
249
    [% IF ( existingitems ) %]
250
        <fieldset class="rows">
251
            <legend>Existing Items</legend>
252
            <div id="existing_items_list" >
253
                <div style="width:100%;overflow:auto;">
254
                    <table>
255
                        <thead>
256
                            <tr>
257
                                <th>&nbsp;</th>
258
                                <th>Barcode</th>
259
                                <th>Home library</th>
260
                                <th>Holding library</th>
261
                                <th>Not for loan</th>
262
                                <th>Restricted</th>
263
                                <th>Location</th>
264
                                <th>Call number</th>
265
                                <th>Copy number</th>
266
                                <th>Inventory number</th>
267
                                <th>Collection code</th>
268
                                <th>Item type</th>
269
                                <th>Materials</th>
270
                                <th>Price</th>
271
                                <th>Notes</th>
272
                            </tr>
273
                        </thead>
274
                        <tbody>
275
                            [% FOREACH item IN existingitems %]
276
                                <tr>
277
                                    <td style="text-align:center;vertical-align:middle">
278
                                        <input type="checkbox" value="[% item.itemnumber %]" name="itemnumber" data-price="[% item.price %]"/>
279
                                    </td>
280
                                    <td>[% item.barcode %]</td>
281
                                    <td>[% item.homebranch %]</td>
282
                                    <td>[% item.holdingbranch %]</td>
283
                                    <td>[% item.notforloan %]</td>
284
                                    <td>[% item.restricted %]</td>
285
                                    <td>[% item.location %]</td>
286
                                    <td>[% item.itemcallnumber %]</td>
287
                                    <td>[% item.copynumber %]</td>
288
                                    <td>[% item.stocknumber %]</td>
289
                                    <td>[% item.ccode %]</td>
290
                                    <td>[% item.itype %]</td>
291
                                    <td>[% item.materials %]</td>
292
                                    <td>[% item.price %]</td>
293
                                    <td>[% item.itemnotes %]</td>
294
                                </tr>
295
                            [% END %]
296
                        </tbody>
297
                    </table>
298
                </div>
299
            </div>
300
        </fieldset>
301
    [% END %]
302
249
    [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
303
    [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
250
      [% IF (AcqCreateItemOrdering) %]
304
      [% IF (AcqCreateItemOrdering) %]
251
305
Lines 611-616 Link Here
611
        }
665
        }
612
666
613
        $(document).ready(function(){
667
        $(document).ready(function(){
668
            $("input[name='itemnumber'][type='checkbox']").change(function() {
669
                if (this.checked) {
670
                    var number = new Number( $("#quantity").val() );
671
                    $("#quantity").val( number+1 );
672
                    var price = new Number( $(this).attr("data-price") );
673
                    var total = new Number( $("#total").val() );
674
                    var listprice = new Number( (total+price)/Number( $("#quantity").val() ) );
675
                    $("#listprice").val( listprice );
676
                    updateCosts();
677
                } else {
678
                    var number = new Number( $("#quantity").val() );
679
                    $("#quantity").val( number-1 ); 
680
                    var price = new Number( $(this).attr("data-price") );
681
                    var total = new Number( $("#total").val() );
682
                    var listprice = new Number( (total-price)/Number( $("#quantity").val() ) );
683
                    if( isNaN( listprice ) ) listprice = 0;
684
                    $("#listprice").val( listprice );
685
                    updateCosts();
686
                }
687
            });
688
614
            [% IF AcqCreateItemOrdering and not basket.is_standing %]
689
            [% IF AcqCreateItemOrdering and not basket.is_standing %]
615
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
690
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
616
            [% END %]
691
            [% END %]
617
- 

Return to bug 20817