mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-10 05:56:27 +02:00
saving column into invoices
This commit is contained in:
parent
ba041a56b6
commit
4c11beb331
7 changed files with 222 additions and 283 deletions
|
@ -80,12 +80,12 @@ sub tpl(){
|
|||
#
|
||||
#collect rentals on operators and get operator hash with dbname->uri_operator
|
||||
#$q->param(-name=>'month',-value=>"18");#disabled because changing to not invoiced positions
|
||||
my ($ctpos,$operator_hash) = $apif->user_rentals_history($q,$ctrel);
|
||||
#print Dumper($ctpos);
|
||||
my ($cttpos,$operator_hash) = $apif->user_rentals_history($q,$ctrel);
|
||||
#print Dumper($cttpos);
|
||||
|
||||
my $ctpos_count=0;
|
||||
foreach my $id (keys(%$ctpos)){
|
||||
$ctpos_count++;
|
||||
my $cttpos_count=0;
|
||||
foreach my $id (keys(%$cttpos)){
|
||||
$cttpos_count++;
|
||||
}
|
||||
|
||||
my $ctt_all = {};
|
||||
|
@ -312,9 +312,9 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
|||
}
|
||||
print $q->div({-class=>'content2'}, "Nach der Mietradnutzung haben Sie hier die Möglichkeit die Mietvorgänge einzusehen und gebuchte Rechnungen als PDF herunterzuladen."),"\n";
|
||||
print $q->div({-class=>'content2'}, "Ihre Bonusnummer wurde akzeptiert. Bitte beachten Sie dass der Bonustarif im Kontext des Mietradbetreibers vergeben wird. Der Tarif wird bei der Mietrad Reservierung angezeigt."),"\n" if($R::success && $R::success eq "txt15");
|
||||
print $q->div({-class=>'content2'}, "Aktuell liegen keine Buchungen vor."),"\n" if(!$ctpos_count);
|
||||
print $q->div({-class=>'content2'}, "Aktuell liegen keine Buchungen vor."),"\n" if(!$cttpos_count);
|
||||
|
||||
}elsif($key =~ /barcode/ && $ctpos_count){
|
||||
}elsif($key =~ /barcode/ && $cttpos_count){
|
||||
|
||||
#print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Ihre Buchungsdaten der letzten 1 ½ Jahre im Überblick"),"\n";
|
||||
print $q->div({-style=>'padding-top:1.5em;font-weight:bold;'},"Folgende Positionen liegen zur nächsten Abbuchung vor"),"\n";
|
||||
|
@ -328,7 +328,7 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
|||
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($ctpos->{$b}->{$scol}) cmp lc($ctpos->{$a}->{$scol}) } keys(%$ctpos)){
|
||||
foreach my $id (sort { lc($cttpos->{$b}->{$scol}) cmp lc($cttpos->{$a}->{$scol}) } keys(%$cttpos)){
|
||||
$j++;
|
||||
$nx++;
|
||||
|
||||
|
@ -338,53 +338,53 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
|
|||
|
||||
my $occupied_style = "background-color:#fcfdfb;";
|
||||
$occupied_style = "background-color:#f4f1ee;" if($nx %= 2);
|
||||
#$occupied_style = "color:#ff1493;" if($ctpos->{$id}->{txt10} =~ /occupied|requested/);
|
||||
$occupied_style = "color:#ff1493;" if($ctpos->{$id}->{int10} == 2 || $ctpos->{$id}->{int10} == 3);
|
||||
#$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"},"$ctpos->{$id}->{$key}");
|
||||
#print $q->td({-class=>'tdtxt', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
print "<td class='tdtxt' style='$occupied_style'>\n";
|
||||
if($ctpos->{$id}->{txt01}){
|
||||
$ctpos->{$id}->{$key} =~ s/\<br \/\>/; /g;
|
||||
print "$ctpos->{$id}->{$key}<br />\n";
|
||||
if($cttpos->{$id}->{txt01}){
|
||||
$cttpos->{$id}->{$key} =~ s/\<br \/\>/; /g;
|
||||
print "$cttpos->{$id}->{$key}<br />\n";
|
||||
}
|
||||
if($ctpos->{$id}->{start_time}){
|
||||
$ctpos->{$id}->{start_time} = $lb->time4de($ctpos->{$id}->{start_time},"1");
|
||||
$ctpos->{$id}->{end_time} = $lb->time4de($ctpos->{$id}->{end_time},"1");
|
||||
print $q->span("→ $ctpos->{$id}->{start_time}<br />← $ctpos->{$id}->{end_time}");
|
||||
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");
|
||||
print $q->span("→ $cttpos->{$id}->{start_time}<br />← $cttpos->{$id}->{end_time}");
|
||||
}
|
||||
print "</td>\n";
|
||||
}elsif($key =~ /int04/){
|
||||
if($ctpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
#print $q->td({-class=>'tdint', -style=>"$occupied_style"},"Station $ctpos->{$id}->{$key}");
|
||||
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";
|
||||
print $q->span("Station<br />→ $ctpos->{$id}->{txt12}$ctpos->{$id}->{int06}<br />← $ctpos->{$id}->{txt13}$ctpos->{$id}->{int04}");
|
||||
print $q->span("Station<br />→ $cttpos->{$id}->{txt12}$cttpos->{$id}->{int06}<br />← $cttpos->{$id}->{txt13}$cttpos->{$id}->{int04}");
|
||||
print "</td>\n";
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$ctpos->{$id}->{$key}");
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
}
|
||||
}elsif($key =~ /ct_name/){
|
||||
if($ctpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"Rad<br />$ctpos->{$id}->{$key}");
|
||||
if($cttpos->{$id}->{int09}){#if Tarifnr then bike
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"Rad<br />$cttpos->{$id}->{$key}");
|
||||
}else{
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$ctpos->{$id}->{$key}");
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style"},"$cttpos->{$id}->{$key}");
|
||||
}
|
||||
}elsif($key eq "int26"){
|
||||
my $co2saving = "";
|
||||
if($ctpos->{$id}->{int26}){
|
||||
if($cttpos->{$id}->{int26}){
|
||||
$co2saving = "Einsparung</br>";
|
||||
my $co2diff = $pri->co2calc($ctpos->{$id});
|
||||
my $sprit_price = $pri->sprit2calc($ctpos->{$id});
|
||||
my $co2diff = $pri->co2calc($cttpos->{$id});
|
||||
my $sprit_price = $pri->sprit2calc($cttpos->{$id});
|
||||
$co2saving .= "$co2diff kg CO²<br />";
|
||||
$co2saving .= "$sprit_price EUR<br />";
|
||||
$ctpos->{$id}->{int26} =~ s/\./,/;
|
||||
$co2saving .= "bei $ctpos->{$id}->{int26} KM";
|
||||
$cttpos->{$id}->{int26} =~ s/\./,/;
|
||||
$co2saving .= "bei $cttpos->{$id}->{int26} KM";
|
||||
}
|
||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$co2saving");
|
||||
}elsif($key eq "int02"){
|
||||
my $gesamt = 0;
|
||||
my $rabatt = "";
|
||||
($gesamt,$rabatt) = $pri->price2calc($ctpos->{$id});
|
||||
($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id});
|
||||
$sum += $gesamt;
|
||||
$gesamt = $lb->round($gesamt);
|
||||
$gesamt = $lb->cashme($gesamt,",");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue