mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-07-10 07:36:26 +02:00
VK Terminal with tariff_description2
This commit is contained in:
parent
4108673ef1
commit
e6ca75a66a
10 changed files with 338 additions and 176 deletions
|
@ -45,7 +45,8 @@ sub tpl(){
|
|||
#get Firma
|
||||
my $ctf = $db->get_content1("contentuser",$dbt->{shareedms_conf}->{parent_id});
|
||||
|
||||
my $rel4tpl = $db->get_rel4tpl("",$lang,$users_dms->{c_id4trans},$node_meta->{tpl_id});
|
||||
#my $rel4tpl = $db->get_rel4tpl("",$lang,$users_dms->{c_id4trans},$node_meta->{tpl_id});
|
||||
my $rel4tpl = $db->get_rel4tpl("",$lang,$users_dms->{c_id4trans},$users_dms->{tpl_id4trans});
|
||||
my @tpl_order = split /,/,$rel4tpl->{tpl_order};
|
||||
|
||||
my $ctx = { c_id => 0 };
|
||||
|
|
|
@ -69,7 +69,7 @@ sub tpl(){
|
|||
my $vibuchen_mtime = "";
|
||||
$vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time});
|
||||
|
||||
my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=Mietzeit","int03=Menge","int02=Preis","int07=Rabatt","int04=Gesamt");
|
||||
my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int03=Menge","int02=Tarif/Preis","int07=Rabatt","int04=Gesamt");
|
||||
my $tplf = $db->get_tpl("201");#Firma tpl
|
||||
my @tplf_order = split /,/,$tplf->{tpl_order};
|
||||
|
||||
|
@ -84,15 +84,20 @@ sub tpl(){
|
|||
my $max_sum = 1000;
|
||||
my $cttpos = { c_id => 0 };
|
||||
my $rows = 0;
|
||||
($cttpos,$rows) = $db->collect_contentpos("contenttrans",$rel4tpl->{content_id});
|
||||
($cttpos,$rows) = $dbt->collect_contentpos($dbh,"contenttrans",$rel4tpl->{content_id});
|
||||
|
||||
foreach my $id (keys(%$cttpos)){
|
||||
if(ref($cttpos->{$id}) eq "HASH"){
|
||||
if($cttpos->{$id}->{int26}){
|
||||
@tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=Mietzeit","int26=Einsparung","int03=Menge","int02=Preis","int07=Rabatt","int04=Gesamt");
|
||||
@tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int26=Einsparung","int03=Menge","int02=Tarif/Preis","int07=Rabatt","int04=Gesamt");
|
||||
}
|
||||
#enhanced tariff
|
||||
#if($cttpos->{$id}->{int35}){
|
||||
# @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int26=Einsparung","int35=Mietzeit Menge","int03=Artikel Menge","int02=Preis","int07=Rabatt","int04=Gesamt");
|
||||
#}
|
||||
}else{
|
||||
$lb->failure3("Der selekt einer Verkaufsposition ist fehlgeschlagen, errocode ($rel4tpl->{content_id} | $users_dms->{c_id4trans} | $node_meta->{tpl_id}). Bitte admin kontaktieren");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +151,7 @@ EOF
|
|||
$k++ if($val);
|
||||
if($key eq "ct_name"){
|
||||
print $q->th($q->textfield(-class=>'etxt',-style=>'height:19px;width:140px;font-size:1.3em;text-align:right;',-id=>"json_select",-name=>"json_select",-value=>"", -override=>'1',-size=>"25",-maxlength=>50, -placeholder=>'Nummer',-autofocus=>1),"");
|
||||
}elsif($key =~ /int|txt/){
|
||||
}elsif($key =~ /int|txt|time\d+/){
|
||||
print $q->th("$val");
|
||||
}
|
||||
}
|
||||
|
@ -168,6 +173,15 @@ EOF
|
|||
|
||||
#foreach my $id (sort { $cttpos->{$b}->{$scol} <=> $cttpos->{$a}->{$scol} } keys(%$cttpos)){
|
||||
foreach my $id (sort { $cttpos->{$b}->{$scol} cmp $cttpos->{$a}->{$scol} } keys(%$cttpos)){
|
||||
|
||||
my $pricing = {};
|
||||
my $counting = {};
|
||||
my $rental_feed = {};
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id},"calc_price");
|
||||
$rental_feed = $pri->fetch_rentalfeed(\%varenv,$cttpos->{$id},$counting);
|
||||
}
|
||||
|
||||
my $set_style="";
|
||||
my $occupied_style = "";
|
||||
my $time_style = "";
|
||||
|
@ -227,10 +241,12 @@ EOF
|
|||
my $txtstyle = "text-align:left;min-width:150px;";
|
||||
my $isize = "30";
|
||||
$isize = $inputsize if($inputsize);
|
||||
if($key =~ /int|txt03/){ #für zahlen etwas kleiner
|
||||
if($key =~ /int\d+/){
|
||||
$txtstyle = "text-align:right;min-width:50px;";
|
||||
$isize = "5";
|
||||
}
|
||||
|
||||
#edit position
|
||||
if(($c_idpos == $cttpos->{$id}->{c_id}) && ($R::trans2edit && $R::trans2edit =~ /transpos/)){
|
||||
if($key =~ /ct_name/){
|
||||
print $q->td({-class=>'element',-style=>"$set_style text-align:right;"}, $q->textfield(-class=>'etxt',-style=>"text-align:right;min-width:120px;",-name=>"ct_name",-default=>"$ct_pos", -override=>'1',-size=>10,-readonly=>'1')),"\n";
|
||||
|
@ -248,16 +264,36 @@ EOF
|
|||
print $q->td({-class=>'tdint'},"$co2saving");
|
||||
|
||||
}elsif($key =~ /int03/){
|
||||
#TODO, autocalc Menge Preis by time-range
|
||||
#Menge
|
||||
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10, -autofocus=>1)),"\n";
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{real_clock}"),"\n";
|
||||
}else{
|
||||
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10, -autofocus=>1)),"\n";
|
||||
}
|
||||
}elsif($key =~ /int02/){
|
||||
#Einzelpreis
|
||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),"\n");
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print "<td class='tdint'>\n";
|
||||
print "Tarif: $rental_feed->{tariff_description2}->{number} $rental_feed->{tariff_description2}->{name}<br />\n";
|
||||
foreach my $fid (sort keys(%{ $rental_feed->{tariff_description2} })){
|
||||
if(ref($rental_feed->{tariff_description2}->{$fid}) eq "ARRAY"){
|
||||
print "$rental_feed->{tariff_description2}->{$fid}[0]: $rental_feed->{tariff_description2}->{$fid}[1]<br />\n";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}else{
|
||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),"\n");
|
||||
}
|
||||
}elsif($key =~ /int07/){
|
||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style",-nowrap=>'1'},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),$but->selector("int08","40px","$cttpos->{$id}->{int08}",("0.00:%","1.00:€"))),"\n";
|
||||
if(!$cttpos->{$id}->{int35}){
|
||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style",-nowrap=>'1'},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),$but->selector("int08","40px","$cttpos->{$id}->{int08}",("0.00:%","1.00:€"))),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint'},""),"\n";
|
||||
}
|
||||
}elsif($key =~ /int04/){
|
||||
print $q->td({-class=>'element',-style=>'text-align:right;padding:0.1em 0.5em;',-nowrap=>"1"},"$gesamt €");
|
||||
if($pricing->{total_price}){
|
||||
print $q->td({-class=>'tdint',-nowrap=>1},"$pricing->{total_price} €"),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €");
|
||||
}
|
||||
}elsif($key =~ /txt01/){
|
||||
if($cttpos->{$id}->{int09} && $cttpos->{$id}->{$key} !~ /Manuell/){
|
||||
$cttpos->{$id}->{$key} .= "\nManuell bearbeitet\n";
|
||||
|
@ -270,21 +306,21 @@ EOF
|
|||
print $q->textarea(-class=>'autos',-style=>"border: 1px solid #ededed;background-color: #ededed;",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-rows=>"1",-cols=>65),"<br />\n";
|
||||
|
||||
if($cttpos->{$id}->{int09}){#2020-12-07 Verleihräder werden anhand der TarifNr als solches erkannt
|
||||
print $q->span({-style=>"$txtstyle $set_style"},
|
||||
"Tarif Nr.: ", $q->textfield(-class=>'etxt',-name=>"int09",-default=>"$cttpos->{$id}->{int09}",-size=>"5",-maxlength=>5),
|
||||
"Tarif Text", $q->textfield(-class=>'etxt',-name=>"txt04",-default=>"$cttpos->{$id}->{txt04}",-size=>"30",-maxlength=>50)),"<br />\n";
|
||||
#print $q->span({-style=>"$txtstyle $set_style"},
|
||||
#"Tarif Nr.: ", $q->textfield(-class=>'etxt',-name=>"int09",-default=>"$cttpos->{$id}->{int09}",-size=>"5",-maxlength=>5),
|
||||
#"Tarif Text", $q->textfield(-class=>'etxt',-name=>"txt04",-default=>"$cttpos->{$id}->{txt04}",-size=>"30",-maxlength=>50)),"<br />\n";
|
||||
|
||||
print $q->span({-style=>"$txtstyle $set_style"},
|
||||
"Endstation: ", $q->textfield(-class=>'etxt',-name=>"int04",-default=>"$cttpos->{$id}->{int04}",-size=>"5",-maxlength=>40),
|
||||
"GPS: ", $q->textfield(-class=>'etxt',-name=>"txt06",-default=>"$cttpos->{$id}->{txt06}",-size=>"35",-maxlength=>40)),"<br />\n";
|
||||
|
||||
print $q->span({-style=>"$txtstyle $set_style"},"Mietzeit: ",
|
||||
$q->textfield(-id=>'datepicker1',-class=>'etxt',-name=>"start_date",-default=>"$s_dd.$s_mo.$s_yy",-size=>"10",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"s_hh",-default=>"$s_hh",-size=>"2",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"s_mi",-default=>"$s_mi",-size=>"2",-maxlength=>2)," – ",
|
||||
$q->textfield(-id=>'datepicker2',-class=>'etxt',-name=>"end_date",-default=>"$e_dd.$e_mo.$e_yy",-size=>"10",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"e_hh",-default=>"$e_hh",-size=>"2",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"e_mi",-default=>"$e_mi",-size=>"2",-maxlength=>2)),"\n";
|
||||
$q->textfield(-id=>'datepicker1',-class=>'etxt',-name=>"start_date",-default=>"$s_dd.$s_mo.$s_yy",-size=>"8",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"s_hh",-default=>"$s_hh",-size=>"1",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"s_mi",-default=>"$s_mi",-size=>"1",-maxlength=>2)," – ",
|
||||
$q->textfield(-id=>'datepicker2',-class=>'etxt',-name=>"end_date",-default=>"$e_dd.$e_mo.$e_yy",-size=>"8",-maxlength=>10),
|
||||
$q->textfield(-class=>'etxt',-name=>"e_hh",-default=>"$e_hh",-size=>"1",-maxlength=>2),":",
|
||||
$q->textfield(-class=>'etxt',-name=>"e_mi",-default=>"$e_mi",-size=>"1",-maxlength=>2)),"\n";
|
||||
}
|
||||
|
||||
print "</td>\n";
|
||||
|
@ -295,7 +331,11 @@ EOF
|
|||
}elsif($key =~ /int/){
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"}," \n");
|
||||
}
|
||||
}else{
|
||||
}
|
||||
#end edit position
|
||||
#
|
||||
#start view position
|
||||
else{
|
||||
if($key =~ /ct_name/){
|
||||
#print $q->td({-class=>'tdint',-style=>"min-width:60px;"},"$ct_pos");
|
||||
my $stamm_style = "background-color:#98c13b;padding:2px;";
|
||||
|
@ -318,22 +358,45 @@ EOF
|
|||
}
|
||||
print $q->td({-class=>'tdint'},"$co2saving");
|
||||
|
||||
}elsif($key =~ /int02/){
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}elsif($key =~ /int03/){
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-colspan=>'1',-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}
|
||||
#int03 on parts, int35 on rental
|
||||
elsif($key =~ /int03/){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{real_clock}"),"\n";
|
||||
}else{
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int02/){
|
||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
print "<td class='tdint'>\n";
|
||||
print "Tarif: $rental_feed->{tariff_description2}->{number} $rental_feed->{tariff_description2}->{name}<br />\n";
|
||||
foreach my $fid (sort keys(%{ $rental_feed->{tariff_description2} })){
|
||||
if(ref($rental_feed->{tariff_description2}->{$fid}) eq "ARRAY"){
|
||||
print "$rental_feed->{tariff_description2}->{$fid}[0]: $rental_feed->{tariff_description2}->{$fid}[1]<br />\n";
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
}else{
|
||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key} €"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int04/){
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
|
||||
if($pricing->{total_price}){
|
||||
print $q->td({-class=>'tdint'},"$pricing->{total_price} €"),"\n";
|
||||
}else{
|
||||
$gesamt =~ s/\./,/;
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
|
||||
}
|
||||
}elsif($key =~ /int07/){
|
||||
my $proz="";
|
||||
$proz = "%" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0);
|
||||
$proz = "€" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0 && $cttpos->{$id}->{int08} && $cttpos->{$id}->{int08} == 1);
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$cttpos->{$id}->{$key} $proz"),"\n";
|
||||
}elsif($key =~ /txt03/){
|
||||
print $q->td({-class=>'tdint'},"$cttpos->{$id}->{$key}"),"\n";
|
||||
if(!$cttpos->{$id}->{int35}){
|
||||
my $proz="";
|
||||
$proz = "%" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0);
|
||||
$proz = "€" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0 && $cttpos->{$id}->{int08} && $cttpos->{$id}->{int08} == 1);
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$cttpos->{$id}->{$key} $proz"),"\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},""),"\n";
|
||||
}
|
||||
}elsif($key =~ /txt01/){
|
||||
$cttpos->{$id}->{$key} = $q->unescapeHTML("$cttpos->{$id}->{$key}");
|
||||
$cttpos->{$id}->{$key} = $lb->newline($cttpos->{$id}->{$key},"","");
|
||||
|
@ -365,17 +428,18 @@ EOF
|
|||
my $bike="";
|
||||
my $tariff = "";
|
||||
$bike = "$cttpos->{$id}->{$key}" if($cttpos->{$id}->{$key});
|
||||
$tariff = ", Tarif: $cttpos->{$id}->{int09} $cttpos->{$id}->{txt04}" if($cttpos->{$id}->{txt04});
|
||||
print $q->span("$bike $tariff<br />"),"\n";
|
||||
#$tariff = ", Tarif: $cttpos->{$id}->{int09} $cttpos->{$id}->{txt04}" if($cttpos->{$id}->{txt04});
|
||||
#print $q->span("$bike $tariff<br />"),"\n";
|
||||
print $q->span("$bike<br />"),"\n";
|
||||
}
|
||||
if($cttpos->{$id}->{int06} || $cttpos->{$id}->{int04}){
|
||||
print $q->span("Start/End Station: $cttpos->{$id}->{int06} / $cttpos->{$id}->{int04}, GPS: $cttpos->{$id}->{txt06}"),"\n";
|
||||
}
|
||||
if($cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||
$cttpos->{$id}->{start_time} = $lb->time4de($cttpos->{$id}->{start_time},"1");
|
||||
$cttpos->{$id}->{end_time} = $lb->time4de($cttpos->{$id}->{end_time},"1");
|
||||
my $start_time = $lb->time4de($cttpos->{$id}->{start_time},"1");
|
||||
my $end_time = $lb->time4de($cttpos->{$id}->{end_time},"1");
|
||||
print "<br />\n";
|
||||
print $q->span({-style=>"$time_style"}, "Mietzeit: $cttpos->{$id}->{start_time} – $cttpos->{$id}->{end_time}"),"\n";
|
||||
print $q->span({-style=>"$time_style"}, "Mietzeit: $start_time – $end_time"),"\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
}elsif($key =~ /txt/){
|
||||
|
@ -383,7 +447,8 @@ EOF
|
|||
}elsif($key =~ /int/){
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"}," \n");
|
||||
}
|
||||
}
|
||||
}#end view position
|
||||
|
||||
}
|
||||
}
|
||||
}#foreach end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue