Adding Mandat datetime

This commit is contained in:
ragu 2025-04-30 08:41:03 +02:00
parent d200ca3593
commit 38cb3b7142
6 changed files with 32 additions and 10 deletions

View file

@ -1088,6 +1088,9 @@ sub booking_request {
owner => $owner,
};
$dbt->update_one($dbh,$update_ctt,"start_time='$now_dt'");
#SEPA-Mandat datetime if exist
$dbt->update_one($dbh,$update_ctt,"ma_time='$auth->{ma_time}'") if($auth->{ma_time});
$dbt->update_one($dbh,$update_ctt,"txt26='$auth->{ct_name}'") if($auth->{ct_name} =~ /^\w{2}-\w+/);
#update waren bike state only if adhock booking
if(!$calreserv){

View file

@ -1042,11 +1042,11 @@ sub update_record(){
$set .= " $key=null,";#we need this for null values in operators loop
}
}
if($key =~ /(mtime|atime|pay_time|invoice_time|warn_time)$/){
if($key =~ /(mtime|atime|pay_time|invoice_time|warn_time|ma_time)$/){
if($value && $value =~ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}|^\d{2}\.\d{2}\.\d{4}$/){
$set .= " $key='$value',";
}elsif($key =~ /warn_time/ && $value eq "null"){
$set .= " $key=null,";
$set .= " $key=null,";
}else{
$set .= " $key='now()',";
}

View file

@ -581,15 +581,26 @@ sub save_account(){
}
}
#elsif($dbt->{primary}->{payment_provider} eq "manually"){
#elsif($dbt->{primary}->{payment_provider} eq "manually")
else{
my $valid = $ibanmod->valid($iban);
if ($valid) {
print FILE "c_id:$c_id --> IBAN:$iban --> valid:$valid\n" if($debug);
$vde_on_fail = 0 if($vde_on_fail != 2);
$u_rows = $dbt->update_one($dbh,$update_adr,"ct_name='MA-$c_id'");#MA for manually mandat
$u_rows = $dbt->update_one($dbh,$update_adr,"txt27='active'");
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
my $update_adr2 = {
table => "contentadr",
mtime => "now()",
owner => "$owner",
c_id => "$c_id",
ct_name => "MA-$c_id",
txt27 => "active",
int12 => $vde_on_fail,
ma_time => "now()",
};
#dedicated update because of mandat
$u_rows = $dbt->update_record($dbh,$update_adr2,$ctadr);
my $ret = $pay->pdfmandat(\%varenv,$ctadr->{c_id});
print FILE "pdfmandat call generates: $ret\n" if($debug);
}

View file

@ -367,9 +367,17 @@ EOF
if($ctt->{int03} && $ctt->{int03} != 3 && $ctadr->{txt28}){
$payteaser = substr($ctadr->{txt28},0,50) . " ...";
}
my $ma_time = $ctt->{ma_time} || "";
$ma_time = $lb->time4de($ma_time,0) if($ma_time);
print $q->Tr(),"\n";
print $q->td({-class=>'tdescr4'},"Zahlungsart"),"\n";
print $q->td({-class=>'tdval4'},"$kind_of_payment"),"\n";
if($ma_time){
print $q->Tr(),"\n";
print $q->td({-class=>'tdescr4'},"SEPA-Mandat"),"\n";
print $q->td({-class=>'tdval4'},"$ctt->{txt26} $ma_time"),"\n";
}
print $q->Tr(),"\n";
print $q->td({-class=>'tdescr4'},"Payone log Kunde"),"\n";
print $q->td({-class=>'tdval4'},"$payteaser"),"\n";

View file

@ -125,8 +125,8 @@ sub utctime {
#'deviceTime' => '2021-10-14T08:19:35.000+0000',
#'serverTime' => '2021-10-14T07:19:37.000+0000',
#$utc_epoch -= 2*60*60;# -2 std (Sommerzeit)
$utc_epoch -= 1*60*60;# -1 std (Winterzeit)
$utc_epoch -= 2*60*60;# -2 std (Sommerzeit)
#$utc_epoch -= 1*60*60;# -1 std (Winterzeit)
$utc_epoch += $latency;
$time = gmtime($utc_epoch);#epoch

View file

@ -87,8 +87,8 @@ sub utctime {
my $time = Time::Piece->strptime($date, "%Y-%m-%dT%H:%M:%S");
print FILE "localtime: " . $time->datetime . "\n";#localtime
my $utc_epoch = $time->epoch;
#$utc_epoch -= 2*60*60;# -2 std (Sommerzeit)
$utc_epoch -= 1*60*60;# -1 std (Winterzeit)
$utc_epoch -= 2*60*60;# -2 std (Sommerzeit)
#$utc_epoch -= 1*60*60;# -1 std (Winterzeit)
$utc_epoch += $latency;
$time = gmtime($utc_epoch);#epoch
print FILE "utctime: " . $time->datetime . "\n";#utc zulu date time