pdf download fix

This commit is contained in:
ragu 2022-10-04 12:14:03 +02:00
parent 60a60121f3
commit f65e88b302
6 changed files with 15 additions and 12 deletions

View file

@ -128,8 +128,9 @@ Weitere Personen aus Ihrem Haushalt profitieren jedoch ebenfalls, falls Sie weit
my $ctt = $dbt->fetch_tablerecord($dbh_operator,$pref);
foreach my $id (keys(%$ctt)){
$ctt->{$id}->{wwwhost} = "$operator_hash->{$sharee_operator}";
$ctt->{$id}->{praefix} = "$sharee_operator";
#print "$ctt->{$id}->{praefix}|";
$ctt->{$id}->{operator} = "$sharee_operator";
$ctt->{$id}->{basedir} = "$dbt->{copri_conf}->{basedir}/$dbt->{operator}->{$sharee_operator}->{dir_app}";
#print "$sharee_operator|$ctt->{$id}->{wwwhost}|$ctt->{$id}->{operator}|$ctt->{$id}->{basedir}<br>";
}
$ctt_all = { %$ctt_all, %$ctt };
@ -471,11 +472,11 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
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($ctt_all->{$id}->{ct_name} =~ /\d/ && $coo){
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){
$i++;
my $invoice_time = $ctt_all->{$id}->{invoice_time} || $ctt_all->{$id}->{mtime};
$invoice_time = $lb->time4de($invoice_time,0);
#$varenv->{praefix} only defined in sharee
#$varenv->{operator} only defined in sharee
my $webtarget = "_blank";
my $dtext = "";
if($varenv->{syshost} =~ /app/){
@ -487,7 +488,7 @@ Nach Abschluss der Registrierung erhalten Sie sowohl auf die von Ihnen hinterleg
print $q->div({-id=>'Rechnungen',-style=>'font-weight:bold;'},"Ihre Rechnungen"),"\n";
print $q->div({-style=>'padding:0.5em;'},"$dtext"),"\n";
}
print $q->div({-style=>'font-size:1em;padding:0.5em;border:0px solid #cccccc;'},$q->a({-href=>"$ctt_all->{$id}->{wwwhost}/FileOut?file=Rechnung-$ctt_all->{$id}->{praefix}-$ctt_all->{$id}->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "Rechnung $ctt_all->{$id}->{ct_name}.pdf"), "&nbsp;&nbsp; ($invoice_time)"),"\n";
print $q->div({-style=>'font-size:1em;padding:0.5em;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->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "Rechnung $ctt_all->{$id}->{ct_name}.pdf"), "&nbsp;&nbsp; ($invoice_time)"),"\n";
}
}

View file

@ -143,7 +143,9 @@ sub tpl(){
$webtarget = "_self";
$dtext = "<br />(Der PDF download öffnet je nach System/Konfiguartion einen externen PDF-Viewer oder Webbrowser)";
}
print $q->div({-style=>'padding:10px;margin:10px 0;'},$q->a({-href=>"$varenv->{wwwhost}/FileOut?file=SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;font-size:1.1em;'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "SEPA-Lastschriftmandat.pdf"),"$dtext"),"\n";
if( -f "$varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf"){
print $q->div({-style=>'padding:10px;margin:10px 0;'},$q->a({-href=>"$varenv->{wwwhost}/FileOut?file=SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;font-size:1.1em;'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "SEPA-Lastschriftmandat.pdf"),"$dtext"),"\n";
}
}else{
print $q->div({-style=>'padding:10px;margin:10px 0;border:1px solid silver;color:#c83434;'},"Es gibt ein Problem! Das SEPA Mandat konnte nicht eingeholt werden. Bitte wenden Sie sich bei Bedarf an den unter \"Kontakt\" hinterlegten Support."),"\n";
}