diff --git a/copri4/main/src/Mod/APIfunc.pm b/copri4/main/src/Mod/APIfunc.pm index 8edc6d7..83d2f79 100755 --- a/copri4/main/src/Mod/APIfunc.pm +++ b/copri4/main/src/Mod/APIfunc.pm @@ -1062,7 +1062,9 @@ sub booking_request { $response_state = "Failure 4260, reserv timerange"; $response_text = "Abbruch, die Mietzeit liegt in der Vergangenheit"; } - }else{ + } + #on adhock check if bike available + elsif($ct_bike->{int10} == 1){ my $adjust_freedtime = 0; my $further_freedtime_available = 1; my ($cttpos,$operator_hash) = $self->user_rentals_history($q,$auth,1,0); @@ -2531,7 +2533,7 @@ sub stations_available { fetch => "all", keyfield => "barcode", template_id => "205", - int10 => "1", + #int10 => "1", }; my $record_bikes = {}; $record_bikes = $dbt->fetch_record($dbh,$bpref,""); @@ -2566,7 +2568,7 @@ sub stations_available { foreach my $b_id (keys (%$record_bikes)){ if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){ push @bike_ids,$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $record_bikes->{$b_id}->{barcode}; - $bike_count++; + $bike_count++ if($record->{$id}->{int10} == 1 && !$record->{$id}->{archive}); if($record_bikes->{$b_id}->{fleed_phone} && $record_bikes->{$b_id}->{fleed_email}){ $fleed = { name => "$record_bikes->{$b_id}->{fleed_name}", @@ -2607,7 +2609,7 @@ sub stations_available { my $bike_count2 = 0; foreach my $b_id (keys (%$record_bikes)){ if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){ - $bike_count2++ if($_ == $record_bikes->{$b_id}->{type_id}); + $bike_count2++ if($_ == $record_bikes->{$b_id}->{type_id} && $record_bikes->{$b_id}->{int10} == 1 && !$record_bikes->{$b_id}->{archive}); } } $return->{$id}->{station_type}->{$dbt->{copri_conf}->{type_id}->{$_}}->{bike_count} = "$bike_count2"; @@ -3194,6 +3196,7 @@ sub auth_verify { open(FILE,">>$varenv{logdir}/authcookie.log") if($debug); print FILE "\n*-->$now_dt $netloc | $varenv{dbname} | $cgi_authcookie\n" if($debug); + my $auth_primary = { c_id => 0 }; if($cgi_authcookie && length($cgi_authcookie) > 30){ my $authref = { table => "contentadr", @@ -3201,7 +3204,6 @@ sub auth_verify { template_id => "202", txt05 => "like::" . "%" . $q->escapeHTML($cgi_authcookie) . "%", }; - my $auth_primary = { c_id => 0 }; my $auth_operator = { c_id => 0 }; $auth_operator = $dbt->fetch_record($dbh,$authref); $record = $auth_operator; @@ -3383,8 +3385,8 @@ sub auth_verify { $return->{agb_checked} = "0"; $return->{agb_checked} = "1" if($record->{int14});#sharee AGB global - my $last_used_operator = $record->{txt19};#check if this is primary and/or useable - #$bw->log("last_used_operator selected by txt19:",$last_used_operator,""); + my $last_used_operator = $auth_primary->{txt19} || ""; + $bw->log("last_used_operator selected by txt19:",$last_used_operator,""); if($last_used_operator){ my $dbh_operator = $dbt->dbconnect_extern("$last_used_operator",""); my $hotline_hash = { @@ -3393,7 +3395,8 @@ sub auth_verify { template_id => 197, c_id => "1", }; - my $hotline_data = $dbt->fetch_record($dbh_operator,$hotline_hash); + my $hotline_data = {}; + $hotline_data = $dbt->fetch_record($dbh_operator,$hotline_hash); $return->{last_used_operator} = { "operator_name" => "", diff --git a/copri4/main/src/scripts/Ilockit_trackingcloud.pl b/copri4/main/src/scripts/Ilockit_trackingcloud.pl index 5ecfa3e..faae68f 100755 --- a/copri4/main/src/scripts/Ilockit_trackingcloud.pl +++ b/copri4/main/src/scripts/Ilockit_trackingcloud.pl @@ -176,9 +176,10 @@ sub get_tripsum { print FILE "distance: $resp->{distance}" . "\n"; if($resp->{distance} && $resp->{distance} > 0){ #my $distance = $resp->{distance} / 1000 * 1.60934; #distance in Meilen - my $distance = $resp->{distance} / 1000; + my $distance = 0; + $distance = $resp->{distance} / 1000; $distance = sprintf('%.2f', $distance); - $update_pos->{int26} = $distance; + $update_pos->{int26} = $distance if($distance < 1000); } } } diff --git a/copri4/main/src/scripts/mailTransportcms.pl b/copri4/main/src/scripts/mailTransportcms.pl index 2304986..5da065d 100755 --- a/copri4/main/src/scripts/mailTransportcms.pl +++ b/copri4/main/src/scripts/mailTransportcms.pl @@ -135,6 +135,7 @@ if(ref($sendmail) eq "HASH" && $sendmail->{c_id}){ #user messaging for all operators by one cronjob if($todo eq "send_invoice_onwork" || $todo eq "email_longterm_occupied"){ + $sendref->{mailxcfg} = "mailx_invoice"; #loop operators DB while (my ($key, $op_name) = each %{ $dbt->{operator} }) { if($op_name->{database}->{dbname}){ @@ -489,7 +490,8 @@ sub send_invoice_onwork { }; my $uadr = { c_id => 0 }; $uadr = $dbt->fetch_tablerecord($dbh_primary,$pref_ctu); - $sendref->{mail_to} = $uadr->{txt08}; + #$sendref->{mail_to} = $uadr->{txt08}; + $sendref->{mail_to} = $sendref->{mail_from};#yes, delivering to $sendref->{mailxcfg} = "mailx_invoice"; my $pref = { table => "contenttrans",