counting position on delete and agb

This commit is contained in:
ragu 2022-05-19 16:00:41 +02:00
parent 7a6f57a2ef
commit d1badd0dca
6 changed files with 54 additions and 22 deletions

View file

@ -866,6 +866,7 @@ sub fetch_bike_tariff {
#2022-04-05 refactored bike reservation
sub booking_request(){
my $self = shift;
my $q = shift;
my $varenv = shift;
my $auth = shift;#app API auth
my $bike = shift || "";#app API request
@ -875,13 +876,17 @@ sub booking_request(){
my $gps = shift || "";
my $sig_book = shift || {};
my $state = $q->escapeHTML($q->param('state')) || "";
my $lock_state = $q->escapeHTML($q->param('lock_state')) || "";
my $dbh = "";
my $pos_id="";
my $now_dt = strftime "%Y-%m-%d %H:%M", localtime;
my $response_state = "OK";
my $response_text = "";
$bw->log("booking_request bike $bike, auth $auth->{c_id}, tarif $ct_tariff->{barcode}, requested bike:",$bike,"");
#state and lock_state is only defined if requestes incl. occupied
$bw->log("booking_request bike to state $bike $state $lock_state, auth $auth->{c_id}, tarif $ct_tariff->{barcode}, bike:",$bike,"");
my $update_adr = {
table => "contentadr",

View file

@ -103,11 +103,17 @@ if(!$coo && !$q->param('merchant_id')){
return Apache2::Const::OK;
exit 0;
}else{
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
if($aowner && ($aowner == 195 || $aowner == 185 || $aowner == 176)){
my $return_merchant = { project_id => "" };
($aowner, $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
#if($aowner && ($aowner == 195 || $aowner == 185 || $aowner == 176)){
if($return_merchant->{project_id} eq "Konstanz"){
$response->{agb_html} = "site/agb_konrad_1.html";
$response->{bike_info_html} = "site/bike_info_konrad_1.html";
}
if($return_merchant->{project_id} eq "Bayern"){
$response->{agb_html} = "site/agb_lastenradbayern_2.html";
}
}
#If param>40 || value > 400 then exit
@ -252,7 +258,7 @@ elsif($q->param('request') eq "booking_request"){
if($ct_bike->{int11} == 3){
$sig_book = $si->sig_booking(\%varenv,$authraw,$ct_bike,"","reserve");
}
$response_book = $apif->booking_request(\%varenv,$authraw,$bike,$ct_bike,$ct_tariff,$aowner,$gps,$sig_book);
$response_book = $apif->booking_request($q,\%varenv,$authraw,$bike,$ct_bike,$ct_tariff,$aowner,$gps,$sig_book);
}elsif(!$ct_tariff->{barcode}){
$response->{response_state} = "Failure 2089: booking bike $bike fails, no user tariff available";
$response->{response_text} = "Reservierungsfehler Fahrrad Nr. $bike. Es konnte kein Mietrad Tarif gefunden werden.";