|
|
@@ -170,8 +170,6 @@ sub ExpirePass {
|
|
|
my $href = $query->fetchrow_hashref;
|
|
|
if ($query->rows == 0) { $dbh->commit; return; }
|
|
|
|
|
|
-print "#bill: cp0\n";
|
|
|
-
|
|
|
my $passid = $href->{'user_pass_id'};
|
|
|
my $current_q_num = $href->{'queue_order'};
|
|
|
|
|
|
@@ -181,8 +179,6 @@ print "#bill: cp0\n";
|
|
|
$query->execute($passid);
|
|
|
audit_user_pass_end($dbh, $passid, $audit_pass_id);
|
|
|
|
|
|
-print "#bill: cp1\n";
|
|
|
-
|
|
|
# activate new pass
|
|
|
$query = $dbh->prepare("select p.user_pass_id, p.rule, p.nday_orig, p.nday_expiration, p.nrides_orig, p.queue_order, rc.ruleclass
|
|
|
from user_pass p, rule_class rc
|
|
|
@@ -195,8 +191,6 @@ print "#bill: cp1\n";
|
|
|
and t.expired = 0) ");
|
|
|
$query->execute($cardid, $cardid, $current_q_num);
|
|
|
|
|
|
-
|
|
|
-print "#bill: cp2\n";
|
|
|
$href = $query->fetchrow_hashref;
|
|
|
|
|
|
# no passes left, put in reject rule, finish transaction
|
|
|
@@ -216,8 +210,6 @@ print "#bill: cp2\n";
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-print "#bill: cp3\n";
|
|
|
-
|
|
|
# else make new pass active and update art with new pass
|
|
|
#$href = $query->fetchrow_hashref;
|
|
|
|
|
|
@@ -234,8 +226,6 @@ print "#bill: cp3\n";
|
|
|
$query->execute($ride_time, $href->{'user_pass_id'} );
|
|
|
audit_user_pass_end($dbh, $href->{'user_pass_id'}, $audit_pass_id);
|
|
|
|
|
|
-print "#bill: cp4\n";
|
|
|
-
|
|
|
if ($isMySQL) {
|
|
|
$query = $dbh->prepare("lock tables active_rider_table write");
|
|
|
$query->execute();
|
|
|
@@ -249,8 +239,6 @@ print "#bill: cp4\n";
|
|
|
$query->execute();
|
|
|
}
|
|
|
|
|
|
-print "#bill: cp5\n";
|
|
|
-
|
|
|
}
|
|
|
|
|
|
sub AdvanceRiderPass {
|
|
|
@@ -267,8 +255,6 @@ sub AdvanceRiderPass {
|
|
|
$dbh->{RaiseError} = 1;
|
|
|
$dbh->{PrintError} = 1;
|
|
|
|
|
|
-print "#bill: advance: cp0, logical_card_id " . $logical_card_id . "\n";
|
|
|
-
|
|
|
$dbh->begin_work;
|
|
|
|
|
|
# my $sth_find = $dbh->prepare('SELECT active_rider_table.logical_card_id, active_rider_table.rfid_token,
|
|
|
@@ -344,8 +330,6 @@ print " ok?\n";
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-print "#bill: advance: cp2\n";
|
|
|
-
|
|
|
#my $pass = $sth_pass->fetchrow_hashref;
|
|
|
|
|
|
my $t = $dbh->prepare("select ruleclass from rule_class where rulename = ?");
|
|
|
@@ -385,8 +369,6 @@ print ">>> \$t->rows " . $t->rows . "\n";
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-print "#bill: advance: cp3\n";
|
|
|
-
|
|
|
if (uc($billing_action) eq "REJECT") {
|
|
|
# bus not sync'd?
|
|
|
$dbh->commit;
|
|
|
@@ -439,8 +421,6 @@ print "#bill: advance: cp3\n";
|
|
|
|
|
|
} elsif ($rule_class eq 'NDAY') {
|
|
|
|
|
|
-print "#>> nday expiration " . $pass->{'nday_expiration'} . "\n";
|
|
|
-
|
|
|
# update user_pass with expiration and update active_rider_table with new param
|
|
|
if (!$pass->{'nday_expiration'}) {
|
|
|
my $audit_pass_id = audit_user_pass_start($dbh, $pass->{'user_pass_id'}, "billing_server: AdvanceRiderPass: updating nday");
|
|
|
@@ -492,11 +472,9 @@ print "#>> nday expiration " . $pass->{'nday_expiration'} . "\n";
|
|
|
$dbh->commit;
|
|
|
}
|
|
|
|
|
|
-print "#bill: advance: cp4\n";
|
|
|
|
|
|
ExpirePass( $dbh, $logical_card_id, $pass->{'user_pass_id'}, $billing_ride_time, @oldrow );
|
|
|
|
|
|
-print "#bill: advance: cp5\n";
|
|
|
}
|
|
|
|
|
|
sub ServerReply
|
|
|
@@ -677,9 +655,6 @@ sub handle_client()
|
|
|
while($linebuffer = <CLIENT>)
|
|
|
{
|
|
|
|
|
|
-## DEBUG
|
|
|
-print "## billing: $linebuffer\n";
|
|
|
-
|
|
|
open LOGFH, ">>$logfile";
|
|
|
print LOGFH $linebuffer;
|
|
|
close LOGFH;
|