From 814692903fb975f694f4772e28cafc511cf285dc Mon Sep 17 00:00:00 2001 From: ragu Date: Fri, 10 Feb 2023 12:04:30 +0100 Subject: [PATCH] Faktura warning workflow refactor --- copri4/main/css/local_style20230105.css | 7 +- copri4/main/src/Mod/APIjsonclient.pm | 3 +- copri4/main/src/Mod/Buttons.pm | 18 ++- copri4/main/src/Mod/Indexsharee.pm | 5 +- copri4/main/src/Mod/Prelib.pm | 19 ++- copri4/main/src/Mod/Prelogic.pm | 41 ++---- copri4/main/src/Mod/Printpreview.pm | 11 +- copri4/main/src/Tpl/Address3.pm | 170 +++++++++++------------ copri4/main/src/Tpl/Calorin.pm | 10 +- copri4/main/src/Tpl/TransPositionen.pm | 47 +++++-- copri4/main/src/scripts/Ilockit_cloud.pl | 4 +- 11 files changed, 175 insertions(+), 160 deletions(-) diff --git a/copri4/main/css/local_style20230105.css b/copri4/main/css/local_style20230105.css index 376b732..444d21d 100755 --- a/copri4/main/css/local_style20230105.css +++ b/copri4/main/css/local_style20230105.css @@ -509,11 +509,12 @@ div#Oline { } .tdval5 { padding:0.5em 1em; + margin:0; vertical-align: top; text-align: left; - min-width:200px; - font-size:0.81em; - background-color:white; + font-size:0.91em; + border: 0px solid green; + background-color:#f2f5de; } .tdtxt { padding:0.2em 0.5em; diff --git a/copri4/main/src/Mod/APIjsonclient.pm b/copri4/main/src/Mod/APIjsonclient.pm index ae26790..5b8d3c5 100755 --- a/copri4/main/src/Mod/APIjsonclient.pm +++ b/copri4/main/src/Mod/APIjsonclient.pm @@ -80,7 +80,8 @@ sub loop_sharees { #if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $op_name->{project}))){ #to reduce request time by ($return_merchant->{project_id} eq "Freiburg") we do it only for shareeweb-sharee.copri.eu - if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{project_id} eq "Freiburg" || ($return_merchant->{project_id} eq $op_name->{project}))){ + #if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{project_id} eq "Freiburg" || ($return_merchant->{project_id} eq $op_name->{project}))){ + if($op_name->{operatorApp} && ($users_serviceapp->{u_id} || $return_merchant->{merchant_id} eq $globalconf{website}->{'shareeweb-sharee'}->{merchant_id} || ($return_merchant->{project_id} eq $op_name->{project}))){ #$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $op_name->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $op_name->{project} || $users_serviceapp->{u_id} > 0)\n","",""); $ret_json = $self->fetch_operator_json("$op_name->{operatorApp}/APIjsonserver",$rest); diff --git a/copri4/main/src/Mod/Buttons.pm b/copri4/main/src/Mod/Buttons.pm index 898c832..9493e15 100755 --- a/copri4/main/src/Mod/Buttons.pm +++ b/copri4/main/src/Mod/Buttons.pm @@ -557,9 +557,14 @@ sub singlesubmit3(){ # without grafic sub singlesubmit7(){ my $self = shift; - my ($function,$b_name,$title,$set_style,$jscript,$ebutton) = @_; - $ebutton = "ebutton" if(!$ebutton); - my ($b_img,$a_key); + my $function = shift; + my $b_name = shift; + my $title = shift || ""; + my $set_style = shift || ""; + my $jscript = shift || ""; + my $autofocus = shift || ""; + + my $b_img = "";; $b_img = "Barcode" if("$b_name" =~ /barcode/); $b_img = "Copy" if("$b_name" =~ /copy/); $b_img = "Relate" if("$b_name" =~ /relate/); @@ -567,7 +572,6 @@ sub singlesubmit7(){ $b_img = "Delete" if("$b_name" =~ /delete|remove/); $b_img = "Delete" if("$b_name" =~ /delete_media/); $b_img = "Save" if("$b_name" =~ /save|service_done|_contenttverpos/); - $a_key = "y" if("$b_name" =~ /save/); $b_img = "Text & State Save" if("$b_name" =~ /save_text/); $b_img = "Delete All" if("$b_name" =~ /delete_all/); $b_img = "Search" if("$b_name" =~ /search/); @@ -588,11 +592,11 @@ sub singlesubmit7(){ my $button = " "; if($b_name){ if("$b_name" =~ /delete/){ - $button = ""; + $button = ""; }elsif($jscript){ - $button = ""; + $button = ""; }else{ - $button = ""; + $button = ""; } } return $button; diff --git a/copri4/main/src/Mod/Indexsharee.pm b/copri4/main/src/Mod/Indexsharee.pm index 2d2b808..d77e4d0 100755 --- a/copri4/main/src/Mod/Indexsharee.pm +++ b/copri4/main/src/Mod/Indexsharee.pm @@ -394,7 +394,10 @@ sub handler { }elsif($R::detail_search && $R::detail_search eq "operator_accounting"){ my $ck4ex = "@R::ck4ex" || ""; $return = $pl->operator_accounting($q,$users_dms,$users_sharee,$R::accounting_type,$ck4ex); - }elsif($R::ct_trans){ + }elsif($R::ct_trans || $R::v_abschluss || $R::trans2edit){ + if($R::ct_trans ne "open" && looks_like_number($R::c_id4trans) && !$R::v_abschluss && !$R::trans2edit){ + $feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans); + } $return .= "|"; $return .= $pre->preinit($users_dms,$lang);#transactions logic } diff --git a/copri4/main/src/Mod/Prelib.pm b/copri4/main/src/Mod/Prelib.pm index cae4dc7..67c12e2 100755 --- a/copri4/main/src/Mod/Prelib.pm +++ b/copri4/main/src/Mod/Prelib.pm @@ -165,9 +165,17 @@ sub save_text2contenttrans { if($ctt->{c_id}){ $u_rows += $dbt->update_record($dbh,$update_ctt,$ctt); #empty warn_time if warnstate not set - if(!$R::int06){ + if(!$R::int06 && $R::txt00 eq "Rechnung"){ $dbt->update_one($dbh,$update_ctt,"warn_time=null",$c_id); } + if($R::txt22 && $R::txt22 eq "Zahlungseingang"){ + $dbt->update_one($dbh,$update_ctt,"int14=null",$c_id); + $dbt->update_one($dbh,$update_ctt,"pay_time=now()",$c_id); + } + if($R::txt22 && $R::txt22 eq "Zahlung offen"){ + $dbt->update_one($dbh,$update_ctt,"int14=1",$c_id); + $dbt->update_one($dbh,$update_ctt,"pay_time=null",$c_id); + } } $feedb->{u_rows} = $u_rows; @@ -504,13 +512,13 @@ sub set_workflow { delete $ctt->{txt22}; delete $ctt->{txt23}; delete $ctt->{txt25}; - delete $ctt->{txt28}; delete $ctt->{txt30}; delete $ctt->{itime}; delete $ctt->{mtime}; delete $ctt->{close_time}; delete $ctt->{invoice_time}; delete $ctt->{pay_time}; + delete $ctt->{warn_time}; my $insert_ctt = { %$ctt, @@ -556,9 +564,10 @@ sub set_workflow { } $db->update_users4trans($c_idnew,"218","",$users_dms->{u_id}); - my $uri_path = $dbt->recurse_node($dbh,$node->{main_id}); - print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n"; - print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows"); + #my $uri_path = $dbt->recurse_node($dbh,$node->{main_id}); + #print "$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows\n"; + #print redirect("$varenv{wwwhost}/$uri_path?return=$i_rows-$u_rows-$d_rows"); + print redirect("$varenv{wwwhost}/DMS/Faktura?ct_trans=open\&c_id4trans=$c_idnew\&tpl_id4trans=218\&owner=$users_dms->{u_id}\&offset=$R::offset\&limit=$R::limit\&return=$i_rows-$u_rows-$d_rows"); exit 0; }#end set_workflow diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index d47c164..61958f6 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -84,25 +84,10 @@ sub preinit(){ if(!$users_dms->{u_id}){ - return "failure::Fehler
Die Anwender Authentifikation wurde unterbrochen."; + return "failure::Fehler
Die Sitzung wurde unterbrochen."; } - #Mindestmengenanzeige #ist in Liste.pm implementiert - #if(!$R::detail_search && $path =~ /root$/ && "$R::redirected" ne "1"){ - # my $repath = $lb->shortcut2("$path","$users_dms->{u_id}"); - #print redirect("$varenv{wwwhost}$script$repath?redirected=1&detail_search=1&s_int03=<=0"); - #exit 0; - #}els - #topmenu shortcut handling - #if(!$R::no_redirect && !$R::detail_search && $path =~ /^\/([\w-\s]+)\/([\w-\s]+)$|root$/ && "$R::redirected" ne "1"){ - # my $repath = $lb->shortcut2("$path","$users_dms->{u_id}"); - # if("$repath" ne "$path"){ - # print redirect("$varenv{wwwhost}$script$repath?redirected=1\&return=0-0-0|$i_rows-$u_rows-$d_rows"); - # exit 0; - # } - #} - - if(!looks_like_number($R::c_id4trans) || !looks_like_number($R::tpl_id4trans)){ + if((!looks_like_number($R::c_id4trans) || !looks_like_number($R::tpl_id4trans)) && $R::ct_trans !~ /delete_trans/ && !$R::v_abschluss){ print FILE Dumper($q); return "failure::Fehler
Daten ID's nicht vollständig ($R::c_id4trans || $R::tpl_id4trans)"; } @@ -500,8 +485,8 @@ sub preinit(){ $d_rows += $db->delete_content($table,$ctt->{c_id}); $db->update_users4trans("0","0","",$users_dms->{u_id}); - print $q->div({-class=>'elementwhite'},"2... redirecting to ... or CLICK ", $q->a({href=>"$varenv{wwwhost}$script$path"},"$varenv{wwwhost}$script$path")); - print redirect("$varenv{wwwhost}$script$path?redirected=1\&return=0-0-0|$i_rows-$u_rows-$d_rows"); + print $q->div({-class=>'elementwhite'},"2... redirecting to ... or CLICK ", $q->a({href=>"$varenv{wwwhost}$script$path"},"$varenv{wwwhost}/DMS/Faktura")); + print redirect("$varenv{wwwhost}/DMS/Faktura?redirected=1\&return=0-0-0|$i_rows-$u_rows-$d_rows"); exit 0; } @@ -569,8 +554,8 @@ sub preinit(){ owner => $users_dms->{u_id}, }; - print FILE "c_id4trans:$R::c_id4trans,tpl_id4trans:$R::tpl_id4trans by condition: ($node_faktura->{invoice_nr} > 0) && ($ctt->{ct_name} !~ /\d/ || $R::set_main_id != $rel->{main_id})\n"; - if($node_faktura->{invoice_nr} > 0 && $ctt->{c_id} > 0 && ($ctt->{ct_name} !~ /\d/ || $R::set_main_id != $rel->{main_id})){ + print FILE "c_id4trans:$R::c_id4trans,tpl_id4trans:$R::tpl_id4trans by condition: ($node_faktura->{invoice_nr} > 0) && $ctt->{ct_name} !~ /\d/)\n old-relation $rel->{main_id} \n new-relation $R::set_main_id\n"; + if($node_faktura->{invoice_nr} > 0 && $ctt->{c_id} > 0 && $ctt->{ct_name} !~ /\d/){ my $nextNr = $node_faktura->{invoice_nr}; $update_ctt->{ct_name} = "$nextNr"; @@ -587,7 +572,6 @@ sub preinit(){ $update_ctt->{txt00} = $node->{node_name}; $u_rows += $dbt->update_record($dbh,$update_ctt,$ctt); - print FILE "invoice_nr:$invoice_nr,c_id4trans:$R::c_id4trans,tpl_id4trans:$R::tpl_id4trans by condition: ($node_faktura->{invoice_nr} > 0) && ($ctt->{ct_name} !~ /\d/ || $R::set_main_id != $rel->{main_id})\n"; } @@ -609,7 +593,7 @@ sub preinit(){ } $update_ctt->{state} = "$state"; - $update_ctt->{int14} = 2 if($state =~ /payone/);#set OPOS + $update_ctt->{int14} = 2;#set OPOS $u_rows += $dbt->update_record($dbh,$update_ctt,$ctt); if($state =~ /payone/){ @@ -631,10 +615,10 @@ sub preinit(){ $ctt = $db->get_content1("contenttrans",$ctt->{c_id}); } - if($ctadr->{int03} == 1 && $ctadr->{ct_name} =~ /\w{2}-\d+/){ + if($ctadr->{ct_name} =~ /\w{2}-\d+/){ my $payoneret = $payone->preauthorizationSEPA_main(\%varenv,$ctadr,$ctt,$users_dms->{u_id}); sleep 2; - }elsif($ctadr->{int03} == 2 && length($ctadr->{ct_name}) >= 19){ + }elsif(length($ctadr->{ct_name}) >= 19){ my $payoneret = $payone->preauthorizationCC_main(\%varenv,$ctadr,$ctt,$users_dms->{u_id}); sleep 2; } @@ -663,8 +647,11 @@ sub preinit(){ #}else{ #return "failure::Payone Geldeinzug nicht ausgeführt. Hat der Einzug bereits stattgefunden?"; } - }else{ - $db->updater($table,"c_id",$ctt->{c_id},"int14","null","","","","",""); + }elsif($ctt->{txt00} eq "Storno" || $state eq "Zahlungsausfall"){ + $update_ctt->{int14} = "null"; + $update_ctt->{pay_time} = "now()"; + $u_rows += $dbt->update_record($dbh,$update_ctt,$ctt); + $db->updater($table,"ct_name",$ctt->{barcode},"int14","null","","","","","");#delete OPOS also on basic invoice } } diff --git a/copri4/main/src/Mod/Printpreview.pm b/copri4/main/src/Mod/Printpreview.pm index 044b8d7..ed61c55 100755 --- a/copri4/main/src/Mod/Printpreview.pm +++ b/copri4/main/src/Mod/Printpreview.pm @@ -407,12 +407,11 @@ td { $mandat_nr = " Mandatsreferenz: $ctt->{txt26}" if($ctt->{txt26} =~ /\w{2}-/); my $invoice_time = $ctt->{invoice_time} || $ctt->{mtime}; - #my $update_ctt = { - # table => "contenttrans", - # pay_time => "$invoice_time", - # }; - #necersarry for non payone capture - #$dbt->update_record($dbh,$update_ctt,$ctt) if(!$ctt->{pay_time}); + my $update_ctt = { + table => "contenttrans", + invoice_time => "$invoice_time", + }; + $dbt->update_record($dbh,$update_ctt,$ctt); my $mtime = $lb->time4de("$invoice_time",""); my $position = ""; diff --git a/copri4/main/src/Tpl/Address3.pm b/copri4/main/src/Tpl/Address3.pm index c5f81ac..c5c8758 100755 --- a/copri4/main/src/Tpl/Address3.pm +++ b/copri4/main/src/Tpl/Address3.pm @@ -189,16 +189,39 @@ EOF print $q->end_form,"\n"; print $q->div({-style=>'position:fixed;bottom:2%;right:1%;z-index:10;font-size:13px;'}," (c_id: $ctt->{c_id} | rel_id: $ctt->{rel_id} | tpl_id: $ctt->{tpl_id})"),"\n" if($users_dms->{u_id} eq $varenv{superu_id}); ########## - + + #Relationen + if($ctt->{barcode}){ + my $pref_rel = { + table => "contenttrans", + fetch => "all", + keyfield => "c_id", + barcode => $ctt->{barcode}, + }; + my $ctt_rel = ""; + $ctt_rel = $dbt->fetch_record($dbh,$pref_rel); + + if(ref($ctt_rel) eq "HASH"){ + my $top = 30; + foreach my $id (sort { $ctt_rel->{$b}->{c_id} <=> $ctt_rel->{$a}->{c_id} } keys (%$ctt_rel)){ + my $toppx = $top . "px"; + print $q->div({-style=>"position:absolute;top:$toppx;right:10px;font-size:0.91em;background-color:#f7ae37"}, $q->a({-class=>"linknav",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Faktura/$ctt_rel->{$id}->{node_name}?ct_trans=open\&c_id4trans=$ctt_rel->{$id}->{c_id}\&tpl_id4trans=$ctt_rel->{$id}->{template_id}\&owner=$users_dms->{u_id}",-title=>"Faktura Terminal öffnen"},"[ $ctt_rel->{$id}->{txt00} #$ctt_rel->{$id}->{ct_name} ]")),"\n"; + $top += 22; + } + } + } + + + #Form for AdressData print $q->start_form(-name=>'addressform'),"\n"; #Big table - print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; + print $q->start_table({-border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; print "\n"; - print $q->start_table({-class=>'list', -height=>'10em',-border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; + print $q->start_table({-class=>'list', -height=>'10em',-border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; ###Content #Edit Address --> template=Adressenliste $ctt->{txt01} = $q->unescapeHTML("$ctt->{txt01}"); my $int05 = ""; @@ -213,7 +236,7 @@ EOF print $q->Tr(),"\n"; print ""; - print $but->singlesubmit7("ct_trans","save_adr","$ib{save_adr}","","","ebutton"),"\n"; + print $but->singlesubmit7("ct_trans","save_adr","$ib{save_adr}","","","autofocus"),"\n"; #print $q->span($q->a({-class=>"ebutton3",-href=>'javascript:history.back()'}, " back ")); print "\n"; print $q->td({-class=>'tdval4',-colspan=>'2'},"Kunden ID $c_idadr"),"\n"; @@ -283,7 +306,7 @@ EOF print "\n"; print "\n"; - print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; + print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; #if operator accounting/invoice if($node_meta->{tpl_id} == 208 || $ctt->{int10} == 2){ @@ -363,123 +386,92 @@ EOF print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"),"\n"; #Text save area - print "\n"; - print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; + #Internas und Bearbeitungstatus + print "\n"; + print $q->start_table({-border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; - my @s_valxx = (""); - my $s_hash = {}; - $s_hash = $dbt->{shareedms_conf}->{warning_state}; - foreach my $s_key (sort keys (%{ $s_hash })) { - push @s_valxx, "$s_key:($s_key) $s_hash->{$s_key}"; + #1. + print $q->Tr(),"\n"; + print $q->td({-class=>'tdval5',-style=>'height:40px;',-colspan=>"1"},$q->span({-style=>'font-weight:bold;'},"Internas und Bearbeitungstatus")),"\n"; + if($ctt->{txt00} ne "Storno"){ + my @_orderstate = split(/\|/,$dbt->{shareedms_conf}->{order_state}); + print $q->td({-class=>'tdval5',-colspan=>1},$but->selector("txt22","180px",$ctt->{txt22},@_orderstate)),"\n"; + }else{ + print $q->td({-class=>'tdval5',-colspan=>"1"}," "),"\n"; } - print $q->Tr(),"\n"; - print $q->td({-class=>'tdval5',-colspan=>"1"},$q->span({-style=>'font-weight:bold;'},"Internas und Bearbeitungstatus")),"\n"; - if($ctt->{txt00} eq "Storno"){ - print $q->td({-class=>'tdval5',-colspan=>"1"},""),"\n"; + #2. + print $q->Tr(),"\n"; + if($ctt->{txt00} eq "Storno" || $ctt->{ct_name} =~ /\d+-\d/){ + print $q->td({-class=>'tdval5',-colspan=>"2"}," "),"\n"; }else{ + my @s_valxx = (""); + my $s_hash = {}; + $s_hash = $dbt->{shareedms_conf}->{warning_state}; + foreach my $s_key (sort keys (%{ $s_hash })) { + push @s_valxx, "$s_key:$s_key"; + } + if($ctt->{ct_name} =~ /^\d+$/){ undef @s_valxx[3]; undef @s_valxx[4]; undef @s_valxx[5]; } - print $q->td({-class=>'tdval5',-colspan=>"1"},"Mahnstufe",$but->selector_class("int06","","",$ctt->{int06},@s_valxx)),"\n"; + print $q->td({-class=>'tdval5',-colspan=>"1"},"Zahlungserinnerung",$but->selector_class("int06","","",$ctt->{int06},@s_valxx)),"\n"; + print $q->td({-class=>'tdval5',-colspan=>1},"Fälligkeit",$q->textfield(-id=>'datepicker3',-class=>'etxt',-name=>"warn_time",-default=>"$warn_time",-override=>1,-size=>"8",-maxlength=>10)),"\n"; } - print $q->td({-class=>'tdval5',-colspan=>"2"},$q->span({-style=>'font-weight:bold;'},"PDF Formular Text "),$q->span({-style=>'color:silver;font-weight:normal;'}," ( für den Kunden sichtbar )")),"\n"; - if($dbt->{shareedms_conf}->{order_state}){ - print $q->Tr(),"\n"; - my @_orderstate = split(/\|/,$dbt->{shareedms_conf}->{order_state}); - print $q->td({-class=>'tdval5',-colspan=>1},$but->selector("txt22","180px",$ctt->{txt22},@_orderstate)),"\n"; - if($ctt->{txt00} eq "Storno"){ - print $q->td({-class=>'tdval5',-colspan=>"1"},""),"\n"; - }else{ - print $q->td({-class=>'tdval5',-colspan=>1},"Fälligkeit",$q->textfield(-id=>'datepicker3',-class=>'etxt',-name=>"warn_time",-default=>"$warn_time",-override=>1,-size=>"8",-maxlength=>10)),"\n"; - } - - } + #3. $ctt->{txt23} = $q->unescapeHTML("$ctt->{txt23}") if($ctt->{txt23}); print $q->Tr(),"\n"; print $q->td({-class=>'tdval5',-colspan=>'2'},$q->textarea(-class=>'etxt',-name=>'txt23', -default=>"$ctt->{txt23}", -rows=>8, -columns=>65)),"\n"; + print $q->end_table,"\n"; + print "\n"; + #------------------------------ + + #PDF Formular Text + print "\n"; + print $q->start_table({-border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; + + #1. + print $q->Tr(),"\n"; + print $q->td({-class=>'tdval5',-style=>'height:40px;',-colspan=>"2"},$q->span({-style=>'font-weight:bold;'},"PDF Formular Text "),$q->span({-style=>'color:silver;font-weight:normal;'}," ( für den Kunden sichtbar )")),"\n"; + + #2. + print $q->Tr(),"\n"; + print $q->td({-class=>'tdval5',-style=>'',-colspan=>"2"}," "),"\n"; + #print $q->td({-class=>'tdval5',-style=>'height:45px;',-colspan=>"2"},"Zahlungseingang",$but->rev_checkbox("4","int14","$ctt->{int14}")),"\n"; + + #3. $ctt->{txt12} = $q->unescapeHTML($ctt->{txt12}) || ""; + print $q->Tr(),"\n"; print $q->td({-class=>'tdval5',-colspan=>'2'},$q->textarea(-class=>'etxt',-name=>'txt12', -default=>"$ctt->{txt12}", -rows=>8, -columns=>65)),"\n"; - print $q->Tr(),"\n"; $line_count1++; - my @line_txt12 = split(/\n/,$ctt->{txt12}); - $line_count1 += scalar(@line_txt12); - - #Vorbelegung-Text - my $formular_text = ""; - my $set_text_id; - #at first empty checkbox definition (txt21='txt61,txt62,...') - print $q->hidden(-name=>"off_txt21",-override=>1,-value=>""); - foreach(@tplf_order){ - my ($key,$des,$size) = split /=/,$_; - if($key =~ /txt6/ && $ctf->{$key}){ - $ctf->{$key} = $q->unescapeHTML("$ctf->{$key}"); - my $substrtxt = $lb->sub4txt($ctf->{$key},"0","14"); - my $check=""; - $check=1 if($ctt->{txt21} && $ctt->{txt21} =~ /$key/); - $formular_text .= " [ $key $substrtxt..." . $but->checkbox("$key","$key","$check","$ctf->{$key}") . " ] "; - if($ctt->{txt21} && $ctt->{txt21} =~ /$key/){ - my @line_key = split(/\n/,$ctf->{$key}); - $line_count1 += scalar(@line_key); - $ctf->{$key} = $lb->newline($ctf->{$key},"",""); - print $q->Tr(); $line_count1++; - print $q->td({-class=>'tdval5',-colspan=>2},"$ctf->{$key}"),"\n"; - } - } - } - ### - - print $q->Tr(),"\n"; - if($ctt->{close_time}){ - print $q->td({-class=>'tdval5',-colspan=>2}, $but->singlesubmit7("ct_trans","save_text_internas","$ib{save_text}","","","ebutton"),"$formular_text"),"\n"; - }else{ - print $q->td({-class=>'tdval5',-colspan=>2}, $but->singlesubmit7("ct_trans","save_text","$ib{save_text}","","","ebutton"),"$formular_text"),"\n"; - } print $q->end_table,"\n"; print "\n"; + print $q->Tr(),"\n"; + if($ctt->{close_time}){ + print $q->td({-class=>'tdval5',-style=>'width:90%;',-colspan=>2}, $but->singlesubmit7("ct_trans","save_text_internas","$ib{save_text}","","","autofocus")),"\n"; + }else{ + print $q->td({-class=>'tdval5',-style=>'width:90%;',-colspan=>2}, $but->singlesubmit7("ct_trans","save_text","$ib{save_text}","","","autofocus")),"\n"; + } + print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$ctt->{c_id}"),"\n"; - print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"),"\n"; + #print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"),"\n"; print $q->end_form,"\n"; print $q->end_table,"\n"; ###end Big - if($ctt->{barcode}){ - my $pref_rel = { - table => "contenttrans", - fetch => "all", - keyfield => "c_id", - barcode => $ctt->{barcode}, - c_id => "!=::$ctt->{c_id}", - }; - my $ctt_rel = ""; - $ctt_rel = $dbt->fetch_record($dbh,$pref_rel); - - if(ref($ctt_rel) eq "HASH"){ - print "
Relationen\n"; - foreach my $id (sort { $ctt_rel->{$b}->{c_id} <=> $ctt_rel->{$a}->{c_id} } keys (%$ctt_rel)){ - print $q->span({-style=>"background-color:#f7ae37"}, $q->a({-class=>"linknav",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Faktura/$ctt_rel->{$id}->{node_name}?ct_trans=open\&c_id4trans=$ctt_rel->{$id}->{c_id}\&tpl_id4trans=$ctt_rel->{$id}->{template_id}\&owner=$users_dms->{u_id}",-title=>"Faktura Terminal öffnen"},"[ $ctt_rel->{$id}->{txt00} #$ctt_rel->{$id}->{ct_name} ]")),"\n"; - } - print "
\n"; - } - } - #payone-return log $ctt->{txt28} = $lb->newline($ctt->{txt28},"",""); print $q->div({-id=>'Oline'},""),"\n"; print $q->div({-style=>'padding: 0 15px 20px 15px;font-size:0.91em;'},"payone-response log
$ctt->{txt28}"),"\n"; - $line_count2 = "0" . "$line_count2" if($line_count2 < 10); - my $line_count = "$line_count1.$line_count2"; - #print $q->div({style=>'font-size:0.81em;'},"line to print -> address+text: $line_count1 | table: $line_count2"),"\n"; - #$db->update_content4change2("contenttrans",$ctt->{c_id},"$line_count","int04") if($ctt->{c_id}); print "\n"; - return $line_count; + return; } 1; diff --git a/copri4/main/src/Tpl/Calorin.pm b/copri4/main/src/Tpl/Calorin.pm index 9ba95b1..8edab80 100755 --- a/copri4/main/src/Tpl/Calorin.pm +++ b/copri4/main/src/Tpl/Calorin.pm @@ -222,9 +222,9 @@ sub tpl(){ if(!$R::theft_details){ $search->{int10} = "IN::(7,8)"; $search->{int03} = ">::$dbt->{copri_conf}->{theftalarm}->{move_count}";#move count - #$search->{int07} = ">::$dbt->{copri_conf}->{theftalarm}->{speed}";#speed - #$search->{int08} = ">::$dbt->{copri_conf}->{theftalarm}->{meter}";#meter - $search->{speedORmeter} = "(cp.int07 > $dbt->{copri_conf}->{theftalarm}->{speed} OR cp.int08 > $dbt->{copri_conf}->{theftalarm}->{meter})"; + $search->{int07} = ">::$dbt->{copri_conf}->{theftalarm}->{speed}";#speed + $search->{int08} = ">::$dbt->{copri_conf}->{theftalarm}->{meter}";#meter + #$search->{speedORmeter} = "(cp.int07 > $dbt->{copri_conf}->{theftalarm}->{speed} OR cp.int08 > $dbt->{copri_conf}->{theftalarm}->{meter})"; } $cttpos = $dbt->collect_theftpos($dbh,$search); } @@ -532,8 +532,8 @@ sub tpl(){ print "\n"; print $q->div({-style=>'clear:both;'}, " "),"\n"; - print $q->div({-style=>'text-align:left;text-decoration:underline;padding:0 0.5em;'}, "Legende"),"\n"; - if($node_meta->{ct_table} eq "contenttheftpos"){ + if(1==2 && $node_meta->{ct_table} eq "contenttheftpos"){ + print $q->div({-style=>'text-align:left;text-decoration:underline;padding:0 0.5em;'}, "Legende"),"\n"; print $q->div({-style=>'text-align:left;font-style:italic;padding:0.1em 0.5em;'}, $q->span({-style=>'padding:0 0.8em;',-style=>"color:$node_meta->{bg_color};"},"Alarm detected:"), "Es wurde eine Bewegung (Erschütterung) mit abgeschlossenem Rahmenschloss erkannt"),"\n"; print $q->div({-style=>'text-align:left;font-style:italic;padding:0.1em 0.5em;'}, $q->span({-style=>'padding:0 0.8em;',-style=>"color:$node_meta->{bg_color};"},"Alarm movement:"), "Es wurde eine Fortbewegung mit abgeschlossenem Rahmenschloss erkannt"),"\n"; } diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm index 099d1f8..5c4008c 100755 --- a/copri4/main/src/Tpl/TransPositionen.pm +++ b/copri4/main/src/Tpl/TransPositionen.pm @@ -76,8 +76,9 @@ sub tpl(){ my $ctadr = $db->get_content1("contentadr",$ctt->{int10}); my $buchen_mtime = $lb->time4de($ctt->{mtime}); - my $vibuchen_mtime = $lb->time4de($ctt->{mtime},1); - $vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time}); + my $vibuchen_mtime = ""; + #my $vibuchen_mtime = $lb->time4de($ctt->{mtime},1); + #$vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time} && $ctt->{state} =~ /payone/); 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 @@ -423,7 +424,7 @@ EOF $tariff = ", Tarif: $cttpos->{$id}->{int09} $cttpos->{$id}->{txt04}" if($cttpos->{$id}->{txt04}); print $q->span("$bike $tariff
"),"\n"; } - if($cttpos->{$id}->{int06} || $cttpos->{$id}->{int04}){ + if($cttpos->{$id}->{int06} && $cttpos->{$id}->{int04}){ print $q->span("Start/End Station: $cttpos->{$id}->{int06} / $cttpos->{$id}->{int04}, GPS: $cttpos->{$id}->{txt06}"),"\n"; } if($cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){ @@ -445,6 +446,10 @@ EOF } }#foreach end + print $q->end_form,"\n";#en transposform + + print $q->start_form(-name=>'set_stateform'),"\n"; + if($sum_parts19 && $sum_parts19 != 0){ $sum_umst19 = $sum_parts19 / $diff19 * 19; $sum_umst19 = $pri->round($sum_umst19); @@ -555,9 +560,10 @@ EOF if($ctt->{state} && $ctt->{int01}){ $ctt->{int01} =~ s/\./,/; 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 $vibuchen_mtime \"$ctt->{state}\" $ctt->{int01} €"),"\n"; + $vibuchen_mtime = $lb->time4de($ctt->{pay_time},1) if($ctt->{pay_time}); + 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 Summe $ctt->{int01} € gebucht per \"$ctt->{state}\" am $vibuchen_mtime "),"\n"; } if(!$ctt->{close_time}){ @@ -571,9 +577,29 @@ EOF $but->singlesubmit1("set_state","buchen")), "\n"; } + + if($ctt->{txt00} ne "Storno" && $ctt->{ct_name} !~ /^\d+$/){ + my @s_valxx = (""); + my $s_hash = {}; + $s_hash = $dbt->{shareedms_conf}->{warning_state}; + foreach my $s_key (sort keys (%{ $s_hash })) { + push @s_valxx, "$s_key:($s_key) $s_hash->{$s_key}"; + } + my $warn_time = $ctt->{warn_time} || ""; + $warn_time = $lb->time4de($warn_time,0) if($warn_time); + + if($ctt->{ct_name} =~ /\d+-\d/){ + undef @s_valxx[1]; + undef @s_valxx[2]; + } + print $q->div({-class=>'element6',-style=>'float:right;'},"Mahnstufe",$but->selector_class("int06","","",$ctt->{int06},@s_valxx), + "Fälligkeit",$q->textfield(-id=>'datepicker3',-class=>'etxt',-name=>"warn_time",-default=>"$warn_time",-override=>1,-size=>"8",-maxlength=>10)),"\n"; + print $q->hidden(-name=>'int14', -override=>'1', -value=>"1"),"\n";#set OPOS + } } + #disabled 2022-11-23, needs more testing. Add +10.- on preauth - if($users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}){ + if(1==2 && $users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}){ #further payone capture are only allowed if OPOS && sequence && TXID is set if($ctt->{int14} && $ctt->{int18} && $ctt->{txt16}){ print $q->div({-class=>'element6',-style=>'clear:both;'},"Test. Weitere Payone Einzüge über die vorhandene TXID $ctt->{txt16} (vorautorisiert Summe beachten) durch manuelle inkrement der Sequencenr mit +1", $q->textfield(-class=>'etxt',-name=>"payone_sequence",-default=>"", -override=>'1',-size=>"1",-maxlength=>1)),"\n"; @@ -603,13 +629,6 @@ EOF print $q->div({-style=>'padding:0.5em;font-size:0.81em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, "$praefix-$ctt->{ct_name}.pdf")),"\n"; } - - if($ctt->{state} && $ctt->{state} =~ /payone/ && $ctt->{txt28} && $ctt->{txt28} =~ /error/i){ - print $q->div({-style=>"clear:both;padding:0.5em;font-size:0.81em;width:98%;text-align:right;color:red;"}, "Payone error: $ctt->{txt28}"),"\n"; - }elsif($ctt->{txt28} =~ /settleaccount=yes/i){ - print $q->div({-style=>"clear:both;padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "Payone Einzug erfolgreich"),"\n"; - } - $db->updater("contenttrans","c_id","$ctt->{content_id}","txt20","$accounting_start - $accounting_end","","","","","no_time") if(!$int05 && $accounting_start && $accounting_end); $db->updater("contenttrans","c_id","$ctt->{content_id}","int15","$sum_preauth","","","","","no_time") if($sum_preauth || $sum_preauth == 0); diff --git a/copri4/main/src/scripts/Ilockit_cloud.pl b/copri4/main/src/scripts/Ilockit_cloud.pl index 7d6609f..c48a8bb 100755 --- a/copri4/main/src/scripts/Ilockit_cloud.pl +++ b/copri4/main/src/scripts/Ilockit_cloud.pl @@ -422,10 +422,10 @@ sub get_positions { my $c_id = 0; $c_id = $dbt->insert_contentoid($dbh,$insert); print FILE "insert sub get_positions:" . Dumper($insert); - print FILE "send_alarm2hotline condition: syshost:$op_name->{syshost}, c_id:$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})\n"; + print FILE "send_alarm2hotline condition: syshost:$op_name->{syshost}, c_id:$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})\n"; #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})){ + 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 #max ~ 10 mails if($theftmove_count < 10){