diff --git a/copri4/main/src/Mod/Buttons.pm b/copri4/main/src/Mod/Buttons.pm index b81117c..f0b8e11 100755 --- a/copri4/main/src/Mod/Buttons.pm +++ b/copri4/main/src/Mod/Buttons.pm @@ -72,9 +72,11 @@ auswerten', 'search_adr' => 'Kunden suchen', 'search_extrakt' => 'extrakt', 'change_login' => 'ID', - 'print_pdf' => 'Print PDF', + 'print_pdf' => ' PDF ', 'set_relation' => 'Formular', 'set_workflow' => 'Workflow', + 'set_workflow2invoice' => 'Rechnung erstellen', + 'set_workflow2storno' => 'Storno erstellen', 'relate_content' => 'Content-Menu Relation', 'relate_dialog' => 'Relation herstellen', 'relate_dialog4menu' => 'Relation herstellen', @@ -573,7 +575,6 @@ sub singlesubmit6(){ return $button; } -# international hack sub singlesubmit3(){ my $self = shift; my ($function,$b_name,$b_img,$style,$title) = @_; @@ -586,13 +587,13 @@ sub singlesubmit3(){ $ib_value = $val; } } - my $button = ""; + my $button = ""; if("$b_name" =~ /delete/){ - $button = ""; + $button = ""; }elsif($b_img){ - $button = ""; + $button = ""; }elsif($b_name){ - $button = ""; + $button = ""; } return $button; } diff --git a/copri4/main/src/Mod/DBtank.pm b/copri4/main/src/Mod/DBtank.pm index e991aaa..2528d1e 100755 --- a/copri4/main/src/Mod/DBtank.pm +++ b/copri4/main/src/Mod/DBtank.pm @@ -948,7 +948,7 @@ sub insert_contentoid { my $reset_keys = shift || ""; my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} ); - if($reset_keys eq "reset_adropkeys"){ + if($insert->{table} eq "contentadr" && $reset_keys eq "reset_adropkeys"){ delete $insert->{txt17};#operators delete $insert->{txt30} if($source ne "sharee_lv" && $insert->{txt30} ne "5511");#Tarif, exception sharee_lv delete $insert->{txt15};#Bonusnr diff --git a/copri4/main/src/Mod/Indexsharee.pm b/copri4/main/src/Mod/Indexsharee.pm index 46cab4f..08b2dde 100755 --- a/copri4/main/src/Mod/Indexsharee.pm +++ b/copri4/main/src/Mod/Indexsharee.pm @@ -18,6 +18,7 @@ use Apache2::RequestIO (); use Apache2::Const -compile => qw(OK); use LWP::UserAgent; use Digest::MD5 qw(md5 md5_hex); +use Scalar::Util qw(looks_like_number); #use Encode; #use URI::Encode qw(uri_encode uri_decode); @@ -359,13 +360,17 @@ sub handler { #DMS Faktura if($node_meta->{ct_table} eq "contenttrans"){ - $bw->log("DMS action from $users_dms->{u_id} on $node_meta->{ct_table}|$R::c_id4trans,$R::tpl_id4trans,$R::kind_of_trans with: $R::ct_trans","",""); + $bw->log("DMS action from $users_dms->{u_id} on $node_meta->{ct_table}|$R::c_id4trans,$R::tpl_id4trans with: $R::ct_trans","",""); if($users_dms->{int03} == 1 && $R::ct_trans eq "open"){#DMS Faktura read - $db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,$R::kind_of_trans,$users_dms->{u_id}) if($R::c_id4trans && $R::tpl_id4trans); + $db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,"",$users_dms->{u_id}) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans)); }elsif($users_dms->{int03} == 2){#DMS Faktura rw - $db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,$R::kind_of_trans,$users_dms->{u_id}) if($R::c_id4trans && $R::tpl_id4trans); - $return .= "|"; - $return .= $pre->preinit($users_dms,$lang);#transactions logic + $db->update_users4trans($R::c_id4trans,$R::tpl_id4trans,"",$users_dms->{u_id}) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans)); + if($R::ct_trans =~ /set_workflow2invoice|set_workflow2storno/){ + $return = $pl->set_workflow($users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow)); + }else{ + $return .= "|"; + $return .= $pre->preinit($users_dms,$lang);#transactions logic + } }elsif($R::ct_trans){ $return = "failure::Abbruch. Schreibender Zugriff \"Faktura\" verweigert."; } diff --git a/copri4/main/src/Mod/Payment.pm b/copri4/main/src/Mod/Payment.pm index 8cf7017..e15b63e 100755 --- a/copri4/main/src/Mod/Payment.pm +++ b/copri4/main/src/Mod/Payment.pm @@ -213,7 +213,7 @@ sub captureSEPA_main { my $pref = { table => "contenttrans", fetch => "one", - template_id => 218, + #template_id => 218, c_id => $ctt_rec->{c_id}, }; my $ctt = { c_id => 0 }; @@ -350,7 +350,7 @@ sub captureCC_main { my $pref = { table => "contenttrans", fetch => "one", - template_id => 218, + #template_id => 218, c_id => $ctt_rec->{c_id}, }; my $ctt = { c_id => 0 }; diff --git a/copri4/main/src/Mod/Prelib.pm b/copri4/main/src/Mod/Prelib.pm index 1d847ce..e5762dc 100755 --- a/copri4/main/src/Mod/Prelib.pm +++ b/copri4/main/src/Mod/Prelib.pm @@ -48,6 +48,100 @@ my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime; my $debug=1; +#set Faktura workflow like Rechnung to Storno +sub set_workflow { + my $self = shift; + my $users_dms = shift; + my $c_id = shift; + my $set_main_id = shift || ""; + my %varenv = $cf->envonline(); + my $dbh = ""; + my $node = $dbt->get_node($dbh,$set_main_id); + + my $pref = { + table => "contenttrans", + fetch => "one", + c_id => $c_id, + }; + + my $ctt = { c_id => 0 }; + $ctt = $dbt->fetch_tablerecord($dbh,$pref); + + #barcode setting logic reset. keep barcode from orignal for backlinking + #counter invoice subnr + if($ctt->{ct_name} =~ /\d+-\d+/){ + my ($ct_name,$subname) = split(/-/,$ctt->{ct_name}); + $subname++; + $ctt->{ct_name} = "$ct_name-$subname"; + }else{ + $ctt->{ct_name} = "$ctt->{ct_name}-1"; + } + delete $ctt->{c_id}; + delete $ctt->{txt00}; + delete $ctt->{state}; + delete $ctt->{int01}; + delete $ctt->{int14}; + delete $ctt->{int15}; + delete $ctt->{txt16}; + delete $ctt->{txt12}; + delete $ctt->{txt21}; + delete $ctt->{txt22}; + delete $ctt->{txt23}; + delete $ctt->{txt30}; + delete $ctt->{itime}; + delete $ctt->{mtime}; + delete $ctt->{close_time}; + delete $ctt->{invoice_time}; + delete $ctt->{pay_time}; + + my $insert_ctt = { + %$ctt, + table => "contenttrans", + itime => 'now()', + mtime => 'now()', + owner => "$users_dms->{u_id}", + ct_name => "$ctt->{ct_name}", + txt00 => "$node->{node_name}", + template_id => "218", + main_id => "$node->{main_id}", + }; + my $c_idnew = 0; + $c_idnew = $dbt->insert_contentoid($dbh,$insert_ctt,""); + $i_rows = 1 if($c_idnew); + #print Dumper($insert_ctt); + #exit; + + #position copy + if($c_idnew > 0){ + my ($cttpos,$rows) = $db->collect_contentpos("contenttrans",$c_id); + foreach my $id (sort { lc($cttpos->{$a}->{sort}) cmp lc($cttpos->{$b}->{sort}) } keys(%$cttpos)){ + $cttpos->{$id}->{int02} = $cttpos->{$id}->{int02} * -1 if($cttpos->{$id}->{int02} != 0); + $cttpos->{$id}->{int07} = $cttpos->{$id}->{int07} * -1 if($cttpos->{$id}->{int07} != 0 && $cttpos->{$id}->{int08} == 1);#if Rabatt int08 != 1 alias €; + + delete $cttpos->{$id}->{c_id}; + delete $cttpos->{$id}->{ct_id}; + delete $cttpos->{$id}->{itime}; + delete $cttpos->{$id}->{mtime}; + my $insert_pos = { + %{$cttpos->{$id}}, + table => "contenttranspos", + ct_id => $c_idnew, + itime => 'now()', + mtime => 'now()', + }; + my $ctpos_id = $dbt->insert_contentoid($dbh,$insert_pos,""); + $i_rows += 1 if($ctpos_id > 0); + + } + } + $db->update_users4trans($c_idnew,"218","",$users_dms->{u_id}); + + my $uri_path = $dbt->recurse_node("",$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"); + exit 0; +}#end set_workflow + #new node relation with option to create subnode for Servicelog sub new_relation { my $self = shift; diff --git a/copri4/main/src/Mod/Prelogic.pm b/copri4/main/src/Mod/Prelogic.pm index 9235389..575c4ae 100755 --- a/copri4/main/src/Mod/Prelogic.pm +++ b/copri4/main/src/Mod/Prelogic.pm @@ -486,122 +486,10 @@ sub preinit(){ } - ###SET workflow (like copy doc-type) - #follows address copy - #1. counter for WaWi and ReNr - my $c_id4trans = $R::c_id4trans;#It needs hidden posts. Only implemented in Address and Transact - if($R::set_workflow && $R::set_main_id4workflow && $R::ct_name4workflow =~ /\d/){ - return "failure::Bitte erst einen Formular-Typ wählen" if($R::set_main_id4workflow <= "300000"); - $table = "contenttrans"; - my $foreign_key="ct_id"; - my $j="1"; - $rel = $db->get_rel4tpl("",$lang,$c_id4trans,$R::tpl_id4trans); - my $set_tpl = $db->get_rel4tpl($R::set_main_id4workflow,$lang,"","","ASC"); - my $backlink = $R::ct_name4workflow; - my $ct_name = $R::ct_name4workflow; - my $subname= 1; - ($ct_name,$subname) = split(/-/,$R::ct_name4workflow) if($R::ct_name4workflow =~ /\d+-\d+/); - my $lastct_name = $db->get_like2sort($table,"ct_name","$ct_name-"); - if($lastct_name->{ct_name}){ - ($ct_name,$subname) = split(/-/,$lastct_name->{ct_name}); - $subname++; - } - my $ct_name_new = "$ct_name-$subname"; - my $barcode = "$ct_name$subname"; - - ###Vorsicht, redundanter code-abschnitt = set_main_id - my ($node,$ct_exist); - $node = $db->get_node4multi($R::set_main_id4workflow,$lang); - if($node->{main_id} > 300000){ - my $rows = $node->{int10} + 1; - $db->updater("nodes","main_id",$node->{main_id},"int10",$rows); - } - - #Node abhängige auto Beleg-Nummer - my $journal_nodes = "$ctf->{txt23}"; - $journal_nodes .= "|$ctf->{txt24}" if($ctf->{txt24}); - $journal_nodes .= "|$ctf->{txt25}" if($ctf->{txt25}); - if(($node->{int06} > 0) && ("$R::set_main_id4workflow" != "$rel->{main_id}") && ("$rel->{main_id}" !~ /$journal_nodes/) && ($node->{node_name} !~ /steuerfrei/)){ - $ct_exist = $db->get_ctrel2($table,$node->{int06},$R::set_main_id4workflow,$lang); - if($ct_exist->{rel_id}){ - return "failure::Konflikt, die Nummer \"$ct_exist->{ct_name}\" ist bereits vergeben."; - } - #$ct_name_new = "$node->{int06}" . "-$ct_name";#neue subNummer - #$barcode = "$node->{int06}" . "$ct_name"; - $ct_name_new = "$node->{int06}"; - $barcode = "$node->{int06}"; - my $int06 = $node->{int06} + 1; - $u_rows += $db->updater("nodes","main_id",$R::set_main_id4workflow,"int06",$int06,"","","","","no_time"); - } - ### - - $ct_exist = $db->get_ctrel2($table,$ct_name_new,"",$lang,"","",$set_tpl->{tpl_id}); - if($ct_exist->{ct_name} && $node->{node_name} !~ /Storno/){ - return "failure::Der Vorgang mit der Nummer \"$ct_exist->{ct_name}\" ist bereits vorhanden"; - } - $c_idnew = $db->insert_content2($table,$ct_name_new,$users_dms->{u_id},""); - $i_rows += 1 if($c_idnew > 0); - my $rel_id = $db->insert_relationlist($table,$R::set_main_id4workflow,$lang,$c_idnew,$set_tpl->{tpl_id},$foreign_key); - $node = $db->get_node4multi($R::set_main_id4workflow,$lang); - $db->updater($table,"c_id",$c_idnew,"close_time","null"); - - #2017-08-10 adapted from lx-rad, set backlink for workflow documentation - $db->updater($table,"c_id",$c_idnew,"txt04","$backlink"); - $db->update_content4change($table,$c_idnew,"",$barcode,"barcode"); - $db->update_content4change($table,$c_idnew,"",$parent_trans->{parent_id},"int09");#mandant_id - $db->update_content4change($table,$c_idnew,"",$R::set_main_id4workflow,"int12");#zusätzl. Formtyp - $db->update_content4change($table,$c_idnew,"",$node->{node_name},"txt00");#node_name - $db->update_content4change($table,$c_idnew,"","txt61,txt63","txt21") if($node->{node_name} =~ /Mietvertrag/);#Text-3 - $db->update_content4change($table,$c_idnew,"","txt64","txt21") if($node->{node_name} =~ /Rückgabe/);#Text-4 - $db->update_content4change($table,$c_idnew,"","txt65","txt21") if($node->{node_name} =~ /steuerfrei/);#Text-5 - $db->update_users4trans($c_idnew,$set_tpl->{tpl_id},$R::kind_of_trans,$R::owner); - - $node = $db->get_node4multi($R::set_main_id4workflow,$lang); - my $old_node = $db->get_node4multi($rel->{main_id},$lang); - - #workflow - #print "$old_node->{node_name} ---> $node->{node_name}"; - - #position copy - my ($cttpos,$rows) = $db->collect_contentpos("$table",$c_id4trans); - foreach my $id (sort { lc($cttpos->{$a}->{sort}) cmp lc($cttpos->{$b}->{sort}) } keys(%$cttpos)){ - #2019-05-24, adding Storno (300009) to Rechnung - if(($node->{node_name} =~ /Storno/) || ($R::set_main_id eq "300009" && $node->{node_name} =~ /Rechnung/)){ - $cttpos->{$id}->{int02} = $cttpos->{$id}->{int02} * -1 if($cttpos->{$id}->{int02} != 0); - $cttpos->{$id}->{int07} = $cttpos->{$id}->{int07} * -1 if($cttpos->{$id}->{int07} != 0 && $cttpos->{$id}->{int08} == 1);#if Rabatt int08 != 1 alias €; - if($R::kind_of_trans =~ /Faktur/){ - $db->update_content4comp("content",$cttpos->{$id}->{ct_name},"$cttpos->{$id}->{cc_id}","+","$cttpos->{$id}->{int03}","$R::kind_of_trans","$cttpos->{$id}->{txt12}"); - } - } - - delete $cttpos->{$id}->{c_id}; - delete $cttpos->{$id}->{ct_id}; - delete $cttpos->{$id}->{itime}; - delete $cttpos->{$id}->{mtime}; - my $insert_pos = { - %{$cttpos->{$id}}, - table => "contenttranspos", - ct_id => $c_idnew, - itime => 'now()', - mtime => 'now()', - }; - my $ctpos_id = $dbt->insert_contentoid($dbh,$insert_pos,""); - $i_rows += 1 if($ctpos_id > 0); - - } - - $db->update_users4trans($c_idnew,$set_tpl->{tpl_id},$R::kind_of_trans,$R::owner); - $users_dms = $db->select_users($users_dms->{u_id}); - $c_id4trans = $users_dms->{c_id4trans}; - } - #### - - #copy ADD ADDRESS from contentadr to contenttrans - #Attention, doupled saved over Terminal AND over set_workflow - #All Verkauf-Terminal submits without Print PDF! - # - if(($R::ct_trans !~ /print_pdf|print/i) && (($ib_key eq "add_transadr") || $R::ct_trans2c_idadr || $R::set_main_id || $R::set_main_id4workflow)){ + my $c_id4trans = $R::c_id4trans || "";#It needs hidden posts. Only implemented in Address and Transact + #TODO + if(1==2 && ($R::ct_trans !~ /print_pdf|print/i) && (($ib_key eq "add_transadr") || $R::ct_trans2c_idadr || $R::set_main_id || $R::set_main_id4workflow)){ $c_id4trans = $users_dms->{c_id4trans} if($ib_key eq "add_transadr" && $users_dms->{c_id4trans}); if(!$c_id4trans){ return "failure::Wohin damit? Für die Zuweisung bitte erst ein Ziel öffnen."; diff --git a/copri4/main/src/Tpl/Address3.pm b/copri4/main/src/Tpl/Address3.pm index cfaac50..690b6d9 100755 --- a/copri4/main/src/Tpl/Address3.pm +++ b/copri4/main/src/Tpl/Address3.pm @@ -95,18 +95,9 @@ print<{main_id} || $ctx->{int12}; + my $main_id = $rel4tpl->{main_id}; my $set_main_id = $dbt->{shareedms_conf}->{invoice}; - my @formular_relations=("$set_main_id:Typ auswählen ..."); - my @workflow_relations=("$set_main_id:Typ auswählen ..."); - my $nodes = $db->collect_node($dbt->{shareedms_conf}->{faktura}, "$lang"); - my $depends = "nothingelse"; - #$depends = "Storno" if(!$ctx->{close_time}); - foreach my $id (sort { $nodes->{$a}->{node_name} cmp $nodes->{$b}->{node_name} } keys (%$nodes)){ - push (@formular_relations, "$id:$nodes->{$id}->{node_path}") if(($main_id eq $id) || ($nodes->{$id}->{node_path} !~ /journal|bericht|offen|Storno|Vorauszahlungsrechnung|letzte|langzeit|OPOS|$depends/)); - push (@workflow_relations, "$id:$nodes->{$id}->{node_path}") if($nodes->{$id}->{node_path} !~ /journal|bericht|offen|Schlussrechnung|letzte|langzeit|OPOS|$node_meta->{node_name}$|$ctx->{txt00}|$depends/); - } print "\n
\n"; if(!$ctx->{c_id}){ @@ -115,7 +106,8 @@ EOF #######Verkauf Header print $q->start_form(),"\n"; - print "\n
\n"; + print $q->hidden(-name=>'printer_id', -override=>'1', -value=>"PDF"); + print "\n
\n"; #submit Header my $invoice_time = ""; @@ -134,34 +126,31 @@ EOF } $set_main_id=$main_id if($rel4tpl->{main_id} > "300000"); - if(!$ctx->{close_time} && ($ctx->{txt00} !~ /Storno/)){ - my $ebutton = "ebutton"; - $ebutton = "ebutton4" if($ctx->{ct_name} !~ /\d+/ && $R::trans2edit ne "client"); - print $but->singlesubmit1("set_relation","set_relation","$ebutton","","Generiert RechnungNr. incl. payone Vorautorisierung (txid)"); - print $but->selector("set_main_id","11em",$set_main_id,@formular_relations); - }else{ - print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"); - print $q->span({-style=>'padding:0.05em 3em;background-color:white;border:solid thin gray;'}, "$ctx->{txt00}"); - } + print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"); + print $q->span({-style=>'margin:0.2em 0.5em 0 0.5em;padding:0.8em 3em;background-color:white;border:solid thin gray;'}, "$ctx->{txt00}"); print $q->b("\# $ctx->{ct_name}"); - print $q->span({-style=>'margin:0 0.2em;'}," | "); - if($ctx->{ct_name} =~ /\d+/){ - print $but->singlesubmit1("set_workflow","set_workflow"); - print $but->selector("set_main_id4workflow","11em","",@workflow_relations); - print $q->span({-style=>'margin:0 0.2em;'}," | "); + print $q->span({-style=>'margin:0 0.5em;'}," "); + if($ctx->{ct_name} =~ /\d+/ && $ctx->{txt00} eq "Storno"){ + print $but->singlesubmit3("ct_trans","set_workflow2invoice","","",""); + print $q->hidden(-name=>'set_main_id4workflow', -override=>'1', -value=>"300008"); + print $q->span({-style=>'margin:0 0.5em;'}," "); } - print $but->singlesubmit1("ct_trans","print_pdf"); - print $q->hidden(-name=>'printer_id', -override=>'1', -value=>"PDF"); + if($ctx->{ct_name} =~ /\d+/ && $ctx->{txt00} eq "Rechnung"){ + print $but->singlesubmit3("ct_trans","set_workflow2storno","","",""); + print $q->hidden(-name=>'set_main_id4workflow', -override=>'1', -value=>"300009"); + print $q->span({-style=>'margin:0 0.5em;'}," "); + } + if(!$ctt->{int01} || $ctt->{ct_name} =~ /-/){ - print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}," $buchen_users->{txt01} / $invoice_time ", $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n"; + print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time ", $but->singlesubmit7("ct_trans","remove_chk4rel","$ib{remove_chk4rel}","")),"\n"; print $q->hidden(-name=>'c_id', -override=>'1', -value=>"$rel4tpl->{content_id}"); print $q->hidden(-name=>'template_id', -override=>'1', -value=>"$rel4tpl->{template_id}"); print $q->hidden(-name=>'main_id', -override=>'1', -value=>"$rel4tpl->{main_id}"); print $q->hidden(-name=>'rel_id', -override=>'1', -value=>"$rel4tpl->{rel_id}"); }else{ - print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}," $buchen_users->{txt01} / $invoice_time "),"\n"; + print $q->span({-style=>'margin:0 0.2em;position:absolute;right:3px;'}, $but->singlesubmit3("ct_trans","print_pdf","","","")," $buchen_users->{txt01} / $invoice_time "),"\n"; } print "
\n"; @@ -172,7 +161,7 @@ EOF print $q->hidden(-name=>'relids', -override=>'1', -value=>"$R::relids"); print $q->hidden(-name=>'ct_name4workflow', -override=>1, -value=>"$ctx->{ct_name}"); print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$ctx->{c_id}"); - print $q->hidden(-name=>'c_id4copy', -override=>'1', -value=>"$ctx->{c_id}"); + print $q->hidden(-name=>'tpl_id4trans', -override=>'1', -value=>"$rel4tpl->{template_id}"); print $q->hidden(-name=>'close_time', -override=>'1', -value=>"$ctx->{close_time}"); print $q->end_form,"\n"; @@ -201,7 +190,7 @@ EOF print $q->hidden(-name=>'rel_id', -override=>'1', -value=>"$rel4tpl->{rel_id}"),"\n"; print $q->Tr(),"\n"; print ""; - print $but->singlesubmit7("ct_trans","save_adr","$ib{save_adr}","","","ebutton4"),"\n"; + print $but->singlesubmit7("ct_trans","save_adr","$ib{save_adr}","","","ebutton"),"\n"; #print $q->span($q->a({-class=>"ebutton3",-href=>'javascript:history.back()'}, " back ")); print "\n"; print $q->td({-class=>'tdval',-nowrap=>1}, $but->selector("txt02","60px",$ctt->{txt02},@_anrede)),"\n"; @@ -325,6 +314,9 @@ EOF print $q->start_form(),"\n"; + print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$ctx->{c_id}"); + print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"),"\n"; + print "\n"; print $q->start_table({-class=>'list', -border=>'0', -width=>'100%',-align=>'left', -cellpadding=>'0', -cellspacing=>'0'}),"\n"; @@ -341,8 +333,6 @@ EOF print $q->Tr(),"\n"; print $q->td({-class=>'tdval4',-colspan=>'2'},$q->textarea(-class=>'etxt',-name=>'txt23', -default=>"$ctt->{txt23}", -rows=>6, -columns=>65)),"\n"; - print $q->hidden(-name=>'c_id4trans', -override=>'1', -value=>"$ctx->{c_id}"); - print $q->hidden(-name=>'set_main_id', -override=>'1', -value=>"$set_main_id"),"\n"; my $ebutton = "ebutton"; $ebutton = "ebutton4" if($ctx->{ct_name} && $ctx->{ct_name} =~ /\d+/ && !$R::trans2edit && !$ctt->{txt12} && $ctt->{txt21} && $ctt->{txt21} !~ /\,/); @@ -355,28 +345,6 @@ EOF } - #Zahlungstexte - foreach(@tplf_order){ - my ($key,$des,$size) = split /=/,$_; - if($key =~ /txt5/ && $ctf->{$key}){ - my @line_txt = split(/\n/,$ctf->{$key}); - $line_count1 += scalar(@line_txt); - $ctf->{$key} = $q->unescapeHTML("$ctf->{$key}"); - $ctf->{$key} = $lb->newline($ctf->{$key},"",""); - if("$des" =~ /$ctt->{state}/){ - print $q->Tr(),"\n"; $line_count1++; - if($ctt->{int01} < 0){ - #print $q->td({-class=>'tdval4',-style=>'width:8em;'},"Gutschrift Text"),"\n"; - print $q->td({-class=>'tdval4',-colspan=>2},"$ctf->{txt58}"),"\n"; - }else{ - #print $q->td({-class=>'tdval4',-style=>'width:8em;'},"$des"),"\n"; - print $q->td({-class=>'tdval4',-colspan=>2},"$ctf->{$key}"),"\n"; - } - } - } - } - - $ctt->{txt12} = $q->unescapeHTML($ctt->{txt12}) || ""; print $q->td({-class=>'tdval4',-colspan=>'2'},$q->textarea(-class=>'etxt',-name=>'txt12', -default=>"$ctt->{txt12}", -rows=>6, -columns=>65)),"\n"; diff --git a/copri4/main/src/Tpl/Liste3.pm b/copri4/main/src/Tpl/Liste3.pm index aee2640..0a4719c 100755 --- a/copri4/main/src/Tpl/Liste3.pm +++ b/copri4/main/src/Tpl/Liste3.pm @@ -234,7 +234,7 @@ sub tpl(){ #Filter OPOS if($path =~ /OPOS/){ $R::detail_search="suchen"; - $searchref->{int14}=1; + $searchref->{int14} = ">=1"; $R::todo="Filter"; $message .= ">>> Offene Payone Posten (Fehlgeschlagene Geldeinzüge) <<<"; $offset=0; @@ -463,7 +463,8 @@ sub tpl(){ if($node_meta->{node_name} eq "Faktura"){ if($v_journal && (!$R::detail_search || $R::s_start_mtime && $R::s_start_mtime =~ /letzt/)){ my $xtime = "date \'$today\' + integer \'7\'";#just time - $last_ab = $db->get_content6("contenttrans","state","Kassenbestand","int09","$dbt->{shareedms_conf}->{parent_id}","int12","$j_exist->{main_id}","close_time","$xtime",""); + #$last_ab = $db->get_content6("contenttrans","state","Kassenbestand","int09","$dbt->{shareedms_conf}->{parent_id}","int12","$j_exist->{main_id}","close_time","$xtime",""); + $last_ab = $db->get_content6("contenttrans","state","Kassenbestand","","","","","close_time","$xtime",""); } # my $v_journalparts = $v_journal . "_parts"; diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm index 6d0a46d..433dd4f 100755 --- a/copri4/main/src/Tpl/TransPositionen.pm +++ b/copri4/main/src/Tpl/TransPositionen.pm @@ -143,7 +143,7 @@ EOF my ($key,$val) = split /=/,$_; $k++ if($val); if($key eq "ct_name"){ - print $q->th($q->textfield(-class=>'etxt',-style=>'height:19px;width:140px;font-size:1.3em;text-align:right;',-id=>"json_select",-name=>"json_select",-value=>"", -override=>'1',-size=>"25",-maxlength=>50, -placeholder=>'Nummer'),""); + print $q->th($q->textfield(-class=>'etxt',-style=>'height:19px;width:140px;font-size:1.3em;text-align:right;',-id=>"json_select",-name=>"json_select",-value=>"", -override=>'1',-size=>"25",-maxlength=>50, -placeholder=>'Nummer',-autofocus=>1),""); }elsif($key =~ /int|txt/){ print $q->th("$val"); }