|
Lines 63-111
if ( $data->{'category_type'} eq 'C') {
Link Here
|
| 63 |
} |
63 |
} |
| 64 |
|
64 |
|
| 65 |
#get account details |
65 |
#get account details |
| 66 |
my ($total,$accts,$numaccts)=GetMemberAccountRecords($borrowernumber); |
66 |
my ($total,$accts,undef)=GetMemberAccountRecords($borrowernumber); |
| 67 |
my $totalcredit; |
67 |
my $totalcredit; |
| 68 |
if($total <= 0){ |
68 |
if($total <= 0){ |
| 69 |
$totalcredit = 1; |
69 |
$totalcredit = 1; |
| 70 |
} |
70 |
} |
| 71 |
my @accountrows; # this is for the tmpl-loop |
71 |
|
| 72 |
|
72 |
my $reverse_col = 0; # Flag whether we need to show the reverse column |
| 73 |
my $toggle; |
73 |
foreach my $accountline ( @{$accts}) { |
| 74 |
for (my $i=0;$i<$numaccts;$i++){ |
74 |
$accountline->{amount} += 0.00; |
| 75 |
if($i%2){ |
75 |
if ($accountline->{amount} <= 0 ) { |
| 76 |
$toggle = 0; |
76 |
$accountline->{amountcredit} = 1; |
| 77 |
} else { |
|
|
| 78 |
$toggle = 1; |
| 79 |
} |
77 |
} |
| 80 |
$accts->[$i]{'toggle'} = $toggle; |
78 |
$accountline->{amountoutstanding} += 0.00; |
| 81 |
$accts->[$i]{'amount'}+=0.00; |
79 |
if ( $accountline->{amountoutstanding} <= 0 ) { |
| 82 |
if($accts->[$i]{'amount'} <= 0){ |
80 |
$accountline->{amountoutstandingcredit} = 1; |
| 83 |
$accts->[$i]{'amountcredit'} = 1; |
|
|
| 84 |
} |
81 |
} |
| 85 |
$accts->[$i]{'amountoutstanding'}+=0.00; |
82 |
|
| 86 |
if($accts->[$i]{'amountoutstanding'} <= 0){ |
83 |
$accountline->{date} = format_date($accountline->{date}); |
| 87 |
$accts->[$i]{'amountoutstandingcredit'} = 1; |
84 |
$accountline->{amount} = sprintf '%.2f', $accountline->{amount}; |
|
|
85 |
$accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding}; |
| 86 |
if ($accountline->{accounttype} eq 'Pay') { |
| 87 |
$accountline->{payment} = 1; |
| 88 |
$reverse_col = 1; |
| 88 |
} |
89 |
} |
| 89 |
my %row = ( 'date' => format_date($accts->[$i]{'date'}), |
90 |
if ($accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU'){ |
| 90 |
'amountcredit' => $accts->[$i]{'amountcredit'}, |
91 |
$accountline->{printtitle} = 1; |
| 91 |
'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'}, |
|
|
| 92 |
'toggle' => $accts->[$i]{'toggle'}, |
| 93 |
'description' => $accts->[$i]{'description'}, |
| 94 |
'itemnumber' => $accts->[$i]{'itemnumber'}, |
| 95 |
'biblionumber' => $accts->[$i]{'biblionumber'}, |
| 96 |
'amount' => sprintf("%.2f",$accts->[$i]{'amount'}), |
| 97 |
'amountoutstanding' => sprintf("%.2f",$accts->[$i]{'amountoutstanding'}), |
| 98 |
'accountno' => $accts->[$i]{'accountno'}, |
| 99 |
'payment' => ( $accts->[$i]{'accounttype'} eq 'Pay' ), |
| 100 |
|
| 101 |
); |
| 102 |
|
| 103 |
if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){ |
| 104 |
$row{'printtitle'}=1; |
| 105 |
$row{'title'} = $accts->[$i]{'title'}; |
| 106 |
} |
92 |
} |
| 107 |
|
|
|
| 108 |
push(@accountrows, \%row); |
| 109 |
} |
93 |
} |
| 110 |
|
94 |
|
| 111 |
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); |
95 |
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); |
|
Lines 121-127
$template->param(
Link Here
|
| 121 |
cardnumber => $data->{'cardnumber'}, |
105 |
cardnumber => $data->{'cardnumber'}, |
| 122 |
categorycode => $data->{'categorycode'}, |
106 |
categorycode => $data->{'categorycode'}, |
| 123 |
category_type => $data->{'category_type'}, |
107 |
category_type => $data->{'category_type'}, |
| 124 |
# category_description => $data->{'description'}, |
|
|
| 125 |
categoryname => $data->{'description'}, |
108 |
categoryname => $data->{'description'}, |
| 126 |
address => $data->{'address'}, |
109 |
address => $data->{'address'}, |
| 127 |
address2 => $data->{'address2'}, |
110 |
address2 => $data->{'address2'}, |
|
Lines 134-140
$template->param(
Link Here
|
| 134 |
branchname => GetBranchName($data->{'branchcode'}), |
117 |
branchname => GetBranchName($data->{'branchcode'}), |
| 135 |
total => sprintf("%.2f",$total), |
118 |
total => sprintf("%.2f",$total), |
| 136 |
totalcredit => $totalcredit, |
119 |
totalcredit => $totalcredit, |
| 137 |
is_child => ($data->{'category_type'} eq 'C'), |
120 |
is_child => ($data->{'category_type'} eq 'C'), |
| 138 |
accounts => \@accountrows ); |
121 |
reverse_col => $reverse_col, |
|
|
122 |
accounts => $accts ); |
| 139 |
|
123 |
|
| 140 |
output_html_with_http_headers $input, $cookie, $template->output; |
124 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 141 |
- |
|
|