rental deactivation on payment-fault and payment-type key change

This commit is contained in:
ragu 2024-01-16 06:23:43 +01:00
parent f731aa352b
commit 5044e9bfe8
13 changed files with 229 additions and 101 deletions

View file

@ -23,13 +23,14 @@ use POSIX;
use CGI ':standard';
use Lib::Config;
use Mod::DBtank;
use Mod::APIfunc;
use Data::Dumper;
my $q = new CGI;
my $cf = new Config;
my %varenv = $cf->envonline("$syshost");
my $dbt = new DBtank;
my $lang = "de";
my $apif = new APIfunc;
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
my $dbh = "";
@ -43,7 +44,6 @@ my $pref = {
fetch => "all",
keyfield => "c_id",
int10 => "2",
owner => "!=::199",#don't select LV api requested bikes
start_time => "<=::(now() - interval '$interval_min minutes')",
};
my $record_cp = $dbt->fetch_tablerecord($dbh,$pref);
@ -61,14 +61,19 @@ my $update_cc = {
my $rows = 0;
foreach my $id (sort { $record_cp->{$a}->{c_id} <=> $record_cp->{$b}->{c_id} } keys (%$record_cp)){
my $record = { c_id => 0 };
$record->{c_id} = $record_cp->{$id}->{c_id};
#contenttranspos
$rows = $dbt->update_record($dbh,$update_cp,$record);
my $record_cpone = { c_id => 0 };
$record_cpone->{c_id} = $record_cp->{$id}->{c_id};
$update_cp->{int04} = $record_cp->{$id}->{int06};#set end-station to start-station
$rows = $dbt->update_record($dbh,$update_cp,$record_cpone);
if($rows > 0 && $record_cp->{$id}->{cc_id}){
$record->{c_id} = $record_cp->{$id}->{cc_id};
#content
my $record = { c_id => 0 };
$record->{c_id} = $record_cp->{$id}->{cc_id};
$dbt->update_record($dbh,$update_cc,$record);
my $authraw = { c_id => 0 };
$apif->stations_caching($q,\%varenv,$authraw);
}
}