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

(-)a/acqui/orderreceive.pl (-13 lines)
Lines 114-131 unless($acq_fw) { Link Here
114
    $template->param('NoACQframework' => 1);
114
    $template->param('NoACQframework' => 1);
115
}
115
}
116
116
117
my $AcqCreateItem = $basket->effective_create_items;
118
if ($AcqCreateItem eq 'receiving') {
119
    $template->param(
120
        AcqCreateItemReceiving => 1,
121
        UniqueItemFields => C4::Context->preference('UniqueItemFields'),
122
    );
123
} elsif ($AcqCreateItem eq 'ordering') {
124
    my $fw = ($acq_fw) ? 'ACQ' : '';
125
    my $items = $order->items;
126
    $template->param(items => $items);
127
}
128
129
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
117
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
130
118
131
my $creator = Koha::Patrons->find( $order->created_by );
119
my $creator = Koha::Patrons->find( $order->created_by );
Lines 161-167 if ( $order->subscriptionid ) { Link Here
161
}
149
}
162
150
163
$template->param(
151
$template->param(
164
    AcqCreateItem         => $AcqCreateItem,
165
    count                 => 1,
152
    count                 => 1,
166
    order                 => $order,
153
    order                 => $order,
167
    name                  => $bookseller->name,
154
    name                  => $bookseller->name,
(-)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 111-117 Link Here
111
                </tbody>
112
                </tbody>
112
            </table>
113
            </table>
113
        </fieldset>
114
        </fieldset>
114
    [% ELSIF (AcqCreateItemReceiving) %]
115
    [% ELSIF (AcqCreateItem == 'receiving') %]
115
        <div id="items_list" style="display:none">
116
        <div id="items_list" style="display:none">
116
            <p><b>Items list</b></p>
117
            <p><b>Items list</b></p>
117
            <div style="width:100%;overflow:auto;">
118
            <div style="width:100%;overflow:auto;">
Lines 154-160 Link Here
154
          </fieldset>
155
          </fieldset>
155
        [% END %]
156
        [% END %]
156
    [% ELSIF (AcqCreateItem == 'ordering') %]
157
    [% ELSIF (AcqCreateItem == 'ordering') %]
157
        [% IF (items.count) %]
158
        [% IF (order.items.count) %]
158
            <h5>Items</h5>
159
            <h5>Items</h5>
159
            <div style="width:100%;overflow:auto">
160
            <div style="width:100%;overflow:auto">
160
                <table>
161
                <table>
Lines 178-184 Link Here
178
                        </tr>
179
                        </tr>
179
                    </thead>
180
                    </thead>
180
                    <tbody>
181
                    <tbody>
181
                        [% FOREACH item IN items %]
182
                        [% FOREACH item IN order.items %]
182
                            <tr id="item_[% item.itemnumber | html %]">
183
                            <tr id="item_[% item.itemnumber | html %]">
183
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
184
                                <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
184
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
185
                                <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
Lines 247-253 Link Here
247
          [% IF order.subscriptionid %]
248
          [% IF order.subscriptionid %]
248
              <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
249
              <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
249
              <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
250
              <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
250
          [% ELSIF AcqCreateItemReceiving %]
251
          [% ELSIF AcqCreateItem == 'receiving' %]
251
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
252
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
252
          [% ELSE %]
253
          [% ELSE %]
253
            [% IF ( order.quantityreceived ) %]
254
            [% IF ( order.quantityreceived ) %]
Lines 255-261 Link Here
255
                    <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
256
                    <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
256
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
257
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
257
                [% ELSE %]
258
                [% ELSE %]
258
                    [% IF ( items ) %]
259
                    [% IF ( order.items.count ) %]
259
                        <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
260
                        <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
260
                    [% ELSE %]
261
                    [% ELSE %]
261
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
262
                        <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
Lines 270-276 Link Here
270
                <p class="error">Warning, you have entered more items than expected.
271
                <p class="error">Warning, you have entered more items than expected.
271
                Items will not be created.</p>
272
                Items will not be created.</p>
272
            </div>
273
            </div>
273
          [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItemReceiving) %]
274
          [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
274
		</li>
275
		</li>
275
276
276
        [% IF ( gst_values ) %]
277
        [% IF ( gst_values ) %]
Lines 349-355 Link Here
349
    [% Asset.js("js/cataloging.js") | $raw %]
350
    [% Asset.js("js/cataloging.js") | $raw %]
350
    <script>
351
    <script>
351
        function Check(form) {
352
        function Check(form) {
352
            [% IF (AcqCreateItemReceiving) %]
353
            [% IF (AcqCreateItem == 'receiving') %]
353
                var total_errors = CheckMandatorySubfields(form);
354
                var total_errors = CheckMandatorySubfields(form);
354
                if (total_errors != 0) {
355
                if (total_errors != 0) {
355
                    var alertString = _("Form not submitted because of the following problem(s)");
356
                    var alertString = _("Form not submitted because of the following problem(s)");
Lines 359-365 Link Here
359
                    return false;
360
                    return false;
360
                }
361
                }
361
362
362
                if(check_additem('[% UniqueItemFields | html %]') == false){
363
                if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
363
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
364
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
364
                    return false;
365
                    return false;
365
                };
366
                };
Lines 377-383 Link Here
377
                    $(lastitemblock).remove();
378
                    $(lastitemblock).remove();
378
                }
379
                }
379
380
380
                if(check_additem('[% UniqueItemFields | html %]') == false){
381
                if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
381
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
382
                    alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
382
                    if(tobedeleted) {
383
                    if(tobedeleted) {
383
                        $(lastitemblock).appendTo("#outeritemblock");
384
                        $(lastitemblock).appendTo("#outeritemblock");
Lines 436-442 Link Here
436
        [% END %]
437
        [% END %]
437
438
438
        $(document).ready(function() {
439
        $(document).ready(function() {
439
            [% IF (AcqCreateItemReceiving) %]
440
            [% IF (AcqCreateItem == 'receiving') %]
440
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
441
                cloneItemBlock(0, '[% UniqueItemFields | html %]');
441
            [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
442
            [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
442
                $("input[name='items_to_receive']").change(function() {
443
                $("input[name='items_to_receive']").change(function() {
443
- 

Return to bug 23376