mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-13 15:16:38 +02:00
SWK Tarif on register and delete_account on craete
This commit is contained in:
parent
901c4c2a71
commit
83da7fe92b
4 changed files with 26 additions and 16 deletions
|
@ -1031,7 +1031,7 @@ sub booking_update(){
|
|||
$geo_debug .= "Out of station distance: $stations_raw->{$id}->{barcode}|$latitude,$longitude,$latitude_station,$longitude_station --> $geo_distance_next Meter ($geo_distance_next <= $geo_distance) station_next: $station_next\n";
|
||||
|
||||
$booking_values->{response_state} = "Failure 2178: bike " . $q->param('bike') . " out of GEO fencing. $geo_distance_next meter distance to next station $station_next .";
|
||||
$booking_values->{response_text} = "Achtung! Ihr aktueller Standort liegt außerhalb einer Fahrradstation. Die Miete Fahrrad Nr. " . $q->param('bike') . " kann nicht $state_text werden. $geo_distance_next Meter Entfernung zur nächsten Station $station_next .";
|
||||
$booking_values->{response_text} = "Achtung! Ihr aktueller Standort liegt außerhalb einer Fahrradstation. Die Miete Fahrrad Nr. " . $q->param('bike') . " kann nicht $state_text werden. $geo_distance_next Meter Entfernung zur nächsten Station $station_next . Falls Sie sich doch an einer Station befinden, dann wiederholen Sie \"Miete beenden\".";
|
||||
}
|
||||
|
||||
}else{
|
||||
|
@ -1299,7 +1299,7 @@ sub service_automatic {
|
|||
|
||||
my $station_id = "";
|
||||
my $bike_id = "";
|
||||
$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);
|
||||
$station_id = $1 if($q->param('station') =~ /(\d+)/);#could be also 0
|
||||
$bike_id = $1 if($q->param('bike') && $q->param('bike') =~ /(\d+)/);
|
||||
my $authraw = { c_id => $owner };#default sys API
|
||||
my $lock_charge = "Achtung, Fahrradschloss Ladung unter " . $q->param('voltage') . "%";
|
||||
|
@ -1498,10 +1498,11 @@ sub bikes_available(){
|
|||
}
|
||||
if(ref($tariff_content) eq "HASH"){
|
||||
foreach my $tid (sort { $tariff_content->{$a}->{barcode} <=> $tariff_content->{$b}->{barcode} } keys (%$tariff_content)){
|
||||
$bw->log("bikes_available tariff_content tariff_description if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $auth->{txt30} =~ /$tariff_content->{$tid}->{barcode}/) BIKE:",$return->{$id}->{bike},"");
|
||||
#$bw->log("bikes_available tariff_content tariff_description if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $auth->{txt30} =~ /$tariff_content->{$tid}->{barcode}/) BIKE:",$return->{$id}->{bike},"");
|
||||
|
||||
foreach(@adr_tariff){
|
||||
if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $_ == $tariff_content->{$tid}->{barcode}){
|
||||
$bw->log("bikes_available for user c_id: $auth->{c_id} if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $_ == $tariff_content->{$tid}->{barcode}) on BIKE:",$return->{$id}->{bike},"");
|
||||
|
||||
$return->{$id}->{tariff_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||
$return->{$id}->{tariff_description}->{number} = "$tariff_content->{$tid}->{barcode}";
|
||||
|
@ -1544,18 +1545,19 @@ sub bikes_all(){
|
|||
|
||||
my $station_id = "";
|
||||
my $bike_id = "";
|
||||
$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);
|
||||
#$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);#doesn't get 0
|
||||
$station_id = $1 if($q->param('station') =~ /(\d+)/);
|
||||
$bike_id = $1 if($q->param('bike') && $q->param('bike') =~ /(\d+)/);
|
||||
$pref->{int04} = "=::$station_id" if(looks_like_number($station_id));
|
||||
$pref->{ barcode} = "=::$bike_id" if(looks_like_number($bike_id));
|
||||
|
||||
my $record = {};
|
||||
#on servicetool only stations on user_tour
|
||||
$bw->log("stations_service_tour",$stations_allraw,"");
|
||||
$bw->log("stations_service_tour of adr c_id: $auth->{c_id}",$stations_allraw,"");
|
||||
my @stations_service_tour = ();
|
||||
|
||||
#shareetool
|
||||
if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187){
|
||||
if(!$pref->{int04} && $q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187){
|
||||
my $stations = "";
|
||||
if(ref($stations_allraw) eq "HASH" && scalar(@{$user_tour} >= 1)){
|
||||
foreach my $id (sort { $stations_allraw->{$a}->{int04} <=> $stations_allraw->{$b}->{int04} } keys (%$stations_allraw)){
|
||||
|
@ -1564,17 +1566,16 @@ sub bikes_all(){
|
|||
}
|
||||
$stations = join(",",@stations_service_tour);
|
||||
$stations =~ s/[a-z_]+//ig;
|
||||
$pref->{int04} = "IN::($stations)" if($stations);
|
||||
$bw->log("sub bikes_all with user_tour",$pref,"");
|
||||
$pref->{int04} = "IN::($stations)" if($stations || $stations eq "0");
|
||||
}
|
||||
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
#bikes_all only if authenticated
|
||||
#}else{
|
||||
# $bw->log("sub bikes_all",$pref,"");
|
||||
# $record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
}
|
||||
|
||||
|
||||
$bw->log("sub bikes_all with user_tour ($station_id) @stations_service_tour",$pref,"");
|
||||
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_group) eq "ARRAY" && @{$bike_group}[0]);
|
||||
|
||||
my $bikes_on_station = {};
|
||||
my $op_return = {};
|
||||
|
@ -1736,7 +1737,7 @@ sub stations_all(){
|
|||
|
||||
my $station_id = "";
|
||||
my $work_val_id = "";
|
||||
$station_id = $1 if($q->param('station') && $q->param('station') =~ /(\d+)/);
|
||||
$station_id = $1 if($q->param('station') =~ /(\d+)/);#could be also 0
|
||||
$work_val_id = $1 if($q->param('work_val') && $q->param('work_val') =~ /(\d+)/);
|
||||
if(looks_like_number($station_id)){
|
||||
$pref->{int04} = "=::$station_id";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue