mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
booking-request fix
This commit is contained in:
parent
814692903f
commit
4155e25027
6 changed files with 34 additions and 26 deletions
|
@ -965,7 +965,7 @@ sub fetch_bike_tariff {
|
|||
}
|
||||
}
|
||||
|
||||
$bw->log("booking_request fetch_bike_tariff result ---> bike $ct_bike->{barcode} matching by bike_node: @{$bike_node} main_ids:$main_ids | bike_group by type_id:@{$bike_group} | Tarif selected: $tariff_nr",$tariff_content->{$tariff_nr},"");
|
||||
$bw->log("booking_request fetch_bike_tariff result ---> bike $ct_bike->{barcode} matching by bike_node: @{$bike_node} main_ids:$main_ids | bike_group by type_id:@{$bike_group} | Tarif selected: $tariff_nr",$tariff_content->{$tariff_nr}->{ct_name},"");
|
||||
|
||||
return ($ct_bike,$tariff_content->{$tariff_nr});
|
||||
}
|
||||
|
@ -2706,7 +2706,7 @@ sub auth_verify(){
|
|||
#first, save operator array which are used
|
||||
my %operator_hash = ();#local DB
|
||||
#$bw->log("booking_request auth_verified by dbname $varenv{dbname}",$auth_primary->{c_id},"");
|
||||
print FILE "booking_request auth_verified by dbname $varenv{dbname} | pri $auth_primary->{c_id}\n if($debug)";
|
||||
print FILE "booking_request auth_verified by dbname $varenv{dbname} | pri $auth_primary->{c_id}\n" if($debug);
|
||||
|
||||
if($auth_primary->{txt17} && $auth_primary->{txt17} =~ /\w\s\w/){#append DB's
|
||||
%operator_hash = map { $_ => 1 } split(/\s+/,$auth_primary->{txt17});
|
||||
|
|
|
@ -263,7 +263,13 @@ elsif($q->param('request') eq "booking_request"){
|
|||
rentalId => "",
|
||||
};
|
||||
|
||||
if($ct_bike->{barcode} && $ct_tariff->{barcode}){
|
||||
if(!$ct_bike->{barcode} || !$ct_bike->{int10} || $ct_bike->{int10} != 1){
|
||||
$response->{response_state} = "Failure 2001: booking bike $bike fails, bike not available";
|
||||
$response->{response_text} = "Mietrad $bike ist nicht verfügbar. Ist das Mietrad für sie freigeschaltet? Bitte überprüfen Sie Ihre Profildaten auf Vollständigkeit";
|
||||
}elsif(!$ct_tariff->{barcode}){#ist will not happen, because of prios tariff select in fetch_bike_tariff
|
||||
$response->{response_state} = "Failure 2089: booking bike $bike fails, no user tariff available";
|
||||
$response->{response_text} = "Reservierung Mietrad $bike nicht möglich. Ist die Mietrad Flotte für sie freigeschaltet? Bitte überprüfen Sie Ihre Profildaten auf Vollständigkeit";
|
||||
}elsif($ct_bike->{barcode} && $ct_tariff->{barcode}){
|
||||
#sig reservation. not mandatory, disabled because sig seems to get confused
|
||||
if((!$q->param('state') || $q->param('state') ne "occupied") && $ct_bike->{int11} == 3){
|
||||
$sig_book = $si->sig_booking(\%varenv,"reserve",$authraw,$ct_bike,"");
|
||||
|
@ -271,13 +277,7 @@ elsif($q->param('request') eq "booking_request"){
|
|||
$sig_book->{rentalId} = "$R::rentalId" if($R::rentalId);#only for cmd tests
|
||||
}
|
||||
$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.";
|
||||
}elsif(!$ct_bike->{barcode}){
|
||||
$response->{response_state} = "Failure 2001: booking bike $bike fails, bike not available";
|
||||
$response->{response_text} = "Fahrrad Nr. $bike ist leider nicht verfügbar. Ist die Mietrad Flotte für sie freigeschaltet? Bitte überprüfen Sie Ihre Profildaten auf Vollständigkeit";
|
||||
}
|
||||
}
|
||||
|
||||
#just in time booking
|
||||
if(ref($response_book) eq "HASH" && $response_book->{response_state} =~ /OK/ && $q->param('state') && $q->param('state') =~ /occupied/){
|
||||
|
|
|
@ -165,15 +165,17 @@ EOF
|
|||
|
||||
print "</span>\n";
|
||||
|
||||
my $praefix = "$ctt->{txt00}-$varenv{praefix}";
|
||||
if(!looks_like_number($ctt->{int01}) || $ctt->{ct_name} =~ /-/){
|
||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, " $buchen_users->{txt01} / $invoice_time ", $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n";
|
||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n";
|
||||
print $q->hidden(-name=>'c_id', -override=>'1', -value=>"$ctt->{content_id}");
|
||||
print $q->hidden(-name=>'template_id', -override=>'1', -value=>"$ctt->{template_id}");
|
||||
print $q->hidden(-name=>'main_id', -override=>'1', -value=>"$ctt->{main_id}");
|
||||
print $q->hidden(-name=>'rel_id', -override=>'1', -value=>"$ctt->{rel_id}");
|
||||
}elsif(looks_like_number($ctt->{int01})){
|
||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time "),"\n";
|
||||
}elsif(looks_like_number($ctt->{int01}) && ! -f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf"){
|
||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")),"\n";
|
||||
}
|
||||
print $q->span({-style=>'margin:0 0.2em;position:absolute;right:100px;'}, "$buchen_users->{txt01} / $invoice_time "),"\n";
|
||||
print "</div>\n";
|
||||
|
||||
print $q->hidden(-name=>'owner', -override=>'1', -value=>"$users_dms->{owner}");
|
||||
|
@ -205,7 +207,9 @@ EOF
|
|||
my $top = 30;
|
||||
foreach my $id (sort { $ctt_rel->{$b}->{c_id} <=> $ctt_rel->{$a}->{c_id} } keys (%$ctt_rel)){
|
||||
my $toppx = $top . "px";
|
||||
print $q->div({-style=>"position:absolute;top:$toppx;right:10px;font-size:0.91em;background-color:#f7ae37"}, $q->a({-class=>"linknav",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Faktura/$ctt_rel->{$id}->{node_name}?ct_trans=open\&c_id4trans=$ctt_rel->{$id}->{c_id}\&tpl_id4trans=$ctt_rel->{$id}->{template_id}\&owner=$users_dms->{u_id}",-title=>"Faktura Terminal öffnen"},"[ $ctt_rel->{$id}->{txt00} #$ctt_rel->{$id}->{ct_name} ]")),"\n";
|
||||
my $rel_color = "#f7ae37";
|
||||
$rel_color = "silver" if($ctt->{c_id} == $ctt_rel->{$id}->{c_id});
|
||||
print $q->div({-style=>"position:absolute;top:$toppx;right:10px;font-size:0.91em;background-color:$rel_color"}, $q->a({-class=>"linknav",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Faktura/$ctt_rel->{$id}->{node_name}?ct_trans=open\&c_id4trans=$ctt_rel->{$id}->{c_id}\&tpl_id4trans=$ctt_rel->{$id}->{template_id}\&owner=$users_dms->{u_id}",-title=>"Faktura Terminal öffnen"},"[ $ctt_rel->{$id}->{txt00} #$ctt_rel->{$id}->{ct_name} ]")),"\n";
|
||||
$top += 22;
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +416,7 @@ EOF
|
|||
push @s_valxx, "$s_key:$s_key";
|
||||
}
|
||||
|
||||
if($ctt->{ct_name} =~ /^\d+$/){
|
||||
if($ctt->{ct_name} !~ /\d+-\d/){
|
||||
undef @s_valxx[3];
|
||||
undef @s_valxx[4];
|
||||
undef @s_valxx[5];
|
||||
|
|
|
@ -540,7 +540,7 @@ EOF
|
|||
print $q->a({-class=>'elinkbutton',-style=>'margin:0 0 2px 20px;', -href=>'?accounting_select=1'},"1. Einzüge selektieren"),"\n";
|
||||
}
|
||||
print "<b>$months[$mon -1] $year</b>\n";
|
||||
print " (1. selektiert Rechnungen mit Payone Einzug & kein OPOS & kein Storno & keine interne Bemerkung, alle anderen bitte manuell überprüfen und falls i.O. selektieren)\n";
|
||||
print $q->span({-style=>'font-size:0.81em;'}," (1. selektiert Rechnungen mit Payone Einzug & kein OPOS & kein Storno & keine interne Bemerkung, alle anderen bitte manuell überprüfen und falls i.O. selektieren)"),"\n";
|
||||
print "</div>\n";
|
||||
}
|
||||
print $q->hidden(-name=>'mandant_main_id', -value=>"$dbt->{shareedms_conf}->{parent_id}"),"\n";
|
||||
|
|
|
@ -76,9 +76,7 @@ sub tpl(){
|
|||
|
||||
my $ctadr = $db->get_content1("contentadr",$ctt->{int10});
|
||||
my $buchen_mtime = $lb->time4de($ctt->{mtime});
|
||||
my $vibuchen_mtime = "";
|
||||
#my $vibuchen_mtime = $lb->time4de($ctt->{mtime},1);
|
||||
#$vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time} && $ctt->{state} =~ /payone/);
|
||||
my $vibuchen_mtime = $lb->time4de($ctt->{mtime},1);
|
||||
|
||||
my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int03=Menge (Miet - Gratis Zeit)","int02=Preis","int07=Rabatt","int04=Gesamt");
|
||||
my $tplf = $db->get_tpl("201");#Kunden-Faktura, ex Firma
|
||||
|
@ -149,7 +147,7 @@ EOF
|
|||
my ($key,$val) = split /=/,$_;
|
||||
$tc++ if($val);
|
||||
if($key eq "ct_name"){
|
||||
print $q->th($q->textfield(-class=>'etxt',-style=>'height:19px;width:140px;font-size:1.3em;text-align:right;',-id=>"json_select",-name=>"json_select",-value=>"", -override=>'1',-size=>"25",-maxlength=>50, -placeholder=>'Nummer'),""),"\n";
|
||||
print $q->th($q->textfield(-class=>'etxt',-style=>'height:19px;width:140px;font-size:1.3em;text-align:right;',-id=>"json_select",-name=>"json_select",-value=>"", -override=>'1',-size=>"25",-maxlength=>50, -placeholder=>'Nummer',-autofocus=>1),""),"\n";
|
||||
}elsif($key =~ /int|txt|time\d+/){
|
||||
print $q->th("$val"),"\n";
|
||||
}
|
||||
|
@ -563,13 +561,19 @@ EOF
|
|||
$vibuchen_mtime = $lb->time4de($ctt->{pay_time},1) if($ctt->{pay_time});
|
||||
my $opos = "";
|
||||
$opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0);
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € gebucht per \"$ctt->{state}\" am $vibuchen_mtime "),"\n";
|
||||
if($ctt->{int16} && $ctt->{int16} > 0){
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € gebucht per \"$ctt->{state}\", Payone Saldo $ctt->{int16} € vom $vibuchen_mtime "),"\n";
|
||||
}else{
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € gebucht per \"$ctt->{state}\" am $vibuchen_mtime "),"\n";
|
||||
}
|
||||
}else{
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:silver;'>Summe ist nicht gebucht!</span>"),"\n";
|
||||
}
|
||||
|
||||
if(!$ctt->{close_time}){
|
||||
my $send_invoice_checkbox = 1;
|
||||
$send_invoice_checkbox = 0 if($ctt->{txt30} || $ctt->{ct_name} =~ /\d-\d/);
|
||||
print $q->div({-class=>'element6',-style=>'float:right;'}, $q->b("$ctt->{txt00}"),
|
||||
print $q->div({-class=>'element6',-style=>'float:right;background-color:silver;'}, $q->b("$ctt->{txt00}"),
|
||||
": PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""),
|
||||
" – eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""),
|
||||
" – Zahlungart ",
|
||||
|
@ -578,7 +582,7 @@ EOF
|
|||
"\n";
|
||||
}
|
||||
|
||||
if($ctt->{txt00} ne "Storno" && $ctt->{ct_name} !~ /^\d+$/){
|
||||
if($ctt->{txt00} ne "Storno" && $ctt->{ct_name} =~ /\d+-\d/){
|
||||
my @s_valxx = ("");
|
||||
my $s_hash = {};
|
||||
$s_hash = $dbt->{shareedms_conf}->{warning_state};
|
||||
|
@ -592,7 +596,7 @@ EOF
|
|||
undef @s_valxx[1];
|
||||
undef @s_valxx[2];
|
||||
}
|
||||
print $q->div({-class=>'element6',-style=>'float:right;'},"Mahnstufe",$but->selector_class("int06","","",$ctt->{int06},@s_valxx),
|
||||
print $q->div({-class=>'element6',-style=>'float:right;background-color:silver;'},"Mahnstufe",$but->selector_class("int06","","",$ctt->{int06},@s_valxx),
|
||||
"Fälligkeit",$q->textfield(-id=>'datepicker3',-class=>'etxt',-name=>"warn_time",-default=>"$warn_time",-override=>1,-size=>"8",-maxlength=>10)),"\n";
|
||||
print $q->hidden(-name=>'int14', -override=>'1', -value=>"1"),"\n";#set OPOS
|
||||
}
|
||||
|
@ -626,7 +630,7 @@ EOF
|
|||
}
|
||||
|
||||
if( -f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf"){
|
||||
print $q->div({-style=>'padding:0.5em;font-size:0.81em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, "$praefix-$ctt->{ct_name}.pdf")),"\n";
|
||||
print $q->div({-style=>'padding:0.5em;font-size:0.91em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, "$praefix-$ctt->{ct_name}.pdf")),"\n";
|
||||
}
|
||||
|
||||
$db->updater("contenttrans","c_id","$ctt->{content_id}","txt20","$accounting_start - $accounting_end","","","","","no_time") if(!$int05 && $accounting_start && $accounting_end);
|
||||
|
|
|
@ -50,7 +50,7 @@ sub tpl(){
|
|||
#my $api_test = "sharee_sx"; my $bike="S3X1001";
|
||||
#my $api_test = "sharee_ren"; my $bike="REN2";
|
||||
|
||||
print $q->div({-style=>'float:right;text-align:right;height:25px;padding:6px 15px;background-color:white'},$q->a({-style=>"background-color:#ffffff;color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test\&bike=$bike", -target=>'_blank'}," [ tests --> $api_test ] "),"$users_sharee->{txt08}",$q->a({-style=>"color:#$bgcolor1;", -href=>"logout_sharee$session"},"logout")),"\n";
|
||||
print $q->div({-style=>'float:right;text-align:right;height:25px;padding:6px 15px;background-color:white'},$q->a({-style=>"background-color:#ffffff;color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test\&bike=$bike\&user_test=$users_sharee->{txt08}", -target=>'_blank'}," [ tests --> $api_test ] "),"$users_sharee->{txt08}",$q->a({-style=>"color:#$bgcolor1;", -href=>"logout_sharee$session"},"logout")),"\n";
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue