mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-10 14:06:26 +02:00
Refactoring user registration payment methodes
This commit is contained in:
parent
dc89bed086
commit
da31898968
28 changed files with 974 additions and 2750 deletions
|
@ -81,13 +81,15 @@ sub tplselect(){
|
|||
my $tpl_id = $node_meta->{tpl_id};
|
||||
|
||||
if($node_meta->{main_id}){
|
||||
if($tpl_id == 2){
|
||||
if($tpl_id == 2){
|
||||
require "Tpl/Anmelden.pm";
|
||||
&Anmelden::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
|
||||
|
||||
}elsif($tpl_id == 302 || $tpl_id == 302008 || $tpl_id == 302004){#Adresse
|
||||
}elsif($tpl_id == 302 || $tpl_id == 302008){
|
||||
require "Tpl/FormEdit.pm";
|
||||
&FormEdit::tpl($node_meta,$users_dms,$mode,$varenv,$users_sharee,$feedb);
|
||||
}elsif($tpl_id == 302004){
|
||||
require "Tpl/RentalData.pm";
|
||||
&RentalData::tpl($node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
}elsif($tpl_id == 308){
|
||||
require "Tpl/PayoneSelect.pm";
|
||||
&PayoneSelect::tpl($q,$node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
|
|
|
@ -159,8 +159,19 @@ sub tpl(){
|
|||
|
||||
print $q->end_form,"\n";
|
||||
|
||||
print $q->div({-style=>'position:fixed;bottom:2%;right:2%;z-index:10;font-size:13px;'},"--> $varenv->{syshost} | $varenv->{merchant_id} | $bgcolor1 | $node_meta->{tpl_name} | $users_sharee->{c_id}"),"\n" if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
||||
if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test"){
|
||||
my $project = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{project};
|
||||
|
||||
print "<div style='position:fixed;bottom:5%;left:2%;z-index:10;font-size:13px;'>Project $project : \n";
|
||||
print $q->a({-href=>"$varenv->{wwwhost}/$dbt->{project_conf}->{$project}->{agb_html}", -target=>'_blank'},"[AGB]"),"\n";
|
||||
print $q->a({-href=>"$varenv->{wwwhost}/$dbt->{project_conf}->{$project}->{privacy_html}", -target=>'_blank'},"[Datenschutz]"),"\n";
|
||||
print $q->a({-href=>"$varenv->{wwwhost}/$dbt->{project_conf}->{$project}->{impress_html}", -target=>'_blank'},"[Impressum]"),"\n";
|
||||
print $q->a({-href=>"$varenv->{wwwhost}/$dbt->{project_conf}->{$project}->{tariff_info_html}", -target=>'_blank'},"[Tarif Info]"),"\n";
|
||||
print $q->a({-href=>"$varenv->{wwwhost}/$dbt->{project_conf}->{$project}->{bike_info_html}", -target=>'_blank'},"[Bike Info]"),"\n";
|
||||
print "</div>\n";
|
||||
|
||||
print $q->div({-style=>'position:fixed;bottom:2%;right:2%;z-index:10;font-size:13px;'},"--> $varenv->{syshost} | $varenv->{merchant_id} | $bgcolor1 | $node_meta->{tpl_name} | $users_sharee->{c_id}"),"\n";
|
||||
}
|
||||
print "</div>";
|
||||
}
|
||||
1;
|
||||
|
|
|
@ -43,17 +43,8 @@ sub tpl(){
|
|||
my $pri = new Pricing;
|
||||
my $but = new Buttons;
|
||||
my $submenu = new AccountSubmenu;
|
||||
my $script = $q->script_name();
|
||||
my $path_info = $q->path_info();
|
||||
my $path = $path_info;
|
||||
#with meta_host,
|
||||
if("$varenv->{metahost}"){
|
||||
$path = "$script" . "$path_info";
|
||||
$script="";
|
||||
}
|
||||
my $dbh = "";#$dbt->dbconnect();
|
||||
my $user_agent = $q->user_agent();
|
||||
my @viewsel = split /\//,$1 if($path =~ /^\/(.*)/);
|
||||
my $path = $q->path_info();
|
||||
my $dbh = "";
|
||||
my $red = "red";
|
||||
|
||||
my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid;
|
||||
|
@ -68,11 +59,6 @@ sub tpl(){
|
|||
$bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1});
|
||||
$bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1});
|
||||
|
||||
#print "$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id}|$varenv->{merchant_id}|$coo";
|
||||
my $aowner = "198";
|
||||
$aowner = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} if($varenv->{merchant_id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id});
|
||||
|
||||
#TODO substitute aowner by project
|
||||
my $project = "Freiburg";#defaults to sharee
|
||||
$project = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{project} if($varenv->{merchant_id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{project});
|
||||
|
||||
|
@ -83,7 +69,7 @@ sub tpl(){
|
|||
my $bonus_saved = "$varenv->{cms}->{'iframe-enabled'}->{txt}:";
|
||||
|
||||
#sharee.bike text
|
||||
if($aowner == 186 || $aowner == 197){
|
||||
if($project eq "Freiburg"){
|
||||
$bonus_desc = "$varenv->{cms}->{'iframe-activation-code'}->{txt}";
|
||||
$bonus_ak = "$varenv->{cms}->{'iframe-activation-code-info'}->{txt}";
|
||||
$bonus_avail = "$varenv->{cms}->{'iframe-activation-not-available'}->{txt}";
|
||||
|
@ -92,12 +78,12 @@ sub tpl(){
|
|||
|
||||
}
|
||||
|
||||
my $ctrel = {};
|
||||
$ctrel = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id});
|
||||
my $ctadr = {};
|
||||
$ctadr = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id});
|
||||
#
|
||||
#collect rentals on operators and get operator hash with dbname->uri_operator
|
||||
#$q->param(-name=>'month',-value=>"1");
|
||||
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctrel);
|
||||
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctadr);
|
||||
#print Dumper($cttpos);
|
||||
|
||||
my $cttpos_count=0;
|
||||
|
@ -113,13 +99,13 @@ sub tpl(){
|
|||
my $pref = {
|
||||
table => "contenttrans",
|
||||
fetch => "all",
|
||||
int10 => "$ctrel->{c_id}",
|
||||
int10 => "$ctadr->{c_id}",
|
||||
keyfield => "ct_name",
|
||||
ct_name => "~::[1-9]",
|
||||
};
|
||||
|
||||
|
||||
if($ctrel->{c_id}){
|
||||
if($ctadr->{c_id}){
|
||||
my $ctt = $dbt->fetch_tablerecord($dbh_operator,$pref);
|
||||
foreach my $id (keys(%$ctt)){
|
||||
$ctt->{$id}->{wwwhost} = "$operator_hash->{$sharee_operator}";
|
||||
|
@ -133,7 +119,7 @@ sub tpl(){
|
|||
table => "contentadr",
|
||||
fetch => "one",
|
||||
txt15 => "~::\\w",
|
||||
c_id => "$ctrel->{c_id}",
|
||||
c_id => "$ctadr->{c_id}",
|
||||
};
|
||||
|
||||
$ctadrcoupon->{$sharee_operator} = $dbt->fetch_tablerecord($dbh_operator,$prefcoupon);
|
||||
|
@ -142,7 +128,6 @@ sub tpl(){
|
|||
}
|
||||
|
||||
my $tpl_id = $node_meta->{tpl_id};
|
||||
#$tpl_id = "302004" if($viewsel[1] =~ /Mieten/ && $ctrel->{c_id});
|
||||
my $tpl = $dbt->get_tpl($dbh,$tpl_id);
|
||||
my $tpl01 = $tpl;#If nothing else, because of tpl_name Title in split_lates
|
||||
my $tpl02 = "";
|
||||
|
@ -214,78 +199,28 @@ EOF
|
|||
|
||||
|
||||
|
||||
my $debug=0;
|
||||
$debug=1 if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
||||
my $debug_message = "";
|
||||
|
||||
my $payable_check=0;
|
||||
if(($ctrel->{int03} == 1 && $ctrel->{ct_name} =~ /\w{2}-\d+/) || ($ctrel->{int03} == 2 && length($ctrel->{ct_name}) >= 19)){
|
||||
$payable_check=1;
|
||||
}
|
||||
|
||||
#subMenue--------
|
||||
$submenu->tpl($node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
#-----------------
|
||||
|
||||
my $debug=0;
|
||||
$debug=1 if($users_sharee->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
||||
my $debug_message = "";
|
||||
my $catch_failure=0;
|
||||
if(($R::failure && $R::failure =~ /\w+/) || ($ctrel->{txt31} && $ctrel->{txt31} =~ /\w/)){
|
||||
$debug_message = "($R::failure || $ctrel->{txt31})" if($debug);
|
||||
if(($R::failure && $R::failure =~ /\w+/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /\w/)){
|
||||
$debug_message = "($R::failure || $ctadr->{txt31})" if($debug);
|
||||
$catch_failure=1;
|
||||
print $q->div({-class=>'content2', -style=>"clear:both;color:$red"}, "* $varenv->{cms}->{'iframe-one-error'}->{txt} $debug_message"),"\n";
|
||||
}
|
||||
|
||||
#confirm code manage
|
||||
if($catch_failure && (!$ctrel->{int04} && !$ctrel->{int13}) && ($tpl_id =~ /^2$|302004/) && ($path =~ /$varenv->{accounting_3}/)){
|
||||
$debug_message = "$catch_failure && (!$ctrel->{int04} || !$ctrel->{int13}) && $tpl_id" if($debug);
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-complete-confirmation'}->{txt} $debug_message"),"\n";
|
||||
}elsif((!$ctrel->{int04} || !$ctrel->{int13}) && ($tpl_id =~ /^2$|302004/) && ($path =~ /$varenv->{accounting_3}/)){
|
||||
|
||||
print $q->start_form(-name=>'accountscreen', -action=>"/$varenv->{mandant}/Account/$varenv->{accounting_3}$session"),"\n";
|
||||
print $q->hidden(-name=>"sessionid",-override=>1,-value=>"$R::sessionid");
|
||||
my $required = "";
|
||||
$debug_message = "(!$ctrel->{int04} || !$ctrel->{int13}) && $tpl_id" if($debug);
|
||||
print $q->div({-class=>'content_title3',-style=>'clear:both;'}, "$varenv->{cms}->{'iframe-almost-done'}->{txt} $debug_message"),"\n";
|
||||
my $acktext = "$varenv->{cms}->{'iframe-confirmation-codes-sent'}->{txt}";
|
||||
$acktext = "$varenv->{cms}->{'iframe-sms-confirmation-code-sent'}->{txt}" if($ctrel->{int04} && !$ctrel->{int13});
|
||||
$acktext = "$varenv->{cms}->{'iframe-email-confirmation-code-sent'}->{txt}" if(!$ctrel->{int04} && $ctrel->{int13});
|
||||
print $q->div({-class=>'content2'}, "$acktext $varenv->{cms}->{'iframe-successful-confirmation'}->{txt}"),"\n";
|
||||
if(!$ctrel->{int04}){
|
||||
my $des = "$varenv->{cms}->{'iframe-email-code'}->{txt}";
|
||||
my $key = "confirm_code";
|
||||
my $label_des="* $des";
|
||||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>" if($R::failure);
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='' $required autofocus/>\n";
|
||||
print $q->div({-class=>'content2'}, " $varenv->{cms}->{'iframe-if-email-code-not-received'}->{txt}",$q->a({-style=>"color:#$bgcolor1;",-href=>"$varenv->{wwwhost}?sharee_edit=send_email$session_and"},"$varenv->{cms}->{'iframe-request-email-code'}->{txt}")),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2', -style=>'color:gray;'}, "* $varenv->{cms}->{'iframe-email-code-already-entered'}->{txt}"),"\n";
|
||||
}
|
||||
if(!$ctrel->{int13}){
|
||||
my $des = "$varenv->{cms}->{'iframe-sms-code'}->{txt}";
|
||||
my $key = "confirm_smscode";
|
||||
my $label_des="* $des";
|
||||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>" if($R::failure);
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='' $required autofocus />\n";
|
||||
#print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-if-sms-code-not-received'}->{txt} ",$q->a({-style=>"color:#$bgcolor1;",-href=>"$varenv->{wwwhost}?sharee_edit=send_sms$session_and"},"$varenv->{cms}->{'iframe-request-sms-code'}->{txt}")),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2', -style=>'color:gray;'}, "* $varenv->{cms}->{'iframe-sms-code-already-entered'}->{txt}"),"\n";
|
||||
}
|
||||
|
||||
my $button_name = "$varenv->{cms}->{'iframe-next'}->{txt}";
|
||||
print $q->div({-style=>'margin-top:2em;text-align:center;'},"<button type='submit' name='confirm_userid' value='$ctrel->{c_id}' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$button_name</button>"),"\n";
|
||||
print $q->end_form,"\n";
|
||||
|
||||
}else{
|
||||
if(1==1){
|
||||
|
||||
my $postaction = "/$varenv->{mandant}/Account/$varenv->{accounting_2}";
|
||||
if($ctrel->{c_id} && $path =~ /$varenv->{accounting_2}|$varenv->{accounting_3}|$varenv->{profile}/){
|
||||
if($ctadr->{c_id} && $path =~ /$varenv->{accounting_2}|$varenv->{accounting_3}|$varenv->{profile}/){
|
||||
$postaction = "/$varenv->{mandant}/Account/$varenv->{accounting_3}";
|
||||
}elsif($path =~ /$varenv->{accounting_1}/){
|
||||
$postaction = "/$varenv->{mandant}/Account/$varenv->{accounting_1_5}";
|
||||
}elsif($ctrel->{c_id} && $path =~ /$varenv->{accounting_1}/){
|
||||
}elsif($ctadr->{c_id} && $path =~ /$varenv->{accounting_1}/){
|
||||
$postaction = "/$varenv->{mandant}/Account/$varenv->{accounting_2}";
|
||||
}
|
||||
|
||||
|
@ -323,176 +258,18 @@ EOF
|
|||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-login-needs'}->{txt}"),"\n";
|
||||
|
||||
}
|
||||
@tpl_order = split /,/,$_;
|
||||
|
||||
@tpl_order = split /,/,$_;
|
||||
my $scol = "itime";
|
||||
foreach (@tpl_order){
|
||||
my ($key,$des,$size) = split /=/,$_;
|
||||
$ctrel->{$key} = $q->unescapeHTML("$ctrel->{$key}");
|
||||
$ctrel->{$key} = $lb->newline($ctrel->{$key},"","1");
|
||||
$ctadr->{$key} = $q->unescapeHTML("$ctadr->{$key}");
|
||||
$ctadr->{$key} = $lb->newline($ctadr->{$key},"","1");
|
||||
|
||||
#$des = "$tpl_id.$key" if($debug);
|
||||
$des = $varenv->{cms}->{"iframe-form-$tpl_id.$key"}->{txt} if($varenv->{cms}->{"iframe-form-$tpl_id.$key"}->{txt});
|
||||
|
||||
if($ctrel->{int03} && $path =~ /$varenv->{accounting_3}|$varenv->{profile}/){
|
||||
if(1==1){
|
||||
if($key =~ /ct_name/){
|
||||
if($ctrel->{int12}){
|
||||
print $q->div({-class=>'content2', -style=>'color:#c83434;'}, "$varenv->{cms}->{'iframe-block-rental-access'}->{txt}"),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-success-welcome'}->{txt}"),"\n";
|
||||
}
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-invoice-note'}->{txt}"),"\n";
|
||||
print $q->div({-class=>'content2'}, "$bonus_ak"),"\n" if($R::success && $R::success eq "txt15");
|
||||
|
||||
}elsif($key =~ /barcode/){
|
||||
|
||||
if($cttpos_count){
|
||||
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"$varenv->{cms}->{'iframe-items-for-debit'}->{txt}"),"\n";
|
||||
|
||||
my @tpl_posorder = ("txt01=$varenv->{cms}->{'iframe-description'}->{txt}","int04=$varenv->{cms}->{'iframe-station'}->{txt}","ct_name=$varenv->{cms}->{'iframe-bike-nr'}->{txt}","int26=CO2","int02=$varenv->{cms}->{'iframe-amount'}->{txt}");
|
||||
|
||||
my $j=0;
|
||||
my $nx=0;
|
||||
my $sum = 0;
|
||||
print "<div style='clear:both;'>\n";
|
||||
print $q->start_table({-style=>'margin:15px 0;', -border=>'0', -width=>'auto',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
|
||||
print $q->Tr(),"\n";
|
||||
|
||||
foreach my $id (sort { lc($cttpos->{$b}->{$scol}) cmp lc($cttpos->{$a}->{$scol}) } keys(%$cttpos)){
|
||||
$j++;
|
||||
$nx++;
|
||||
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id});
|
||||
}
|
||||
|
||||
print $q->Tr(),"\n";
|
||||
foreach (@tpl_posorder){
|
||||
my ($key,$val) = split /=/,$_;
|
||||
|
||||
my $occupied_style = "background-color:#fcfdfb;";
|
||||
$occupied_style = "background-color:#f4f1ee;" if($nx %= 2);
|
||||
#$occupied_style = "color:#ff1493;" if($cttpos->{$id}->{txt10} =~ /occupied|requested/);
|
||||
$occupied_style = "color:#ff1493;" if($cttpos->{$id}->{int10} == 2 || $cttpos->{$id}->{int10} == 3);
|
||||
|
||||
if($key eq "txt01"){
|
||||
#print $q->td({-class=>'tdtxt', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
print "<td class='tdtxt' style='$occupied_style'>\n";
|
||||
if($cttpos->{$id}->{txt01}){
|
||||
$cttpos->{$id}->{$key} =~ s/\<br \/\>/; /g;
|
||||
print "$cttpos->{$id}->{$key}<br />\n";
|
||||
}
|
||||
if($pricing->{start_time} && $pricing->{end_time}){
|
||||
$pricing->{start_time} = $lb->time4de($pricing->{start_time},"1");
|
||||
$pricing->{end_time} = $lb->time4de($pricing->{end_time},"1");
|
||||
my $rental_time = "";
|
||||
$rental_time = "(rental debug: $pricing->{real_clock} $pricing->{freed_time})" if($debug);
|
||||
print $q->span("→ $pricing->{start_time}<br />← $pricing->{end_time} $rental_time");
|
||||
}
|
||||
print "</td>\n";
|
||||
}elsif($key =~ /int04/){
|
||||
if($cttpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
#print $q->td({-class=>'tdint', -style=>"$occupied_style"},"Station $cttpos->{$id}->{$key}");
|
||||
print "<td class='tdtxt' style='$occupied_style'>\n";
|
||||
my $return_station = "";
|
||||
$return_station = "← $cttpos->{$id}->{txt13}$cttpos->{$id}->{int04}" if($cttpos->{$id}->{txt13} && $cttpos->{$id}->{int04});
|
||||
print $q->span("$varenv->{cms}->{'iframe-station'}->{txt}<br />→ $cttpos->{$id}->{txt12}$cttpos->{$id}->{int06}<br />$return_station");
|
||||
print "</td>\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
}
|
||||
}elsif($key =~ /ct_name/){
|
||||
if($cttpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$varenv->{cms}->{'iframe-bike'}->{txt}<br />$cttpos->{$id}->{$key}"),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}
|
||||
}elsif($key eq "int26"){
|
||||
my $co2saving = "";
|
||||
if($cttpos->{$id}->{int26}){
|
||||
$co2saving = "$varenv->{cms}->{'iframe-saving'}->{txt}</br>";
|
||||
my $co2diff = $pri->co2calc($cttpos->{$id});
|
||||
#my $sprit_price = $pri->sprit2calc($cttpos->{$id});
|
||||
$co2saving .= "$co2diff kg CO²<br />";
|
||||
#$co2saving .= "$sprit_price EUR<br />" if($sprit_price !~ /-/);
|
||||
$cttpos->{$id}->{int26} =~ s/\./,/;
|
||||
$co2saving .= "bei $cttpos->{$id}->{int26} KM";
|
||||
}
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$co2saving"),"\n";
|
||||
}elsif($key eq "int02"){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
my $gesamt = 0;
|
||||
$sum += $pricing->{total_price};
|
||||
$gesamt = $lb->round($pricing->{total_price});
|
||||
$gesamt = sprintf('%.2f', $gesamt);
|
||||
$gesamt =~ s/\./,/;
|
||||
my $rabatt = "";
|
||||
$rabatt = "$pricing->{discount}" if($pricing->{discount});
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
||||
}else{
|
||||
my $gesamt = 0;
|
||||
my $rabatt = "";
|
||||
($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum += $gesamt;
|
||||
$gesamt = $lb->round($gesamt);
|
||||
$gesamt = sprintf('%.2f',$gesamt);
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($j==0){
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdint'},"$varenv->{cms}->{'iframe-no-data'}->{txt}"),"\n";
|
||||
}else{
|
||||
$sum = $lb->round($sum);
|
||||
$sum = sprintf('%.2f',$sum);
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdint', -colspan=>3},""),"\n";
|
||||
print $q->td({-class=>'tdint'},"$varenv->{cms}->{'iframe-total'}->{txt}"),"\n";
|
||||
print $q->td({-class=>'tdint'},$q->b("$sum €")),"\n";
|
||||
}
|
||||
print $q->end_table;
|
||||
print "</div>\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2',-style=>'padding:0.5em 0;'}, "$varenv->{cms}->{'iframe-no-bookings'}->{txt}"),"\n";
|
||||
}#end if $cttpos_count
|
||||
|
||||
my $i=0;
|
||||
my $dtext = "";
|
||||
print "<div style='clear:both;'>\n";
|
||||
foreach my $id (sort { $ctt_all->{$b}->{ct_name} cmp $ctt_all->{$a}->{ct_name} } keys(%$ctt_all)){
|
||||
|
||||
if( -f "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf" && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo){
|
||||
#print "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo<br />";
|
||||
$i++;
|
||||
my $invoice_time = $ctt_all->{$id}->{invoice_time} || $ctt_all->{$id}->{mtime};
|
||||
$invoice_time = $lb->time4de($invoice_time,0);
|
||||
#$varenv->{operator} only defined in sharee
|
||||
my $webtarget = "_blank";
|
||||
my $dtext = "";
|
||||
if($varenv->{syshost} =~ /app/){
|
||||
$webtarget = "_self";
|
||||
$dtext = "$varenv->{cms}->{'iframe-pdf-download-info'}->{txt}";
|
||||
}
|
||||
|
||||
if($i==1){
|
||||
print $q->div({-id=>'Rechnungen',-style=>'font-weight:bold;'},"$varenv->{cms}->{'iframe-your-invoice'}->{txt}"),"\n";
|
||||
print $q->div({-style=>'padding:0.5em 0;'},"$dtext"),"\n";
|
||||
}
|
||||
print $q->div({-style=>'padding:0.7em 0;border:0px solid #cccccc;'},$q->a({-href=>"$ctt_all->{$id}->{wwwhost}/FileOut?file=Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, $q->span({-class=>"bi bi-file-earmark-pdf"}), "$varenv->{cms}->{'iframe-invoice'}->{txt} $ctt_all->{$id}->{ct_name}.pdf"), " ($invoice_time)"),"\n";
|
||||
}
|
||||
|
||||
}
|
||||
print "</div>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
#------------------------------------------------------
|
||||
|
||||
my $label_des="* $des";
|
||||
my $autofocus="";
|
||||
if($key =~ /txt15|txt19/){
|
||||
|
@ -502,7 +279,7 @@ EOF
|
|||
if($key =~ /txt/ && $size eq "select" && $key eq "txt10"){
|
||||
my $country = $lb->country_code();
|
||||
my $country_all = $lb->country_code_all();
|
||||
$ctrel->{$key} = "DE" if(!$ctrel->{$key});
|
||||
$ctadr->{$key} = "DE" if(!$ctadr->{$key});
|
||||
my @_valxx = ();
|
||||
foreach (sort { $country->{$a} cmp $country->{$b} } keys (%$country)){
|
||||
push @_valxx, "$_:$country->{$_}";
|
||||
|
@ -512,39 +289,23 @@ EOF
|
|||
}
|
||||
|
||||
print $q->label({-for=>"$key",-style=>'padding-top:15px;'},"$label_des"),"\n";
|
||||
print $but->selector_class("$key","form-control","","$ctrel->{$key}",@_valxx);
|
||||
print $but->selector_class("$key","form-control","","$ctadr->{$key}",@_valxx);
|
||||
|
||||
}elsif($key =~ /txt/ && $size eq "select"){
|
||||
my @_valxx = split(/,/,$varenv->{$des});
|
||||
print $q->label({-for=>"$key",-style=>'padding-top:15px;'},"$label_des"),"\n";
|
||||
print $but->selector_class("$key","form-control","","$ctrel->{$key}",@_valxx);
|
||||
print $but->selector_class("$key","form-control","","$ctadr->{$key}",@_valxx);
|
||||
|
||||
#}elsif($key =~ /txt/ && !$R::confirm_success){
|
||||
}elsif($key =~ /txt/){
|
||||
my $required="required";
|
||||
|
||||
#start failure messages
|
||||
#Gutschein
|
||||
if($key =~ /txt16/ && $ctrel->{c_id}){
|
||||
if($R::failure =~ /^txt16/){
|
||||
$autofocus = "autofocus";
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-voucher-not-available'}->{txt}</span>";
|
||||
}
|
||||
elsif($R::failure =~ /conflict_txt16/){
|
||||
$autofocus = "autofocus";
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-voucher-deposit'}->{txt}</span>";
|
||||
}else{
|
||||
$required="";
|
||||
$label_des = "<span style='font-weight:normal;'>$des</span>";
|
||||
}
|
||||
}
|
||||
elsif($key eq "txt08" && $R::failure && $R::failure =~ /conflict_txt08/){
|
||||
if($key eq "txt08" && $R::failure && $R::failure =~ /conflict_txt08/){
|
||||
$autofocus = "autofocus";
|
||||
my ($failkey,$failval) = split(/=/,$R::failure);
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-attention-email-exist'}->{txt} $failval</span>";
|
||||
$ctrel->{$key} = $R::conflict_txt08;
|
||||
$ctadr->{$key} = $R::conflict_txt08;
|
||||
}
|
||||
elsif(($R::failure && $R::failure =~ /^$key/) || ($ctrel->{txt31} && $ctrel->{txt31} =~ /$key/)){
|
||||
elsif(($R::failure && $R::failure =~ /^$key/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /$key/)){
|
||||
$autofocus = "autofocus";
|
||||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>";
|
||||
|
@ -585,7 +346,7 @@ EOF
|
|||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-repeat-pw-failure'}->{txt}</span>";
|
||||
}
|
||||
my $pw = "xxxxxxxx";
|
||||
$pw = "" if(!$ctrel->{c_id});
|
||||
$pw = "" if(!$ctadr->{c_id});
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='password' class='form-control' name='$key' value='$pw' override $required $autofocus /><br />\n";
|
||||
print $q->label({-for=>"confirm_$key"},"* $varenv->{cms}->{'iframe-repeat-pw'}->{txt}"),"\n";
|
||||
|
@ -594,14 +355,14 @@ EOF
|
|||
}else{
|
||||
#all other input textfields
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='$ctrel->{$key}' override $required $autofocus />\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='$ctadr->{$key}' override $required $autofocus />\n";
|
||||
}
|
||||
}
|
||||
#end $key =~ /txt/
|
||||
|
||||
#all int checkboxes disabled because of AGB downunder
|
||||
elsif($key =~ /int/ && $size eq "checkbox"){
|
||||
if(($R::failure && $R::failure =~ /^$key/) || ($ctrel->{txt31} && $ctrel->{txt31} =~ /$key/)){
|
||||
if(($R::failure && $R::failure =~ /^$key/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /$key/)){
|
||||
$autofocus = "autofocus";
|
||||
$varenv->{cms}->{'iframe-please-confirm'}->{txt} =~ s/::value::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-please-confirm'}->{txt}</span>";
|
||||
|
@ -615,7 +376,7 @@ EOF
|
|||
my $sharee_agb = "<button type='button' class='btn btn-primary ' style='padding:1px 40px;border:1px solid #$bgcolor1;background-color:#$bgcolor1;' data-bs-toggle='modal' data-bs-target='#sharee_agb'>$des</button>\n";
|
||||
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:20px;'},"$label_des"),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctrel->{$key}","","$required","$autofocus"), " $sharee_agb"),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctadr->{$key}","","$required","$autofocus"), " $sharee_agb"),"\n";
|
||||
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
|
||||
|
||||
my $sharee_privacy = "<button type='button' class='btn btn-primary ' style='text-decoration:underline;color:#3f3f3f;border:1px solid white;background-color:white;' data-bs-toggle='modal' data-bs-target='#sharee_privacy'>$varenv->{cms}->{'iframe-form-privacy'}->{txt}</button>\n";
|
||||
|
@ -624,16 +385,16 @@ EOF
|
|||
|
||||
}elsif(1==2 && $key =~ /int02/){#newsletter
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:10px;'},""),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctrel->{$key}","","$required"), " $des"),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctadr->{$key}","","$required"), " $des"),"\n";
|
||||
print $q->hidden(-name=>"$key",-override=>1,-value=>"0");
|
||||
}else{
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:10px;'},""),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctrel->{$key}","","$required"), " $des"),"\n";
|
||||
print $q->div({-id=>"$key"},$but->checkbox("1","$key","$ctadr->{$key}","","$required"), " $des"),"\n";
|
||||
print $q->hidden(-name=>"$key",-override=>1,-value=>"0");
|
||||
}
|
||||
|
||||
}elsif($key =~ /int/){
|
||||
if(($R::failure && $R::failure =~ /^$key/) || ($ctrel->{txt31} && $ctrel->{txt31} =~ /$key/)){
|
||||
if(($R::failure && $R::failure =~ /^$key/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /$key/)){
|
||||
$autofocus = "autofocus";
|
||||
$varenv->{cms}->{'iframe-please-confirm'}->{txt} =~ s/::value::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-please-confirm'}->{txt}</span>";
|
||||
|
@ -649,40 +410,39 @@ EOF
|
|||
my $checked_prepaid = "";
|
||||
|
||||
foreach my $p_id (sort keys (%{ $dbt->{copri_conf}->{payment_type} })) {
|
||||
$checked_sepa = 1 if($ctrel->{$key} == 1);
|
||||
$checked_creditcard = 2 if($ctrel->{$key} == 2);
|
||||
$checked_prepaid = 3 if($ctrel->{$key} == 3);
|
||||
$checked_sepa = 1 if($ctadr->{$key} == 1);
|
||||
$checked_creditcard = 2 if($ctadr->{$key} == 2);
|
||||
$checked_prepaid = 3 if($ctadr->{$key} == 3);
|
||||
if($p_id == 1){
|
||||
print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$p_id","$checked_sepa",$q->img({-id=>"pic-payment" ,-style=>'height:50px;', -title=>"$dbt->{copri_conf}->{payment_type}->{$p_id}",-src=>"$varenv->{metahost}/img/payment-incasso2.png"}))),"\n";
|
||||
}elsif($p_id == 2){
|
||||
print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$p_id","$checked_creditcard",$q->img({-id=>"pic-payment" ,-style=>'height:25px;', -title=>"$dbt->{copri_conf}->{payment_type}->{$p_id}",-src=>"$varenv->{metahost}/img/payment-creditcard2.png"}))),"\n";
|
||||
}elsif($p_id == 3){
|
||||
print $q->div({ -class=>'radio', -style=>'padding-top:25px;' },$but->radiobox_vertical("$key","$p_id","$checked_prepaid","<span style='padding-left:25px;font-size:1.2em;'>Prepaid</span>")),"\n" if($ctrel->{c_id} && $dbt->{copri_conf}->{betau_id}->{$ctrel->{c_id}});#testing by contributors
|
||||
print $q->div({ -class=>'radio', -style=>'padding-top:25px;' },$but->radiobox_vertical("$key","$p_id","$checked_prepaid","<span style='padding-left:25px;font-size:1.2em;'>Prepaid</span>")),"\n" if($ctadr->{c_id} && $dbt->{copri_conf}->{betau_id}->{$ctadr->{c_id}});#testing by contributors
|
||||
}
|
||||
}
|
||||
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
|
||||
}
|
||||
}
|
||||
|
||||
if($key eq "txt16" && $ctrel->{c_id}){
|
||||
if($key eq "txt16" && $ctadr->{c_id}){
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='save_transact' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-save'}->{txt}</button>"),"\n";
|
||||
}
|
||||
|
||||
}#end foreach (@tpl_order)
|
||||
}
|
||||
|
||||
if(($R::failure && $R::failure =~ /\w+/ && $R::failure !~ /txt15|txt16/) || ($ctrel->{txt31} && $ctrel->{txt31} =~ /\w/)){
|
||||
if(($R::failure && $R::failure =~ /\w+/ && $R::failure !~ /txt15|txt16/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /\w/)){
|
||||
print $q->div({-class=>'content2', -style=>"color:$red"}, "* $varenv->{cms}->{'iframe-please-check-profile'}->{txt}"),"\n";
|
||||
}
|
||||
|
||||
if($path !~ /$varenv->{accounting_3}|$varenv->{profile}/){
|
||||
if($ctrel->{c_id}){
|
||||
if($ctadr->{c_id}){
|
||||
my $button_name = "$varenv->{cms}->{'iframe-save'}->{txt}";
|
||||
$button_name = "$varenv->{cms}->{'iframe-next'}->{txt}" if($path =~ /$varenv->{accounting_1_5}|$varenv->{accounting_2}/);
|
||||
print $q->hidden(-name=>"tinkc_id",-override=>1,-value=>"$ctrel->{c_id}");
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='save_account' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$button_name</button>"),"\n";
|
||||
if($path =~ /$varenv->{accounting_1}/){
|
||||
print $q->div({-style=>'margin-top:3em;text-align:center;'},$q->a({-style=>"color:#$bgcolor1;font-size:1.2em;", -role=>"button", -href=>"/$viewsel[0]/Account?sharee_edit=delete_account1$session_and"}, "$varenv->{cms}->{'iframe-ask-delete-account'}->{txt}")),"\n";
|
||||
print $q->div({-style=>'margin-top:3em;text-align:center;'},$q->a({-style=>"color:#$bgcolor1;font-size:1.2em;", -role=>"button", -href=>"$varenv->{wwwhost}/app/Account?sharee_edit=delete_account1$session_and"}, "$varenv->{cms}->{'iframe-ask-delete-account'}->{txt}")),"\n";
|
||||
}
|
||||
}else{
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='create_account' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-next'}->{txt}</button>"),"\n";
|
||||
|
|
111
copri4/shareeapp-operator/src/Tpl/PayoneLink.pm
Executable file
111
copri4/shareeapp-operator/src/Tpl/PayoneLink.pm
Executable file
|
@ -0,0 +1,111 @@
|
|||
package PayoneLink;
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use CGI ':standard';
|
||||
use Mod::Buttons;
|
||||
use Mod::Basework;
|
||||
use Mod::DBtank;
|
||||
use Mod::Prelib;
|
||||
use Mod::Pricing;
|
||||
use Mod::Payment;
|
||||
use Data::Dumper;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
bless($self,$class);
|
||||
return $self;
|
||||
}
|
||||
|
||||
#Template
|
||||
sub tpl(){
|
||||
my $self = shift;
|
||||
my $tpl_id = shift;
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift || "";
|
||||
my $varenv = shift;
|
||||
my $users_sharee = shift || "";
|
||||
my $feedb = shift || "";
|
||||
|
||||
my $q = new CGI;
|
||||
my $bw = new Basework;
|
||||
my $dbt = new DBtank;
|
||||
my $but = new Buttons;
|
||||
my $pl = new Prelib;
|
||||
my $pri = new Pricing;
|
||||
my $pay = new Payment;
|
||||
|
||||
$q->import_names('R');
|
||||
my @keywords = $q->param;
|
||||
my $dbh = "";
|
||||
my $bgcolor1 = "009899";#sharee
|
||||
$bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1});
|
||||
$bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1});
|
||||
my $aowner = "198";
|
||||
$aowner = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} if($varenv->{merchant_id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id});
|
||||
|
||||
|
||||
my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid;
|
||||
my $ctadr = { c_id => 0 };
|
||||
$ctadr = $users_sharee if(ref($users_sharee) eq "HASH" && $users_sharee->{c_id});
|
||||
my $payable_check=0;
|
||||
$payable_check = $bw->isuser_rentable($ctadr,$varenv);
|
||||
my $prepaidhash = {};
|
||||
$prepaidhash = $pri->collect_prepaid($dbh,$ctadr) if($ctadr->{c_id});
|
||||
if(!$prepaidhash->{prepaid_id} && $ctadr->{c_id}){
|
||||
$feedb = $pl->prepaid_request($dbh,$ctadr,$aowner);
|
||||
$prepaidhash = $pri->collect_prepaid($dbh,$ctadr);
|
||||
}
|
||||
my $ret_json = "";
|
||||
|
||||
print $q->start_form(),"\n";
|
||||
print $q->hidden(-name=>"sessionid",-override=>1,-value=>"$R::sessionid");
|
||||
|
||||
print "<div class='form-group' style='clear:both;'>\n";
|
||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-prepay-account'}->{txt}"),"\n";
|
||||
|
||||
if($prepaidhash->{prepaid_id}){
|
||||
#print $q->hidden(-name=>"prepaid_id",-override=>1,-value=>"$prepaidhash->{prepaid_id}");
|
||||
if($ctadr->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /generate_payonelink/){
|
||||
$ret_json = $pay->generate_payonelink($varenv,$ctadr,$prepaidhash,$R::prepaid_amount,$aowner);
|
||||
}
|
||||
$prepaidhash->{prepaid_total} = sprintf('%.2f',$prepaidhash->{prepaid_total});
|
||||
$prepaidhash->{prepaid_total} =~ s/\./,/;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/\n/<br \/>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::prepaid_total::/<b>$prepaidhash->{prepaid_total} €<\/b>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::app_name::/<b>$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{app_name}<\/b>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::prepaid_id::/<b>$prepaidhash->{prepaid_id}<\/b>/g;
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-prepay-prolog'}->{txt}"),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-failure-contact-hotline'}->{txt} $prepaidhash->{prepaid_id}"),"\n";
|
||||
}
|
||||
|
||||
if(!$ret_json || $ret_json =~ /failure/){
|
||||
my $required="required";
|
||||
print $q->div({-class=>'content2', -style=>'color:#c83434;'}, "$varenv->{cms}->{'iframe-prepay-failure'}->{txt}"),"\n" if($ret_json =~ /failure/);
|
||||
|
||||
my $label_des="$varenv->{cms}->{'iframe-prepay-input'}->{txt}";
|
||||
print $q->label({-for=>"prepaid_amount", -style=>'padding-top:1.5em;'},"$label_des"),"\n";
|
||||
print "<input id='prepaid_amount' type='text' class='form-control' name='prepaid_amount' override=1 value='0 €' $required />\n";
|
||||
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='generate_payonelink' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-next-prepay'}->{txt}</button>"),"\n";
|
||||
|
||||
}elsif($ret_json){
|
||||
#TODO payone-link mailing
|
||||
$varenv->{cms}->{'iframe-prepay-emailinfo'}->{txt} =~ s/::app_name::/<b>$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{app_name}<\/b>/g;
|
||||
print $q->div({-class=>'content2', -style=>'color:#009899;'}, "$varenv->{cms}->{'iframe-prepay-emailinfo'}->{txt}"),"\n";
|
||||
print $q->div({-class=>'content2'}, ""),"\n";
|
||||
print Dumper($ret_json) . "<br />\n";
|
||||
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print $q->end_form,"\n";
|
||||
|
||||
}
|
||||
1;
|
|
@ -11,8 +11,6 @@ use Mod::Buttons;
|
|||
use Mod::Basework;
|
||||
use Mod::Shareework;
|
||||
use Mod::DBtank;
|
||||
use Mod::Pricing;
|
||||
use Sys::Hostname;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
|
@ -35,7 +33,6 @@ sub tpl(){
|
|||
my $bw = new Basework;
|
||||
my $tk = new Shareework;
|
||||
my $dbt = new DBtank;
|
||||
my $pri = new Pricing;
|
||||
my $but = new Buttons;
|
||||
|
||||
$q->import_names('R');
|
||||
|
@ -55,13 +52,10 @@ sub tpl(){
|
|||
|
||||
print $q->start_form(),"\n";
|
||||
print $q->hidden(-name=>"sessionid",-override=>1,-value=>"$R::sessionid");
|
||||
print $q->hidden(-name=>"tinkc_id",-override=>1,-value=>"$ctadr->{c_id}");
|
||||
print $q->hidden(-name=>"request",-override=>1,-value=>"managemandate");
|
||||
|
||||
print "<div class='form-group' style='clear:both;'>\n";
|
||||
|
||||
#SEPA
|
||||
if($tpl_id == 309){
|
||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-bank-account'}->{txt}"),"\n";
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-sepa-mandat-prolog'}->{txt}"),"\n";
|
||||
#print $q->div({-class=>'content2'}, "Zur Validierung Ihrer Zahlungsdaten wird eine 1,- € Testbuchung vorgenommen. Wir werden nach erfolgreicher Abbuchung den Betrag als Mietgutschrift in Ihrem Account hinterlegen."),"\n";
|
||||
|
@ -82,6 +76,10 @@ sub tpl(){
|
|||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>";
|
||||
}
|
||||
if($R::failure eq "conflict_txt22" && $R::txt22){
|
||||
$varenv->{cms}->{'iframe-sepa-conflict'}->{txt} =~ s/::input::/$R::txt22/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-sepa-conflict'}->{txt}</span>";
|
||||
}
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' override=1 value='$ctadr->{$key}' placeholder='$des' $required />\n";
|
||||
|
||||
|
@ -91,7 +89,7 @@ sub tpl(){
|
|||
|
||||
#------------------------
|
||||
}elsif($key =~ /int03/ && $size eq "checkbox"){
|
||||
if(!$payable_check){
|
||||
if(!$payable_check || !-f "$varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf"){
|
||||
my $int03 = "";
|
||||
#$int03 = $ctadr->{$key} if($ctadr->{$key} == 1);
|
||||
print $q->div({-style=>'margin:10px 0;'},"$varenv->{cms}->{'iframe-sepa-mandat'}->{txt}"),"\n";
|
||||
|
@ -130,48 +128,6 @@ sub tpl(){
|
|||
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='save_account' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-next'}->{txt}</button>"),"\n";
|
||||
|
||||
}#end SEPA
|
||||
#prepay
|
||||
elsif($tpl_id == 313){
|
||||
|
||||
my $posref = {
|
||||
table => "contenttrans",
|
||||
table_pos => "contenttranspos",
|
||||
fetch => "all",
|
||||
keyfield => "c_id",
|
||||
ca_id => "$ctadr->{c_id}",
|
||||
'ct.state' => "is::null",
|
||||
'ct.int14' => "is::null",
|
||||
};
|
||||
my $cttpos = { c_id => 0 };
|
||||
$cttpos = $dbt->collect_post($dbh,$posref);
|
||||
#TODO negative counting booked operator invoices
|
||||
my $total_prepaid = 0;
|
||||
my $prepay_id = 0;
|
||||
foreach my $id (sort { $cttpos->{$b}->{c_id} <=> $cttpos->{$a}->{c_id} } keys(%$cttpos)){
|
||||
#print $cttpos->{$id}->{barcode} . ":" . $cttpos->{$id}->{int02},"<br>";
|
||||
if($cttpos->{$id}->{int02} > 0){
|
||||
$total_prepaid += $cttpos->{$id}->{int02};
|
||||
}
|
||||
if($cttpos->{$id}->{int02} == 0){
|
||||
$prepay_id = $cttpos->{$id}->{barcode};
|
||||
}
|
||||
}
|
||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-prepay-account'}->{txt}"),"\n";
|
||||
if(!$prepay_id){
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-failure-contact-hotline'}->{txt} $prepay_id"),"\n";
|
||||
}else{
|
||||
$total_prepaid = sprintf('%.2f',$total_prepaid);
|
||||
$total_prepaid =~ s/\./,/;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/\n/<br \/>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::total_prepaid::/<b>$total_prepaid €<\/b>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::app_name::/<b>$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{app_name}<\/b>/g;
|
||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::prepaid_id::/<b>$prepay_id<\/b>/g;
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-prepay-prolog'}->{txt}"),"\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print $q->end_form,"\n";
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ use CGI ':standard';
|
|||
use Tpl::AccountSubmenu;
|
||||
use Tpl::PayoneSEPA;
|
||||
use Tpl::PayoneCCclient;
|
||||
use Tpl::PayoneLink;
|
||||
|
||||
|
||||
sub new {
|
||||
|
@ -32,6 +33,7 @@ sub tpl(){
|
|||
my $submenu = new AccountSubmenu;
|
||||
my $payDebit = new PayoneSEPA;
|
||||
my $payCC = new PayoneCCclient;
|
||||
my $payLink = new PayoneLink;
|
||||
|
||||
print "<div id='Contentapp'>\n";
|
||||
|
||||
|
@ -44,7 +46,7 @@ sub tpl(){
|
|||
}elsif($users_sharee->{int03} == 2){
|
||||
$payCC->tpl("310",$node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
}elsif($users_sharee->{int03} == 3){
|
||||
$payDebit->tpl("313",$node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
$payLink->tpl("313",$node_meta,$users_dms,$varenv,$users_sharee,$feedb);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
375
copri4/shareeapp-operator/src/Tpl/RentalData.pm
Executable file
375
copri4/shareeapp-operator/src/Tpl/RentalData.pm
Executable file
|
@ -0,0 +1,375 @@
|
|||
package RentalData;
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use CGI ':standard';
|
||||
use Mod::Basework;
|
||||
use Mod::Libenz;
|
||||
use Mod::DBtank;
|
||||
use Mod::APIfunc;
|
||||
use Mod::Pricing;
|
||||
use Tpl::AccountSubmenu;
|
||||
use Data::Dumper;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
bless($self,$class);
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub tpl {
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift || "";
|
||||
my $varenv = shift;
|
||||
my $ctadr = shift || "";
|
||||
my $feedb = shift || "";
|
||||
|
||||
my $q = new CGI;
|
||||
my $bw = new Basework;
|
||||
my $lb = new Libenz;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
my $pri = new Pricing;
|
||||
my $submenu = new AccountSubmenu;
|
||||
my $path = $q->path_info();
|
||||
my $dbh = "";
|
||||
my $red = "red";
|
||||
|
||||
my $coo = $q->cookie(-name=>'domcookie') || $R::sessionid;
|
||||
my $session="";
|
||||
my $session_and="";
|
||||
if($R::sessionid && length($R::sessionid) > 20 && !$q->cookie(-name=>'domcookie')){
|
||||
$session = "?sessionid=$R::sessionid";
|
||||
$session_and = "&sessionid=$R::sessionid";
|
||||
}
|
||||
my $bgcolor1 = "009899";#sharee
|
||||
$bgcolor1 = $dbt->{website}->{$varenv->{syshost}}->{bgcolor1} if($dbt->{website}->{$varenv->{syshost}}->{bgcolor1});
|
||||
$bgcolor1 = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1} if($dbt->{merchant_ids}->{$varenv->{merchant_id}}->{bgcolor1});
|
||||
|
||||
my $tpl_id = $node_meta->{tpl_id};
|
||||
my $tpl = $dbt->get_tpl($dbh,$tpl_id);
|
||||
my @tpl_order = split /,/,$tpl->{tpl_order};
|
||||
|
||||
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctadr);
|
||||
my $cttpos_count=0;
|
||||
foreach my $id (keys(%$cttpos)){
|
||||
$cttpos_count++;
|
||||
}
|
||||
|
||||
#loop operator hash to get invoices for each operator
|
||||
my $ctt_all = {};
|
||||
my $ctadrcoupon = {};
|
||||
foreach my $sharee_operator (keys (%$operator_hash)){
|
||||
my $dbh_operator = $dbt->dbconnect_extern("$sharee_operator");
|
||||
my $pref = {
|
||||
table => "contenttrans",
|
||||
fetch => "all",
|
||||
int10 => "$ctadr->{c_id}",
|
||||
keyfield => "ct_name",
|
||||
ct_name => "~::[1-9]",
|
||||
};
|
||||
|
||||
|
||||
if($ctadr->{c_id}){
|
||||
my $ctt = $dbt->fetch_tablerecord($dbh_operator,$pref);
|
||||
foreach my $id (keys(%$ctt)){
|
||||
$ctt->{$id}->{wwwhost} = "$operator_hash->{$sharee_operator}";
|
||||
$ctt->{$id}->{operator} = "$sharee_operator";
|
||||
$ctt->{$id}->{basedir} = "$dbt->{copri_conf}->{basedir}/$dbt->{operator}->{$sharee_operator}->{dir_app}";
|
||||
}
|
||||
$ctt_all = { %$ctt_all, %$ctt };
|
||||
|
||||
my $prefcoupon = {
|
||||
table => "contentadr",
|
||||
fetch => "one",
|
||||
txt15 => "~::\\w",
|
||||
c_id => "$ctadr->{c_id}",
|
||||
};
|
||||
|
||||
$ctadrcoupon->{$sharee_operator} = $dbt->fetch_tablerecord($dbh_operator,$prefcoupon);
|
||||
$ctadrcoupon->{$sharee_operator}->{oprefix} = "$dbt->{operator}->{$sharee_operator}->{oprefix}";
|
||||
}
|
||||
}
|
||||
|
||||
my $project = "Freiburg";#defaults to sharee
|
||||
$project = $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{project} if($varenv->{merchant_id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{project});
|
||||
my $bonus_ak = "$varenv->{cms}->{'iframe-bonusnumber-accepted'}->{txt}";
|
||||
$bonus_ak = "$varenv->{cms}->{'iframe-activation-code-info'}->{txt}" if($project eq "Freiburg");
|
||||
|
||||
my $payable_check=0;
|
||||
$payable_check = $bw->isuser_rentable($ctadr,$varenv);
|
||||
|
||||
print "<div id='Contentapp'>\n";
|
||||
|
||||
#subMenue--------
|
||||
$submenu->tpl($node_meta,$users_dms,$varenv,$ctadr,$feedb);
|
||||
#-----------------
|
||||
|
||||
my $debug=0;
|
||||
$debug=1 if($ctadr->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
||||
my $debug_message = "";
|
||||
my $catch_failure=0;
|
||||
if(($R::failure && $R::failure =~ /\w+/) || ($ctadr->{txt31} && $ctadr->{txt31} =~ /\w/)){
|
||||
$debug_message = "($R::failure || $ctadr->{txt31})" if($debug);
|
||||
$catch_failure=1;
|
||||
print $q->div({-class=>'content2', -style=>"clear:both;color:$red"}, "* $varenv->{cms}->{'iframe-one-error'}->{txt} $debug_message"),"\n";
|
||||
}
|
||||
|
||||
#confirm code manage
|
||||
if($catch_failure && (!$ctadr->{int04} && !$ctadr->{int13}) && ($tpl_id =~ /^2$|302004/) && ($path =~ /$varenv->{accounting_3}/)){
|
||||
$debug_message = "$catch_failure && (!$ctadr->{int04} || !$ctadr->{int13}) && $tpl_id" if($debug);
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-complete-confirmation'}->{txt} $debug_message"),"\n";
|
||||
}elsif((!$ctadr->{int04} || !$ctadr->{int13}) && ($tpl_id =~ /^2$|302004/) && ($path =~ /$varenv->{accounting_3}/)){
|
||||
|
||||
print $q->start_form(-name=>'accountscreen', -action=>"/$varenv->{mandant}/Account/$varenv->{accounting_3}$session"),"\n";
|
||||
print $q->hidden(-name=>"sessionid",-override=>1,-value=>"$R::sessionid");
|
||||
my $required = "";
|
||||
$debug_message = "(!$ctadr->{int04} || !$ctadr->{int13}) && $tpl_id" if($debug);
|
||||
print $q->div({-class=>'content_title3',-style=>'clear:both;'}, "$varenv->{cms}->{'iframe-almost-done'}->{txt} $debug_message"),"\n";
|
||||
my $acktext = "$varenv->{cms}->{'iframe-confirmation-codes-sent'}->{txt}";
|
||||
$acktext = "$varenv->{cms}->{'iframe-sms-confirmation-code-sent'}->{txt}" if($ctadr->{int04} && !$ctadr->{int13});
|
||||
$acktext = "$varenv->{cms}->{'iframe-email-confirmation-code-sent'}->{txt}" if(!$ctadr->{int04} && $ctadr->{int13});
|
||||
print $q->div({-class=>'content2'}, "$acktext $varenv->{cms}->{'iframe-successful-confirmation'}->{txt}"),"\n";
|
||||
if(!$ctadr->{int04}){
|
||||
my $des = "$varenv->{cms}->{'iframe-email-code'}->{txt}";
|
||||
my $key = "confirm_code";
|
||||
my $label_des="* $des";
|
||||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>" if($R::failure);
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='' $required autofocus/>\n";
|
||||
print $q->div({-class=>'content2'}, " $varenv->{cms}->{'iframe-if-email-code-not-received'}->{txt}",$q->a({-style=>"color:#$bgcolor1;",-href=>"$varenv->{wwwhost}?sharee_edit=send_email$session_and"},"$varenv->{cms}->{'iframe-request-email-code'}->{txt}")),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2', -style=>'color:gray;'}, "* $varenv->{cms}->{'iframe-email-code-already-entered'}->{txt}"),"\n";
|
||||
}
|
||||
if(!$ctadr->{int13}){
|
||||
my $des = "$varenv->{cms}->{'iframe-sms-code'}->{txt}";
|
||||
my $key = "confirm_smscode";
|
||||
my $label_des="* $des";
|
||||
$varenv->{cms}->{'iframe-correct-input'}->{txt} =~ s/::input::/$des/;
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-correct-input'}->{txt}</span>" if($R::failure);
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='' $required autofocus />\n";
|
||||
#print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-if-sms-code-not-received'}->{txt} ",$q->a({-style=>"color:#$bgcolor1;",-href=>"$varenv->{wwwhost}?sharee_edit=send_sms$session_and"},"$varenv->{cms}->{'iframe-request-sms-code'}->{txt}")),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2', -style=>'color:gray;'}, "* $varenv->{cms}->{'iframe-sms-code-already-entered'}->{txt}"),"\n";
|
||||
}
|
||||
|
||||
my $button_name = "$varenv->{cms}->{'iframe-next'}->{txt}";
|
||||
print $q->div({-style=>'margin-top:2em;text-align:center;'},"<button type='submit' name='confirm_userid' value='$ctadr->{c_id}' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$button_name</button>"),"\n";
|
||||
print $q->end_form,"\n";
|
||||
|
||||
}#end confirm code manage
|
||||
else{
|
||||
|
||||
|
||||
print $q->start_form(-name=>'accountscreen', -action=>"/$varenv->{mandant}/Account/$varenv->{accounting_3}$session"),"\n";
|
||||
print $q->hidden(-name=>"sessionid",-override=>1,-value=>"$R::sessionid");
|
||||
|
||||
if($R::confirm_success){
|
||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-registration-confirmed'}->{txt}"),"\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{$tpl->{tpl_name}}->{txt}"),"\n";
|
||||
}
|
||||
|
||||
my $scol = "itime";
|
||||
foreach (@tpl_order){
|
||||
my ($key,$des,$size) = split /=/,$_;
|
||||
$ctadr->{$key} = $q->unescapeHTML("$ctadr->{$key}");
|
||||
$ctadr->{$key} = $lb->newline($ctadr->{$key},"","1");
|
||||
|
||||
#$des = "$tpl_id.$key" if($debug);
|
||||
$des = $varenv->{cms}->{"iframe-form-$tpl_id.$key"}->{txt} if($varenv->{cms}->{"iframe-form-$tpl_id.$key"}->{txt});
|
||||
|
||||
if($key =~ /ct_name/){
|
||||
if($ctadr->{int12}){
|
||||
print $q->div({-class=>'content2', -style=>'color:#c83434;'}, "$varenv->{cms}->{'iframe-block-rental-access'}->{txt}"),"\n";
|
||||
}elsif($R::confirm_success){
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-success-welcome'}->{txt}"),"\n";
|
||||
}else{
|
||||
#print $q->div({-class=>'content2'}, ""),"\n";
|
||||
}
|
||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-invoice-note'}->{txt}"),"\n";
|
||||
print $q->div({-class=>'content2'}, "$bonus_ak"),"\n" if($R::success && $R::success eq "txt15");
|
||||
|
||||
}elsif($key =~ /barcode/){
|
||||
|
||||
if($cttpos_count){
|
||||
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"$varenv->{cms}->{'iframe-items-for-debit'}->{txt}"),"\n";
|
||||
|
||||
my @tpl_posorder = ("txt01=$varenv->{cms}->{'iframe-description'}->{txt}","int04=$varenv->{cms}->{'iframe-station'}->{txt}","ct_name=$varenv->{cms}->{'iframe-bike-nr'}->{txt}","int26=CO2","int02=$varenv->{cms}->{'iframe-amount'}->{txt}");
|
||||
|
||||
my $j=0;
|
||||
my $nx=0;
|
||||
my $sum = 0;
|
||||
print "<div style='clear:both;'>\n";
|
||||
print $q->start_table({-style=>'margin:15px 0;', -border=>'0', -width=>'auto',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
|
||||
print $q->Tr(),"\n";
|
||||
|
||||
foreach my $id (sort { lc($cttpos->{$b}->{$scol}) cmp lc($cttpos->{$a}->{$scol}) } keys(%$cttpos)){
|
||||
$j++;
|
||||
$nx++;
|
||||
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
($pricing,$counting) = $pri->counting_rental($varenv,$cttpos->{$id});
|
||||
}
|
||||
|
||||
print $q->Tr(),"\n";
|
||||
foreach (@tpl_posorder){
|
||||
my ($key,$val) = split /=/,$_;
|
||||
|
||||
my $occupied_style = "background-color:#fcfdfb;";
|
||||
$occupied_style = "background-color:#f4f1ee;" if($nx %= 2);
|
||||
#$occupied_style = "color:#ff1493;" if($cttpos->{$id}->{txt10} =~ /occupied|requested/);
|
||||
$occupied_style = "color:#ff1493;" if($cttpos->{$id}->{int10} == 2 || $cttpos->{$id}->{int10} == 3);
|
||||
|
||||
if($key eq "txt01"){
|
||||
#print $q->td({-class=>'tdtxt', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
print "<td class='tdtxt' style='$occupied_style'>\n";
|
||||
if($cttpos->{$id}->{txt01}){
|
||||
$cttpos->{$id}->{$key} =~ s/\<br \/\>/; /g;
|
||||
print "$cttpos->{$id}->{$key}<br />\n";
|
||||
}
|
||||
if($pricing->{start_time} && $pricing->{end_time}){
|
||||
$pricing->{start_time} = $lb->time4de($pricing->{start_time},"1");
|
||||
$pricing->{end_time} = $lb->time4de($pricing->{end_time},"1");
|
||||
my $rental_time = "";
|
||||
$rental_time = "";#"(rental debug: $pricing->{real_clock} $pricing->{freed_time})";
|
||||
print $q->span("→ $pricing->{start_time}<br />← $pricing->{end_time} $rental_time");
|
||||
}
|
||||
print "</td>\n";
|
||||
}elsif($key =~ /int04/){
|
||||
if($cttpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
#print $q->td({-class=>'tdint', -style=>"$occupied_style"},"Station $cttpos->{$id}->{$key}");
|
||||
print "<td class='tdtxt' style='$occupied_style'>\n";
|
||||
my $return_station = "";
|
||||
$return_station = "← $cttpos->{$id}->{txt13}$cttpos->{$id}->{int04}" if($cttpos->{$id}->{txt13} && $cttpos->{$id}->{int04});
|
||||
print $q->span("$varenv->{cms}->{'iframe-station'}->{txt}<br />→ $cttpos->{$id}->{txt12}$cttpos->{$id}->{int06}<br />$return_station");
|
||||
print "</td>\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
}
|
||||
}elsif($key =~ /ct_name/){
|
||||
if($cttpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$varenv->{cms}->{'iframe-bike'}->{txt}<br />$cttpos->{$id}->{$key}"),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}
|
||||
}elsif($key eq "int26"){
|
||||
my $co2saving = "";
|
||||
if($cttpos->{$id}->{int26}){
|
||||
$co2saving = "$varenv->{cms}->{'iframe-saving'}->{txt}</br>";
|
||||
my $co2diff = $pri->co2calc($cttpos->{$id});
|
||||
#my $sprit_price = $pri->sprit2calc($cttpos->{$id});
|
||||
$co2saving .= "$co2diff kg CO²<br />";
|
||||
#$co2saving .= "$sprit_price EUR<br />" if($sprit_price !~ /-/);
|
||||
$cttpos->{$id}->{int26} =~ s/\./,/;
|
||||
$co2saving .= "bei $cttpos->{$id}->{int26} KM";
|
||||
}
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$co2saving"),"\n";
|
||||
}elsif($key eq "int02"){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
my $gesamt = 0;
|
||||
$sum += $pricing->{total_price};
|
||||
$gesamt = $lb->round($pricing->{total_price});
|
||||
$gesamt = sprintf('%.2f', $gesamt);
|
||||
$gesamt =~ s/\./,/;
|
||||
my $rabatt = "";
|
||||
$rabatt = "$pricing->{discount}" if($pricing->{discount});
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
||||
}else{
|
||||
my $gesamt = 0;
|
||||
my $rabatt = "";
|
||||
($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum += $gesamt;
|
||||
$gesamt = $lb->round($gesamt);
|
||||
$gesamt = sprintf('%.2f',$gesamt);
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($j==0){
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdint'},"$varenv->{cms}->{'iframe-no-data'}->{txt}"),"\n";
|
||||
}else{
|
||||
$sum = $lb->round($sum);
|
||||
$sum = sprintf('%.2f',$sum);
|
||||
print $q->Tr(),"\n";
|
||||
print $q->td({-class=>'tdint', -colspan=>3},""),"\n";
|
||||
print $q->td({-class=>'tdint'},"$varenv->{cms}->{'iframe-total'}->{txt}"),"\n";
|
||||
print $q->td({-class=>'tdint'},$q->b("$sum €")),"\n";
|
||||
}
|
||||
print $q->end_table;
|
||||
print "</div>\n";
|
||||
}else{
|
||||
print $q->div({-class=>'content2',-style=>'padding:0.5em 0;'}, "$varenv->{cms}->{'iframe-no-bookings'}->{txt}"),"\n";
|
||||
}#end if $cttpos_count
|
||||
|
||||
my $i=0;
|
||||
my $dtext = "";
|
||||
print "<div style='clear:both;'>\n";
|
||||
foreach my $id (sort { $ctt_all->{$b}->{ct_name} cmp $ctt_all->{$a}->{ct_name} } keys(%$ctt_all)){
|
||||
|
||||
if( -f "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf" && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo){
|
||||
#print "$ctt_all->{$id}->{basedir}/pdfinvoice/Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf && $ctt_all->{$id}->{ct_name} =~ /\d/ && $coo<br />";
|
||||
$i++;
|
||||
my $invoice_time = $ctt_all->{$id}->{invoice_time} || $ctt_all->{$id}->{mtime};
|
||||
$invoice_time = $lb->time4de($invoice_time,0);
|
||||
#$varenv->{operator} only defined in sharee
|
||||
my $webtarget = "_blank";
|
||||
my $dtext = "";
|
||||
if($varenv->{syshost} =~ /app/){
|
||||
$webtarget = "_self";
|
||||
$dtext = "$varenv->{cms}->{'iframe-pdf-download-info'}->{txt}";
|
||||
}
|
||||
|
||||
if($i==1){
|
||||
print $q->div({-id=>'Rechnungen',-style=>'font-weight:bold;'},"$varenv->{cms}->{'iframe-your-invoice'}->{txt}"),"\n";
|
||||
print $q->div({-style=>'padding:0.5em 0;'},"$dtext"),"\n";
|
||||
}
|
||||
print $q->div({-style=>'padding:0.7em 0;border:0px solid #cccccc;'},$q->a({-href=>"$ctt_all->{$id}->{wwwhost}/FileOut?file=Rechnung-$ctt_all->{$id}->{operator}-$ctt_all->{$id}->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, $q->span({-class=>"bi bi-file-earmark-pdf"}), "$varenv->{cms}->{'iframe-invoice'}->{txt} $ctt_all->{$id}->{ct_name}.pdf"), " ($invoice_time)"),"\n";
|
||||
}
|
||||
|
||||
}
|
||||
print "</div>\n";
|
||||
}
|
||||
#Gutschein
|
||||
elsif($key =~ /txt16/ && $ctadr->{c_id}){
|
||||
my $autofocus = "";
|
||||
my $label_des="$des";
|
||||
if($R::failure =~ /^txt16/){
|
||||
$autofocus = "autofocus";
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-voucher-not-available'}->{txt}</span>";
|
||||
}
|
||||
elsif($R::failure =~ /conflict_txt16/){
|
||||
$autofocus = "autofocus";
|
||||
$label_des = "<span style=color:$red>$varenv->{cms}->{'iframe-voucher-deposit'}->{txt}</span>";
|
||||
}else{
|
||||
$label_des = "<span style='font-weight:normal;'>$des</span>";
|
||||
}
|
||||
print $q->label({-for=>"$key", -style=>'padding-top:1.5em;'},"$label_des"),"\n";
|
||||
print "<input id='$key' type='text' class='form-control' name='$key' value='$ctadr->{$key}' override $autofocus />\n";
|
||||
}
|
||||
}
|
||||
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='sharee_edit' value='save_account' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-save'}->{txt}</button>"),"\n";
|
||||
|
||||
print $q->div({-class=>'content2', -style=>'margin-top:2em;'}, "$varenv->{cms}->{'iframe-registration-contact-hotline'}->{txt}"),"\n";
|
||||
|
||||
print "</div>\n";
|
||||
print $q->end_form,"\n";
|
||||
}
|
||||
|
||||
print $q->div({-style=>'position:fixed;bottom:2%;right:2%;z-index:10;font-size:13px;'},"--> $varenv->{syshost} | $varenv->{merchant_id} | $bgcolor1 | template -> $node_meta->{tpl_name},$tpl_id"),"\n" if($ctadr->{c_id} eq $dbt->{copri_conf}->{superu_id} || $dbt->{copri_conf}->{stage} eq "test");
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
1;
|
Loading…
Add table
Add a link
Reference in a new issue