From ba041a56b6b5fb6130a0deb3d79acce8c49b4e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rainer=20G=C3=BCmpelein?= Date: Fri, 4 Feb 2022 15:42:58 +0100 Subject: [PATCH] payment operator reference --- copri4/main/src/Mod/Payment.pm | 19 ++++++++----------- copri4/main/src/Mod/Prelogic.pm | 2 +- copri4/main/src/Mod/Printpreview.pm | 16 ++++++++-------- copri4/main/src/Tpl/Liste3.pm | 4 +++- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/copri4/main/src/Mod/Payment.pm b/copri4/main/src/Mod/Payment.pm index b208f73..46a2660 100755 --- a/copri4/main/src/Mod/Payment.pm +++ b/copri4/main/src/Mod/Payment.pm @@ -117,7 +117,7 @@ sub preauthorizationSEPA_main { my $pref = { table => "contenttrans", fetch => "one", - template_id => 205, + template_id => 218, c_id => $ctt->{c_id}, }; my $ctt_up = $dbt->fetch_record($dbh,$pref); @@ -133,9 +133,7 @@ sub preauthorizationSEPA_main { $ctt->{ct_name} = "$ctt_up->{ct_name}-1"; } } - if(!$ctt->{reference}){ - $ctt->{reference} = $dbt->{operator}->{$varenv->{dbname}}->{oprefix} . "-" . $ctt->{ct_name}; - } + $ctt->{reference} = $dbt->{operator}->{$varenv->{dbname}}->{oprefix} . "-S-" . $ctt->{ct_name}; #2019-05-18, makes only sense if int15 alias $sum_preauth > 0 if($ctadr->{c_id} && $ctt->{c_id} && $ctt->{int15} > 0){ @@ -242,9 +240,7 @@ sub preauthorizationCC_main { $ctt->{ct_name} = "$ctt_up->{ct_name}-1"; } } - if(!$ctt->{reference}){ - $ctt->{reference} = $dbt->{operator}->{$varenv->{dbname}}->{oprefix} . "-" . $ctt->{ct_name}; - } + $ctt->{reference} = $dbt->{operator}->{$varenv->{dbname}}->{oprefix} . "-C-" . $ctt->{ct_name}; #2019-05-18, makes only sense if int15 alias $sum_preauth > 0 if($ctadr->{c_id} && $ctt->{c_id} && $ctt->{int15} > 0){ @@ -687,11 +683,12 @@ sub payone_capture(){ my $print_return = `$topdf --page-size A4 "$varenv->{wwwhost}/Printpreview?printer_id=PDF\&mandant_main_id=$mandant_id\&main_id=$main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$owner\&wc=$wc_line" $varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf 2>&1`; $return_text .= "$topdf --page-size A4 \"$varenv->{wwwhost}/Printpreview?printer_id=PDF\&mandant_main_id=$mandant_id\&main_id=$main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$owner\&wc=$wc_line\" $varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf\n"; + #FIXME to new mailTarnsport #send_invoice infomail - if(-f "$varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf"){ - system(`$varenv->{basedir}/src/Mod/newsletter_tink.pl "$varenv->{basedir}" "$varenv->{wwwhost}" "send_invoice" "$ctadr->{c_id}" "$ctt->{ct_name}"`); - $return_text .= "---> Sent Invoice Info e-mail\n"; - } + #if(-f "$varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf"){ + # system(`$varenv->{basedir}/src/Mod/newsletter_tink.pl "$varenv->{basedir}" "$varenv->{wwwhost}" "send_invoice" "$ctadr->{c_id}" "$ctt->{ct_name}"`); + # $return_text .= "---> Sent Invoice Info e-mail\n"; + #} } #TODO diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index 19a3446..cc97867 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -1007,7 +1007,7 @@ sub preinit(){ } } - if(-f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf" && (($R::set_state eq "buchen" && $R::send_invoice) || ($ib_key eq "send_invoice_again"))){ + if(-f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf" && (($R::set_state eq "buchen" && $R::send_invoice && $ctt->{int01} && $ctt->{int01} != 0) || ($ib_key eq "send_invoice_again"))){ #sleep 3;#PDF invoice sending disabled because of partly empty invoices # #my $key_pdf; diff --git a/copri4/main/src/Mod/Printpreview.pm b/copri4/main/src/Mod/Printpreview.pm index 69a0ada..7a53cbf 100755 --- a/copri4/main/src/Mod/Printpreview.pm +++ b/copri4/main/src/Mod/Printpreview.pm @@ -229,7 +229,7 @@ td { #2.seite if($site_all > 1){ #Alles horizontal absolut zum obersten Punkt ausrichten - $h_top = $footer_top + 270;# second header top, depence from footer_top + $h_top = $footer_top + 220;# second header top, depence from footer_top &header_small($h_top,$mandant_main_id,$logo); $h_top +=250; &data_invoice($h_top,$vendor,$kd_nr,$mandat_nr,$ctt->{txt00},$ct_name2print,$mtime); @@ -273,7 +273,7 @@ td { print $q->start_table({-width=>'100%',-border=>'0',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; print "\n"; - print "\n"; + print "\n"; print $q->start_table({-width=>'100%',-border=>'0',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; print $q->Tr(); print $q->td({-class=>'tdpdf4', -style=>'padding-bottom:0.8em;text-decoration:underline;color:black;'}, "$ctf->{txt01} | $ctf->{txt02} | $ctf->{txt03}","\n"); @@ -295,8 +295,10 @@ td { $txid = "Verwendungszweck TXID: $ctt->{txt16}" if($ctt->{txt16} && $ctt->{state} =~ /payone/i); my $mailaccount = ""; $mailaccount = "Account: $ctt->{txt08}" if($ctt->{txt08}); + my $invoice_period = ""; + $invoice_period = "Leistungszeitraum: $ctt->{txt20}" if($ctt->{txt20}); - print ""; + print ""; print $q->start_table({-border=>'0',-align=>'right', -cellpadding=>'0', -cellspacing=>'0'}); print $q->Tr(); print $q->td({-style=>'padding:2em 0;'}," "),"\n"; @@ -305,14 +307,12 @@ td { print $q->Tr(); print $q->td({-class=>'tdpdf5'}, "$mailaccount"),"\n"; print $q->Tr(); - print $q->td({-class=>'tdpdf5'}, "Leistungsdatum: $ctt->{txt20}"),"\n"; + print $q->td({-class=>'tdpdf5'}, "$invoice_period"),"\n"; print $q->end_table; print ""; print ""; print $q->end_table; - #print $q->div({-style=>"text-align:right;width:$width;font-size:1em;"},"Login: $ctt->{txt08} "),"\n"; - #print $q->div({-style=>"text-align:right;width:$width;font-size:1em;"},"Leistungsdatum: $ctt->{txt20} "),"\n" if($ctt->{txt20}); } #end Adresse @@ -489,8 +489,8 @@ td { if("$key" eq "ct_name"){ my $ct_pos = ""; if($cttpos->{$id}->{int09}){#if Tarif defined - $ct_pos = "Endstation: $cttpos->{$id}->{int04}  " if($cttpos->{$id}->{int04}); - $ct_pos .= "Rad: $cttpos->{$id}->{ct_name}"; + $ct_pos = "Endstation: $cttpos->{$id}->{txt13}$cttpos->{$id}->{int04}
" if($cttpos->{$id}->{int04}); + $ct_pos .= "Mietrad: $cttpos->{$id}->{ct_name}"; }else{ $ct_pos = "$cttpos->{$id}->{ct_name}"; } diff --git a/copri4/main/src/Tpl/Liste3.pm b/copri4/main/src/Tpl/Liste3.pm index 20a538c..85d5ef6 100755 --- a/copri4/main/src/Tpl/Liste3.pm +++ b/copri4/main/src/Tpl/Liste3.pm @@ -700,7 +700,9 @@ sub tpl(){ } } keys(%$ct4rel)){ - my ($set_style,$set_style4nr,$sum_error); + my $set_style = ""; + my $set_style4nr = ""; + my $sum_error = 0; my $ecol=0; if($ct4rel->{$id}->{int01} > 0 && $ct4rel->{$id}->{int03} > 0){