|
Lines 45-51
my $do_it = $input->param('do_it');
Link Here
|
| 45 |
my $output = $input->param("output"); |
45 |
my $output = $input->param("output"); |
| 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 $manager_branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; |
| 49 |
our $sep = $input->param("sep") // ','; |
49 |
our $sep = $input->param("sep") // ','; |
| 50 |
$sep = "\t" if ($sep eq 'tabulation'); |
50 |
$sep = "\t" if ($sep eq 'tabulation'); |
| 51 |
|
51 |
|
|
Lines 88-95
if ($do_it) {
Link Here
|
| 88 |
} |
88 |
} |
| 89 |
|
89 |
|
| 90 |
my $whereBranchCode = ''; |
90 |
my $whereBranchCode = ''; |
| 91 |
if ($branchcode ne 'ALL') { |
91 |
if ($manager_branchcode ne 'ALL') { |
| 92 |
$whereBranchCode = "AND bo.branchcode = '$branchcode'"; |
92 |
$whereBranchCode = "AND m.branchcode = '$manager_branchcode'"; |
| 93 |
} |
93 |
} |
| 94 |
|
94 |
|
| 95 |
### $transaction_type; |
95 |
### $transaction_type; |
|
Lines 98-104
if ($do_it) {
Link Here
|
| 98 |
SELECT round(amount,2) AS amount, description, |
98 |
SELECT round(amount,2) AS amount, description, |
| 99 |
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, |
99 |
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, |
| 100 |
bo.cardnumber, br.branchname, bo.borrowernumber, |
100 |
bo.cardnumber, br.branchname, bo.borrowernumber, |
| 101 |
al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding, |
101 |
al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding, al.note, |
| 102 |
bi.title, bi.biblionumber, i.barcode, i.itype |
102 |
bi.title, bi.biblionumber, i.barcode, i.itype |
| 103 |
FROM accountlines al |
103 |
FROM accountlines al |
| 104 |
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) |
104 |
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) |
|
Lines 124-130
if ($do_it) {
Link Here
|
| 124 |
### date : $row->{date} |
124 |
### date : $row->{date} |
| 125 |
|
125 |
|
| 126 |
push (@loopresult, $row); |
126 |
push (@loopresult, $row); |
| 127 |
$grantotal += abs($row->{amount}); |
127 |
if($transaction_type eq 'ACT' && ($row->{accounttype} !~ /^C$|^CR$|^LR$|^Pay$/)){ |
|
|
128 |
pop @loopresult; |
| 129 |
next; |
| 130 |
} |
| 131 |
if($row->{accounttype} =~ /^C$|^CR$|^LR$/){ |
| 132 |
$grantotal -= abs($row->{amount}); |
| 133 |
$row->{amount} = '-' . $row->{amount}; |
| 134 |
}elsif($row->{accounttype} eq 'FORW' || $row->{accounttype} eq 'W'){ |
| 135 |
}else{ |
| 136 |
$grantotal += abs($row->{amount}); |
| 137 |
} |
| 128 |
#} |
138 |
#} |
| 129 |
} |
139 |
} |
| 130 |
|
140 |
|
|
Lines 182-188
$template->param(
Link Here
|
| 182 |
beginDate => dt_from_string($fromDate), |
192 |
beginDate => dt_from_string($fromDate), |
| 183 |
endDate => dt_from_string($toDate), |
193 |
endDate => dt_from_string($toDate), |
| 184 |
transaction_type => $transaction_type, |
194 |
transaction_type => $transaction_type, |
| 185 |
branchloop => C4::Branch::GetBranchesLoop($branchcode), |
195 |
branchloop => C4::Branch::GetBranchesLoop($manager_branchcode), |
| 186 |
manualinv_types => $manualinv_types, |
196 |
manualinv_types => $manualinv_types, |
| 187 |
CGIsepChoice => GetDelimiterChoices, |
197 |
CGIsepChoice => GetDelimiterChoices, |
| 188 |
); |
198 |
); |
| 189 |
- |
|
|