Lines 14-21
Link Here
|
14 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
14 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
15 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
15 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
16 |
|
16 |
|
17 |
use strict; |
17 |
use Modern::Perl; |
18 |
use warnings; |
|
|
19 |
use C4::Auth; |
18 |
use C4::Auth; |
20 |
use CGI; |
19 |
use CGI; |
21 |
use C4::Context; |
20 |
use C4::Context; |
Lines 23-29
use C4::Reports;
Link Here
|
23 |
use C4::Output; |
22 |
use C4::Output; |
24 |
use C4::Koha; |
23 |
use C4::Koha; |
25 |
use C4::Circulation; |
24 |
use C4::Circulation; |
26 |
use C4::Dates qw/format_date format_date_in_iso/; |
25 |
use DateTime; |
|
|
26 |
use Koha::DateUtils qw/output_pref dt_from_string/; |
27 |
use C4::Budgets qw/GetCurrency GetCurrencies/; |
27 |
use C4::Budgets qw/GetCurrency GetCurrencies/; |
28 |
#use Data::Dumper; |
28 |
#use Data::Dumper; |
29 |
#use Smart::Comments; |
29 |
#use Smart::Comments; |
Lines 46-63
my $output = $input->param("output");
Link Here
|
46 |
my $basename = $input->param("basename"); |
46 |
my $basename = $input->param("basename"); |
47 |
my $transaction_type = $input->param("transaction_type") || 'ACT'; |
47 |
my $transaction_type = $input->param("transaction_type") || 'ACT'; |
48 |
my $branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; |
48 |
my $branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; |
49 |
our $sep = ","; |
49 |
our $sep = $input->param("sep") // ','; |
|
|
50 |
$sep = "\t" if ($sep eq 'tabulation'); |
50 |
|
51 |
|
51 |
$template->param( |
52 |
$template->param( |
52 |
do_it => $do_it, |
53 |
do_it => $do_it, |
53 |
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), |
54 |
#DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), |
|
|
55 |
CGIsepChoice => GetDelimiterChoices, |
54 |
); |
56 |
); |
55 |
|
57 |
|
56 |
#Initialize date pickers to today |
58 |
#Initialize date pickers to today |
57 |
my $today = C4::Dates->today('iso'); |
59 |
my $now = DateTime->today; |
58 |
my $fromDate = $today; |
60 |
my $today = $now->strftime('%d/%m/%Y'); |
59 |
my $toDate = $today; |
61 |
my $fromDate = dt_from_string($today, 'metric'); |
60 |
|
62 |
my $toDate = dt_from_string($today, 'metric'); |
61 |
### fromdate today: $fromDate |
63 |
### fromdate today: $fromDate |
62 |
|
64 |
|
63 |
my $query_manualinv = "SELECT id, authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'"; |
65 |
my $query_manualinv = "SELECT id, authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'"; |
Lines 69-76
my $manualinv_types = $sth_manualinv->fetchall_arrayref({});
Link Here
|
69 |
|
71 |
|
70 |
if ($do_it) { |
72 |
if ($do_it) { |
71 |
|
73 |
|
72 |
$fromDate = format_date_in_iso($input->param("filter_date_begin")); |
74 |
$fromDate = dt_from_string($input->param("filter_date_begin"), 'metric'); |
73 |
$toDate = format_date_in_iso($input->param("filter_date_end")); |
75 |
$toDate = dt_from_string($input->param("filter_date_end"), 'metric'); |
74 |
|
76 |
|
75 |
my $whereTType = ''; |
77 |
my $whereTType = ''; |
76 |
|
78 |
|
Lines 119-125
if ($do_it) {
Link Here
|
119 |
$row->{amountoutstanding} = 0 if (!$row->{amountoutstanding}); |
121 |
$row->{amountoutstanding} = 0 if (!$row->{amountoutstanding}); |
120 |
#if ((abs($row->{amount}) - $row->{amountoutstanding}) > 0) { |
122 |
#if ((abs($row->{amount}) - $row->{amountoutstanding}) > 0) { |
121 |
$row->{amount} = sprintf("%.2f", abs ($row->{amount})); |
123 |
$row->{amount} = sprintf("%.2f", abs ($row->{amount})); |
122 |
$row->{date} = format_date($row->{date}); |
124 |
$row->{date} = output_pref({ dt => dt_from_string($row->{date}, 'sql'), date_format => 'metric', dateonly => 1 }); |
123 |
### date : $row->{date} |
125 |
### date : $row->{date} |
124 |
|
126 |
|
125 |
push (@loopresult, $row); |
127 |
push (@loopresult, $row); |
Lines 178-189
if ($do_it) {
Link Here
|
178 |
### fromdate final: $fromDate |
180 |
### fromdate final: $fromDate |
179 |
### toDate final: $toDate |
181 |
### toDate final: $toDate |
180 |
$template->param( |
182 |
$template->param( |
181 |
beginDate => format_date($fromDate), |
183 |
beginDate => output_pref({dt => $fromDate, date_format => 'metric', dateonly => 1}), |
182 |
endDate => format_date($toDate), |
184 |
endDate => output_pref({dt => $toDate, date_format => 'metric', dateonly => 1}), |
183 |
transaction_type => $transaction_type, |
185 |
transaction_type => $transaction_type, |
184 |
branchloop => C4::Branch::GetBranchesLoop($branchcode), |
186 |
branchloop => C4::Branch::GetBranchesLoop($branchcode), |
185 |
manualinv_types => $manualinv_types, |
187 |
manualinv_types => $manualinv_types, |
|
|
188 |
CGIsepChoice => GetDelimiterChoices, |
186 |
); |
189 |
); |
|
|
190 |
|
187 |
output_html_with_http_headers $input, $cookie, $template->output; |
191 |
output_html_with_http_headers $input, $cookie, $template->output; |
188 |
|
192 |
|
189 |
1; |
193 |
1; |
190 |
- |
|
|