Lines 103-112
if ($do_it) {
Link Here
|
103 |
} |
103 |
} |
104 |
|
104 |
|
105 |
my $query = " |
105 |
my $query = " |
106 |
SELECT round(amount,2) AS amount, description, |
106 |
SELECT round(amount,2) AS amount, al.description, |
107 |
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, |
107 |
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, |
108 |
bo.cardnumber, br.branchname, bo.borrowernumber, |
108 |
bo.cardnumber, br.branchname, bo.borrowernumber, |
109 |
al.borrowernumber, DATE(al.date) as date, al.credit_type_code, al.debit_type_code, al.amountoutstanding, al.note, |
109 |
al.borrowernumber, DATE(al.date) as date, al.credit_type_code, al.debit_type_code, COALESCE(act.description,al.credit_type_code,adt.description,al.debit_type_code) AS type_description, al.amountoutstanding, al.note, |
110 |
bi.title, bi.biblionumber, i.barcode, i.itype |
110 |
bi.title, bi.biblionumber, i.barcode, i.itype |
111 |
FROM accountlines al |
111 |
FROM accountlines al |
112 |
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) |
112 |
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) |
Lines 114-119
if ($do_it) {
Link Here
|
114 |
LEFT JOIN branches br ON (br.branchcode = m.branchcode ) |
114 |
LEFT JOIN branches br ON (br.branchcode = m.branchcode ) |
115 |
LEFT JOIN items i ON (i.itemnumber = al.itemnumber) |
115 |
LEFT JOIN items i ON (i.itemnumber = al.itemnumber) |
116 |
LEFT JOIN biblio bi ON (bi.biblionumber = i.biblionumber) |
116 |
LEFT JOIN biblio bi ON (bi.biblionumber = i.biblionumber) |
|
|
117 |
LEFT JOIN account_credit_types act ON (al.credit_type_code = act.code) |
118 |
LEFT JOIN account_debit_types adt ON (al.debit_type_code = adt.code) |
117 |
WHERE CAST(al.date AS DATE) BETWEEN ? AND ? |
119 |
WHERE CAST(al.date AS DATE) BETWEEN ? AND ? |
118 |
$whereTType |
120 |
$whereTType |
119 |
$whereBranchCode |
121 |
$whereBranchCode |
Lines 166-172
if ($do_it) {
Link Here
|
166 |
$row->{bfirstname} . ' ' . $row->{bsurname}, |
168 |
$row->{bfirstname} . ' ' . $row->{bsurname}, |
167 |
$row->{branchname}, |
169 |
$row->{branchname}, |
168 |
$row->{date}, |
170 |
$row->{date}, |
169 |
$row->{credit_type_code} || $row->{debit_type_code}, |
171 |
$row->{type_description}, |
170 |
$row->{note}, |
172 |
$row->{note}, |
171 |
$row->{amount}, |
173 |
$row->{amount}, |
172 |
$row->{title}, |
174 |
$row->{title}, |
Lines 175-181
if ($do_it) {
Link Here
|
175 |
push (@rows, \@rowValues) ; |
177 |
push (@rows, \@rowValues) ; |
176 |
} |
178 |
} |
177 |
my @total; |
179 |
my @total; |
178 |
for (1..7){push(@total,"")}; |
180 |
for (1..6){push(@total,"")}; |
179 |
push(@total, $grantotal); |
181 |
push(@total, $grantotal); |
180 |
print $input->header( |
182 |
print $input->header( |
181 |
-type => 'text/csv', |
183 |
-type => 'text/csv', |
182 |
- |
|
|