mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-12 23:06:27 +02:00
last Verkaufsjournal fix
This commit is contained in:
parent
b81e12c873
commit
2d822e3a83
5 changed files with 52 additions and 59 deletions
|
@ -198,9 +198,6 @@ sub tpl(){
|
|||
|
||||
#get Firma
|
||||
my $ctf = $db->get_content1("contentuser","$dbt->{sharedms_conf}->{parent_id}");
|
||||
#get Benutzer
|
||||
my $ctb = $db->get_content1("contentuser","$users_dms->{owner}");
|
||||
|
||||
|
||||
my ($edit,$new_key,$copy_key,$save_key,$delete_key,$c_id4csv);
|
||||
my $ct4rel = {};
|
||||
|
@ -253,7 +250,7 @@ sub tpl(){
|
|||
$limit=10000;
|
||||
}
|
||||
|
||||
if(!$v_journal && !$R::detail_search && -f $hashfile && ($path =~ /letzte Suche/ || ($limit > $varenv{limit} && !$ctb->{int04}))){
|
||||
if(!$v_journal && !$R::detail_search && -f $hashfile && ($path =~ /letzte Suche/ || ($limit > $varenv{limit}))){
|
||||
$R::todo="Filter";
|
||||
$message .= ">>> es wurden die letzten Suchparameter oder Filter geladen <<<";
|
||||
$offset=0;
|
||||
|
@ -332,7 +329,7 @@ sub tpl(){
|
|||
|
||||
#mandanten-modul abhängige rekursive suche
|
||||
my $main_ids = "";
|
||||
if($v_journal && $v_journal =~ /Verleihjournal|Verkaufsjournal/){
|
||||
if($v_journal && $v_journal =~ /Verkaufsjournal/){
|
||||
$main_ids = $dbt->{shareedms_conf}->{invoicejournal};
|
||||
$tplids = 209;
|
||||
}else{
|
||||
|
@ -366,11 +363,8 @@ sub tpl(){
|
|||
}else{
|
||||
$lb->failure("Fehler! Es fehlen wichtige Einstellungen. ....journal-ID!");
|
||||
}
|
||||
my $kt_sum=0;
|
||||
my $ct_name_set1;
|
||||
my $ct_name_set2;
|
||||
my $ct_ids;
|
||||
my $last_ab;
|
||||
my $ct_ids = "";
|
||||
my $last_ab = {};
|
||||
|
||||
if($R::detail_search && $R::detail_search eq "suchen"){
|
||||
$offset = 0;
|
||||
|
@ -451,30 +445,27 @@ sub tpl(){
|
|||
#trying to save hashref
|
||||
if(!$v_journal && $R::detail_search && ref($searchref) eq "HASH"){
|
||||
store $searchref, $hashfile;
|
||||
}elsif(!$v_journal && !$R::detail_search && !$ctb->{int04} && -f $hashfile && ($path =~ /letzte Suche/ || $limit > $varenv{limit})){
|
||||
}elsif(!$v_journal && !$R::detail_search && -f $hashfile && ($path =~ /letzte Suche/ || $limit > $varenv{limit})){
|
||||
$searchref = {};
|
||||
$searchref = retrieve($hashfile);
|
||||
}
|
||||
|
||||
#print Dumper($searchref);
|
||||
|
||||
|
||||
#Because of pre counting sum_pos
|
||||
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","","","","","close_time","$xtime","");
|
||||
}
|
||||
#
|
||||
my $v_journalparts = $v_journal . "_parts";
|
||||
$ct4rel_parts = $db->search_content3($searchref,$table,$dbt->{shareedms_conf}->{parent_id},$node_meta,$users_dms->{u_id},$lang,"$main_ids","$tplids","$ct_ids",$v_journalparts,$time,$R::s_kontext,$scol,$users_dms->{sort_updown},$offset,$limit,$export,$R::todo,$ck4ex,$opos);
|
||||
#counting sum_pos
|
||||
#Verkaufsjournal
|
||||
if($node_meta->{tpl_id} == 209 && $v_journal && !$R::detail_search){
|
||||
my $pref_209 = {
|
||||
table => "contenttrans",
|
||||
fetch => "one",
|
||||
order => "int11",
|
||||
state => "Tagesabschluss",
|
||||
};
|
||||
$last_ab = $dbt->fetch_tablerecord($dbh,$pref_209);
|
||||
$searchref->{int11} = $last_ab->{int11} if($last_ab->{int11});
|
||||
|
||||
#collect invoice ids in kontext of parts
|
||||
foreach my $cp_id (keys (%$ct4rel_parts)){
|
||||
$ct_ids .= "$ct4rel_parts->{$cp_id}->{ct_id}," if($R::detail_search && ($R::s_kontext && $R::s_kontext eq "Waren" || $export eq "FiBu"));
|
||||
}
|
||||
}
|
||||
#print Dumper($last_ab->{int11});
|
||||
|
||||
#reload sig bikes and stations states
|
||||
#$bw->log("Liste3 condition",$node_meta,"");
|
||||
|
@ -512,16 +503,12 @@ sub tpl(){
|
|||
}
|
||||
print $q->div({-style=>'background-color:silver;height:10px;'}," "),"\n";
|
||||
my $hstyle = "border-right: solid thin gray;border-bottom: solid thin gray;";
|
||||
|
||||
if($v_journal && $v_journal =~ /journal/){
|
||||
my ($a_check,$b_check,$c_check,$d_check,$f_check,$g_check);
|
||||
$a_check = "1" if($R::s_kontext && $R::s_kontext eq "Waren");
|
||||
$b_check = "1" if($R::s_kontext && $R::s_kontext eq "Beleg" || !$R::s_kontext);
|
||||
my @_s_time_defaults = ("0,manuelle Eingabe in \"bearbeitet\"","7,1 Woche","14,2 Wochen","28,4 Wochen","365,1 Jahr");
|
||||
#print $q->div({-style=>'float:left;background-color:silver;'}," <b>Suchzeitraum:</b> ",$but->selector("selected_start_mtime","130px","$R::selected_start_mtime",@_s_time_defaults));
|
||||
print "<div style='background-color:silver;padding:0 0.5em;$hstyle'>\n";
|
||||
print $q->span("<b>Suchkontext:</b> ",$but->radiobox("Beleg","s_kontext","$b_check"),"$node_meta->{node_name}/Kunde");
|
||||
print $q->span($but->radiobox("Waren","s_kontext","$a_check"),"Waren/FiBu");
|
||||
print "</div>\n";
|
||||
print $q->hidden(-name=>'s_kontext', -value=>"Beleg"),"\n";
|
||||
#my ($a_check,$b_check,$c_check,$d_check,$f_check,$g_check);
|
||||
#$a_check = "1" if($R::s_kontext && $R::s_kontext eq "Waren");
|
||||
#$b_check = "1" if($R::s_kontext && $R::s_kontext eq "Beleg" || !$R::s_kontext);
|
||||
}
|
||||
print $q->hidden(-name=>'mandant_main_id', -value=>"$dbt->{shareedms_conf}->{parent_id}"),"\n";
|
||||
print $q->hidden(-name=>'tpl_id4trans', -value=>"$node_meta->{tpl_id}"),"\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue