@@ -, +, @@
---
acqui/lateorders-excel.pl | 65 ----------
acqui/lateorders-export.pl | 65 ++++++++++
acqui/lateorders.pl | 5 +-
.../prog/en/modules/acqui/lateorders.tt | 15 ++-
.../prog/en/modules/serials/claims.tt | 4 +-
serials/lateissues-excel.pl | 130 --------------------
serials/lateissues-export.pl | 130 ++++++++++++++++++++
7 files changed, 209 insertions(+), 205 deletions(-)
delete mode 100755 acqui/lateorders-excel.pl
create mode 100755 acqui/lateorders-export.pl
delete mode 100755 serials/lateissues-excel.pl
create mode 100755 serials/lateissues-export.pl
--- a/acqui/lateorders-excel.pl
+++ a/acqui/lateorders-excel.pl
@@ -1,65 +0,0 @@
-#!/usr/bin/perl
-
-# 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.
-
-use Modern::Perl;
-use CGI;
-use C4::Auth;
-use C4::Serials;
-use C4::Acquisition;
-use C4::Output;
-use C4::Context;
-
-use Text::CSV::Encoded;
-use open qw/ :std :utf8 /;
-
-my $csv = Text::CSV::Encoded->new ({
- encoding => undef,
- quote_char => '"',
- escape_char => '"',
- sep_char => ',',
- binary => 1,
- });
-
-my $query = new CGI;
-my @ordernumbers = $query->param('ordernumber');
-
-print $query->header(
- -type => 'text/csv',
- -attachment => "lateorders.csv",
-);
-
-print "LATE ORDERS\n\n";
-print "ORDER DATE,ESTIMATED DELIVERY DATE,VENDOR,INFORMATION,TOTAL COST,BASKET,CLAIMS COUNT,CLAIMED DATE\n";
-
-for my $ordernumber ( @ordernumbers ) {
- my $order = GetOrder $ordernumber;
- $csv->combine(
- "(" . $$order{supplierid} . ") " . $$order{orderdate} . " (" . $$order{latesince} . " days)",
- $$order{estimateddeliverydate},
- $$order{supplier},
- $$order{title} . ( $$order{author} ? " Author: $$order{author}" : "" ) . ( $$order{publisher} ? " Published by: $$order{publisher}" : "" ),
- $$order{unitpricesupplier} . "x" . $$order{quantity} . " = " . $$order{subtotal} . " (" . $$order{budget} . ")",
- $$order{basketname} . " (" . $$order{basketno} . ")",
- $$order{claims_count},
- $$order{claimed_date}
- );
- my $string = $csv->string;
- print $string, "\n";
-}
-
-print ",,Total Number Late, " . scalar @ordernumbers . "\n";
-
--- a/acqui/lateorders-export.pl
+++ a/acqui/lateorders-export.pl
@@ -0,0 +1,65 @@
+#!/usr/bin/perl
+
+# 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.
+
+use Modern::Perl;
+use CGI;
+use C4::Auth;
+use C4::Serials;
+use C4::Acquisition;
+use C4::Output;
+use C4::Context;
+
+use Text::CSV::Encoded;
+use open qw/ :std :utf8 /;
+
+my $csv = Text::CSV::Encoded->new ({
+ encoding => undef,
+ quote_char => '"',
+ escape_char => '"',
+ sep_char => ',',
+ binary => 1,
+ });
+
+my $query = new CGI;
+my @ordernumbers = $query->param('ordernumber');
+
+print $query->header(
+ -type => 'text/csv',
+ -attachment => "lateorders.csv",
+);
+
+print "LATE ORDERS\n\n";
+print "ORDER DATE,ESTIMATED DELIVERY DATE,VENDOR,INFORMATION,TOTAL COST,BASKET,CLAIMS COUNT,CLAIMED DATE\n";
+
+for my $ordernumber ( @ordernumbers ) {
+ my $order = GetOrder $ordernumber;
+ $csv->combine(
+ "(" . $$order{supplierid} . ") " . $$order{orderdate} . " (" . $$order{latesince} . " days)",
+ $$order{estimateddeliverydate},
+ $$order{supplier},
+ $$order{title} . ( $$order{author} ? " Author: $$order{author}" : "" ) . ( $$order{publisher} ? " Published by: $$order{publisher}" : "" ),
+ $$order{unitpricesupplier} . "x" . $$order{quantity} . " = " . $$order{subtotal} . " (" . $$order{budget} . ")",
+ $$order{basketname} . " (" . $$order{basketno} . ")",
+ $$order{claims_count},
+ $$order{claimed_date}
+ );
+ my $string = $csv->string;
+ print $string, "\n";
+}
+
+print ",,Total Number Late, " . scalar @ordernumbers . "\n";
+
--- a/acqui/lateorders.pl
+++ a/acqui/lateorders.pl
@@ -81,8 +81,11 @@ if ($op and $op eq "send_alert"){
my $err;
eval {
$err = SendAlerts( 'claimacquisition', \@ordernums, $input->param("letter_code") ); # FIXME: Fallback value?
- AddClaim ( $_ ) for @ordernums;
+ if ( not $err ) {
+ AddClaim ( $_ ) for @ordernums
+ }
};
+
if ( $@ ) {
$template->param(error_claim => $@);
} elsif ( defined $err->{error} and $err->{error} eq "no_email" ) {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
@@ -14,8 +14,6 @@ $(document).ready(function() {
}
});
- $("span.exportSelected").html(" "+_("Export selected items data") +"<\/a>");
-
$('#CheckAll').click(function(){ $("#late_orders td").checkCheckboxes();});
$('#CheckNone').click(function(){ $("#late_orders td").unCheckCheckboxes();});
@@ -29,7 +27,7 @@ $(document).ready(function() {
}
// Building the url from currently checked boxes
- var url = '/cgi-bin/koha/acqui/lateorders-excel.pl?op=export';
+ var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
for (var i = 0; i < selected.length; i++) {
url += '&ordernumber=' + selected[i].value;
}
@@ -146,10 +144,13 @@ $(document).ready(function() {
-
- [% UNLESS lateorder.budget_lock %]
-
- [% END %]
+
+
+
+ [% UNLESS lateorder.budget_lock %]
+
+ [% END %]
+ There are no late orders.