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

(-)a/acqui/orderreceive.pl (-39 / +3 lines)
Lines 118-159 unless($acq_fw) { Link Here
118
    $template->param('NoACQframework' => 1);
118
    $template->param('NoACQframework' => 1);
119
}
119
}
120
120
121
my $AcqCreateItem = $basket->effective_create_items;
122
if ($AcqCreateItem eq 'receiving') {
123
    $template->param(
124
        AcqCreateItemReceiving => 1,
125
        UniqueItemFields => C4::Context->preference('UniqueItemFields'),
126
    );
127
} elsif ($AcqCreateItem eq 'ordering') {
128
    my $fw = ($acq_fw) ? 'ACQ' : '';
129
    my $items = $order->items;
130
    $template->param(items => $items);
131
}
132
133
$order->quantityreceived = '' if $order->quantityreceived == 0;
134
135
my $unitprice = $order->unitprice;
136
my ( $rrp, $ecost );
137
if ( $bookseller->invoiceincgst ) {
138
    $rrp = $order->rrp_tax_included;
139
    $ecost = $order->ecost_tax_included;
140
    unless ( $unitprice != 0 and defined $unitprice) {
141
        $unitprice = $order->ecost_tax_included;
142
    }
143
} else {
144
    $rrp = $order->rrp_tax_excluded;
145
    $ecost = $order->ecost_tax_excluded;
146
    unless ( $unitprice != 0 and defined $unitprice) {
147
        $unitprice = $order->ecost_tax_excluded;
148
    }
149
}
150
151
my $tax_rate;
152
if( defined $order->tax_rate_on_receiving ) {
153
    $tax_rate = $order->tax_rate_on_receiving + 0.0;
154
} else {
155
    $tax_rate = $order->tax_rate_on_ordering + 0.0;
156
}
157
121
158
my $creator = Koha::Patrons->find( $order->created_by );
122
my $creator = Koha::Patrons->find( $order->created_by );
159
123
Lines 188-194 if ( $order->subscriptionid ) { Link Here
188
}
152
}
189
153
190
$template->param(
154
$template->param(
191
    AcqCreateItem         => $AcqCreateItem,
192
    count                 => 1,
155
    count                 => 1,
193
    order                 => $order,
156
    order                 => $order,
194
    freight               => $freight,
157
    freight               => $freight,
Lines 197-204 $template->param( Link Here
197
    currencies            => scalar $currencies->search({ rate => { '!=' => 1 } }),
160
    currencies            => scalar $currencies->search({ rate => { '!=' => 1 } }),
198
    invoiceincgst         => $bookseller->invoiceincgst,
161
    invoiceincgst         => $bookseller->invoiceincgst,
199
    bookfund              => $budget->{budget_name},
162
    bookfund              => $budget->{budget_name},
200
    rrp                   => $rrp,
201
    ecost                 => $ecost,
202
    creator               => $creator,
163
    creator               => $creator,
203
    invoiceid             => $invoice->{invoiceid},
164
    invoiceid             => $invoice->{invoiceid},
204
    invoice               => $invoice->{invoicenumber},
165
    invoice               => $invoice->{invoicenumber},
Lines 225-230 foreach my $period (@$periods) { Link Here
225
    my @funds;
186
    my @funds;
226
    foreach my $r ( @{$budget_hierarchy} ) {
187
    foreach my $r ( @{$budget_hierarchy} ) {
227
        next unless ( CanUserUseBudget( $patron, $r, $userflags ) );
188
        next unless ( CanUserUseBudget( $patron, $r, $userflags ) );
189
        if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
190
            next;
191
        }
228
        push @funds,
192
        push @funds,
229
          {
193
          {
230
            b_id  => $r->{budget_id},
194
            b_id  => $r->{budget_id},
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-11 / +11 lines)
Lines 19-24 Link Here
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 %]
22
        <div class="col-sm-10 col-sm-push-2">
23
        <div class="col-sm-10 col-sm-push-2">
23
            <main>
24
            <main>
24
25
Lines 141-147 Link Here
141
                </tbody>
142
                </tbody>
142
            </table>
143
            </table>
143
        </fieldset>
144
        </fieldset>
144
    [% ELSIF (AcqCreateItemReceiving) %]
145
    [% ELSIF (AcqCreateItem == 'receiving') %]
145
        <div id="items_list" style="display:none">
146
        <div id="items_list" style="display:none">
146
            <p><strong>Items list</strong></p>
147
            <p><strong>Items list</strong></p>
147
            <div style="width:100%;overflow:auto;">
148
            <div style="width:100%;overflow:auto;">
Lines 184-190 Link Here
184
          </fieldset>
185
          </fieldset>
185
        [% END %]
186
        [% END %]
186
    [% ELSIF (AcqCreateItem == 'ordering') %]
187
    [% ELSIF (AcqCreateItem == 'ordering') %]
187
        [% IF (items.count) %]
188
        [% IF (order.items.size) %]
188
            <h5>Items</h5>
189
            <h5>Items</h5>
189
            <div style="width:100%;overflow:auto">
190
            <div style="width:100%;overflow:auto">
190
                <table>
191
                <table>
Lines 208-214 Link Here
208
                        </tr>
209
                        </tr>
209
                    </thead>
210
                    </thead>
210
                    <tbody>
211
                    <tbody>
211
                        [% FOREACH item IN items %]
212
                        [% FOREACH item IN order.items %]
212
                            <tr id="item_[% item.itemnumber | html %]">
213
                            <tr id="item_[% item.itemnumber | html %]">
213
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
214
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
214
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
215
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
Lines 277-283 Link Here
277
          [% IF order.subscriptionid %]
278
          [% IF order.subscriptionid %]
278
              <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
279
              <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
279
              <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
280
              <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
280
          [% ELSIF AcqCreateItemReceiving %]
281
          [% ELSIF AcqCreateItem == 'receiving' %]
281
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
282
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
282
          [% ELSE %]
283
          [% ELSE %]
283
            [% IF ( order.quantityreceived ) %]
284
            [% IF ( order.quantityreceived ) %]
Lines 285-291 Link Here
285
                    <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
286
                    <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
286
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
287
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
287
                [% ELSE %]
288
                [% ELSE %]
288
                    [% IF ( items ) %]
289
                    [% IF ( order.items.count ) %]
289
                        <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 %]" />
290
                    [% ELSE %]
291
                    [% ELSE %]
291
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
292
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
Lines 300-306 Link Here
300
                <p class="error">Warning, you have entered more items than expected.
301
                <p class="error">Warning, you have entered more items than expected.
301
                Items will not be created.</p>
302
                Items will not be created.</p>
302
            </div>
303
            </div>
303
          [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItemReceiving) %]
304
          [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
304
		</li>
305
		</li>
305
306
306
        [% IF ( gst_values ) %]
307
        [% IF ( gst_values ) %]
Lines 392-398 Link Here
392
    [% Asset.js("js/cataloging.js") | $raw %]
393
    [% Asset.js("js/cataloging.js") | $raw %]
393
    <script>
394
    <script>
394
        function Check(form) {
395
        function Check(form) {
395
            [% IF (AcqCreateItemReceiving) %]
396
            [% IF (AcqCreateItem == 'receiving') %]
396
                var total_errors = CheckMandatorySubfields(form);
397
                var total_errors = CheckMandatorySubfields(form);
397
                if (total_errors != 0) {
398
                if (total_errors != 0) {
398
                    var alertString = _("Form not submitted because of the following problem(s)");
399
                    var alertString = _("Form not submitted because of the following problem(s)");
Lines 402-408 Link Here
402
                    return false;
403
                    return false;
403
                }
404
                }
404
405
405
                if(check_additem('[% UniqueItemFields | html %]') == false){
406
                if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
406
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
407
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
407
                    return false;
408
                    return false;
408
                };
409
                };
Lines 420-426 Link Here
420
                    $(lastitemblock).remove();
421
                    $(lastitemblock).remove();
421
                }
422
                }
422
423
423
                if(check_additem('[% UniqueItemFields | html %]') == false){
424
                if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
424
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
425
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
425
                    if(tobedeleted) {
426
                    if(tobedeleted) {
426
                        $(lastitemblock).appendTo("#outeritemblock");
427
                        $(lastitemblock).appendTo("#outeritemblock");
Lines 479-485 Link Here
479
        [% END %]
480
        [% END %]
480
481
481
        $(document).ready(function() {
482
        $(document).ready(function() {
482
            [% IF (AcqCreateItemReceiving) %]
483
            [% IF (AcqCreateItem == 'receiving') %]
483
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
484
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
484
            [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
485
            [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
485
                $("input[name='items_to_receive']").change(function() {
486
                $("input[name='items_to_receive']").change(function() {
486
- 

Return to bug 23376