mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
some optimization to reduce db selections
This commit is contained in:
parent
f39ac77590
commit
8cfb680fec
9 changed files with 48 additions and 55 deletions
|
@ -1971,7 +1971,8 @@ sub bikes_available(){
|
|||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||
#$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||
}
|
||||
}#end new rental_description
|
||||
|
||||
|
@ -2592,7 +2593,8 @@ sub auth_verify(){
|
|||
my $q = shift;
|
||||
my $coo = shift || "";
|
||||
my $userc_id = shift || "";
|
||||
my $new_authcoo = shift || "";
|
||||
my $simple_op = shift || "";
|
||||
|
||||
my $cgi_authcookie = $q->param('authcookie') || $q->param('sessionid') || $coo;
|
||||
my $session_log = $q->param('sessionid') || "";
|
||||
my $user_agent = $q->user_agent();
|
||||
|
@ -2632,10 +2634,11 @@ sub auth_verify(){
|
|||
my $auth_primary = { c_id => 0 };
|
||||
my $auth_operator = { c_id => 0 };
|
||||
$auth_operator = $dbt->fetch_record($dbh,$authref);
|
||||
$record = $auth_operator;
|
||||
#$bw->log("auth_verified on operator $varenv{dbname} anchor 1",$auth_operator->{c_id},"");
|
||||
|
||||
#just part of operator-routing (sharee account management)
|
||||
if($varenv{dbname} ne $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||
if(!$simple_op && $varenv{dbname} ne $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||
#primary select
|
||||
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
$auth_primary = $dbt->fetch_record($dbh_primary,$authref);
|
||||
|
@ -2749,7 +2752,7 @@ sub auth_verify(){
|
|||
#$bw->log("auth_verified on primary anchor 4 FAILS by dbname $varenv{dbname}.",$auth_primary->{c_id},"");
|
||||
print FILE "auth_verified on primary anchor 4 FAILS by dbname $varenv{dbname} | pri $auth_primary->{c_id}\n" if($debug);
|
||||
}
|
||||
}else{# if($varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname})
|
||||
}elsif($varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||
$auth_primary = $dbt->fetch_record($dbh,$authref);
|
||||
#$bw->log("auth_verified on operator anchor 4 by dbname $varenv{dbname}",$auth_primary->{c_id},"");
|
||||
print FILE "auth_verified on operator anchor 4 by dbname $varenv{dbname} | pri $auth_primary->{c_id}\n" if($debug);
|
||||
|
@ -2760,8 +2763,8 @@ sub auth_verify(){
|
|||
($bike_group,$bike_node,$user_tour,$tariff_content,$adrtarif_hash) = $self->fetch_tariff($varenv{dbname},$record,$q->param('authcookie'));
|
||||
}
|
||||
|
||||
if($auth_primary->{c_id} > 0 && length($auth_primary->{txt05}) > 30){
|
||||
my @check_cookies = split(/\|/,$auth_primary->{txt05});
|
||||
if($record->{c_id} > 0 && length($record->{txt05}) > 30){
|
||||
my @check_cookies = split(/\|/,$record->{txt05});
|
||||
foreach(@check_cookies){
|
||||
if(length($_) > 30 && $_ =~ /$cgi_authcookie/){
|
||||
$return->{authcookie} = $cgi_authcookie;
|
||||
|
|
|
@ -455,7 +455,9 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
$response = { %$response, %$return_merchant };
|
||||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
my $auth = {};
|
||||
my $authraw = {};
|
||||
($auth,$authraw) = $apif->auth_verify($q);
|
||||
$response = { %$response, %$auth };
|
||||
($response->{bikes},$response->{uri_operator_array},$response->{user_group},$response->{user_tour}) = $jsc->loop_sharees($q,$authraw,$return_merchant);
|
||||
#$bw->log("X bikes_available $varenv{syshost} $stamp: $response->{user_group}",$response,"");
|
||||
|
@ -464,16 +466,12 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
|
||||
#on operator loop select, operator adr must be select to get user_group
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
my $auth = {};
|
||||
my $authraw = {};
|
||||
($auth,$authraw) = $apif->auth_verify($q,"","",1);
|
||||
$response = { %$response, %$auth };
|
||||
#$bw->log("Y bikes_available by c_id $authraw->{c_id}, Tarif:",$authraw->{txt30},"");
|
||||
|
||||
#sig first save
|
||||
#if($varenv{syshost} eq "shareeapp-sx"){
|
||||
# (my $response_bikes_disabled,my $return2copri->{bikes}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
# $tk->sigbike_cupdate($return2copri->{bikes});
|
||||
#}
|
||||
#$response->{bikes} = $apif->bikes_available($q,\%varenv,$authraw);
|
||||
if($varenv{syshost} eq "shareeapp-sx"){
|
||||
($response->{bikes},my $return2copri->{bikes}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
$tk->sigbike_cupdate($return2copri->{bikes});
|
||||
|
@ -502,7 +500,9 @@ elsif($q->param('request') eq "bikes_all"){
|
|||
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
my $auth = {};
|
||||
my $authraw = {};
|
||||
($auth,$authraw) = $apif->auth_verify($q,"","",1);
|
||||
$response = { %$response, %$auth };
|
||||
$response->{response_text} = "Vorsicht, das ist die Liste aller Leihräder unabhängig von der Verfügbarkeit";
|
||||
|
||||
|
@ -641,7 +641,9 @@ elsif($q->param('request') eq "stations_all"){
|
|||
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
my $auth = {};
|
||||
my $authraw = {};
|
||||
($auth,$authraw) = $apif->auth_verify($q,"","",1);
|
||||
$response = { %$response, %$auth };
|
||||
my ($bikes_all,$bikes_allraw,$bikes_on_station) = $apif->bikes_all($q,\%varenv,$authraw,"");
|
||||
($response->{stations},my $stations_allraw) = $apif->stations_all($q,\%varenv,$bikes_on_station,$authraw);
|
||||
|
@ -667,15 +669,12 @@ elsif($q->param('request') eq "stations_available"){
|
|||
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
my $auth = {};
|
||||
my $authraw = {};
|
||||
($auth,$authraw) = $apif->auth_verify($q,"","",1);
|
||||
$response = { %$response, %$auth };
|
||||
|
||||
#sig first save
|
||||
#if($varenv{syshost} eq "shareeapp-sx"){
|
||||
# (my $response_stations_disabled,my $return2copri->{stations}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
# $tk->sigstation_cupdate($return2copri->{stations});
|
||||
#}
|
||||
#($response->{stations}, my $response_raw) = $apif->stations_available($q,\%varenv,$authraw,"");
|
||||
if($varenv{syshost} eq "shareeapp-sx"){
|
||||
($response->{stations},my $return2copri->{stations}) = $si->sig_available($q,\%varenv,$authraw);
|
||||
$tk->sigstation_cupdate($return2copri->{stations});
|
||||
|
|
|
@ -279,7 +279,7 @@ sub sig_available {
|
|||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||
}
|
||||
}#end new rental_description
|
||||
|
||||
|
|
|
@ -45,8 +45,7 @@ sub dbconnect {
|
|||
my $options ="";
|
||||
my $database = "dbi:Pg:dbname=$varenv{dbname};host=$varenv{dbhost};port=5432;options='$options'";
|
||||
my $dbh = DBI->connect($database, $varenv{dbuser}, $varenv{dbpassw},{ RaiseError => 1, AutoCommit => 1 }) or die "Can't connect to $varenv{dbname}: $DBI::errstr";
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
#$bw->log("--> dbconnect_intern --> $varenv{syshost} $source",$database,"");
|
||||
#$bw->log("--> dbconnect_intern --> $varenv{syshost} ",$database,"");
|
||||
return $dbh if($dbh);
|
||||
}
|
||||
|
||||
|
@ -323,7 +322,6 @@ sub get_node_meta {
|
|||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $viewsel = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
my $node_name1 = $q->escapeHTML(@{$viewsel}[-1]);
|
||||
my @node_path = ("$node_name1");
|
||||
|
@ -357,7 +355,7 @@ sub get_node_meta {
|
|||
$uri_path .= "$_/";
|
||||
}
|
||||
$uri_path =~ s/\/$//;
|
||||
$bw->log("get_node_meta $uri_path | $source",$sql,"") if($debug);
|
||||
$bw->log("get_node_meta $uri_path",$sql,"") if($debug);
|
||||
#print Dumper($nrt);
|
||||
return $nrt;
|
||||
}
|
||||
|
@ -509,7 +507,6 @@ sub fetch_rel4tpl4nd(){
|
|||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $fetch = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
$fetch->{content_id}=0 if($fetch->{content_id} eq "null");
|
||||
my $where = "WHERE nodes.main_id=relation.main_id and relation.template_id=template.tpl_id";
|
||||
|
@ -533,7 +530,7 @@ sub fetch_rel4tpl4nd(){
|
|||
}else{
|
||||
$rel = $sth->fetchrow_hashref();
|
||||
}
|
||||
#$bw->log("fetch_rel4tpl4nd $source",$sql,"") if($debug);
|
||||
#$bw->log("fetch_rel4tpl4nd ",$sql,"") if($debug);
|
||||
|
||||
return $rel;
|
||||
}
|
||||
|
@ -595,7 +592,6 @@ sub collect_post(){
|
|||
my $fetch = shift;
|
||||
my $count = shift || "";
|
||||
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $table;
|
||||
my $table_pos;
|
||||
my $ct_where = "1=1";
|
||||
|
@ -687,7 +683,7 @@ sub collect_post(){
|
|||
$sql = "SELECT cp.*, ct.state FROM $fetch->{table_pos} cp, $fetch->{table} ct WHERE $cp_where and cp.ct_id=ct.c_id and $poscid IN (SELECT ct.c_id FROM relation rel, $fetch->{table} ct WHERE rel.content_id=ct.c_id and $ct_where) order by cp.mtime ASC";#mtime aufsteigend get last (newest) entry
|
||||
$sth = $dbh->prepare($sql);
|
||||
}
|
||||
#$bw->log("DBtank collect_post $source",$sql,"") if($debug);
|
||||
#$bw->log("DBtank collect_post ",$sql,"") if($debug);
|
||||
my $rc = $sth->execute();
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
|
@ -705,7 +701,6 @@ sub fetch_record(){
|
|||
my $dbh = shift || $dbh_intern;
|
||||
my $fetch = shift;
|
||||
my $fetch_sql = shift || "";
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
my $where = "where ct.c_id=rel.content_id and nd.main_id=rel.main_id";
|
||||
$where .= "$fetch_sql" if($fetch_sql);#enhancement to get bike_group OR
|
||||
|
@ -768,7 +763,7 @@ sub fetch_record(){
|
|||
my $sql = "SELECT ct.*,rel.*,nd.node_name,nd.parent_id,nd.type_id,nd.energy_id FROM $fetch->{table} ct, relation rel, nodes nd $where $order";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
#$bw->log("DBtank fetch_record $source: $rc",$sql,"") if($debug);
|
||||
#$bw->log("DBtank fetch_record : $rc",$sql,"") if($debug);
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
||||
|
@ -784,7 +779,6 @@ sub fetch_tablerecord(){
|
|||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my ($fetch) = @_;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $where = "where 1=1";
|
||||
|
||||
foreach my $key (keys %$fetch){
|
||||
|
@ -837,7 +831,7 @@ sub fetch_tablerecord(){
|
|||
my $sql = "SELECT * FROM $fetch->{table} $where";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
#$bw->log("DBtank fetch_tablerecord $source:",$sql,"") if($debug);
|
||||
#$bw->log("DBtank fetch_tablerecord :",$sql,"") if($debug);
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
||||
|
@ -853,7 +847,6 @@ sub update_sql(){
|
|||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $update_sql = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $rows = 0;
|
||||
|
||||
my $sql = "$update_sql";
|
||||
|
@ -861,7 +854,7 @@ sub update_sql(){
|
|||
my $sth = $dbh->prepare($sql);
|
||||
$rows = $sth->execute();
|
||||
|
||||
$bw->log("DBtank update_sql $source: $rows",$sql,"") if($debug);
|
||||
$bw->log("DBtank update_sql: $rows",$sql,"") if($debug);
|
||||
|
||||
return $rows;
|
||||
|
||||
|
@ -875,7 +868,6 @@ sub update_one(){
|
|||
my $one_in = shift || "";
|
||||
my $c_id = shift || "";
|
||||
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $rows = 0;
|
||||
my $where = "";
|
||||
if($c_id){
|
||||
|
@ -914,7 +906,7 @@ sub update_one(){
|
|||
my $sql = "UPDATE $update->{table} set $one $where";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
$rows = $sth->execute();
|
||||
$bw->log("DBtank update_one $source: $rows",$sql,"") if($debug);
|
||||
$bw->log("DBtank update_one : $rows",$sql,"") if($debug);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
@ -926,7 +918,6 @@ sub update_record(){
|
|||
my $dbh = shift || $dbh_intern;
|
||||
my $update = shift;
|
||||
my $record = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $where = "";
|
||||
my $set = "";
|
||||
my $rows = 0;
|
||||
|
@ -974,7 +965,7 @@ sub update_record(){
|
|||
my $sql = "UPDATE $update->{table} set $set $where";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
$rows = $sth->execute();
|
||||
$bw->log("DBtank update_record $source: $rows",$sql,"") if($debug);
|
||||
$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
|
||||
}
|
||||
return $rows;
|
||||
}#update_record
|
||||
|
@ -985,12 +976,11 @@ sub insert_users {
|
|||
my $dbh = shift || $dbh_intern;
|
||||
my $u_id = shift;
|
||||
my $owner = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
my $sql = "INSERT INTO users (u_id,itime,mtime,owner) VALUES ('$u_id','now()','now()','$owner')";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rows = $sth->execute();
|
||||
$bw->log("DBtank INSERT DMS users $source $rows",$sql,"") if($debug);
|
||||
$bw->log("DBtank INSERT DMS users $rows",$sql,"") if($debug);
|
||||
return $u_id;
|
||||
}
|
||||
|
||||
|
@ -999,13 +989,12 @@ sub select_users(){
|
|||
my $dbh = shift || $dbh_intern;
|
||||
my $u_id = shift || 0;
|
||||
my $sqlcon = shift || "";#used with "and int09=1"
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
my $sql = "SELECT * FROM users WHERE u_id=$u_id $sqlcon";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
my $users = $sth->fetchrow_hashref();
|
||||
$bw->log("DBtank SELECT DMS users $source u_id: $users->{u_id}",$sql,"") if($debug);
|
||||
$bw->log("DBtank SELECT DMS users u_id: $users->{u_id}",$sql,"") if($debug);
|
||||
return $users;
|
||||
}
|
||||
|
||||
|
@ -1121,7 +1110,6 @@ sub delete_content(){
|
|||
my $c_id = shift || 0;
|
||||
my $template_id = shift || "";
|
||||
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
my $rows = 0;
|
||||
if($c_id){
|
||||
my $where = "c_id=$c_id";
|
||||
|
@ -1130,7 +1118,7 @@ sub delete_content(){
|
|||
my $sql = "DELETE FROM $table WHERE $where";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
$rows = $sth->execute();
|
||||
$bw->log("delete_content $source: $rows",$sql,"") if($debug);
|
||||
$bw->log("delete_content : $rows",$sql,"") if($debug);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
@ -1358,7 +1346,6 @@ sub copy_template(){
|
|||
my $master_tpl_id = shift;
|
||||
my $new_tpl_id = shift;
|
||||
my $owner = shift;
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
|
||||
my $columns = "tpl_name,tpl_order,ct_table,tpl_height,tpl_width,bg_color";
|
||||
my $sql = "INSERT INTO template ($columns) SELECT $columns from template where tpl_id=$master_tpl_id RETURNING tpl_id";
|
||||
|
@ -1368,7 +1355,7 @@ sub copy_template(){
|
|||
my $last_id;
|
||||
$sth->bind_columns(\$last_id);
|
||||
my $auto_tpl_id = $sth->fetchrow_array();
|
||||
$bw->log("DBtank copy_template $source: $rows",$sql,"") if($debug);
|
||||
$bw->log("DBtank copy_template : $rows",$sql,"") if($debug);
|
||||
|
||||
my $sth2 = $dbh->prepare("UPDATE template set tpl_id=$new_tpl_id, change='now()',owner=$owner where tpl_id=$auto_tpl_id");
|
||||
$rows = $sth2->execute();
|
||||
|
|
|
@ -128,7 +128,7 @@ sub handler {
|
|||
#3. authorize
|
||||
my $author = $apif->authorization($q,$varenv{merchant_id},$hw_id,$aowner);#$co like browser hw_id
|
||||
#4. verify and get user values
|
||||
($api_return,$users_sharee) = $apif->auth_verify($q,$author->{authcookie},"",$author->{new_authcoo});
|
||||
($api_return,$users_sharee) = $apif->auth_verify($q,$author->{authcookie},"");
|
||||
|
||||
#5. domcookie by authcookie substr (cut first 15 chars), AND also sessionid
|
||||
if($author->{authcookie} && length($author->{authcookie}) > 30){
|
||||
|
@ -638,6 +638,10 @@ sub handler {
|
|||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}$session");
|
||||
exit 0;
|
||||
}
|
||||
elsif($users_sharee->{int12} || $users_sharee->{int03} != $R::int03){
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_2}?cum=2$session_and\&$returnwww");
|
||||
exit 0;
|
||||
}
|
||||
elsif($payable_check && (!$users_sharee->{int04} || !$users_sharee->{int13})){
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=2$session_and\&$returnwww");
|
||||
exit 0;
|
||||
|
|
|
@ -271,8 +271,8 @@ sub month_line(){
|
|||
}
|
||||
}
|
||||
|
||||
#my $daymarker = $raster_mmpx * ($day_today - 0.5);
|
||||
my $daymarker = $raster_mmpx * $day_today;
|
||||
my $daymarker = $raster_mmpx * ($day_today - 0.5);
|
||||
#my $daymarker = $raster_mmpx * $day_today;
|
||||
$daymarker .= "%";
|
||||
|
||||
return ($daymarker,$raster_mmpx,$day4month);
|
||||
|
|
|
@ -56,7 +56,7 @@ sub managemandate_main {
|
|||
my $ctt = shift || "";
|
||||
my $owner = shift || 0;
|
||||
my $payoneret = "";
|
||||
my $payone_conf = $dbt->{operator}->{$varenv->{dbname}}->{payone_conf} || {};
|
||||
my $payone_conf = $dbt->{payone_conf} || {};
|
||||
|
||||
if($ctadr->{c_id}){
|
||||
my $lastname = $ctadr->{txt01};
|
||||
|
|
|
@ -370,7 +370,7 @@ sub fetch_rentalfeed {
|
|||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / Tag"];
|
||||
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($ctpos->{time02});
|
||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||
}elsif($td_template->{$td}->{xduration} && $returned_counting->{real_clock} && $returned_counting->{real_clock} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($returned_counting->{real_clock});
|
||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{xduration}","$time_unit"];
|
||||
|
|
|
@ -502,7 +502,7 @@ sub save_account(){
|
|||
$iban =~ s/\s//g;
|
||||
my $iban_reject = 0;
|
||||
$iban_reject = 1 if($iban =~ /DE33700202700000091600/i);
|
||||
if($R::request eq "managemandate" && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id} && !$iban_reject){
|
||||
if($R::request eq "managemandate" && $ctadr->{int03} == 1 && !$iban_reject){
|
||||
|
||||
my $vde_on_fail = $ctadr->{int12} || 3;#keep last or set 3
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue