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

(-)a/C4/Acquisition.pm (-5 / +7 lines)
Lines 918-924 Else, the upcoming July 1st is used. Link Here
918
918
919
=item defaults entrydate to Now
919
=item defaults entrydate to Now
920
920
921
The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gst", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
921
The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gstrate", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
922
922
923
=back
923
=back
924
924
Lines 1160-1166 C<$ordernumber>. Link Here
1160
1160
1161
sub ModReceiveOrder {
1161
sub ModReceiveOrder {
1162
    my (
1162
    my (
1163
        $biblionumber,    $ordernumber,  $quantrec, $user, $cost,
1163
        $biblionumber, $ordernumber,  $quantrec, $user, $cost, $ecost,
1164
        $invoiceno, $freight, $rrp, $budget_id, $datereceived, $received_items
1164
        $invoiceno, $freight, $rrp, $budget_id, $datereceived, $received_items
1165
    )
1165
    )
1166
    = @_;
1166
    = @_;
Lines 1191-1200 sub ModReceiveOrder { Link Here
1191
                , unitprice=?
1191
                , unitprice=?
1192
                , freight=?
1192
                , freight=?
1193
                , rrp=?
1193
                , rrp=?
1194
                , ecost=?
1194
                , quantity=?
1195
                , quantity=?
1195
            WHERE biblionumber=? AND ordernumber=?");
1196
            WHERE biblionumber=? AND ordernumber=?");
1196
1197
1197
        $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$quantrec,$biblionumber,$ordernumber);
1198
        $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$ecost,$quantrec,$biblionumber,$ordernumber);
1198
        $sth->finish;
1199
        $sth->finish;
1199
1200
1200
        # create a new order for the remaining items, and set its bookfund.
1201
        # create a new order for the remaining items, and set its bookfund.
Lines 1219-1227 sub ModReceiveOrder { Link Here
1219
    } else {
1220
    } else {
1220
        $sth=$dbh->prepare("update aqorders
1221
        $sth=$dbh->prepare("update aqorders
1221
                            set quantityreceived=?,datereceived=?,booksellerinvoicenumber=?,
1222
                            set quantityreceived=?,datereceived=?,booksellerinvoicenumber=?,
1222
                                unitprice=?,freight=?,rrp=?
1223
                                unitprice=?,freight=?,rrp=?,ecost=?
1223
                            where biblionumber=? and ordernumber=?");
1224
                            where biblionumber=? and ordernumber=?");
1224
        $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$biblionumber,$ordernumber);
1225
        $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$ecost,$biblionumber,$ordernumber);
1225
        $sth->finish;
1226
        $sth->finish;
1226
    }
1227
    }
1227
    return $datereceived;
1228
    return $datereceived;
Lines 1371-1376 sub GetParcel { Link Here
1371
                aqorders.listprice,
1372
                aqorders.listprice,
1372
                aqorders.rrp,
1373
                aqorders.rrp,
1373
                aqorders.ecost,
1374
                aqorders.ecost,
1375
                aqorders.gstrate,
1374
                biblio.title
1376
                biblio.title
1375
        FROM aqorders
1377
        FROM aqorders
1376
        LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
1378
        LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
(-)a/acqui/addorder.pl (-33 / +12 lines)
Lines 153-191 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
153
my $orderinfo					= $input->Vars;
153
my $orderinfo					= $input->Vars;
154
$orderinfo->{'list_price'}    ||=  0;
154
$orderinfo->{'list_price'}    ||=  0;
155
$orderinfo->{'uncertainprice'} ||= 0;
155
$orderinfo->{'uncertainprice'} ||= 0;
156
#my $ordernumber        = $input->param('ordernumber');
156
157
#my $basketno      = $input->param('basketno');
157
my $user = $input->remote_user;
158
#my $booksellerid  = $input->param('booksellerid');
158
159
#my $existing      = $input->param('existing');    # existing biblio, (not basket or order)
160
#my $title         = $input->param('title');
161
#my $author        = $input->param('author');
162
#my $publicationyear= $input->param('publicationyear');
163
#my $isbn          = $input->param('ISBN');
164
#my $itemtype      = $input->param('format');
165
#my $quantity      = $input->param('quantity');		# FIXME: else ERROR!
166
#my $branch        = $input->param('branch');
167
#my $series        = $input->param('series');
168
#my $notes         = $input->param('notes');
169
#my $budget_id     = $input->param('budget_id');
170
#my $sort1         = $input->param('sort1');
171
#my $sort2         = $input->param('sort2');
172
#my $rrp           = $input->param('rrp');
173
#my $ecost         = $input->param('ecost');
174
#my $gst           = $input->param('GST');
175
#my $budget        = $input->param('budget');
176
#my $cost          = $input->param('cost');
177
#my $sub           = $input->param('sub');
178
#my $purchaseorder = $input->param('purchaseordernumber');
179
#my $invoice       = $input->param('invoice');
180
#my $publishercode = $input->param('publishercode');
181
#my $suggestionid  = $input->param('suggestionid');
182
#my $biblionumber  = $input->param('biblionumber');
183
#my $uncertainprice = $input->param('uncertainprice');
184
#my $import_batch_id= $input->param('import_batch_id');
185
#
186
#my $createbibitem = $input->param('createbibitem');
187
#
188
my $user          = $input->remote_user;
189
# create, modify or delete biblio
159
# create, modify or delete biblio
190
# create if $quantity>=0 and $existing='no'
160
# create if $quantity>=0 and $existing='no'
191
# modify if $quantity>=0 and $existing='yes'
161
# modify if $quantity>=0 and $existing='yes'
Lines 207-212 if ( $orderinfo->{quantity} ne '0' ) { Link Here
207
                "biblio.copyrightdate"        => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
177
                "biblio.copyrightdate"        => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
208
                "biblioitems.itemtype"        => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "",
178
                "biblioitems.itemtype"        => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "",
209
                "biblioitems.editionstatement"=> $$orderinfo{editionstatement} ? $$orderinfo{editionstatement} : "",
179
                "biblioitems.editionstatement"=> $$orderinfo{editionstatement} ? $$orderinfo{editionstatement} : "",
180
                "aqorders.branchcode"         => $$orderinfo{branchcode} ? $$orderinfo{branchcode} : "",
181
                "aqorders.quantity"           => $$orderinfo{quantity} ? $$orderinfo{quantity} : "",
182
                "aqorders.listprice"          => $$orderinfo{listprice} ? $$orderinfo{listprice} : "",
183
                "aqorders.uncertainprice"     => $$orderinfo{uncertainprice} ? $$orderinfo{uncertainprice} : "",
184
                "aqorders.rrp"                => $$orderinfo{rrp} ? $$orderinfo{rrp} : "",
185
                "aqorders.ecost"              => $$orderinfo{ecost} ? $$orderinfo{ecost} : "",
186
                "aqorders.discount"           => $$orderinfo{discount} ? $$orderinfo{discount} : "",
210
            });
187
            });
211
188
212
        # create the record in catalogue, with framework ''
189
        # create the record in catalogue, with framework ''
Lines 219-224 if ( $orderinfo->{quantity} ne '0' ) { Link Here
219
		$orderinfo->{biblionumber}=$biblionumber;
196
		$orderinfo->{biblionumber}=$biblionumber;
220
    }
197
    }
221
198
199
    $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq '';
200
222
    # if we already have $ordernumber, then it's an ordermodif
201
    # if we already have $ordernumber, then it's an ordermodif
223
    if ($$orderinfo{ordernumber}) {
202
    if ($$orderinfo{ordernumber}) {
224
        ModOrder( $orderinfo);
203
        ModOrder( $orderinfo);
(-)a/acqui/addorderiso2709.pl (-5 / +13 lines)
Lines 207-216 if ($op eq ""){ Link Here
207
        # we suppose the currency is correct, as we have no possibilities to get it.
207
        # we suppose the currency is correct, as we have no possibilities to get it.
208
        my $price= GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
208
        my $price= GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
209
        if ($price){
209
        if ($price){
210
            # in France, the cents separator is the , but sometimes, ppl use a .
211
            # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
212
            $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
210
            $price = $num->unformat_number($price);
213
            $price = $num->unformat_number($price);
211
        }
214
        }
212
        if ($price){
215
        if ($price){
213
            $orderinfo{'listprice'} = $price;
214
            eval {
216
            eval {
215
		require C4::Acquisition;
217
		require C4::Acquisition;
216
		import C4::Acquisition qw/GetBasket/;
218
		import C4::Acquisition qw/GetBasket/;
Lines 227-239 if ($op eq ""){ Link Here
227
	    }
229
	    }
228
            my $basket     = GetBasket( $orderinfo{basketno} );
230
            my $basket     = GetBasket( $orderinfo{basketno} );
229
            my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
231
            my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
230
            my $gst        = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
232
            $orderinfo{gstrate} = $bookseller->{gstrate};
231
            $orderinfo{'unitprice'} = $orderinfo{listprice} - ( $orderinfo{listprice} * ( $bookseller->{discount} / 100 ) );
233
            if ( $bookseller->{listincgst} ) {
232
            $orderinfo{'ecost'} = $orderinfo{unitprice};
234
                $orderinfo{ecost} = $price;
235
            } else {
236
                $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} );
237
            }
238
            $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} );
239
            $orderinfo{listprice} = $orderinfo{rrp};
240
            $orderinfo{unitprice} = $orderinfo{ecost};
241
            $orderinfo{total} = $orderinfo{ecost};
233
        } else {
242
        } else {
234
            $orderinfo{'listprice'} = 0;
243
            $orderinfo{'listprice'} = 0;
235
        }
244
        }
236
        $orderinfo{'rrp'} = $orderinfo{'listprice'};
237
245
238
        # remove uncertainprice flag if we have found a price in the MARC record
246
        # remove uncertainprice flag if we have found a price in the MARC record
239
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
247
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
(-)a/acqui/basket.pl (-117 / +123 lines)
Lines 231-351 if ( $op eq 'delete_confirm' ) { Link Here
231
      "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
231
      "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
232
      $basket->{creationdate}, $basket->{authorisedby};
232
      $basket->{creationdate}, $basket->{authorisedby};
233
233
234
	#to get active currency
234
    #to get active currency
235
	my $cur = GetCurrency();
235
    my $cur = GetCurrency();
236
236
237
237
238
    my @results = GetOrders( $basketno );
238
    my @results = GetOrders( $basketno );
239
    
240
	my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
241
	$gist = 0 if $gist == 0.0000;
242
	my $discount = $bookseller->{'discount'} / 100;
243
    my $total_rrp = 0;      # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'}
244
    my $total_rrp_gsti = 0; # RRP Total, GST included
245
    my $total_rrp_gste = 0; # RRP Total, GST excluded
246
    my $gist_rrp = 0;
247
    my $total_rrp_est = 0;
248
249
    my $qty_total;
250
    my @books_loop;
239
    my @books_loop;
251
    my $suggestion;
252
240
253
    for my $order ( @results ) {
241
    my @book_foot_loop;
254
        my $rrp = $order->{'listprice'} || 0;
242
    my %foot;
255
		my $qty = $order->{'quantity'} || 0;
243
    my $total_quantity = 0;
256
        if (!defined $order->{quantityreceived}) {
244
    my $total_gste = 0;
257
            $order->{quantityreceived} = 0;
245
    my $total_gsti = 0;
258
        }
246
    my $total_gstvalue = 0;
259
        for ( qw(rrp ecost quantityreceived)) {
247
    for my $order (@results) {
260
            if (!defined $order->{$_}) {
248
        my $line = get_order_infos( $order, $bookseller);
261
                $order->{$_} = 0;
249
        if ( $line->{uncertainprice} ) {
262
            }
263
        }
264
265
        my $budget = GetBudget(  $order->{'budget_id'} );
266
        $rrp = ConvertCurrency( $order->{'currency'}, $rrp );
267
268
        $total_rrp += $qty * $order->{'rrp'};
269
        my $line_total = $qty * $order->{'ecost'};
270
        $total_rrp_est += $qty * $order->{'ecost'};
271
		# FIXME: what about the "actual cost" field?
272
        $qty_total += $qty;
273
        my %line = %{ $order };
274
        my $biblionumber = $order->{'biblionumber'};
275
        my $countbiblio = CountBiblioInOrders($biblionumber);
276
        my $ordernumber = $order->{'ordernumber'};
277
        my @subscriptions = GetSubscriptionsId ($biblionumber);
278
        my $itemcount = GetItemsCount($biblionumber);
279
        my $holds  = GetHolds ($biblionumber);
280
        my @items = GetItemnumbersFromOrder( $ordernumber );
281
        my $itemholds;
282
        foreach my $item (@items){
283
            my $nb = GetItemHolds($biblionumber, $item);
284
            if ($nb){
285
                $itemholds += $nb;
286
            }
287
        }
288
        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
289
        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
290
        $line{items}                = ($itemcount) - (scalar @items);
291
        $line{left_item}            = 1 if $line{items} >= 1;
292
        $line{left_biblio}          = 1 if $countbiblio > 1;
293
        $line{biblios}              = $countbiblio - 1;
294
        $line{left_subscription}    = 1 if scalar @subscriptions >= 1;
295
        $line{subscriptions}        = scalar @subscriptions;
296
        ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
297
        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
298
        $line{holds}                = $holds;
299
        $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
300
        $line{order_received}       = ( $qty == $order->{'quantityreceived'} );
301
        $line{basketno}             = $basketno;
302
        $line{budget_name}          = $budget->{budget_name};
303
        $line{rrp}                  = sprintf( "%.2f", $line{'rrp'} );
304
        $line{ecost}                = sprintf( "%.2f", $line{'ecost'} );
305
        $line{line_total}           = sprintf( "%.2f", $line_total );
306
        if ($line{uncertainprice}) {
307
            $template->param( uncertainprices => 1 );
250
            $template->param( uncertainprices => 1 );
308
            $line{rrp} .= ' (Uncertain)';
309
        }
251
        }
310
	if ($line{'title'}){
252
311
	    my $volume = $order->{'volume'};
253
        push @books_loop, $line;
312
	    my $seriestitle = $order->{'seriestitle'};
254
313
	    $line{'title'} .= " / $seriestitle" if $seriestitle;
255
        $foot{$$line{gstgsti}}{gstgsti} = $$line{gstgsti};
314
	    $line{'title'} .= " / $volume" if $volume;
256
        $foot{$$line{gstgsti}}{gstvalue} += $$line{gstvalue};
315
	} else {
257
        $total_gstvalue += $$line{gstvalue};
316
	    $line{'title'} = "Deleted bibliographic notice, can't find title.";
258
        $foot{$$line{gstgsti}}{quantity}  += $$line{quantity};
317
	}
259
        $total_quantity += $$line{quantity};
318
260
        $foot{$$line{gstgsti}}{totalgste} += $$line{totalgste};
319
        $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
261
        $total_gste += $$line{totalgste};
320
        $line{suggestionid}         = $suggestion->{suggestionid};
262
        $foot{$$line{gstgsti}}{totalgsti} += $$line{totalgsti};
321
        $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
263
        $total_gsti += $$line{totalgsti};
322
        $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
323
324
        push @books_loop, \%line;
325
    }
264
    }
326
265
327
my $total_est_gste;
266
    push @book_foot_loop, map {$_} values %foot;
328
    my $total_est_gsti;
267
329
    my $gist_est;
268
    # Get cancelled orders
330
    if ($gist){                                                    # if we have GST
269
    @results = GetCancelledOrders($basketno);
331
       if ( $bookseller->{'listincgst'} ) {                        # if prices already includes GST
270
    my @cancelledorders_loop;
332
           $total_rrp_gsti = $total_rrp;                           # we know $total_rrp_gsti
271
    for my $order (@results) {
333
           $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );      # and can reverse compute other values
272
        my $line = get_infos( $order, $bookseller);
334
           $gist_rrp       = $total_rrp_gsti - $total_rrp_gste;    #
273
        push @cancelledorders_loop, $line;
335
           $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
274
    }
336
           $total_est_gsti = $total_rrp_est;
337
        } else {                                                    # if prices does not include GST
338
           $total_rrp_gste = $total_rrp;                           # then we use the common way to compute other values
339
           $gist_rrp       = $total_rrp_gste * $gist;              #
340
           $total_rrp_gsti = $total_rrp_gste + $gist_rrp;          #
341
           $total_est_gste = $total_rrp_est;
342
           $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
343
       }
344
       $gist_est = $gist_rrp - ( $gist_rrp * $discount );
345
    } else {
346
    $total_rrp_gsti = $total_rrp;
347
    $total_est_gsti = $total_rrp_est;
348
}
349
275
350
    my $contract = &GetContract($basket->{contractnumber});
276
    my $contract = &GetContract($basket->{contractnumber});
351
    my @orders = GetOrders($basketno);
277
    my @orders = GetOrders($basketno);
Lines 382-399 my $total_est_gste; Link Here
382
        booksellerid         => $bookseller->{'id'},
308
        booksellerid         => $bookseller->{'id'},
383
        name                 => $bookseller->{'name'},
309
        name                 => $bookseller->{'name'},
384
        books_loop           => \@books_loop,
310
        books_loop           => \@books_loop,
311
        book_foot_loop       => \@book_foot_loop,
385
        cancelledorders_loop => \@cancelledorders,
312
        cancelledorders_loop => \@cancelledorders,
386
        gist_rate            => sprintf( "%.2f", $gist * 100 ) . '%',
313
        total_quantity       => $total_quantity,
387
        total_rrp_gste       => sprintf( "%.2f", $total_rrp_gste ),
314
        total_gste           => sprintf( "%.2f", $total_gste ),
388
        total_est_gste       => sprintf( "%.2f", $total_est_gste ),
315
        total_gsti           => sprintf( "%.2f", $total_gsti ),
389
        gist_est             => sprintf( "%.2f", $gist_est ),
316
        total_gstvalue       => sprintf( "%.2f", $total_gstvalue ),
390
        gist_rrp             => sprintf( "%.2f", $gist_rrp ),        
317
        currency             => $cur->{'currency'},
391
        total_rrp_gsti       => sprintf( "%.2f", $total_rrp_gsti ),
318
        listincgst           => $bookseller->{listincgst},
392
        total_est_gsti       => sprintf( "%.2f", $total_est_gsti ),
393
#        currency             => $bookseller->{'listprice'},
394
	currency		=> $cur->{'currency'},
395
        qty_total            => $qty_total,
396
        GST                  => $gist,
397
        basketgroups         => $basketgroups,
319
        basketgroups         => $basketgroups,
398
        grouped              => $basket->{basketgroupid},
320
        grouped              => $basket->{basketgroupid},
399
        unclosable           => @orders ? 0 : 1, 
321
        unclosable           => @orders ? 0 : 1, 
Lines 401-404 my $total_est_gste; Link Here
401
    );
323
    );
402
}
324
}
403
325
326
sub get_order_infos {
327
    my $order = shift;
328
    my $bookseller = shift;
329
    my $qty = $order->{'quantity'} || 0;
330
    if ( !defined $order->{quantityreceived} ) {
331
        $order->{quantityreceived} = 0;
332
    }
333
    my $budget = GetBudget( $order->{'budget_id'} );
334
335
    my %line = %{ $order };
336
    $line{order_received} = ( $qty == $order->{'quantityreceived'} );
337
    $line{basketno}       = $basketno;
338
    $line{budget_name}    = $budget->{budget_name};
339
    $line{rrp} = ConvertCurrency( $order->{'currency'}, $line{rrp} ); # FIXME from comm
340
    if ( $bookseller->{'listincgst'} ) {
341
        $line{rrpgsti} = sprintf( "%.2f", $line{rrp} );
342
        $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
343
        $line{rrpgste} = sprintf( "%.2f", $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ) );
344
        $line{gstgste} = sprintf( "%.2f", $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ) );
345
        $line{ecostgsti} = sprintf( "%.2f", $line{ecost} );
346
        $line{ecostgste} = sprintf( "%.2f", $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ) );
347
        $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
348
        $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
349
        $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
350
    } else {
351
        $line{rrpgsti} = sprintf( "%.2f", $line{rrp} * ( 1 + ( $line{gstrate} ) ) );
352
        $line{rrpgste} = sprintf( "%.2f", $line{rrp} );
353
        $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
354
        $line{gstgste} = sprintf( "%.2f", $line{gstrate} * 100 );
355
        $line{ecostgsti} = sprintf( "%.2f", $line{ecost} * ( 1 + ( $line{gstrate} ) ) );
356
        $line{ecostgste} = sprintf( "%.2f", $line{ecost} );
357
        $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
358
        $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
359
        $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
360
    }
361
362
    if ( $line{uncertainprice} ) {
363
        $line{rrpgste} .= ' (Uncertain)';
364
    }
365
    if ( $line{'title'} ) {
366
        my $volume      = $order->{'volume'};
367
        my $seriestitle = $order->{'seriestitle'};
368
        $line{'title'} .= " / $seriestitle" if $seriestitle;
369
        $line{'title'} .= " / $volume"      if $volume;
370
    } else {
371
        $line{'title'} = "Deleted bibliographic notice, can't find title.";
372
    }
373
374
    my $biblionumber = $order->{'biblionumber'};
375
    my $countbiblio = CountBiblioInOrders($biblionumber);
376
    my $ordernumber = $order->{'ordernumber'};
377
    my @subscriptions = GetSubscriptionsId ($biblionumber);
378
    my $itemcount = GetItemsCount($biblionumber);
379
    my $holds  = GetHolds ($biblionumber);
380
    my @items = GetItemnumbersFromOrder( $ordernumber );
381
    my $itemholds;
382
    foreach my $item (@items){
383
        my $nb = GetItemHolds($biblionumber, $item);
384
        if ($nb){
385
            $itemholds += $nb;
386
        }
387
    }
388
    # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
389
    $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
390
    $line{items}                = ($itemcount) - (scalar @items);
391
    $line{left_item}            = 1 if $line{items} >= 1;
392
    $line{left_biblio}          = 1 if $countbiblio > 1;
393
    $line{biblios}              = $countbiblio - 1;
394
    $line{left_subscription}    = 1 if scalar @subscriptions >= 1;
395
    $line{subscriptions}        = scalar @subscriptions;
396
    ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
397
    $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
398
    $line{holds}                = $holds;
399
    $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
400
401
402
    my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
403
    $line{suggestionid}         = $$suggestion{suggestionid};
404
    $line{surnamesuggestedby}   = $$suggestion{surnamesuggestedby};
405
    $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby};
406
407
    return \%line;
408
}
409
404
output_html_with_http_headers $query, $cookie, $template->output;
410
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/acqui/finishreceive.pl (-20 / +52 lines)
Lines 28-33 use C4::Output; Link Here
28
use C4::Context;
28
use C4::Context;
29
use C4::Acquisition;
29
use C4::Acquisition;
30
use C4::Biblio;
30
use C4::Biblio;
31
use C4::Bookseller;
31
use C4::Items;
32
use C4::Items;
32
use C4::Search;
33
use C4::Search;
33
use List::MoreUtils qw/any/;
34
use List::MoreUtils qw/any/;
Lines 37-60 my $flagsrequired = {acquisition => 'order_receive'}; Link Here
37
38
38
checkauth($input, 0, $flagsrequired, 'intranet');
39
checkauth($input, 0, $flagsrequired, 'intranet');
39
40
40
my $user=$input->remote_user;
41
my $user             = $input->remote_user;
41
my $biblionumber = $input->param('biblionumber');
42
my $biblionumber     = $input->param('biblionumber');
42
my $biblioitemnumber=$input->param('biblioitemnumber');
43
my $biblioitemnumber = $input->param('biblioitemnumber');
43
my $ordernumber=$input->param('ordernumber');
44
my $ordernumber      = $input->param('ordernumber');
44
my $origquantityrec=$input->param('origquantityrec');
45
my $origquantityrec  = $input->param('origquantityrec');
45
my $quantityrec=$input->param('quantityrec');
46
my $quantityrec      = $input->param('quantityrec');
46
my $quantity=$input->param('quantity');
47
my $quantity         = $input->param('quantity');
47
my $unitprice=$input->param('cost');
48
my $unitprice        = $input->param('cost');
48
my $invoiceno=$input->param('invoice');
49
my $invoiceno        = $input->param('invoice');
49
my $datereceived=$input->param('datereceived');
50
my $datereceived     = $input->param('datereceived');
50
my $replacement=$input->param('rrp');
51
my $freight          = $input->param('freight');
51
my $gst=$input->param('gst');
52
my $booksellerid     = $input->param('booksellerid');
52
my $freight=$input->param('freight');
53
my $cnt              = 0;
53
my $booksellerid = $input->param('booksellerid');
54
my $cnt=0;
55
my $error_url_str;
54
my $error_url_str;
56
my $ecost = $input->param('ecost');
55
my $ecost            = $input->param('ecost');
57
my $note = $input->param("note");
56
my $rrp              = $input->param('rrp');
57
my $note             = $input->param("note");
58
my $order            = GetOrder($ordernumber);
58
59
59
#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
60
#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
60
if ($quantityrec > $origquantityrec ) {
61
if ($quantityrec > $origquantityrec ) {
Lines 100-112 if ($quantityrec > $origquantityrec ) { Link Here
100
        @received_items = $input->param('items_to_receive');
101
        @received_items = $input->param('items_to_receive');
101
    }
102
    }
102
103
104
    $order->{rrp} = $rrp;
105
    $order->{ecost} = $ecost;
106
    $order->{unitprice} = $unitprice;
107
    my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
108
    if ( $bookseller->{listincgst} ) {
109
        if ( not $bookseller->{invoiceincgst} ) {
110
            $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
111
            $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} );
112
            $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} );
113
        }
114
    } else {
115
        if ( $bookseller->{invoiceincgst} ) {
116
            $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} );
117
            $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} );
118
            $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} );
119
        }
120
    }
121
103
    # save the quantity received.
122
    # save the quantity received.
104
    $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived, \@received_items);
123
    $datereceived = ModReceiveOrder(
124
        $biblionumber,
125
        $ordernumber,
126
        $quantityrec,
127
        $user,
128
        $order->{unitprice},
129
        $order->{ecost},
130
        $invoiceno,
131
        $freight,
132
        $order->{rrp},
133
        undef,
134
        $datereceived,
135
        \@received_items,
136
    );
105
}
137
}
106
138
107
update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber );
139
update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber );
108
140
109
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&booksellerid=$booksellerid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str");
141
print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&booksellerid=$booksellerid&freight=$freight&datereceived=$datereceived$error_url_str");
110
142
111
################################ End of script ################################
143
################################ End of script ################################
112
144
Lines 117-123 sub update_item { Link Here
117
        booksellerid         => $booksellerid,
149
        booksellerid         => $booksellerid,
118
        dateaccessioned      => $datereceived,
150
        dateaccessioned      => $datereceived,
119
        price                => $unitprice,
151
        price                => $unitprice,
120
        replacementprice     => $replacement,
152
        replacementprice     => $rrp,
121
        replacementpricedate => $datereceived,
153
        replacementpricedate => $datereceived,
122
    }, $biblionumber, $itemnumber );
154
    }, $biblionumber, $itemnumber );
123
}
155
}
(-)a/acqui/neworderempty.pl (-15 / +23 lines)
Lines 334-339 $template->param( Link Here
334
    budget_name  => $budget_name
334
    budget_name  => $budget_name
335
) if ($close);
335
) if ($close);
336
336
337
# get option values for gist syspref
338
my @gst_values = map {
339
    option => $_
340
}, split( '\|', C4::Context->preference("gist") );
341
342
my $cur = GetCurrency();
343
337
$template->param(
344
$template->param(
338
    existing         => $biblionumber,
345
    existing         => $biblionumber,
339
    ordernumber           => $ordernumber,
346
    ordernumber           => $ordernumber,
Lines 353-370 $template->param( Link Here
353
    suggestionid         => $suggestion->{suggestionid},
360
    suggestionid         => $suggestion->{suggestionid},
354
    surnamesuggestedby   => $suggestion->{surnamesuggestedby},
361
    surnamesuggestedby   => $suggestion->{surnamesuggestedby},
355
    firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
362
    firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
356
    biblionumber     => $biblionumber,
363
    biblionumber         => $biblionumber,
357
    uncertainprice   => $data->{'uncertainprice'},
364
    uncertainprice       => $data->{'uncertainprice'},
358
    authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'},
365
    authorisedbyname     => $borrower->{'firstname'} . " " . $borrower->{'surname'},
359
    biblioitemnumber => $data->{'biblioitemnumber'},
366
    biblioitemnumber     => $data->{'biblioitemnumber'},
360
    discount_2dp     => sprintf( "%.2f",  $bookseller->{'discount'}) ,   # for display
367
    discount_2dp         => sprintf( "%.2f",  $bookseller->{'discount'} ) ,   # for display
361
    discount         => $bookseller->{'discount'},
368
    discount             => $bookseller->{'discount'},
369
    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
370
    orderdiscount        => $data->{'discount'},
362
    listincgst       => $bookseller->{'listincgst'},
371
    listincgst       => $bookseller->{'listincgst'},
363
    invoiceincgst    => $bookseller->{'invoiceincgst'},
372
    invoiceincgst    => $bookseller->{'invoiceincgst'},
364
    name             => $bookseller->{'name'},
373
    name             => $bookseller->{'name'},
365
    cur_active_sym   => $active_currency->{'symbol'},
374
    cur_active_sym   => $active_currency->{'symbol'},
366
    cur_active       => $active_currency->{'currency'},
375
    cur_active       => $active_currency->{'currency'},
367
    loop_currencies  => \@loop_currency,
376
    loop_currencies  => \@loop_currency,
377
    currency_rate    => $cur->{rate},
368
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
378
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
369
    title            => $data->{'title'},
379
    title            => $data->{'title'},
370
    author           => $data->{'author'},
380
    author           => $data->{'author'},
Lines 377-395 $template->param( Link Here
377
    quantity         => $data->{'quantity'},
387
    quantity         => $data->{'quantity'},
378
    quantityrec      => $data->{'quantity'},
388
    quantityrec      => $data->{'quantity'},
379
    rrp              => $data->{'rrp'},
389
    rrp              => $data->{'rrp'},
380
    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
390
    gst_values       => \@gst_values,
381
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
391
    gstrate          => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
382
    ecost            => $data->{'ecost'},
392
    gstreg           => $bookseller->{'gstreg'},
383
    unitprice        => sprintf("%.2f", $data->{'unitprice'}||0),
393
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
394
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
395
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
396
    unitprice        => sprintf( "%.2f", $data->{unitprice} || 0),
384
    notes            => $data->{'notes'},
397
    notes            => $data->{'notes'},
385
    publishercode    => $data->{'publishercode'},
398
    publishercode    => $data->{'publishercode'},
386
    barcode_subfield => $barcode_subfield,
399
    barcode_subfield => $barcode_subfield,
387
    
388
    import_batch_id  => $import_batch_id,
400
    import_batch_id  => $import_batch_id,
389
390
# CHECKME: gst-stuff needs verifing, mason.
391
    gstrate          => $bookseller->{'gstrate'} // C4::Context->preference("gist") // 0,
392
    gstreg           => $bookseller->{'gstreg'},
393
);
401
);
394
402
395
output_html_with_http_headers $input, $cookie, $template->output;
403
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/acqui/orderreceive.pl (-14 / +36 lines)
Lines 93-100 my $datereceived = $input->param('datereceived'); Link Here
93
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
93
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
94
94
95
my $bookseller = GetBookSellerFromId($booksellerid);
95
my $bookseller = GetBookSellerFromId($booksellerid);
96
my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
97
my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
98
my $results = SearchOrder($ordernumber,$search);
96
my $results = SearchOrder($ordernumber,$search);
99
97
100
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
98
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 159-174 if ( $count == 1 ) { Link Here
159
        $template->param(items => \@items);
157
        $template->param(items => \@items);
160
    }
158
    }
161
159
162
    if ( $order->{'unitprice'} == 0 ) {
160
    $order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
163
        $order->{'unitprice'} = '';
161
    $order->{unitprice} = '' if $order->{unitprice} == 0;
164
    }
162
163
    my $rrp;
164
    my $ecost;
165
    my $unitprice;
166
    if ( $bookseller->{listincgst} ) {
167
        if ( $bookseller->{invoiceincgst} ) {
168
            $rrp = $order->{rrp};
169
            $ecost = $order->{ecost};
170
            $unitprice = $order->{unitprice};
171
        } else {
172
            $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
173
            $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
174
            $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
175
        }
176
    } else {
177
        if ( $bookseller->{invoiceincgst} ) {
178
            $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
179
            $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
180
            $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
181
        } else {
182
            $rrp = $order->{rrp};
183
            $ecost = $order->{ecost};
184
            $unitprice = $order->{unitprice};
185
        }
186
     }
165
187
166
    my $suggestion   = GetSuggestionInfoFromBiblionumber($order->{'biblionumber'});
188
    my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
167
189
168
    my $authorisedby = $order->{'authorisedby'};
190
    my $authorisedby = $order->{authorisedby};
169
    my $member = GetMember( borrowernumber => $authorisedby );
191
    my $member = GetMember( borrowernumber => $authorisedby );
170
192
171
    my $budget = GetBudget( $order->{'budget_id'} );
193
    my $budget = GetBudget( $order->{budget_id} );
172
194
173
    $template->param(
195
    $template->param(
174
        AcqCreateItem         => $AcqCreateItem,
196
        AcqCreateItem         => $AcqCreateItem,
Lines 178-184 if ( $count == 1 ) { Link Here
178
        biblioitemnumber      => $order->{'biblioitemnumber'},
200
        biblioitemnumber      => $order->{'biblioitemnumber'},
179
        booksellerid          => $order->{'booksellerid'},
201
        booksellerid          => $order->{'booksellerid'},
180
        freight               => $freight,
202
        freight               => $freight,
181
        gst                   => $gst,
203
        gstrate               => $order->{gstrate} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0,
182
        name                  => $bookseller->{'name'},
204
        name                  => $bookseller->{'name'},
183
        date                  => format_date($order->{entrydate}),
205
        date                  => format_date($order->{entrydate}),
184
        title                 => $order->{'title'},
206
        title                 => $order->{'title'},
Lines 190-198 if ( $count == 1 ) { Link Here
190
        quantity              => $order->{'quantity'},
212
        quantity              => $order->{'quantity'},
191
        quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
213
        quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
192
        quantityreceived      => $order->{'quantityreceived'},
214
        quantityreceived      => $order->{'quantityreceived'},
193
        rrp                   => $order->{'rrp'},
215
        rrp                   => sprintf( "%.2f", $rrp ),
194
        ecost                 => $order->{'ecost'},
216
        ecost                 => sprintf( "%.2f", $ecost ),
195
        unitprice             => $order->{'unitprice'},
217
        unitprice             => $unitprice,
196
        memberfirstname       => $member->{firstname} || "",
218
        memberfirstname       => $member->{firstname} || "",
197
        membersurname         => $member->{surname} || "",
219
        membersurname         => $member->{surname} || "",
198
        invoice               => $invoice,
220
        invoice               => $invoice,
Lines 212-221 else { Link Here
212
        $line{invoice}      = $invoice;
234
        $line{invoice}      = $invoice;
213
        $line{datereceived} = $datereceived->output();
235
        $line{datereceived} = $datereceived->output();
214
        $line{freight}      = $freight;
236
        $line{freight}      = $freight;
215
        $line{gst}          = $gst;
237
        $line{gstrate}      = @$results[$i]->{'gstrate'} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
216
        $line{title}        = @$results[$i]->{'title'};
238
        $line{title}        = @$results[$i]->{'title'};
217
        $line{author}       = @$results[$i]->{'author'};
239
        $line{author}       = @$results[$i]->{'author'};
218
        $line{booksellerid}   = $booksellerid;
240
        $line{booksellerid} = $booksellerid;
219
        push @loop, \%line;
241
        push @loop, \%line;
220
    }
242
    }
221
243
(-)a/acqui/parcel.pl (-45 / +99 lines)
Lines 76-83 my $bookseller=GetBookSellerFromId($booksellerid); Link Here
76
76
77
my $invoice=$input->param('invoice') || '';
77
my $invoice=$input->param('invoice') || '';
78
my $freight=$input->param('freight');
78
my $freight=$input->param('freight');
79
my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
79
80
my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
80
#my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); # FIXME from comm
81
#my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
82
81
my $datereceived =  ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) 
83
my $datereceived =  ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) 
82
					:  C4::Dates->new($input->param('datereceived'), 'iso')   ;
84
					:  C4::Dates->new($input->param('datereceived'), 'iso')   ;
83
$datereceived = C4::Dates->new() unless $datereceived;
85
$datereceived = C4::Dates->new() unless $datereceived;
Lines 90-105 my $resultsperpage = $input->param('resultsperpage'); Link Here
90
$resultsperpage = 20 unless ($resultsperpage);
92
$resultsperpage = 20 unless ($resultsperpage);
91
$startfrom=0 unless ($startfrom);
93
$startfrom=0 unless ($startfrom);
92
94
95
sub get_value_with_gst_params {
96
    my $value = shift;
97
    my $gstrate = shift;
98
    my $bookseller = shift;
99
    if ( $bookseller->{listincgst} ) {
100
        if ( $bookseller->{invoiceincgst} ) {
101
            return $value;
102
        } else {
103
            return $value / ( 1 + $gstrate );
104
        }
105
    } else {
106
        if ( $bookseller->{invoiceincgst} ) {
107
            return $value * ( 1 + $gstrate );
108
        } else {
109
            return $value;
110
        }
111
    }
112
}
113
114
sub get_gste {
115
    my $value = shift;
116
    my $gstrate = shift;
117
    my $bookseller = shift;
118
    return $bookseller->{invoiceincgst}
119
        ? $value / ( 1 + $gstrate )
120
        : $value;
121
}
122
123
sub get_gst {
124
    my $value = shift;
125
    my $gstrate = shift;
126
    my $bookseller = shift;
127
    return $bookseller->{invoiceincgst}
128
        ? $value / ( 1 + $gstrate ) * $gstrate
129
        : $value * ( 1 + $gstrate ) - $value;
130
}
131
93
if($input->param('format') eq "json"){
132
if($input->param('format') eq "json"){
94
    my ($template, $loggedinuser, $cookie)
133
    my ($template, $loggedinuser, $cookie)
95
        = get_template_and_user({template_name => "acqui/ajax.tmpl",
134
        = get_template_and_user({template_name => "acqui/ajax.tmpl",
96
                 query => $input,
135
                 query => $input,
97
				 type => "intranet",
136
                 type => "intranet",
98
                 authnotrequired => 0,
137
                 authnotrequired => 0,
99
                 flagsrequired => {acquisition => 'order_receive'},
138
                 flagsrequired => {acquisition => 'order_receive'},
100
                 debug => 1,
139
                 debug => 1,
101
    });
140
    });
102
       
141
103
    my @datas;
142
    my @datas;
104
    my $search   = $input->param('search') || '';
143
    my $search   = $input->param('search') || '';
105
    my $supplier = $input->param('booksellerid') || '';
144
    my $supplier = $input->param('booksellerid') || '';
Lines 110-116 if($input->param('format') eq "json"){ Link Here
110
    foreach my $order (@$orders){
149
    foreach my $order (@$orders){
111
        if($order->{quantityreceived} < $order->{quantity}){
150
        if($order->{quantityreceived} < $order->{quantity}){
112
            my $data = {};
151
            my $data = {};
113
            
152
            my $ecost = get_value_with_gst_params( $order->{ecost}, $order->{gstrate}, $bookseller );
153
114
            $data->{basketno} = $order->{basketno};
154
            $data->{basketno} = $order->{basketno};
115
            $data->{ordernumber} = $order->{ordernumber};
155
            $data->{ordernumber} = $order->{ordernumber};
116
            $data->{title} = $order->{title};
156
            $data->{title} = $order->{title};
Lines 120-131 if($input->param('format') eq "json"){ Link Here
120
            $data->{biblionumber} = $order->{biblionumber};
160
            $data->{biblionumber} = $order->{biblionumber};
121
            $data->{freight} = $order->{freight};
161
            $data->{freight} = $order->{freight};
122
            $data->{quantity} = $order->{quantity};
162
            $data->{quantity} = $order->{quantity};
123
            $data->{ecost} = $order->{ecost};
163
            $data->{ecost}        = sprintf( "%.2f", $ecost );
124
            $data->{ordertotal} = sprintf("%.2f",$order->{ecost}*$order->{quantity});
164
            $data->{ordertotal}   = sprintf( "%.2f", $ecost * $order->{quantity} );
125
            push @datas, $data;
165
            push @datas, $data;
126
        }
166
        }
127
    }
167
    }
128
    
168
129
    my $json_text = to_json(\@datas);
169
    my $json_text = to_json(\@datas);
130
    $template->param(return => $json_text);
170
    $template->param(return => $json_text);
131
    output_html_with_http_headers $input, $cookie, $template->output;
171
    output_html_with_http_headers $input, $cookie, $template->output;
Lines 135-141 if($input->param('format') eq "json"){ Link Here
135
my ($template, $loggedinuser, $cookie)
175
my ($template, $loggedinuser, $cookie)
136
    = get_template_and_user({template_name => "acqui/parcel.tmpl",
176
    = get_template_and_user({template_name => "acqui/parcel.tmpl",
137
                 query => $input,
177
                 query => $input,
138
				 type => "intranet",
178
                 type => "intranet",
139
                 authnotrequired => 0,
179
                 authnotrequired => 0,
140
                 flagsrequired => {acquisition => 'order_receive'},
180
                 flagsrequired => {acquisition => 'order_receive'},
141
                 debug => 1,
181
                 debug => 1,
Lines 156-199 if( scalar(@rcv_err) ) { Link Here
156
196
157
my $cfstr         = "%.2f";                                                           # currency format string -- could get this from currency table.
197
my $cfstr         = "%.2f";                                                           # currency format string -- could get this from currency table.
158
my @parcelitems   = GetParcel($booksellerid, $invoice, $datereceived->output('iso'));
198
my @parcelitems   = GetParcel($booksellerid, $invoice, $datereceived->output('iso'));
159
my $countlines    = scalar @parcelitems;
199
#my $countlines    = scalar @parcelitems; FIXME from comm, it's used ?
160
my $totalprice    = 0;
200
my $totalprice    = 0;
161
my $totalfreight  = 0;
201
my $totalfreight  = 0;
162
my $totalquantity = 0;
202
my $totalquantity = 0;
163
my $total;
203
my $total;
164
my $tototal;
204
my $tototal;
165
my @loop_received = ();
205
my @loop_received = ();
166
206
my @book_foot_loop;
167
for (my $i = 0 ; $i < $countlines ; $i++) {
207
my %foot;
168
208
my $total_quantity = 0;
169
    #$total=($parcelitems[$i]->{'unitprice'} + $parcelitems[$i]->{'freight'}) * $parcelitems[$i]->{'quantityreceived'};   #weird, are the freight fees counted by book? (pierre)
209
my $total_gste = 0;
170
    $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'};    #weird, are the freight fees counted by book? (pierre)
210
my $total_gsti = 0;
171
    $parcelitems[$i]->{'unitprice'} += 0;
211
212
for my $item ( @parcelitems ) {
213
    $item->{unitprice} = get_value_with_gst_params( $item->{unitprice}, $item->{gstrate}, $bookseller );
214
    $total = ( $item->{'unitprice'} ) * $item->{'quantityreceived'};    #weird, are the freight fees counted by book? (pierre)
215
    $item->{'unitprice'} += 0;
172
    my %line;
216
    my %line;
173
    %line          = %{ $parcelitems[$i] };
217
    %line          = %{ $item };
218
    my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
219
    $line{ecost} = sprintf( "%.2f", $ecost );
174
    $line{invoice} = $invoice;
220
    $line{invoice} = $invoice;
175
    $line{gst}     = $gst;
176
    $line{total} = sprintf($cfstr, $total);
221
    $line{total} = sprintf($cfstr, $total);
177
    $line{booksellerid} = $booksellerid;
222
    $line{booksellerid} = $booksellerid;
178
    push @loop_received, \%line;
223
    $totalprice += $item->{'unitprice'};
179
    $totalprice += $parcelitems[$i]->{'unitprice'};
224
    $line{unitprice} = sprintf( $cfstr, $item->{'unitprice'} );
180
    $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'});
225
    my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller );
226
    my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller );
227
    $foot{$line{gstrate}}{gstrate} = $line{gstrate};
228
    $foot{$line{gstrate}}{value} += sprintf( "%.2f", $gst );
229
    $total_quantity += $line{quantity};
230
    $total_gste += $gste;
231
    $total_gsti += $gste + $gst;
181
232
182
    my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
233
    my $suggestion   = GetSuggestionInfoFromBiblionumber($line{biblionumber});
183
    $line{suggestionid}         = $suggestion->{suggestionid};
234
    $line{suggestionid}         = $suggestion->{suggestionid};
184
    $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
235
    $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
185
    $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
236
    $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
186
237
187
    #double FIXME - totalfreight is redefined later.
238
    $totalfreight = $item->{'freight'};
239
    $totalquantity += $item->{'quantityreceived'};
188
240
189
# FIXME - each order in a  parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget..
190
    if ($i > 0 && $totalfreight != $parcelitems[$i]->{'freight'}) {
191
        warn "FREIGHT CHARGE MISMATCH!!";
192
    }
193
    $totalfreight = $parcelitems[$i]->{'freight'};
194
    $totalquantity += $parcelitems[$i]->{'quantityreceived'};
195
    $tototal       += $total;
241
    $tototal       += $total;
196
}
242
243
    my $budget = GetBudget( $line{budget_id} );
244
    $line{budget_name} = $budget->{'budget_name'};
245
246
    push @loop_received, \%line;
247
 }
248
249
push @book_foot_loop, map { $_ } values %foot;
197
250
198
my $pendingorders = GetPendingOrders($booksellerid);
251
my $pendingorders = GetPendingOrders($booksellerid);
199
my $countpendings = scalar @$pendingorders;
252
my $countpendings = scalar @$pendingorders;
Lines 205-227 my @loop_orders = (); Link Here
205
for (my $i = 0 ; $i < $countpendings ; $i++) {
258
for (my $i = 0 ; $i < $countpendings ; $i++) {
206
    my %line;
259
    my %line;
207
    %line = %{$pendingorders->[$i]};
260
    %line = %{$pendingorders->[$i]};
208
   
261
262
    my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
263
    $line{unitprice} = get_value_with_gst_params( $line{unitprice}, $line{gstrate}, $bookseller );
209
    $line{quantity}+=0;
264
    $line{quantity}+=0;
210
    $line{quantityreceived}+=0;
265
    $line{quantityreceived}+=0;
211
    $line{unitprice}+=0;
266
    $line{unitprice}+=0;
212
    $totalPunitprice += $line{unitprice};
267
    $totalPunitprice += $line{unitprice};
213
    $totalPquantity +=$line{quantity};
268
    $totalPquantity +=$line{quantity};
214
    $totalPqtyrcvd +=$line{quantityreceived};
269
    $totalPqtyrcvd +=$line{quantityreceived};
215
    $totalPecost += $line{ecost};
270
    $totalPecost += $ecost;
216
    $line{ecost} = sprintf("%.2f",$line{ecost});
271
    $line{ecost} = sprintf( "%.2f", $ecost );
217
    $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
272
    $line{ordertotal} = sprintf( "%.2f", $ecost * $line{quantity} );
218
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
273
    $line{unitprice} = sprintf("%.2f",$line{unitprice});
219
    $line{invoice} = $invoice;
274
    $line{invoice} = $invoice;
220
    $line{gst} = $gst;
221
    $line{total} = $total;
222
    $line{booksellerid} = $booksellerid;
275
    $line{booksellerid} = $booksellerid;
223
    $ordergrandtotal += $line{ecost} * $line{quantity};
276
    $ordergrandtotal += $ecost * $line{quantity};
224
    
277
225
    my $biblionumber = $line{'biblionumber'};
278
    my $biblionumber = $line{'biblionumber'};
226
    my $countbiblio = CountBiblioInOrders($biblionumber);
279
    my $countbiblio = CountBiblioInOrders($biblionumber);
227
    my $ordernumber = $line{'ordernumber'};
280
    my $ordernumber = $line{'ordernumber'};
Lines 242-247 for (my $i = 0 ; $i < $countpendings ; $i++) { Link Here
242
    $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
295
    $line{surnamesuggestedby}   = $suggestion->{surnamesuggestedby};
243
    $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
296
    $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
244
297
298
    my $budget = GetBudget( $line{budget_id} );
299
    $line{budget_name} = $budget->{'budget_name'};
300
245
    # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
301
    # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
246
    $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
302
    $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
247
    $line{items}                = ($itemcount) - (scalar @items);
303
    $line{items}                = ($itemcount) - (scalar @items);
Lines 254-261 for (my $i = 0 ; $i < $countpendings ; $i++) { Link Here
254
    $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
310
    $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
255
    $line{holds}                = $holds;
311
    $line{holds}                = $holds;
256
    $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
312
    $line{holds_on_order}       = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
257
    
313
258
    
259
    push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
314
    push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
260
}
315
}
261
$freight = $totalfreight unless $freight;
316
$freight = $totalfreight unless $freight;
Lines 293-299 if ($count>$resultsperpage){ Link Here
293
                    );
348
                    );
294
}
349
}
295
350
296
#$totalfreight=$freight;
297
$tototal = $tototal + $freight;
351
$tototal = $tototal + $freight;
298
352
299
$template->param(
353
$template->param(
Lines 303-327 $template->param( Link Here
303
    formatteddatereceived => $datereceived->output(),
357
    formatteddatereceived => $datereceived->output(),
304
    name                  => $bookseller->{'name'},
358
    name                  => $bookseller->{'name'},
305
    booksellerid            => $booksellerid,
359
    booksellerid            => $booksellerid,
306
    gst                   => $gst,
307
    freight               => $freight,
360
    freight               => $freight,
308
    invoice               => $invoice,
361
    invoice               => $invoice,
309
    countreceived         => $countlines,
310
    loop_received         => \@loop_received,
362
    loop_received         => \@loop_received,
311
    countpending          => $countpendings,
312
    loop_orders           => \@loop_orders,
363
    loop_orders           => \@loop_orders,
364
    book_foot_loop        => \@book_foot_loop,
313
    totalprice            => sprintf($cfstr, $totalprice),
365
    totalprice            => sprintf($cfstr, $totalprice),
314
    totalfreight          => $totalfreight,
366
    totalfreight          => $totalfreight,
315
    totalquantity         => $totalquantity,
367
    totalquantity         => $totalquantity,
316
    tototal               => sprintf($cfstr, $tototal),
368
    tototal               => sprintf($cfstr, $tototal),
317
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
369
    ordergrandtotal       => sprintf($cfstr, $ordergrandtotal),
318
    gst                   => $gst,
370
    grandtot              => sprintf($cfstr, $tototal ),
319
    grandtot              => sprintf($cfstr, $tototal + $gst),
320
    totalPunitprice       => sprintf("%.2f", $totalPunitprice),
371
    totalPunitprice       => sprintf("%.2f", $totalPunitprice),
321
    totalPquantity        => $totalPquantity,
372
    totalPquantity        => $totalPquantity,
322
    totalPqtyrcvd         => $totalPqtyrcvd,
373
    totalPqtyrcvd         => $totalPqtyrcvd,
323
    totalPecost           => sprintf("%.2f", $totalPecost),
374
    totalPecost           => sprintf("%.2f", $totalPecost),
324
    resultsperpage        => $resultsperpage,
375
    resultsperpage        => $resultsperpage,
376
    total_quantity       => $total_quantity,
377
    total_gste           => sprintf( "%.2f", $total_gste ),
378
    total_gsti           => sprintf( "%.2f", $total_gsti ),
325
);
379
);
326
output_html_with_http_headers $input, $cookie, $template->output;
380
output_html_with_http_headers $input, $cookie, $template->output;
327
 
381
 
(-)a/acqui/supplier.pl (-12 / +7 lines)
Lines 67-78 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
67
        debug           => 1,
67
        debug           => 1,
68
    }
68
    }
69
);
69
);
70
my $seller_gstrate = $supplier->{'gstrate'};
71
70
72
# ensure the scalar isn't flagged as a string
73
$seller_gstrate = ( defined $seller_gstrate ) ? $seller_gstrate + 0 : undef;
74
my $tax_rate = $seller_gstrate // C4::Context->preference('gist') // 0;
75
$tax_rate *= 100;
76
#build array for currencies
71
#build array for currencies
77
if ( $op eq 'display' ) {
72
if ( $op eq 'display' ) {
78
73
Lines 102-113 if ( $op eq 'display' ) { Link Here
102
        gstreg        => $supplier->{'gstreg'},
97
        gstreg        => $supplier->{'gstreg'},
103
        listincgst    => $supplier->{'listincgst'},
98
        listincgst    => $supplier->{'listincgst'},
104
        invoiceincgst => $supplier->{'invoiceincgst'},
99
        invoiceincgst => $supplier->{'invoiceincgst'},
100
        gstrate       => $supplier->{'gstrate'} + 0.0,
105
        discount      => $supplier->{'discount'},
101
        discount      => $supplier->{'discount'},
106
        deliverytime  => $supplier->{deliverytime},
102
        deliverytime  => $supplier->{deliverytime},
107
        invoiceprice  => $supplier->{'invoiceprice'},
103
        invoiceprice  => $supplier->{'invoiceprice'},
108
        listprice     => $supplier->{'listprice'},
104
        listprice     => $supplier->{'listprice'},
109
        GST           => $tax_rate,
110
        default_tax   => defined($seller_gstrate),
111
        basketcount   => $supplier->{'basketcount'},
105
        basketcount   => $supplier->{'basketcount'},
112
        subscriptioncount   => $supplier->{'subscriptioncount'},
106
        subscriptioncount   => $supplier->{'subscriptioncount'},
113
        contracts     => $contracts,
107
        contracts     => $contracts,
Lines 141-149 if ( $op eq 'display' ) { Link Here
141
            };
135
            };
142
    }
136
    }
143
137
144
    my $default_gst_rate = (C4::Context->preference('gist') * 100) || '0.0';
138
    # get option values from gist syspref
139
    my @gst_values = map {
140
        option => $_
141
    }, split( '\|', C4::Context->preference("gist") );
145
142
146
    my $gstrate = defined $supplier->{gstrate} ? $supplier->{gstrate} * 100 : '';
147
    $template->param(
143
    $template->param(
148
        booksellerid => $booksellerid,
144
        booksellerid => $booksellerid,
149
        name         => $supplier->{'name'},
145
        name         => $supplier->{'name'},
Lines 169-181 if ( $op eq 'display' ) { Link Here
169
        gstreg        => $supplier->{'gstreg'},
165
        gstreg        => $supplier->{'gstreg'},
170
        listincgst    => $supplier->{'listincgst'},
166
        listincgst    => $supplier->{'listincgst'},
171
        invoiceincgst => $supplier->{'invoiceincgst'},
167
        invoiceincgst => $supplier->{'invoiceincgst'},
172
        gstrate       => $gstrate,
168
        gstrate       => $supplier->{gstrate} ? $supplier->{'gstrate'}+0.0 : 0,
169
        gst_values    => \@gst_values,
173
        discount      => $supplier->{'discount'},
170
        discount      => $supplier->{'discount'},
174
        deliverytime  => $supplier->{deliverytime},
171
        deliverytime  => $supplier->{deliverytime},
175
        loop_currency => $loop_currency,
172
        loop_currency => $loop_currency,
176
        GST           => $tax_rate,
177
        enter         => 1,
173
        enter         => 1,
178
        default_gst_rate => $default_gst_rate,
179
    );
174
    );
180
}
175
}
181
176
(-)a/acqui/updatesupplier.pl (-7 / +2 lines)
Lines 100-112 $data{'gstreg'}=$input->param('gst'); Link Here
100
$data{'listincgst'}=$input->param('list_gst');
100
$data{'listincgst'}=$input->param('list_gst');
101
$data{'invoiceincgst'}=$input->param('invoice_gst');
101
$data{'invoiceincgst'}=$input->param('invoice_gst');
102
#have to transform this into fraction so it's easier to use
102
#have to transform this into fraction so it's easier to use
103
my $gstrate = $input->param('gstrate');
103
$data{'gstrate'} = $input->param('gstrate');
104
if ($gstrate eq '') {
104
$data{'discount'} = $input->param('discount');
105
    $data{'gstrate'} = undef;
106
} else {
107
    $data{'gstrate'} = $input->param('gstrate')/100;
108
}
109
$data{'discount'}=$input->param('discount');
110
$data{deliverytime} = $input->param('deliverytime');
105
$data{deliverytime} = $input->param('deliverytime');
111
$data{'active'}=$input->param('status');
106
$data{'active'}=$input->param('status');
112
if($data{'name'}) {
107
if($data{'name'}) {
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 2737-2743 CREATE TABLE `aqorders` ( Link Here
2737
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2737
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2738
  `rrp` decimal(13,2) default NULL,
2738
  `rrp` decimal(13,2) default NULL,
2739
  `ecost` decimal(13,2) default NULL,
2739
  `ecost` decimal(13,2) default NULL,
2740
  `gst` decimal(13,2) default NULL,
2740
  gstrate decimal(6,4) default NULL,
2741
  discount float(6,4) default NULL,
2741
  `budget_id` int(11) NOT NULL,
2742
  `budget_id` int(11) NOT NULL,
2742
  `budgetgroup_id` int(11) NOT NULL,
2743
  `budgetgroup_id` int(11) NOT NULL,
2743
  `budgetdate` date default NULL,
2744
  `budgetdate` date default NULL,
(-)a/installer/data/mysql/updatedatabase.pl (+14 lines)
Lines 5246-5251 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5246
    SetVersion($DBversion);
5246
    SetVersion($DBversion);
5247
}
5247
}
5248
5248
5249
$DBversion = "3.07.00.XXX";
5250
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5251
    $dbh->do("ALTER TABLE aqorders CHANGE COLUMN gst gstrate DECIMAL(6,4)  DEFAULT NULL");
5252
    print "Upgrade to $DBversion done (Change column name in aqorders gst --> gstrate)\n";
5253
    SetVersion($DBversion);
5254
}
5255
5256
$DBversion = "3.07.00.XXX";
5257
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5258
    $dbh->do("ALTER TABLE aqorders ADD discount float(6,4) DEFAULT NULL AFTER gstrate");
5259
    print "Upgrade to $DBversion done (Add discount field in aqorders table)\n";
5260
    SetVersion($DBversion);
5261
}
5262
5249
=head1 FUNCTIONS
5263
=head1 FUNCTIONS
5250
5264
5251
=head2 TableExists($table)
5265
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js (-39 / +15 lines)
Lines 646-694 function messenger(X,Y,etc){ // FIXME: unused? Link Here
646
646
647
//  NEXT BLOCK IS USED BY NEWORDERBEMPTY
647
//  NEXT BLOCK IS USED BY NEWORDERBEMPTY
648
648
649
function calcNeworderTotal(){
649
function updateCosts(){
650
    //collect values
650
    var quantity = new Number($("#quantity").val());
651
    var f        = document.getElementById('Aform');
651
    var discount = new Number($("#discount").val());
652
    var quantity = new Number(f.quantity.value);
652
    var applygst = new Number ($("#applygst").val());
653
    var discount = new Number(f.discount.value);
653
    var listprice   =  new Number($("#listprice").val());
654
    var listinc  = new Number (f.listinc.value);
654
    var exchangerate =  new Number($("#currency_rate").val());
655
    //var currency = f.currency.value;
655
    var gst_on=false;
656
    var applygst = new Number (f.applygst.value);
656
657
    var listprice   =  new Number(f.listprice.value);
658
    var invoiceingst =  new Number (f.invoiceincgst.value);
659
//    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
660
        var currcode = new String(document.getElementById('currency').value);
661
	var exchangerate =  new Number(document.getElementById(currcode).value);
662
663
    var gst_on=(!listinc && invoiceingst);
664
665
    //do real stuff
666
    var rrp   = new Number(listprice*exchangerate);
657
    var rrp   = new Number(listprice*exchangerate);
667
    var ecost = rrp;
658
    var ecost = rrp;
668
    if (100-discount != 100) { //Prevent rounding issues if no discount
659
    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
669
        ecost = new Number(Math.floor(rrp * (100 - discount ))/100);
660
        ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);
670
    }
661
    }
671
    var GST   = new Number(0);
662
    var total =  new Number( ecost * quantity);
672
    if (gst_on) {
663
    $("#rrp").val(rrp.toFixed(2));
673
            rrp=rrp * (1+f.gstrate.value / 100);
664
    $("#ecost").val(ecost.toFixed(2));
674
        GST=ecost * f.gstrate.value / 100;
665
    $("#total").val(total.toFixed(2));
675
    }
666
    $("listprice").val(listprice.toFixed(2));
676
677
    var total =  new Number( (ecost + GST) * quantity);
678
667
679
    f.rrp.value = rrp.toFixed(2);
680
681
//	f.rrp.value = rrp
682
//	f.rrp.value = 'moo'
683
684
    f.ecost.value = ecost.toFixed(2);
685
    f.total.value = total.toFixed(2);
686
    f.listprice.value =  listprice.toFixed(2);
687
688
//  gst-stuff needs verifing, mason.
689
    if (f.GST) {
690
        f.GST.value=GST;
691
    }
692
    return true;
668
    return true;
693
}
669
}
694
670
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-1 / +1 lines)
Lines 163-169 Link Here
163
                            [% ELSE %]
163
                            [% ELSE %]
164
                            <li>
164
                            <li>
165
                            <label for="currency">Currency:</label>
165
                            <label for="currency">Currency:</label>
166
                            <select name="currency" id="currency" onchange="calcNeworderTotal();">
166
                            <select name="currency" id="currency">
167
                            [% FOREACH loop_currencie IN loop_currencies %]
167
                            [% FOREACH loop_currencie IN loop_currencies %]
168
                                    [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
168
                                    [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
169
                            </select>
169
                            </select>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-54 / +94 lines)
Lines 2-20 Link Here
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
6
<script type="text/javascript">
7
//<![CDATA[
8
    function updateColumnsVisibility(visible) {
9
        if ( visible ) {
10
            $("table .gste, .gsti").show();
11
        } else {
12
            [% IF ( listincgst ) %]
13
                $("table .gste").hide();
14
            [% ELSE %]
15
                $("table .gsti").hide();
16
            [% END %]
17
        }
18
    }
19
20
    $(document).ready(function() {
21
        $("#show_all_details").click(function(){
22
            updateColumnsVisibility($(this+":checked").val());
23
        });
24
25
        $("#show_all_details").attr('checked', false);
26
        updateColumnsVisibility(false);
27
    });
28
//]]>
29
</script>
30
5
[% UNLESS ( closedate ) %]
31
[% UNLESS ( closedate ) %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
32
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script type="text/javascript">
33
<script type="text/javascript">
8
//<![CDATA[
34
//<![CDATA[
9
    $(document).ready(function() {
35
    $(document).ready(function() {
10
        $("#orders").tablesorter({
36
        $("#orders").tablesorter({});
11
            headers: {
12
                9: { sorter: false },
13
                10: { sorter: false }
14
            }
15
        });
16
        $("#cancelledorderst").tablesorter();
37
        $("#cancelledorderst").tablesorter();
17
    });
38
    });
39
18
            function confirm_close() {
40
            function confirm_close() {
19
                var is_confirmed = confirm(_('Are you sure you want to close this basket?'));
41
                var is_confirmed = confirm(_('Are you sure you want to close this basket?'));
20
                if (is_confirmed) {
42
                if (is_confirmed) {
Lines 215-230 Link Here
215
237
216
        [% UNLESS ( delete_confirm ) %]
238
        [% UNLESS ( delete_confirm ) %]
217
        <div id="acqui_basket_content" class="yui-g">
239
        <div id="acqui_basket_content" class="yui-g">
240
        <label for="show_all_details">
241
            <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
242
            Show all details
243
        </label>
218
        <h2>Order Details</h2>
244
        <h2>Order Details</h2>
219
        [% IF ( books_loop ) %]
245
        [% IF ( books_loop ) %]
220
            <table id="orders">
246
            <table id="orders">
221
                <thead>
247
                <thead>
222
                    <tr>
248
                    <tr>
223
                        <th>Order</th>
249
                        <th>Order</th>
224
                        <th>RRP</th>
250
                        <th class="gste">RRP tax exc.</th>
225
                        <th>Est.</th>
251
                        <th class="gste">ecost tax exc.</th>
252
                        <th class="gsti">RRP tax inc.</th>
253
                        <th class="gsti">ecost tax inc.</th>
226
                        <th>Qty.</th>
254
                        <th>Qty.</th>
227
                        <th>Total</th>
255
                        <th class="gste">Total tax exc. ([% currency %])</th>
256
                        <th class="gsti">Total tax inc. ([% currency %])</th>
257
                        <th>GST %</th>
258
                        <th>GST</th>
228
                        <th>Fund</th>
259
                        <th>Fund</th>
229
                        [% IF ( active ) %]
260
                        [% IF ( active ) %]
230
                            [% UNLESS ( closedate ) %]
261
                            [% UNLESS ( closedate ) %]
Lines 235-278 Link Here
235
                    </tr>
266
                    </tr>
236
                </thead>
267
                </thead>
237
                <tfoot>
268
                <tfoot>
238
                [% IF ( GST ) %]
269
                [% FOREACH foot_loo IN book_foot_loop %]
239
                <tr>
270
                    <tr>
240
                    <th scope="row">Total tax exc.</th>
271
                        <th>Total (GST [% foot_loo.gstgsti %])</th>
241
                    <td>[% total_rrp_gste %]</td>
272
                        <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
242
                    <td>&nbsp;</td>
273
                        <th>[% foot_loo.quantity %]</th>
243
                    <td>[% qty_total %]</td>
274
                        <th class="gste">[% foot_loo.totalgste %]</th>
244
                    <td>[% total_est_gste %]</td>
275
                        <th class="gsti">[% foot_loo.totalgsti %]</th>
245
                        [% IF ( active ) %]
276
                        <th/>
246
                            [% IF ( closedate ) %]
277
                        <th>[% foot_loo.gstvalue %]</th>
247
                            <td colspan="1" rowspan="3">&nbsp;</td>
278
                        <th/>
248
                            [% ELSE %]
279
                        [% IF ( foot_loo.active ) %]
249
                            <td colspan="3" rowspan="3">&nbsp;</td>
280
                            [% UNLESS ( foot_loo.closedate ) %]
281
                                <th/>&nbsp;<th/>
250
                            [% END %]
282
                            [% END %]
251
                        [% END %]
283
                        [% END %]
252
                </tr>
284
                    </tr>
253
                <tr>
285
                [% END %]
254
                    <th scope="row">Tax ([% gist_rate %])</th>
255
                    <td>[% gist_rrp %]</td>
256
                    <td>&nbsp;</td>
257
                    <td>&nbsp;</td>
258
                    <td>[% gist_est %]</td>
259
                </tr>
260
                <tr>
261
                    <th scope="row">Total tax inc. ([% currency %])</th>
262
                    <td>[% total_rrp_gsti %]</td>
263
                    <td>&nbsp;</td>
264
                    <td>[% qty_total %]</td>
265
                    <td>[% total_est_gsti %]</td>
266
                </tr>
267
                [% ELSE %]
268
                <tr>
286
                <tr>
269
                    <th scope="row">Total ([% currency %])</th>
287
                    <th>Total ([% currency %])</th>
270
                    <td>[% total_rrp_gsti %]</td>
288
                    <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
271
                    <td>&nbsp;</td>
289
                    <th>[% total_quantity %]</th>
272
                    <td>[% qty_total %]</td>
290
                    <th class="gste">[% total_gste %]</th>
273
                    <td>[% total_est_gsti %]</td>
291
                    <th class="gsti">[% total_gsti %]</th>
292
                    <th/>
293
                    <th>[% total_gstvalue %]</th>
294
                    <th/>
295
                    [% IF ( books_loo.active ) %]
296
                        [% UNLESS ( books_loo.closedate ) %]
297
                            <th/>&nbsp;<th/>
298
                        [% END %]
299
                    [% END %]
274
                </tr>
300
                </tr>
275
                [% END %]
276
                </tfoot>
301
                </tfoot>
277
                <tbody>
302
                <tbody>
278
                [% FOREACH books_loo IN books_loop %]
303
                [% FOREACH books_loo IN books_loop %]
Lines 298-307 Link Here
298
                                [% END %]
323
                                [% END %]
299
                            </p>
324
                            </p>
300
                        </td>
325
                        </td>
301
                        <td class="number">[% books_loo.rrp %]</td>
326
                        <td class="number gste">[% books_loo.rrpgste %]</td>
302
                        <td class="number">[% books_loo.ecost %]</td>
327
                        <td class="number gste">[% books_loo.ecostgste %]</td>
328
                        <td class="number gsti">[% books_loo.rrpgsti %]</td>
329
                        <td class="number gsti">[% books_loo.ecostgsti %]</td>
303
                        <td class="number">[% books_loo.quantity %]</td>
330
                        <td class="number">[% books_loo.quantity %]</td>
304
                        <td class="number">[% books_loo.line_total %]</td>
331
                        <td class="number gste">[% books_loo.totalgste %]</td>
332
                        <td class="number gsti">[% books_loo.totalgsti %]</td>
333
                        <td class="number">[% books_loo.gstgsti %]</td>
334
                        <td class="number">[% books_loo.gstvalue %]</td>
305
                        <td>[% books_loo.budget_name %]</td>
335
                        <td>[% books_loo.budget_name %]</td>
306
                        [% IF ( active ) %]
336
                        [% IF ( active ) %]
307
                            [% UNLESS ( closedate ) %]
337
                            [% UNLESS ( closedate ) %]
Lines 353-362 Link Here
353
              <thead>
383
              <thead>
354
                <tr>
384
                <tr>
355
                  <th>Order</th>
385
                  <th>Order</th>
356
                  <th>RRP</th>
386
                  <th class="gste">RRP tax exc.</th>
357
                  <th>Est.</th>
387
                  <th class="gste">ecost tax exc.</th>
388
                  <th class="gsti">RRP tax inc.</th>
389
                  <th class="gsti">ecost tax inc.</th>
358
                  <th>Qty.</th>
390
                  <th>Qty.</th>
359
                  <th>Total</th>
391
                  <th class="gste">Total tax exc. ([% currency %])</th>
392
                  <th class="gsti">Total tax inc. ([% currency %])</th>
393
                  <th>GST %</th>
394
                  <th>GST</th>
360
                  <th>Fund</th>
395
                  <th>Fund</th>
361
                </tr>
396
                </tr>
362
              </thead>
397
              </thead>
Lines 379-389 Link Here
379
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
414
                        [% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
380
                      </p>
415
                      </p>
381
                    </td>
416
                    </td>
382
                    <td><p>[% order.rrp %]</p></td>
417
                    <td class="number gste">[% order.rrpgste %]</td>
383
                    <td><p>[% order.ecost %]</p></td>
418
                    <td class="number gste">[% order.ecostgste %]</td>
384
                    <td><p>[% order.quantity %]</p></td>
419
                    <td class="number gsti">[% order.rrpgsti %]</td>
385
                    <td><p>[% order.line_total %]</p></td>
420
                    <td class="number gsti">[% order.ecostgsti %]</td>
386
                    <td><p>[% order.budget_name %]</p></td>
421
                    <td class="number">[% order.quantity %]</td>
422
                    <td class="number gste">[% order.totalgste %]</td>
423
                    <td class="number gsti">[% order.totalgsti %]</td>
424
                    <td class="number">[% order.gstgsti %]</td>
425
                    <td class="number">[% order.gstvalue %]</td>
426
                    <td>[% order.budget_name %]
387
                  </tr>
427
                  </tr>
388
                [% END %]
428
                [% END %]
389
              </tbody>
429
              </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-39 / +50 lines)
Lines 143-149 $(document).ready(function() Link Here
143
//]]>
143
//]]>
144
</script>
144
</script>
145
</head>
145
</head>
146
<body id="acq_neworderempty" class="acq">
146
<body id="acq_neworderempty" class="acq" onload="updateCosts()">
147
147
148
[% INCLUDE 'header.inc' %]
148
[% INCLUDE 'header.inc' %]
149
[% INCLUDE 'acquisitions-search.inc' %]
149
[% INCLUDE 'acquisitions-search.inc' %]
Lines 222-239 $(document).ready(function() Link Here
222
        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
222
        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
223
        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
223
        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
224
        <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
224
        <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
225
        <input type="hidden" name="discount" value="[% discount %]" />
225
        <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
226
        <input type="hidden" name="listinc" value="[% listincgst %]" />
226
        <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
227
<!--        <input type="hidden" name="currency" value="[% currency %]" />-->
227
        <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
228
        <input type="hidden" name="applygst" value="[% gstreg %]" />
229
        <input type="hidden" name="invoiceincgst" value="[% invoiceincgst %]" />
230
        <input type="hidden" name="gstrate" value="[% gstrate %]" />
231
        <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
228
        <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
232
        <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
229
        <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
230
        <input type="hidden" name="currency_rate" id="currency_rate" value="[% currency_rate %]" />
233
231
234
        [% FOREACH loop_currencie IN loop_currencies %]
235
            <input type="hidden" id="[% loop_currencie.currcode %]"  name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
236
        [% END %]
237
        <ol><li>
232
        <ol><li>
238
            [% IF ( biblionumber ) %]
233
            [% IF ( biblionumber ) %]
239
            <span class="label">Title</span>
234
            <span class="label">Title</span>
Lines 383-389 $(document).ready(function() Link Here
383
                    [% IF (AcqCreateItemOrdering) %]
378
                    [% IF (AcqCreateItemOrdering) %]
384
                        <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
379
                        <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
385
                    [% ELSE %]
380
                    [% ELSE %]
386
                        <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" />
381
                        <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
387
                    [% END %]
382
                    [% END %]
388
                [% END %]
383
                [% END %]
389
                <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
384
                <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
Lines 417-423 $(document).ready(function() Link Here
417
			<input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
412
			<input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
418
                [% ELSE %]
413
                [% ELSE %]
419
			<label for="currency">Currency:</label>
414
			<label for="currency">Currency:</label>
420
			<select name="currency" id="currency" onchange="calcNeworderTotal();">
415
			<select name="currency" id="currency" onchange="updateCosts();">
421
			[% FOREACH loop_currencie IN loop_currencies %]
416
			[% FOREACH loop_currencie IN loop_currencies %]
422
	                [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
417
	                [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
423
			</select>
418
			</select>
Lines 425-435 $(document).ready(function() Link Here
425
                </li>
420
                </li>
426
            <li>
421
            <li>
427
                [% IF ( close ) %]
422
                [% IF ( close ) %]
428
            <span class="label">Vendor price: </span>
423
                    <span class="label">Vendor price: </span>
429
                    <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
424
                    <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
430
                [% ELSE %]
425
                [% ELSE %]
431
                <label for="listprice">Vendor price: </label>
426
                <label for="listprice">Vendor price: </label>
432
                    <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
427
                    <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" />
433
                [% END %]
428
                [% END %]
434
            </li>
429
            </li>
435
            [% UNLESS ( close ) %]
430
            [% UNLESS ( close ) %]
Lines 442-494 $(document).ready(function() Link Here
442
                [% END %]
437
                [% END %]
443
            </li>
438
            </li>
444
            [% END %]
439
            [% END %]
445
			<li>
440
            <li>
446
                [% IF ( close ) %]
441
                [% IF ( close ) %]
447
            <span class="label">Replacement cost: </span>
442
                    <span class="label">gstrate: </span>
448
                    <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
443
                    <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
449
                [% ELSE %]
444
                [% ELSE %]
450
                <label for="rrp">Replacement cost: </label>
445
                    <label for="gst">gstrate: </label>
451
                    <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
446
                    <select name="gstrate" id="gstrate" onchange="updateCosts();">
447
                    [% FOREACH gst IN gst_values %]
448
                       <option value="[% gst.option %]"[% IF ( gst.option == gstrate ) %] selected="selected"[% END %]>[% gst.option * 100 | format("%.1f") %]%</option>
449
                    [% END %]
450
                    </select>
452
                [% END %]
451
                [% END %]
453
            </li>
452
            </li>
454
            <li>
453
            <li>
454
                <label for="discount">Discount: </label>
455
                [% IF ( close ) %]
455
                [% IF ( close ) %]
456
            <label for="ecost">Budgeted cost: </label>
456
                    [% IF ( orderdiscount ) %]
457
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
457
                        <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
458
                    [% ELSE %]
459
                        <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
460
                    [% END %]
458
                [% ELSE %]
461
                [% ELSE %]
459
                <label for="ecost">Budgeted cost: </label>
462
                    [% IF ( orderdiscount ) %]
460
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
463
                        <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
464
                    [% ELSE %]
465
                        <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
466
                    [% END %]
461
                [% END %]
467
                [% END %]
462
                [% IF ( discount_2dp ) %]  (adjusted for [% discount_2dp %]% discount)  [% END %]
463
464
            </li>
468
            </li>
465
            [% IF ( GST ) %]
466
            <li>
469
            <li>
467
                [% IF ( close ) %]
470
                [% IF ( close ) %]
468
            <label for="GST">Budgeted GST: </label>
471
                    <span class="label">Replacement cost: </span>
469
                <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
472
                    <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
470
                [% ELSE %]
473
                [% ELSE %]
471
                <label for="GST">Budgeted GST: </label>
474
                    <label for="rrp">Replacement cost: </label>
472
                <input type="text" size="20" name="gst" id="GST" value="" />
475
                    <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
476
                [% END %]
477
            </li>
478
            <li>
479
                [% IF ( close ) %]
480
                    <label for="ecost">Budgeted cost: </label>
481
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
482
                [% ELSE %]
483
                    <label for="ecost">Budgeted cost: </label>
484
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
473
                [% END %]
485
                [% END %]
474
            </li>
486
            </li>
475
            [% END %]
476
            <li>
487
            <li>
477
                [% IF ( close ) %]
488
                [% IF ( close ) %]
478
            <label for="total">Total: </label>
489
                    <label for="total">Total: </label>
479
                <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
490
                    <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
480
                [% ELSE %]
491
                [% ELSE %]
481
                <label for="total">Total: </label>
492
                    <label for="total">Total: </label>
482
                <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
493
                    <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
483
                [% END %]
494
                [% END %]
484
            </li>
495
            </li>
485
            <li>
496
            <li>
486
                [% IF ( close ) %]
497
                [% IF ( close ) %]
487
            <label for="cost">Actual cost: </label>
498
                    <label for="unitprice">Actual cost: </label>
488
                <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
499
                    <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
489
                [% ELSE %]
500
                [% ELSE %]
490
                <label for="cost">Actual cost: </label>
501
                    <label for="unitprice">Actual cost: </label>
491
                <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
502
                    <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
492
                [% END %]
503
                [% END %]
493
            </li>
504
            </li>
494
            <li>
505
            <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-3 / +3 lines)
Lines 241-247 Link Here
241
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
241
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
242
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
242
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
243
    <input type="hidden" name="freight" value="[% freight %]" />
243
    <input type="hidden" name="freight" value="[% freight %]" />
244
    <input type="hidden" name="gst" value="[% gst %]" />
244
    <input type="hidden" name="gstrate" value="[% gstrate %]" />
245
	</div>
245
	</div>
246
	<div class="yui-u">
246
	<div class="yui-u">
247
    <fieldset class="rows">
247
    <fieldset class="rows">
Lines 302-308 Link Here
302
</div>
302
</div>
303
</div><div class="yui-g"><fieldset class="action">
303
</div><div class="yui-g"><fieldset class="action">
304
        <input type="submit"  value="Save" />
304
        <input type="submit"  value="Save" />
305
        <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% supplierid %]&amp;invoice=[% invoice %]&amp;gst=[% gst %]&amp;freight=[% freight %]">Cancel</a>
305
        <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% supplierid %]&amp;invoice=[% invoice %]&amp;gst=rate[% gstrate %]&amp;freight=[% freight %]">Cancel</a>
306
</fieldset></div>    </form>
306
</fieldset></div>    </form>
307
[% ELSE %]
307
[% ELSE %]
308
<div id="acqui_acquire_orderlist">
308
<div id="acqui_acquire_orderlist">
Lines 319-325 Link Here
319
        <tr>
319
        <tr>
320
            <td>[% loo.basketno %]</td>
320
            <td>[% loo.basketno %]</td>
321
            <td>[% loo.isbn %]</td>
321
            <td>[% loo.isbn %]</td>
322
         <td><a href="orderreceive.pl?datereceived=[% loo.datereceived %]&amp;receive=[% loo.ordernumber %]&amp;biblio=[% loo.biblionumber %]&amp;invoice=[% loo.invoice %]&amp;freight=[% loo.freight %]&amp;gst=[% loo.gst %]&amp;id=[% loo.id %]">[% loo.title |html %]</a></td>
322
         <td><a href="orderreceive.pl?datereceived=[% loo.datereceived %]&amp;receive=[% loo.ordernumber %]&amp;biblio=[% loo.biblionumber %]&amp;invoice=[% loo.invoice %]&amp;freight=[% loo.freight %]&amp;gstrate=[% loo.gstrate %]&amp;id=[% loo.id %]">[% loo.title |html %]</a></td>
323
            <td>[% loo.author %]</td>
323
            <td>[% loo.author %]</td>
324
            <td>[% loo.quantity %]</td>
324
            <td>[% loo.quantity %]</td>
325
            <td>[% loo.quantityreceived %]</td>
325
            <td>[% loo.quantityreceived %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-51 / +24 lines)
Lines 19-25 Link Here
19
19
20
    $(document).ready(function(){
20
    $(document).ready(function(){
21
    $("#pendingt").tablesorter({
21
    $("#pendingt").tablesorter({
22
		headers: { 2: { sorter: 'articles' },3: { sorter: false },7:{sorter:false}}
22
		headers: { 2: { sorter: 'articles' },3: { sorter: false },8:{sorter:false}}
23
    });
23
    });
24
24
25
	rowCountPending  = $("#pendingt tbody.filterclass tr").length;
25
	rowCountPending  = $("#pendingt tbody.filterclass tr").length;
Lines 44-50 Link Here
44
	$("#pendingcollapserow").remove();
44
	$("#pendingcollapserow").remove();
45
    $("#pendingt tr").show();
45
    $("#pendingt tr").show();
46
	$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
46
	$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
47
	$("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ")  + rowsToCollapse +  _(" items are displayed.") + "<a href=\"javascript:pendingExpand();\">" + _("Click here to show all ")  + rowCountPending + _(" items") + "<\/a>.<\/p>");
47
	$("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ")  + rowsToCollapse +  _(" items are displayed.") + " <a href=\"javascript:pendingExpand();\">" + _("Click here to show all ")  + rowCountPending + _(" items") + "<\/a>.<\/p>");
48
48
49
    }
49
    }
50
50
Lines 53-73 Link Here
53
	$("#pendingcollapserow").remove();
53
	$("#pendingcollapserow").remove();
54
	$("#pendingt tr").show();
54
	$("#pendingt tr").show();
55
    $("#pendingt tbody.filterclass tr.orderfound").remove();
55
    $("#pendingt tbody.filterclass tr.orderfound").remove();
56
	$("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
56
	$("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + " <a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
57
    }
57
    }
58
58
59
    // Collapse already received items table
59
    // Collapse already received items table
60
    function receivedCollapse() {
60
    function receivedCollapse() {
61
	$("#receivedcollapserow").remove();
61
	$("#receivedcollapserow").remove();
62
	$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
62
	$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
63
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
63
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
64
    }
64
    }
65
65
66
    // Expand already received items table
66
    // Expand already received items table
67
    function receivedExpand() {
67
    function receivedExpand() {
68
	$("#receivedcollapserow").remove();
68
	$("#receivedcollapserow").remove();
69
	$("#receivedt tr").show();
69
	$("#receivedt tr").show();
70
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
70
	$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + " <a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
71
    }
71
    }
72
72
73
    // Launch filtering
73
    // Launch filtering
Lines 89-95 Link Here
89
	var callback =  {
89
	var callback =  {
90
		success: function(o) {
90
		success: function(o) {
91
			var jsonString = o.responseText;
91
			var jsonString = o.responseText;
92
			var gst = "[% gst %]";
93
			try {
92
			try {
94
				var orders = YAHOO.lang.JSON.parse(jsonString);
93
				var orders = YAHOO.lang.JSON.parse(jsonString);
95
				var foundCount = orders.length;
94
				var foundCount = orders.length;
Lines 106-112 Link Here
106
                       + '<td>' + order.ecost + '</td>'
105
                       + '<td>' + order.ecost + '</td>'
107
                       + '<td>' + order.ordertotal + '</td>'
106
                       + '<td>' + order.ordertotal + '</td>'
108
                       + '<td>'
107
                       + '<td>'
109
                       + '<a href="orderreceive.pl?ordernumber=' + order.ordernumber + '&amp;datereceived=[% invoicedatereceived %]&amp;invoice=[% invoice %]&amp;gst=' + gst + '&amp;freight=' + order.freight + '&amp;booksellerid=[% booksellerid %]">Receive</a> /'
108
                       + '<a href="orderreceive.pl?ordernumber=' + order.ordernumber + '&amp;datereceived=[% invoicedatereceived %]&amp;invoice=[% invoice %]&amp;freight=' + order.freight + '&amp;booksellerid=[% booksellerid %]">Receive</a> /'
110
                       + '<a href="parcel.pl?type=intra&amp;ordernumber=' + order.ordernumber + '&amp;biblionumber=' + order.biblionumber + '&amp;action=cancelorder&amp;booksellerid=[% booksellerid %]&amp;datereceived=[% invoicedatereceived %]&amp;invoice=[% invoice %]" onclick="return confirm(\'' + _('Are you sure you want to cancel this order?') + '\');">Cancel</a>'
109
                       + '<a href="parcel.pl?type=intra&amp;ordernumber=' + order.ordernumber + '&amp;biblionumber=' + order.biblionumber + '&amp;action=cancelorder&amp;booksellerid=[% booksellerid %]&amp;datereceived=[% invoicedatereceived %]&amp;invoice=[% invoice %]" onclick="return confirm(\'' + _('Are you sure you want to cancel this order?') + '\');">Cancel</a>'
111
                       + '</td></tr>').appendTo("table#pendingt");
110
                       + '</td></tr>').appendTo("table#pendingt");
112
				}
111
				}
Lines 214-232 Link Here
214
            <th>Quantity</th>
213
            <th>Quantity</th>
215
            <th>Unit cost</th>
214
            <th>Unit cost</th>
216
            <th>Order cost</th>
215
            <th>Order cost</th>
216
            <th>Fund</th>
217
            <th>&nbsp;</th>
217
            <th>&nbsp;</th>
218
            <th>&nbsp;</th>
218
            <th>&nbsp;</th>
219
        </tr>
219
        </tr>
220
    </thead>
220
    </thead>
221
		<tfoot>
222
            <tr><td colspan="4" class="total">TOTAL</td>
223
                <td> [% totalPquantity %] </td>
224
				<td>&nbsp;</td>
225
                <td>[% ordergrandtotal %]</td>
226
				<td>&nbsp;</td>
227
				<td>&nbsp;</td>
228
            </tr>
229
		</tfoot>
230
    <tbody class="filterclass">
221
    <tbody class="filterclass">
231
        [% FOREACH loop_order IN loop_orders %]
222
        [% FOREACH loop_order IN loop_orders %]
232
	[% UNLESS ( loop.odd ) %]
223
	[% UNLESS ( loop.odd ) %]
Lines 257-264 Link Here
257
                <td>[% loop_order.quantity %]</td>
248
                <td>[% loop_order.quantity %]</td>
258
                <td>[% loop_order.ecost %]</td>
249
                <td>[% loop_order.ecost %]</td>
259
                <td>[% loop_order.ordertotal %]</td>
250
                <td>[% loop_order.ordertotal %]</td>
251
                <td>[% loop_order.budget_name %]</td>
260
				<td>
252
				<td>
261
				    <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]&amp;gst=[% loop_order.gst %]&amp;freight=[% loop_order.freight %]&amp;booksellerid=[% loop_order.booksellerid %]">Receive</a>
253
				    <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;datereceived=[% loop_order.invoicedatereceived %]&amp;invoice=[% loop_order.invoice %]&amp;freight=[% loop_order.freight %]&amp;booksellerid=[% loop_order.booksellerid %]">Receive</a>
262
				    
254
				    
263
				</td>
255
				</td>
264
				<td>
256
				<td>
Lines 324-363 Link Here
324
		<th>TOTAL</th>
316
		<th>TOTAL</th>
325
	    </tr>
317
	    </tr>
326
	</thead>
318
	</thead>
327
<tfoot>
319
    <tfoot>
328
	    <tr>
320
        <tr>
329
		<td colspan="4" class="total">SUBTOTAL</td>
321
            <th colspan="7" class="total">Total tax exc.</th>
330
		<td colspan="2">&nbsp;</td>
322
            <th>[% total_gste %]</th>
331
		<td>[% totalprice %]</td>
323
        </tr>
332
		<td>[% tototal %]</td>
324
        [% FOREACH book_foot IN book_foot_loop %]
333
	    </tr>
325
            <tr>
334
	      
326
                <th colspan="7">Total (GST [% book_foot.gstrate * 100 | format ("%.1f") %]%)</th>
335
	      [% IF ( totalfreight ) %]
327
                <th>[% book_foot.value %]</th>
336
		    <tr>
328
            </tr>
337
			<td colspan="6">&nbsp;
329
        [% END %]
338
		</td>
330
        <tr>
339
			    <td>Shipping</td>
331
            <th colspan="7" class="total">Total tax inc.</th>
340
		<td>[% totalfreight %]</td>
332
            <th>[% total_gsti %]</th>
341
	    	</tr> 
333
        </tr>
342
	    [% END %]
343
	      [% IF ( gst ) %]
344
		    <tr>
345
			<td colspan="6">
346
		<p class="message">
347
			    <b>HELP</b><br />
348
		    The total at the bottom of the page should be within a few cents of the total for the invoice.
349
		</p>
350
		</td>
351
			    <td><b>Tax rate</b></td>
352
		<td>[% gst %]</td>
353
	    	</tr> 
354
	    [% END %]
355
	    <tr>
356
	    <td colspan="4" class="total">TOTAL</td>
357
		<td>[% totalquantity %]</td>
358
		<td colspan="2">&nbsp;</td>
359
		<td>[% grandtot %]</td>
360
	    </tr>
361
    </tfoot>
334
    </tfoot>
362
	<tbody class="filterclass">
335
	<tbody class="filterclass">
363
	    [% FOREACH loop_receive IN loop_received %]
336
	    [% FOREACH loop_receive IN loop_received %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt (-4 / +13 lines)
Lines 107-113 if (f.company.value == "") { Link Here
107
            </li>
107
            </li>
108
            </ol>
108
            </ol>
109
            <ol class="radio">
109
            <ol class="radio">
110
            <li><label for="gstyes" class="radio">Tax Number Registered:</label>
110
            <li><label for="gstyes" class="radio">Tax number registered:</label>
111
                [% IF ( gstreg ) %]
111
                [% IF ( gstreg ) %]
112
                    <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
112
                    <label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
113
                    <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
113
                    <label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
Lines 134-143 if (f.company.value == "") { Link Here
134
                    <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
134
                    <label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
135
                [% END %]</li>
135
                [% END %]</li>
136
            </ol>
136
            </ol>
137
             <ol>
138
                <li>
139
                    <label for="gst">Tax rate</label>
140
                    <select name="gstrate" id="gstrate">
141
                    [% FOREACH gst IN gst_values %]
142
                       <option value="[% gst.option %]"[% IF ( gstrate == gst.option ) %] selected="selected"[% END %]>[% gst.option * 100 | format ("%.1f") %] %</option>
143
                    [% END %]
144
                    </select>
145
                </li>
146
            </ol>
137
            <ol>
147
            <ol>
138
            <li><label for="discount">Discount</label>
148
            <li><label for="discount">Discount</label>
139
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
149
                <input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
140
            <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
141
            <li>
150
            <li>
142
                <label for="deliverytime">Delivery time</label>
151
                <label for="deliverytime">Delivery time</label>
143
                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
152
                <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
Lines 192-198 if (f.company.value == "") { Link Here
192
                    [% END %]</p>
201
                    [% END %]</p>
193
            <p><strong>List prices are: </strong>[% listprice %]</p>
202
            <p><strong>List prices are: </strong>[% listprice %]</p>
194
            <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
203
            <p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
195
            [% IF ( GST ) %]<p><strong>Tax number registered: </strong>
204
            [% IF ( gstrate ) %]<p><strong>Tax number registered: </strong>
196
                    [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
205
                    [% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
197
            <p><strong>List item price includes tax: </strong>
206
            <p><strong>List item price includes tax: </strong>
198
                    [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
207
                    [% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
Lines 201-207 if (f.company.value == "") { Link Here
201
            <p><strong>Discount: </strong>
210
            <p><strong>Discount: </strong>
202
                [% discount %] %</p>
211
                [% discount %] %</p>
203
            <p><strong>Tax rate: </strong>
212
            <p><strong>Tax rate: </strong>
204
                [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
213
                [% 0 + gstrate * 100 | format("%.1f") %]%</p>
205
            [% IF deliverytime.defined %]
214
            [% IF deliverytime.defined %]
206
                <p><strong>Delivery time: </strong>
215
                <p><strong>Delivery time: </strong>
207
                    [% deliverytime %] days</p>
216
                    [% deliverytime %] days</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-2 / +2 lines)
Lines 32-40 Acquisitions: Link Here
32
              US: 360,000.00 (US)
32
              US: 360,000.00 (US)
33
              FR: 360 000,00 (FR)
33
              FR: 360 000,00 (FR)
34
    -
34
    -
35
        - The default tax rate is   
35
        - Default tax rates are
36
        - pref: gist
36
        - pref: gist
37
        - (enter in numeric form, 0.12 for 12%)
37
        - (enter in numeric form, 0.12 for 12%. First is the default. If you want more than 1 value, please separe with |)
38
38
39
    Printing:
39
    Printing:
40
    -
40
    -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (+34 lines)
Lines 122-127 $(document).ready(function() { Link Here
122
     </div>
122
     </div>
123
</div>
123
</div>
124
</div>
124
</div>
125
    [% IF ( show_acquisition_details ) %]
126
        <div id="acquisition_details">
127
            <h2>Acquisition details</h2>
128
            <table>
129
                <thead>
130
                    <tr><th></th><th>Price exc. taxes</th><th>Price inc. taxes</th><th>fund</th><th></th></tr>
131
                </thead>
132
                <tbody>
133
                    <tr>
134
                        <td>Ordered amount</td>
135
                        <td>[% valuegste_ordered %]</td>
136
                        <td>[% valuegsti_ordered %]</td>
137
                        <td>[% budget_name_ordered %]</td>
138
                        <td>
139
                            [% IF ( ordered_exists ) %]
140
                                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">See basket informations</a>
141
                            [% END %]
142
                        </td>
143
                    </tr>
144
                    <tr>
145
                        <td>Spent amount</td>
146
                        <td>[% valuegste_spent %]</td>
147
                        <td>[% valuegsti_spent %]</td>
148
                        <td>[% budget_name_spent %]</td>
149
                        <td>
150
                            [% IF ( spent_exists ) %]
151
                                <a href="/cgi-bin/koha/acqui/invoice.pl?invoicenumber=[% invoicenumber %]">See invoice informations</a>
152
                            [% END %]
153
                        </td>
154
                    </tr>
155
                </tbody>
156
            </table>
157
        </div>
158
    <!-- /TMPL_IF -->
125
    <div id="subscription_planning">
159
    <div id="subscription_planning">
126
    <div class="yui-g">
160
    <div class="yui-g">
127
    <div class="rows">
161
    <div class="rows">
(-)a/serials/subscription-detail.pl (+27 lines)
Lines 119-124 if (! $subs->{periodicity}) { Link Here
119
    $subs->{periodicity} = '0';
119
    $subs->{periodicity} = '0';
120
}
120
}
121
my $default_bib_view = get_default_view();
121
my $default_bib_view = get_default_view();
122
123
my ( $order, $bookseller, $tmpl_infos );
124
if ( defined $subscriptionid ) {
125
    my $lastOrderNotReceived = GetLastOrderNotReceivedFromSubscriptionid $subscriptionid;
126
    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
127
    if ( defined $lastOrderNotReceived ) {
128
        my $basket = GetBasket $$lastOrderNotReceived{basketno};
129
        my $bookseller = GetBookSellerFromId $$basket{booksellerid};
130
        ( $$tmpl_infos{valuegsti_ordered}, $$tmpl_infos{valuegste_ordered} ) = get_value_with_gst_params ( $$lastOrderNotReceived{ecost}, $$lastOrderNotReceived{gstrate}, $bookseller );
131
        $$tmpl_infos{valuegsti_ordered} = sprintf( "%.2f", $$tmpl_infos{valuegsti_ordered} );
132
        $$tmpl_infos{valuegste_ordered} = sprintf( "%.2f", $$tmpl_infos{valuegste_ordered} );
133
        $$tmpl_infos{budget_name_ordered} = GetBudgetName $$lastOrderNotReceived{budget_id};
134
        $$tmpl_infos{basketno} = $$lastOrderNotReceived{basketno};
135
        $$tmpl_infos{ordered_exists} = 1;
136
    }
137
    if ( defined $lastOrderReceived ) {
138
        my $basket = GetBasket $$lastOrderReceived{basketno};
139
        my $bookseller = GetBookSellerFromId $$basket{booksellerid};
140
        ( $$tmpl_infos{valuegsti_spent}, $$tmpl_infos{valuegste_spent} ) = get_value_with_gst_params ( $$lastOrderReceived{unitprice}, $$lastOrderReceived{gstrate}, $bookseller );
141
        $$tmpl_infos{valuegsti_spent} = sprintf( "%.2f", $$tmpl_infos{valuegsti_spent} );
142
        $$tmpl_infos{valuegste_spent} = sprintf( "%.2f", $$tmpl_infos{valuegste_spent} );
143
        $$tmpl_infos{budget_name_spent} = GetBudgetName $$lastOrderReceived{budget_id};
144
        $$tmpl_infos{invoicenumber} = $$lastOrderReceived{booksellerinvoicenumber};
145
        $$tmpl_infos{spent_exists} = 1;
146
    }
147
}
148
122
$template->param(
149
$template->param(
123
	subscriptionid => $subscriptionid,
150
	subscriptionid => $subscriptionid,
124
    serialslist => \@serialslist,
151
    serialslist => \@serialslist,
(-)a/t/db_dependent/lib/KohaTest/Acquisition/GetParcel.pm (+1 lines)
Lines 48-53 sub one_parcel : Test( 17 ) { Link Here
48
                                        undef,         # $quantrec,
48
                                        undef,         # $quantrec,
49
                                        undef,         # $user,
49
                                        undef,         # $user,
50
                                        undef,         # $cost,
50
                                        undef,         # $cost,
51
                                        undef,         # $ecost,
51
                                        $invoice,         # $invoiceno,
52
                                        $invoice,         # $invoiceno,
52
                                        undef,         # $freight,
53
                                        undef,         # $freight,
53
                                        undef,         # $rrp,
54
                                        undef,         # $rrp,
(-)a/t/db_dependent/lib/KohaTest/Acquisition/GetParcels.pm (-1 / +1 lines)
Lines 276-281 sub create_order { Link Here
276
                                        undef,         # $quantrec,
276
                                        undef,         # $quantrec,
277
                                        undef,         # $user,
277
                                        undef,         # $user,
278
                                        undef,         # $cost,
278
                                        undef,         # $cost,
279
                                        undef,         # $ecost,
279
                                        $param{'invoice'},         # $invoiceno,
280
                                        $param{'invoice'},         # $invoiceno,
280
                                        undef,         # $freight,
281
                                        undef,         # $freight,
281
                                        undef,         # $rrp,
282
                                        undef,         # $rrp,
282
- 

Return to bug 5335