<option value="C">Credit</option>
[% END %]
+ [% IF transaction_type == "CR" %]
+ <option value="CR" selected="selected">Credit (item returned)</option>
+ [% ELSE %]
+ <option value="CR">Credit (item returned)</option>
+ [% END %]
+
[% IF transaction_type == "FORW" %]
<option value="FORW" selected="selected">Write off</option>
[% ELSE %]
</select>
</li>
<li>
- <label>Library</label>
+ <label>Transaction branch</label>
<select name="branch" id="branch">
<option value="ALL">All</option>
[% FOREACH branchloo IN branchloop %]
<th>Manager name</th>
<th>Patron cardnumber</th>
<th>Patron name</th>
- <th>Library</th>
+ <th>Transaction branch</th>
<th>Transaction date</th>
<th>Transaction type</th>
+ <th>Notes</th>
<th>Amount</th>
<th>Biblio title</th>
<th>Barcode</th>
[% END %]
[% END %]
</td>
+ <td>[% loopresul.note %]</td>
<td style="text-align:right;">[% loopresul.amount %]</td>
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber %]">[% loopresul.title %]</a></td>
<td>[% loopresul.barcode %]</td>
[% END %]
<tfoot>
<tr>
- <th colspan="6" style="text-align:right;">TOTAL</th>
+ [% IF transaction_type == "ACT" %]
+ <th colspan="7" style="text-align:right;">TOTAL</th>
<th style="text-align:right;">[% total %]</th>
<th colspan="3"> </th>
+ [% END %]
</tr>
</tfoot>
</table>
my $output = $input->param("output");
my $basename = $input->param("basename");
my $transaction_type = $input->param("transaction_type") || 'ACT';
-my $branchcode = $input->param("branch") || C4::Context->userenv->{'branch'};
+my $manager_branchcode = $input->param("branch") || C4::Context->userenv->{'branch'};
our $sep = $input->param("sep") // ',';
$sep = "\t" if ($sep eq 'tabulation');
}
my $whereBranchCode = '';
- if ($branchcode ne 'ALL') {
- $whereBranchCode = "AND bo.branchcode = '$branchcode'";
+ if ($manager_branchcode ne 'ALL') {
+ $whereBranchCode = "AND m.branchcode = '$manager_branchcode'";
}
### $transaction_type;
SELECT round(amount,2) AS amount, description,
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname,
bo.cardnumber, br.branchname, bo.borrowernumber,
- al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding,
+ al.borrowernumber, DATE(al.date) as date, al.accounttype, al.amountoutstanding, al.note,
bi.title, bi.biblionumber, i.barcode, i.itype
FROM accountlines al
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber)
### date : $row->{date}
push (@loopresult, $row);
- $grantotal += abs($row->{amount});
+ if($transaction_type eq 'ACT' && ($row->{accounttype} !~ /^C$|^CR$|^LR$|^Pay$/)){
+ pop @loopresult;
+ next;
+ }
+ if($row->{accounttype} =~ /^C$|^CR$|^LR$/){
+ $grantotal -= abs($row->{amount});
+ $row->{amount} = '-' . $row->{amount};
+ }elsif($row->{accounttype} eq 'FORW' || $row->{accounttype} eq 'W'){
+ }else{
+ $grantotal += abs($row->{amount});
+ }
#}
}
beginDate => dt_from_string($fromDate),
endDate => dt_from_string($toDate),
transaction_type => $transaction_type,
- branchloop => C4::Branch::GetBranchesLoop($branchcode),
+ branchloop => C4::Branch::GetBranchesLoop($manager_branchcode),
manualinv_types => $manualinv_types,
CGIsepChoice => GetDelimiterChoices,
);