mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
operator data fix
This commit is contained in:
parent
b9b63c63e5
commit
148d4bbd48
3 changed files with 17 additions and 11 deletions
|
@ -1062,7 +1062,9 @@ sub booking_request {
|
||||||
$response_state = "Failure 4260, reserv timerange";
|
$response_state = "Failure 4260, reserv timerange";
|
||||||
$response_text = "Abbruch, die Mietzeit liegt in der Vergangenheit";
|
$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 $adjust_freedtime = 0;
|
||||||
my $further_freedtime_available = 1;
|
my $further_freedtime_available = 1;
|
||||||
my ($cttpos,$operator_hash) = $self->user_rentals_history($q,$auth,1,0);
|
my ($cttpos,$operator_hash) = $self->user_rentals_history($q,$auth,1,0);
|
||||||
|
@ -2531,7 +2533,7 @@ sub stations_available {
|
||||||
fetch => "all",
|
fetch => "all",
|
||||||
keyfield => "barcode",
|
keyfield => "barcode",
|
||||||
template_id => "205",
|
template_id => "205",
|
||||||
int10 => "1",
|
#int10 => "1",
|
||||||
};
|
};
|
||||||
my $record_bikes = {};
|
my $record_bikes = {};
|
||||||
$record_bikes = $dbt->fetch_record($dbh,$bpref,"");
|
$record_bikes = $dbt->fetch_record($dbh,$bpref,"");
|
||||||
|
@ -2566,7 +2568,7 @@ sub stations_available {
|
||||||
foreach my $b_id (keys (%$record_bikes)){
|
foreach my $b_id (keys (%$record_bikes)){
|
||||||
if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){
|
if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){
|
||||||
push @bike_ids,$dbt->{operator}->{$varenv->{dbname}}->{oprefix} . $record_bikes->{$b_id}->{barcode};
|
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}){
|
if($record_bikes->{$b_id}->{fleed_phone} && $record_bikes->{$b_id}->{fleed_email}){
|
||||||
$fleed = {
|
$fleed = {
|
||||||
name => "$record_bikes->{$b_id}->{fleed_name}",
|
name => "$record_bikes->{$b_id}->{fleed_name}",
|
||||||
|
@ -2607,7 +2609,7 @@ sub stations_available {
|
||||||
my $bike_count2 = 0;
|
my $bike_count2 = 0;
|
||||||
foreach my $b_id (keys (%$record_bikes)){
|
foreach my $b_id (keys (%$record_bikes)){
|
||||||
if($record->{$id}->{int04} == $record_bikes->{$b_id}->{int04}){
|
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";
|
$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);
|
open(FILE,">>$varenv{logdir}/authcookie.log") if($debug);
|
||||||
print FILE "\n*-->$now_dt $netloc | $varenv{dbname} | $cgi_authcookie\n" 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){
|
if($cgi_authcookie && length($cgi_authcookie) > 30){
|
||||||
my $authref = {
|
my $authref = {
|
||||||
table => "contentadr",
|
table => "contentadr",
|
||||||
|
@ -3201,7 +3204,6 @@ sub auth_verify {
|
||||||
template_id => "202",
|
template_id => "202",
|
||||||
txt05 => "like::" . "%" . $q->escapeHTML($cgi_authcookie) . "%",
|
txt05 => "like::" . "%" . $q->escapeHTML($cgi_authcookie) . "%",
|
||||||
};
|
};
|
||||||
my $auth_primary = { c_id => 0 };
|
|
||||||
my $auth_operator = { c_id => 0 };
|
my $auth_operator = { c_id => 0 };
|
||||||
$auth_operator = $dbt->fetch_record($dbh,$authref);
|
$auth_operator = $dbt->fetch_record($dbh,$authref);
|
||||||
$record = $auth_operator;
|
$record = $auth_operator;
|
||||||
|
@ -3383,8 +3385,8 @@ sub auth_verify {
|
||||||
$return->{agb_checked} = "0";
|
$return->{agb_checked} = "0";
|
||||||
$return->{agb_checked} = "1" if($record->{int14});#sharee AGB global
|
$return->{agb_checked} = "1" if($record->{int14});#sharee AGB global
|
||||||
|
|
||||||
my $last_used_operator = $record->{txt19};#check if this is primary and/or useable
|
my $last_used_operator = $auth_primary->{txt19} || "";
|
||||||
#$bw->log("last_used_operator selected by txt19:",$last_used_operator,"");
|
$bw->log("last_used_operator selected by txt19:",$last_used_operator,"");
|
||||||
if($last_used_operator){
|
if($last_used_operator){
|
||||||
my $dbh_operator = $dbt->dbconnect_extern("$last_used_operator","");
|
my $dbh_operator = $dbt->dbconnect_extern("$last_used_operator","");
|
||||||
my $hotline_hash = {
|
my $hotline_hash = {
|
||||||
|
@ -3393,7 +3395,8 @@ sub auth_verify {
|
||||||
template_id => 197,
|
template_id => 197,
|
||||||
c_id => "1",
|
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} = {
|
$return->{last_used_operator} = {
|
||||||
"operator_name" => "",
|
"operator_name" => "",
|
||||||
|
|
|
@ -176,9 +176,10 @@ sub get_tripsum {
|
||||||
print FILE "distance: $resp->{distance}" . "\n";
|
print FILE "distance: $resp->{distance}" . "\n";
|
||||||
if($resp->{distance} && $resp->{distance} > 0){
|
if($resp->{distance} && $resp->{distance} > 0){
|
||||||
#my $distance = $resp->{distance} / 1000 * 1.60934; #distance in Meilen
|
#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);
|
$distance = sprintf('%.2f', $distance);
|
||||||
$update_pos->{int26} = $distance;
|
$update_pos->{int26} = $distance if($distance < 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,6 +135,7 @@ if(ref($sendmail) eq "HASH" && $sendmail->{c_id}){
|
||||||
|
|
||||||
#user messaging for all operators by one cronjob
|
#user messaging for all operators by one cronjob
|
||||||
if($todo eq "send_invoice_onwork" || $todo eq "email_longterm_occupied"){
|
if($todo eq "send_invoice_onwork" || $todo eq "email_longterm_occupied"){
|
||||||
|
$sendref->{mailxcfg} = "mailx_invoice";
|
||||||
#loop operators DB
|
#loop operators DB
|
||||||
while (my ($key, $op_name) = each %{ $dbt->{operator} }) {
|
while (my ($key, $op_name) = each %{ $dbt->{operator} }) {
|
||||||
if($op_name->{database}->{dbname}){
|
if($op_name->{database}->{dbname}){
|
||||||
|
@ -489,7 +490,8 @@ sub send_invoice_onwork {
|
||||||
};
|
};
|
||||||
my $uadr = { c_id => 0 };
|
my $uadr = { c_id => 0 };
|
||||||
$uadr = $dbt->fetch_tablerecord($dbh_primary,$pref_ctu);
|
$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 = {
|
my $pref = {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
|
|
Loading…
Add table
Reference in a new issue