mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-06-15 21:26:28 +02:00
minor accounting and journaling fix
This commit is contained in:
parent
0ac2e784ca
commit
2e2c824dbe
17 changed files with 223 additions and 300 deletions
|
@ -125,7 +125,10 @@ sub tpl(){
|
|||
my $start_date_time = $R::start_date_time;
|
||||
my $end_date_time = $R::end_date_time;
|
||||
|
||||
$start_date_time = "01.$mon.$year" if(!$start_date_time);
|
||||
if(!$start_date_time){
|
||||
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,1, 0,0,-10);
|
||||
$start_date_time = "$nday.$nmon.$nyear";
|
||||
}
|
||||
|
||||
|
||||
my $c_date; my $start_chck=0;my $end_chck=0;my $message;
|
||||
|
@ -145,9 +148,9 @@ sub tpl(){
|
|||
}
|
||||
|
||||
|
||||
my $limit = $R::limit || $varenv{limit} * 2;#max. 160 * 2
|
||||
my $limit = $R::limit || 400;
|
||||
my $offset = $R::offset || "0";
|
||||
if($R::detail_search){
|
||||
if($R::detail_search && !$R::theft_details){
|
||||
$limit = 10000;
|
||||
$offset = 0;
|
||||
}
|
||||
|
@ -195,6 +198,9 @@ sub tpl(){
|
|||
if($node_meta->{ct_table} eq "contenttranspos"){
|
||||
$cttpos = $dbt->collect_transpos($dbh,$search);
|
||||
}elsif($node_meta->{ct_table} eq "contenttheftpos"){
|
||||
#7=get_event alarm
|
||||
#8=get_position after validate
|
||||
$search->{int10} = "IN::(7,8)" if(!$R::theft_details);
|
||||
$cttpos = $dbt->collect_theftpos($dbh,$search);
|
||||
}
|
||||
}
|
||||
|
@ -225,25 +231,21 @@ sub tpl(){
|
|||
|
||||
print $q->div({-style=>'background-color:silver;height:10px;'},""),"\n";
|
||||
|
||||
my $hstyle = "border-right: solid thin gray;border-bottom: solid thin gray;";
|
||||
my $search = "search";
|
||||
my $edit="ct_trans";
|
||||
my $new_key="new_transdate";
|
||||
|
||||
print $q->start_table({ -style=>"width:100%;", -border=>'0',-align=>'left', -cellpadding=>'1', -cellspacing=>'0'});
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>"background-color:silver;$hstyle;width:30px;padding:1px 10px;"},$but->singlesubmit1("detail_search","$search")),"\n";
|
||||
print $q->td({-style=>"background-color:silver;border-right: solid thin gray;border-bottom: solid thin gray;width:30px;padding:1px 10px;"},$but->singlesubmit1("detail_search","search")),"\n";
|
||||
|
||||
|
||||
#1. Search-fields
|
||||
my $h=3;
|
||||
print "<td class='search_line'>\n";
|
||||
#print $q->a({-class=>"sortnav",-href=>"?cal_sort_updown=up\&offset=$offset\&limit=$limit",-title=>'Aufsteigend sortieren'},"$sort_up"),"|",$q->a({-class=>"sortnav",-href=>"?cal_sort_updown=down\&offset=$offset\&limit=$limit",-title=>'Absteigend sortieren'},"$sort_down"),"\n";
|
||||
print $but->checkbox("1","theft_details","$R::theft_details","Details") if($node_meta->{ct_table} eq "contenttheftpos" && $users_dms->{u_id} == $dbt->{copri_conf}->{superu_id});
|
||||
foreach(@tpl_order){
|
||||
#$h++;
|
||||
my ($key,$des,$size) = split /=/,$_;
|
||||
my $valxx = $q->param("$_") || "";
|
||||
#$valxx = "" if($R::base_edit eq "save_pos" && $key ne "barcode");#empty search fields, select only bike number
|
||||
my $valxx = $q->param("$key") || "";
|
||||
$valxx = "" if($R::base_edit eq "save_pos" && $key ne "barcode");#empty search fields, select only bike number
|
||||
|
||||
if($key =~ /time/){
|
||||
$size="10px";
|
||||
|
@ -295,9 +297,6 @@ sub tpl(){
|
|||
my $nx=0;
|
||||
my $set_style="";
|
||||
my $scale_color = $node_meta->{bg_color};
|
||||
my $edit="ct_trans";
|
||||
my $save_key="save";
|
||||
my $delete_key="delete";
|
||||
my $itime="";
|
||||
my $start_time="";
|
||||
my $end_time="";
|
||||
|
@ -417,12 +416,13 @@ sub tpl(){
|
|||
if($cttpos->{$pid}->{int10} ne $ct4rel_part->{$cttpos->{$pid}->{cc_id}}->{int10}){
|
||||
$status = "<span style='border: 1px solid #c63e3e;'>$dbt->{copri_conf}->{bike_state}->{$cttpos->{$pid}->{int10}}</span>";
|
||||
}
|
||||
my $lock_state = "lock failure" if(!$cttpos->{$pid}->{int20});
|
||||
my $lock_state = "";
|
||||
#my $lock_state = "lock failure" if(!$cttpos->{$pid}->{int20});
|
||||
$lock_state = "locked" if($cttpos->{$pid}->{int20} == 1);
|
||||
$lock_state = "<span style='color:#c63e3e;'>unlocked</span>" if($cttpos->{$pid}->{int20} == 2);
|
||||
$lock_state = "<span style='color:#c63e3e;'>locking</span>" if($cttpos->{$pid}->{int20} == 3);
|
||||
$lock_state = "<span style='color:#c63e3e;'>unlocking</span>" if($cttpos->{$pid}->{int20} == 4);
|
||||
if($cttpos->{$pid}->{int20} ne $ct4rel_part->{$cttpos->{$pid}->{cc_id}}->{int20}){
|
||||
if($cttpos->{$pid}->{int20} && $cttpos->{$pid}->{int20} ne $ct4rel_part->{$cttpos->{$pid}->{cc_id}}->{int20}){
|
||||
$lock_state = "<span style='border: 1px solid #c63e3e;'>$dbt->{copri_conf}->{lock_state}->{$cttpos->{$pid}->{int20}}</span>";
|
||||
}
|
||||
|
||||
|
@ -476,12 +476,18 @@ sub tpl(){
|
|||
my $event_type = "";
|
||||
my $meter = $cttpos->{$pid}->{int08};
|
||||
$meter =~ s/\./\,/;
|
||||
$event_type = "Diebstahlalarm" if($cttpos->{$pid}->{int01});
|
||||
if($cttpos->{$pid}->{int02} && $cttpos->{$pid}->{txt06}){
|
||||
if($cttpos->{$pid}->{int01} && $cttpos->{$pid}->{int10} == 7){
|
||||
$event_type = "Alarm detected";
|
||||
}elsif($cttpos->{$pid}->{int01} && $cttpos->{$pid}->{txt10}){
|
||||
$event_type = "statusCode $cttpos->{$pid}->{txt10}";
|
||||
}elsif($cttpos->{$pid}->{int02} && $cttpos->{$pid}->{txt06}){
|
||||
my $gps2card = $q->a({-class=>"linknav3",-href=>"/DMS/Karte?man_gps=$cttpos->{$pid}->{txt06}\&owner=$users_dms->{owner}",-title=>"Karte öffnen"}, "$cttpos->{$pid}->{txt06}");
|
||||
$event_type = "Alarm movement → GPS $gps2card → speed $speed km/h → distance $meter m ";
|
||||
}
|
||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $pos_id → $end_time → Bike $bikenr → $event_type → $u_name"),"\n";
|
||||
if($cttpos->{$pid}->{int20}){
|
||||
$lock_state = $dbt->{copri_conf}->{lock_state}->{$cttpos->{$pid}->{int20}};
|
||||
}
|
||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $pos_id → $end_time → Bike $bikenr $lock_state → $event_type → $u_name"),"\n";
|
||||
|
||||
}
|
||||
|
||||
|
@ -506,6 +512,13 @@ sub tpl(){
|
|||
print $q->a({-class=>"linknav1",-href=>"?go=forward_list;offset=$offset;limit=$limit",-title=>'forward'}," →") if($nr >= $limit-10);
|
||||
print "</div>\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"){
|
||||
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";
|
||||
}
|
||||
|
||||
print $q->end_form;
|
||||
}
|
||||
1;
|
||||
|
|
|
@ -226,12 +226,12 @@ sub tpl(){
|
|||
$tplids = "218";
|
||||
|
||||
if($node_meta->{node_name} =~ /OPOS/){
|
||||
$R::detail_search="suchen";
|
||||
$R::detail_search="search";
|
||||
$searchref->{int14} = ">=1";
|
||||
$R::todo="Filter";
|
||||
$message .= ">>> Offene Payone Posten (Fehlgeschlagene Geldeinzüge) <<<";
|
||||
$offset=0;
|
||||
$limit=10000;
|
||||
$limit=1000;
|
||||
$tplids = "209,218";
|
||||
my $tpl = $dbt->get_tpl($dbh,209);
|
||||
@tpl_order = split /,/,$tpl->{tpl_order};
|
||||
|
@ -241,7 +241,7 @@ sub tpl(){
|
|||
$R::todo="Filter";
|
||||
$message .= ">>> es wurden die letzten Suchparameter oder Filter geladen <<<";
|
||||
$offset=0;
|
||||
$limit=10000;
|
||||
$limit=1000;
|
||||
#$tplids = "208,209,218";#reload store by hashfile
|
||||
$v_journal = $node_meta->{node_name};
|
||||
my $tpl = $dbt->get_tpl($dbh,209);
|
||||
|
@ -249,7 +249,7 @@ sub tpl(){
|
|||
}
|
||||
|
||||
elsif($node_meta->{node_name} eq "Tagesbericht"){
|
||||
$R::detail_search="suchen";
|
||||
$R::detail_search="search";
|
||||
$R::todo="Filter";
|
||||
$offset=0;
|
||||
$limit = "1000";
|
||||
|
@ -263,7 +263,7 @@ sub tpl(){
|
|||
$v_journal = $node_meta->{node_name};
|
||||
$tplids = 209;
|
||||
$offset=0;
|
||||
$limit=10000;
|
||||
$limit=1000;
|
||||
}
|
||||
elsif($node_meta->{node_name} eq "Rechnung"){
|
||||
$main_id = $dbt->{shareedms_conf}->{invoice};
|
||||
|
@ -279,7 +279,7 @@ sub tpl(){
|
|||
}
|
||||
|
||||
#search at all
|
||||
if($R::detail_search eq "suchen"){
|
||||
if($R::detail_search eq "search"){
|
||||
$tplids = "208,209,218";
|
||||
}
|
||||
$searchref->{tplids} = "$tplids";
|
||||
|
@ -346,9 +346,9 @@ sub tpl(){
|
|||
my $ct_ids = "";
|
||||
my $last_ab = {};
|
||||
|
||||
if($R::detail_search && $R::detail_search eq "suchen"){
|
||||
if($R::detail_search && $R::detail_search eq "search"){
|
||||
$offset = 0;
|
||||
$limit = 10000;
|
||||
$limit = 1000;
|
||||
}
|
||||
|
||||
my $channel_map = $dbt->channel_map();
|
||||
|
@ -416,6 +416,7 @@ sub tpl(){
|
|||
if($R::detail_search && ref($searchref) eq "HASH"){
|
||||
store $searchref, $hashfile;
|
||||
}elsif(!$R::detail_search && -f $hashfile && ($path =~ /letzte Suche/)){
|
||||
#}elsif(!$R::detail_search && -f $hashfile && ($path =~ /letzte Suche/ || $R::select_part || $R::ct_trans || $R::trans2edit || $R::node2edit || $R::base_edit || $R::rel_edit || $R::set_state)){
|
||||
$searchref = {};
|
||||
$searchref = retrieve($hashfile);
|
||||
$tplids = $searchref->{tplids} if($searchref->{tplids});
|
||||
|
@ -1066,7 +1067,7 @@ sub tpl(){
|
|||
my $end_nr = $year_en . $mon_en . $day_en . $hh_en . $mm_en;
|
||||
my $day_stpx = 0;
|
||||
my $rent_day_px = 0;
|
||||
my $time_style;
|
||||
my $time_style = "";
|
||||
if($start_nr <= $end_nr){
|
||||
($day_stpx,$rent_day_px) = $lb->rent_scale($users_dms,$year_st,$mon_st,$day_st,$hh_st,$mm_st,$year_en,$mon_en,$day_en,$hh_en,$mm_en);
|
||||
}else{
|
||||
|
@ -1078,11 +1079,12 @@ sub tpl(){
|
|||
print "<td class='$calement' colspan='$tdcal' style='$set_style;'>\n";
|
||||
#print $q->div({-style=>"position:absolute;margin-left:$daymarker;border-right: solid thin #86cb00;height:1.7em;"}," "),"\n";# if("$mon" eq "$mon_today");
|
||||
my $calpath = "Mietjournal";
|
||||
if($ct4rel->{$id}->{int13} == $cttpos->{$ctid}->{int13} && $cttpos->{$ctid}->{int10} =~ /7|8/){
|
||||
if(1==2 && $ct4rel->{$id}->{int13} == $cttpos->{$ctid}->{int13} && $cttpos->{$ctid}->{int10} =~ /7|8/){
|
||||
$calpath = "Alarmjournal";
|
||||
$time_style="color:red;";
|
||||
}
|
||||
print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;background-color:$scale_color"},$q->a({-class=>"linknav3",-style=>"$time_style",-href=>"$varenv{wwwhost}/DMS/$calpath/?cttpos_id=$cttpos->{$ctid}->{c_id}",-title=>"Im $calpath öffnen"},"$hh_en:$mm_en")),"\n";
|
||||
#print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;background-color:$scale_color"},$q->a({-class=>"linknav3",-style=>"$time_style",-href=>"$varenv{wwwhost}/DMS/$calpath/?cttpos_id=$cttpos->{$ctid}->{c_id}",-title=>"Im $calpath öffnen"},"$hh_en:$mm_en")),"\n";
|
||||
print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;background-color:$scale_color"},$q->a({-class=>"linknav3",-style=>"$time_style",-href=>"$varenv{wwwhost}/DMS/$calpath/?barcode=$cttpos->{$ctid}->{barcode}",-title=>"Im $calpath öffnen"},"$hh_en:$mm_en")),"\n";
|
||||
print "</td>\n";
|
||||
print $q->Tr();
|
||||
print $q->td({-style=>'padding-top:1px;'},""),"\n";
|
||||
|
|
|
@ -192,6 +192,7 @@ EOF
|
|||
}
|
||||
|
||||
$scol = "change" if($node_meta->{template_id} == 198);
|
||||
$users_dms->{sort_updown} = "down" if(!$users_dms->{sort_updown});
|
||||
|
||||
#print Dumper($node_meta);
|
||||
my $hashfile = "$varenv{logdir}/$users_dms->{u_id}-$searchref->{table_pos}-searchhash";
|
||||
|
@ -363,7 +364,6 @@ EOF
|
|||
}
|
||||
#BIG LOOP loop content table
|
||||
else{
|
||||
$users_dms->{sort_updown} = "down" if(!$users_dms->{sort_updown});
|
||||
foreach my $id (sort {
|
||||
if($users_dms->{sort_updown} eq "down"){
|
||||
if ($scol =~ /barcode|int/) {
|
||||
|
|
|
@ -91,16 +91,16 @@ sub tpl(){
|
|||
my $ctt_accounting = $dbt->fetch_record($dbh,$pref);
|
||||
($cttpos,$rows) = $dbt->collect_contenttrans($dbh,$ctt_accounting->{content_id});
|
||||
#int9x are not in db
|
||||
@tpl_order = ("c_id=ID","int01=Summe Erlös","state=Zahlungsart","int93=TeilRad Gebühren","int98=19% UmSt","int100=Summe");
|
||||
@tpl_order = ("c_id=ID","int01=Netto Erlös","state=Zahlungsart","int93=TeilRad Gebühren","int100=Summe");
|
||||
}
|
||||
#operator accounting
|
||||
else{
|
||||
($cttpos,$rows) = $dbt->collect_contenttrans($dbh,$ctt->{content_id});
|
||||
#int9x are not in db
|
||||
if($varenv{dbname} eq "sharee_sx"){
|
||||
@tpl_order = ("c_id=ID","int01=Summe Erlös","state=Zahlungsart","int94=payone Disagio","int02=Summe Gutschrift");
|
||||
@tpl_order = ("c_id=ID","int01=Netto Erlös","state=Zahlungsart","int94=payone Disagio","int02=Summe Gutschrift");
|
||||
}else{
|
||||
@tpl_order = ("c_id=ID","int01=Summe Erlös","state=Zahlungsart","int94=payone Disagio","int95=payone Transaktion","int96=payone Zahlungsmeldung","int97=payone Kreditkarte Zuordnung","int02=Summe Gutschrift");
|
||||
@tpl_order = ("c_id=ID","int01=Netto Erlös","state=Zahlungsart","int94=payone Disagio","int95=payone Transaktion","int96=payone Zahlungsmeldung","int97=payone Kreditkarte Zuordnung","int02=Summe Gutschrift");
|
||||
}
|
||||
}
|
||||
my $tplf = $dbt->get_tpl($dbh,201);#Kunden-Faktura, ex Firma
|
||||
|
@ -258,14 +258,14 @@ sub tpl(){
|
|||
|
||||
print $q->Tr("\n");$line_count2++;
|
||||
print $q->td({-class=>'tdint',-colspan=>1,-style=>'color:silver;'},"(Einzüge brutto $sum_all)");
|
||||
print $q->td({-class=>'tdsum',-colspan=>1},"Summe $ctt->{state}");
|
||||
print $q->td({-class=>'tdsum',-colspan=>1},"Gesamtbetrag");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_paid €");
|
||||
}
|
||||
#Summe Betreiber Abrechnung (Gutschrift)
|
||||
else{
|
||||
print $q->Tr("\n");$line_count2++;
|
||||
print $q->td({-class=>'tdint',-colspan=>1,-style=>'color:silver;'},"(Einzüge brutto $sum_all)");
|
||||
print $q->td({-class=>'tdsum',-colspan=>1},"Summe $ctt->{state}");
|
||||
print $q->td({-class=>'tdsum',-colspan=>1},"Summe");
|
||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_operatorcredit €");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue