invoice mailing

This commit is contained in:
Rainer Gümpelein 2022-02-01 20:53:23 +01:00
parent 4d9395808c
commit f852443c6d
13 changed files with 97 additions and 126 deletions

View file

@ -49,10 +49,9 @@ sub printpre(){
my $ct_name2print=$R::ct_name2print;
my $wc= $1 if($R::wc =~ /(\d+\.\d+)/);
my $node = $db->get_node4multi($R::main_id,$lang);
#print "$u_id,$c_id,$mandant_main_id,$main_id,$ct_name2print,$wc";
print $q->start_html(-title=>'COPRIprint',
print $q->start_html(-title=>'',
-base=>'true',
-target=>'Printpre'
);
@ -156,8 +155,8 @@ td {
#payone Bank
my $footer_bank = $ctf->{txt19};
#sparkasse Bank
$footer_bank = $ctf->{txt20} if($ctt->{state} !~ /payone/i);
#manuel Bank
#$footer_bank = $ctf->{txt20} if($ctt->{state} !~ /payone/i);
my $ctt_users = $db->get_owner($ctt->{owner});
@ -178,10 +177,10 @@ td {
my $tplf = $db->get_tpl("201");#Firma tpl
my @tplf_order = split /,/,$tplf->{tpl_order};
my $logo = "$ctf->{img01}" || "000empty";
my $logo = "$ctf->{img01}" || "";
if($printer_id =~ /Briefpapier/){
#Ohne Logo da Briefpapier
$logo = "000empty";
$logo = "";
}
#logging siteformat
@ -259,7 +258,7 @@ td {
my $position;
my $h_toppx = "$h_top" . "px";
$position = "position:absolute; top: $h_toppx;" if($h_top);
print $q->div({-style=>"$position width:$width;text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"\n"));
print $q->div({-style=>"$position width:$width;text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/images/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"\n"));
}
#Briefkopf + Adresse
@ -269,7 +268,7 @@ td {
my $ctt = $db->get_content1("contenttrans",$c_id);
$ctt->{txt01} = $lb->newline($ctt->{txt01},$users->{tiny_mce},"0");
print $q->div({-style=>"width:$width; text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"")),"\n";
print $q->div({-style=>"width:$width; text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/images/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"")),"\n";
print $q->start_table({-width=>'100%',-border=>'0',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
print "<tr>\n";
@ -293,7 +292,7 @@ td {
my $txid = "";
$txid = "TXID: $ctt->{txt16}" if($ctt->{txt16} && $ctt->{state} =~ /payone/i);
$txid = "Verwendungszweck TXID: $ctt->{txt16}" if($ctt->{txt16} && $ctt->{state} =~ /payone/i);
my $mailaccount = "";
$mailaccount = "Account: $ctt->{txt08}" if($ctt->{txt08});
@ -340,7 +339,6 @@ td {
sub data_table(){
my ($h_top,$c_id,$scol,$ctt_dummy,$mandant_main_id,$kind_of_trans,$tpl_order,$break_table_wc,$max_table_wc,$ctt,$sum_break) = @_;
#print "($h_top,$c_id,$scol,$ctt_dummy,$mandant_main_id,$kind_of_trans,$tpl_order,$break_table_wc,$max_table_wc)";
$ctf = $db->get_content1("contentuser","$mandant_main_id");
my $umst1619 = $lb->umst_breaking($ctt,"");
@ -438,7 +436,6 @@ td {
if(($gesamt == 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){
$nullcount++;
}
#print "if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){";
if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){
$j++;
@ -455,12 +452,10 @@ td {
$gesamt = $lb->cashme($gesamt);
#summieren
if("$cttpos->{$id}->{int05}" =~ /\d/){
#print "xxx $gesamt $cttpos->{$id}->{int05} |";
$sum_parts0 += $gesamt if("$cttpos->{$id}->{int05}" == "0");
$sum_parts7 += $gesamt if("$cttpos->{$id}->{int05}" == "7");
$sum_parts19 += $gesamt if("$cttpos->{$id}->{int05}" >= "16");
}else{
#print "yyy $gesamt $ctf->{txt13} |";
$sum_parts0 += $gesamt if("$ctf->{txt13}" == "0");
$sum_parts7 += $gesamt if("$ctf->{txt13}" == "7");
$sum_parts19 += $gesamt if($ctf->{txt13} >= 16);
@ -525,9 +520,6 @@ td {
print $q->td({-class=>'tdint'},"$menge"),"\n";
}
if($ctt->{txt00} =~ /Lieferschein/){
print $q->td(""),"\n" if($key =~ /int02|int04/);
}else{
if($key =~ /int02/){
if($einzel == "0"){
$einzel="";
@ -553,21 +545,20 @@ td {
print $q->td({-nowrap=>'1',-class=>'tdint'},"$gesamt"),"\n";
}
}
}
}
}
}
}#end foreach
#Zahlungstext Text & Vorbelegungen
my $payment_text;
my $payment_text = "";
foreach(@tplf_order){
my ($key,$des,$size) = split /=/,$_;
if($key =~ /txt52|txt53|txt54|txt55|txt56|txt57|txt58|txt59|txt60/){
if($key =~ /txt5\d/){
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
$ctf->{$key} = $lb->newline($ctf->{$key},$users->{tiny_mce},"");
$ctf->{$key} = $lb->newline($ctf->{$key},"","");
$ctt->{state} =~ s/\(payone.*//;
if("$des" =~ /$ctt->{state}/ && ($j <= $max_table_wc || $break_table_wc)){
if($des =~ /$ctt->{state}/ && ($j <= $max_table_wc || $break_table_wc)){
if($sum_parts19 < 0){
$payment_text = "$ctf->{txt58}";
}else{
@ -690,23 +681,10 @@ td {
my @rechnungstext = split(/\<br \/\>/,$ctf->{$key});
if($ctt_txt21 =~ /$key/){
foreach(@rechnungstext){
if($_ =~ /signature/){
print $q->Tr();
print $q->td({-style=>'border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
print $q->td({-style=>'width:4em;height:2em;'},"&nbsp;");
print $q->td({-style=>'border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
print $q->Tr();
print $q->td({-class=>'tdpdf3'}, "&nbsp;&nbsp; Unterschrift Mieterin / Mieter &nbsp;&nbsp;","\n");
print $q->td("&nbsp;");
print $q->td({-class=>'tdpdf3'}, "Unterschrift ","\n");
print $q->Tr();
print $q->td({-colspan=>3, -style=>'border-bottom-width:2px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
}else{
$style = "padding:0.4em;text-align:left;font-size:1em;";
$style = "padding:0.4em;text-align:left;font-size:1em;" if($_ =~ s/\<b\>// && $node_name ne "Rückgabe");
print $q->Tr();
print $q->td({-style=>"$style",-colspan=>3},"$_");
}
}
}
}
@ -756,10 +734,6 @@ td {
print $q->start_table({-border=>'0',-align=>'left'});
print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "TEL: $ctf->{txt08}","\n");
#if($ctf->{txt09}){
# print $q->Tr();
# print $q->td({-class=>'tdpdf2'}, "FAX: $ctf->{txt09}","\n");
#}
print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "$ctf->{txt10}","\n");
print $q->Tr();