From 966acc02f08506527353831ec17be86b75edfd53 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 6 Jan 2012 16:53:00 +0100 Subject: [PATCH 2/2] Bug 5339: Invoices management improvement - New pages: - invoices.pl: allow to search in invoices on several criteria - invoice.pl: permit to view and modify invoice details - shipment date - billing date - shipment cost and budget used for shipment cost Invoice informations are now stored in their own sql table and aqorders have a link to it --- C4/Acquisition.pm | 354 +++++++++++++++++++- C4/Budgets.pm | 24 ++- acqui/finishreceive.pl | 12 +- acqui/invoice.pl | 211 ++++++++++++ acqui/invoices.pl | 150 +++++++++ acqui/orderreceive.pl | 32 +- acqui/parcel.pl | 251 +++++++-------- acqui/parcels.pl | 48 ++- .../prog/en/includes/acquisitions-menu.inc | 1 + .../intranet-tmpl/prog/en/modules/acqui/invoice.tt | 174 ++++++++++ .../prog/en/modules/acqui/invoices.tt | 219 ++++++++++++ .../prog/en/modules/acqui/orderreceive.tt | 7 +- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 208 ++++++------ .../intranet-tmpl/prog/en/modules/acqui/parcels.tt | 48 ++-- 14 files changed, 1441 insertions(+), 298 deletions(-) create mode 100755 acqui/invoice.pl create mode 100755 acqui/invoices.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 0a96a02..1fdd701 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -61,6 +61,14 @@ BEGIN { &GetParcels &GetParcel &GetContracts &GetContract + &GetInvoices + &GetInvoice + &GetInvoiceDetails + &AddInvoice + &ModInvoice + &CloseInvoice + &ReopenInvoice + &GetItemnumbersFromOrder &AddClaim @@ -1103,7 +1111,7 @@ C<$ordernumber>. sub ModReceiveOrder { my ( $biblionumber, $ordernumber, $quantrec, $user, $cost, - $invoiceno, $freight, $rrp, $budget_id, $datereceived + $invoiceid, $rrp, $budget_id, $datereceived ) = @_; my $dbh = C4::Context->dbh; @@ -1129,14 +1137,13 @@ sub ModReceiveOrder { UPDATE aqorders SET quantityreceived=? , datereceived=? - , booksellerinvoicenumber=? + , invoiceid=? , unitprice=? - , freight=? , rrp=? , quantity=? WHERE biblionumber=? AND ordernumber=?"); - $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$quantrec,$biblionumber,$ordernumber); + $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$quantrec,$biblionumber,$ordernumber); $sth->finish; # create a new order for the remaining items, and set its bookfund. @@ -1148,10 +1155,10 @@ sub ModReceiveOrder { my $newOrder = NewOrder($order); } else { $sth=$dbh->prepare("update aqorders - set quantityreceived=?,datereceived=?,booksellerinvoicenumber=?, - unitprice=?,freight=?,rrp=? + set quantityreceived=?,datereceived=?,invoiceid=?, + unitprice=?,rrp=? where biblionumber=? and ordernumber=?"); - $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$biblionumber,$ordernumber); + $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$biblionumber,$ordernumber); $sth->finish; } return $datereceived; @@ -1801,7 +1808,340 @@ sub AddClaim { "; my $sth = $dbh->prepare($query); $sth->execute($ordernumber); +} + +=head3 GetInvoices + + my @invoices = GetInvoices( + invoicenumber => $invoicenumber, + suppliername => $suppliername, + shipmentdatefrom => $shipmentdatefrom, # ISO format + shipmentdateto => $shipmentdateto, # ISO format + billingdatefrom => $billingdatefrom, # ISO format + billingdateto => $billingdateto, # ISO format + isbneanissn => $isbn_or_ean_or_issn, + title => $title, + author => $author, + publisher => $publisher, + publicationyear => $publicationyear, + branchcode => $branchcode, + order_by => $order_by + ); + +Return a list of invoices that match all given criteria. + +$order_by is "column_name (asc|desc)", where column_name is any of +'invoicenumber', 'booksellerid', 'shipmentdate', 'billingdate', 'closedate', +'shipmentcost', 'shipmentcost_budgetid'. + +asc is the default if omitted + +=cut + +sub GetInvoices { + my %args = @_; + + my @columns = qw(invoicenumber booksellerid shipmentdate billingdate + closedate shipmentcost shipmentcost_budgetid); + + my $dbh = C4::Context->dbh; + my $query = qq{ + SELECT invoices.*, aqbooksellers.name AS suppliername, + COUNT( + DISTINCT IF( + aqorders.datereceived IS NOT NULL, + aqorders.biblionumber, + NULL + ) + ) AS receivedbiblios, + SUM(aqorders.quantityreceived) AS receiveditems + FROM invoices + LEFT JOIN aqbooksellers ON aqbooksellers.id = invoices.booksellerid + LEFT JOIN aqorders ON aqorders.invoiceid = invoices.invoiceid + LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber + LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber + LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber + }; + + my @bind_args; + my @bind_strs; + if($args{invoicenumber}) { + push @bind_strs, " invoices.invoicenumber LIKE ? "; + push @bind_args, "%$args{invoicenumber}%"; + } + if($args{suppliername}) { + push @bind_strs, " aqbooksellers.name LIKE ? "; + push @bind_args, "%$args{suppliername}%"; + } + if($args{shipmentdatefrom}) { + push @bind_strs, " invoices.shipementdate >= ? "; + push @bind_args, $args{shipementdatefrom}; + } + if($args{shipmentdateto}) { + push @bind_strs, " invoices.shipementdate <= ? "; + push @bind_args, $args{shipementdateto}; + } + if($args{billingdatefrom}) { + push @bind_strs, " invoices.billingdate >= ? "; + push @bind_args, $args{billingdatefrom}; + } + if($args{billingdateto}) { + push @bind_strs, " invoices.billingdate <= ? "; + push @bind_args, $args{billingdateto}; + } + if($args{isbneanissn}) { + push @bind_strs, " (biblioitems.isbn LIKE ? OR biblioitems.ean LIKE ? OR biblioitems.issn LIKE ? ) "; + push @bind_args, $args{isbneanissn}, $args{isbneanissn}, $args{isbneanissn}; + } + if($args{title}) { + push @bind_strs, " biblio.title LIKE ? "; + push @bind_args, $args{title}; + } + if($args{author}) { + push @bind_strs, " biblio.author LIKE ? "; + push @bind_args, $args{author}; + } + if($args{publisher}) { + push @bind_strs, " biblioitems.publishercode LIKE ? "; + push @bind_args, $args{publisher}; + } + if($args{publicationyear}) { + push @bind_strs, " biblioitems.publicationyear = ? "; + push @bind_args, $args{publicationyear}; + } + if($args{branchcode}) { + push @bind_strs, " aqorders.branchcode = ? "; + push @bind_args, $args{branchcode}; + } + + $query .= " WHERE " . join(" AND ", @bind_strs) if @bind_strs; + $query .= " GROUP BY invoices.invoiceid "; + + if($args{order_by}) { + my ($column, $direction) = split / /, $args{order_by}; + if(grep /^$column$/, @columns) { + $direction ||= 'ASC'; + $query .= " ORDER BY $column $direction"; + } + } + + my $sth = $dbh->prepare($query); + $sth->execute(@bind_args); + + my $results = $sth->fetchall_arrayref({}); + return @$results; +} + +=head3 GetInvoice + + my $invoice = GetInvoice($invoiceid); + +Get informations about invoice with given $invoiceid + +Return a hash filled with invoices.* fields + +=cut + +sub GetInvoice { + my ($invoiceid) = @_; + my $invoice; + + return unless $invoiceid; + + my $dbh = C4::Context->dbh; + my $query = qq{ + SELECT * + FROM invoices + WHERE invoiceid = ? + }; + my $sth = $dbh->prepare($query); + $sth->execute($invoiceid); + + $invoice = $sth->fetchrow_hashref; + return $invoice; +} + +=head3 GetInvoiceDetails + + my $invoice = GetInvoiceDetails($invoiceid) + +Return informations about an invoice + the list of related order lines + +Orders informations are in $invoice->{orders} (array ref) + +=cut + +sub GetInvoiceDetails { + my ($invoiceid) = @_; + my $invoice; + + return unless $invoiceid; + + my $dbh = C4::Context->dbh; + my $query = qq{ + SELECT invoices.*, aqbooksellers.name AS suppliername + FROM invoices + LEFT JOIN aqbooksellers ON invoices.booksellerid = aqbooksellers.id + WHERE invoiceid = ? + }; + my $sth = $dbh->prepare($query); + $sth->execute($invoiceid); + + $invoice = $sth->fetchrow_hashref; + $query = qq{ + SELECT aqorders.*, biblio.* + FROM aqorders + LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber + WHERE invoiceid = ? + }; + $sth = $dbh->prepare($query); + $sth->execute($invoiceid); + $invoice->{orders} = $sth->fetchall_arrayref({}); + + return $invoice; +} + +=head3 AddInvoice + + my $invoiceid = AddInvoice( + invoicenumber => $invoicenumber, + booksellerid => $booksellerid, + shipmentdate => $shipmentdate, + billingdate => $billingdate, + closedate => $closedate, + shipmentcost => $shipmentcost, + shipmentcost_budgetid => $shipmentcost_budgetid + ); + +Create a new invoice and return its id or undef if it fails. + +=cut + +sub AddInvoice { + my %invoice = @_; + + return unless(%invoice and $invoice{invoicenumber}); + + my @columns = qw(invoicenumber booksellerid shipmentdate billingdate + closedate shipmentcost shipmentcost_budgetid); + + my @set_strs; + my @set_args; + foreach my $key (keys %invoice) { + if(0 < grep(/^$key$/, @columns)) { + push @set_strs, "$key = ?"; + push @set_args, ($invoice{$key} || undef); + } + } + + my $rv; + if(@set_args > 0) { + my $dbh = C4::Context->dbh; + my $query = "INSERT INTO invoices SET "; + $query .= join (",", @set_strs); + my $sth = $dbh->prepare($query); + $rv = $sth->execute(@set_args); + if($rv) { + $rv = $dbh->last_insert_id(undef, undef, 'invoices', undef); + } + } + return $rv; +} + +=head3 ModInvoice + + ModInvoice( + invoiceid => $invoiceid, # Mandatory + invoicenumber => $invoicenumber, + booksellerid => $booksellerid, + shipmentdate => $shipmentdate, + billingdate => $billingdate, + closedate => $closedate, + shipmentcost => $shipmentcost, + shipmentcost_budgetid => $shipmentcost_budgetid + ); + +Modify an invoice, invoiceid is mandatory. + +Return undef if it fails. + +=cut + +sub ModInvoice { + my %invoice = @_; + + return unless(%invoice and $invoice{invoiceid}); + + my @columns = qw(invoicenumber booksellerid shipmentdate billingdate + closedate shipmentcost shipmentcost_budgetid); + + my @set_strs; + my @set_args; + foreach my $key (keys %invoice) { + if(0 < grep(/^$key$/, @columns)) { + push @set_strs, "$key = ?"; + push @set_args, ($invoice{$key} || undef); + } + } + + my $dbh = C4::Context->dbh; + my $query = "UPDATE invoices SET "; + $query .= join(",", @set_strs); + $query .= " WHERE invoiceid = ?"; + + my $sth = $dbh->prepare($query); + $sth->execute(@set_args, $invoice{invoiceid}); +} + +=head3 CloseInvoice + + CloseInvoice($invoiceid); + +Close an invoice. + +Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => undef); + +=cut + +sub CloseInvoice { + my ($invoiceid) = @_; + + return unless $invoiceid; + + my $dbh = C4::Context->dbh; + my $query = qq{ + UPDATE invoices + SET closedate = CAST(NOW() AS DATE) + WHERE invoiceid = ? + }; + my $sth = $dbh->prepare($query); + $sth->execute($invoiceid); +} + +=head3 ReopenInvoice + + ReopenInvoice($invoiceid); + +Reopen an invoice + +Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => C4::Dates->new()->output('iso')) + +=cut + +sub ReopenInvoice { + my ($invoiceid) = @_; + + return unless $invoiceid; + + my $dbh = C4::Context->dbh; + my $query = qq{ + UPDATE invoices + SET closedate = NULL + WHERE invoiceid = ? + }; + my $sth = $dbh->prepare($query); + $sth->execute($invoiceid); } 1; diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 7c867e0..1748341 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -309,9 +309,19 @@ sub GetBudgetSpent { quantityreceived > 0 AND datecancellationprinted IS NULL |); - $sth->execute($budget_id); my $sum = $sth->fetchrow_array; + + $sth = $dbh->prepare(qq| + SELECT SUM(shipmentcost) AS sum + FROM invoices + WHERE shipmentcost_budgetid = ? + AND closedate IS NOT NULL + |); + $sth->execute($budget_id); + my ($shipmentcost_sum) = $sth->fetchrow_array; + $sum += $shipmentcost_sum; + return $sum; } @@ -325,9 +335,19 @@ sub GetBudgetOrdered { quantityreceived = 0 AND datecancellationprinted IS NULL |); - $sth->execute($budget_id); my $sum = $sth->fetchrow_array; + + $sth = $dbh->prepare(qq| + SELECT SUM(shipmentcost) AS sum + FROM invoices + WHERE shipmentcost_budgetid = ? + AND closedate IS NULL + |); + $sth->execute($budget_id); + my ($shipmentcost_sum) = $sth->fetchrow_array; + $sum += $shipmentcost_sum; + return $sum; } diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 0f2f070..f83b7d0 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -43,14 +43,14 @@ my $origquantityrec=$input->param('origquantityrec'); my $quantityrec=$input->param('quantityrec'); my $quantity=$input->param('quantity'); my $unitprice=$input->param('cost'); -my $invoiceno=$input->param('invoice'); -my $datereceived=$input->param('datereceived'); +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 $freight=$input->param('freight'); my $supplierid = $input->param('supplierid'); my $cnt=0; -my $error_url_str; my $ecost = $input->param('ecost'); my $note = $input->param("note"); @@ -94,12 +94,12 @@ if ($quantityrec > $origquantityrec ) { } # save the quantity received. - $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived); + $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoice->{invoiceid},$replacement,undef,$datereceived); } update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber ); -print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str"); +print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); ################################ End of script ################################ diff --git a/acqui/invoice.pl b/acqui/invoice.pl new file mode 100755 index 0000000..074f8d8 --- /dev/null +++ b/acqui/invoice.pl @@ -0,0 +1,211 @@ +#!/usr/bin/perl + +# Copyright 2011 BibLibre SARL +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +invoice.pl + +=head1 DESCRIPTION + +Invoice details + +=cut + +use strict; +use warnings; + +use CGI; +use C4::Auth; +use C4::Output; +use C4::Acquisition; +use C4::Bookseller qw/GetBookSellerFromId/; +use C4::Budgets; + +my $input = new CGI; +my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { + template_name => 'acqui/invoice.tmpl', + query => $input, + type => 'intranet', + authnotrequired => 0, + flagsrequired => { 'acquisition' => '*' }, + debug => 1, +} ); + +my $invoiceid = $input->param('invoiceid'); +my $op = $input->param('op'); + +if($op && $op eq 'close') { + CloseInvoice($invoiceid); + my $referer = $input->param('referer'); + if($referer) { + print $input->redirect($referer); + exit 0; + } +}elsif($op && $op eq 'reopen') { + ReopenInvoice($invoiceid); + my $referer = $input->param('referer'); + if($referer) { + print $input->redirect($referer); + exit 0; + } +}elsif($op && $op eq 'mod') { + my $shipmentdate = $input->param('shipmentdate'); + my $billingdate = $input->param('billingdate'); + my $shipmentcost = $input->param('shipmentcost'); + my $shipment_budget_id = $input->param('shipment_budget_id'); + ModInvoice( + invoiceid => $invoiceid, + shipmentdate => C4::Dates->new($shipmentdate)->output("iso"), + billingdate => C4::Dates->new($billingdate)->output("iso"), + shipmentcost => $shipmentcost, + shipmentcost_budgetid => $shipment_budget_id + ); + $template->param(modified => 1); +} + +my $details = GetInvoiceDetails($invoiceid); +my $bookseller = GetBookSellerFromId($details->{booksellerid}); +my @orders_loop = (); +my $orders = $details->{'orders'}; +my $qty_total; +my @books_loop; +my @book_foot_loop; +my %foot; +my $total_quantity = 0; +my $total_rrp = 0; +my $total_est = 0; +foreach my $order (@$orders) { + my $line = get_infos( $order, $bookseller); + + $total_quantity += $$line{quantity}; + $total_rrp += $order->{quantity} * $order->{rrp}; + $total_est += $order->{quantity} * $order->{'ecost'}; + + my %row = (%$order, %$line); + push @orders_loop, \%row; +} + +my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; +my $discount = $bookseller->{'discount'} ? ($bookseller->{discount} / 100) : 0; +my $total_est_gste; +my $total_est_gsti; +my $total_rrp_gsti; # RRP Total, GST included +my $total_rrp_gste; # RRP Total, GST excluded +my $gist_est; +my $gist_rrp; +if ($gist){ + # if we have GST + if ( $bookseller->{'listincgst'} ) { + # if prices already includes GST + + # we know $total_rrp_gsti + $total_rrp_gsti = $total_rrp; + # and can reverse compute other values + $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 ); + + $gist_rrp = $total_rrp_gsti - $total_rrp_gste; + $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount ); + $total_est_gsti = $total_est; + } else { + # if prices does not include GST + + # then we use the common way to compute other values + $total_rrp_gste = $total_rrp; + $gist_rrp = $total_rrp_gste * $gist; + $total_rrp_gsti = $total_rrp_gste + $gist_rrp; + $total_est_gste = $total_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_est; +} +my $total_gsti_shipment = $total_est_gsti + $details->{shipmentcost}; + +my $format = "%.2f"; +$template->param( + total_rrp_gste => sprintf($format, $total_rrp_gste), + total_rrp_gsti => sprintf($format, $total_rrp_gsti), + total_est_gste => sprintf($format, $total_est_gste), + total_est_gsti => sprintf($format, $total_est_gsti), + gist_rrp => sprintf($format, $gist_rrp), + gist_est => sprintf($format, $gist_est), + total_gsti_shipment => sprintf($format, $total_gsti_shipment), + gist => sprintf($format, $gist * 100), +); + +my $budgets = GetBudgets(); +my @budgets_loop; +my $shipmentcost_budgetid = $details->{shipmentcost_budgetid}; +foreach (@$budgets) { + my %line = %{ $_ }; + if($shipmentcost_budgetid and $_->{'budget_id'} == $shipmentcost_budgetid) { + $line{'selected'} = 1; + } + push @budgets_loop, \%line; +} + +$template->param( + invoiceid => $details->{'invoiceid'}, + invoicenumber => $details->{'invoicenumber'}, + suppliername => $details->{'suppliername'}, + supplierid => $details->{'booksellerid'}, + datereceived => $details->{'datereceived'}, + shipmentdate => $details->{'shipmentdate'}, + billingdate => $details->{'billingdate'}, + invoiceclosedate => $details->{'closedate'}, + shipmentcost => sprintf($format, $details->{'shipmentcost'}), + orders_loop => \@orders_loop, + total_quantity => $total_quantity, + invoiceincgst => $bookseller->{invoiceincgst}, + currency => $bookseller->{listprice}, + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), + budgets_loop => \@budgets_loop, +); + +sub get_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{budget_name} = $budget->{budget_name}; + $line{total} = $qty * $order->{ecost}; + + if ( $line{uncertainprice} ) { + $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."; + } + + return \%line; +} + +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/invoices.pl b/acqui/invoices.pl new file mode 100755 index 0000000..3ca0f01 --- /dev/null +++ b/acqui/invoices.pl @@ -0,0 +1,150 @@ +#!/usr/bin/perl + +# Copyright 2011 BibLibre SARL +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 NAME + +invoices.pl + +=head1 DESCRIPTION + +Search for invoices + +=cut + +use strict; +use warnings; + +use CGI; +use C4::Auth; +use C4::Output; + +use C4::Acquisition; +use C4::Bookseller qw/GetBookSeller/; +use C4::Branch; + +my $input = new CGI; +my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { + template_name => 'acqui/invoices.tmpl', + query => $input, + type => 'intranet', + authnotrequired => 0, + flagsrequired => { 'acquisition' => '*' }, + debug => 1, +} ); + +my $invoicenumber = $input->param('invoicenumber'); +my $supplier = $input->param('supplier'); +my $billingdatefrom = $input->param('billingdatefrom'); +my $billingdateto = $input->param('billingdateto'); +my $isbneanissn = $input->param('isbneanissn'); +my $title = $input->param('title'); +my $author = $input->param('author'); +my $publisher = $input->param('publisher'); +my $publicationyear = $input->param('publicationyear'); +my $branch = $input->param('branch'); +my $op = $input->param('op'); + +my @results_loop = (); +if($op and $op eq "do_search") { + my $billingdatefrom_iso = C4::Dates->new($billingdatefrom)->output("iso"); + my $billingdateto_iso = C4::Dates->new($billingdateto)->output("iso"); + my @invoices = GetInvoices( + invoicenumber => $invoicenumber, + suppliername => $supplier, + billingdatefrom => $billingdatefrom_iso, + billingdateto => $billingdateto_iso, + isbneanissn => $isbneanissn, + title => $title, + author => $author, + publisher => $publisher, + publicationyear => $publicationyear, + branchcode => $branch + ); + foreach (@invoices) { + my %row = ( + invoiceid => $_->{invoiceid}, + billingdate => $_->{billingdate}, + invoicenumber => $_->{invoicenumber}, + suppliername => $_->{suppliername}, + receivedbiblios => $_->{receivedbiblios}, + receiveditems => $_->{receiveditems}, + subscriptionid => $_->{subscriptionid}, + closedate => $_->{closedate}, + ); + push @results_loop, \%row; + } +} + + +# Build suppliers list +my @suppliers = GetBookSeller(undef); +my @suppliers_loop = (); +my $suppliername; +foreach (@suppliers) { + my $selected = 0; + if ($supplier && $supplier == $_->{'id'}) { + $selected = 1; + $suppliername = $_->{'name'}; + } + my %row = ( + suppliername => $_->{'name'}, + supplierid => $_->{'id'}, + selected => $selected, + ); + push @suppliers_loop, \%row; +} + +# Build branches list +my $branches = GetBranches(); +my @branches_loop = (); +my $branchname; +foreach (sort keys %$branches) { + my $selected = 0; + if ($branch && $branch eq $_) { + $selected = 1; + $branchname = $branches->{$_}->{'branchname'}; + } + my %row = ( + branchcode => $_, + branchname => $branches->{$_}->{'branchname'}, + selected => $selected, + ); + push @branches_loop, \%row; +} + +$template->param( + do_search => ($op and $op eq "do_search") ? 1 : 0, + results_loop => \@results_loop, + invoicenumber => $invoicenumber, + supplier => $supplier, + suppliername => $suppliername, + billingdatefrom => $billingdatefrom, + billingdateto => $billingdateto, + isbneanissn => $isbneanissn, + title => $title, + author => $author, + publisher => $publisher, + publicationyear => $publicationyear, + branch => $branch, + branchname => $branchname, + suppliers_loop => \@suppliers_loop, + branches_loop => \@branches_loop, + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), +); + +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 753071d..77e2149 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -40,9 +40,9 @@ to know on what supplier this script has to display receive order. =item receive -=item invoice +=item invoiceid -the number of this invoice. +the id of this invoice. =item freight @@ -61,7 +61,8 @@ The biblionumber of this order. =cut use strict; -#use warnings; FIXME - Bug 2505 +use warnings; + use CGI; use C4::Context; use C4::Koha; # GetKohaAuthorisedValues GetItemTypes @@ -80,26 +81,23 @@ use C4::Biblio; my $input = new CGI; my $dbh = C4::Context->dbh; -my $supplierid = $input->param('supplierid'); -my $ordernumber = $input->param('ordernumber'); +my $invoiceid = $input->param('invoiceid'); +my $invoice = GetInvoice($invoiceid); +my $supplierid = $invoice->{booksellerid}; +my $freight = $invoice->{shipmentcost}; +my $datereceived = $invoice->{shipmentdate}; +my $ordernumber = $input->param('ordernumber'); my $search = $input->param('receive'); -my $invoice = $input->param('invoice'); -my $freight = $input->param('freight'); -my $datereceived = $input->param('datereceived'); - $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new(); my $bookseller = GetBookSellerFromId($supplierid); -my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); -my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; +my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; my $results = SearchOrder($ordernumber,$search); - my $count = scalar @$results; my $order = GetOrder($ordernumber); - my $date = @$results[0]->{'entrydate'}; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -164,7 +162,8 @@ if ( $count == 1 ) { unitprice => @$results[0]->{'unitprice'}, memberfirstname => $member->{firstname} || "", membersurname => $member->{surname} || "", - invoice => $invoice, + invoiceid => $invoice->{invoiceid}, + invoice => $invoice->{invoicenumber}, datereceived => $datereceived->output(), datereceived_iso => $datereceived->output('iso'), notes => $order->{notes} @@ -175,7 +174,7 @@ else { for ( my $i = 0 ; $i < $count ; $i++ ) { my %line = %{ @$results[$i] }; - $line{invoice} = $invoice; + $line{invoice} = $invoice->{invoicenumber}; $line{datereceived} = $datereceived->output(); $line{freight} = $freight; $line{gst} = $gst; @@ -188,10 +187,11 @@ else { $template->param( loop => \@loop, supplierid => $supplierid, + invoiceid => $invoice->{invoiceid}, ); } my $op = $input->param('op'); -if ($op eq 'edit'){ +if ($op and $op eq 'edit'){ $template->param(edit => 1); } output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/parcel.pl b/acqui/parcel.pl index c256c60..a7c792b 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -42,8 +42,6 @@ To know the supplier this script has to show orders. is the bookseller invoice number. -=item freight - =item gst @@ -57,7 +55,8 @@ To filter the results list on this given date. =cut use strict; -#use warnings; FIXME - Bug 2505 +use warnings; + use C4::Auth; use C4::Acquisition; use C4::Budgets; @@ -70,16 +69,13 @@ use C4::Dates qw/format_date format_date_in_iso/; use JSON; my $input=new CGI; -my $supplierid=$input->param('supplierid'); -my $bookseller=GetBookSellerFromId($supplierid); - -my $invoice=$input->param('invoice') || ''; -my $freight=$input->param('freight'); -my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst')); -my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0; -my $datereceived = ($input->param('op') eq 'new') ? C4::Dates->new($input->param('datereceived')) - : C4::Dates->new($input->param('datereceived'), 'iso') ; -$datereceived = C4::Dates->new() unless $datereceived; + +my $invoiceid = $input->param('invoiceid'); +my $invoice = GetInvoiceDetails($invoiceid); +my $supplierid = $invoice->{booksellerid}; +my $bookseller = GetBookSellerFromId($supplierid); +my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0; +my $datereceived = C4::Dates->new(); my $code = $input->param('code'); my @rcv_err = $input->param('error'); my @rcv_err_barcode = $input->param('error_bc'); @@ -89,16 +85,17 @@ my $resultsperpage = $input->param('resultsperpage'); $resultsperpage = 20 unless ($resultsperpage); $startfrom=0 unless ($startfrom); -if($input->param('format') eq "json"){ +my $format = $input->param('format') || ''; +if($format eq "json"){ my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "acqui/ajax.tmpl", query => $input, - type => "intranet", + type => "intranet", authnotrequired => 0, flagsrequired => {acquisition => 'order_receive'}, debug => 1, }); - + my @datas; my $search = $input->param('search') || ''; my $supplier = $input->param('supplierid') || ''; @@ -109,7 +106,7 @@ if($input->param('format') eq "json"){ foreach my $order (@$orders){ if($order->{quantityreceived} < $order->{quantity}){ my $data = {}; - + $data->{basketno} = $order->{basketno}; $data->{ordernumber} = $order->{ordernumber}; $data->{title} = $order->{title}; @@ -117,14 +114,13 @@ if($input->param('format') eq "json"){ $data->{isbn} = $order->{isbn}; $data->{booksellerid} = $order->{booksellerid}; $data->{biblionumber} = $order->{biblionumber}; - $data->{freight} = $order->{freight}; $data->{quantity} = $order->{quantity}; $data->{ecost} = $order->{ecost}; $data->{ordertotal} = sprintf("%.2f",$order->{ecost}*$order->{quantity}); push @datas, $data; } } - + my $json_text = to_json(\@datas); $template->param(return => $json_text); output_html_with_http_headers $input, $cookie, $template->output; @@ -134,7 +130,7 @@ if($input->param('format') eq "json"){ my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "acqui/parcel.tmpl", query => $input, - type => "intranet", + type => "intranet", authnotrequired => 0, flagsrequired => {acquisition => 'order_receive'}, debug => 1, @@ -154,10 +150,9 @@ if( scalar(@rcv_err) ) { } my $cfstr = "%.2f"; # currency format string -- could get this from currency table. -my @parcelitems = GetParcel($supplierid, $invoice, $datereceived->output('iso')); +my @parcelitems = @{ $invoice->{orders} }; my $countlines = scalar @parcelitems; my $totalprice = 0; -my $totalfreight = 0; my $totalquantity = 0; my $total; my $tototal; @@ -165,152 +160,144 @@ my @loop_received = (); for (my $i = 0 ; $i < $countlines ; $i++) { - #$total=($parcelitems[$i]->{'unitprice'} + $parcelitems[$i]->{'freight'}) * $parcelitems[$i]->{'quantityreceived'}; #weird, are the freight fees counted by book? (pierre) - $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'}; #weird, are the freight fees counted by book? (pierre) + $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'}; $parcelitems[$i]->{'unitprice'} += 0; my %line; %line = %{ $parcelitems[$i] }; - $line{invoice} = $invoice; + $line{invoice} = $invoice->{invoicenumber}; $line{gst} = $gst; $line{total} = sprintf($cfstr, $total); - $line{supplierid} = $supplierid; + $line{supplierid} = $invoice->{booksellerid}; push @loop_received, \%line; $totalprice += $parcelitems[$i]->{'unitprice'}; $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'}); - #double FIXME - totalfreight is redefined later. - -# 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.. - if ($i > 0 && $totalfreight != $parcelitems[$i]->{'freight'}) { - warn "FREIGHT CHARGE MISMATCH!!"; - } - $totalfreight = $parcelitems[$i]->{'freight'}; $totalquantity += $parcelitems[$i]->{'quantityreceived'}; $tototal += $total; } -my $pendingorders = GetPendingOrders($supplierid); -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; - $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{unitprice} = sprintf("%.2f",$line{unitprice}); - $line{invoice} = $invoice; - $line{gst} = $gst; - $line{total} = $total; - $line{supplierid} = $supplierid; - $ordergrandtotal += $line{ecost} * $line{quantity}; - - my $biblionumber = $line{'biblionumber'}; - my $countbiblio = CountBiblioInOrders($biblionumber); - my $ordernumber = $line{'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(!defined $invoice->{closedate}) { + my $pendingorders = GetPendingOrders($supplierid); + 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; + $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{unitprice} = sprintf("%.2f",$line{unitprice}); + $line{invoice} = $invoice; + $line{gst} = $gst; + $line{total} = $total; + $line{supplierid} = $supplierid; + $ordergrandtotal += $line{ecost} * $line{quantity}; + + my $biblionumber = $line{'biblionumber'}; + my $countbiblio = CountBiblioInOrders($biblionumber); + my $ordernumber = $line{'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; + $line{left_holds} = ($holds >= 1) ? 1 : 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}; + + + push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage); } - - # 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; - $line{left_holds} = 1 if $holds >= 1; - $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}; - - - push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage); -} -$freight = $totalfreight unless $freight; -my $count = $countpendings; + my $count = $countpendings; -if ($count>$resultsperpage){ - my $displaynext=0; - my $displayprev=$startfrom; - if(($count - ($startfrom+$resultsperpage)) > 0 ) { - $displaynext = 1; - } + if ($count>$resultsperpage){ + my $displaynext=0; + my $displayprev=$startfrom; + if(($count - ($startfrom+$resultsperpage)) > 0 ) { + $displaynext = 1; + } - my @numbers = (); - for (my $i=1; $i<$count/$resultsperpage+1; $i++) { - my $highlight=0; - ($startfrom/$resultsperpage==($i-1)) && ($highlight=1); - push @numbers, { number => $i, - highlight => $highlight , - startfrom => ($i-1)*$resultsperpage}; - } + my @numbers = (); + for (my $i=1; $i<$count/$resultsperpage+1; $i++) { + my $highlight=0; + ($startfrom/$resultsperpage==($i-1)) && ($highlight=1); + push @numbers, { number => $i, + highlight => $highlight , + startfrom => ($i-1)*$resultsperpage}; + } - my $from = $startfrom*$resultsperpage+1; - my $to; - if($count < (($startfrom+1)*$resultsperpage)){ - $to = $count; - } else { - $to = (($startfrom+1)*$resultsperpage); + my $from = $startfrom*$resultsperpage+1; + my $to; + if($count < (($startfrom+1)*$resultsperpage)){ + $to = $count; + } else { + $to = (($startfrom+1)*$resultsperpage); + } + $template->param(numbers=>\@numbers, + displaynext=>$displaynext, + displayprev=>$displayprev, + nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count), + prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0) + ); } - $template->param(numbers=>\@numbers, - displaynext=>$displaynext, - displayprev=>$displayprev, - nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count), - prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0) - ); + + $template->param( + countpending => $countpendings, + loop_orders => \@loop_orders, + ordergrandtotal => sprintf($cfstr, $ordergrandtotal), + totalPunitprice => sprintf("%.2f", $totalPunitprice), + totalPquantity => $totalPquantity, + totalPqtyrcvd => $totalPqtyrcvd, + totalPecost => sprintf("%.2f", $totalPecost), + ); } -#$totalfreight=$freight; -$tototal = $tototal + $freight; $template->param( - invoice => $invoice, + invoiceid => $invoice->{invoiceid}, + invoice => $invoice->{invoicenumber}, + invoiceclosedate => $invoice->{closedate}, datereceived => $datereceived->output('iso'), invoicedatereceived => $datereceived->output('iso'), formatteddatereceived => $datereceived->output(), name => $bookseller->{'name'}, - supplierid => $supplierid, + supplierid => $bookseller->{id}, gst => $gst, - freight => $freight, - invoice => $invoice, countreceived => $countlines, loop_received => \@loop_received, - countpending => $countpendings, - loop_orders => \@loop_orders, totalprice => sprintf($cfstr, $totalprice), - totalfreight => $totalfreight, totalquantity => $totalquantity, tototal => sprintf($cfstr, $tototal), - ordergrandtotal => sprintf($cfstr, $ordergrandtotal), gst => $gst, grandtot => sprintf($cfstr, $tototal + $gst), - totalPunitprice => sprintf("%.2f", $totalPunitprice), - totalPquantity => $totalPquantity, - totalPqtyrcvd => $totalPqtyrcvd, - totalPecost => sprintf("%.2f", $totalPecost), resultsperpage => $resultsperpage, ); output_html_with_http_headers $input, $cookie, $template->output; - diff --git a/acqui/parcels.pl b/acqui/parcels.pl index 915b1e8..b8aa69d 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -84,6 +84,7 @@ my $code = $input->param('filter'); my $datefrom = $input->param('datefrom'); my $dateto = $input->param('dateto'); my $resultsperpage = $input->param('resultsperpage'); +my $op = $input->param('op'); $resultsperpage ||= 20; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -96,8 +97,34 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +if($op and $op eq 'new') { + my $invoicenumber = $input->param('invoice'); + my $shipmentdate = $input->param('shipmentdate'); + if($shipmentdate) { + $shipmentdate = C4::Dates->new($shipmentdate)->output('iso'); + } + my $invoiceid = AddInvoice( + invoicenumber => $invoicenumber, + booksellerid => $supplierid, + shipmentdate => $shipmentdate, + ); + if(defined $invoiceid) { + # Successful 'Add' + print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid"); + exit 0; + } else { + $template->param(error_failed_to_create_invoice => 1); + } +} + my $bookseller = GetBookSellerFromId($supplierid); -my @parcels = GetParcels( $supplierid, $order, $code, $datefrom, $dateto ); +my @parcels = GetInvoices( + supplierid => $supplierid, + invoicenumber => $code, + shipmentdatefrom => $datefrom, + shipmentdateto => $dateto, + order_by => $order +); my $count_parcels = @parcels; # multi page display gestion @@ -114,14 +141,15 @@ for my $i ( $startfrom .. $last_row) { push @{$loopres}, { number => $i + 1, - code => $p->{booksellerinvoicenumber}, - nullcode => $p->{booksellerinvoicenumber} eq 'NULL', - emptycode => $p->{booksellerinvoicenumber} eq q{}, - raw_datereceived => $p->{datereceived}, - datereceived => format_date( $p->{datereceived} ), - bibcount => $p->{biblio}, - reccount => $p->{itemsreceived}, - itemcount => $p->{itemsexpected}, + invoiceid => $p->{invoiceid}, + code => $p->{invoicenumber}, + nullcode => $p->{invoicenumber} eq 'NULL', + emptycode => $p->{invoicenumber} eq q{}, + raw_datereceived => $p->{shipmentdate}, + datereceived => format_date( $p->{shipmentdate} ), + bibcount => $p->{receivedbiblios} || 0, + reccount => $p->{receiveditems} || 0, + itemcount => $p->{itemsexpected} || 0, }; } if ($count_parcels) { @@ -135,7 +163,7 @@ $template->param( resultsperpage => $resultsperpage, name => $bookseller->{'name'}, DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), - datereceived_today => C4::Dates->new()->output(), + shipmentdate_today => C4::Dates->new()->output(), supplierid => $supplierid, GST => C4::Context->preference('gist'), ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc index a0f094c..b67cec2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc @@ -1,6 +1,7 @@