mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-21 11:16:29 +01:00
Refactoring user registration payment methodes
This commit is contained in:
parent
dc89bed086
commit
da31898968
28 changed files with 974 additions and 2750 deletions
|
@ -1902,7 +1902,7 @@ sub bikes_available(){
|
|||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
$return->{$id}->{aa_ride} = "0";
|
||||
$return->{$id}->{aa_ride} = "1" if($record_st->{$record->{$id}->{int04}}->{int42});
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
$return->{$id}->{uri_operator} = "$dbt->{operator}->{$varenv->{dbname}}->{operatorApp}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
$return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}";
|
||||
|
||||
|
@ -2084,7 +2084,7 @@ sub bikes_all(){
|
|||
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
|
||||
if(1==1){
|
||||
$bikes_on_station->{$record->{$id}->{int04}}->{bike_ist} += 1;
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
$return->{$id}->{uri_operator} = "$dbt->{operator}->{$varenv->{dbname}}->{operatorApp}";
|
||||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
$return->{$id}->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{barcode}";
|
||||
|
@ -2302,7 +2302,7 @@ sub stations_available(){
|
|||
$return->{$id}->{capacity} = "$record->{$id}->{int05}" || "1";
|
||||
|
||||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
$return->{$id}->{uri_operator} = "$dbt->{operator}->{$varenv->{dbname}}->{operatorApp}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
|
@ -2497,7 +2497,7 @@ sub stations_all(){
|
|||
}
|
||||
}
|
||||
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
$return->{$id}->{uri_operator} = "$dbt->{operator}->{$varenv->{dbname}}->{operatorApp}";
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
if($record->{$id}->{description}){
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
|
@ -2940,6 +2940,16 @@ sub auth_verify(){
|
|||
$update_primary->{txt26} = $q->escapeHTML($user_agent) if($user_agent);
|
||||
}
|
||||
|
||||
#check prepaid account
|
||||
if($auth_primary->{int03} == 3){
|
||||
my $prepaidhash = { prepaid_total => 0 };
|
||||
$prepaidhash = $pri->collect_prepaid($dbh_primary,$auth_primary) if($auth_primary->{c_id});
|
||||
if(!$prepaidhash->{prepaid_total} || $prepaidhash->{prepaid_total} < 0){
|
||||
my $vde = $auth_primary->{int12} || 1;
|
||||
$update_primary->{int12} = $vde;
|
||||
}
|
||||
}
|
||||
|
||||
my $rows = $dbt->update_record($dbh_primary,$update_primary,$auth_primary);
|
||||
$auth_primary = $dbt->fetch_record($dbh_primary,$authref);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ my $response = {
|
|||
apiserver => "$apiserver",
|
||||
response => "$respreq",
|
||||
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
||||
copri_version => "4.1.23.22",
|
||||
copri_version => "4.1.23.23",
|
||||
user_id => "",
|
||||
authcookie => "",
|
||||
new_authcoo => "0",
|
||||
|
|
|
@ -171,6 +171,7 @@ sub handler {
|
|||
#update adr also on primary
|
||||
my $dbh_primary = $dbt->dbconnect($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
$dbt->update_record($dbh_primary,$update_adr,$ctadr);
|
||||
print FILE Dumper($update_adr) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,13 +47,17 @@ sub handler {
|
|||
my $debug=1;
|
||||
my $user_agent = $q->user_agent();
|
||||
my $dbh = "";
|
||||
|
||||
$bw->log("APIvelo POST:\n--> user-agent: '$user_agent' to syshost: $varenv{syshost}\n",$q,"");
|
||||
my %headers = map { $_ => $q->http($_) } $q->http();
|
||||
#$bw->log("APIvelo POST:\n--> user-agent: '$user_agent' to syshost: $varenv{syshost}\n",$q,"");
|
||||
|
||||
print $q->header(-type => "application/json", -charset => "utf-8", -'Access-Control-Allow-Origin' => "*");
|
||||
|
||||
open(FILE,">>$varenv{logdir}/APIvelo.log") if($debug);
|
||||
print FILE "\n*** $now_dt user-agent: '$user_agent' to syshost: $varenv{syshost}\n" if($debug);
|
||||
#print FILE "headers:" . Dumper(%headers) . "\n";
|
||||
for my $header ( keys %headers ) {
|
||||
print FILE "$header: $headers{$header}\n";
|
||||
}
|
||||
print FILE "<=== veloDUMP\n " . Dumper($q) . "\n" if($debug);
|
||||
print FILE "<=== DUMP postdata:\n " . Dumper($q->param('POSTDATA')) . "\n" if($debug);
|
||||
|
||||
|
@ -68,7 +72,7 @@ eval {
|
|||
#- int30=velofactur station ID
|
||||
#- int31=velofactur slot ID
|
||||
|
||||
my $jrout = $json->pretty->encode({ fakturjson => $response_in });
|
||||
my $jrout = $json->pretty->encode($response_in);
|
||||
print FILE "<=== JSON POST from velofactur:\n$jrout\n" if($debug);
|
||||
|
||||
my $record_cc = { c_id => 0 };
|
||||
|
@ -118,7 +122,7 @@ eval {
|
|||
#$update_cc->{int29} = 1;
|
||||
}
|
||||
|
||||
$rows = $dbt->update_record($dbh_operator,$update_cc,$record_cc);
|
||||
#$rows = $dbt->update_record($dbh_operator,$update_cc,$record_cc);
|
||||
$bw->log("velofactur updates dbname: $sharee_operator, c_id=$record_cc->{c_id} by fakturjson $response_in->{Typ} | rows:$rows",$update_cc,"");
|
||||
print FILE "---> velofactur updates dbname: $sharee_operator, c_id=$record_cc->{c_id} by fakturjson $response_in->{Typ} | rows:$rows\n" . Dumper($update_cc) . "\n" if($debug);
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ sub isuser_rentable {
|
|||
my $varenv = shift;
|
||||
|
||||
my $rentable_check=0;
|
||||
if($auth->{int03} && $auth->{ct_name} && ($auth->{int03} == 1 && $auth->{ct_name} =~ /\w{2}-\d+/) || ($auth->{int03} == 2 && length($auth->{ct_name}) >= 19) || ($auth->{int03} == 3 && $auth->{ct_name} =~ /Prepay-\d+/i)){
|
||||
if($auth->{int03} && $auth->{ct_name} && ($auth->{int03} == 1 && $auth->{ct_name} =~ /\w{2}-\d+/) || ($auth->{int03} == 2 && length($auth->{ct_name}) >= 19) || ($auth->{int03} == 3 && $auth->{ct_name} =~ /Prepaid-\d+/i)){
|
||||
$rentable_check=1;
|
||||
if($auth->{txt08} && $auth->{int04} == 1 && $auth->{int13} == 1 && !$auth->{int12} && $auth->{int14}){
|
||||
$rentable_check=2;#if 2 then everything should be alright. rental is enabled
|
||||
|
|
|
@ -429,27 +429,47 @@ sub collect_node {
|
|||
return ($nodes,$rows);
|
||||
}
|
||||
|
||||
#only used by dead_relation
|
||||
sub collect_relation {
|
||||
#collect main_ids
|
||||
sub collect_noderec {
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $where = shift || "1=1";
|
||||
my $main_id = shift;
|
||||
|
||||
my $sth = $dbh->prepare("SELECT * FROM relation where $where");
|
||||
my $rc = $sth->execute();
|
||||
my $rel = $sth->fetchall_hashref("rel_id");
|
||||
return $rel;
|
||||
my $main_ids = "$main_id,";
|
||||
my ($main_collect,$rows) = $self->collect_node($dbh,$main_id);
|
||||
if(ref($main_collect) eq "HASH"){
|
||||
foreach my $id (keys (%$main_collect)){
|
||||
if($main_collect->{$id}->{node_name}){
|
||||
$main_ids .= "$main_collect->{$id}->{main_id},";
|
||||
my ($main_collect2,$rows) = $self->collect_node($dbh,$main_collect->{$id}->{main_id}) if($main_collect->{$id}->{main_id});
|
||||
if(ref($main_collect2) eq "HASH"){
|
||||
foreach my $id (keys (%$main_collect2)){
|
||||
$main_ids .= "$main_collect2->{$id}->{main_id},";
|
||||
my ($main_collect3,$rows) = $self->collect_node($dbh,$main_collect2->{$id}->{main_id}) if($main_collect2->{$id}->{main_id});
|
||||
if(ref($main_collect3) eq "HASH"){
|
||||
foreach my $id (keys (%$main_collect3)){
|
||||
$main_ids .= "$main_collect3->{$id}->{main_id},";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$main_ids =~ s/,$//;
|
||||
return $main_ids;
|
||||
}
|
||||
|
||||
#not used
|
||||
sub collect_relct {
|
||||
#collect relation nodes
|
||||
sub collect_rel4nodes(){
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $ref = shift;
|
||||
my $sth = $dbh->prepare("SELECT * FROM relation rel, $ref->{table} c where rel.content_id > 0 and rel.template_id=224 and rel.content_id=c.c_id order by rel.content_id");
|
||||
my $main_ids = shift;
|
||||
|
||||
my $sth = $dbh->prepare("SELECT * FROM relation rel, nodes nd where rel.main_id=nd.main_id and parent_id IN ($main_ids)");
|
||||
my $rc = $sth->execute();
|
||||
my $rel = $sth->fetchall_hashref("rel_id");
|
||||
return $rel;
|
||||
my $rel4nd = $sth->fetchall_hashref("rel_id");
|
||||
return $rel4nd;
|
||||
}
|
||||
|
||||
# Nodes einer Ebene mit relation
|
||||
|
@ -582,21 +602,6 @@ sub fetch_rel4tpl4nd(){
|
|||
return $rel;
|
||||
}
|
||||
|
||||
#azn time worktime from Von Bis
|
||||
sub select_worktime {
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $fetch = shift;
|
||||
|
||||
my $sql = "SELECT $fetch->{end_at} - $fetch->{start_at} AS worktime FROM $fetch->{table} where ct_id = $fetch->{ct_id} and barcode = $fetch->{barcode} and $fetch->{end_at} is not null and $fetch->{start_at} is not null";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
my $record = $sth->fetchrow_hashref();
|
||||
$bw->log("DBtank select_worktime: ",$sql,"") if($debug);
|
||||
|
||||
return $record;
|
||||
}
|
||||
|
||||
#all accounting position of contenttrans
|
||||
sub collect_contenttrans(){
|
||||
my $self = shift;
|
||||
|
@ -1190,6 +1195,28 @@ sub delete_content(){
|
|||
return $rows;
|
||||
}
|
||||
|
||||
#collect content with contenttranspos
|
||||
sub collect_postime(){
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $table = shift;
|
||||
my $start_date_time = shift;
|
||||
my $end_date_time = shift;
|
||||
my $start_date2 = shift || "";
|
||||
my $end_date2 = shift || "";
|
||||
|
||||
$start_date_time =~ s/,/./g;
|
||||
$end_date_time =~ s/,/./g;
|
||||
my $where = "where cp.cc_id=c.c_id";
|
||||
$where .= " and cp.start_time >= $start_date_time";
|
||||
$where .= " and cp.end_time <= $end_date_time";
|
||||
$where .= " and (cp.start_time >= '$start_date2' OR cp.end_time >= '$start_date2')" if($start_date2 && $end_date2);
|
||||
my $sth = $dbh->prepare("SELECT cp.* from content c, $table cp $where order by cp.end_time");
|
||||
my $rc = $sth->execute();
|
||||
my $ct = $sth->fetchall_hashref("cc_id");
|
||||
return $ct;
|
||||
}
|
||||
|
||||
|
||||
#collect contenttranspos with contenttrans
|
||||
sub collect_transpos {
|
||||
|
@ -1563,7 +1590,7 @@ sub insert_pos(){
|
|||
if($ct->{template_id} && $ct->{template_id} == 205){#Leihrad_list
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,txt12,itime,start_time,end_time,int01,int02,int03,int06,txt05,txt06,txt07,int10,int12,template_id,int13,owner,int07,txt04,int09,int17,int15,int11,int18,int19,txt17,txt18,int20,int25,int29,int34,txt22,txt11,int35,int36,int37,int42,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}','$prefix',now(),now(),'$endRental','1','$unit_price','$menge','$start_station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$from_template_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$daymax_price','$abo_price','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','1','$trackon','$bike_type_id','$staff','$sig_book->{bikeId}','$sig_book->{rentalId}','$unit_price1','$unit_price2','$start_price','$aa_station','$unit_time','$free_time') RETURNING c_id");
|
||||
}else{
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int01,int02,int03,txt01,int10,int12,int16,template_id,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$user_name','$ctadr->{txt09}',now(),'1','$unit_price','1','$ct->{txt01}','0','$from_main_id','$fibumark','$from_template_id','$owner') RETURNING c_id");
|
||||
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,itime,int01,int02,int03,txt01,int10,int12,int16,template_id,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$user_name',now(),'1','$unit_price','1','$ct->{txt01}','0','$from_main_id','$fibumark','$from_template_id','$owner') RETURNING c_id");
|
||||
}
|
||||
my $rows = $sth->execute();
|
||||
my $last_id;
|
||||
|
@ -1675,7 +1702,7 @@ sub evaluationsfragen {
|
|||
}
|
||||
|
||||
#search table content.
|
||||
sub search_content(){
|
||||
sub search_content {
|
||||
my $self = shift;
|
||||
my $dbh = shift || $dbh_intern;
|
||||
my $searchref = shift;
|
||||
|
@ -1683,14 +1710,12 @@ sub search_content(){
|
|||
my $users_dms = shift;
|
||||
my $main_ids = shift || 0;
|
||||
my $tplids = shift || 0;
|
||||
my $ct_ids = shift || 0;
|
||||
my $v_journal = shift || "";
|
||||
my $ck4ex = shift || "";
|
||||
|
||||
my $table = $node_meta->{ct_table};
|
||||
$main_ids =~ s/,$//;
|
||||
$tplids =~ s/,$//;
|
||||
$ct_ids =~ s/,$//;
|
||||
$ck4ex =~ s/\s/,/g;
|
||||
$ck4ex =~ s/,$//;
|
||||
|
||||
|
@ -1706,12 +1731,11 @@ sub search_content(){
|
|||
my $debug=0;
|
||||
$debug=1;
|
||||
open(FILE,">>$varenv{logdir}/Liste3.log") if($debug);
|
||||
print FILE "*** $stamp_time Libenzdb.search_content3 ***\n" if($debug);
|
||||
print FILE "*** $stamp_time search_content3 ***\n" if($debug);
|
||||
print FILE Dumper($searchref) if($debug);
|
||||
print FILE "$table,$node_meta->{node_name},$owner,$sort_updown,$main_ids,$tplids,$ct_ids,$v_journal,$ck4ex\n" if($debug);
|
||||
print FILE "$table,$node_meta->{node_name},$owner,$sort_updown,$main_ids,$tplids,$v_journal,$ck4ex\n" if($debug);
|
||||
close(FILE) if($debug);
|
||||
|
||||
|
||||
my $table_pos = $searchref->{table_pos} || "";
|
||||
my $txt_where;
|
||||
my $cptxt_where;
|
||||
|
@ -1726,23 +1750,22 @@ sub search_content(){
|
|||
$opref->{$key} = "=";
|
||||
($opref->{$key}, $valref->{$key}) = split(/::/, $searchref->{$key}) if($searchref->{$key} =~ /::/);
|
||||
if($key =~ /table_pos/){
|
||||
$table_pos = $valref->{$key};
|
||||
$table_pos = $valref->{$key};
|
||||
}
|
||||
if($key =~ /c_id|int\d+|barcode|time|sort|owner/){
|
||||
$searchref->{$key} =~ s/,/./g;
|
||||
if($searchref->{$key} =~ /(\<\=|\>\=|\<|\>|\=)/){
|
||||
$opref->{$key} = $1;
|
||||
$opref->{$key} = $1;
|
||||
}
|
||||
if($searchref->{$key} =~ /([-0-9\.]+)/){
|
||||
$valref->{$key} = $1;
|
||||
$valref->{$key} = $1;
|
||||
}
|
||||
if($searchref->{$key} =~ /null/){
|
||||
$opref->{$key} = "is";
|
||||
$opref->{$key} = "is";
|
||||
}
|
||||
chomp($valref->{$key});
|
||||
}
|
||||
$valref->{$key} = $q->escapeHTML($valref->{$key});
|
||||
#print $key . ":" . $opref->{$key} . ":" . $valref->{$key} . "\n";
|
||||
|
||||
if($table_pos =~ /contentpos|contentadrpos|users/){
|
||||
if($key =~ /ct_name/){
|
||||
|
@ -1756,46 +1779,36 @@ sub search_content(){
|
|||
if($key eq "ct_name" && $valref->{$key} =~ /^\d+$/){
|
||||
$txt_where .= " and (ct.$key ilike '$valref->{$key}' OR ct.barcode $opref->{$key} $valref->{$key})";
|
||||
}elsif($key eq "ct_name"){
|
||||
$txt_where .= " and ct.$key ilike '$valref->{$key}%'";
|
||||
$txt_where .= " and ct.$key ilike '$valref->{$key}%'";
|
||||
}elsif($key =~ /_id|barcode|int\d+|sort|owner/ && (looks_like_number($valref->{$key}) || $valref->{$key} =~ /null|0/)){
|
||||
$txt_where .= " and ct.$key $opref->{$key} $valref->{$key}";
|
||||
}elsif($key =~ /txt|uri/){
|
||||
$txt_where .= " and ct.$key ilike '%$valref->{$key}%'";
|
||||
}elsif($key eq "state"){
|
||||
#searchs also order_state
|
||||
$txt_where .= " and (ct.state ilike '%$valref->{$key}%' OR ct.txt22 ilike '%$valref->{$key}%')";
|
||||
$txt_where .= " and (ct.state ilike '%$valref->{$key}%' OR ct.txt22 ilike '%$valref->{$key}%')";
|
||||
}elsif($key =~ /byte/){
|
||||
$txt_where .= " and ct.$key = '\\x$valref->{$key}'";
|
||||
}
|
||||
|
||||
#sum pos doesn't work anymore
|
||||
#if($key =~ /int01/ && $table eq "contenttrans" && looks_like_number($valref->{$key})){
|
||||
#$cpgroup_where .= " group by cp.ct_id HAVING sum(cp.int02) $opref->{$key} $valref->{$key}";
|
||||
#}
|
||||
}
|
||||
|
||||
#if($key =~ /end_/ && $key =~ /time$/){
|
||||
#$valref->{$key} .= " 23:59" if($valref->{$key} !~ /\d:\d/);
|
||||
#}
|
||||
|
||||
|
||||
if(!$v_journal){
|
||||
if($table_pos =~ /contentpos|contentadrpos|users/ && $key =~ /mtime/ && $valref->{$key} =~ /\d+\.\d+\.\d+/){
|
||||
$cptxt_where .= " and cp.mtime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$cptxt_where .= " and cp.mtime < '$valref->{$key}'" if($key =~ /end/);
|
||||
$cptxt_where .= " and cp.mtime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$cptxt_where .= " and cp.mtime < '$valref->{$key}'" if($key =~ /end/);
|
||||
}
|
||||
elsif($table_pos =~ /contentpos|contentadrpos|users/ && $key eq "template_id_pos" && $valref->{$key}){
|
||||
$cptxt_where .= " and cp.template_id = $valref->{$key}";
|
||||
$cptxt_where .= " and cp.template_id = $valref->{$key}";
|
||||
}
|
||||
elsif($key =~ /mtime/ && $valref->{$key} =~ /\d+\.\d+\.\d+/){
|
||||
$txt_where .= " and ct.mtime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$txt_where .= " and ct.mtime < '$valref->{$key}'" if($key =~ /end/);
|
||||
$txt_where .= " and ct.mtime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$txt_where .= " and ct.mtime < '$valref->{$key}'" if($key =~ /end/);
|
||||
}
|
||||
|
||||
}elsif($v_journal){
|
||||
if($key =~ /itime/ && $valref->{$key} =~ /\d+\.\d+\.\d+/){
|
||||
$txt_where .= " and ct.itime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$txt_where .= " and ct.itime < '$valref->{$key}'" if($key =~ /end/);
|
||||
$txt_where .= " and ct.itime >= '$valref->{$key}'" if($key =~ /start/);
|
||||
$txt_where .= " and ct.itime < '$valref->{$key}'" if($key =~ /end/);
|
||||
}
|
||||
if($key =~ /start_mtime/ && $valref->{$key} =~ /^\d+$/){
|
||||
$txt_where .= " and ct.int11 = '$valref->{$key}'";#int11 = c_id-abschluss key
|
||||
|
@ -1822,7 +1835,6 @@ sub search_content(){
|
|||
}
|
||||
}
|
||||
}#
|
||||
|
||||
if($v_journal =~ /Tagesbericht/){
|
||||
$txt_where .= " and (ct.state ~ '[a-z]') and ct.int01 is not null and ct.close_time is null";
|
||||
$txt_where .= " and ct.int14 is $opos" if($opos eq "null");
|
||||
|
@ -1838,10 +1850,6 @@ sub search_content(){
|
|||
$sth = $dbh->prepare("SELECT cp.* FROM contenttranspos cp WHERE cp.ct_id IN (SELECT ct.c_id FROM relation rel, contenttrans ct WHERE rel.content_id=ct.c_id and rel.main_id IN ($main_ids) and rel.template_id IN ($tplids) $txt_where) $cptxt_where ORDER BY cp.$cp_scol $updown");
|
||||
}elsif($valref->{long_rent} || $valref->{start_date_time} =~ /^\d+\.\d+\.\d+/ || $valref->{end_date_time} =~ /^\d+\.\d+\.\d+/ || $cpgroup_where){
|
||||
$sth = $dbh->prepare("SELECT * FROM relation rel, $table ct WHERE rel.content_id=ct.c_id and rel.main_id IN ($main_ids) and rel.template_id IN ($tplids) $txt_where and c_id IN (SELECT cp.ct_id from contenttranspos cp WHERE 1=1 $cptxt_where $cpgroup_where) ORDER BY $scol $updown LIMIT $limit OFFSET $offset");
|
||||
}elsif($v_journal && $ct_ids){#and executes ct_ids
|
||||
$ct_ids = 0 if(!$ct_ids);
|
||||
$sth = $dbh->prepare("SELECT * FROM relation rel, $table ct WHERE rel.content_id=ct.c_id and rel.main_id IN ($main_ids) and rel.template_id IN ($tplids) and rel.content_id IN ($ct_ids) $txt_where ORDER BY $scol $updown LIMIT $limit OFFSET $offset");
|
||||
|
||||
}elsif($table_pos && $table_pos eq "contentpos"){
|
||||
$sth = $dbh->prepare("SELECT cp.* FROM contentpos cp WHERE cp.cc_id IN (SELECT ct.c_id FROM relation rel, content ct WHERE rel.content_id=ct.c_id and rel.main_id IN ($main_ids) and rel.template_id IN ($tplids) $txt_where) $cptxt_where ORDER BY cp.$scol $updown LIMIT $limit OFFSET $offset");
|
||||
}elsif($table_pos && $table_pos eq "contentadrpos"){
|
||||
|
@ -1856,7 +1864,6 @@ sub search_content(){
|
|||
}else{
|
||||
$sth = $dbh->prepare("SELECT * FROM relation rel, $table ct WHERE rel.content_id=ct.c_id and rel.main_id IN ($main_ids) and rel.template_id IN ($tplids) $txt_where ORDER BY $scol $updown LIMIT $limit OFFSET $offset");
|
||||
}
|
||||
|
||||
my $rc = $sth->execute();
|
||||
my $s_id = "c_id";
|
||||
$s_id = "u_id" if($table_pos && $table_pos eq "users");
|
||||
|
|
|
@ -38,7 +38,7 @@ sub handler {
|
|||
my $cf = new Config;
|
||||
my $ml = new Mlogic;
|
||||
my $bw = new Basework;
|
||||
my $tk = new Shareework;
|
||||
my $shwo = new Shareework;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
my $but = new Buttons;
|
||||
|
@ -195,8 +195,8 @@ sub handler {
|
|||
$apif->authout($q,$coo);
|
||||
|
||||
#create_account. 2. inserts contentadr
|
||||
my $tinkc_id = $tk->create_account($aowner);
|
||||
($returnwww,$feedb) = $tk->save_account($q,$tinkc_id,\%varenv,$aowner);
|
||||
my $shareec_id = $shwo->create_account($aowner);
|
||||
($returnwww,$feedb) = $shwo->save_account($q,$shareec_id,\%varenv,$aowner);
|
||||
|
||||
#Like login_sharee, redundant
|
||||
my $hw_id = unpack ('H*', pack('Nc', time, $$ % 0xff));#old $co
|
||||
|
@ -218,8 +218,8 @@ sub handler {
|
|||
|
||||
#if user-pw authorized, then ignore conflict_ because it matches exist user-data
|
||||
#should be result to Uhps page
|
||||
if($tinkc_id && $returnwww && $returnwww =~ /conflict_txt07|conflict_txt08/){
|
||||
$return = $tk->delete_account($tinkc_id,$users_dms->{u_id});
|
||||
if($shareec_id && $returnwww && $returnwww =~ /conflict_txt07|conflict_txt08/){
|
||||
$return = $shwo->delete_account($shareec_id,$users_dms->{u_id});
|
||||
$apif->authout($q,$coo) if($coo);
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Anmelden?conflict_failure=1");
|
||||
exit 0;
|
||||
|
@ -353,9 +353,9 @@ sub handler {
|
|||
my $delete_key = "delete_adr";
|
||||
$feedb->{message} = "failure::Datensatz wirklich löschen. ::?base_edit=$delete_key\&exit_box2=1\&c_id=$R::c_id ::löschen";
|
||||
}elsif($R::c_id && $R::base_edit eq "delete_adr"){
|
||||
$return = $tk->delete_account($R::c_id,$users_dms->{u_id});
|
||||
$return = $shwo->delete_account($R::c_id,$users_dms->{u_id});
|
||||
}elsif($R::c_id && $R::base_edit eq "save_adr"){
|
||||
($returnwww,$feedb) = $tk->save_account($q,$R::c_id,\%varenv,$users_dms->{u_id});
|
||||
($returnwww,$feedb) = $shwo->save_account($q,$R::c_id,\%varenv,$users_dms->{u_id});
|
||||
}
|
||||
}else{
|
||||
$feedb->{message} = "failure::Abbruch. Schreibender Zugriff \"Kunden Stammdaten\" verweigert.";
|
||||
|
@ -540,12 +540,15 @@ sub handler {
|
|||
|
||||
#save_account. 3. updates contentadr
|
||||
if($users_sharee->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /save_account/){
|
||||
($returnwww,$feedb) = $tk->save_account($q,$users_sharee->{c_id},\%varenv,$aowner);
|
||||
($returnwww,$feedb) = $shwo->save_account($q,$users_sharee->{c_id},\%varenv,$aowner);
|
||||
}
|
||||
|
||||
if($users_sharee->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /save_transact/){
|
||||
$returnwww = $tk->save_transact($q,$users_sharee->{c_id},$coo,$aowner);
|
||||
$returnwww = $shwo->save_transact($q,$users_sharee->{c_id},$coo,$aowner);
|
||||
}
|
||||
#we do it in PayoneLink.pm
|
||||
#if($users_sharee->{c_id} && $R::sharee_edit && $R::sharee_edit =~ /generate_payonelink/){
|
||||
# $returnwww = $pay->generate_payonelink($q,\%varenv,$users_sharee,$R::prepaid_id,$R::prepaid_amount,$aowner);
|
||||
#}
|
||||
|
||||
if($returnwww && $returnwww =~ /failure::(.*)/){
|
||||
$returnwww =~ s/::/=/g;
|
||||
|
@ -554,10 +557,8 @@ sub handler {
|
|||
if($returnwww =~ /txt22|txt23/){
|
||||
#should be result to Uhps page
|
||||
if($returnwww =~ /conflict_txt22/){
|
||||
$return = $tk->delete_account($users_sharee->{c_id},$users_dms->{u_id});
|
||||
$apif->authout($q,$coo) if($coo);
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Anmelden?conflict_failure=1$session_and");
|
||||
exit 0;
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_2}?cum=1\&conflict_failure=1$session_and\&$returnwww");
|
||||
exit 0;
|
||||
}
|
||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_2}?cum=1$session_and\&$returnwww");
|
||||
}elsif($returnwww =~ /int03/){
|
||||
|
@ -586,7 +587,6 @@ sub handler {
|
|||
print FILE "$_=$val\n";
|
||||
$payone_return .= "$_=$val\n";# if($_ =~ /error|message/i);
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
my $update_adr = {
|
||||
table => "contentadr",
|
||||
|
@ -637,10 +637,10 @@ sub handler {
|
|||
#int12=0 should be set after capture success in payment module
|
||||
|
||||
if(($users_sharee->{int04} != 1) && ($users_sharee->{txt08} =~ /\w\@\w/)){
|
||||
$tk->emailack(\%varenv,$users_sharee->{c_id});
|
||||
$shwo->emailack(\%varenv,$users_sharee->{c_id});
|
||||
}
|
||||
if(($users_sharee->{int13} != 1) && ($users_sharee->{txt07} =~ /\d{9}/ && length($users_sharee->{txt07}) <= 16)){
|
||||
$tk->smsack($users_sharee);
|
||||
$shwo->smsack($users_sharee);
|
||||
}
|
||||
close(FILE) if($debug);
|
||||
}else{
|
||||
|
@ -657,6 +657,9 @@ sub handler {
|
|||
$dbt->update_record($dbh,$update_adr,$users_sharee) if($users_sharee->{c_id} > 0);
|
||||
$dbt->update_operatorsloop($varenv{dbname},$users_sharee->{c_id},"update");
|
||||
}
|
||||
|
||||
print FILE Dumper($update_adr) . "\n" if($debug);
|
||||
close(FILE);
|
||||
}#end payone response with pseudocardpan
|
||||
}
|
||||
|
||||
|
@ -668,10 +671,10 @@ sub handler {
|
|||
print FILE "trigger confirm-code request by $R::sharee_edit\n" if($debug);
|
||||
|
||||
if(($users_sharee->{int04} != 1 && $R::sharee_edit =~ /send_email/) && ($users_sharee->{txt08} =~ /\w\@\w/)){
|
||||
$tk->emailack(\%varenv,$users_sharee->{c_id});
|
||||
$shwo->emailack(\%varenv,$users_sharee->{c_id});
|
||||
}
|
||||
if(($users_sharee->{int13} != 1 && $R::sharee_edit =~ /send_sms/) && ($users_sharee->{txt07} =~ /\d{9}/ && length($users_sharee->{txt07}) <= 16)){
|
||||
$tk->smsack($users_sharee);
|
||||
$shwo->smsack($users_sharee);
|
||||
}
|
||||
close(FILE) if($debug);
|
||||
}#send confirm code
|
||||
|
@ -771,7 +774,7 @@ sub handler {
|
|||
|
||||
if($R::email && $R::sharee_edit =~ /password_forgotten/){
|
||||
my $hw_id = unpack ('H*', pack('Nc', time, $$ % 0xff));#old $co
|
||||
$tk->send_password(\%varenv,$R::email,$hw_id,$aowner);
|
||||
$shwo->send_password(\%varenv,$R::email,$hw_id,$aowner);
|
||||
}
|
||||
|
||||
#redirections
|
||||
|
|
|
@ -18,7 +18,6 @@ use CGI::Carp qw(fatalsToBrowser);
|
|||
use Calendar::Simple;
|
||||
use Date::Calc qw(:all);
|
||||
use Mod::Callib;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::Buttons;
|
||||
use Lib::Config;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
|
@ -26,7 +25,6 @@ use Scalar::Util qw(looks_like_number);
|
|||
my $cf = new Config;
|
||||
my $cb = new Callib;
|
||||
my $but = new Buttons;
|
||||
my $db = new Libenzdb;
|
||||
my $q = new CGI;
|
||||
|
||||
#my $pi = new Image::Magick;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,6 @@ use CGI::Carp qw(fatalsToBrowser);
|
|||
use Scalar::Util qw(looks_like_number);
|
||||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
|
||||
sub new {
|
||||
|
@ -32,7 +31,6 @@ sub mobox(){
|
|||
my $q = new CGI;
|
||||
my $cf = new Config;
|
||||
my $but = new Buttons;
|
||||
my $db = new Libenzdb;
|
||||
my $dbt = new DBtank;
|
||||
$q->import_names('R');
|
||||
my @keywords = $q->param;
|
||||
|
|
|
@ -3,20 +3,19 @@ package Payment;
|
|||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
#Adapted from Prelogic Rechnung "buchen" and "print_pdf"
|
||||
#Adapted from payone_post.pl
|
||||
#
|
||||
#enable for syntax check
|
||||
#use lib "/var/www/copri-bike/shareedms-primary/src";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use CGI; # only for debugging
|
||||
use CGI;
|
||||
use Digest::SHA qw(hmac_sha256_base64);
|
||||
use JSON;
|
||||
my $json = JSON->new->allow_nonref;
|
||||
use LWP::UserAgent;
|
||||
use URI::Encode;
|
||||
my $uri_encode = URI::Encode->new( { encode_reserved => 1 } );
|
||||
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use Lib::Config;
|
||||
use Mod::Callib;
|
||||
|
@ -921,7 +920,6 @@ sub rpc {
|
|||
}
|
||||
print FILE "payone RPC end\n\n" if($debug);
|
||||
|
||||
close(FILE) if($debug);
|
||||
#set contentadr owner and mtime only if vde or payone-return will be set by payone id's
|
||||
if((($update_adr->{int12} && $update_adr->{int12} > 0) || $update_adr->{txt28}) && ($owner == 178 || $owner == 179)){
|
||||
$update_adr->{owner} = "$owner";
|
||||
|
@ -930,12 +928,15 @@ sub rpc {
|
|||
|
||||
if($ctadr->{c_id} > 0){
|
||||
$dbt->update_record($dbh,$update_adr,$ctadr);
|
||||
print FILE Dumper($update_adr) . "\n" if($debug);
|
||||
#2023-04-11 set it global by update adr also on primary
|
||||
#disabled, because isuser_rentable will be only used by operator rental
|
||||
#my $dbh_primary = $dbt->dbconnect($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
#$dbt->update_record($dbh_primary,$update_adr,$ctadr);
|
||||
}
|
||||
$dbt->update_record($dbh,$update_ctt,$ctt) if($ctt->{c_id} > 0);
|
||||
|
||||
close(FILE) if($debug);
|
||||
return $payoneret;
|
||||
}
|
||||
|
||||
|
@ -1020,23 +1021,12 @@ sub payone_capture {
|
|||
return $return_text;
|
||||
}
|
||||
|
||||
my $state = $ctt->{state};
|
||||
if($dbt->{shareedms_conf}->{payment_state}){
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
if($ctadr->{ct_name} =~ /\w{2}-\d+/){
|
||||
$state = "$_paymentstate[0]";
|
||||
}else{
|
||||
undef $_paymentstate[0];
|
||||
}
|
||||
if(length($ctadr->{ct_name}) >= 19){
|
||||
$state = "$_paymentstate[1]";
|
||||
}else{
|
||||
undef $_paymentstate[1];
|
||||
}
|
||||
}
|
||||
|
||||
my $state = $ctt->{state} || "";
|
||||
my $p_hash = $dbt->{shareedms_conf}->{payment_state2};
|
||||
$state = $p_hash->{1} if($ctadr->{ct_name} =~ /\w{2}-\d+/);
|
||||
$state = $p_hash->{2} if(length($ctadr->{ct_name}) >= 19);
|
||||
$update_ctt->{state} = "$state";
|
||||
$dbt->update_record($dbh,$update_ctt,$ctt);
|
||||
$dbt->update_record($dbh,$update_ctt,$ctt) if($update_ctt->{state});
|
||||
|
||||
#in cron we set OPOS anyway. If payone captured, it will be set int14=null
|
||||
if(!$state || $state !~ /payone/){
|
||||
|
@ -1101,6 +1091,138 @@ sub payone_capture {
|
|||
return ($retval,$return_text);
|
||||
}
|
||||
|
||||
#Request "payone-link"
|
||||
sub generate_payonelink {
|
||||
my $self = shift;
|
||||
my $varenv = shift;
|
||||
my $ctadr = shift;
|
||||
my $prepaidhash = shift || {};
|
||||
my $prepaid_amount = shift || 0;
|
||||
my $owner = shift || 0;
|
||||
|
||||
my $payonelink_conf = $dbt->{payonelink_conf} || {};
|
||||
my $ret_json = {};
|
||||
my $response_in = {};
|
||||
my $dbh = "";
|
||||
|
||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
open(FILE,">>$varenv->{logdir}/payonelink.log");
|
||||
print FILE "\n*** $now_dt 'generate_payonelink' ctadr:$ctadr->{c_id}|$ctadr->{txt08}\n";
|
||||
|
||||
my $prepaid_amount2 = 0;
|
||||
$prepaid_amount2 = $1 if($prepaid_amount =~ /^(\d+)/);
|
||||
|
||||
if($ctadr->{c_id} && $prepaidhash->{prepaid_id} && $prepaid_amount2 >= 5){
|
||||
|
||||
my $lastname = $ctadr->{txt01};
|
||||
(my $firstname,$lastname) = split(/\s+/,$ctadr->{txt01}) if($ctadr->{txt01} =~ /\w\s+\w/i);
|
||||
chomp($firstname);
|
||||
chomp($lastname);
|
||||
my $city = $ctadr->{txt06};
|
||||
(my $zip, $city) = split(/\s+/,$ctadr->{txt06}) if($ctadr->{txt06} =~ /[\w\d]\s+[\w\d]/i);
|
||||
chomp($zip);
|
||||
chomp($city);
|
||||
|
||||
my $currency = "EUR";
|
||||
my $amount = 0;
|
||||
$amount = $prepaid_amount2 * 100 if($prepaid_amount2);
|
||||
my $pay_request = {
|
||||
intent => 'authorization',
|
||||
active => 1,
|
||||
paymentMethods => ['visa', 'mastercard', 'paypal', 'sofort', 'paydirekt', 'giropay', 'sepa'],
|
||||
userId => "$ctadr->{c_id}",
|
||||
email => "$ctadr->{txt08}",
|
||||
firstName => "$firstname",
|
||||
lastName => "$lastname",
|
||||
country => "$ctadr->{txt10}",
|
||||
language => "de_DE",
|
||||
reference => "$prepaidhash->{prepaid_id}",
|
||||
shoppingCart => [{
|
||||
type => "prepaid",
|
||||
number => "$prepaidhash->{number}",
|
||||
price => $amount,
|
||||
quantity => 1,
|
||||
description => "$prepaidhash->{description}",
|
||||
vatRate => 19
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
my $datahash = $payonelink_conf->{merchantId} . $payonelink_conf->{accountId} . $payonelink_conf->{portalId} . $payonelink_conf->{mode} . $prepaidhash->{prepaid_id} . $amount . $currency;
|
||||
|
||||
my $paytoken = hmac_sha256_base64($datahash, $payonelink_conf->{portalKey});
|
||||
|
||||
#my $whole_json = { %$payonelink_conf, %$pay_request};
|
||||
#my $rest_json = encode_json($whole_json);
|
||||
my $rest_json = encode_json(\%{ $pay_request });
|
||||
|
||||
print FILE "rest_json:\n" . Dumper($rest_json) . "\n";
|
||||
|
||||
($ret_json, my $ret_status) = $self->rpc_postjson($paytoken,$rest_json);
|
||||
eval {
|
||||
$response_in = decode_json($ret_json);
|
||||
print FILE "<--- payonelink response_in with status_line: $ret_status\n" . Dumper($response_in);
|
||||
print FILE $ret_json . "\n";
|
||||
|
||||
#expecting something like this:
|
||||
#return "https://onelink.pay1.de/p/YNEVNS4N1N5JXTFLYPMQJ5PVADEEZ0UL?lang=de_DE";
|
||||
};
|
||||
if ($@){
|
||||
print FILE "<--- failure payonelink raw response_in with status_line: $ret_status\n" . Dumper($ret_json) . "\n";
|
||||
#warn $@;
|
||||
print FILE "warn:" . $@ . "\n";
|
||||
}
|
||||
|
||||
}else{
|
||||
$ret_json = "failure:: $ctadr->{c_id} && $prepaidhash->{prepaid_id} && $prepaid_amount2 >= 5";
|
||||
}
|
||||
|
||||
close FILE;
|
||||
return $ret_json;
|
||||
}#end Request "send_payone_link"
|
||||
|
||||
#JSON POST to onelink
|
||||
sub rpc_postjson {
|
||||
my $self = shift;
|
||||
my $paytoken = shift;
|
||||
my $rest_json = shift || "";
|
||||
|
||||
my $api_file = "/var/www/copri4/shareeconf/apikeys.cfg";
|
||||
my $aconf = Config::General->new($api_file);
|
||||
my %apikeyconf = $aconf->getall;
|
||||
|
||||
my $ua = LWP::UserAgent->new(
|
||||
ssl_opts => {
|
||||
SSL_version => 'TLSv12:!SSLv2:!SSLv3:!TLSv1:!TLSv11',
|
||||
}
|
||||
);
|
||||
|
||||
$ua->agent("sharee payone jsonPOST API");
|
||||
my $bytes = 100000;
|
||||
$ua->max_size( $bytes );
|
||||
$ua->default_header( 'Authorization' => "payone-hmac-sha256 $paytoken" );
|
||||
print Dumper($ua);
|
||||
|
||||
#local TEST
|
||||
my $endpoint = "https://shareeapp-fr01.copri-bike.de/APIvelo";
|
||||
#my $endpoint = "https://onelink.pay1.de/api/v1/payment-links/";
|
||||
|
||||
my $req = HTTP::Request->new(POST => "$endpoint");
|
||||
$req->content_type('application/json');
|
||||
$req->content($rest_json);
|
||||
my $res = $ua->request($req);
|
||||
|
||||
if ($res->is_success) {
|
||||
#print $res->content;
|
||||
#print $res->status_line, "\n";
|
||||
return ($res->content, $res->status_line);
|
||||
}else {
|
||||
#print $res->status_line, "\n";
|
||||
return ("", $res->status_line);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ my $debug=1;
|
|||
sub prepaid_request {
|
||||
my $self = shift;
|
||||
my $dbh = shift;
|
||||
my $ctadr = shift;
|
||||
my $ctadr = shift || {};
|
||||
my $owner = shift;
|
||||
|
||||
my $feedb = {
|
||||
|
@ -61,6 +61,7 @@ sub prepaid_request {
|
|||
message => "",
|
||||
};
|
||||
|
||||
if($ctadr->{c_id}){
|
||||
my $pref_ctt = {
|
||||
table => "contenttrans",
|
||||
fetch => "one",
|
||||
|
@ -76,6 +77,13 @@ sub prepaid_request {
|
|||
my $ct_id = $dbt->insert_contenttrans($dbh,$ctadr,"300023","219","----","$owner");
|
||||
$pref_ctt->{c_id} = $ct_id;
|
||||
$ctt_prepaid = $dbt->fetch_record($dbh,$pref_ctt) if($pref_ctt->{c_id});
|
||||
my $update_adr = {
|
||||
table => "contentadr",
|
||||
mtime => "now()",
|
||||
owner => "$owner",
|
||||
c_id => "$ctadr->{c_id}",
|
||||
};
|
||||
$dbt->update_one($dbh,$update_adr,"ct_name='Prepaid-$ctt_prepaid->{c_id}'");
|
||||
}
|
||||
|
||||
my $pos_id = 0;
|
||||
|
@ -107,13 +115,14 @@ sub prepaid_request {
|
|||
|
||||
$cttpos->{c_id} = $dbt->insert_pos($dbh,$ctt_prepaid->{c_id},$ct,"",$ctadr,"","","","0",$owner,"");
|
||||
$dbt->update_one($dbh,{table => 'contenttranspos',c_id => $cttpos->{c_id}},"barcode = $cttpos->{c_id},ct_name = '$cttpos->{c_id}'");
|
||||
$feedb->{prepaid_id} = $ctt_prepaid->{c_id} . "-" . $cttpos->{c_id};
|
||||
}
|
||||
}
|
||||
|
||||
$feedb->{prepaid_account} = $ctt_prepaid->{c_id};
|
||||
$feedb->{prepaid_id} = $cttpos->{c_id};
|
||||
$feedb->{prepaid_account} = $ctt_prepaid->{c_id};
|
||||
}
|
||||
}
|
||||
return $feedb;
|
||||
}
|
||||
}#end prepaid_request
|
||||
|
||||
#select rentals for messaging user if bike > 12h ... occupied
|
||||
sub longterm_occupied {
|
||||
|
@ -612,13 +621,10 @@ sub insert_contenttranspos {
|
|||
my $cc_part = { c_id => 0 };
|
||||
$cc_part = $dbt->fetch_record($dbh,$pref_cc) if($R::c_id || $R::json_select);
|
||||
|
||||
my $pref_adr = {
|
||||
table => "contentadr",
|
||||
fetch => "one",
|
||||
c_id => "$ctt->{int10}",
|
||||
my $ctadr = {
|
||||
c_id => $ctt->{int10},
|
||||
txt01 => $ctt->{txt01},
|
||||
};
|
||||
my $ctadr = { c_id => 0 };
|
||||
$ctadr = $dbt->fetch_tablerecord($dbh,$pref_adr) if($ctt->{int10});
|
||||
|
||||
if($cc_part->{c_id}){
|
||||
$cc_part->{int02} = "0" if(!$cc_part->{int02});
|
||||
|
|
|
@ -44,6 +44,52 @@ sub round(){
|
|||
return $rounded;
|
||||
}
|
||||
|
||||
#collect prepaid
|
||||
sub collect_prepaid {
|
||||
my $self = shift;
|
||||
my $dbh = shift;
|
||||
my $ctadr = shift || {};
|
||||
|
||||
my $prepaidhash = {
|
||||
prepaid_total => 0,
|
||||
prepaid_id => 0,
|
||||
};
|
||||
|
||||
if($ctadr->{c_id}){
|
||||
my $posref = {
|
||||
table => "contenttrans",
|
||||
table_pos => "contenttranspos",
|
||||
fetch => "all",
|
||||
keyfield => "c_id",
|
||||
ca_id => "$ctadr->{c_id}",
|
||||
'ct.state' => "is::null",
|
||||
'ct.close_time' => "is::null",
|
||||
};
|
||||
my $cttpos = { c_id => 0 };
|
||||
$cttpos = $dbt->collect_post($dbh,$posref);
|
||||
#TODO negative counting booked operator invoices
|
||||
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}->{barcode} && $cttpos->{$id}->{int02} == 0){
|
||||
$prepaidhash->{prepaid_id} = $cttpos->{$id}->{ct_id} . "-" . $cttpos->{$id}->{c_id};
|
||||
$prepaidhash->{number} = $cttpos->{$id}->{c_id};
|
||||
$prepaidhash->{description} = $cttpos->{$id}->{txt01};
|
||||
}
|
||||
#if($cttpos->{$id}->{barcode} && $cttpos->{$id}->{int02} > 0){
|
||||
# $prepaidhash->{prepay_id_payed} = $cttpos->{$id}->{int02};
|
||||
#}
|
||||
if($cttpos->{$id}->{int02} > 0){
|
||||
$prepaidhash->{prepaid_total} += $cttpos->{$id}->{int02};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$bw->log("Pricing prepaidhash:",$prepaidhash,"");
|
||||
return $prepaidhash;
|
||||
}
|
||||
|
||||
|
||||
#for one freed rental
|
||||
#depends on operator, only 1 rental get freed_time
|
||||
sub count_freedrental {
|
||||
|
|
|
@ -560,11 +560,11 @@ sub save_account(){
|
|||
print FILE "account_check iban:$iban, c_id:$account_check->{c_id} && $account_check->{c_id} != $c_id\n" if($debug);
|
||||
if($account_check->{c_id} && $account_check->{c_id} != $c_id){
|
||||
my $encoded_val = $uri_encode->encode($iban);
|
||||
$ret_conflict = "failure::conflict_txt22=$encoded_val#top";
|
||||
}
|
||||
$ret_conflict = "failure::conflict_txt22\&txt22=$encoded_val#top";
|
||||
}else{
|
||||
|
||||
my $payone_mival = $payone->managemandate_main(\%varenv,$ctadr,"",$owner);
|
||||
if($payone_mival && $payone_mival =~ /\w{2}-\d+/){
|
||||
my $payone_mival = $payone->managemandate_main(\%varenv,$ctadr,"",$owner);
|
||||
if($payone_mival && $payone_mival =~ /\w{2}-\d+/){
|
||||
#define fictiv invoice to get 1 € test
|
||||
my $epoche = time();
|
||||
my $ctt = {
|
||||
|
@ -594,12 +594,13 @@ sub save_account(){
|
|||
}else{
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#prepaid
|
||||
elsif($ctadr->{int03} == 3){
|
||||
$feedb = $pl->prepaid_request($dbh,$ctadr,$owner);
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"ct_name='Prepay-$feedb->{prepaid_account}'");#Vde
|
||||
}
|
||||
#prepaid, will be requested in PayoneLink.pm
|
||||
#elsif($ctadr->{int03} == 3){
|
||||
# $feedb = $pl->prepaid_request($dbh,$ctadr,$owner);
|
||||
#}
|
||||
|
||||
if($R::txt04 && $R::confirm_txt04 && $R::txt04 ne $R::confirm_txt04){
|
||||
$ret = "failure::confirm_txt04#top";
|
||||
|
|
|
@ -353,10 +353,17 @@ EOF
|
|||
$pay_state = " | receivable: $ctt->{int19}. Einzug im PMI prüfen!" if($ctt->{txt16} && $ctt->{int16} == 0 && $ctt->{int18} == 0 && looks_like_number($ctt->{int19}) && $ctt->{int01} != $ctt->{int19});
|
||||
my $pay_sequence = "";
|
||||
$pay_sequence = " | sequencenr: $ctt->{int18}" if($ctt->{int18});
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
|
||||
my $kind_of_payment = "fehlt";
|
||||
$kind_of_payment = "$_paymentstate[0]" if($ctadr->{int03} == 1);
|
||||
$kind_of_payment = "$_paymentstate[1]" if($ctadr->{int03} == 2);
|
||||
my $p_hash = $dbt->{shareedms_conf}->{payment_state2};
|
||||
foreach my $s_key (sort keys (%{ $p_hash })) {
|
||||
if($ctt->{state} && $ctt->{int03}){
|
||||
$kind_of_payment = $p_hash->{$s_key} if($ctt->{int03} == $s_key);
|
||||
}
|
||||
elsif($ctadr->{int03}){
|
||||
$kind_of_payment = $p_hash->{$s_key} if($ctadr->{int03} == $s_key);
|
||||
}
|
||||
}
|
||||
my $payteaser = "";
|
||||
if($ctadr->{txt28}){
|
||||
$payteaser = substr($ctadr->{txt28},0,50) . " ...";
|
||||
|
|
|
@ -19,7 +19,6 @@ use Lib::Config;
|
|||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
use Mod::Prelib;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
use Date::Calc qw(:all);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
|
@ -50,7 +49,6 @@ sub tpl(){
|
|||
my $cf = new Config;
|
||||
my $lb = new Libenz;
|
||||
my $pl = new Prelib;
|
||||
my $db = new Libenzdb;
|
||||
my $but = new Buttons;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
|
@ -124,11 +122,11 @@ sub tpl(){
|
|||
my $cttpos_trans = {};
|
||||
my $cttpos_theft = {};
|
||||
if(($node_meta->{ct_table} eq "content") && ($node_meta->{tpl_id} == 205) && (!$start_chck && !$end_chck)){
|
||||
my $cttpos1 = $db->collect_postime("contenttranspos","$search_startdt","$search_enddt","$start_date_time","$end_date_time");
|
||||
my $cttpos1 = $dbt->collect_postime($dbh,"contenttranspos","$search_startdt","$search_enddt","$start_date_time","$end_date_time");
|
||||
foreach my $key (keys %$cttpos1){
|
||||
$cttpos_trans->{"trans_" . $key} = $cttpos1->{$key};
|
||||
}
|
||||
#my $cttpos2 = $db->collect_postime("contenttheftpos","$search_startdt","$search_enddt","$start_date_time","$end_date_time");
|
||||
#my $cttpos2 = $dbt->collect_postime($dbh,"contenttheftpos","$search_startdt","$search_enddt","$start_date_time","$end_date_time");
|
||||
#foreach my $key (keys %$cttpos2){
|
||||
# $cttpos_theft->{"theft_" . $key} = $cttpos2->{$key};
|
||||
#}
|
||||
|
@ -175,8 +173,6 @@ sub tpl(){
|
|||
my ($daymarker,$raster_mmpx,$day4month) = $lb->month_line($users_dms);
|
||||
my $rows = 0;
|
||||
|
||||
my $ctf = $db->get_content1("contentuser","$dbt->{sharedms_conf}->{parent_id}");
|
||||
|
||||
my $c_id4csv = "";
|
||||
my $ct4rel = {};
|
||||
my $ct4rel_parts = {};
|
||||
|
@ -207,13 +203,19 @@ sub tpl(){
|
|||
$feedb->{message} .= ">>> Datum Eingabefehler: $date <<<" if($end_chck);
|
||||
my ($c_dd,$c_mm,$c_yy) = split(/\./,$date);
|
||||
}
|
||||
|
||||
my $update_users = {
|
||||
table => "users",
|
||||
change => "no_time",
|
||||
u_id => $users_dms->{u_id}
|
||||
};
|
||||
|
||||
my $export = "";
|
||||
my $ck4ex = "@R::ck4ex" || "";
|
||||
$export = "check4export" if($R::ck4ex);
|
||||
if($export || $ck4ex){
|
||||
$db->users_up("time4csv","$time",$users_dms->{u_id});
|
||||
$users_dms = $db->select_users($users_dms->{u_id});
|
||||
$dbt->update_one($dbh,$update_users,"time4csv='$time'");
|
||||
$users_dms = $dbt->select_users($dbh,$users_dms->{u_id});
|
||||
}
|
||||
|
||||
my $searchref = {
|
||||
|
@ -225,7 +227,6 @@ sub tpl(){
|
|||
opos => "",
|
||||
};
|
||||
my $tplids = "$tpl_id," || 0;
|
||||
my $main_ids = "";
|
||||
|
||||
#Faktura actions
|
||||
if($node_meta->{template_id} =~ /208|209|218|219/){
|
||||
|
@ -293,10 +294,7 @@ sub tpl(){
|
|||
$searchref->{limit} = 1000;
|
||||
}
|
||||
|
||||
|
||||
$main_ids = "$main_id,";
|
||||
$main_ids .= $db->collect_noderec($main_id,$lang,"nothing");
|
||||
$main_ids =~ s/,$//;
|
||||
my $main_ids .= $dbt->collect_noderec($dbh,$main_id);
|
||||
|
||||
#path-line
|
||||
my $redirect = "";
|
||||
|
@ -358,20 +356,7 @@ EOF
|
|||
my $s_ct_name = $q->escapeHTML($R::s_ct_name) || "";
|
||||
my $s_barcode = $q->escapeHTML($R::s_barcode) || "";
|
||||
|
||||
my $relnod = "";
|
||||
$relnod = $db->collect_rel4nodes($main_ids,"","","rel_id");
|
||||
|
||||
my $j_exist = $db->get_node4multi("300011",$lang);
|
||||
|
||||
my $nodes = "";
|
||||
if($main_ids){
|
||||
$nodes = $db->collect_node2($main_ids);
|
||||
}else{
|
||||
$lb->failure("Fehler! Es fehlen wichtige Einstellungen. ....journal-ID!");
|
||||
}
|
||||
my $ct_ids = "";
|
||||
my $last_ab = {};
|
||||
|
||||
my $relnod = $dbt->collect_rel4nodes($dbh,$main_ids);
|
||||
my $channel_map = $dbt->channel_map();
|
||||
my $mapref = {};
|
||||
my $ct_users = $dbt->users_map($dbh,$mapref);#get serviceAPP and DMS users from contentadr
|
||||
|
@ -437,7 +422,14 @@ EOF
|
|||
|
||||
#it will takes only one dataset
|
||||
if($node_meta->{ct_table} eq "contenttrans" && $c_id4trans && $c_id4trans =~ /^\d+$/ && (($users_dms->{faksum}) || ($full_url ne $referer) || ($node_meta->{tpl_id} == 209 && $v_journal && !$R::detail_search))){
|
||||
$ct4rel = $db->collect_cid($table,$lang,$tplids,$R::rel_id,$R::barcode,"c_id",$c_id4trans);
|
||||
my $pref_ct = {
|
||||
table => "contenttrans",
|
||||
fetch => "all",
|
||||
keyfield => "c_id",
|
||||
c_id => $c_id4trans,
|
||||
};
|
||||
$ct4rel = $dbt->fetch_record($dbh,$pref_ct);
|
||||
|
||||
}elsif(!$start_chck && !$end_chck){
|
||||
|
||||
#collect search keys
|
||||
|
@ -478,13 +470,13 @@ EOF
|
|||
$tk->sigstation_cupdate($return2copri->{stations});
|
||||
}
|
||||
}
|
||||
$ct4rel = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tplids","$ct_ids",$v_journal,$ck4ex);
|
||||
$ct4rel = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tplids",$v_journal,$ck4ex);
|
||||
$feedb = $pl->export_csv($node_meta,$users_dms,$ct4rel,$bike_nodes,$coo) if($ck4ex);
|
||||
|
||||
if($node_meta->{node_name} eq "Faktura" || $tplids =~ /218/){
|
||||
my $v_journalparts = "";
|
||||
$v_journalparts = $v_journal . "_parts";
|
||||
$ct4rel_parts = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tplids","$ct_ids",$v_journalparts,$ck4ex);
|
||||
$ct4rel_parts = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tplids",$v_journalparts,$ck4ex);
|
||||
}
|
||||
|
||||
}#end $ct4rel collect
|
||||
|
@ -617,7 +609,11 @@ EOF
|
|||
}elsif($key =~ /owner/){
|
||||
print $q->td({-class=>'search_line'},$but->selector("s_$key","120px","$s_val",@_users)),"\n";
|
||||
}elsif($key =~ /state/){
|
||||
my @_states = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
my @_states = ("");
|
||||
my $p_hash = $dbt->{shareedms_conf}->{payment_state2};
|
||||
foreach my $s_key (sort keys (%{ $p_hash })) {
|
||||
push @_states, "$p_hash->{$s_key}";
|
||||
}
|
||||
my @_orderstates = split(/\|/,$dbt->{shareedms_conf}->{order_state});
|
||||
push (@_states,@_orderstates);
|
||||
print $q->td({-class=>'search_line'},$but->selector("s_$key","120px","$s_val",@_states)),"\n";
|
||||
|
@ -1275,7 +1271,7 @@ EOF
|
|||
}
|
||||
|
||||
if($users_dms->{u_id}){
|
||||
if($v_journal eq "Tagesbericht" && $j_exist->{main_id}){
|
||||
if($v_journal eq "Tagesbericht"){
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;"},""),"\n";
|
||||
print $q->td({-style=>"background-color:silver;",-class=>'tdsum',-colspan=>"$m"},"Tagesbericht abschließen, Übertrag in das Verkaufsjournal"),"\n";
|
||||
|
|
|
@ -12,7 +12,6 @@ use CGI ':standard';
|
|||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
|
||||
sub new {
|
||||
|
@ -31,66 +30,61 @@ sub tpl(){
|
|||
my $q = new CGI;
|
||||
my $cf = new Config;
|
||||
my $lb = new Libenz;
|
||||
my $db = new Libenzdb;
|
||||
my $dbt = new DBtank;
|
||||
my $but = new Buttons;
|
||||
my %ib = $but->ibuttons();
|
||||
my %varenv = $cf->envonline();
|
||||
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="";
|
||||
}
|
||||
$path =~ s/\/user|\/manager|\/admin//;
|
||||
my $lang = "de";
|
||||
my $dbh = "";
|
||||
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname});
|
||||
my $users_dms_primary = { u_id => 0 };
|
||||
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int08 >= 1");
|
||||
|
||||
my $rel = {};
|
||||
my $ct = {};
|
||||
if($node_meta->{ct_table} eq "contentuser"){
|
||||
#Firma alias Kunden-Faktura and Operator-Faktura config
|
||||
my $ref = {
|
||||
table => $node_meta->{ct_table},
|
||||
fetch => "one",
|
||||
main_id => $node_meta->{main_id},
|
||||
template_id => $node_meta->{tpl_id},
|
||||
c_id => ">::0",
|
||||
};
|
||||
#Kunden-Faktura and Operator-Faktura config
|
||||
if(($node_meta->{template_id} =~ /196|201/) && $users_dms_primary->{int08} >= 1){
|
||||
$rel = $db->get_rel4tpl($node_meta->{main_id},$lang,"","$node_meta->{template_id}","","",">0");
|
||||
$ct = $db->get_content1("contentuser",$rel->{content_id});
|
||||
$ct = $dbt->fetch_record($dbh,$ref);
|
||||
}elsif($node_meta->{template_id} == 197 && $users_dms->{int08} >= 1){
|
||||
$rel = $db->get_rel4tpl($node_meta->{main_id},$lang,"","197","","",">0");
|
||||
$ct = $db->get_content1("contentuser",$rel->{content_id});
|
||||
$ct = $dbt->fetch_record($dbh,$ref);
|
||||
}else{
|
||||
$feedb->{message} = "failure::Abbruch. Keine Zugriffsberechtigung";
|
||||
}
|
||||
}
|
||||
|
||||
my $tpl = $db->get_tpl($rel->{template_id});
|
||||
my $tpl = $dbt->get_tpl($dbh,$ct->{template_id});
|
||||
my @tpl_order = split /,/,$tpl->{tpl_order};
|
||||
my $u_name = $dbt->sys_username($dbh,$ct->{owner});
|
||||
$ct->{mtime} = $lb->time4de($ct->{mtime},"1");
|
||||
|
||||
print "<div id='Content4conf'>";
|
||||
print $q->div({-class=>"copri_header",-style=>"background-color:#cccccc;"},"Pfad: $path");
|
||||
print $q->div({-class=>"copri_header",-style=>"background-color:#cccccc;"},"$path");
|
||||
print $q->div({-style=>'background-color:silver;height:10px;'},""),"\n";
|
||||
print $q->start_form();
|
||||
|
||||
#Content
|
||||
print $q->start_table({-border=>'0', -width=>'100%',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'});
|
||||
if($feedb->{message} !~ /failure/){
|
||||
if($ct->{c_id} > 0 && $feedb->{message} !~ /failure/){
|
||||
print $q->Tr();
|
||||
if($R::config2edit){
|
||||
print "<td class='ct_editline'>";
|
||||
print $q->hidden(-name=>'owner',-override=>'1', -value=>"$users_dms->{u_id}");
|
||||
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ct->{c_id}");
|
||||
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$rel->{rel_id}");
|
||||
print $q->hidden(-name=>'main_id',-override=>'1', -value=>"$rel->{main_id}");
|
||||
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$ct->{rel_id}");
|
||||
print $q->hidden(-name=>'main_id',-override=>'1', -value=>"$ct->{main_id}");
|
||||
print $but->singlesubmit7("rel_edit","save_user","$ib{save}");
|
||||
print "</td>\n";
|
||||
}else{
|
||||
print "<td class='ct_editline'>";
|
||||
print $q->a({-class=>"editnav",-href=>"$script$path?config2edit=1",-title=>'bearbeiten'}, $q->span({-class=>"bi bi-file-earmark-text-fill", -style=>'font-size:1.5em;'}));
|
||||
print $q->a({-class=>"editnav",-href=>"?config2edit=1",-title=>'bearbeiten'}, $q->span({-class=>"bi bi-file-earmark-text-fill", -style=>'font-size:1.5em;'}));
|
||||
print "</td>\n";
|
||||
}
|
||||
print $q->td({-style=>"background-color:white;padding-right:10px;border-bottom: 1px solid silver;text-align:right;font-size:12px;"}, "$u_name / $ct->{mtime}");
|
||||
|
@ -138,7 +132,7 @@ sub tpl(){
|
|||
print "</div>";
|
||||
|
||||
my $debug = "";
|
||||
$debug = "(ct_table: $node_meta->{ct_table} | main_id: $node_meta->{main_id} | c_id: $ct->{c_id} | tpl_id: $tpl->{tpl_id} | rel_id: $rel->{rel_id})";
|
||||
$debug = "(ct_table: $node_meta->{ct_table} | main_id: $node_meta->{main_id} | c_id: $ct->{c_id} | tpl_id: $tpl->{tpl_id} | rel_id: $ct->{rel_id})";
|
||||
print $q->div({-style=>'z-index:10;font-size:13px;'},"$debug"),"\n" if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
|
||||
return $feedb;
|
||||
|
|
|
@ -16,7 +16,6 @@ use Encode;
|
|||
use Lib::Config;
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenz;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
use Mod::APIfunc;
|
||||
use Storable;
|
||||
|
@ -45,7 +44,6 @@ sub tpl(){
|
|||
my $now_db = strftime("%d.%m.%Y %H:%M:%S",localtime(time));
|
||||
my $cf = new Config;
|
||||
my $lb = new Libenz;
|
||||
my $db = new Libenzdb;
|
||||
my $dbt = new DBtank;
|
||||
my $apif = new APIfunc;
|
||||
my $but = new Buttons;
|
||||
|
@ -57,7 +55,6 @@ sub tpl(){
|
|||
my $lang = "de";
|
||||
my $dbh = "";
|
||||
|
||||
my $parent_node4rel = $db->get_node4rel($node_meta->{parent_id},"","","null");
|
||||
my %ib = $but->ibuttons();
|
||||
my $opdir_dms = "$dbt->{copri_conf}->{basedir}/$dbt->{operator}->{$varenv{dbname}}->{dir_dms}" || "";
|
||||
|
||||
|
@ -117,10 +114,8 @@ sub tpl(){
|
|||
my ($c_dd,$c_mm,$c_yy) = split(/\./,$date);
|
||||
}
|
||||
|
||||
#because of search we need parents
|
||||
my $main_ids = $parent_node4rel->{main_id};
|
||||
my $tpl_ids = $parent_node4rel->{template_id};
|
||||
|
||||
my $main_ids = $node_meta->{parent_id};
|
||||
my $tpl_ids = $node_meta->{tpl_id};
|
||||
my $table = "content";
|
||||
$searchref->{table_pos} = "contentpos";
|
||||
if($node_meta->{tpl_id} == 194 || $node_meta->{tpl_id} == 199){
|
||||
|
@ -215,7 +210,6 @@ EOF
|
|||
|
||||
my $ct4rel = {};
|
||||
if(!$start_chck && !$end_chck && $main_ids && $tpl_ids){
|
||||
#$rows = $db->count_content($searchref->{table_pos},"$main_ids","$tpl_ids");
|
||||
|
||||
#collect search keys.
|
||||
foreach my $postkey (@keywords){
|
||||
|
@ -242,7 +236,7 @@ EOF
|
|||
}
|
||||
}
|
||||
|
||||
$ct4rel = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tpl_ids","","",$ck4ex);
|
||||
$ct4rel = $dbt->search_content($dbh,$searchref,$node_meta,$users_dms,"$main_ids","$tpl_ids","",$ck4ex);
|
||||
}else{
|
||||
$feedb->{message} = "failure::Abbruch. Keine Zugriffsberechtigung";
|
||||
}
|
||||
|
|
|
@ -555,25 +555,24 @@ EOF
|
|||
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"");
|
||||
|
||||
if($users_dms_primary->{u_id}){
|
||||
my @_paymentstate = split(/\|/,$dbt->{shareedms_conf}->{payment_state});
|
||||
push @_paymentstate, "";
|
||||
my $kind_of_payment = "";
|
||||
if($ctadr->{int03} == 1 && ($ctadr->{ct_name} =~ /PO-\d+/ || $ctadr->{ct_name} =~ /TM-\d+/)){
|
||||
$kind_of_payment = "$_paymentstate[0]";
|
||||
}else{
|
||||
undef $_paymentstate[0];
|
||||
}
|
||||
if($ctadr->{int03} == 2 && length($ctadr->{ct_name}) >= 19){
|
||||
$kind_of_payment = "$_paymentstate[1]";
|
||||
}else{
|
||||
undef $_paymentstate[1];
|
||||
}
|
||||
|
||||
if($ctt->{state} && $ctt->{int01}){
|
||||
$kind_of_payment = "$ctt->{state}";
|
||||
}elsif($ctt->{int06} && $ctt->{int06} >= 3 || $ctt->{ct_name} =~ /\d-\d/){
|
||||
#default to Überw.
|
||||
$kind_of_payment = "$_paymentstate[2]";
|
||||
my @_paymentstate = ("");
|
||||
my $p_hash = $dbt->{shareedms_conf}->{payment_state2};
|
||||
foreach my $s_key (sort keys (%{ $p_hash })) {
|
||||
push @_paymentstate, "$p_hash->{$s_key}";
|
||||
if($ctt->{state}){
|
||||
#$kind_of_payment = $p_hash->{$s_key} if($ctt->{int03} == $s_key);
|
||||
$kind_of_payment = $ctt->{state};
|
||||
}
|
||||
elsif($ctt->{int06} && $ctt->{int06} >= 3 || $ctt->{ct_name} =~ /\d-\d/){
|
||||
#default to Überw.
|
||||
$kind_of_payment = $p_hash->{4};
|
||||
}
|
||||
elsif($ctadr->{int03}){
|
||||
$kind_of_payment = $p_hash->{1} if($ctadr->{ct_name} =~ /\w{2}-\d+/);
|
||||
$kind_of_payment = $p_hash->{2} if(length($ctadr->{ct_name}) >= 19);
|
||||
$kind_of_payment = $p_hash->{3} if($ctadr->{ct_name} =~ /Prepaid-\d+/);
|
||||
}
|
||||
}
|
||||
|
||||
if($ctt->{state} && $ctt->{int01}){
|
||||
|
|
|
@ -121,9 +121,9 @@ sub post_velo {
|
|||
my $Befehl = shift;
|
||||
|
||||
#local TEST
|
||||
#my $endpoint = "https://shareeapp-primary.copri-bike.de/APIvelo";
|
||||
my $endpoint = "https://shareeapp-fr01.copri-bike.de/APIvelo";
|
||||
#LIVE
|
||||
my $endpoint = "https://cockpit.velofactur.de/api/portal/befehl";
|
||||
#my $endpoint = "https://cockpit.velofactur.de/api/portal/befehl";
|
||||
|
||||
|
||||
my %json;
|
||||
|
@ -133,6 +133,8 @@ sub post_velo {
|
|||
$json{Befehl} = "$Befehl";
|
||||
my $rest_json = encode_json(\%json);
|
||||
|
||||
print FILE "rest_json:\n" . Dumper($rest_json) . "\n";
|
||||
|
||||
my $ret_json = post2velo_cloud("","$endpoint",$rest_json);
|
||||
#
|
||||
eval {
|
||||
|
|
|
@ -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;
|
|
@ -4,11 +4,9 @@ use warnings;
|
|||
use CGI::Carp qw(fatalsToBrowser);
|
||||
use CGI ':standard';
|
||||
use Mod::Buttons;
|
||||
use Mod::Libenzdb;
|
||||
use Mod::DBtank;
|
||||
use Data::Dumper;
|
||||
|
||||
my $db = new Libenzdb;
|
||||
my $dbt = new DBtank;
|
||||
my $but = new Buttons;
|
||||
|
||||
|
@ -285,13 +283,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue