diff --git a/copri4/main/src/Mod/Payment.pm b/copri4/main/src/Mod/Payment.pm index ed7cbf3..415974d 100755 --- a/copri4/main/src/Mod/Payment.pm +++ b/copri4/main/src/Mod/Payment.pm @@ -656,7 +656,7 @@ sub payone_capture(){ #send_invoice infomail if(-f "$varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf"){ system(`$varenv->{basedir}/src/scripts/mailTransport.pl "$varenv->{syshost}" "send_invoice" "$ctt->{c_id}" "$praefix-$ctt->{ct_name}.pdf"`); - print EMA "---> Sent Invoice Info e-mail\n"; + print EMA "---> Sent Invoice e-mail command: $varenv->{basedir}/src/scripts/mailTransport.pl '$varenv->{syshost}' 'send_invoice' '$ctt->{c_id}' '$praefix-$ctt->{ct_name}.pdf'\n"; } close EMA; } diff --git a/copri4/main/src/Mod/Prelib.pm b/copri4/main/src/Mod/Prelib.pm index 7fe04d3..1d847ce 100755 --- a/copri4/main/src/Mod/Prelib.pm +++ b/copri4/main/src/Mod/Prelib.pm @@ -317,22 +317,24 @@ sub set_usertarif { print FILE "-1-> txt15: $adr_bonus->{txt15}\n" if($debug); $i++; foreach my $sourcetarif (@{$adr_bonus->{txt30_array}}){ - print FILE "-1.2-> activeTarif-source:$sourcetarif | Bonus-source:$bonus_collect->{$id}->{int21} | Bonus-target:$bonus_collect->{$id}->{int22}\n" if($debug); + print FILE "-1.2-> activeTarif:$sourcetarif | Bonus-source:$bonus_collect->{$id}->{int21} | Bonus-target:$bonus_collect->{$id}->{int22}\n" if($debug); if($sourcetarif eq $bonus_collect->{$id}->{int22}){ print FILE "-2.1-> still activ Bonusnr ct_name: $bonus_collect->{$id}->{ct_name}\n" if($debug); + $u_rows = $dbt->update_one($dbh_operator,$adr_bonus,"txt15='$adr_bonus->{txt15}'"); $ret = "success::txt15"; + push(@new_txt30,$bonus_collect->{$id}->{int22}); #push(@new_txt30,$sourcetarif); - }elsif($bonus_collect->{$id}->{int21} eq $sourcetarif && $bonus_collect->{$id}->{int22}){ + }elsif($sourcetarif eq $bonus_collect->{$id}->{int21} && $bonus_collect->{$id}->{int22}){ + print FILE "-2.2-> match-update Bonusnr ct_name: $bonus_collect->{$id}->{ct_name}\n" if($debug); if($id > 3){#means if not file greped with static c_id <= 3 $dbt->update_content4comp($dbh_operator,$bonus_collect->{$id}->{c_id},"-","1"); } $u_rows = $dbt->update_one($dbh_operator,$adr_bonus,"txt15='$adr_bonus->{txt15}'"); - print FILE "-2.2-> match-update Bonusnr ct_name: $bonus_collect->{$id}->{ct_name}\n" if($debug); $ret = "success::txt15"; push(@new_txt30,$bonus_collect->{$id}->{int22}); }else{ - print FILE "-2.3-> No matching Bonusnr ct_name: $bonus_collect->{$id}->{ct_name}, keeping sourcetarif\n" if($debug); - push(@new_txt30,$sourcetarif); + print FILE "-2.3-> No matching Bonusnr ct_name: $bonus_collect->{$id}->{ct_name}, doing nothing\n" if($debug); + #push(@new_txt30,$sourcetarif); #$ret = "failure::txt15#top1"; } } @@ -340,7 +342,6 @@ sub set_usertarif { if(@new_txt30){ print FILE "-3-> txt30: @new_txt30\n" if($debug); $u_rows = $dbt->update_one($dbh_operator,$adr_bonus,"txt30='@new_txt30'"); - $u_rows = $dbt->update_one($dbh_operator,$adr_bonus,"txt15='$adr_bonus->{txt15}'"); } $ret = "failure::txt30#top2" if(!$adr_bonus->{txt30_array} || $adr_bonus->{txt30_array} !~ /\d/); } diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index 983bf5a..5709243 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -917,17 +917,13 @@ sub preinit(){ if(1==1){#debugging my $filesize = -s "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf"; open(EMA, ">> $varenv{logdir}/copri-print.log"); - print EMA "$today4db\n$topdf --page-size $psize $varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&wc=$wc_line $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf\nreturn: $print_return\nfilesize: $filesize\nexit_code: $exit_code\n"; + print EMA "$today4db\n$topdf --page-size $psize $varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&wc=$wc_line $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf\nreturn: $print_return\nfilesize: $filesize\nexit_code: $exit_code\nset_state: $R::set_state\n"; close EMA; #exit 0; } if($R::set_state ne "buchen"){#no redirect if buchen incl. print_pdf - if( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf" && $varenv{metahost}){ - #print redirect("$varenv{metahost}$script/pdf/$praefix-$ctt->{ct_name}.pdf"); - #exit 0; - print ""; - }elsif( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf"){ + if( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf"){ #print redirect("$varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf"); #exit 0; print ""; diff --git a/copri4/main/src/Mod/Printpreview.pm b/copri4/main/src/Mod/Printpreview.pm index c3f63b5..d1a2a1d 100755 --- a/copri4/main/src/Mod/Printpreview.pm +++ b/copri4/main/src/Mod/Printpreview.pm @@ -343,17 +343,7 @@ td { $ctf = $db->get_content1("contentuser","$mandant_main_id"); #my $umst1619 = $lb->umst_breaking($ctt,""); - my $txt20 = $ctt->{txt20}; - my $max_timestamp = "210001012359"; - if($node->{node_name} !~ /journal/){ - if($txt20 =~ /(\d{2})\.(\d{2})\.(\d{4})$/){ - $max_timestamp = $3 . $2 . $1 . "2359"; - }elsif($ctf->{txt80} =~ /(\d{2})\.(\d{2})\.(\d{4})$/){ - $max_timestamp = $3 . $2 . $1 . "2359"; - } - } - my $max_sum = $ctf->{int03} || "10000"; my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=Mietzeit","int03=Menge","int02=Preis","int07=Rabatt","int04=Gesamt"); my ($cttpos,$rows) = $db->collect_contentpos("contenttrans",$c_id); foreach my $id (keys(%$cttpos)){ @@ -406,21 +396,21 @@ td { foreach my $id (sort { $cttpos->{$b}->{$scol} cmp $cttpos->{$a}->{$scol} } keys(%$cttpos)){ my $cttpos_timestamp = $1 . $2 . $3 . "0000" if($cttpos->{$id}->{itime} =~ /(\d+)\-(\d+)\-(\d+)/); - my $gesamt = 0; - my $rabatt = ""; - my $einzel = $cttpos->{$id}->{int02}; - my $menge = $cttpos->{$id}->{int03} || 0; - my $unit = $cttpos->{$id}->{txt03}; + my $gesamt = 0; + my $rabatt = ""; + my $einzel = $cttpos->{$id}->{int02}; + my $menge = $cttpos->{$id}->{int03} || 0; + my $unit = $cttpos->{$id}->{txt03}; - ($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id}); - $gesamt = $lb->round($gesamt); - $gesamt = $lb->cashme($gesamt,","); + ($gesamt,$rabatt) = $pri->price2calc($cttpos->{$id}); - #max. Rechnungspositionen - if(($gesamt == 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){ + if($gesamt == 0){ $nullcount++; } - if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){ + + if($gesamt != 0){ + $gesamt = $lb->round($gesamt); + $gesamt = $lb->cashme($gesamt,","); $j++; if($j<=$max_table_wc || $break_table_wc){ @@ -453,10 +443,10 @@ td { }else{ $ct_pos = "$cttpos->{$id}->{ct_name}"; } - print $q->td({-class=>'tdint'},"$ct_pos "),"\n"; + print $q->td({-class=>'tdint',-nowrap=>'1'},"$ct_pos "),"\n"; } if($key =~ /txt01/){ - print "