diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 88a968a7b3..05cae14b3a 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1021,7 +1021,7 @@ Else, the upcoming July 1st is used. =item defaults entrydate to Now -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". +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". =back @@ -1270,7 +1270,7 @@ C<$ordernumber>. sub ModReceiveOrder { my ( - $biblionumber, $ordernumber, $quantrec, $user, $cost, + $biblionumber, $ordernumber, $quantrec, $user, $cost, $ecost, $invoiceid, $rrp, $budget_id, $datereceived, $received_items ) = @_; @@ -1306,6 +1306,7 @@ sub ModReceiveOrder { "); $sth->execute($order->{quantity} - $quantrec, $ordernumber); + $sth->finish; delete $order->{'ordernumber'}; @@ -1315,6 +1316,7 @@ sub ModReceiveOrder { $order->{'invoiceid'} = $invoiceid; $order->{'unitprice'} = $cost; $order->{'rrp'} = $rrp; + $order->{ecost} = $ecost; $order->{'orderstatus'} = 3; # totally received $new_ordernumber = NewOrder($order); @@ -1326,9 +1328,9 @@ sub ModReceiveOrder { } else { $sth=$dbh->prepare("update aqorders set quantityreceived=?,datereceived=?,invoiceid=?, - unitprice=?,rrp=? + unitprice=?,rrp=?,ecost=? where biblionumber=? and ordernumber=?"); - $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$biblionumber,$ordernumber); + $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$ecost,$biblionumber,$ordernumber); $sth->finish; } return ($datereceived, $new_ordernumber); @@ -1598,6 +1600,7 @@ sub GetParcel { aqorders.listprice, aqorders.rrp, aqorders.ecost, + aqorders.gstrate, biblio.title FROM aqorders LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 01febba05d..1dfa0b1e1c 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -153,39 +153,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $orderinfo = $input->Vars; $orderinfo->{'list_price'} ||= 0; $orderinfo->{'uncertainprice'} ||= 0; -#my $ordernumber = $input->param('ordernumber'); -#my $basketno = $input->param('basketno'); -#my $booksellerid = $input->param('booksellerid'); -#my $existing = $input->param('existing'); # existing biblio, (not basket or order) -#my $title = $input->param('title'); -#my $author = $input->param('author'); -#my $publicationyear= $input->param('publicationyear'); -#my $isbn = $input->param('ISBN'); -#my $itemtype = $input->param('format'); -#my $quantity = $input->param('quantity'); # FIXME: else ERROR! -#my $branch = $input->param('branch'); -#my $series = $input->param('series'); -#my $notes = $input->param('notes'); -#my $budget_id = $input->param('budget_id'); -#my $sort1 = $input->param('sort1'); -#my $sort2 = $input->param('sort2'); -#my $rrp = $input->param('rrp'); -#my $ecost = $input->param('ecost'); -#my $gst = $input->param('GST'); -#my $budget = $input->param('budget'); -#my $cost = $input->param('cost'); -#my $sub = $input->param('sub'); -#my $purchaseorder = $input->param('purchaseordernumber'); -#my $invoice = $input->param('invoice'); -#my $publishercode = $input->param('publishercode'); -#my $suggestionid = $input->param('suggestionid'); -#my $biblionumber = $input->param('biblionumber'); -#my $uncertainprice = $input->param('uncertainprice'); -#my $import_batch_id= $input->param('import_batch_id'); -# -#my $createbibitem = $input->param('createbibitem'); -# -my $user = $input->remote_user; + +my $user = $input->remote_user; + # create, modify or delete biblio # create if $quantity>=0 and $existing='no' # modify if $quantity>=0 and $existing='yes' @@ -208,6 +178,13 @@ if ( $orderinfo->{quantity} ne '0' ) { "biblio.copyrightdate" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "", "biblioitems.itemtype" => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "", "biblioitems.editionstatement"=> $$orderinfo{editionstatement} ? $$orderinfo{editionstatement} : "", + "aqorders.branchcode" => $$orderinfo{branchcode} ? $$orderinfo{branchcode} : "", + "aqorders.quantity" => $$orderinfo{quantity} ? $$orderinfo{quantity} : "", + "aqorders.listprice" => $$orderinfo{listprice} ? $$orderinfo{listprice} : "", + "aqorders.uncertainprice" => $$orderinfo{uncertainprice} ? $$orderinfo{uncertainprice} : "", + "aqorders.rrp" => $$orderinfo{rrp} ? $$orderinfo{rrp} : "", + "aqorders.ecost" => $$orderinfo{ecost} ? $$orderinfo{ecost} : "", + "aqorders.discount" => $$orderinfo{discount} ? $$orderinfo{discount} : "", }); # create the record in catalogue, with framework '' @@ -220,6 +197,8 @@ if ( $orderinfo->{quantity} ne '0' ) { $orderinfo->{biblionumber}=$biblionumber; } + $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; + # if we already have $ordernumber, then it's an ordermodif if ($$orderinfo{ordernumber}) { ModOrder( $orderinfo); diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 3dc83335c1..4942571952 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -205,7 +205,6 @@ if ($op eq ""){ my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour')); if ($price){ - $orderinfo{'listprice'} = $price; eval { require C4::Acquisition; import C4::Acquisition qw/GetBasket/; @@ -222,13 +221,19 @@ if ($op eq ""){ } my $basket = GetBasket( $orderinfo{basketno} ); my $bookseller = GetBookSellerFromId( $basket->{booksellerid} ); - my $gst = $bookseller->{gstrate} || C4::Context->preference("gist") || 0; - $orderinfo{'unitprice'} = $orderinfo{listprice} - ( $orderinfo{listprice} * ( $bookseller->{discount} / 100 ) ); - $orderinfo{'ecost'} = $orderinfo{unitprice}; + $orderinfo{gstrate} = $bookseller->{gstrate}; + if ( $bookseller->{listincgst} ) { + $orderinfo{ecost} = $price; + } else { + $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} ); + } + $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} ); + $orderinfo{listprice} = $orderinfo{rrp}; + $orderinfo{unitprice} = $orderinfo{ecost}; + $orderinfo{total} = $orderinfo{ecost}; } else { $orderinfo{'listprice'} = 0; } - $orderinfo{'rrp'} = $orderinfo{'listprice'}; # remove uncertainprice flag if we have found a price in the MARC record $orderinfo{uncertainprice} = 0 if $orderinfo{listprice}; diff --git a/acqui/basket.pl b/acqui/basket.pl index 9b36c14846..4b7566b934 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -238,121 +238,47 @@ if ( $op eq 'delete_confirm' ) { "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s", $basket->{creationdate}, $basket->{authorisedby}; - #to get active currency - my $cur = GetCurrency(); + #to get active currency + my $cur = GetCurrency(); my @results = GetOrders( $basketno ); - - my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; - $gist = 0 if $gist == 0.0000; - my $discount = $bookseller->{'discount'} / 100; - my $total_rrp = 0; # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'} - my $total_rrp_gsti = 0; # RRP Total, GST included - my $total_rrp_gste = 0; # RRP Total, GST excluded - my $gist_rrp = 0; - my $total_rrp_est = 0; - - my $qty_total; my @books_loop; - my $suggestion; - for my $order ( @results ) { - my $rrp = $order->{'listprice'} || 0; - my $qty = $order->{'quantity'} || 0; - if (!defined $order->{quantityreceived}) { - $order->{quantityreceived} = 0; - } - for ( qw(rrp ecost quantityreceived)) { - if (!defined $order->{$_}) { - $order->{$_} = 0; - } - } - - my $budget = GetBudget( $order->{'budget_id'} ); - $rrp = ConvertCurrency( $order->{'currency'}, $rrp ); - - $total_rrp += $qty * $order->{'rrp'}; - my $line_total = $qty * $order->{'ecost'}; - $total_rrp_est += $qty * $order->{'ecost'}; - # FIXME: what about the "actual cost" field? - $qty_total += $qty; - my %line = %{ $order }; - my $biblionumber = $order->{'biblionumber'}; - my $countbiblio = CountBiblioInOrders($biblionumber); - my $ordernumber = $order->{'ordernumber'}; - my @subscriptions = GetSubscriptionsId ($biblionumber); - my $itemcount = GetItemsCount($biblionumber); - my $holds = GetHolds ($biblionumber); - my @items = GetItemnumbersFromOrder( $ordernumber ); - my $itemholds; - foreach my $item (@items){ - my $nb = GetItemHolds($biblionumber, $item); - if ($nb){ - $itemholds += $nb; - } - } - # 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 - $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds); - $line{items} = ($itemcount) - (scalar @items); - $line{left_item} = 1 if $line{items} >= 1; - $line{left_biblio} = 1 if $countbiblio > 1; - $line{biblios} = $countbiblio - 1; - $line{left_subscription} = 1 if scalar @subscriptions >= 1; - $line{subscriptions} = scalar @subscriptions; - ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0; - $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); - $line{holds} = $holds; - $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order}; - $line{order_received} = ( $qty == $order->{'quantityreceived'} ); - $line{basketno} = $basketno; - $line{budget_name} = $budget->{budget_name}; - $line{rrp} = sprintf( "%.2f", $line{'rrp'} ); - $line{ecost} = sprintf( "%.2f", $line{'ecost'} ); - $line{line_total} = sprintf( "%.2f", $line_total ); - if ($line{uncertainprice}) { + my @book_foot_loop; + my %foot; + my $total_quantity = 0; + my $total_gste = 0; + my $total_gsti = 0; + my $total_gstvalue = 0; + for my $order (@results) { + my $line = get_order_infos( $order, $bookseller); + if ( $line->{uncertainprice} ) { $template->param( uncertainprices => 1 ); - $line{rrp} .= ' (Uncertain)'; } - if ($line{'title'}){ - my $volume = $order->{'volume'}; - my $seriestitle = $order->{'seriestitle'}; - $line{'title'} .= " / $seriestitle" if $seriestitle; - $line{'title'} .= " / $volume" if $volume; - } else { - $line{'title'} = "Deleted bibliographic notice, can't find title."; - } - $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); - $line{suggestionid} = $suggestion->{suggestionid}; - $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby}; - $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby}; + push @books_loop, $line; - push @books_loop, \%line; + $foot{$$line{gstgsti}}{gstgsti} = $$line{gstgsti}; + $foot{$$line{gstgsti}}{gstvalue} += $$line{gstvalue}; + $total_gstvalue += $$line{gstvalue}; + $foot{$$line{gstgsti}}{quantity} += $$line{quantity}; + $total_quantity += $$line{quantity}; + $foot{$$line{gstgsti}}{totalgste} += $$line{totalgste}; + $total_gste += $$line{totalgste}; + $foot{$$line{gstgsti}}{totalgsti} += $$line{totalgsti}; + $total_gsti += $$line{totalgsti}; } -my $total_est_gste; - my $total_est_gsti; - my $gist_est; - if ($gist){ # if we have GST - if ( $bookseller->{'listincgst'} ) { # if prices already includes GST - $total_rrp_gsti = $total_rrp; # we know $total_rrp_gsti - $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 ); # and can reverse compute other values - $gist_rrp = $total_rrp_gsti - $total_rrp_gste; # - $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount ); - $total_est_gsti = $total_rrp_est; - } else { # if prices does not include GST - $total_rrp_gste = $total_rrp; # then we use the common way to compute other values - $gist_rrp = $total_rrp_gste * $gist; # - $total_rrp_gsti = $total_rrp_gste + $gist_rrp; # - $total_est_gste = $total_rrp_est; - $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount ); - } - $gist_est = $gist_rrp - ( $gist_rrp * $discount ); - } else { - $total_rrp_gsti = $total_rrp; - $total_est_gsti = $total_rrp_est; -} + push @book_foot_loop, map {$_} values %foot; + + # Get cancelled orders + @results = GetCancelledOrders($basketno); + my @cancelledorders_loop; + for my $order (@results) { + my $line = get_order_infos( $order, $bookseller); + push @cancelledorders_loop, $line; + } my $contract = &GetContract($basket->{contractnumber}); my @orders = GetOrders($basketno); @@ -391,18 +317,14 @@ my $total_est_gste; booksellerid => $bookseller->{'id'}, name => $bookseller->{'name'}, books_loop => \@books_loop, + book_foot_loop => \@book_foot_loop, cancelledorders_loop => \@cancelledorders, - gist_rate => sprintf( "%.2f", $gist * 100 ) . '%', - total_rrp_gste => sprintf( "%.2f", $total_rrp_gste ), - total_est_gste => sprintf( "%.2f", $total_est_gste ), - gist_est => sprintf( "%.2f", $gist_est ), - gist_rrp => sprintf( "%.2f", $gist_rrp ), - total_rrp_gsti => sprintf( "%.2f", $total_rrp_gsti ), - total_est_gsti => sprintf( "%.2f", $total_est_gsti ), -# currency => $bookseller->{'listprice'}, - currency => $cur->{'currency'}, - qty_total => $qty_total, - GST => $gist, + total_quantity => $total_quantity, + total_gste => sprintf( "%.2f", $total_gste ), + total_gsti => sprintf( "%.2f", $total_gsti ), + total_gstvalue => sprintf( "%.2f", $total_gstvalue ), + currency => $cur->{'currency'}, + listincgst => $bookseller->{listincgst}, basketgroups => $basketgroups, grouped => $basket->{basketgroupid}, unclosable => @orders ? 0 : 1, @@ -410,4 +332,88 @@ my $total_est_gste; ); } +sub get_order_infos { + my $order = shift; + my $bookseller = shift; + my $qty = $order->{'quantity'} || 0; + if ( !defined $order->{quantityreceived} ) { + $order->{quantityreceived} = 0; + } + my $budget = GetBudget( $order->{'budget_id'} ); + + my %line = %{ $order }; + $line{order_received} = ( $qty == $order->{'quantityreceived'} ); + $line{basketno} = $basketno; + $line{budget_name} = $budget->{budget_name}; + $line{rrp} = ConvertCurrency( $order->{'currency'}, $line{rrp} ); # FIXME from comm + if ( $bookseller->{'listincgst'} ) { + $line{rrpgsti} = sprintf( "%.2f", $line{rrp} ); + $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 ); + $line{rrpgste} = sprintf( "%.2f", $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ) ); + $line{gstgste} = sprintf( "%.2f", $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ) ); + $line{ecostgsti} = sprintf( "%.2f", $line{ecost} ); + $line{ecostgste} = sprintf( "%.2f", $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ) ); + $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}); + $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} ); + $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} ); + } else { + $line{rrpgsti} = sprintf( "%.2f", $line{rrp} * ( 1 + ( $line{gstrate} ) ) ); + $line{rrpgste} = sprintf( "%.2f", $line{rrp} ); + $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 ); + $line{gstgste} = sprintf( "%.2f", $line{gstrate} * 100 ); + $line{ecostgsti} = sprintf( "%.2f", $line{ecost} * ( 1 + ( $line{gstrate} ) ) ); + $line{ecostgste} = sprintf( "%.2f", $line{ecost} ); + $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity}); + $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} ); + $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} ); + } + + if ( $line{uncertainprice} ) { + $line{rrpgste} .= ' (Uncertain)'; + } + if ( $line{'title'} ) { + my $volume = $order->{'volume'}; + my $seriestitle = $order->{'seriestitle'}; + $line{'title'} .= " / $seriestitle" if $seriestitle; + $line{'title'} .= " / $volume" if $volume; + } else { + $line{'title'} = "Deleted bibliographic notice, can't find title."; + } + + my $biblionumber = $order->{'biblionumber'}; + my $countbiblio = CountBiblioInOrders($biblionumber); + my $ordernumber = $order->{'ordernumber'}; + my @subscriptions = GetSubscriptionsId ($biblionumber); + my $itemcount = GetItemsCount($biblionumber); + my $holds = GetHolds ($biblionumber); + my @items = GetItemnumbersFromOrder( $ordernumber ); + my $itemholds; + foreach my $item (@items){ + my $nb = GetItemHolds($biblionumber, $item); + if ($nb){ + $itemholds += $nb; + } + } + # 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 + $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds); + $line{items} = ($itemcount) - (scalar @items); + $line{left_item} = 1 if $line{items} >= 1; + $line{left_biblio} = 1 if $countbiblio > 1; + $line{biblios} = $countbiblio - 1; + $line{left_subscription} = 1 if scalar @subscriptions >= 1; + $line{subscriptions} = scalar @subscriptions; + ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0; + $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); + $line{holds} = $holds; + $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order}; + + + my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); + $line{suggestionid} = $$suggestion{suggestionid}; + $line{surnamesuggestedby} = $$suggestion{surnamesuggestedby}; + $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby}; + + return \%line; +} + output_html_with_http_headers $query, $cookie, $template->output; diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index bb4818dd5a..565ac36d72 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -28,6 +28,7 @@ use C4::Output; use C4::Context; use C4::Acquisition; use C4::Biblio; +use C4::Bookseller; use C4::Items; use C4::Search; use List::MoreUtils qw/any/; @@ -37,24 +38,25 @@ my $flagsrequired = {acquisition => 'order_receive'}; checkauth($input, 0, $flagsrequired, 'intranet'); -my $user=$input->remote_user; -my $biblionumber = $input->param('biblionumber'); -my $biblioitemnumber=$input->param('biblioitemnumber'); -my $ordernumber=$input->param('ordernumber'); -my $origquantityrec=$input->param('origquantityrec'); -my $quantityrec=$input->param('quantityrec'); -my $quantity=$input->param('quantity'); -my $unitprice=$input->param('cost'); -my $invoiceid = $input->param('invoiceid'); -my $invoice = GetInvoice($invoiceid); -my $invoiceno = $invoice->{invoicenumber}; -my $datereceived= $invoice->{shipmentdate}; -my $replacement=$input->param('rrp'); -my $gst=$input->param('gst'); -my $booksellerid = $input->param('booksellerid'); -my $cnt=0; -my $ecost = $input->param('ecost'); -my $note = $input->param("note"); +my $user = $input->remote_user; +my $biblionumber = $input->param('biblionumber'); +my $biblioitemnumber = $input->param('biblioitemnumber'); +my $ordernumber = $input->param('ordernumber'); +my $origquantityrec = $input->param('origquantityrec'); +my $quantityrec = $input->param('quantityrec'); +my $quantity = $input->param('quantity'); +my $unitprice = $input->param('cost'); +my $invoiceid = $input->param('invoiceid'); +my $invoice = GetInvoice($invoiceid); +my $invoiceno = $invoice->{invoicenumber}; +my $datereceived = $invoice->{shipmentdate}; +my $booksellerid = $input->param('booksellerid'); +my $cnt = 0; +my $error_url_str; +my $ecost = $input->param('ecost'); +my $rrp = $input->param('rrp'); +my $note = $input->param("note"); +my $order = GetOrder($ordernumber); #need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME if ($quantityrec > $origquantityrec ) { @@ -63,12 +65,40 @@ if ($quantityrec > $origquantityrec ) { @received_items = $input->param('items_to_receive'); } + $order->{rrp} = $rrp; + $order->{ecost} = $ecost; + $order->{unitprice} = $unitprice; + my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid); + if ( $bookseller->{listincgst} ) { + if ( not $bookseller->{invoiceincgst} ) { + $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} ); + $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} ); + $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} ); + } + } else { + if ( $bookseller->{invoiceincgst} ) { + $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} ); + $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} ); + $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} ); + } + } + my $new_ordernumber = $ordernumber; # save the quantity received. if ( $quantityrec > 0 ) { ($datereceived, $new_ordernumber) = ModReceiveOrder( - $biblionumber, $ordernumber, $quantityrec, $user, $unitprice, - $invoiceid, $replacement, undef, $datereceived, \@received_items); + $biblionumber, + $ordernumber, + $quantityrec, + $user, + $order->{unitprice}, + $order->{ecost}, + $invoiceno, + $order->{rrp}, + undef, + $datereceived, + \@received_items, + ); } # now, add items if applicable @@ -107,6 +137,7 @@ if ($quantityrec > $origquantityrec ) { NewOrderItem($itemnumber, $new_ordernumber); } } + } update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber ); @@ -122,7 +153,7 @@ sub update_item { booksellerid => $booksellerid, dateaccessioned => $datereceived, price => $unitprice, - replacementprice => $replacement, + replacementprice => $rrp, replacementpricedate => $datereceived, }, $biblionumber, $itemnumber ); } diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 4a3eb49ce6..4144033392 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -331,6 +331,13 @@ $template->param( budget_name => $budget_name ) if ($close); +# get option values for gist syspref +my @gst_values = map { + option => $_ +}, split( '\|', C4::Context->preference("gist") ); + +my $cur = GetCurrency(); + $template->param( existing => $biblionumber, ordernumber => $ordernumber, @@ -350,18 +357,21 @@ $template->param( suggestionid => $suggestion->{suggestionid}, surnamesuggestedby => $suggestion->{surnamesuggestedby}, firstnamesuggestedby => $suggestion->{firstnamesuggestedby}, - biblionumber => $biblionumber, - uncertainprice => $data->{'uncertainprice'}, - authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'}, - biblioitemnumber => $data->{'biblioitemnumber'}, - discount_2dp => sprintf( "%.2f", $bookseller->{'discount'}) , # for display - discount => $bookseller->{'discount'}, + biblionumber => $biblionumber, + uncertainprice => $data->{'uncertainprice'}, + authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'}, + biblioitemnumber => $data->{'biblioitemnumber'}, + discount_2dp => sprintf( "%.2f", $bookseller->{'discount'} ) , # for display + discount => $bookseller->{'discount'}, + orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ), + orderdiscount => $data->{'discount'}, listincgst => $bookseller->{'listincgst'}, invoiceincgst => $bookseller->{'invoiceincgst'}, name => $bookseller->{'name'}, cur_active_sym => $active_currency->{'symbol'}, cur_active => $active_currency->{'currency'}, loop_currencies => \@loop_currency, + currency_rate => $cur->{rate}, orderexists => ( $new eq 'yes' ) ? 0 : 1, title => $data->{'title'}, author => $data->{'author'}, @@ -375,19 +385,17 @@ $template->param( quantity => $data->{'quantity'}, quantityrec => $data->{'quantity'}, rrp => $data->{'rrp'}, - listprice => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice), - total => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ), - ecost => $data->{'ecost'}, - unitprice => sprintf("%.2f", $data->{'unitprice'}||0), + gst_values => \@gst_values, + gstrate => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0, + gstreg => $bookseller->{'gstreg'}, + listprice => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice), + total => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ), + ecost => sprintf( "%.2f", $data->{ecost} || 0), + unitprice => sprintf( "%.2f", $data->{unitprice} || 0), notes => $data->{'notes'}, publishercode => $data->{'publishercode'}, barcode_subfield => $barcode_subfield, - import_batch_id => $import_batch_id, - -# CHECKME: gst-stuff needs verifing, mason. - gstrate => $bookseller->{'gstrate'} // C4::Context->preference("gist") // 0, - gstreg => $bookseller->{'gstreg'}, (uc(C4::Context->preference("marcflavour"))) => 1 ); diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index a0b933bebf..17c2d5ea73 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -93,7 +93,6 @@ my $search = $input->param('receive'); $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new(); my $bookseller = GetBookSellerFromId($booksellerid); -my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; my $results = SearchOrder($ordernumber,$search); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -158,16 +157,40 @@ if ( $count == 1 ) { $template->param(items => \@items); } - if ( $order->{'unitprice'} == 0 ) { - $order->{'unitprice'} = ''; - } + $order->{quantityreceived} = '' if $order->{quantityreceived} == 0; + $order->{unitprice} = '' if $order->{unitprice} == 0; - my $suggestion = GetSuggestionInfoFromBiblionumber($order->{'biblionumber'}); + my $rrp; + my $ecost; + my $unitprice; + if ( $bookseller->{listincgst} ) { + if ( $bookseller->{invoiceincgst} ) { + $rrp = $order->{rrp}; + $ecost = $order->{ecost}; + $unitprice = $order->{unitprice}; + } else { + $rrp = $order->{rrp} / ( 1 + $order->{gstrate} ); + $ecost = $order->{ecost} / ( 1 + $order->{gstrate} ); + $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} ); + } + } else { + if ( $bookseller->{invoiceincgst} ) { + $rrp = $order->{rrp} * ( 1 + $order->{gstrate} ); + $ecost = $order->{ecost} * ( 1 + $order->{gstrate} ); + $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} ); + } else { + $rrp = $order->{rrp}; + $ecost = $order->{ecost}; + $unitprice = $order->{unitprice}; + } + } - my $authorisedby = $order->{'authorisedby'}; + my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber}); + + my $authorisedby = $order->{authorisedby}; my $member = GetMember( borrowernumber => $authorisedby ); - my $budget = GetBudget( $order->{'budget_id'} ); + my $budget = GetBudget( $order->{budget_id} ); $template->param( AcqCreateItem => $AcqCreateItem, @@ -177,7 +200,7 @@ if ( $count == 1 ) { biblioitemnumber => $order->{'biblioitemnumber'}, booksellerid => $order->{'booksellerid'}, freight => $freight, - gst => $gst, + gstrate => $order->{gstrate} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0, name => $bookseller->{'name'}, date => format_date($order->{entrydate}), title => $order->{'title'}, @@ -189,9 +212,9 @@ if ( $count == 1 ) { quantity => $order->{'quantity'}, quantityreceivedplus1 => $order->{'quantityreceived'} + 1, quantityreceived => $order->{'quantityreceived'}, - rrp => $order->{'rrp'}, - ecost => sprintf( "%.2f",$order->{'ecost'}), - unitprice => sprintf( "%.2f",$order->{'unitprice'}), + rrp => sprintf( "%.2f", $rrp ), + ecost => sprintf( "%.2f", $ecost ), + unitprice => sprintf( "%.2f", $unitprice), memberfirstname => $member->{firstname} || "", membersurname => $member->{surname} || "", invoiceid => $invoice->{invoiceid}, @@ -212,10 +235,10 @@ else { $line{invoice} = $invoice->{invoicenumber}; $line{datereceived} = $datereceived->output(); $line{freight} = $freight; - $line{gst} = $gst; + $line{gstrate} = @$results[$i]->{'gstrate'} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0; $line{title} = @$results[$i]->{'title'}; $line{author} = @$results[$i]->{'author'}; - $line{booksellerid} = $booksellerid; + $line{booksellerid} = $booksellerid; push @loop, \%line; } diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 7f50f0b69d..0e0f41bce3 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -71,6 +71,43 @@ use JSON; my $input=new CGI; +sub get_value_with_gst_params { + my $value = shift; + my $gstrate = shift; + my $bookseller = shift; + if ( $bookseller->{listincgst} ) { + if ( $bookseller->{invoiceincgst} ) { + return $value; + } else { + return $value / ( 1 + $gstrate ); + } + } else { + if ( $bookseller->{invoiceincgst} ) { + return $value * ( 1 + $gstrate ); + } else { + return $value; + } + } +} + +sub get_gste { + my $value = shift; + my $gstrate = shift; + my $bookseller = shift; + return $bookseller->{invoiceincgst} + ? $value / ( 1 + $gstrate ) + : $value; +} + +sub get_gst { + my $value = shift; + my $gstrate = shift; + my $bookseller = shift; + return $bookseller->{invoiceincgst} + ? $value / ( 1 + $gstrate ) * $gstrate + : $value * ( 1 + $gstrate ) - $value; +} + my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "acqui/parcel.tmpl", query => $input, @@ -125,21 +162,33 @@ my $countlines = scalar @parcelitems; my $totalprice = 0; my $totalquantity = 0; my $total; -my $tototal; my @loop_received = (); +my @book_foot_loop; +my %foot; +my $total_quantity = 0; +my $total_gste = 0; +my $total_gsti = 0; -for (my $i = 0 ; $i < $countlines ; $i++) { - - $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'}; - $parcelitems[$i]->{'unitprice'} += 0; +for my $item ( @parcelitems ) { + $item->{unitprice} = get_value_with_gst_params( $item->{unitprice}, $item->{gstrate}, $bookseller ); + $total = ( $item->{'unitprice'} ) * $item->{'quantityreceived'}; + $item->{'unitprice'} += 0; my %line; - %line = %{ $parcelitems[$i] }; + %line = %{ $item }; + my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller ); + $line{ecost} = sprintf( "%.2f", $ecost ); $line{invoice} = $invoice->{invoicenumber}; - $line{gst} = $gst; $line{total} = sprintf($cfstr, $total); $line{booksellerid} = $invoice->{booksellerid}; - $totalprice += $parcelitems[$i]->{'unitprice'}; - $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'}); + $totalprice += $item->{'unitprice'}; + $line{unitprice} = sprintf( $cfstr, $item->{'unitprice'} ); + my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller ); + my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller ); + $foot{$line{gstrate}}{gstrate} = $line{gstrate}; + $foot{$line{gstrate}}{value} += sprintf( "%.2f", $gst ); + $total_quantity += $line{quantity}; + $total_gste += $gste; + $total_gsti += $gste + $gst; my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); $line{suggestionid} = $suggestion->{suggestionid}; @@ -154,11 +203,16 @@ for (my $i = 0 ; $i < $countlines ; $i++) { } } - push @loop_received, \%line; - $totalquantity += $parcelitems[$i]->{'quantityreceived'}; - $tototal += $total; -} + my $budget = GetBudget( $line{budget_id} ); + $line{budget_name} = $budget->{'budget_name'}; + push @loop_received, \%line; + $totalquantity += $item->{'quantityreceived'}; + +} +push @book_foot_loop, map { $_ } values %foot; + +my @loop_orders = (); if(!defined $invoice->{closedate}) { my $pendingorders; if($input->param('op') eq "search"){ @@ -174,29 +228,22 @@ if(!defined $invoice->{closedate}) { } my $countpendings = scalar @$pendingorders; - # pending orders totals - my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd); - my $ordergrandtotal; - my @loop_orders = (); for (my $i = 0 ; $i < $countpendings ; $i++) { my %line; %line = %{$pendingorders->[$i]}; - $line{quantity}+=0; - $line{quantityreceived}+=0; + my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller ); + $line{unitprice} = get_value_with_gst_params( $line{unitprice}, $line{gstrate}, $bookseller ); + $line{quantity} += 0; + $line{quantityreceived} += 0; $line{unitprice}+=0; - $totalPunitprice += $line{unitprice}; - $totalPquantity +=$line{quantity}; - $totalPqtyrcvd +=$line{quantityreceived}; - $totalPecost += $line{ecost}; - $line{ecost} = sprintf("%.2f",$line{ecost}); - $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity}); + $line{ecost} = sprintf( "%.2f", $ecost ); + $line{ordertotal} = sprintf( "%.2f", $ecost * $line{quantity} ); $line{unitprice} = sprintf("%.2f",$line{unitprice}); $line{invoice} = $invoice; - $line{gst} = $gst; - $line{total} = $total; $line{booksellerid} = $booksellerid; - $ordergrandtotal += $line{ecost} * $line{quantity}; + + my $biblionumber = $line{'biblionumber'}; my $countbiblio = CountBiblioInOrders($biblionumber); @@ -231,6 +278,8 @@ if(!defined $invoice->{closedate}) { $line{holds} = $holds; $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order}; + my $budget = GetBudget( $line{budget_id} ); + $line{budget_name} = $budget->{'budget_name'}; push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage); } @@ -269,17 +318,10 @@ if(!defined $invoice->{closedate}) { } $template->param( - countpending => $countpendings, loop_orders => \@loop_orders, - ordergrandtotal => sprintf($cfstr, $ordergrandtotal), - totalPunitprice => sprintf("%.2f", $totalPunitprice), - totalPquantity => $totalPquantity, - totalPqtyrcvd => $totalPqtyrcvd, - totalPecost => sprintf("%.2f", $totalPecost), ); } - $template->param( invoiceid => $invoice->{invoiceid}, invoice => $invoice->{invoicenumber}, @@ -289,15 +331,17 @@ $template->param( formatteddatereceived => $datereceived->output(), name => $bookseller->{'name'}, booksellerid => $bookseller->{id}, - gst => $gst, countreceived => $countlines, loop_received => \@loop_received, + booksellerid => $booksellerid, + loop_orders => \@loop_orders, + book_foot_loop => \@book_foot_loop, totalprice => sprintf($cfstr, $totalprice), totalquantity => $totalquantity, - tototal => sprintf($cfstr, $tototal), - gst => $gst, - grandtot => sprintf($cfstr, $tototal + $gst), resultsperpage => $resultsperpage, - (uc(C4::Context->preference("marcflavour"))) => 1 + (uc(C4::Context->preference("marcflavour"))) => 1, + total_quantity => $total_quantity, + total_gste => sprintf( "%.2f", $total_gste ), + total_gsti => sprintf( "%.2f", $total_gsti ), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 0387d35bb7..d113de2044 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -67,12 +67,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( debug => 1, } ); -my $seller_gstrate = $supplier->{'gstrate'}; -# ensure the scalar isn't flagged as a string -$seller_gstrate = ( defined $seller_gstrate ) ? $seller_gstrate + 0 : undef; -my $tax_rate = $seller_gstrate // C4::Context->preference('gist') // 0; -$tax_rate *= 100; #build array for currencies if ( $op eq 'display' ) { @@ -102,12 +97,11 @@ if ( $op eq 'display' ) { gstreg => $supplier->{'gstreg'}, listincgst => $supplier->{'listincgst'}, invoiceincgst => $supplier->{'invoiceincgst'}, + gstrate => $supplier->{'gstrate'} + 0.0, discount => $supplier->{'discount'}, deliverytime => $supplier->{deliverytime}, invoiceprice => $supplier->{'invoiceprice'}, listprice => $supplier->{'listprice'}, - GST => $tax_rate, - default_tax => defined($seller_gstrate), basketcount => $supplier->{'basketcount'}, subscriptioncount => $supplier->{'subscriptioncount'}, contracts => $contracts, @@ -142,9 +136,11 @@ if ( $op eq 'display' ) { }; } - my $default_gst_rate = (C4::Context->preference('gist') * 100) || '0.0'; + # get option values from gist syspref + my @gst_values = map { + option => $_ + }, split( '\|', C4::Context->preference("gist") ); - my $gstrate = defined $supplier->{gstrate} ? $supplier->{gstrate} * 100 : ''; $template->param( booksellerid => $booksellerid, name => $supplier->{'name'}, @@ -170,13 +166,12 @@ if ( $op eq 'display' ) { gstreg => $supplier->{'gstreg'}, listincgst => $supplier->{'listincgst'}, invoiceincgst => $supplier->{'invoiceincgst'}, - gstrate => $gstrate, + gstrate => $supplier->{gstrate} ? $supplier->{'gstrate'}+0.0 : 0, + gst_values => \@gst_values, discount => $supplier->{'discount'}, deliverytime => $supplier->{deliverytime}, loop_currency => $loop_currency, - GST => $tax_rate, enter => 1, - default_gst_rate => $default_gst_rate, ); } diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 3dc69641a5..7b3bf9d6d8 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -100,13 +100,8 @@ $data{'gstreg'}=$input->param('gst'); $data{'listincgst'}=$input->param('list_gst'); $data{'invoiceincgst'}=$input->param('invoice_gst'); #have to transform this into fraction so it's easier to use -my $gstrate = $input->param('gstrate'); -if ($gstrate eq '') { - $data{'gstrate'} = undef; -} else { - $data{'gstrate'} = $input->param('gstrate')/100; -} -$data{'discount'}=$input->param('discount'); +$data{'gstrate'} = $input->param('gstrate'); +$data{'discount'} = $input->param('discount'); $data{deliverytime} = $input->param('deliverytime'); $data{'active'}=$input->param('status'); if($data{'name'}) { diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 53bc692325..4f7058776a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2786,7 +2786,8 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order line was last modified `rrp` decimal(13,2) default NULL, -- the replacement cost for this line item `ecost` decimal(13,2) default NULL, -- the estimated cost for this line item - `gst` decimal(13,2) default NULL, -- the tax rate for this line item + `gstrate` decimal(6,4) default NULL, -- the tax rate for this line item + `discount` float(6,4) default NULL, -- the discount for this line item `budget_id` int(11) NOT NULL, -- the fund this order goes against (aqbudgets.budget_id) `budgetgroup_id` int(11) NOT NULL, -- not used? always zero `budgetdate` date default NULL, -- not used? always NULL diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 949d56be67..6cc4601757 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5617,7 +5617,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do("UPDATE systempreferences SET options = concat(options,'|EAN13'), explanation = concat(explanation,'; EAN13 - incremental') WHERE variable = 'autoBarcode' AND options NOT LIKE '%EAN13%'"); print "Upgrade to $DBversion done ( Added EAN13 barcode autogeneration sequence )\n"; - SetVersion($DBversion); } @@ -5953,6 +5952,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("ALTER TABLE aqorders CHANGE COLUMN gst gstrate DECIMAL(6,4) DEFAULT NULL"); + print "Upgrade to $DBversion done (Change column name in aqorders gst --> gstrate)\n"; + SetVersion($DBversion); +} + +$DBversion = "3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("ALTER TABLE aqorders ADD discount float(6,4) DEFAULT NULL AFTER gstrate"); + print "Upgrade to $DBversion done (Add discount field in aqorders table)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js index 028dae437d..d67b05b9ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js @@ -639,49 +639,25 @@ function messenger(X,Y,etc){ // FIXME: unused? // NEXT BLOCK IS USED BY NEWORDERBEMPTY -function calcNeworderTotal(){ - //collect values - var f = document.getElementById('Aform'); - var quantity = new Number(f.quantity.value); - var discount = new Number(f.discount.value); - var listinc = new Number (f.listinc.value); - //var currency = f.currency.value; - var applygst = new Number (f.applygst.value); - var listprice = new Number(f.listprice.value); - var invoiceingst = new Number (f.invoiceincgst.value); -// var exchangerate = new Number(f.elements[currency].value); //get exchange rate - var currcode = new String(document.getElementById('currency').value); - var exchangerate = new Number(document.getElementById(currcode).value); +function updateCosts(){ + var quantity = new Number($("#quantity").val()); + var discount = new Number($("#discount").val()); + var applygst = new Number ($("#applygst").val()); + var listprice = new Number($("#listprice").val()); + var exchangerate = new Number($("#currency_rate").val()); + var gst_on=false; - var gst_on=(!listinc && invoiceingst); - - //do real stuff var rrp = new Number(listprice*exchangerate); var ecost = rrp; - if (100-discount != 100) { //Prevent rounding issues if no discount - ecost = new Number(Math.floor(rrp * (100 - discount ))/100); - } - var GST = new Number(0); - if (gst_on) { - rrp=rrp * (1+f.gstrate.value / 100); - GST=ecost * f.gstrate.value / 100; + if ( 100-discount != 100 ) { //Prevent rounding issues if no discount + ecost = new Number(Math.floor(rrp * (100 - discount )) / 100); } + var total = new Number( ecost * quantity); + $("#rrp").val(rrp.toFixed(2)); + $("#ecost").val(ecost.toFixed(2)); + $("#total").val(total.toFixed(2)); + $("listprice").val(listprice.toFixed(2)); - var total = new Number( (ecost + GST) * quantity); - - f.rrp.value = rrp.toFixed(2); - -// f.rrp.value = rrp -// f.rrp.value = 'moo' - - f.ecost.value = ecost.toFixed(2); - f.total.value = total.toFixed(2); - f.listprice.value = listprice.toFixed(2); - -// gst-stuff needs verifing, mason. - if (f.GST) { - f.GST.value=GST; - } return true; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index 71ae462622..98161b2331 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -163,7 +163,7 @@ [% ELSE %]