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

(-)a/Koha/Acquisition/Fund.pm (-1 / +1 lines)
Lines 17-24 package Koha::Acquisition::Fund; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Acquisition::Budgets;
21
use Koha::Database;
20
use Koha::Database;
21
use Koha::Acquisition::Budget;
22
22
23
use base qw(Koha::Object);
23
use base qw(Koha::Object);
24
24
(-)a/Koha/Acquisition/Order.pm (+15 lines)
Lines 32-37 use Koha::Exceptions::Object; Link Here
32
use Koha::Biblios;
32
use Koha::Biblios;
33
use Koha::Holds;
33
use Koha::Holds;
34
use Koha::Items;
34
use Koha::Items;
35
use Koha::Patron;
35
use Koha::Subscriptions;
36
use Koha::Subscriptions;
36
37
37
use base qw(Koha::Object);
38
use base qw(Koha::Object);
Lines 394-399 sub claimed_date { Link Here
394
    return $last_claim->claimed_on;
395
    return $last_claim->claimed_on;
395
}
396
}
396
397
398
=head3 creator
399
400
my $creator = $order->creator;
401
402
Retrieves patron that created this order.
403
404
=cut
405
406
sub creator {
407
    my ( $self )  = @_;
408
    my $creator_rs = $self->_result->creator;
409
    return Koha::Patron->_new_from_dbic( $creator_rs );
410
}
411
397
=head3 duplicate_to
412
=head3 duplicate_to
398
413
399
    my $duplicated_order = $order->duplicate_to($basket, [$default_values]);
414
    my $duplicated_order = $order->duplicate_to($basket, [$default_values]);
(-)a/Koha/Item.pm (+27 lines)
Lines 45-50 use Koha::Plugins; Link Here
45
use Koha::Libraries;
45
use Koha::Libraries;
46
use Koha::StockRotationItem;
46
use Koha::StockRotationItem;
47
use Koha::StockRotationRotas;
47
use Koha::StockRotationRotas;
48
use Koha::MarcSubfieldStructures;
49
use Koha::AuthorisedValues;
48
50
49
use base qw(Koha::Object);
51
use base qw(Koha::Object);
50
52
Lines 1076-1081 sub _after_item_action_hooks { Link Here
1076
    );
1078
    );
1077
}
1079
}
1078
1080
1081
=head3 _fetch_authorised_values
1082
1083
Retrieves for each column name the unblessed authorised value.
1084
1085
=cut
1086
1087
sub _fetch_authorised_values {
1088
    my ($self, $av_expand) = @_;
1089
1090
    my $columns_info = $self->_result->result_source->columns_info;
1091
    my $framworkcode = $self->biblio->frameworkcode;
1092
    # Handle not null and default values for integers and dates
1093
    my $avs = {};
1094
    foreach my $col ( keys %{$columns_info} ) {
1095
        next unless defined $self->$col;
1096
        my $field = $self->_result->result_source->name.'.'.$col;
1097
        my $mss = Koha::MarcSubfieldStructures->find({frameworkcode => $framworkcode, kohafield => $field});
1098
        if ($mss && $mss->authorised_value) {
1099
            my $av = Koha::AuthorisedValues->find({category => $mss->authorised_value, authorised_value => $self->$col});
1100
            $avs->{$col} = $av->unblessed if $av;
1101
        };
1102
    }
1103
    return $avs;
1104
}
1105
1079
=head3 _type
1106
=head3 _type
1080
1107
1081
=cut
1108
=cut
(-)a/Koha/REST/V1/Acquisitions/Orders.pm (-2 / +5 lines)
Lines 130-136 sub list { Link Here
130
                for my $f ( qw( isbn ean publisher ) ) {
130
                for my $f ( qw( isbn ean publisher ) ) {
131
                    $reserved_params->{$q} =~ s|"biblio.$f":|"biblio.biblioitem.$f":|g;
131
                    $reserved_params->{$q} =~ s|"biblio.$f":|"biblio.biblioitem.$f":|g;
132
                }
132
                }
133
                push @query_params_array, $reserved_params->{$q};
133
                push @query_params_array, $q eq 'query'
134
                  ? $reserved_params->{$q}
135
                  : decode_json( $reserved_params->{$q} );
136
134
            }
137
            }
135
138
136
            if(scalar(@query_params_array) > 1) {
139
            if(scalar(@query_params_array) > 1) {
Lines 157-163 sub list { Link Here
157
160
158
        return $c->render(
161
        return $c->render(
159
            status  => 200,
162
            status  => 200,
160
            openapi => $orders->to_api({ embed => $embed })
163
            openapi => $orders->to_api({ embed => $embed, av_expand => $c->req->headers->header('x-koha-av') })
161
        );
164
        );
162
    }
165
    }
163
    catch {
166
    catch {
(-)a/Koha/REST/V1/Items.pm (-2 / +5 lines)
Lines 66-81 sub get { Link Here
66
    my $c = shift->openapi->valid_input or return;
66
    my $c = shift->openapi->valid_input or return;
67
67
68
    try {
68
    try {
69
        my $item = Koha::Items->find($c->validation->param('item_id'));
69
        my $items_set = Koha::Items->new;
70
        my $id = $c->validation->param('item_id');
71
        my $item = $c->objects->find( $items_set, $id );
70
        unless ( $item ) {
72
        unless ( $item ) {
71
            return $c->render(
73
            return $c->render(
72
                status => 404,
74
                status => 404,
73
                openapi => { error => 'Item not found'}
75
                openapi => { error => 'Item not found'}
74
            );
76
            );
75
        }
77
        }
76
        return $c->render( status => 200, openapi => $item->to_api );
78
        return $c->render( status => 200, openapi => $item );
77
    }
79
    }
78
    catch {
80
    catch {
81
        print $_->message;
79
        $c->unhandled_exception($_);
82
        $c->unhandled_exception($_);
80
    };
83
    };
81
}
84
}
(-)a/Koha/Schema/Result/Aqorder.pm (+20 lines)
Lines 800-805 __PACKAGE__->belongs_to( Link Here
800
  },
800
  },
801
);
801
);
802
802
803
=head2 creator
804
805
Type: belongs_to
806
807
Related object: L<Koha::Schema::Result::Borrower>
808
809
=cut
810
811
__PACKAGE__->belongs_to(
812
  "creator",
813
  "Koha::Schema::Result::Borrower",
814
  { borrowernumber => "created_by" },
815
  {
816
    is_deferrable => 1,
817
    join_type     => "LEFT",
818
    on_delete     => "SET NULL",
819
    on_update     => "CASCADE",
820
  },
821
);
822
803
__PACKAGE__->belongs_to(
823
__PACKAGE__->belongs_to(
804
  "subscription",
824
  "subscription",
805
  "Koha::Schema::Result::Subscription",
825
  "Koha::Schema::Result::Subscription",
(-)a/acqui/finishreceive.pl (+2 lines)
Lines 73-78 if (C4::Context->preference("CurrencyFormat") eq 'FR') { Link Here
73
$unitprice = Koha::Number::Price->new( $unitprice )->unformat();
73
$unitprice = Koha::Number::Price->new( $unitprice )->unformat();
74
$replacementprice = Koha::Number::Price->new( $replacementprice )->unformat();
74
$replacementprice = Koha::Number::Price->new( $replacementprice )->unformat();
75
my $order_obj = Koha::Acquisition::Orders->find( $ordernumber );
75
my $order_obj = Koha::Acquisition::Orders->find( $ordernumber );
76
76
my $basket = $order_obj->basket;
77
my $basket = $order_obj->basket;
77
78
78
#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
79
#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
Lines 116-121 if ($quantityrec > $origquantityrec ) { Link Here
116
            # Quantity can only be modified if linked to a subscription
117
            # Quantity can only be modified if linked to a subscription
117
            $order->{quantity} = $quantity; # quantityrec will be deduced from this value in ModReceiveOrder
118
            $order->{quantity} = $quantity; # quantityrec will be deduced from this value in ModReceiveOrder
118
        }
119
        }
120
119
        ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
121
        ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
120
            {
122
            {
121
                biblionumber     => $biblionumber,
123
                biblionumber     => $biblionumber,
(-)a/acqui/orderreceive.pl (-44 / +54 lines)
Lines 87-92 my $invoice = GetInvoice($invoiceid); Link Here
87
my $booksellerid   = $invoice->{booksellerid};
87
my $booksellerid   = $invoice->{booksellerid};
88
my $freight      = $invoice->{shipmentcost};
88
my $freight      = $invoice->{shipmentcost};
89
my $ordernumber  = $input->param('ordernumber');
89
my $ordernumber  = $input->param('ordernumber');
90
my $multiple_orders = $input->param('multiple_orders');
90
91
91
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
92
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
92
my $order = Koha::Acquisition::Orders->find( $ordernumber );
93
my $order = Koha::Acquisition::Orders->find( $ordernumber );
Lines 101-113 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
101
    }
102
    }
102
);
103
);
103
104
104
unless ( $order ) {
105
unless ( $order || $multiple_orders ) {
105
    output_html_with_http_headers $input, $cookie, $template->output;
106
    output_html_with_http_headers $input, $cookie, $template->output;
106
    exit;
107
    exit;
107
}
108
}
108
109
109
# prepare the form for receiving
110
my $budget;
110
my $basket = $order->basket;
111
if( $order ) {
112
    # prepare the form for receiving
113
    my $creator = Koha::Patrons->find( $order->created_by );
114
115
    $budget = GetBudget( $order->budget_id );
116
117
    my $datereceived = $order->datereceived ? dt_from_string( $order->datereceived ) : dt_from_string;
118
119
    my $order_internalnote = $order->order_internalnote;
120
    my $order_vendornote   = $order->order_vendornote;
121
    if ( $order->subscriptionid ) {
122
        # Order from a subscription, we will display an history of what has been received
123
        my $orders = Koha::Acquisition::Orders->search(
124
            {
125
                subscriptionid     => $order->subscriptionid,
126
                parent_ordernumber => $order->ordernumber,
127
                ordernumber        => { '!=' => $order->ordernumber }
128
            }
129
        );
130
        if ( $order->parent_ordernumber != $order->ordernumber ) {
131
            my $parent_order = Koha::Acquisition::Orders->find($order->parent_ordernumber);
132
            $order_internalnote = $parent_order->order_internalnote;
133
            $order_vendornote   = $parent_order->order_vendornote;
134
        }
135
        $template->param(
136
            orders => $orders,
137
        );
138
    }
139
140
    my $suggestion = GetSuggestionInfoFromBiblionumber($order->biblionumber);
141
142
    if ( $suggestion ) {
143
        $template->param( suggestion => $suggestion );
144
    }
145
146
    $template->param(
147
        order                 => $order,
148
        creator               => $creator,
149
        bookfund              => $budget->{budget_name},
150
        datereceived          => $datereceived,
151
        order_internalnote    => $order_internalnote,
152
        order_vendornote      => $order_vendornote,
153
    );
154
}
155
156
if( $multiple_orders ) {
157
    $template->param(multiple_orders => $multiple_orders);
158
}
159
111
my $currencies = Koha::Acquisition::Currencies->search;
160
my $currencies = Koha::Acquisition::Currencies->search;
112
my $active_currency = $currencies->get_active;
161
my $active_currency = $currencies->get_active;
113
162
Lines 117-182 unless($acq_fw) { Link Here
117
    $template->param('NoACQframework' => 1);
166
    $template->param('NoACQframework' => 1);
118
}
167
}
119
168
120
121
my $creator = Koha::Patrons->find( $order->created_by );
122
123
my $budget = GetBudget( $order->budget_id );
124
125
my $datereceived = $order->datereceived ? dt_from_string( $order->datereceived ) : dt_from_string;
126
127
# get option values for TaxRates syspref
169
# get option values for TaxRates syspref
128
my @gst_values = map {
170
my @gst_values = map {
129
    option => $_ + 0.0
171
    option => $_ + 0.0
130
}, split( '\|', C4::Context->preference("TaxRates") );
172
}, split( '\|', C4::Context->preference("TaxRates") );
131
173
132
my $order_internalnote = $order->order_internalnote;
133
my $order_vendornote   = $order->order_vendornote;
134
if ( $order->subscriptionid ) {
135
    # Order from a subscription, we will display an history of what has been received
136
    my $orders = Koha::Acquisition::Orders->search(
137
        {
138
            subscriptionid     => $order->subscriptionid,
139
            parent_ordernumber => $order->ordernumber,
140
            ordernumber        => { '!=' => $order->ordernumber }
141
        }
142
    );
143
    if ( $order->parent_ordernumber != $order->ordernumber ) {
144
        my $parent_order = Koha::Acquisition::Orders->find($order->parent_ordernumber);
145
        $order_internalnote = $parent_order->order_internalnote;
146
        $order_vendornote   = $parent_order->order_vendornote;
147
    }
148
    $template->param(
149
        orders => $orders,
150
    );
151
}
152
153
$template->param(
174
$template->param(
154
    order                 => $order,
155
    freight               => $freight,
175
    freight               => $freight,
156
    name                  => $bookseller->name,
176
    name                  => $bookseller->name,
157
    active_currency       => $active_currency,
177
    active_currency       => $active_currency,
158
    currencies            => scalar $currencies->search({ rate => { '!=' => 1 } }),
178
    currencies            => scalar $currencies->search({ rate => { '!=' => 1 } }),
159
    invoiceincgst         => $bookseller->invoiceincgst,
179
    invoiceincgst         => $bookseller->invoiceincgst,
160
    bookfund              => $budget->{budget_name},
161
    creator               => $creator,
162
    invoiceid             => $invoice->{invoiceid},
180
    invoiceid             => $invoice->{invoiceid},
163
    invoice               => $invoice->{invoicenumber},
181
    invoice               => $invoice->{invoicenumber},
164
    datereceived          => $datereceived,
165
    order_internalnote    => $order_internalnote,
166
    order_vendornote      => $order_vendornote,
167
    gst_values            => \@gst_values,
182
    gst_values            => \@gst_values,
168
);
183
);
169
184
170
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
171
if ( $suggestion ) {
172
    $template->param( suggestion => $suggestion );
173
}
174
175
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
185
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
176
my @budget_loop;
186
my @budget_loop;
177
my $periods = GetBudgetPeriods( );
187
my $periods = GetBudgetPeriods( );
178
foreach my $period (@$periods) {
188
foreach my $period (@$periods) {
179
    if ($period->{'budget_period_id'} == $budget->{'budget_period_id'}) {
189
    if ($budget && $period->{'budget_period_id'} == $budget->{'budget_period_id'}) {
180
        $template->{'VARS'}->{'budget_period_description'} = $period->{'budget_period_description'};
190
        $template->{'VARS'}->{'budget_period_description'} = $period->{'budget_period_description'};
181
    }
191
    }
182
    next if $period->{'budget_period_locked'} || !$period->{'budget_period_description'};
192
    next if $period->{'budget_period_locked'} || !$period->{'budget_period_description'};
Lines 191-197 foreach my $period (@$periods) { Link Here
191
          {
201
          {
192
            b_id  => $r->{budget_id},
202
            b_id  => $r->{budget_id},
193
            b_txt => $r->{budget_name},
203
            b_txt => $r->{budget_name},
194
            b_sel => ( $r->{budget_id} == $order->{budget_id} ) ? 1 : 0,
204
            b_sel => ( $order && $r->{budget_id} == $order->{budget_id} ) ? 1 : 0,
195
          };
205
          };
196
    }
206
    }
197
207
(-)a/api/v1/swagger/definitions/item.json (+12 lines)
Lines 180-185 Link Here
180
    "exclude_from_local_holds_priority": {
180
    "exclude_from_local_holds_priority": {
181
      "type": "boolean",
181
      "type": "boolean",
182
      "description": "Exclude this item from local holds priority."
182
      "description": "Exclude this item from local holds priority."
183
    },
184
    "home_branch": {
185
      "type": ["object", "null"]
186
    },
187
    "holding_branch": {
188
      "type": ["object", "null"]
189
    },
190
    "itemtype": {
191
      "type": ["object", "null"]
192
    },
193
    "_authorised_values": {
194
      "type": ["object", "null"]
183
    }
195
    }
184
  },
196
  },
185
  "additionalProperties": false,
197
  "additionalProperties": false,
(-)a/api/v1/swagger/definitions/order.json (+9 lines)
Lines 329-334 Link Here
329
                "object",
329
                "object",
330
                "null"
330
                "null"
331
            ]
331
            ]
332
        },
333
        "creator": {
334
            "type": [
335
                "object",
336
                "null"
337
            ]
338
        },
339
        "_authorised_values": {
340
            "type": "object"
332
        }
341
        }
333
    },
342
    },
334
    "additionalProperties": false
343
    "additionalProperties": false
(-)a/api/v1/swagger/paths/acquisitions_orders.json (-1 / +6 lines)
Lines 124-133 Link Here
124
                "biblio.items+count",
124
                "biblio.items+count",
125
                "biblio.suggestions.suggester",
125
                "biblio.suggestions.suggester",
126
                "fund",
126
                "fund",
127
                "fund.budget",
127
                "current_item_level_holds+count",
128
                "current_item_level_holds+count",
128
                "invoice",
129
                "invoice",
129
                "items",
130
                "items",
130
                "subscription"
131
                "items.home_branch",
132
                "items.holding_branch",
133
                "items.itemtype",
134
                "subscription",
135
                "creator"
131
            ]
136
            ]
132
        },
137
        },
133
        "post": {
138
        "post": {
(-)a/api/v1/swagger/paths/items.json (-1 / +6 lines)
Lines 122-128 Link Here
122
        "permissions": {
122
        "permissions": {
123
          "catalogue": "1"
123
          "catalogue": "1"
124
        }
124
        }
125
      }
125
      },
126
      "x-koha-embed": [
127
        "itemtype",
128
        "home_branch",
129
        "holding_branch"
130
      ]
126
    }
131
    }
127
  }
132
  }
128
}
133
}
(-)a/koha-tmpl/intranet-tmpl/lib/datatables/dataTables.select.min.js (+38 lines)
Line 0 Link Here
1
/*!
2
   Copyright 2015-2019 SpryMedia Ltd.
3
4
 This source file is free software, available under the following license:
5
   MIT license - http://datatables.net/license/mit
6
7
 This source file is distributed in the hope that it will be useful, but
8
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9
 or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
10
11
 For details please refer to: http://www.datatables.net/extensions/select
12
 Select for DataTables 1.3.1
13
 2015-2019 SpryMedia Ltd - datatables.net/license/mit
14
*/
15
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return f(k,window,document)}):"object"===typeof exports?module.exports=function(k,p){k||(k=window);p&&p.fn.dataTable||(p=require("datatables.net")(k,p).$);return f(p,k,k.document)}:f(jQuery,window,document)})(function(f,k,p,h){function z(a,b,c){var d=function(c,b){if(c>b){var d=b;b=c;c=d}var e=!1;return a.columns(":visible").indexes().filter(function(a){a===c&&(e=!0);return a===b?(e=!1,!0):e})};var e=
16
function(c,b){var d=a.rows({search:"applied"}).indexes();if(d.indexOf(c)>d.indexOf(b)){var e=b;b=c;c=e}var f=!1;return d.filter(function(a){a===c&&(f=!0);return a===b?(f=!1,!0):f})};a.cells({selected:!0}).any()||c?(d=d(c.column,b.column),c=e(c.row,b.row)):(d=d(0,b.column),c=e(0,b.row));c=a.cells(c,d).flatten();a.cells(b,{selected:!0}).any()?a.cells(c).deselect():a.cells(c).select()}function v(a){var b=a.settings()[0]._select.selector;f(a.table().container()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",
17
b).off("click.dtSelect",b);f("body").off("click.dtSelect"+a.table().node().id.replace(/[^a-zA-Z0-9\-_]/g,"-"))}function A(a){var b=f(a.table().container()),c=a.settings()[0],d=c._select.selector,e;b.on("mousedown.dtSelect",d,function(a){if(a.shiftKey||a.metaKey||a.ctrlKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1});k.getSelection&&(e=k.getSelection())}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(c){var b=
18
a.select.items();if(e){var d=k.getSelection();if((!d.anchorNode||f(d.anchorNode).closest("table")[0]===a.table().node())&&d!==e)return}d=a.settings()[0];var l=f.trim(a.settings()[0].oClasses.sWrapper).replace(/ +/g,".");if(f(c.target).closest("div."+l)[0]==a.table().container()&&(l=a.cell(f(c.target).closest("td, th")),l.any())){var g=f.Event("user-select.dt");m(a,g,[b,l,c]);g.isDefaultPrevented()||(g=l.index(),"row"===b?(b=g.row,w(c,a,d,"row",b)):"column"===b?(b=l.index().column,w(c,a,d,"column",
19
b)):"cell"===b&&(b=l.index(),w(c,a,d,"cell",b)),d._select_lastCell=g)}});f("body").on("click.dtSelect"+a.table().node().id.replace(/[^a-zA-Z0-9\-_]/g,"-"),function(b){!c._select.blurable||f(b.target).parents().filter(a.table().container()).length||0===f(b.target).parents("html").length||f(b.target).parents("div.DTE").length||r(c,!0)})}function m(a,b,c,d){if(!d||a.flatten().length)"string"===typeof b&&(b+=".dt"),c.unshift(a),f(a.table().node()).trigger(b,c)}function B(a){var b=a.settings()[0];if(b._select.info&&
20
b.aanFeatures.i&&"api"!==a.select.style()){var c=a.rows({selected:!0}).flatten().length,d=a.columns({selected:!0}).flatten().length,e=a.cells({selected:!0}).flatten().length,l=function(b,c,d){b.append(f('<span class="select-item"/>').append(a.i18n("select."+c+"s",{_:"%d "+c+"s selected",0:"",1:"1 "+c+" selected"},d)))};f.each(b.aanFeatures.i,function(b,a){a=f(a);b=f('<span class="select-info"/>');l(b,"row",c);l(b,"column",d);l(b,"cell",e);var g=a.children("span.select-info");g.length&&g.remove();
21
""!==b.text()&&a.append(b)})}}function D(a){var b=new g.Api(a);a.aoRowCreatedCallback.push({fn:function(b,d,e){d=a.aoData[e];d._select_selected&&f(b).addClass(a._select.className);b=0;for(e=a.aoColumns.length;b<e;b++)(a.aoColumns[b]._select_selected||d._selected_cells&&d._selected_cells[b])&&f(d.anCells[b]).addClass(a._select.className)},sName:"select-deferRender"});b.on("preXhr.dt.dtSelect",function(){var a=b.rows({selected:!0}).ids(!0).filter(function(b){return b!==h}),d=b.cells({selected:!0}).eq(0).map(function(a){var c=
22
b.row(a.row).id(!0);return c?{row:c,column:a.column}:h}).filter(function(b){return b!==h});b.one("draw.dt.dtSelect",function(){b.rows(a).select();d.any()&&d.each(function(a){b.cells(a.row,a.column).select()})})});b.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){B(b)});b.on("destroy.dtSelect",function(){v(b);b.off(".dtSelect")})}function C(a,b,c,d){var e=a[b+"s"]({search:"applied"}).indexes();d=f.inArray(d,e);var g=f.inArray(c,e);if(a[b+"s"]({selected:!0}).any()||
23
-1!==d){if(d>g){var u=g;g=d;d=u}e.splice(g+1,e.length);e.splice(0,d)}else e.splice(f.inArray(c,e)+1,e.length);a[b](c,{selected:!0}).any()?(e.splice(f.inArray(c,e),1),a[b+"s"](e).deselect()):a[b+"s"](e).select()}function r(a,b){if(b||"single"===a._select.style)a=new g.Api(a),a.rows({selected:!0}).deselect(),a.columns({selected:!0}).deselect(),a.cells({selected:!0}).deselect()}function w(a,b,c,d,e){var f=b.select.style(),g=b.select.toggleable(),h=b[d](e,{selected:!0}).any();if(!h||g)"os"===f?a.ctrlKey||
24
a.metaKey?b[d](e).select(!h):a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):(a=b[d+"s"]({selected:!0}),h&&1===a.flatten().length?b[d](e).deselect():(a.deselect(),b[d](e).select())):"multi+shift"==f?a.shiftKey?"cell"===d?z(b,e,c._select_lastCell||null):C(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):b[d](e).select(!h):b[d](e).select(!h)}function t(a,b){return function(c){return c.i18n("buttons."+a,b)}}function x(a){a=a._eventNamespace;
25
return"draw.dt.DT"+a+" select.dt.DT"+a+" deselect.dt.DT"+a}function E(a,b){return-1!==f.inArray("rows",b.limitTo)&&a.rows({selected:!0}).any()||-1!==f.inArray("columns",b.limitTo)&&a.columns({selected:!0}).any()||-1!==f.inArray("cells",b.limitTo)&&a.cells({selected:!0}).any()?!0:!1}var g=f.fn.dataTable;g.select={};g.select.version="1.3.1";g.select.init=function(a){var b=a.settings()[0],c=b.oInit.select,d=g.defaults.select;c=c===h?d:c;d="row";var e="api",l=!1,u=!0,k=!0,m="td, th",p="selected",n=!1;
26
b._select={};!0===c?(e="os",n=!0):"string"===typeof c?(e=c,n=!0):f.isPlainObject(c)&&(c.blurable!==h&&(l=c.blurable),c.toggleable!==h&&(u=c.toggleable),c.info!==h&&(k=c.info),c.items!==h&&(d=c.items),e=c.style!==h?c.style:"os",n=!0,c.selector!==h&&(m=c.selector),c.className!==h&&(p=c.className));a.select.selector(m);a.select.items(d);a.select.style(e);a.select.blurable(l);a.select.toggleable(u);a.select.info(k);b._select.className=p;f.fn.dataTable.ext.order["select-checkbox"]=function(b,a){return this.api().column(a,
27
{order:"index"}).nodes().map(function(a){return"row"===b._select.items?f(a).parent().hasClass(b._select.className):"cell"===b._select.items?f(a).hasClass(b._select.className):!1})};!n&&f(a.table().node()).hasClass("selectable")&&a.select.style("os")};f.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(a,b){g.ext.selector[b.type].push(function(a,d,e){d=d.selected;var c=[];if(!0!==d&&!1!==d)return e;for(var f=0,g=e.length;f<g;f++){var h=a[b.prop][e[f]];(!0===d&&!0===h._select_selected||
28
!1===d&&!h._select_selected)&&c.push(e[f])}return c})});g.ext.selector.cell.push(function(a,b,c){b=b.selected;var d=[];if(b===h)return c;for(var e=0,f=c.length;e<f;e++){var g=a.aoData[c[e].row];(!0===b&&g._selected_cells&&!0===g._selected_cells[c[e].column]||!(!1!==b||g._selected_cells&&g._selected_cells[c[e].column]))&&d.push(c[e])}return d});var n=g.Api.register,q=g.Api.registerPlural;n("select()",function(){return this.iterator("table",function(a){g.select.init(new g.Api(a))})});n("select.blurable()",
29
function(a){return a===h?this.context[0]._select.blurable:this.iterator("table",function(b){b._select.blurable=a})});n("select.toggleable()",function(a){return a===h?this.context[0]._select.toggleable:this.iterator("table",function(b){b._select.toggleable=a})});n("select.info()",function(a){return B===h?this.context[0]._select.info:this.iterator("table",function(b){b._select.info=a})});n("select.items()",function(a){return a===h?this.context[0]._select.items:this.iterator("table",function(b){b._select.items=
30
a;m(new g.Api(b),"selectItems",[a])})});n("select.style()",function(a){return a===h?this.context[0]._select.style:this.iterator("table",function(b){b._select.style=a;b._select_init||D(b);var c=new g.Api(b);v(c);"api"!==a&&A(c);m(new g.Api(b),"selectStyle",[a])})});n("select.selector()",function(a){return a===h?this.context[0]._select.selector:this.iterator("table",function(b){v(new g.Api(b));b._select.selector=a;"api"!==b._select.style&&A(new g.Api(b))})});q("rows().select()","row().select()",function(a){var b=
31
this;if(!1===a)return this.deselect();this.iterator("row",function(b,a){r(b);b.aoData[a]._select_selected=!0;f(b.aoData[a].nTr).addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["row",b[d]],!0)});return this});q("columns().select()","column().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("column",function(b,a){r(b);b.aoColumns[a]._select_selected=!0;a=(new g.Api(b)).column(a);f(a.header()).addClass(b._select.className);f(a.footer()).addClass(b._select.className);
32
a.nodes().to$().addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["column",b[d]],!0)});return this});q("cells().select()","cell().select()",function(a){var b=this;if(!1===a)return this.deselect();this.iterator("cell",function(b,a,e){r(b);a=b.aoData[a];a._selected_cells===h&&(a._selected_cells=[]);a._selected_cells[e]=!0;a.anCells&&f(a.anCells[e]).addClass(b._select.className)});this.iterator("table",function(a,d){m(b,"select",["cell",b[d]],!0)});return this});q("rows().deselect()",
33
"row().deselect()",function(){var a=this;this.iterator("row",function(a,c){a.aoData[c]._select_selected=!1;f(a.aoData[c].nTr).removeClass(a._select.className)});this.iterator("table",function(b,c){m(a,"deselect",["row",a[c]],!0)});return this});q("columns().deselect()","column().deselect()",function(){var a=this;this.iterator("column",function(a,c){a.aoColumns[c]._select_selected=!1;var b=new g.Api(a),e=b.column(c);f(e.header()).removeClass(a._select.className);f(e.footer()).removeClass(a._select.className);
34
b.cells(null,c).indexes().each(function(b){var c=a.aoData[b.row],d=c._selected_cells;!c.anCells||d&&d[b.column]||f(c.anCells[b.column]).removeClass(a._select.className)})});this.iterator("table",function(b,c){m(a,"deselect",["column",a[c]],!0)});return this});q("cells().deselect()","cell().deselect()",function(){var a=this;this.iterator("cell",function(a,c,d){c=a.aoData[c];c._selected_cells[d]=!1;c.anCells&&!a.aoColumns[d]._select_selected&&f(c.anCells[d]).removeClass(a._select.className)});this.iterator("table",
35
function(b,c){m(a,"deselect",["cell",a[c]],!0)});return this});var y=0;f.extend(g.ext.buttons,{selected:{text:t("selected","Selected"),className:"buttons-selected",limitTo:["rows","columns","cells"],init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){d.enable(E(a,c))});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectedSingle:{text:t("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(a,b,c){var d=this;c._eventNamespace=
36
".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(1===b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}},selectAll:{text:t("selectAll","Select all"),className:"buttons-select-all",action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:t("selectNone","Deselect all"),className:"buttons-select-none",action:function(){r(this.settings()[0],
37
!0)},init:function(a,b,c){var d=this;c._eventNamespace=".select"+y++;a.on(x(c),function(){var b=a.rows({selected:!0}).flatten().length+a.columns({selected:!0}).flatten().length+a.cells({selected:!0}).flatten().length;d.enable(0<b)});this.disable()},destroy:function(a,b,c){a.off(c._eventNamespace)}}});f.each(["Row","Column","Cell"],function(a,b){var c=b.toLowerCase();g.ext.buttons["select"+b+"s"]={text:t("select"+b+"s","Select "+c+"s"),className:"buttons-select-"+c+"s",action:function(){this.select.items(c)},
38
init:function(a){var b=this;a.on("selectItems.dt.DT",function(a,d,e){b.active(e===c)})}}});f(p).on("preInit.dt.dtSelect",function(a,b){"dt"===a.namespace&&g.select.init(new g.Api(b))});return g.select});
(-)a/koha-tmpl/intranet-tmpl/lib/datatables/select.dataTables.min.css (+1 lines)
Line 0 Link Here
1
table.dataTable tbody>tr.selected,table.dataTable tbody>tr>.selected{background-color:#B0BED9}table.dataTable.stripe tbody>tr.odd.selected,table.dataTable.stripe tbody>tr.odd>.selected,table.dataTable.display tbody>tr.odd.selected,table.dataTable.display tbody>tr.odd>.selected{background-color:#acbad4}table.dataTable.hover tbody>tr.selected:hover,table.dataTable.hover tbody>tr>.selected:hover,table.dataTable.display tbody>tr.selected:hover,table.dataTable.display tbody>tr>.selected:hover{background-color:#aab7d1}table.dataTable.order-column tbody>tr.selected>.sorting_1,table.dataTable.order-column tbody>tr.selected>.sorting_2,table.dataTable.order-column tbody>tr.selected>.sorting_3,table.dataTable.order-column tbody>tr>.selected,table.dataTable.display tbody>tr.selected>.sorting_1,table.dataTable.display tbody>tr.selected>.sorting_2,table.dataTable.display tbody>tr.selected>.sorting_3,table.dataTable.display tbody>tr>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody>tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody>tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody>tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody>tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody>tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody>tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody>tr.odd>.selected,table.dataTable.order-column.stripe tbody>tr.odd>.selected{background-color:#a6b4cd}table.dataTable.display tbody>tr.even>.selected,table.dataTable.order-column.stripe tbody>tr.even>.selected{background-color:#acbad5}table.dataTable.display tbody>tr.selected:hover>.sorting_1,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody>tr.selected:hover>.sorting_2,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody>tr.selected:hover>.sorting_3,table.dataTable.order-column.hover tbody>tr.selected:hover>.sorting_3{background-color:#a5b2cb}table.dataTable.display tbody>tr:hover>.selected,table.dataTable.display tbody>tr>.selected:hover,table.dataTable.order-column.hover tbody>tr:hover>.selected,table.dataTable.order-column.hover tbody>tr>.selected:hover{background-color:#a2aec7}table.dataTable tbody td.select-checkbox,table.dataTable tbody th.select-checkbox{position:relative}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody td.select-checkbox:after,table.dataTable tbody th.select-checkbox:before,table.dataTable tbody th.select-checkbox:after{display:block;position:absolute;top:1.2em;left:50%;width:12px;height:12px;box-sizing:border-box}table.dataTable tbody td.select-checkbox:before,table.dataTable tbody th.select-checkbox:before{content:' ';margin-top:-6px;margin-left:-6px;border:1px solid black;border-radius:3px}table.dataTable tr.selected td.select-checkbox:after,table.dataTable tr.selected th.select-checkbox:after{content:'\2714';margin-top:-11px;margin-left:-4px;text-align:center;text-shadow:1px 1px #B0BED9, -1px -1px #B0BED9, 1px -1px #B0BED9, -1px 1px #B0BED9}div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0.5em}@media screen and (max-width: 640px){div.dataTables_wrapper span.select-info,div.dataTables_wrapper span.select-item{margin-left:0;display:block}}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc (+1 lines)
Lines 2-5 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% INCLUDE 'format_price.inc' %]
3
[% INCLUDE 'format_price.inc' %]
4
[% Asset.js("lib/datatables/datatables.min.js") | $raw %]
4
[% Asset.js("lib/datatables/datatables.min.js") | $raw %]
5
[% Asset.js("lib/datatables/dataTables.select.min.js") | $raw %]
5
[% Asset.js("js/datatables.js") | $raw %]
6
[% Asset.js("js/datatables.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (+1 lines)
Lines 18-23 Link Here
18
[% Asset.css("lib/bootstrap/bootstrap-theme.min.css") | $raw %]
18
[% Asset.css("lib/bootstrap/bootstrap-theme.min.css") | $raw %]
19
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
19
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
20
[% Asset.css("lib/datatables/datatables.min.css") | $raw %]
20
[% Asset.css("lib/datatables/datatables.min.css") | $raw %]
21
[% Asset.css("lib/datatables/select.dataTables.min.css") | $raw %]
21
[% Asset.css("css/print.css", { media = "print" }) | $raw %]
22
[% Asset.css("css/print.css", { media = "print" }) | $raw %]
22
[% INCLUDE intranetstylesheet.inc %]
23
[% INCLUDE intranetstylesheet.inc %]
23
[% IF ( bidi ) %][% Asset.css("css/right-to-left.css") | $raw %][% END %]
24
[% IF ( bidi ) %][% Asset.css("css/right-to-left.css") | $raw %][% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-6 / +1125 lines)
Lines 15-31 Link Here
15
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'acquisitions-search.inc' %]
16
[% INCLUDE 'acquisitions-search.inc' %]
17
17
18
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | html %]">[% name | html %]</a> &rsaquo; Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]][% END %] (order #[% order.ordernumber | html %])</div>
18
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | html %]">[% name | html %]</a> &rsaquo; Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]][% END %] (order #[% order.ordernumber || multiple_orders | html %])</div>
19
19
20
<div class="main container-fluid">
20
<div class="main container-fluid">
21
    <div class="row">
21
    <div class="row">
22
    [% AcqCreateItem = order.basket.effective_create_items %]
23
        <div class="col-sm-10 col-sm-push-2">
22
        <div class="col-sm-10 col-sm-push-2">
24
            <main>
23
            <main>
25
24
26
<h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
25
<h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber || multiple_orders | html %])</h1>
27
26
28
[% IF ( order ) %]
27
[% IF ( order ) %]
28
    [% AcqCreateItem = order.basket.effective_create_items %]
29
    <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
29
    <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
30
<div class="row">
30
<div class="row">
31
<div class="col-sm-6">
31
<div class="col-sm-6">
Lines 289-295 Link Here
289
                    [% IF ( order.items.count ) %]
289
                    [% IF ( order.items.count ) %]
290
                        <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
290
                        <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
291
                    [% ELSE %]
291
                    [% ELSE %]
292
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
292
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
293
                    [% END %]
293
                    [% END %]
294
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
294
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
295
                [% END %]
295
                [% END %]
Lines 350-356 Link Here
350
        </li>
350
        </li>
351
        <li id="select_currency">
351
        <li id="select_currency">
352
            <label for="unitprice_currency"></label>
352
            <label for="unitprice_currency"></label>
353
            <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
353
            <input type="text" size="20" name="unitprice_currency" id="unitprice_currency" value="" />
354
            [% IF currencies.count %]
354
            [% IF currencies.count %]
355
                <select name="currency">
355
                <select name="currency">
356
                    <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
356
                    <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
Lines 372-377 Link Here
372
        <input type="submit"  value="Save" class="button" accesskey="w" />
372
        <input type="submit"  value="Save" class="button" accesskey="w" />
373
        <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
373
        <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
374
</fieldset></div>    </form>
374
</fieldset></div>    </form>
375
[% ELSIF multiple_orders %]
376
    <table id="multiple_orders" class="table table-bordered table-striped">
377
        <thead>
378
            <tr>
379
                <th>Order</td>
380
                <th>Title</th>
381
                <th>Author</th>
382
                <th>ISBN</th>
383
                <th>Date received</th>
384
                <th>Fund</th>
385
                <th>Quantity</th>
386
                <th>&nbsp;</th>
387
            </tr>
388
        </thead>
389
    </table>
390
391
    <div class="col">
392
        <fieldset class="action">
393
            <button class="save">Save</button>
394
            <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Return</a>
395
        </fieldset>
396
        <div id="jobpanel"><div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
397
        <div id="jobfailed"></div>
398
    </div>
399
400
    <div class="modal fade" id="order_edit" tabindex="-1" role="dialog" aria-labelledby="Order edit">
401
        <div class="modal-dialog" role="document">
402
            <div class="modal-content modal-lg">
403
                <div class="modal-header row">
404
                    <h4 class="col-md-11 modal-title"></h4>
405
                    <button type="button" class="close col-md-1" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
406
                </div>
407
                <div class="modal-body">
408
                    <div class="hide" id="loading">Loading ...</div>
409
                    <div id="modal-order-main">
410
                        <ul>
411
                            <li><a href="#info-panel">Info</a></li>
412
                            <li><a href="#accounting-panel">Accounting</a></li>
413
                            <li><a href="#history-panel">Receipt history</a></li>
414
                            <li><a href="#items-panel">Items</a></li>
415
                        </ul>
416
417
418
                        <div id="info-panel">
419
                            <div>
420
                                <h4>Catalog details</h4>
421
422
                                <div class="row"> <span class="lbl col-sm-4">Title: </span><span class="col-sm-8" id="biblio_title"></span></div>
423
                                <div class="row"> <span class="lbl col-sm-4">Author: </span><span class="col-sm-8" id="biblio_author"></span></div>
424
                                <div class="row"> <span class="lbl col-sm-4">Copyright: </span><span class="col-sm-8" id="biblio_copyright_date"></span></div>
425
                                <div class="row"> <span class="lbl col-sm-4">ISBN: </span><span class="col-sm-8" id="biblio_isbn"></span></div>
426
                                <div class="row"> <span class="lbl col-sm-4">Series: </span><span class="col-sm-8" id="biblio_series_title"></span></div>
427
428
                            </div>
429
                            <div id="suggestion_fieldset">
430
                                <h4>Suggestion</h4>
431
                                <div class="row">
432
                                    <span class="lbl col-sm-4">Suggested by: </span> <span class="col-sm-8" id="biblio_suggestion_suggester"></span>
433
                                </div>
434
                                <div class="row" id="suggestion_reason">
435
                                    <span class="lbl col-sm-4">Reason:</span>
436
                                    <div class="col-sm-8">
437
                                        [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
438
                                        <select class="select-reason" id="reason" name="reason">
439
                                            <option value=""> -- Choose a reason -- </option>
440
                                            [% FOREACH reason IN suggestion_reasons %]
441
                                            <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
442
                                            [% END %]
443
                                            <option value="other">Others...</option>
444
                                        </select>
445
446
                                        <span id="other_reason" name="other_reason">
447
                                            <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
448
                                            <a href="#back">Cancel</a>
449
                                        </span>
450
                                    </div>
451
                                </div>
452
                            </div>
453
                        </div>
454
                        <div id="history-panel">
455
                            <div id="child_orders">
456
                                <h4>Receipt history for this subscription</h4>
457
                                <table id="child_orders_table">
458
                                    <thead>
459
                                        <tr>
460
                                            <th>Invoice</th>
461
                                            <th>Order number</th>
462
                                            <th class="title-string">Creation date</th>
463
                                            <th class="title-string">Receive date</th>
464
                                            <th>Quantity received</th>
465
                                            <th class="title-string">Status</th>
466
                                            <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
467
                                            <th>Internal note</th>
468
                                        </tr>
469
                                    </thead>
470
                                </table>
471
                            </div>
472
                        </div>
473
                        <div id="items-panel">
474
                            <div id="acq-create-receiving">
475
                                <div id="items_list" style="display: none">
476
                                    <h4>Items list</h4>
477
                                    <div style="width:100%;overflow:auto;">
478
                                        <table>
479
                                            <thead>
480
                                                <tr>
481
                                                    <th>Actions</th>
482
                                                    <th>Barcode</th>
483
                                                    <th>Home library</th>
484
                                                    <th>Holding library</th>
485
                                                    <th>Not for loan</th>
486
                                                    <th>Restricted</th>
487
                                                    <th>Location</th>
488
                                                    <th>Call number</th>
489
                                                    <th>Copy number</th>
490
                                                    <th>Inventory number</th>
491
                                                    <th>Collection</th>
492
                                                    <th>Item type</th>
493
                                                    <th>Materials</th>
494
                                                    <th>Notes</th>
495
                                                </tr>
496
                                            </thead>
497
                                            <tbody>
498
                                            </tbody>
499
                                        </table>
500
                                    </div>
501
                                </div>
502
503
                                <div id="itemfieldset">
504
                                    <h4>Item</h4>
505
                                    [% IF ( NoACQframework ) %]
506
                                        <p class="required">
507
                                            No ACQ framework, using default. You should create a
508
                                            framework with code ACQ, the items framework would be
509
                                            used
510
                                        </p>
511
                                    [% END %]
512
                                    <div id="outeritemblock"></div>
513
                                </div>
514
                            </div>
515
                            <div id="acq-create-ordering">
516
                                <h4>Items</h4>
517
                                <div style="width:100%;overflow:auto">
518
                                    <table>
519
                                        <thead>
520
                                            <tr>
521
                                                <th>Receive?</th>
522
                                                <th>&nbsp;</th>
523
                                                <th>Barcode</th>
524
                                                <th>Home library</th>
525
                                                <th>Current library</th>
526
                                                <th>Not for loan</th>
527
                                                <th>Restricted</th>
528
                                                <th>Location</th>
529
                                                <th>Call number</th>
530
                                                <th>Copy number</th>
531
                                                <th>Inventory number</th>
532
                                                <th>Collection</th>
533
                                                <th>Item type</th>
534
                                                <th>Materials</th>
535
                                                <th>Notes</th>
536
                                            </tr>
537
                                        </thead>
538
                                        <tbody>
539
                                        </tbody>
540
                                    </table>
541
                                </div>
542
                            </div>
543
                        </div>
544
                        <div id="accounting-panel">
545
                            <h4>Accounting details</h4>
546
                            <ol>
547
                                <li>
548
                                    <label for="datereceived">Date received: </label>
549
                                    <input type="text" size="10" id="datereceived" name="datereceived" class="datepicker" />
550
                                </li>
551
                                <li>
552
                                    <label for="bookfund">Fund: </label>
553
                                    <select id="bookfund" name="bookfund">
554
                                        <option value=""></option>
555
                                        [% FOREACH period IN budget_loop %]
556
                                        <optgroup label="[% period.description | html %]">
557
                                        [% FOREACH fund IN period.funds %]
558
                                            <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
559
                                        [% END %]
560
                                        </optgroup>
561
                                        [% END %]
562
                                    </select>
563
                                </li>
564
                                <li>
565
                                    <label>&nbsp;</label>
566
                                    <span id="current-fund"></span>
567
                                </li>
568
                                <li>
569
                                    <label for="creator">Ordered by: </label>
570
                                    <span id="creator"></span>
571
                                </li>
572
                                <li>
573
                                    <label for="quantity_to_receive">Quantity ordered: </label>
574
                                    <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" />
575
                                </li>
576
                                <li>
577
                                    <label for="quantity">Quantity received: </label>
578
                                    <input type="text" size="20" name="quantityrec" id="quantity" />
579
                                    <div id="qtyrecerror" style="display:none">
580
                                        <p class="error">Warning, you have entered more items than expected.
581
                                        Items will not be created.</p>
582
                                    </div>
583
                                </li>
584
585
                                [% IF ( gst_values ) %]
586
                                <li>
587
                                    <label for="tax_rate">Tax rate: </label>
588
                                    <select name="tax_rate" id="tax_rate">
589
                                    [% FOREACH gst IN gst_values %]
590
                                        <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
591
                                    [% END %]
592
                                    </select>
593
                                </li>
594
                                [% END %]
595
596
                                <li>
597
                                    <label for="rrp">Retail price: </label>
598
                                    <span id="rrp"></span>
599
                                <li>
600
                                    <label for="replacementprice">Replacement price:</label>
601
                                    <input type="text" size="20" name="replacementprice" id="replacementprice" />
602
                                </li>
603
                                <li>
604
                                    <label for="ecost">Budgeted cost: </label>
605
                                    <span id="ecost"></span>
606
                                </li>
607
                                <li>
608
                                    <label for="unitprice">Actual cost:</label>
609
                                    <input type="text" size="20" name="unitprice" id="unitprice" />
610
                                    <span id="unitprice_hint" class="hint"></span>
611
                                    <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
612
                                </li>
613
                                <li id="select_currency">
614
                                    <label for="unitprice_currency"></label>
615
                                    <input type="text" size="20" name="unitprice_currency" id="unitprice_currency" value="" />
616
                                    [% IF currencies.count %]
617
                                    <select name="currency">
618
                                        <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
619
                                        [% FOR currency IN currencies %]
620
                                        <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
621
                                        [% END %]
622
                                    </select>
623
                                    [% END %]
624
                                </li>
625
                                <li>
626
                                    <label for="order_internalnote">Internal note: </label>
627
                                    <textarea name="order_internalnote" id="order_internalnote" width="40" rows="8" ></textarea>
628
                                </li>
629
                                <li>
630
                                    <label for="order_vendornote">Vendor note: </label>
631
                                    <span id="order_vendornote"></span>
632
                                </li>
633
                            </ol>
634
                        </div>
635
                    </div>
636
                </div>
637
                <div class="modal-footer">
638
                    <button type="button" class="btn btn-defualt modal-prev">Previous</button>
639
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
640
                    <button type="button" class="btn btn-primary modal-save">Save changes</button>
641
                    <button type="button" class="btn btn-defualt modal-next">Next</button>
642
                </div>
643
            </div>
644
        </div>
645
    </div>
375
[% ELSE %]
646
[% ELSE %]
376
    This ordernumber does not exist.
647
    This ordernumber does not exist.
377
[% END %]
648
[% END %]
Lines 387-396 Link Here
387
</div> <!-- /.row -->
658
</div> <!-- /.row -->
388
[% MACRO jsinclude BLOCK %]
659
[% MACRO jsinclude BLOCK %]
389
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
660
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
390
[% INCLUDE 'calendar.inc' %]
661
    [% INCLUDE 'calendar.inc' %]
391
    [% Asset.js("js/additem.js") | $raw %]
662
    [% Asset.js("js/additem.js") | $raw %]
392
    [% Asset.js("js/cataloging.js") | $raw %]
663
    [% Asset.js("js/cataloging.js") | $raw %]
664
    [% INCLUDE 'datatables.inc' %]
665
    [% INCLUDE 'js-date-format.inc' %]
666
    [% INCLUDE 'format_price.inc' %]
667
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
668
    <style>
669
        .lbl {
670
            font-weight: 700;
671
            text-align: right;
672
        }
673
        .modal-body ol {
674
            list-style-type: none;
675
        }
676
677
        .modal-body ol li {
678
            list-style-type: none;
679
            padding-bottom: 1em;
680
            width: 100%;
681
        }
682
683
        .modal-body h4 {
684
            margin-left: 1em;
685
            padding: .2em .5em;
686
            margin-bottom: 17px;
687
        }
688
689
        .modal-body label {
690
            margin-right: 1em;
691
            text-align: right;
692
            width: 11em;
693
            display: inline-block;
694
            font-weight: 700;
695
        }
696
697
        .modal-body textarea {
698
            vertical-align: text-top;
699
        }
700
    </style>
393
    <script>
701
    <script>
702
        [% IF order %]
394
        function Check(form) {
703
        function Check(form) {
395
            [% IF (AcqCreateItem == 'receiving') %]
704
            [% IF (AcqCreateItem == 'receiving') %]
396
                var total_errors = CheckMandatorySubfields(form);
705
                var total_errors = CheckMandatorySubfields(form);
Lines 541-546 Link Here
541
            });
850
            });
542
851
543
        });
852
        });
853
        [% ELSIF multiple_orders %]
854
855
        var _build_item = function(item, tr) {
856
            var chb = $('<input type="checkbox" name="items_to_receive" value="'+item.item_id+'" />')
857
                .prop('checked', item._checked)
858
                .change(function() {
859
                    item._checked = $(this).prop('checked');
860
                });
861
            tr.append($('<td style="text-align:center"></td>').append(chb));
862
            tr.append('<td><a style="cursor:pointer" onclick="PopupEditPage('+item.biblio_id+', '+item.item_id+');">'+EDIT[0].toUpperCase()+EDIT.substr(1).toLowerCase()+'</a></td>');
863
            tr.append('<td>'+(item.external_id||'')+'</td>');
864
            tr.append('<td>'+(item.home_branch && item.home_branch.name||'')+'</td>');
865
            tr.append('<td>'+(item.holding_branch && item.holding_branch.name||'')+'</td>');
866
            tr.append('<td>'+(item._authorised_values.not_for_loan_status && item._authorised_values.not_for_loan_status.lib||'')+'</td>');
867
            tr.append('<td>'+(item._authorised_values.restricted_status && item._authorised_values.restricted_status.lib||'')+'</td>');
868
            tr.append('<td><span class="shelvingloc">'+(item._authorised_values.location && item._authorised_values.location.lib||'')+'</span></td>');
869
            tr.append('<td>'+(item.callnumber||'')+'</td>');
870
            tr.append('<td>'+(item.copy_number||'')+'</td>');
871
            tr.append('<td>'+(item.inventory_number||'')+'</td>');
872
            tr.append('<td>'+(item._authorised_values.collection_code && item._authorised_values.collection_code.lib||'')+'</td>');
873
            tr.append('<td>'+(item.itemtype && item.itemtype.description || '')+'</td>');
874
            tr.append('<td>'+(item._authorised_values.materials_notes && item._authorised_values.materials_notes.lib||'')+'</td>')
875
            tr.append('<td>'+(item.public_notes||'')+'</td>');
876
        };
877
878
        var items_columns = [null, null, 'external_id', 'home_library_id',
879
                'holding_library_id', 'not_for_loan_status', 'restricted_status', 'location',
880
                'callnumber', 'copy_number', 'inventory_number', 'collection_code',
881
                'item_type', 'materials_notes', 'public_notes'];
882
883
        function PopupEditPage(biblionumber, itemnumber) {
884
            var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
885
                + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
886
            var w = window.open(url);
887
            var watchClose = setInterval(function() {
888
                if (w.closed) {
889
                    clearTimeout(watchClose);
890
                    $.ajax({
891
                        dataType: "json",
892
                        headers: {
893
                            "x-koha-embed": "home_branch,holding_branch,itemtype",
894
                            "x-koha-av": "1"
895
                        },
896
                        url: '/api/v1/items/'+itemnumber,
897
                        success: function(item) {
898
                            var tr = $("#item_"+itemnumber);
899
                            tr.html('');
900
                            _build_item(item, tr);
901
                        }
902
                    });
903
                }
904
            }, 500);
905
        }
906
907
        var periods={};
908
        var funds={};
909
        var funds_tree = [];
910
911
        var QTY_TOTAL = _("Receiving %0$s out of %1$s");
912
        var EDIT = _("edit");
913
        var MOD_TITLE = _("Edit %s");
914
        var SUGGESTION = _("suggestion #%s");
915
        var FUND_KEEP = _("Keep current (%0$s - %1$s)");
916
        var FUNC_CUR = _("(Current: %0$s - %1$s)");
917
        var ADJ_TAX_INC = _("(adjusted for %s, tax inclusive)");
918
        var ADJ_TAX_EXC = _("(adjusted for %s, tax exclusive)");
919
        var TAX_INC = _("(tax inclusive)");
920
        var TAX_EXC = _("(tax exclusive)");
921
        var SAVE_WARNING = _("Order %s: Warning, you have entered more items than expected. Items will not be created.");
922
        var SAVE_WARNING_NO_ITEMS = _("Order %s: No quantity to receive setted. No items will be created.");
923
        var SAVE_ERROR = _("Order %s: An error cocurred while saving");
924
925
926
        var CAN_user_acquisition = "[% CAN_user_acquisition | html %]";
927
        var AcqCreateItem = "[% Koha.Preference('AcqCreateItem') | html %]";
928
        var edit_mode = "[% edit | html %]";
929
        var invoiceincgst = "[% invoiceincgst | html %]";
930
        var active_currency = "[% active_currency.currency | html %]";
931
        var invoice_id = "[% invoiceid | html %]";
932
933
        $(document).ready(function(){
934
            var base_query = { "order_id": {"in": [[% multiple_orders | html %]]}};
935
            var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1";
936
            var options = {
937
                "ajax": {
938
                    "url": pending_orders_url + "&q=" + encodeURI(JSON.stringify(base_query)),
939
                    "headers": {
940
                        'x-koha-av': '1'
941
                    }
942
                },
943
                "header_filter": true,
944
                "embed": [
945
                    "basket",
946
                    "biblio.suggestions.suggester",
947
                    "fund.budget",
948
                    "items.home_branch",
949
                    "items.holding_branch",
950
                    "items.itemtype",
951
                    "creator"
952
                ],
953
                'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
954
                "columns": [
955
                    {
956
                        "data": "order_id",
957
                        "searchable": true,
958
                        "orderable": true
959
                    },
960
                    {
961
                        "data": "biblio.title",
962
                        "searchable": true,
963
                        "orderable": true,
964
                        "render": function(data, type, row, meta) {
965
                            if ( data == null ) {
966
                                return "";
967
                            }
968
                            else {
969
                                return data;
970
                            }
971
                        }
972
                    },
973
                    {
974
                        "data": "biblio.author",
975
                        "searchable": true,
976
                        "orderable": true,
977
                        "render": function(data, type, row, meta) {
978
                            if ( data == null ) {
979
                                return "";
980
                            }
981
                            else {
982
                                return data;
983
                            }
984
                        }
985
                    },
986
                    {
987
                        "data": "biblio.isbn",
988
                        "searchable": true,
989
                        "orderable": true,
990
                        "render": function(data, type, row, meta) {
991
                            if ( data == null ) {
992
                                return "";
993
                            }
994
                            else {
995
                                return data;
996
                            }
997
                        }
998
                    },
999
                    {
1000
                        "searchable": false,
1001
                        "orderable": false,
1002
                        "data": function(row, type, val, meta) {
1003
                            return $date(row.date_received||new Date().toISOString());
1004
                        }
1005
                    },
1006
                    {
1007
                        "data": "fund.name",
1008
                        "searchable": true,
1009
                        "orderable": false,
1010
                        "render": function(data, type, row, meta) {
1011
                            return row.fund.budget.budget_period_description+" - "+row.fund.name;
1012
                        }
1013
                    },
1014
                    {
1015
                        "searchable": false,
1016
                        "orderable": true,
1017
                        "data": "quantity_received",
1018
                        "render": function(data, type, row, meta) {
1019
                            return QTY_TOTAL.format(row.subscription_id?row.quantity:row.quantity_received, row.quantity);
1020
                        }
1021
                    },
1022
                    {
1023
                        "searchable": false,
1024
                        "orderable": false,
1025
                        "render": function(data, type, row, meta) {
1026
                            return '<a data-toggle="modal" href="#order_edit" data-row="'+meta.row+'" class="order_edit_toggle">'+EDIT+'</a>';
1027
                        }
1028
                    }
1029
                ]
1030
            };
1031
            var orders_table = $("#multiple_orders").api(options);
1032
            var api = orders_table.api();
1033
1034
            api.on('preDraw', function() {
1035
                var saved = $("#order_edit").data('saved');
1036
                if(saved) {
1037
                    var data = api.data();
1038
                    for(var i = 0; i<data.length; i++) {
1039
                        var row = data[i];
1040
                        var srow = saved[row.order_id];
1041
                        if(srow) {
1042
                            if(row.fund_id != srow.fund_id) {
1043
                                row.fund.budget.budget_period_description = $("#bookfund option[value="+srow.fund_id+"]").parent().attr('label');
1044
                                row.fund.name = $("#bookfund option[value="+srow.fund_id+"]").html();
1045
                            }
1046
                            row.date_received = srow.date_received;
1047
                            row.quantity = srow.quantity;
1048
                            row.quantity_received = srow.quantity_received;
1049
                        }
1050
                    }
1051
                }
1052
            });
1053
1054
            var _doSave = function(params) {
1055
                $.ajax($.extend({
1056
                    method: 'POST',
1057
                    url: '/cgi-bin/koha/acqui/finishreceive.pl'
1058
                }, params));
1059
            };
1060
1061
            var _set_error = function(error) {
1062
                if($('#jobfailed').html() == '') $('#jobfailed').append('<ul/>');
1063
                $('#jobfailed ul').append('<li>'+error+'</li>');
1064
            };
1065
1066
            var _transform_row = function(row, origrec) {
1067
                var params = {};
1068
                params['biblionumber'] = row.biblio_id;
1069
                params['invoiceid'] = invoice_id;
1070
                params['ordernumber'] = row.order_id;
1071
                params['booksellerid'] = row.basket.vendor_id;
1072
1073
                if(row.biblio.suggestions.length && row.biblio.suggestions[0].reason) {
1074
                    params["suggestionid"] = row.biblio.suggestions[0].suggestion_id;
1075
                    if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) {
1076
                        params['reason'] =  row.biblio.suggestions[0].reason;
1077
                    } else {
1078
                        params['reason'] = 'other';
1079
                        params['other_reason'] = row.biblio.suggestions[0].reason;
1080
                    }
1081
                }
1082
                params['datereceived'] = row.date_received;
1083
                params['bookfund'] = row.fund_id;
1084
                params['quantity'] = row.quantity;
1085
                params['quantityrec'] = row.quantity_received;
1086
                params['origquantityrec'] = origrec;
1087
                var effective_create_items = row.basket.create_items || AcqCreateItem;
1088
                params['tax_rate'] = (effective_create_items == 'receiving')?row.tax_rate_on_receiving:row.tax_rate_on_ordering;
1089
                params['replacementprice'] = row.replacement_price;
1090
                params['unitprice'] = invoiceincgst?row.unit_price_tax_included:row.unit_price_tax_excluded;
1091
                params['order_internalnote'] = row.internal_note;
1092
                if(effective_create_items == 'receiving') {
1093
                    Object.keys(row.items).forEach(function(key) {
1094
                        var item = row.items[key];
1095
                        Object.keys(item).forEach(function(key) {
1096
                            var field = item[key];
1097
                            Object.keys(field).forEach(function(key) {
1098
                                if(!params[key]) params[key] = [];
1099
                                params[key].push(item[key]);
1100
                            });
1101
                        });
1102
                    });
1103
                } else if(effective_create_items == 'ordering') {
1104
                    params['items_to_receive'] = (row.items||[])
1105
                        .filter(function(item) {
1106
                            return item._checked
1107
                        })
1108
                        .map(function(item) {
1109
                            item.item_id;
1110
                        })
1111
                }
1112
                return params;
1113
            };
1114
1115
            $('.save').click(function() {
1116
                var data = $("#order_edit").data();
1117
                var rows = api.rows().data();
1118
                $('this').prop('disabled', true);
1119
                var redirect = true;
1120
                if(rows.length) {
1121
                    $('#jobfailed, #jobpanel, #jobstatus').show();
1122
1123
                    var loopRows = function(i) {
1124
                        var row = rows[i];
1125
                        if(!row) {
1126
                            if(redirect) {
1127
                                location.href = "/cgi-bin/koha/acqui/parcel.pl?invoiceid="+invoice_id
1128
                            }
1129
                            return;
1130
                        }
1131
                        if(data.saved && data.saved[row.order_id]) {
1132
                            row = data.saved[row.order_id];
1133
                            var origrec = data.origrec[row.order_id];
1134
                        } else {
1135
                            var origrec = row.quantity_received;
1136
                        }
1137
                        if(row.subscription_id) row.quantity_received = row.quantity;
1138
                        var _set_percentage = function() {
1139
                            var percentage = Math.round(( (i+1) / rows.length) * 100);
1140
                            var bgproperty = (parseInt(percentage*2)-300)+"px 0px";
1141
                            $("#jobprogress").css("background-position",bgproperty);
1142
                            $("#jobprogresspercent").text(percentage);
1143
                        }
1144
                        if(row.quantity_received > row.quantity) {
1145
                            _set_error(SAVE_WARNING.format(row.order_id));
1146
                            row.quantity_received = row.quantity;
1147
                        }
1148
                        if(row.quantity_received == '0') {
1149
                            _set_error(SAVE_WARNING_NO_ITEMS.format(row.order_id));
1150
                        }
1151
                        _doSave({
1152
                            data: _transform_row(row, origrec),
1153
                            success: function() {
1154
                                _set_percentage();
1155
                                loopRows(i+1);
1156
                            },
1157
                            error: function() {
1158
                                _set_percentage()
1159
                                _set_error(SAVE_ERROR.format(row.order_id));
1160
                                redirect = false;
1161
                                loopRows(i+1);
1162
                            }
1163
                        });
1164
                    };
1165
                    loopRows(0)
1166
                }
1167
            });
1168
1169
            $("#order_edit").on("change", "#reason", function() {
1170
                var val = $(this).val();
1171
                var row = $("#order_edit").data('row');
1172
                if(val == 'other') {
1173
                    $("#other_reason").show();
1174
                    $(this).hide();
1175
                } else {
1176
                    row.biblio.suggestions[0].reason = val;
1177
                }
1178
            });
1179
1180
            $("#order_edit").on("change", "#select-other_reason", function() {
1181
                var val = $(this).val();
1182
                var row = $("#order_edit").data('row');
1183
                row.biblio.suggestions[0].reason = val;
1184
            });
1185
1186
            $("#order_edit").on("click", "#other_reason a", function() {
1187
                $("#other_reason").hide();
1188
                $("#reason").val(null).show();
1189
            });
1190
1191
            $("#order_edit").on("change", "#datereceived", function() {
1192
                var val = $(this).val();
1193
                var row = $("#order_edit").data('row');
1194
                row.date_received = val;
1195
            });
1196
1197
            $("#order_edit").on("change", "#bookfund", function() {
1198
                var val = $(this).val();
1199
                var row = $("#order_edit").data('row');
1200
                row.fund_id = val;
1201
            });
1202
1203
            $("#order_edit").on("change", "#quantity_to_receive", function() {
1204
                var val = $(this).val();
1205
                var row = $("#order_edit").data('row');
1206
                row.quantity = val;
1207
                if(row.subscription_id) {
1208
                    $("#quantity").val(val).change();
1209
                }
1210
            });
1211
1212
            $("#order_edit").on("change", "#quantity", function() {
1213
                var val = $(this).val();
1214
                var row = $("#order_edit").data('row');
1215
                row.quantity_received = val;
1216
                var qtyto = parseInt($("#quantity_to_receive").val());
1217
                if(parseInt(val) > qtyto) {
1218
                    $("#qtyrecerror").show();
1219
                } else {
1220
                    $("#qtyrecerror").hide();
1221
                }
1222
                $("input[name='items_to_receive']").each(function() {
1223
                    $(this).prop('checked', false).change();
1224
                });
1225
                $("input[name='items_to_receive']:lt("+val+")").each(function () {
1226
                    $(this).prop('checked', true).change();
1227
                });
1228
            });
1229
1230
            $("#order_edit").on("change", "input[name='items_to_receive']", function() {
1231
                var qty = $("input[name='items_to_receive']:checked").length;
1232
                $("#quantity").val(qty);
1233
                var row = $("#order_edit").data('row');
1234
                row.quantity_received = qty;
1235
            })
1236
1237
            $("#order_edit").on("change", "#tax_rate", function() {
1238
                var val = $(this).val();
1239
                if(val === null) $(this).val($('option:first-child', this).attr('value'));
1240
                val = $(this).val();
1241
                var row = $("#order_edit").data('row');
1242
                var effective_create_items = row.basket.create_items || AcqCreateItem;
1243
                if(effective_create_items == 'receiving') {
1244
                    row.tax_rate_on_receiving = val;
1245
                } else {
1246
                    row.tax_rate_on_ordering = val;
1247
                }
1248
1249
            });
1250
1251
            $("#order_edit").on("change", "#unitprice", function() {
1252
                var val = $(this).val();
1253
                var row = $("#order_edit").data('row');
1254
                if(invoiceincgst) {
1255
                    row.unit_price_tax_included = val;
1256
                } else {
1257
                    row.unit_price_tax_excluded = val;
1258
                }
1259
1260
            });
1261
1262
            $("#order_edit").on("change", "input[name='change_currency']", function(){
1263
                if ( $(this).is(":checked") ) {
1264
                    $("#select_currency").show();
1265
                    $("#unitprice").prop("readonly", "true");
1266
                } else {
1267
                    $("#select_currency").hide();
1268
                    $("#unitprice").prop("readonly", "");
1269
                }
1270
            });
1271
1272
            function _update_unitprice() {
1273
                var rate = Number($("select[name='currency'] option:selected").val());
1274
                var unitprice = $("#unitprice_currency").val();
1275
                var new_unitprice = Number( unitprice * rate ).toFixed(2);
1276
                $("#unitprice").val(new_unitprice).change();
1277
            }
1278
            $("#order_edit").on("change", "select[name='currency']", _update_unitprice );
1279
            $("#order_edit").on("change", "#unitprice_currency", _update_unitprice );
1280
1281
            $("#order_edit").on("change", "#replacementprice", function() {
1282
                var val = $(this).val();
1283
                var row = $("#order_edit").data('row');
1284
                row.replacement_price = val;
1285
            });
1286
1287
            $("#order_edit").on("change", "#order_internalnote", function() {
1288
                var val = $(this).val();
1289
                var row = $("#order_edit").data('row');
1290
                row.internal_note = val;
1291
1292
            });
1293
1294
            var keep_row = function() {
1295
                var row = $("#order_edit").data('row');
1296
                var kept = $("#order_edit").data('kept')||{};
1297
                if($('#items_list tbody tr').length) {
1298
                    row.items = [];
1299
                    $('#items_list tbody tr').each(function() {
1300
                        var item = {};
1301
                        $('#'+$(this).attr('idblock')).find('*[name=kohafield]').each(function() {
1302
                            var kf = $(this).val();
1303
                            var obj = {};
1304
                            $(this).parent().find('*[name]').each(function() {
1305
                                obj[$(this).prop('name')] = $(this).val();
1306
                            });
1307
                            item[kf] = obj;
1308
                        });
1309
                        row.items.push(item);
1310
                    });
1311
                }
1312
                kept[row.order_id] = row;
1313
                $("#order_edit").data('kept', kept);
1314
            };
1315
1316
            var save_row = function() {
1317
                keep_row();
1318
                var saved = $("#order_edit").data('saved')||{};
1319
                var kept = $("#order_edit").data('kept');
1320
                $("#order_edit").data('saved', $.extend(saved, kept));
1321
                api.draw();
1322
            }
1323
1324
            var set_modal_buttons = function() {
1325
                var n = $("#order_edit").data('n');
1326
                var info = api.page.info();
1327
1328
                $('.modal-prev').prop('disabled', info.page == 0 && n == 0);
1329
                $('.modal-next').prop('disabled', info.pages - 1 == info.page && info.end - info.start - 1 == n);
1330
            };
1331
1332
            var show_subs = function(row) {
1333
                //$("#child_orders").show();
1334
                var had_rows = false;
1335
                var base_query = { "subscription_id": row.subscription_id, "parent_order_id": row.order_id, "order_id": {"!=": row.order_id}};
1336
                var pending_orders_url = "/api/v1/acquisitions/orders";
1337
                var options = {
1338
                    "ajax": {
1339
                        "url": pending_orders_url + "?q=" + encodeURI(JSON.stringify(base_query))
1340
                    },
1341
                    "header_filter": true,
1342
                    "embed": [
1343
                        "invoice",
1344
                        "basket"
1345
                    ],
1346
                    "order": [[1, 'asc']],
1347
                    'dom': 'C<"top pager"ilpfB>tr<"bottom pager"ip>',
1348
                    "columns": [
1349
                        {
1350
                            "searchable": false,
1351
                            "orderable": false,
1352
                            "data": function(row, type, val, meta) {
1353
                                if(row.invoice) {
1354
                                    if(CAN_user_acquisition) {
1355
                                        return '<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid='+row.invoice_id+'" title="Invoice detail page">'+row.invoice.invoice_number+"</a>";
1356
                                    }
1357
                                    return row.invoice.invoice_number;
1358
                                }
1359
                            }
1360
                        },
1361
                        {
1362
                            "data": "order_id",
1363
                            "searchable": false,
1364
                            "orderable": false
1365
                        },
1366
                        {
1367
                            "searchable": false,
1368
                            "orderable": false,
1369
                            "data": "basket.creation_date",
1370
                            "render": function(data, type, row, meta) {
1371
                                return $date(row.basket.creation_date);
1372
                            }
1373
                        },
1374
                        {
1375
                            "searchable": false,
1376
                            "orderable": false,
1377
                            "data": function(row, type, val, meta) {
1378
                                return $date(row.date_received);
1379
                            }
1380
                        },
1381
                        {
1382
                            "searchable": false,
1383
                            "orderable": false,
1384
                            "data": function(row, type, val, meta) {
1385
                                return row.quantity_received;
1386
                            }
1387
                        },
1388
                        {
1389
                            "searchable": false,
1390
                            "orderable": true,
1391
                            "data": function(row, type, val, meta) {
1392
                                if(!row.status) return;
1393
                                var first_letter = row.status[0].toUpperCase();
1394
                                return first_letter+row.status.substr(1).toLowerCase();
1395
                            }
1396
                        },
1397
                        {
1398
                            "searchable": false,
1399
                            "orderable": false,
1400
                            "data": function(row, type, val, meta) {
1401
                                if(!row.date_received) return;
1402
                                return Number(row.unit_price_tax_excluded * row.quantity_received).format_price()+' / '+Number(row.unit_price_tax_included * row.quantity_received).format_price()
1403
                            }
1404
                        },
1405
                        {
1406
                            "searchable": false,
1407
                            "orderable": false,
1408
                            "data": function(row, type, val, meta) {
1409
                                return row.internal_note;
1410
                            }
1411
                        }
1412
                    ]
1413
                };
1414
                var child_orders_table = $("#child_orders_table").api(options);
1415
                var child_api = child_orders_table.api();
1416
                child_api.on('preDraw', function() {
1417
                    if(!child_api.data().length && !had_rows) return;
1418
                    $("#child_orders").show();
1419
                    had_rows = true;
1420
                });
1421
            };
1422
1423
            var set_editor = function() {
1424
                var modal = $("#order_edit");
1425
                var row = modal.data('row');
1426
                var origrec = $("#order_edit").data('origrec')||{};
1427
                if(!origrec.hasOwnProperty(row.order_id)) {
1428
                    origrec[row.order_id] = row.quantity_received;
1429
                    $("#order_edit").data('origrec', origrec);
1430
                }
1431
                if(row.subscription_id) {
1432
                    row.quantity_received = row.quantity;
1433
                }
1434
                var keep = $("#order_edit").data('kept');
1435
                if(keep && keep[row.order_id]) {
1436
                    row = keep[row.order_id];
1437
                    modal.data('row', row);
1438
                }
1439
                $('input, select, textarea', '.modal-body').val(null)
1440
                modal.find(".modal-title").text(MOD_TITLE.format(row.biblio.title));
1441
                ["title", "author", "copyright_date", "isbn", "series_title"].forEach(function(key){
1442
                    var o = modal.find(".modal-body #biblio_"+key);
1443
                    if(row.biblio[key] !== null) {
1444
                        o.parent().show();
1445
                        o.html(row.biblio[key]);
1446
                    } else {
1447
                        o.parent().hide();
1448
                    }
1449
                });
1450
                if(row.biblio.suggestions.length) {
1451
                    $("#suggestion_fieldset").show();
1452
                    if(row.biblio.suggestions[0].suggester) {
1453
                        $("#biblio_suggestion_suggester").parent().show();
1454
                        $("#biblio_suggestion_suggester")
1455
                            .html(
1456
                                [row.biblio.suggestions[0].suggester.surname, row.biblio.suggestions[0].suggester.firstname]
1457
                                    .filter(function(name){
1458
                                        return name
1459
                                    })
1460
                                    .join(', ')+' (<a href="http://localhost:8081/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestionid+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestionid)+'</a>)'
1461
                            );
1462
                    } else {
1463
                        $("#biblio_suggestion_suggester").parent().hide();
1464
                    }
1465
                    if(row.biblio.suggestions[0].reason) {
1466
                        $("#suggestion_reason").show();
1467
                        if($("#reason option[value='"+row.biblio.suggestions[0].reason+"']").length) {
1468
                             $("#other_reason a").click();
1469
                            $("#reason").val(row.biblio.suggestions[0].reason);
1470
                            $("#select-other_reason").val(null);
1471
                        } else {
1472
                            $("#reason").val("other").change();
1473
                            $("#select-other_reason").val(row.biblio.suggestions[0].reason);
1474
                        }
1475
1476
                    } else {
1477
                        $("#suggestion_reason").hide();
1478
                    }
1479
                } else {
1480
                    $("#suggestion_fieldset").hide();
1481
                }
1482
1483
                var effective_create_items = row.basket.create_items || AcqCreateItem;
1484
                $("#datereceived").val(row.date_received||$date(new Date().toISOString())).change();
1485
                $("#bookfund option[value='']").html(FUND_KEEP.format(row.fund.budget.budget_period_description, row.fund.name));
1486
                if(row.fund_id != row.fund.fund_id) {
1487
                    $("#bookfund").val(row.fund_id);
1488
                }
1489
                $("#current-fund").html(FUNC_CUR.format(row.fund.budget.budget_period_description, row.fund.name));
1490
                $("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')')
1491
                $("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id);
1492
                $("#quantity").val(row.quantity_received).prop('readonly', !row.subscription_id && effective_create_items == 'receiving');
1493
                $('#qtyrecerror').hide();
1494
                var tax_rate = row.tax_rate_on_receiving || row.tax_rate_on_ordering;
1495
                $("#tax_rate").val(tax_rate).change();
1496
                var rrp_txt;
1497
                var ecost_txt;
1498
                if(invoiceincgst) {
1499
                    rrp_txt = Number(row.rrp_tax_included).format_price()+'<span class="hint">'+ADJ_TAX_INC.format(active_currency)+"</span>";
1500
                    ecost_txt = Number(row.ecost_tax_included).format_price()+'<span class="hint">'+TAX_INC+"</span>";
1501
                    $("#unitprice").val(row.unit_price_tax_included);
1502
                    $("#unitprice_hint").html(TAX_INC);
1503
                } else {
1504
                    rrp_txt = Number(row.rrp_tax_excluded).format_price()+'<span class="hint">'+ADJ_TAX_EXC.format(active_currency)+"</span>";
1505
                    ecost_txt = Number(row.ecost_tax_excluded).format_price()+'<span class="hint">'+TAX_EXC+"</span>";
1506
                    $("#unitprice").val(row.unit_price_tax_excluded);
1507
                    $("#unitprice_hint").html(TAX_EXC);
1508
                }
1509
                $("#rrp").html(rrp_txt);
1510
                $("#replacementprice").val(row.replacement_price);
1511
                $("#ecost").html(ecost_txt);
1512
                $("#order_internalnote").val(row.internal_note);
1513
                if(row.vendor_note) {
1514
                    $("#order_vendornote").html(row.vendor_note);
1515
                    $("#order_vendornote").parent().show();
1516
                } else {
1517
                    $("#order_vendornote").parent().hide();
1518
                }
1519
1520
1521
                $("#child_orders").hide();
1522
1523
                $('#items_list tbody tr, #outeritemblock > *, #acq-create-ordering tbody tr').remove();
1524
                $('#items_list').hide();
1525
                if(row.subscription_id) {
1526
                    $('#modal-order-main').tabs("disable", "#items-panel");
1527
                    $('#modal-order-main').tabs("enable", "#history-panel");
1528
                    if($('#modal-order-main').tabs( "option", "active" ) == 3) {
1529
                        $('#modal-order-main').tabs( "option", "active", 0);
1530
                    }
1531
                } else {
1532
                    $('#modal-order-main').tabs("enable", "#items-panel");
1533
                    $('#modal-order-main').tabs("disable", "#history-panel");
1534
                    if($('#modal-order-main').tabs( "option", "active" ) == 2) {
1535
                        $('#modal-order-main').tabs( "option", "active", 0);
1536
                    }
1537
                    if(effective_create_items == 'receiving') {
1538
                        $("#acq-create-receiving").show();
1539
                        $("#acq-create-ordering").hide();
1540
                        if(row.items && row.items.length) {
1541
                            row.items.forEach(function(item, index) {
1542
                                cloneItemBlock(index, '[% UniqueItemFields | html %]', function(block_id) {
1543
                                    var block = $('#'+block_id).hide();
1544
                                    Object.keys(item).forEach(function(key) {
1545
                                        block
1546
                                            .find('*[name=kohafield][value="'+key+'"]')
1547
                                            .parent()
1548
                                            .find('*[name=field_value]')
1549
                                            .val(item[key].field_value);
1550
                                    });
1551
                                    addItemInList(block_id, '[% UniqueItemFields | html %]');
1552
                                    block.find("input[name='buttonPlus']").val( (window.MSG_ADDITEM_JS_UPDATEITEM ) );
1553
                                    block.find("input[name='buttonPlusMulti']").remove();
1554
                                    block.find("input[name='multiValue']").remove();
1555
                                });
1556
                            });
1557
                        }
1558
                        cloneItemBlock((row.items && row.items.length) || 0, '[% UniqueItemFields | html %]');
1559
                    } else if (effective_create_items == 'ordering') {
1560
                        $("#acq-create-receiving").hide();
1561
                        $("#acq-create-ordering").show();
1562
                        if(row.items.length) {
1563
                            $("#acq-create-ordering tbody").append(
1564
                                row.items.map(function(item) {
1565
                                    var tr = $('<tr id="item_'+item.item_id+'"/>');
1566
                                    _build_item(item, tr);
1567
                                    return tr;
1568
                                })
1569
                            );
1570
                        }
1571
                    } else {
1572
                        if($('#modal-order-main').tabs( "option", "active" ) == 3) {
1573
                            $('#modal-order-main').tabs( "option", "active", 0);
1574
                        }
1575
                        $('#modal-order-main').tabs("disable", "#items-panel");
1576
                    }
1577
                }
1578
1579
                set_modal_buttons();
1580
            };
1581
1582
            $('.modal-prev').click(function() {
1583
                var modal = $("#order_edit");
1584
                keep_row();
1585
                var n = modal.data('n');
1586
                if(n > 0) {
1587
                    n--;
1588
                    modal.data('row', JSON.parse(JSON.stringify(api.row(n).data())));
1589
                    modal.data('n', n);
1590
                    set_editor();
1591
                } else {
1592
                    $('.modal-next, .modal-prev').prop('disabled', true);
1593
                    orders_table.one('draw.dt', function() {
1594
                        var info = api.page.info();
1595
                        n = info.end - info.start - 1;
1596
                        modal.data('row', JSON.parse(JSON.stringify(api.row(n).data())));
1597
                        modal.data('n', n);
1598
                        set_editor();
1599
                    });
1600
                    api.page('previous').draw( 'page' );
1601
                }
1602
            });
1603
1604
            $('.modal-next').click(function() {
1605
                var modal = $("#order_edit");
1606
                keep_row();
1607
                var n = modal.data('n');
1608
                var info = api.page.info();
1609
                if(n < info.end - info.start - 1) {
1610
                    n++;
1611
                    modal.data('row', JSON.parse(JSON.stringify(api.row(n).data())));
1612
                    modal.data('n', n);
1613
                    set_editor();
1614
                } else {
1615
                    $('.modal-next, .modal-prev').prop('disabled', true);
1616
                    orders_table.one('draw.dt', function() {
1617
                        var info = api.page.info();
1618
                        n = 0;
1619
                        modal.data('row', JSON.parse(JSON.stringify(api.row(n).data())));
1620
                        modal.data('n', n);
1621
                        set_editor();
1622
                    });
1623
                    api.page('next').draw( 'page' );
1624
                }
1625
            });
1626
1627
            $('.modal-save').click(function() {
1628
                save_row();
1629
                $("#order_edit").modal('hide');
1630
            })
1631
1632
            $('#modal-order-main').tabs({
1633
                activate: function(event, ui) {
1634
                    var active = ui.newPanel.attr('id')
1635
                    if(active == 'history-panel') {
1636
                        show_subs($("#order_edit").data('row'));
1637
                    }
1638
                }
1639
            });
1640
1641
            $("#order_edit").on("show.bs.modal", function (event) {
1642
                var anchor = $(event.relatedTarget);
1643
                var n = anchor.data("row");
1644
                var row = api.row(n).data();
1645
1646
                var modal = $(this);
1647
                modal.data('row', JSON.parse(JSON.stringify(row)));
1648
                modal.data('n', n);
1649
                modal.data('keep', modal.data('saved')||{});
1650
                $('#modal-order-main').tabs("option", "active", 0);
1651
                set_editor();
1652
            });
1653
/*            $("#order_edit").on("shown.bs.modal", function() {
1654
                var modal = $(this);
1655
1656
                if(modal.data('show_subs')) show_subs(modal.data('row'));
1657
            });*/
1658
            $("#order_edit").on("hide.bs.modal", function() {
1659
                $("#child_orders_table").DataTable().off('preDraw').destroy();
1660
            });
1661
        });
1662
        [% END %]
544
    </script>
1663
    </script>
545
[% END %]
1664
[% END %]
546
1665
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-5 / +66 lines)
Lines 102-107 Link Here
102
        <table id="pending_orders" class="table table-bordered table-striped">
102
        <table id="pending_orders" class="table table-bordered table-striped">
103
            <thead>
103
            <thead>
104
                <tr>
104
                <tr>
105
                    [% IF Koha.Preference('AcqReceiveMultipleOrderLines') %]
106
                    <th><!--input type="checkbox" id="selectAll"/--></th>
107
                    [% END %]
105
                    <th>Basket</th>
108
                    <th>Basket</th>
106
                    <th>Basket group</th>
109
                    <th>Basket group</th>
107
                    <th>Order line</th>
110
                    <th>Order line</th>
Lines 117-122 Link Here
117
                </tr>
120
                </tr>
118
            </thead>
121
            </thead>
119
        </table>
122
        </table>
123
      [% IF Koha.Preference('AcqReceiveMultipleOrderLines') %]
124
      <fieldset class="action">
125
        <button id="select_multiple"></button>
126
      </fieldset>
127
      [% END %]
120
    </div>
128
    </div>
121
[% ELSE %]
129
[% ELSE %]
122
    <p>
130
    <p>
Lines 330-337 Link Here
330
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
338
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
331
    [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
339
    [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
332
    <style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
340
    <style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
341
    <style>fieldset.action { margin-bottom: 20px }</style>
333
    <script>
342
    <script>
334
        dt_overwrite_html_sorting_localeCompare();
343
        dt_overwrite_html_sorting_localeCompare();
344
        var PENDING_MULTI_SELECTION = _("Receive selected (%s)");
335
        var columns_filter = {};
345
        var columns_filter = {};
336
346
337
        function _escape_str(s){
347
        function _escape_str(s){
Lines 370-376 Link Here
370
                }));
380
                }));
371
            }
381
            }
372
382
373
            var pending_orders_table = $("#pending_orders").api({
383
            var options = {
374
                "ajax": {
384
                "ajax": {
375
                    "url": '/api/v1/acquisitions/orders?only_active=1'
385
                    "url": '/api/v1/acquisitions/orders?only_active=1'
376
                },
386
                },
Lines 398-404 Link Here
398
                },
408
                },
399
                "columns": [
409
                "columns": [
400
                    { "data": "basket.name",
410
                    { "data": "basket.name",
401
                    "searchable": true,
411
                      "searchable": true,
402
                      "orderable": true,
412
                      "orderable": true,
403
                      "render": function(data, type, row, meta) {
413
                      "render": function(data, type, row, meta) {
404
                        if (type != 'display') return _escape_str(data);
414
                        if (type != 'display') return _escape_str(data);
Lines 507-513 Link Here
507
517
508
                            return result;
518
                            return result;
509
                        },
519
                        },
510
                        "orderable": false,
520
                        "orderable": false
511
                    },
521
                    },
512
                    {
522
                    {
513
                        "data": "",
523
                        "data": "",
Lines 627-633 Link Here
627
                        "searchable": false
637
                        "searchable": false
628
                    }
638
                    }
629
                ]
639
                ]
630
            }, {}, 1, {"basket.vendor_id": [% booksellerid | html %]});
640
           };
641
642
            [% IF Koha.Preference('AcqReceiveMultipleOrderLines') %]
643
            var selected_rows = {};
644
            $('#select_multiple').click(function() {
645
              var ids = Object.keys(selected_rows);
646
              if(!ids.length) return;
647
              if(ids.length == 1) {
648
                location.href = 'orderreceive.pl?ordernumber='+ids[0]+ '&invoiceid=[% invoiceid | uri %]';
649
              } else {
650
                location.href = 'orderreceive.pl?multiple_orders='+ids.join(',')+ '&invoiceid=[% invoiceid | uri %]';
651
              }
652
            }).html(PENDING_MULTI_SELECTION.format('0'))
653
            options.select = {
654
              style: 'api'
655
            };
656
            options.order = [[1, 'asc']];
657
            options.columns.unshift({
658
              "data": function(row, type, val, meta) {
659
                  return '<input type="checkbox" class="selOrder" />';
660
              },
661
              "searchable": false,
662
              "orderable": false
663
            });
664
            [% END %]
665
666
            var pending_orders_table = $("#pending_orders").api(options, {}, 1, {"basket.vendor_id": [% booksellerid | html %]});
667
668
            [% IF Koha.Preference('AcqReceiveMultipleOrderLines') %]
669
            var api = pending_orders_table.api();
670
            api.on('draw', function() {
671
              api.rows().every(function() {
672
                var row = this;
673
                var data = row.data();
674
                $('.selOrder', row.node()).on('click', function(event) {
675
                  if($(this).prop('checked')) {
676
                    row.select();
677
                    selected_rows[data.order_id] = data;
678
                  } else {
679
                    row.deselect();
680
                    delete selected_rows[data.order_id];
681
                  }
682
                  $('#select_multiple').html(PENDING_MULTI_SELECTION.format(Object.keys(selected_rows).length));
683
                });
684
                if(selected_rows[data.order_id]) {
685
                  row.select();
686
                  $('.selOrder', row.node()).prop('checked', true);
687
                }
688
              });
689
            });
690
691
            [% END %]
692
631
693
632
            $(".previewData").on("click", function(e){
694
            $(".previewData").on("click", function(e){
633
                e.preventDefault();
695
                e.preventDefault();
634
- 

Return to bug 8179