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

(-)a/acqui/finishreceive.pl (-1 / +6 lines)
Lines 61-67 my $new_ordernumber = $ordernumber; Link Here
61
61
62
$unitprice = Koha::Number::Price->new( $unitprice )->unformat();
62
$unitprice = Koha::Number::Price->new( $unitprice )->unformat();
63
$replacementprice = Koha::Number::Price->new( $replacementprice )->unformat();
63
$replacementprice = Koha::Number::Price->new( $replacementprice )->unformat();
64
my $basket = Koha::Acquisition::Orders->find( $ordernumber )->basket;
64
my $order_obj = Koha::Acquisition::Orders->find( $ordernumber );
65
my $basket = $order_obj->basket;
65
66
66
#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
67
#need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
67
if ($quantityrec > $origquantityrec ) {
68
if ($quantityrec > $origquantityrec ) {
Lines 100-105 if ($quantityrec > $origquantityrec ) { Link Here
100
101
101
    # save the quantity received.
102
    # save the quantity received.
102
    if ( $quantityrec > 0 ) {
103
    if ( $quantityrec > 0 ) {
104
        if ( $order_obj->subscriptionid ) {
105
            # Quantity can only be modified if linked to a subscription
106
            $order->{quantity} = $quantity; # quantityrec will be deduced from this value in ModReceiveOrder
107
        }
103
        ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
108
        ( $datereceived, $new_ordernumber ) = ModReceiveOrder(
104
            {
109
            {
105
                biblionumber     => $biblionumber,
110
                biblionumber     => $biblionumber,
(-)a/acqui/orderreceive.pl (+12 lines)
Lines 194-199 my @gst_values = map { Link Here
194
    option => $_ + 0.0
194
    option => $_ + 0.0
195
}, split( '\|', C4::Context->preference("gist") );
195
}, split( '\|', C4::Context->preference("gist") );
196
196
197
if ( $order->{subscriptionid} ) {
198
    # Order from a subscription, we will display an history of what has been received
199
    my $orders = Koha::Acquisition::Orders->search(
200
        {
201
            subscriptionid     => $order->{subscriptionid},
202
            parent_ordernumber => $order->{ordernumber},
203
            ordernumber        => { '!=' => $order->{ordernumber} }
204
        }
205
    );
206
    $template->param( orders => $orders );
207
}
208
197
$template->param(
209
$template->param(
198
    AcqCreateItem         => $AcqCreateItem,
210
    AcqCreateItem         => $AcqCreateItem,
199
    count                 => 1,
211
    count                 => 1,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-4 / +6 lines)
Lines 303-316 Link Here
303
                    <input type="hidden" name="quantity" value="[% quantity | html %]" />[% quantity | html %]
303
                    <input type="hidden" name="quantity" value="[% quantity | html %]" />[% quantity | html %]
304
                [% ELSE %]
304
                [% ELSE %]
305
                    <label class="required" for="quantity">Quantity: </label>
305
                    <label class="required" for="quantity">Quantity: </label>
306
                    [% IF (AcqCreateItemOrdering) %]
306
                    [% IF subscriptionid %]
307
                        [% IF subscriptionid || basket.is_standing %]
307
                        <input type="text" size="20" id="quantity" name="quantity" value="1" onchange="updateCosts();" />
308
                    [% ELSIF AcqCreateItemOrdering %]
309
                        [% IF basket.is_standing %]
308
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
310
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
309
                        [% ELSE %]
311
                        [% ELSE %]
310
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
312
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
311
                        [% END %]
313
                        [% END %]
312
                    [% ELSE %]
314
                    [% ELSE %]
313
                        [% IF subscriptionid || basket.is_standing %]
315
                        [% IF basket.is_standing %]
314
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
316
                            <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
315
                        [% ELSE %]
317
                        [% ELSE %]
316
                            <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec | html %]" onchange="updateCosts();" />
318
                            <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec | html %]" onchange="updateCosts();" />
Lines 622-628 Link Here
622
            });
624
            });
623
625
624
            //We apply the fonction only for modify option
626
            //We apply the fonction only for modify option
625
            [% IF ( quantityrec ) %]
627
            [% IF ( quantityrec and not subscriptionid ) %]
626
                [% IF ( acqcreate ) %]
628
                [% IF ( acqcreate ) %]
627
                    $('#quantity').blur(function(){
629
                    $('#quantity').blur(function(){
628
                        // if user decreases the quantity
630
                        // if user decreases the quantity
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-17 / +66 lines)
Lines 54-60 Link Here
54
        </fieldset>
54
        </fieldset>
55
    [% END %]
55
    [% END %]
56
56
57
    [% IF (AcqCreateItemReceiving) %]
57
    [% IF subscriptionid and orders.count %]
58
        <fieldset class="rows">
59
            <legend>Receipt history for this subscription</legend>
60
            <table id="orders">
61
                <thead>
62
                    <tr>
63
                        <th>Invoice</th>
64
                        <th>Order number</th>
65
                        <th class="title-string">Creation date</th>
66
                        <th class="title-string">Receive date</th>
67
                        <th>Quantity received</th>
68
                        <th class="title-string">Status</th>
69
                        <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
70
                        <th>Internal note</th>
71
                    </tr>
72
                </thead>
73
                <tbody>
74
                [% FOR order IN orders %]
75
                    <tr>
76
                        <td>
77
                        [% IF order.invoice %]
78
                            [% IF CAN_user_acquisition %]
79
                                <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | html %]" title="Invoice detail page">
80
                                   [% order.invoice.invoicenumber | html %]</a>
81
                            [% ELSE %]
82
                                [% order.invoice.invoicenumber | html %]
83
                            [% END %]
84
                        [% END %]
85
                        </td>
86
                        <td>[% order.ordernumber | html %]</td>
87
                        <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
88
                        <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
89
                        <td>[% order.quantityreceived | html %]</td>
90
                        <td>
91
                          [% SWITCH order.orderstatus %]
92
                          [%# FIXME We should only see/display Complete here, right? %]
93
                            [% CASE 'new' %]<span title="status_1">New</span>
94
                            [% CASE 'ordered' %]<span title="status_2">Ordered</span>
95
                            [% CASE 'partial' %]<span title="status_3">Partial</span>
96
                            [% CASE 'complete' %]<span title="status_4">Complete</span>
97
                            [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
98
                          [% END %]
99
                        </td>
100
                        <td>
101
                            [% IF order.datereceived %][%# FIXME Should only be true, right? %]
102
                                [%# FIXME What if unitprice has not been filled? %]
103
                                [% order.unitprice_tax_excluded | $Price | html %] / [% order.unitprice_tax_included | $Price | html %]
104
                            [% END %]
105
                        </td>
106
                        <td>[% order.order_internalnote | html %]</td>
107
                    </tr>
108
                [% END %]
109
                </tbody>
110
            </table>
111
        </fieldset>
112
    [% ELSIF (AcqCreateItemReceiving) %]
58
        <div id="items_list" style="display:none">
113
        <div id="items_list" style="display:none">
59
            <p><b>Items list</b></p>
114
            <p><b>Items list</b></p>
60
            <div style="width:100%;overflow:auto;">
115
            <div style="width:100%;overflow:auto;">
Lines 181-199 Link Here
181
        </span>
236
        </span>
182
       </li>
237
       </li>
183
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
238
       <li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
184
           [% IF ( edit and not subscriptionid) %]
239
           [% IF edit or subscriptionid %]
185
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
240
               <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
186
           [% ELSE%]
241
           [% ELSE%]
187
               <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
242
               <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
188
           [% END %]
243
           [% END %]
189
           </span></li>
244
           </span></li>
190
        <li><label for="quantity">Quantity received: </label>
245
        <li><label for="quantity">Quantity received: </label>
191
          [% IF (AcqCreateItemReceiving) %]
246
          [% IF subscriptionid %]
192
            [% IF ( subscriptionid ) %]
247
              <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantity | html %]" />
193
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="1" />
248
              <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
194
            [% ELSE %]
249
          [% ELSIF AcqCreateItemReceiving %]
195
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
250
              <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
196
            [% END %]
197
          [% ELSE %]
251
          [% ELSE %]
198
            [% IF ( quantityreceived ) %]
252
            [% IF ( quantityreceived ) %]
199
                [% IF ( edit ) %]
253
                [% IF ( edit ) %]
Lines 208-225 Link Here
208
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
262
                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
209
                [% END %]
263
                [% END %]
210
            [% ELSE %]
264
            [% ELSE %]
211
                [% IF ( subscriptionid ) %]
265
                <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
212
                    <input type="text" readonly="readonly" id="quantity" size="20" name="quantityrec" value="1" />
213
                [% ELSE %]
214
                    <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
215
                [% END %]
216
                <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
266
                <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
217
            [% END %]
267
            [% END %]
218
            <div id="qtyrecerror" style="display:none">
268
            <div id="qtyrecerror" style="display:none">
219
                <p class="error">Warning, you have entered more items than expected.
269
                <p class="error">Warning, you have entered more items than expected.
220
                Items will not be created.</p>
270
                Items will not be created.</p>
221
            </div>
271
            </div>
222
          [% END %][%# IF (AcqCreateItemReceiving) %]
272
          [% END %][%# IF (subscriptionid) ELSIF (AcqCreateItemReceiving) %]
223
		</li>
273
		</li>
224
274
225
        [% IF ( gst_values ) %]
275
        [% IF ( gst_values ) %]
Lines 239-250 Link Here
239
            <input type="hidden" name="tax_rate" value="0" />
289
            <input type="hidden" name="tax_rate" value="0" />
240
        [% END %]
290
        [% END %]
241
291
242
        <li><label for="rrp">Retail price: </label>[% rrp | $Price %]</li>
292
        <li><label for="rrp">Retail price: </label>[% rrp | $Price | html %]</li>
243
        <li>
293
        <li>
244
            <label for="replacementprice">Replacement price:</label>
294
            <label for="replacementprice">Replacement price:</label>
245
            <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price %]" />
295
            <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price | html %]" />
246
        </li>
296
        </li>
247
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
297
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price | html %]</li>
248
        <li>
298
        <li>
249
            <label for="unitprice">Actual cost:</label>
299
            <label for="unitprice">Actual cost:</label>
250
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 | html %]" />
300
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 | html %]" />
251
- 

Return to bug 21467