From 6747fa4fc282747a3bdf746311ec45f08ab7b01b Mon Sep 17 00:00:00 2001 From: ragu Date: Tue, 31 Jan 2023 14:58:22 +0100 Subject: [PATCH] minor changes --- copri4/main/src/Mod/Prelogic.pm | 14 +++++++++++--- copri4/main/src/Tpl/Liste3.pm | 7 +++---- copri4/main/src/Tpl/TransInvoices.pm | 8 ++++---- copri4/main/src/Tpl/TransPositionen.pm | 12 ++++++------ copri4/main/src/scripts/Ilockit_cloud.pl | 7 +++++-- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index 30ddd91..56e39e4 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -17,7 +17,7 @@ use Date::Calc qw(:all); use Scalar::Util qw(looks_like_number); use DateTime; use DateTime::Format::Pg; - +use Data::Dumper; use Lib::Config; use Mod::Buttons; use Mod::Libenz; @@ -79,6 +79,10 @@ sub preinit(){ my $aconf = Config::General->new($api_file); my %apikeyconf = $aconf->getall; + open(FILE,">>$varenv{logdir}/Prelogic.log"); + print FILE "\n*--> $now_dt| u_id: $users_dms->{u_id}" . Dumper($q) . "\n"; + + if(!$users_dms->{u_id}){ return "failure::Fehler
Die Anwender Authentifikation wurde unterbrochen."; } @@ -242,7 +246,7 @@ sub preinit(){ }elsif($ct_name && !$rel->{content_id}){ return "failure::Für die Terminzuordnung bitte zuerst einen Verkauf Vorgang öffnen oder neu erzeugen.
::$varenv{wwwhost}/Verkauf::Zum Verkauf"; }else{ - return "failure::Die Artikelnummer konnte nicht gefunden werden.
::$varenv{wwwhost}/Waren::Waren verwalten"; + return "failure::Die Artikelnummer konnte nicht gefunden werden.
::$varenv{wwwhost}/DMS/Waren::Waren verwalten"; } } ##### @@ -562,7 +566,7 @@ sub preinit(){ owner => $users_dms->{u_id}, }; - if(($node_faktura->{invoice_nr} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){ + if($node_faktura->{invoice_nr} > 0 && $ctt->{c_id} > 0 && ($ctt->{ct_name} !~ /\d/ || $R::set_main_id != $rel->{main_id})){ my $nextNr = $node_faktura->{invoice_nr}; $update_ctt->{ct_name} = "$nextNr"; @@ -578,8 +582,11 @@ sub preinit(){ $update_ctt->{int12} = $node->{main_id}; $update_ctt->{txt00} = $node->{node_name}; $u_rows += $dbt->update_record($dbh,$update_ctt,$ctt); + + print FILE "invoice_nr:$invoice_nr,$users_dms->{c_id4trans},$users_dms->{tpl_id4trans} by condition: ($node_faktura->{invoice_nr} > 0) && ($ctt->{ct_name} !~ /\d/ || $R::set_main_id != $rel->{main_id})\n"; } + #SET state alias Zahlung buchen if($R::set_state && !$R::close_time){ my $state = $R::state || ""; @@ -773,6 +780,7 @@ sub preinit(){ } $db->cleanup_users($users_dms->{u_id}); } + close(FILE); ### return "$i_rows-$u_rows-$d_rows"; } diff --git a/copri4/main/src/Tpl/Liste3.pm b/copri4/main/src/Tpl/Liste3.pm index 8e2f604..3580074 100755 --- a/copri4/main/src/Tpl/Liste3.pm +++ b/copri4/main/src/Tpl/Liste3.pm @@ -440,10 +440,9 @@ EOF } #it will takes only one dataset - #if($node_meta->{ct_table} eq "contenttrans" && $c_id4trans && $c_id4trans =~ /^\d+$/){ - # $ct4rel = $db->collect_cid($table,$lang,$tplids,$R::rel_id,$R::barcode,"c_id",$c_id4trans); - #}els - if(!$start_chck && !$end_chck){ + if($node_meta->{ct_table} eq "contenttrans" && $c_id4trans && $c_id4trans =~ /^\d+$/ && $users_dms->{faksum}){ + $ct4rel = $db->collect_cid($table,$lang,$tplids,$R::rel_id,$R::barcode,"c_id",$c_id4trans); + }elsif(!$start_chck && !$end_chck){ #collect search keys foreach my $postkey (@keywords){ diff --git a/copri4/main/src/Tpl/TransInvoices.pm b/copri4/main/src/Tpl/TransInvoices.pm index cd46dea..af18df9 100755 --- a/copri4/main/src/Tpl/TransInvoices.pm +++ b/copri4/main/src/Tpl/TransInvoices.pm @@ -326,7 +326,7 @@ sub tpl(){ my $style = "color:red;" if($ctt->{int01} ne $sum_paid); my $opos = ""; $opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0); - print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"$opos Buchung $vibuchen_mtime \"$ctt->{state}\" $ctt->{int01} €"),"\n"; + print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"$opos $vibuchen_mtime \"$ctt->{state}\" $ctt->{int01} €"),"\n"; } } else{ @@ -345,9 +345,9 @@ sub tpl(){ my $send_invoice_checkbox = 0; #$send_invoice_checkbox = 0 if($ctt->{txt30}); print $q->div({-class=>'element6',-style=>'float:right;'}, $q->b("$ctt->{txt00}"), - " PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""), - " eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""), - " Zahlungsart ", + ": PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""), + " – eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""), + " – Zahlungsart ", $but->selector("state","250px",$kind_of_payment,@_paymentstate), $but->singlesubmit1("set_state","buchen")), "\n"; diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm index 3915a37..099d1f8 100755 --- a/copri4/main/src/Tpl/TransPositionen.pm +++ b/copri4/main/src/Tpl/TransPositionen.pm @@ -76,8 +76,8 @@ sub tpl(){ my $ctadr = $db->get_content1("contentadr",$ctt->{int10}); my $buchen_mtime = $lb->time4de($ctt->{mtime}); - my $vibuchen_mtime = ""; - $vibuchen_mtime = "payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time}); + my $vibuchen_mtime = $lb->time4de($ctt->{mtime},1); + $vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time}); my @tpl_order = ("txt01=Beschreibung","ct_name=Nummer","date_time=timerange","int03=Menge (Miet - Gratis Zeit)","int02=Preis","int07=Rabatt","int04=Gesamt"); my $tplf = $db->get_tpl("201");#Kunden-Faktura, ex Firma @@ -557,16 +557,16 @@ EOF my $style = "color:red;" if($ctt->{int01} ne $sum_paid); my $opos = ""; $opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0); - print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"$opos Buchung $vibuchen_mtime \"$ctt->{state}\" $ctt->{int01} €"),"\n"; + print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"$opos $vibuchen_mtime \"$ctt->{state}\" $ctt->{int01} €"),"\n"; } if(!$ctt->{close_time}){ my $send_invoice_checkbox = 1; $send_invoice_checkbox = 0 if($ctt->{txt30} || $ctt->{ct_name} =~ /\d-\d/); print $q->div({-class=>'element6',-style=>'float:right;'}, $q->b("$ctt->{txt00}"), - " PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""), - " eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""), - " Zahlungart ", + ": PDF drucken ",$but->checkbox("print_pdf","ct_trans","1","PDF drucken",""), + " – eMail senden ",$but->checkbox("1","send_invoice","$send_invoice_checkbox","eMail $ctt->{txt00}",""), + " – Zahlungart ", $but->selector("state","250px",$kind_of_payment,@_paymentstate), $but->singlesubmit1("set_state","buchen")), "\n"; diff --git a/copri4/main/src/scripts/Ilockit_cloud.pl b/copri4/main/src/scripts/Ilockit_cloud.pl index 881bb56..7d6609f 100755 --- a/copri4/main/src/scripts/Ilockit_cloud.pl +++ b/copri4/main/src/scripts/Ilockit_cloud.pl @@ -427,8 +427,11 @@ sub get_positions { #theft mailing if($c_id && $theftmove_count > $dbt->{copri_conf}->{theftalarm}->{move_count} && ($resp->{speed} > $dbt->{copri_conf}->{theftalarm}->{speed} || $resp->{attributes}->{distance} > $dbt->{copri_conf}->{theftalarm}->{meter})){ #send mail - system("$dbt->{copri_conf}->{basedir}/$op_name->{syshost}/src/scripts/mailTransportcms.pl '$op_name->{syshost}' 'send_alarm2hotline' '1' '$c_id' ''"); - print FILE "$dbt->{copri_conf}->{basedir}/$op_name->{syshost}/src/scripts/mailTransportcms.pl '$op_name->{syshost}' 'send_alarm2hotline' '1' '$c_id' ''\n\n"; + #max ~ 10 mails + if($theftmove_count < 10){ + system("$dbt->{copri_conf}->{basedir}/$op_name->{syshost}/src/scripts/mailTransportcms.pl '$op_name->{syshost}' 'send_alarm2hotline' '1' '$c_id' ''"); + print FILE "$dbt->{copri_conf}->{basedir}/$op_name->{syshost}/src/scripts/mailTransportcms.pl '$op_name->{syshost}' 'send_alarm2hotline' '1' '$c_id' ''\n\n"; + } } }