Your Balance body<=

[<< Back]

{'userid'}); $sth = $dbh->prepare("SELECT date, amt, method, note FROM bzrpayout WHERE userid=?"); $sth->execute($remote->{'userid'}); my $hist; while (my $po = $sth->fetchrow_hashref) { unless ($hist) { $hist .= ""; $hist .= "\n"; } $hist .= "\n"; } if ($hist) { $ret .= $hist; $ret .= "
DateAmountMethodNote
$po->{'date'}\$" . sprintf("%0.02f", $po->{'amt'}) . "$po->{'method'}$po->{'note'}
\n"; } $sth = $dbh->prepare("SELECT bzid, date, amt, owed, expired ". "FROM bzrbalance WHERE userid=? ORDER BY bzid"); $sth->execute($remote->{'userid'}); $ret .= ""; $ret .= ""; $ret .= "\n"; my $owed; my $rows = 0; my $now = time(); while (my $r = $sth->fetchrow_hashref) { $rows++; $ret .= ""; $owed += $r->{'owed'}; $ret .= sprintf("", $r->{'amt'}); $ret .= sprintf("", $r->{'owed'}); my $extra; if ($r->{'expired'} > 0) { $extra .= sprintf(" (\$%0.02f expired after 3 months unclaimed)", $r->{'expired'}); } my $time = LJ::mysqldate_to_time($r->{'date'}); my $exptime = $time + 86400*93; if ($r->{'owed'} > 0 && $now < $exptime) { $extra .= ", balance will expire in " . int(($exptime - $now) / 86400) . " days"; } $ret .= ""; $ret .= "\n"; } unless ($rows) { return "No balance or history."; } $ret .= ""; $ret .= "
DateAmountBalanceNote
$r->{'date'}\$%0.02f\$%0.02fBazaar \#$r->{'bzid'}$extra
Amount owed:" . sprintf("\$%0.02f", $owed) . "
"; return $ret unless $owed; unless ($remote->{'legal_assignagree'}) { $ret .= ""; $ret .= ""; $ret .= "Mailing address:
" . LJ::Pay::postal_address_text() . "
"; $ret .= "Include your LiveJournal username, as well as a mailing address to send your check if your balance is over \$50. If you'd prefer to not get paid (and instead generate coupons later at this URL), indicate as such in your letter."; $ret .= ""; $ret .= ""; return $ret; } if ($owed >= 50) { $ret .= ""; } else { $ret .= ""; } $ret .= "Important note: coupons are either used or unused... they don't maintain a balance. As such, only generate a coupon for the amount you intend to use. For your protection, we only allow coupons to be generated for the amounts \$5.00 - \$25.00. You may use multiple coupons in an order, if your order will be more than \$25.00. p?>"; $ret .= "
\n"; $ret .= "Amount: \$ "; $ret .= "
"; return $ret; } _code?> <=body page?>