Mietjournal parts edit and comment view

This commit is contained in:
ragu 2022-09-15 17:06:08 +02:00
parent 009025103f
commit eb09d2d480
19 changed files with 247 additions and 170 deletions

View file

@ -41,13 +41,13 @@ div {
text-left: center;
padding: 8px;
position: absolute;
margin-left:-350px;
/*margin-left:-350px;*/
z-index: 11;
}
.popup .show {
visibility: visible;
margin-left:-350px;
/*margin-left:-350px;*/
}
th {
@ -678,7 +678,7 @@ div#ContentLogin {
}
div#Content4list {
text-align:left;
text-align:left;
font-size:15px;
border: 0px solid yellow;
margin: 0;
@ -687,10 +687,12 @@ text-align:left;
}
div#Content4cal {
text-align:left;
font-size:14px;
border: 0px solid gray;
margin: 10px;
padding: 50px 5px 5px 0px;
min-width: 900px;
margin: 0;
padding: 40px 5px 5px 0px;
min-width: 1200px;
min-height: 500px;
}

View file

@ -1994,10 +1994,10 @@ sub bikes_available(){
my $max_bars = 5;
my $current_bars = 0;
my $charge_view_hidden = 1;#1=hide charge view
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "KN");
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);
my $backend_accessible = 1;
#$backend_accessible = 0 if($record->{$id}->{int11} eq "2");#for asking user
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "KN");#for asking user
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);#for asking user
$return->{$id}->{bike_type}->{battery}->{charge_max_bars} = "$max_bars";
$return->{$id}->{bike_type}->{battery}->{charge_current_bars} = "$current_bars";
$return->{$id}->{bike_type}->{battery}->{charge_current_percent} = "0";
@ -2168,10 +2168,10 @@ sub bikes_all(){
my $max_bars = 5;
my $current_bars = 0;
my $charge_view_hidden = 1;#1=hide charge view
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "KN");
$charge_view_hidden = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);
my $backend_accessible = 1;#1=battery charge from backend, 0=asking user
#$backend_accessible = 0 if($record->{$id}->{int11} eq "2");#for asking user
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "KN");#for asking user
$backend_accessible = 0 if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} =~ /FR|KN/);#for asking user
$return->{$id}->{bike_type}->{battery}->{charge_max_bars} = "$max_bars";
$return->{$id}->{bike_type}->{battery}->{charge_current_bars} = "$current_bars";
$return->{$id}->{bike_type}->{battery}->{charge_current_percent} = "0";

View file

@ -312,7 +312,7 @@ sub selector_class(){
push @selopt, "<option style='$des_style' value='$id'>$value</option>\n";
}
}
my $selret = "<select class='$class' style='background-color:white;' name='$column'>@selopt</select>\n";
my $selret = "<select class='$class' style='background-color:white;$style' name='$column'>@selopt</select>\n";
return $selret;
}
@ -597,7 +597,7 @@ sub singlesubmit3(){
if("$b_name" =~ /delete/){
$button = "<button type='submit' onClick=\"return confirm('Wirklich löschen?')\" class='ebutton' style='$style' name='$function' value='$ib_key'>$ib_value</button>";
}elsif($b_img){
$button = "<button type='submit' class='ebutton' name='$function' value='$ib_key' title='$title' ><img src='$b_img' style='$style' /></button>";
$button = "<button type='submit' style='border: 1px solid silver;' name='$function' value='$ib_key' title='$title' ><img src='$b_img' style='$style' /></button>";
}elsif($b_name){
$button = "<button type='submit' class='ebutton' style='$style' name='$function' value='$ib_key'>$ib_value</button>";
}

View file

@ -766,6 +766,8 @@ sub fetch_tablerecord(){
}elsif($key =~ /^(ct_name$|txt\d+|uri\d+|state)$/ && $value){
if($value eq "null"){
$where .= " and $key $op $value";
}elsif($op eq "IN"){
$where .= " and $key $op $value";
}else{
$where .= " and $key $op '$value'";
}
@ -1051,7 +1053,7 @@ sub insert_contentoid {
my $c_id = $sth->fetchrow_array();
$bw->log("insert_contentoid $source c_id: $c_id",$sql,"") if($debug);
if($insert->{table} =~ /content$|contentadr|contenttrans$|contenttver$|contentuser$/ && $insert->{main_id} && $insert->{template_id}){
if($insert->{table} =~ /content$|contentadr$|contenttrans$|contenttver$|contentuser$/ && $insert->{main_id} && $insert->{template_id}){
my $foreignkey = "";
$foreignkey = "ca_id" if($insert->{table} eq "contentadr");
$foreignkey = "cc_id" if($insert->{table} eq "content");
@ -1106,17 +1108,8 @@ sub collect_transpos {
$search->{$key} =~ s/^\s//g;
$search->{$key} =~ s/\s$//g;
$where .= " and cp.c_id = $search->{$key}" if(($key eq "c_id" || $key eq "cttpos_id") && $search->{$key});
if($key eq "start_time_interval"){
$where .= " and cp.start_time <= $search->{$key}";
}
if($key eq "start_date_time"){
$where .= " and cp.end_time >= '$search->{$key}'";
}
if($key eq "end_date_time"){
$where .= " and cp.end_time <= '$search->{$key}'";
$where .= " and cp.start_time <= '$search->{$key}'";
}
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt08" && $search->{$key});
$where .= " and cp.$key ilike '%$search->{$key}%'" if($key eq "txt23" && $search->{$key});
$where .= " and (cp.int04 = $search->{$key} OR cp.int06 = $search->{$key})" if($key eq "int04" && looks_like_number($search->{$key}));
$where .= " and cp.ct_name = '$search->{$key}'" if($key eq "cp_ct_name" && $search->{$key});
$where .= " and ct.ct_name = '$search->{$key}'" if($key eq "ct_ct_name" && $search->{$key});
@ -1129,6 +1122,13 @@ sub collect_transpos {
$where .= " and (cp.$key is $search->{$key} OR cp.$key = 0)" if($key eq "int34" && $search->{$key} eq "null");
}
#adding itime to get also not rental dependent entries
if($search->{start_date_time} && $search->{end_date_time}){
$where .= " and ((cp.end_time >= '$search->{start_date_time}' and cp.end_time <= '$search->{end_date_time}' and cp.start_time <= '$search->{end_date_time}') OR (cp.itime >= '$search->{start_date_time}' and cp.itime <= '$search->{end_date_time}'))";
}elsif($search->{start_time_interval}){
$where .= " and cp.start_time <= $search->{start_time_interval}";
}
$where .= " ORDER BY cp.end_time $updown LIMIT $search->{limit} OFFSET $search->{offset}" if($search->{limit});
my $sql = "SELECT cp.*,ct.txt07 AS phone from $search->{table} cp, contenttrans ct $where";
my $sth = $dbh->prepare($sql);
@ -1176,7 +1176,6 @@ sub insert_nodeoid(){
my $self = shift;
my $dbh = shift || $dbh_intern;
my $insert = shift;
#my ($parent_id,$main_id,$node_name,$lang,$sort,$template_id,$c_id,$owner) = @_;
my $node_name = $insert->{node_name};
my $node_path = $insert->{node_name};
($node_name,$node_path) = split(/\|/,$node_name) if($node_name =~ /\|/);
@ -1351,6 +1350,7 @@ sub insert_pos(){
my $trackon = $ct->{int25} || 0;
my $bike_type_id = $ct->{type_id} || 0;
my $from_main_id = $ct->{main_id} || 0;
my $from_template_id = $ct->{template_id} || 0;
my $station = $ct->{int04} || 0;
my $rabatt = 0;
@ -1388,9 +1388,9 @@ sub insert_pos(){
my $sth;
#Verleihräder
if($ct->{template_id} && $ct->{template_id} == 205){#Leihrad_list
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,txt12,itime,start_time,end_time,int01,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25,int29,int34,txt22,txt11,int35,int36,int37,int42,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}','$prefix',now(),now(),'$endRental','1','$unit_price','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$daymax_price','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','$ct->{int20}','$trackon','$bike_type_id','$staff','$sig_book->{bikeId}','$sig_book->{rentalId}','$unit_price1','$unit_price2','$start_price','$aa_station','$unit_time','$free_time') RETURNING c_id");
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,txt12,itime,start_time,end_time,int01,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,template_id,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25,int29,int34,txt22,txt11,int35,int36,int37,int42,time01,time02) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}','$prefix',now(),now(),'$endRental','1','$unit_price','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$from_template_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$daymax_price','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','$ct->{int20}','$trackon','$bike_type_id','$staff','$sig_book->{bikeId}','$sig_book->{rentalId}','$unit_price1','$unit_price2','$start_price','$aa_station','$unit_time','$free_time') RETURNING c_id");
}else{
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int01,int02,int03,txt01,txt06,txt07,int10,int12,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','0','$user_name','$ctadr->{txt09}',now(),'1','$unit_price','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$owner') RETURNING c_id");
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int01,int02,int03,txt01,txt06,txt07,int10,int12,template_id,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$ct_name','$ct->{barcode}','$user_name','$ctadr->{txt09}',now(),'1','$unit_price','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$from_template_id','$owner') RETURNING c_id");
}
my $rows = $sth->execute();
my $last_id;

View file

@ -28,9 +28,7 @@ sub handler {
my %varenv = $cf->envonline();
my $filesuff = $q->param('file');
my $dir = $varenv{data};
$dir = $varenv{pdfinvoice} if($varenv{pdfinvoice});
rcopy("$dir/$filesuff","$varenv{basedir}/cache/$coo/$filesuff");
rcopy("$varenv{basedir}/pdfinvoice/$filesuff","$varenv{basedir}/cache/$coo/$filesuff");
print $q->redirect(-uri=>"$varenv{metahost}/cache/$coo/$filesuff", -type=>"application/octet-stream");
#remove_tree("$varenv{basedir}/cache/$coo");
#

View file

@ -261,7 +261,7 @@ sub month_line(){
$week[$j] .= "$_,";
#print $q->th({-nowrap=>1},"$days[$i] $_");
if("$_" eq "$day_today" && "$mon" eq "$mon_today"){
$bg="#86cb00";
$bg="#009899";
}else{
$bg="silver";
}
@ -271,8 +271,7 @@ sub month_line(){
}
}
my $daycounter = $day_today - 1;
my $daymarker = $raster_mmpx * $daycounter;
my $daymarker = $raster_mmpx * ($day_today - 0.5);
$daymarker .= "%";
return ($daymarker,$raster_mmpx,$day4month);

View file

@ -147,7 +147,11 @@ sub save_contenttranspos {
$sig_book = $si->sig_booking(\%varenv,"reserve_end",$authraw,"",$ctpos);
}
}else{
if($ctpos->{c_id}){
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
}else{
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits abgeschlossen";
}
}
#again to get setted date-times
$ctpos = $dbt->collect_post($dbh,$pref);
@ -203,10 +207,11 @@ sub save_contenttranspos {
$feedb->{message} = "Mietdaten gespeichert. Achtung, Mietrad Stati in Warenstamm NICHT übernommen, da es sich nicht um die letzte Miete handelt";
}
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
if($ctpos->{c_id}){
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
#
if($ctpos->{ct_id}){
#
if($ctpos->{ct_id}){
my $ctpref = {
table => "contenttrans",
c_id => $ctpos->{ct_id},
@ -216,10 +221,49 @@ sub save_contenttranspos {
mtime => "now()",
};
$u_rows += $dbt->update_record($dbh,$ctpref,$ctpref);
}
}else{
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits abgeschlossen";
}
}
}elsif($R::int02 && $R::int03){
$R::int02 =~ s/\./\,/ if($R::int02 =~ /\,/);
$R::int03 =~ s/\./\,/ if($R::int03 =~ /\,/);
$R::txt01 = $q->escapeHTML($R::txt01) if($R::txt01);
$R::txt23 = $q->escapeHTML($R::txt23) if($R::txt23);
if($c_id && looks_like_number($R::int02) && looks_like_number($R::int03)){
my $pref = {
table => "contenttrans",
table_pos => "contenttranspos",
fetch => "one",
template_id => "218",#Mietjournal tpl_id
c_id => $c_id,
"ct.close_time" => "is::null",
};
my $ctpos = {};
$ctpos = $dbt->collect_post($dbh,$pref);
my $update_pos = {
table => "contenttranspos",
int02 => "$R::int02",
int03 => "$R::int03",
txt01 => "$R::txt01",
txt23 => "$R::txt23",
owner => $owner,
mtime => "now()",
};
if($ctpos->{c_id}){
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
}else{
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits abgeschlossen";
}
}else{
$feedb->{message} = "failure::Fehler, es sind nur numerische Werte erlaubt.";
}
}else{
$feedb->{message} = "failure::Fehler, falsche Zeitangaben oder Datensatz nicht gefunden!";
$feedb->{message} = "failure::Fehler, fehlerhafte Eingaben oder Datensatz nicht gefunden!";
}
$feedb->{u_rows} = $u_rows;
return $feedb;

View file

@ -201,7 +201,6 @@ sub preinit(){
###ADD PARTS/DATE TO Transactions
if((($ib_key =~ /add_transpos|add_transdate/) || ($R::select_part && ($R::spart_ct_name || $R::json_select))) && (!$ctt->{close_time})){
$table = "contenttranspos";
my $menge="1";
my $zcolumn = "barcode";
my $zcontent = "$R::spart_ct_name" || "$R::json_select";
@ -209,16 +208,10 @@ sub preinit(){
#get part for adding and get from_main_id
my $ct_name = "$R::spart_ct_name" || "$R::json_select" || "";#turn-around!§$
my $c_id = "$R::c_id" || "";
my ($ct,$waren,$pre_lager,$lager);
#my $warentpl_ids = $ctf->{txt37};
my $warentpl_ids = "205,224,225,210,226,227,228,229";
$ct = $db->get_ctrel2("content","$ct_name","","$lang","","$c_id","$warentpl_ids","$zcolumn","$zcontent","");
my $ct = { c_id => 0 };
$ct = $db->get_ctrel2("content","$ct_name","","$lang","","$c_id","224,229","$zcolumn","$zcontent","");
$ct_name = $ct->{ct_name} if($ct->{ct_name});
$lager = $ct->{txt12} if($ct->{txt12});
$lager = $mandant_main_id if(($ib_key =~ /new_transdate/) || ($R::spart_ct_name == $varenv{termin_id}));
if($ct->{main_id}){
$users_dms = $db->select_users($users_dms->{u_id}) if($ib_key =~ /new_/);#nur bei new_ mit save_
@ -231,29 +224,17 @@ sub preinit(){
my $partnr = "$ct_name / $ct->{barcode}";
$partnr = "$ct_name" if("$ct_name" eq "$ct->{barcode}" || !$ct->{barcode});
my $bezeichnung = "$ct->{txt01}";
$ct->{int02} = $ct->{int02} * -1 if($ct->{main_id} == 300012);#Gutscheine
my $einzel_preis = $ct->{int02};
my $einzel_rabatt = $ct->{int07};
$einzel_rabatt = $ctt->{int06} if($ctt->{int06} > 0);
my $unit = $ct->{txt03};
$ct->{int02} = $ct->{int02} * -1 if($ct->{template_id} == 224 && $ct->{int02} > 0);#Gutscheine
#Add Parts from content to contenttranspos#################
my $pos_id;
#Sort counter
my $ctpos = $db->get_content2sort("contenttranspos","1",">=","ct_id","$rel->{content_id}","","");
my $pos_id = 0;
my $ctt = $db->get_content1("contenttrans",$users_dms->{c_id4trans});
#INSERT pos
$pos_id = $db->insert_contenttranspos($table,$partnr,$users_dms->{u_id},$ct->{barcode},$ct->{c_id},$ctt->{c_id},$ct->{main_id},$bezeichnung,"",$unit,$einzel_preis,$menge,"",$einzel_rabatt,$lager,"","$ct->{txt05}","$ct->{txt06}","$ct->{txt07}","$ctt->{txt08}","$ctt->{int10}");
$i_rows += 1 if($pos_id > 0);
#negate if not rental-bike
if(($ct->{template_id} ne "205") && ($ctt->{txt00} !~ /Angebot|Kostenvoranschlag|Auftrag|Storno/) && !$R::c_idpos){
$db->update_content4comp("content",$ct_name,"$ct->{c_id}","-","1","$R::kind_of_trans","$lager");
}
my $ctt = $db->get_content1("contenttrans",$users_dms->{c_id4trans});
my $ctadr = $db->get_content1("contentadr",$ctt->{int10});
$pos_id = $dbt->insert_pos($dbh,$ctt->{c_id},$ct,"",$ctadr,"","",$partnr,"0",$users_dms->{u_id},"");
$i_rows += 1 if($pos_id > 0);
$dbt->update_content4comp($dbh,$ct->{c_id},"-","1");
return "pos_id=$pos_id";#new return-code to get opened Part-Position in Transposition
}elsif($ct_name && !$rel->{content_id}){
return "failure::Für die Terminzuordnung bitte zuerst einen Verkauf Vorgang öffnen oder neu erzeugen.<br /> ::$varenv{wwwhost}/Verkauf::Zum Verkauf";

View file

@ -658,8 +658,10 @@ sub save_transact(){
$valxx =~ s/\s+$//;
#Gutschein
if($_ eq "txt16"){
#forgotten prefix workaround
$valxx = "SX-" . $valxx if($valxx =~ /sigoinpassau|EMW2022/i && $valxx !~ /^SX-/i);
print FILE "Gutschein request $_: $valxx\n" if($debug);
if($valxx && ($valxx =~ /^(\w{2,3})-(\w+)/ || $valxx =~ /^(\w{2,3})(\d+)/)){
if($valxx && $valxx =~ /^(\w{2,3})-(\w+)/){
$valxx =~ s/\s//g;
my $coupon_prefix = uc($1),
my $coupon_nr = $2;
@ -749,14 +751,13 @@ sub save_transact(){
$cttpos = $dbt->collect_post($dbh_operator,$posref);
#check if user has still coupon used
#if(!$cttpos->{c_id}){#disabled
if(1==1){
if(!$cttpos->{c_id}){
if($ctt->{c_id} > 0){
$pos_id = $dbt->insert_pos($dbh_operator,$ctt->{c_id},$ct,"",$ctadr_operator,"",$now_dt,$valxx,"0",$owner,"");
$pos_id = $dbt->insert_pos($dbh_operator,$ctt->{c_id},$ct,"",$ctadr_operator,"","",$valxx,"0",$owner,"");
}else{
my $ct_id = {c_id => 0};
$ct_id = $dbt->insert_contenttrans($dbh_operator,$ctadr_operator,"300008","218","----",$owner);
$pos_id = $dbt->insert_pos($dbh_operator,$ct_id,$ct,$ctadr_operator,"",$now_dt,$valxx,"0",$owner);
$pos_id = $dbt->insert_pos($dbh_operator,$ct_id,$ct,$ctadr_operator,"","",$valxx,"0",$owner);
}
}else{
$ret = "failure::conflict_txt16#top";

View file

@ -216,7 +216,7 @@ $ct->{txt05}
$ct->{txt08}
$ct->{txt11}
Unsere Hotline erreichen Sie unter Tel.: +49 761 45370099
Bei Fragen zum e-Mail Bestätigungscode können sie uns unter hotline\@sharee.bike erreichen.
</div>

View file

@ -15,7 +15,6 @@ use Lib::Config;
use Mod::Buttons;
use Date::Calc qw(:all);
use Mod::Libenz;
use Mod::Libenzdb;
use Mod::Basework;
use Mod::DBtank;
use Mod::APIfunc;
@ -39,7 +38,6 @@ sub tpl(){
my $q = new CGI;
my $cf = new Config;
my $lb = new Libenz;
my $db = new Libenzdb;
my $bw = new Basework;
my $dbt = new DBtank;
my $apif = new APIfunc;
@ -56,7 +54,7 @@ sub tpl(){
my $c_id = $1 if($R::c_id && $R::c_id =~ /(\d+)/);
my $u_id = $1 if($R::u_id && $R::u_id =~ /(\d+)/);
$u_id = $1 if($R::c_idadr && $R::c_idadr =~ /(\d+)/ && $R::base_edit eq "new_dmsusers");
my ($edit,$copy_key,$save_key,$relate_key,$move_key,$delete_key,$package_key);
my ($edit,$copy_key,$save_key,$relate_key,$move_key,$delete_key);
my $tpl = {};
my @tpl_order = ();
my $edit_template = "";
@ -87,7 +85,7 @@ sub tpl(){
#$copy_key = "copy_content";
$save_key = "save_content";
$edit_template = "$ctrel->{template_id}";
$tpl = $db->get_tpl($edit_template);
$tpl = $dbt->get_tpl($dbh,$edit_template);
}elsif($node_meta->{ct_table} eq "contentadr" && $node_meta->{tpl_id}){
my $ref = {
table => "$node_meta->{ct_table}",
@ -103,8 +101,19 @@ sub tpl(){
$edit = "base_edit";
$save_key = "save_adr";
$edit_template = "$ctrel->{template_id}" . "000";
$tpl = $db->get_tpl($edit_template);
$tpl = $dbt->get_tpl($dbh,$edit_template);
}elsif($node_meta->{ct_table} eq "users" && $node_meta->{tpl_id} == 198 && $u_id){
my $dbh_primary = $dbt->dbconnect_extern("sharee_primary");
my $users_dms_primary = { u_id => 0 };
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int03=2");
$tpl = $dbt->get_tpl($dbh,$node_meta->{tpl_id});
#only if user is also a primary DMS user with invoice rw
if(!$users_dms_primary->{u_id} || $users_dms_primary->{int03} != 2){
$tpl->{tpl_order} =~ s/int02=[\w\s\+\&=]+,//;
$tpl->{tpl_order} =~ s/int03=[\w\s\+\&=]+,//;
}
my $ref = {
table => "$node_meta->{ct_table}",
fetch => "one",
@ -116,7 +125,6 @@ sub tpl(){
$bg_color = $varenv{background_color2};
$edit = "base_edit";
$save_key = "save_dmsusers";
$tpl = $db->get_tpl($node_meta->{tpl_id});
#print Dumper($node_meta->{tpl_id}) . "\n u_id:" . $u_id;
#
}elsif($node_meta->{ct_table} eq "contentuser" && $node_meta->{tpl_id} == 199){
@ -133,7 +141,7 @@ sub tpl(){
$bg_color = $varenv{background_color2};
$edit = "rel_edit";
$save_key = "save_ctuser";
$tpl = $db->get_tpl($node_meta->{tpl_id});
$tpl = $dbt->get_tpl($dbh,$node_meta->{tpl_id});
}elsif($node_meta->{ct_table} eq "contenttranspos" && $node_meta->{tpl_id} == 221){
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
@ -164,7 +172,9 @@ sub tpl(){
$bg_color = $varenv{background_color2};
$edit = "base_edit";
$save_key = "save_pos";
$tpl = $db->get_tpl($node_meta->{tpl_id});
my $tpl_id = $node_meta->{tpl_id};
$tpl_id = 223 if($cttpos->{template_id} && $cttpos->{template_id} =~ /224|229/);
$tpl = $dbt->get_tpl($dbh,$tpl_id);
}else{
print $q->div("Es konnten keine Daten gefunden werden"),"\n";
@ -183,7 +193,6 @@ sub tpl(){
$u_name = $dbt->sys_username($dbh,$dbowner);
$dbmtime = $lb->time4de($dbmtime,"1") if($dbmtime);
my $selsize="200px";
#$db->users_up("rel_id4edit",$ctrel->{rel_id},$users_dms->{u_id});
print $q->hidden(-name=>'parent_id',-override=>'1', -value=>"$node_meta->{parent_id}");
print $q->hidden(-name=>'main_id',-override=>'1', -value=>"$node_meta->{main_id}");
@ -203,7 +212,14 @@ sub tpl(){
keyfield => "main_id",
};
$bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$node);
$tariff_all = $db->collect_ct4rel("content","300026",$lang,"","","","","210");
my $tariff = {
table => "content",
fetch => "all",
keyfield => "barcode",
template_id => "210",#Tariff tpl_id
};
$tariff_all = $dbt->fetch_record($dbh,$tariff);
}
print "<div id='Container_cms'>\n";
@ -234,7 +250,16 @@ sub tpl(){
my $tpath = "";
my $top = 70;
if($node_meta->{tpl_id} == 202){
my $cttrans = $db->collect_ct4rel4nd("contenttrans","","$lang","","","","ct.int10","$ctrel->{c_id}","209,218","","rel_id","");
my $pref = {
table => "contenttrans",
fetch => "all",
keyfield => "c_id",
template_id => "IN::(209,218)",
#ca_id => "$ctrel->{c_id}",#future change
int10 => "$ctrel->{c_id}",
};
my $cttrans = $dbt->fetch_record($dbh,$pref);
foreach my $id (sort { $cttrans->{$b}->{c_id} <=> $cttrans->{$a}->{c_id} } keys (%$cttrans)){
my $toppx = $top . "px";
print $q->div({-style=>"position:absolute;top:$toppx;right:20px;"}, " TXID $cttrans->{$id}->{txt16} ",$q->span({-style=>"background-color:#f7ae37"},$q->a({-class=>"linknav",-href=>"/$dbt->{shareedms_conf}->{parent_node}/Faktura/$cttrans->{$id}->{node_name}?ct_trans=open\&c_id4trans=$cttrans->{$id}->{c_id}\&tpl_id4trans=$cttrans->{$id}->{template_id}\&kind_of_trans=$users_dms->{kind_of_trans}&owner=$users_dms->{u_id}",-title=>"Faktura Terminal öffnen"},"[ $cttrans->{$id}->{node_name} #$cttrans->{$id}->{ct_name} ]"))),"\n";

View file

@ -16,7 +16,6 @@ use Lib::Config;
use Mod::Buttons;
use Mod::Libenz;
use Mod::Callib;
use Mod::Libenzdb;
use Mod::DBtank;
use Mod::APIfunc;
use Mod::Pricing;
@ -37,17 +36,12 @@ sub tpl(){
my $lb = new Libenz;
my $but = new Buttons;
my $cb = new Callib;
my $db = new Libenzdb;
my $apif = new APIfunc;
my $dbt = new DBtank;
my $pri = new Pricing;
my $lang = "de";
my $tpl = $db->get_tpl($node_meta->{template_id});
#DB tpl_order used by Rental Editor
#my @tpl_order = split /,/,$tpl->{tpl_order};
my @tpl_order = ('date_time=Mietzeit','txt08=Vorname Name=readonly','int06=Start Station=5','int04=End Station=5','barcode=Rad Nr.=5','int12=Flotte=select','int10=Miet Status=select','int20=Schloss Status=select','owner=user=select');
my @tpl_order = ('date_time=Mietzeit','txt08=Name=15','int06=Start Station=5','int04=End Station=5','barcode=Bike Nr.=5','int12=Flotte=select','int10=Rental State=select','int20=Lock State=select','owner=User=select','txt23=Comment=15');
my %varenv = $cf->envonline();
my %ib = $but->ibuttons();
@ -101,16 +95,16 @@ sub tpl(){
};
my $bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$bnode);
my $root_id = 100;
my $x_main_ids = "$root_id,";
my $tplids = "$node_meta->{template_id},";
my $pref_ct = {
table => "contenttrans",
fetch => "all",
keyfield => "c_id",
template_id => "IN::(209,218)",
};
$tplids .= "218,209";
$tplids =~ s/,$//;
my $ct4rel = { c_id => 0 };
$ct4rel = $dbt->fetch_record($dbh,$pref_ct);
$x_main_ids .= $db->collect_noderec($root_id,$lang,"nothing");
$x_main_ids =~ s/,$//;
my $ct4rel = $db->collect_ct4rel4nd($table,"$x_main_ids","$lang","","","","","","$tplids","","c_id","");
my @months = $cb->monthmap();
my $hh;my $mm;
@ -125,7 +119,7 @@ sub tpl(){
print $q->end_form;
print $q->start_form();
print "<div id='Content4list' style='font-size:0.91em;min-width:1500px;'>\n";
print "<div id='Content4cal'>\n";
my $start_date_time = $R::start_date_time;
my $end_date_time = $R::end_date_time;
@ -177,6 +171,7 @@ sub tpl(){
cttpos_id => $q->escapeHTML("$R::cttpos_id"),
txt06 => $q->escapeHTML("$R::txt06"),
txt08 => $q->escapeHTML("$R::txt08"),
txt23 => $q->escapeHTML("$R::txt23"),
int04 => $q->escapeHTML("$R::int04"),
int06 => $q->escapeHTML("$R::int06"),
int12 => $q->escapeHTML("$R::int12"),
@ -206,14 +201,19 @@ sub tpl(){
}
}
#2019-05-09 collect content to get content.txt10 for Räder Status
my $tpl_id_ware = "205";
my $ct4rel_ware = {};
$ct4rel_ware = $db->collect_cid("content",$lang,$tpl_id_ware,"","","","");
my $pref_cc = {
table => "content",
fetch => "all",
keyfield => "c_id",
template_id => "205",
};
my $ct4rel_part = { c_id => 0 };
$ct4rel_part = $dbt->fetch_record($dbh,$pref_cc);
my $header_style = "";
$header_style = "border:2px solid #9f1f0e;" if($message);
print $q->div({-class=>"copri_header",-style=>"background-color:$tpl->{bg_color};"},"$path", $q->span({-style=>"padding:4px 10px;color:white;"},
print $q->div({-class=>"copri_header",-style=>"background-color:$node_meta->{bg_color};"},"$path", $q->span({-style=>"padding:4px 10px;color:white;"},
" $months[$mon -1] $year",
$q->a({-class=>"linknav",-style=>"padding:0 0.5em;",-title=>"Monat zurück",-href=>"?cal_delta_start=0:-1:0"}," &larr; "),
$q->a({-class=>"linknav",-style=>"padding:0 0.5em;",-title=>"Monat aktuell",-href=>"?cal_today=1"}," &bull; "),
@ -242,7 +242,7 @@ sub tpl(){
#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 $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";
foreach(@tpl_order){
#$h++;
my ($key,$des,$size) = split /=/,$_;
@ -296,37 +296,35 @@ sub tpl(){
###
###Calendar Content
my $nx;my $set_style="";my $kind;
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;
my $itime="";
my $start_time="";
my $end_time="";
my ($year_st,$mon_st,$day_st,$hh_st,$mm_st);
my ($year_en,$mon_en,$day_en,$hh_en,$mm_en);
my $nr=0;
my $i= $offset || 0;
foreach my $pid (sort {
if($users_dms->{cal_sort_updown} eq "down"){
$cttpos->{$b}->{end_time} cmp $cttpos->{$a}->{end_time}
}else{
$cttpos->{$a}->{end_time} cmp $cttpos->{$b}->{end_time}
}
} keys(%$cttpos)){
my $c_left = "14px;";
foreach my $pid (sort { $cttpos->{$b}->{c_id} <=> $cttpos->{$a}->{c_id} } keys(%$cttpos)){
$nr++;
$i++;
$nx++;
$i++;
$c_left = "7px;" if($i >= 10);
$c_left = "0px;" if($i >= 100);
$set_style = "background-color:#fcfdfb;";
$set_style = "background-color:#f4f1ee;" if($nx %= 2);
$set_style = "background-color:#b6dbe3;" if($R::c_id && $R::c_id == $cttpos->{$pid}->{c_id});
my $trans_style = "padding:0 5px;border: 2px solid #f7ae37;";
my $stamm_style = "padding:0 5px;border: 2px solid #98c13b;";
my $ware_style = "padding:0 5px;border: 2px solid #dcd77f;";
my $part_style = "padding:0 5px;border: 2px solid #dcd77f;";
my ($ct_name,$ct_txt00,$ct_txt01,$ct_phone,$c_id4trans,$tpl_id4trans,$u_name,$order_state22);
my $id = $cttpos->{$pid}->{ct_id};
@ -340,27 +338,39 @@ sub tpl(){
$tpl_id4trans = $ct4rel->{$id}->{template_id};
$trans_style .= "background-color:#f7ae37;" if($ct4rel->{$id}->{c_id} == $users_dms->{c_id4trans});
}
($year_st,$mon_st,$day_st,$hh_st,$mm_st) = $lb->split_date($cttpos->{$pid}->{start_time}) if($cttpos->{$pid}->{start_time});
($year_en,$mon_en,$day_en,$hh_en,$mm_en) = $lb->split_date($cttpos->{$pid}->{end_time}) if($cttpos->{$pid}->{end_time});
if($cttpos->{$pid}->{start_time}){
($year_st,$mon_st,$day_st,$hh_st,$mm_st) = $lb->split_date($cttpos->{$pid}->{start_time});
}else{
($year_st,$mon_st,$day_st,$hh_st,$mm_st) = $lb->split_date($cttpos->{$pid}->{itime});
}
if($cttpos->{$pid}->{end_time}){
($year_en,$mon_en,$day_en,$hh_en,$mm_en) = $lb->split_date($cttpos->{$pid}->{end_time});
}else{
($year_en,$mon_en,$day_en,$hh_en,$mm_en) = $lb->split_date($cttpos->{$pid}->{itime});
}
if($year_st && $mon_st && $day_st && $hh_st && $mm_st && $year_en && $mon_en && $day_en && $hh_en && $mm_en){
#if($year_st && $mon_st && $day_st && $hh_st && $mm_st && $year_en && $mon_en && $day_en && $hh_en && $mm_en){
if(1==1){
#generate px for rent scale
my $start_nr = $year_st . $mon_st . $day_st . $hh_st . $mm_st;
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{
$time_style="color:red;";
}
$itime = $lb->time4de($cttpos->{$pid}->{itime},1);
if($cttpos->{$pid}->{start_time}){
$itime = $lb->time4de($cttpos->{$pid}->{itime},1);
$start_time = $lb->time4de($cttpos->{$pid}->{start_time},1);
$end_time = $lb->time4de($cttpos->{$pid}->{end_time},1);
}else{
$start_time = $lb->time4de($cttpos->{$pid}->{itime},1);
$end_time = $lb->time4de($cttpos->{$pid}->{itime},1);
}
my $u_name = $cttpos->{$pid}->{owner} || "";
@ -389,37 +399,35 @@ sub tpl(){
foreach my $did (sort keys (%{$pos_hash})){
$pos_details .= $did . " = " . $pos_hash->{$did} . "</br>" if($pos_hash->{$did});
}
my $pos_id = "";
my $pos_id = "ID $cttpos->{$pid}->{c_id}";
my $user_device = "";
#if($users_dms->{u_id} == $dbt->{copri_conf}->{bike_state}->{superu_id}){
if($users_dms->{u_id} && $users_dms->{u_id} =~ /1842|5781|11765|21618/){
if($users_dms->{u_id} && $users_dms->{u_id} =~ /1842|5781|11765|21618|38883/){
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
my $txt26 = $cttpos->{$pid}->{txt26};
my $txt21 = $cttpos->{$pid}->{txt21};
$txt26 = substr($cttpos->{$pid}->{txt26},0,25) . " ..." if(length($cttpos->{$pid}->{txt26}) > 20);
$txt21 = substr($cttpos->{$pid}->{txt21},0,50) . " ..." if(length($cttpos->{$pid}->{txt21}) > 50);
$user_device = "";
$user_device .= " &rarr; lock charge $cttpos->{$pid}->{int14} %" if($cttpos->{$pid}->{int14});
my $txt26 = $cttpos->{$pid}->{txt26};
$txt26 = substr($cttpos->{$pid}->{txt26},0,25) if(length($cttpos->{$pid}->{txt26}) > 20);
$user_device .= " &rarr; $txt26" if($txt26);
$user_device .= " &rarr; $txt21" if($txt21);
my $txt21 = $cttpos->{$pid}->{txt21};
$txt21 = substr($cttpos->{$pid}->{txt21},0,50) . " ..." if(length($cttpos->{$pid}->{txt21}) > 50);
#$user_device .= " &rarr; $txt21" if($txt21);
}
my $bikenr = "$cttpos->{$pid}->{barcode}";
$bikenr = $q->a({-class=>"linknav3",-style=>"$stamm_style",-href=>"/DMS/Waren/?detail_search=1&s_barcode=$cttpos->{$pid}->{barcode}",-title=>"Rad im Warenstamm"},"$cttpos->{$pid}->{barcode}") if($cttpos->{$pid}->{cc_id});
# (Flotte $cttpos->{$pid}->{int12})
#
my $bikenr = $cttpos->{$pid}->{barcode} || $cttpos->{$pid}->{ct_name};
my $status = "$dbt->{copri_conf}->{bike_state}->{$cttpos->{$pid}->{int10}}" || "state failure";
$status = "<span style='color:#c63e3e;'>$dbt->{copri_conf}->{bike_state}->{$cttpos->{$pid}->{int10}}</span>" if($cttpos->{$pid}->{int10} == 2 || $cttpos->{$pid}->{int10} == 3);
if($cttpos->{$pid}->{int10} ne $ct4rel_ware->{$cttpos->{$pid}->{cc_id}}->{int10}){
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});
$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 in progress</span>" if($cttpos->{$pid}->{int20} == 3);
$lock_state = "<span style='color:#c63e3e;'>unlocking in progress</span>" if($cttpos->{$pid}->{int20} == 4);
if($cttpos->{$pid}->{int20} ne $ct4rel_ware->{$cttpos->{$pid}->{cc_id}}->{int20}){
$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}){
$lock_state = "<span style='border: 1px solid #c63e3e;'>$dbt->{copri_conf}->{lock_state}->{$cttpos->{$pid}->{int20}}</span>";
}
@ -435,22 +443,33 @@ sub tpl(){
if($node_meta->{ct_table} eq "contenttranspos"){
my $start_station = "$cttpos->{$pid}->{int06}";
my $end_station = "$cttpos->{$pid}->{int04}";
$start_station = $q->a({-class=>"linknav3",-style=>"",-href=>"/DMS/Waren/?detail_search=1&s_int04=$cttpos->{$pid}->{int06}",-title=>"Rad Warenstamm nach Station filtern"},"$cttpos->{$pid}->{int06}") if($ct4rel_ware->{$cttpos->{$pid}->{cc_id}}->{rel_id});
$end_station = $q->a({-class=>"linknav3",-style=>"",-href=>"/DMS/Waren/?detail_search=1&s_int04=$cttpos->{$pid}->{int04}",-title=>"Rad Warenstamm nach Station filtern"},"$cttpos->{$pid}->{int04}") if($ct4rel_ware->{$cttpos->{$pid}->{cc_id}}->{rel_id});
$start_station = $q->a({-class=>"linknav3",-style=>"",-href=>"/DMS/Waren/?detail_search=1&s_int04=$cttpos->{$pid}->{int06}",-title=>"Rad Warenstamm nach Station filtern"},"$cttpos->{$pid}->{int06}") if($ct4rel_part->{$cttpos->{$pid}->{cc_id}}->{rel_id});
$end_station = $q->a({-class=>"linknav3",-style=>"",-href=>"/DMS/Waren/?detail_search=1&s_int04=$cttpos->{$pid}->{int04}",-title=>"Rad Warenstamm nach Station filtern"},"$cttpos->{$pid}->{int04}") if($ct4rel_part->{$cttpos->{$pid}->{cc_id}}->{rel_id});
my $comment = $cttpos->{$pid}->{txt23};
$comment = substr($cttpos->{$pid}->{txt23},0,50) . " ..." if(length($cttpos->{$pid}->{txt23}) > 50);
my $kunde = "$cttpos->{$pid}->{txt08}";
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2){
$kunde = $q->a({-class=>"linknav3",-style=>"$ware_style",-href=>"/DMS/Kunden/?detail_search=1&s_c_id=$cttpos->{$pid}->{ca_id}",-title=>"Kunde im Kundenstamm"},"$cttpos->{$pid}->{txt08} ($cttpos->{$pid}->{ca_id})");#2021-05-24 saves kd name
$kunde = $q->a({-class=>"linknav3",-style=>"$part_style",-href=>"/DMS/Kunden/?detail_search=1&s_c_id=$cttpos->{$pid}->{ca_id}",-title=>"Kunde im Kundenstamm"},"$cttpos->{$pid}->{txt08} ($cttpos->{$pid}->{ca_id})");#2021-05-24 saves kd name
}
my $edit_pos = $q->a({-class=>"editboo",-href=>"?base_edit=transpos\&c_id=$cttpos->{$pid}->{c_id}\&owner=$users_dms->{u_id}",-title=>"Miete bearbeiten ($cttpos->{$pid}->{c_id})"},$q->span({-class=>"bi bi-file-earmark-text-fill"}));
my $edit_pos = $q->a({-class=>"editboo",-href=>"?base_edit=transpos\&c_id=$cttpos->{$pid}->{c_id}\&owner=$users_dms->{u_id}",-title=>"Position bearbeiten ($cttpos->{$pid}->{c_id})"},$q->span({-class=>"bi bi-file-earmark-text-fill"}));
print $q->div({-style=>'float:left;margin-left:1em;font-size:0.91em;'}, "<span style='$time_style'>$edit_pos $i) $start_time $end_time</span> &rarr; $kunde &rarr; Start Station $start_station &rarr; End Station $end_station &rarr; Rad $bikenr $status $lock_state $track_info &rarr; $u_name/$u_name_end $pos_id"),"\n";
#Gebühren und Gutscheine
if($cttpos->{$pid}->{template_id} && $cttpos->{$pid}->{template_id} =~ /224|229/){
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id &rarr; $start_time &rarr; Nr. $bikenr &rarr; $kunde &rarr; $u_name/$u_name_end"),"\n";
}else{
$bikenr = $q->a({-class=>"linknav3",-style=>"$stamm_style",-href=>"/DMS/Waren/?detail_search=1&s_barcode=$cttpos->{$pid}->{barcode}",-title=>"Rad im Warenstamm"},"$bikenr") if($cttpos->{$pid}->{cc_id});
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id &rarr; <span style='$time_style'>$start_time $end_time</span> &rarr; $kunde &rarr; Start Station $start_station &rarr; End Station $end_station &rarr; Bike $bikenr $status $lock_state $track_info &rarr; $u_name/$u_name_end"),"\n";
#print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id &rarr; Start $start_time Station $start_station &rarr; End $end_time Station $end_station &rarr; Bike $bikenr $status $lock_state $track_info &rarr; $kunde &rarr; $u_name/$u_name_end"),"\n";
}
if($users_dms_primary->{u_id} && $users_dms_primary->{int03} == 2){
print $q->div({-style=>'float:left;margin-left:1em;font-size:0.91em;'}, "&rarr; Faktura", $q->a({-class=>"linknav3",-style=>"$trans_style",-href=>"/DMS/Faktura?ct_trans=open\&c_id4trans=$c_id4trans\&tpl_id4trans=$tpl_id4trans\&kind_of_trans=Faktura\&owner=$users_dms->{owner}",-title=>"Faktura Terminal öffnen"},"\#$ct_name")),"\n" if($c_id4trans && $tpl_id4trans);
print $q->div({-style=>'float:left;margin-left:1em;font-size:0.91em;'}, "$user_device"),"\n";
print $q->div({-style=>'float:left;margin-left:1em;'}, "&rarr; Faktura", $q->a({-class=>"linknav3",-style=>"$trans_style",-href=>"/DMS/Faktura?ct_trans=open\&c_id4trans=$c_id4trans\&tpl_id4trans=$tpl_id4trans\&kind_of_trans=Faktura\&owner=$users_dms->{owner}",-title=>"Faktura Terminal öffnen"},"\#$ct_name")),"\n" if($c_id4trans && $tpl_id4trans);
print $q->div({-style=>'float:left;margin-left:1em;'}, "$user_device"),"\n";
}
print $q->div({-style=>'float:left;margin-left:1em;'}, " &rarr; $comment"),"\n";
}elsif($node_meta->{ct_table} eq "contenttheftpos"){
my $speed = 0;
@ -461,11 +480,11 @@ sub tpl(){
my $event_type = "";
$event_type = "Diebstahlalarm" if($cttpos->{$pid}->{int01});
$event_type = "GPS $cttpos->{$pid}->{txt06} &rarr; speed $speed km/h &rarr; distance $cttpos->{$pid}->{int08} Meter" if($cttpos->{$pid}->{int02});
print $q->div({-style=>'float:left;margin-left:1em;font-size:0.91em;'}, "$i) <span style='$time_style'> $end_time</span> &rarr; $event_type &rarr; Rad $bikenr &rarr; $u_name $pos_id"),"\n";
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $pos_id &rarr; $end_time &rarr; $event_type &rarr; Bike $bikenr &rarr; $u_name"),"\n";
}
print $q->div({-style=>"position:absolute;margin-left:$daymarker;border-right: solid thin #86cb00;height:1.5em;"},"&nbsp;"),"\n" if("$mon" eq "$mon_today");
print $q->div({-style=>"position:absolute;margin-left:$daymarker;border-right: solid thin #009899;height:1.5em;"},"&nbsp;"),"\n" if("$mon" eq "$mon_today");
print $q->div({-style=>"position:static;margin-left:$day_stpx;width:$rent_day_px;height:1.5em;background-color:$scale_color;"},"&nbsp;"),"\n";
print "</td></Tr>\n";
}

View file

@ -815,7 +815,7 @@ sub tpl(){
print $q->Tr(),"\n";
#checkboxes
#permissions
if($users_dms->{int07} == 2){#only DMS-Account Admin
if($users_dms_primary->{int03} == 2 && $users_dms->{int03} == 2){
print $q->td({-style=>"background-color:silver;"}, $q->checkbox(-name=>"ck4ex", -checked=>'', -value=>"$ct4rel->{$id}->{c_id}", -label=>'')),"\n";
}else{
print $q->td({-style=>"background-color:silver;"},"&nbsp;"),"\n";
@ -1353,7 +1353,7 @@ sub tpl(){
print "<div id='jump_bottom' style='clear:both;border:0px dotted silver;height:35px;'>\n";
if($R::detail_search !~ /suchen/ && $rows > $limit && $nr > 0){
print $q->div({-style=>'float:left;padding:6px 0 0 20px;'},"Datensätze pro Seite:",$q->textfield(-style=>'height:16px;',-name=>"limit",-default=>"$limit",-size=>"3",-maxlength=>10)),"\n";
print $q->div({-style=>'float:left;padding:7px 0 0 10px;'},$but->singlesubmit3("detail_search","reload_search","$varenv{metahost}/img/refresh.png","height:15px;","Tabelle neu laden")),"\n";
print $q->div({-style=>'float:left;padding:7px 0 0 10px;'},$but->singlesubmit3("detail_search","reload_search","$varenv{metahost}/img/refresh.png","height:14px;","Tabelle neu laden")),"\n";
}
print $q->end_form;

View file

@ -54,14 +54,9 @@ sub tpl(){
my $parent_node4rel = $db->get_node4rel($node_meta->{parent_id},"","","null");
my %ib = $but->ibuttons();
my $tpl_order = $node_meta->{tpl_order};
if(1==2 && $node_meta->{tpl_id} > 400 && $node_meta->{tpl_id} < 500){
$tpl_order =~ s/barcode=Rad/barcode=Rad,txt10=Station-log,txt09=Wartungsprotokoll=area/;
$tpl_order =~ s/int04=Station/int04=Station,txt09=Wartungsprotokoll=area/ if($node_meta->{tpl_id} == 499);
}
my @tpl_order = split /,/,$tpl_order;
my $message = "";
#$message = "Fehler: " if(scalar(@tpl_order) < 1);
my $s_owner_id = "";
#my $s_u_name = "";
@ -146,6 +141,16 @@ sub tpl(){
$tpl_ids = $node_meta->{tpl_id};
}
elsif($node_meta->{tpl_id} == 198){
my $dbh_primary = $dbt->dbconnect_extern("sharee_primary");
my $users_dms_primary = { u_id => 0 };
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int03=2");
#only if user is also a primary DMS user with invoice rw
if(!$users_dms_primary->{u_id} || $users_dms_primary->{int03} != 2){
$node_meta->{tpl_order} =~ s/int02=[\w\s\+\&=]+,//;
$node_meta->{tpl_order} =~ s/int03=[\w\s\+\&=]+,//;
}
$table = "contentadr";
$searchref->{table_pos} = "users";
#$searchref->{template_id_pos} = "$node_meta->{tpl_id}";
@ -177,6 +182,7 @@ EOF
;
}
my @tpl_order = split /,/,$node_meta->{tpl_order};
#print Dumper($node_meta);
my $hashfile = "$varenv{logdir}/$users_dms->{u_id}-$searchref->{table_pos}-searchhash";

View file

@ -53,11 +53,11 @@ sub tpl(){
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
my $dbh = "";
my $channel_map = $dbt->channel_map();
my $coo = $q->cookie(-name=>'domcookie');
my $mapref = {};
my $ct_users = $dbt->users_map($dbh,$mapref);#get serviceAPP and DMS users from contentadr
my $line_count2;
my $line_count2 = 0;
my $k=0;
my $spart_ct_name = $R::spart_ct_name || "";
my $c_idpos = $R::c_idpos || $R::pos_id || "";
@ -586,8 +586,9 @@ EOF
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> $vibuchen_mtime Gebucht $ctt->{int01} € \"$ctt->{state}\"") if($ctt->{state});
}
if( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" && $varenv{metahost}){
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "Download: ", $q->a({-href=>"$varenv{metahost}/pdf/$praefix-$ctt->{ct_name}.pdf", -target=>'_blank'},"$praefix-$ctt->{ct_name}.pdf"));
if( -f "$varenv{pdfinvoice}/$praefix-$ctt->{ct_name}.pdf"){
#print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"}, "Download: ", $q->a({-href=>"$varenv{metahost}/pdf/$praefix-$ctt->{ct_name}.pdf", -target=>'_blank'},"$praefix-$ctt->{ct_name}.pdf"));
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;'}), "Rechnung $ctt->{ct_name}.pdf"),"\n";
}

View file

@ -0,0 +1 @@
../../../../../sharee.bike/copri-bike/main/src/scripts/statistik_userevaluation.pl

View file

@ -89,13 +89,13 @@ sub tpl(){
if($dbt->{operator}->{$m_id}->{oprefix} eq $oprefix || $dbt->{operator}->{$m_id}->{project} eq $project){
print $q->div({-class=>"$content2"},"&nbsp;"),"\n";
my $sharee_operator = $dbt->{operator}->{$m_id}->{database}->{dbname};
my $sharee_operator = $dbt->{operator}->{$m_id}->{database}->{dbname} || "";
my $dbh_operator = $dbt->dbconnect_extern($sharee_operator);
$record_cc = $dbt->fetch_record($dbh_operator,$pref_cc);
#print Dumper($node_meta->{tpl_order}) . "<br />\n";
#Do it only if phone and email defined
if($record_cc->{txt07} && $record_cc->{txt08}){
#handmade activation to show only realy live operators on web contact
if($sharee_operator && $sharee_operator =~ /sharee_mak|sharee_sx|sharee_lec/){
foreach (@tpl_order){
my ($key,$des,$size) = split /=/,$_;
@ -120,8 +120,8 @@ sub tpl(){
$record_cc->{$key} =~ s/\\//g;
if($des =~ /hotline|e-Mail|zeiten/i){
print $q->div({-class=>"$content2"}, "$des: $record_cc->{$key}"),"\n";
print $q->div({-class=>"$content2"},"&nbsp;"),"\n" if($des =~ /e-Mail/i);
}else{
print $q->div({-class=>"$content2"},"&nbsp;"),"\n" if($key eq "txt01");
print $q->div({-class=>"$content2"}, "$record_cc->{$key}"),"\n";
}

View file

@ -143,7 +143,7 @@ sub tpl(){
$webtarget = "_self";
$dtext = "<br />(Der PDF download öffnet je nach System/Konfiguartion einen externen PDF-Viewer oder Webbrowser)";
}
print $q->div({-style=>'padding:10px;margin:10px 0;'},$q->a({-href=>"$varenv->{wwwhost}/FileOut?file=SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;font-size:1.1em;'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "SEPA-Lastschriftmandat.pdf"),"$dtext"),"\n";
print $q->div({-style=>'padding:10px;margin:10px 0;'},$q->a({-href=>"$varenv->{wwwhost}/FileOut?file=SEPA-Lastschriftmandat-$varenv->{praefix}-$ctadr->{ct_name}.pdf&sessionid=$coo", -target=>"$webtarget" , -type=>'application/octet-stream', -style=>'text-decoration:underline;font-size:1.1em;'}, $q->img({-src=>"$varenv->{metahost}/glyphicons/file-any.png", -style=>'width:30px;'}), "SEPA-Lastschriftmandat.pdf"),"$dtext"),"\n";
}else{
print $q->div({-style=>'padding:10px;margin:10px 0;border:1px solid silver;color:#c83434;'},"Es gibt ein Problem! Das SEPA Mandat konnte nicht eingeholt werden. Bitte wenden Sie sich bei Bedarf an den unter \"Kontakt\" hinterlegten Support."),"\n";
}

View file

@ -80,6 +80,12 @@
PerlResponseHandler Mod::GBFSout
</Location>
<Location /FileOut>
SetHandler perl-script
PerlInitHandler Apache2::Reload
PerlResponseHandler Mod::FileOut
</Location>
<Location /ajax_json>
SetHandler perl-script
PerlInitHandler Apache2::Reload
@ -92,12 +98,6 @@
PerlResponseHandler Mod::ajax_post
</Location>
<Location /FileOut>
SetHandler perl-script
PerlInitHandler Apache2::Reload
PerlResponseHandler Mod::FileOut
</Location>
<IfModule mod_rewrite.c>
RewriteEngine On
RedirectMatch ^/$ /DMS/Mietjournal