Invoice on work mailing. Check iban if still exist with vde. Station selector on edit

This commit is contained in:
ragu 2023-07-13 12:10:45 +02:00
parent a3d251e643
commit 1744cd35a3
15 changed files with 234 additions and 110 deletions

View file

@ -1243,6 +1243,7 @@ sub booking_update(){
$booking_values->{response_state} = "OK: occupied bike " . $q->param('bike');
$booking_values->{response_text} = "Fahrrad Nr. " . $q->param('bike') . " Miete gestartet. ";
$update_cc->{int10} = 3;
#$update_cc->{int04} = "null";#Because of servicetool, we hav to be keep the station
}
#fraud_rental sms_message

View file

@ -699,7 +699,7 @@ elsif($q->param('request') eq "stations_available"){
my $localtime = Time::Piece->strptime($lnow, "%Y-%m-%d %H:%M:%S");
my $epoch_now = $localtime->epoch;
my $merchant_message_start = Time::Piece->strptime("2023-06-26 00:00:00", "%Y-%m-%d %H:%M:%S");
my $merchant_message_end = Time::Piece->strptime("2023-07-06 23:59:00", "%Y-%m-%d %H:%M:%S");
my $merchant_message_end = Time::Piece->strptime("2023-08-06 23:59:00", "%Y-%m-%d %H:%M:%S");
my $epoch_start = $merchant_message_start->epoch;
my $epoch_end = $merchant_message_end->epoch;

View file

@ -422,14 +422,15 @@ sub sig_booking {
my $endpoint = "$dbt->{operator}->{$varenv->{dbname}}->{endpoint}/";
my %json = ();
$ctadr->{txt08} =~ s/[a-z]-/-/; $ctadr->{txt08} =~ s/[a-z]_/_/; $ctadr->{txt08} =~ s/[0-9a-z]\@/\@/i; $ctadr->{txt08} =~ s/[0-9a-z]\@/\@/i; $ctadr->{txt08} =~ s/\@(\w{1,2})\w+\.(\w+)/\@$1email\.$2/i;
$ctadr->{txt08} =~ s/[a-z]\./\./ if($ctadr->{txt08} =~ /\.\w+\@/);
my $email = $ctadr->{txt08};
$email =~ s/[a-z]-/-/; $email =~ s/[a-z]_/_/; $email =~ s/[0-9a-z]\@/\@/i; $email =~ s/[0-9a-z]\@/\@/i; $email =~ s/\@(\w{1,2})\w+\.(\w+)/\@$1email\.$2/i;
$email =~ s/[a-z]\./\./ if($email =~ /\.\w+\@/);
#reservation start
if($todo eq "reserve"){
$endpoint .= "bikes/reserve";
%json = (
bikeId => "$ct_bike->{txt22}",
email => "$ctadr->{txt08}"
email => "$email"
);
}
#reservation end, this sig request is still not defined. maybe end by rentalId
@ -438,7 +439,7 @@ sub sig_booking {
$endpoint .= "bikes/reserve/end";
%json = (
rentalId => "$ctpos->{txt11}",
email => "$ctadr->{txt08}"
email => "$email"
);
}
#rental start
@ -448,7 +449,7 @@ sub sig_booking {
my $sig_bikeId = $ctpos->{txt22} || $ct_bike->{txt22};
%json = (
bikeId => "$sig_bikeId",
email => "$ctadr->{txt08}"
email => "$email"
);
}
#rental end
@ -456,7 +457,7 @@ sub sig_booking {
$endpoint .= "rental/end";
%json = (
rentalId => "$ctpos->{txt11}",
email => "$ctadr->{txt08}"
email => "$email"
);
#keep in mind, it will return no json, just text: "Rental Ended"
}
@ -465,7 +466,7 @@ sub sig_booking {
elsif($todo eq "rentals_running"){
$endpoint .= "rentals/running";
%json = (
email => "$ctadr->{txt08}"
email => "$email"
);
}

View file

@ -268,7 +268,7 @@ sub selector_class(){
my $value = $opt;
($id,$value) = split /:/,$opt if($opt =~ /\:/);
$des_style = "color:grey;" if(!$id);
if($sel && $sel eq $id){
if($sel eq $id){
push @selopt, "<option style='$des_style' selected value='$id'>$value</option>\n";
}else{
push @selopt, "<option style='$des_style' value='$id'>$value</option>\n";

View file

@ -1466,7 +1466,8 @@ sub insert_pos(){
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 $start_station = $ct->{int04} || 0;
my $end_station = "null";#2023-07-12 will be not set on request.
my $fibumark = $ct->{int16} || 0;
my $rabatt = 0;
@ -1502,7 +1503,7 @@ 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,template_id,int13,owner,int07,txt04,int09,int17,int15,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','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','1','$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,txt05,txt06,txt07,int10,int12,template_id,int13,owner,int07,txt04,int09,int17,int15,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','$start_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','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','1','$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,int16,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','$fibumark','$from_template_id','$owner') RETURNING c_id");
}

View file

@ -213,19 +213,16 @@ sub handler {
print $q->header(-charset=>"$html_charset", -cookie=>$cookie);
#print "5. set cookie: " . $author->{authcookie} . " -- " . $q->param('authcookie') . " ++ " . $coo . "<br>";
#2020-07-09 if user-pw authorized, then ignore conflict_ because it matches exist user-data
#if user-pw authorized, then ignore conflict_ because it matches exist user-data
#should be result to Uhps page
if($tinkc_id && $returnwww && $returnwww =~ /conflict_txt07|conflict_txt08/){
#delete user-pw conflict registration and going on with existing data
#$db->delete_content("contentadr",$tinkc_id);
$return = $tk->delete_account($tinkc_id,$users_dms->{u_id});
$apif->authout($q,$coo) if($coo);
print redirect("$varenv{wwwhost}/$varenv{mandant}/Anmelden?conflict_failure=1");
exit 0;
}
elsif(length($coo) > 20){
#we need this to get $R::sessionid to FormEdit
#if(length($coo) > 20 && !$q->cookie(-name=>'domcookie')){
($api_return,$users_sharee) = $apif->auth_verify($q,$author->{authcookie},"");
if(($returnwww && $returnwww =~ /failure::(.*)/) || ($users_sharee->{txt31} && $users_sharee->{txt31} =~ /\w/)){
$returnwww =~ s/::/=/g;
@ -482,6 +479,13 @@ sub handler {
($api_return,$users_sharee) = $apif->auth_verify($q,$coo,"");
if($returnwww =~ /txt22|txt23/){
#should be result to Uhps page
if($returnwww =~ /conflict_txt22/){
$return = $tk->delete_account($users_sharee->{c_id},$users_dms->{u_id});
$apif->authout($q,$coo) if($coo);
print redirect("$varenv{wwwhost}/$varenv{mandant}/Anmelden?conflict_failure=1");
exit 0;
}
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_2}?cum=1$session_and\&$returnwww");
}elsif($returnwww =~ /int03/){
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}?cum=1$session_and\&$returnwww");

View file

@ -556,6 +556,7 @@ sub save_contenttranspos {
table => "contenttranspos",
start_time => "$start_time",
end_time => "$end_time",
int04 => "null",
owner_end => $owner,
mtime => "now()",
};

View file

@ -324,14 +324,12 @@ sub fetch_rentalfeed {
my $return = {};
$return->{bike_group} = ["$bike_group"];
#TOD save with prefix
$return->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int04}";
$return->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int06}";
$return->{uri_operator} = "$varenv->{wwwhost}";#TOD, should be DB select
$return->{bike} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{barcode}";
#TOD save also sig prefix
if($dbt->{operator}->{$varenv->{dbname}}->{oprefix} eq "SX"){
$return->{bike} = "S3X$ctpos->{barcode}";
#$return->{station} = "S3X$ctpos->{int04}";
}
$return->{state} = "$dbt->{copri_conf}->{bike_state}->{$ctpos->{int10}}" || "";
$return->{lock_state} = "$dbt->{copri_conf}->{lock_state}->{$ctpos->{int20}}";
@ -508,46 +506,62 @@ sub operator_accounting2calc {
my $varenv = shift;
my $ctpos = shift;#client invoices
my $ctf = shift;#Operator-Faktura config
my $today4db = strftime("%Y-%m-%d %H:%M:%S",localtime(time));
my $tplf = $dbt->get_tpl($dbh,"196");#Operator-Faktura
my @tplf_order = split /,/,$tplf->{tpl_order};
my $debug=1;
open(FILE,">>$varenv->{logdir}/operator_accounting2calc.log") if($debug);
print FILE "\n*-->$today4db $varenv->{dbname}\n" if($debug);
print FILE "ctpos:\n" . Dumper($ctpos) . "\n" if($debug);
#returned values
my $oac = {
int01 => 0,
int02 => 0,
int93 => 0,
int94 => 0,
int95 => 0,
int96 => 0,
int97 => 0,
int98 => 0,
int99 => 0,
int100 => 0,
int01 => 0,#capture netto (Netto Erlös)
int02 => 0,#Gutschrift
int93 => 0,#Entgelt TeilRad
int94 => 0,#Disagio
int95 => 0,#Transaktion
int96 => 0,#Zahlungsmeldung
int97 => 0,#Kreditkarte Zuordnung
int99 => 0,#invoice captured brutto
int100 => 0,#Operator invoice (TeilRad Gebühren netto)
};
#TODO #accounting Bank Gebühren
my $invoice_brutto = 0;
my $sumgeb_bank = 0;
if($ctpos->{int01}){
$invoice_brutto = $ctpos->{int01};
#substract TeilRad Gebühren
if($ctpos->{int08} && $ctpos->{int08} > 0){
$invoice_brutto -= $ctpos->{int08};
}
#substract Bank Gebühren
if($ctpos->{int07} && $ctpos->{int07} > 0){
$invoice_brutto -= $ctpos->{int07};
$sumgeb_bank -= $ctpos->{int07};
}
$oac->{int99} = $invoice_brutto;
#invoice capture netto
$oac->{int01} = $invoice_brutto / 119 * 100;
}
$oac->{int01} = sprintf('%.2f', $oac->{int01});
foreach(@tplf_order){
my ($key,$val,$size) = split /=/,$_;
if($key =~ /int/){
my $invoice_brutto = 0;
if($key eq "int01" && $ctpos->{int01}){
$invoice_brutto = $ctpos->{int01};
#substract TeilRad Gebühren
$invoice_brutto = $ctpos->{int01} - $ctpos->{int08} if($ctpos->{int08} && $ctpos->{int08} > 0);
#substract Bank Gebühren
$invoice_brutto = $ctpos->{int01} - $ctpos->{int07} if($ctpos->{int07} && $ctpos->{int07} > 0);
$oac->{int99} = $invoice_brutto;
#invoice capture netto
$oac->{int01} = $invoice_brutto / 119 * 100;
}
$oac->{int01} = sprintf('%.2f', $oac->{int01});
if($ctpos->{state} =~ /Lastschrift|Überweisung/){
$oac->{int93} = $oac->{int01} / 100 * $ctf->{$key} if($key eq "int01");#7,5%
if($ctpos->{state} =~ /Zahlungsausfall/){
$oac->{int01} = $sumgeb_bank;
$oac->{int93} = $sumgeb_bank * -1 if($key eq "int01");#Entgelt TeilRad
$oac->{int93} = sprintf('%.3f', $oac->{int93});
}
if($ctpos->{state} =~ /Lastschrift|Überweisung/){
$oac->{int93} = $oac->{int01} / 100 * $ctf->{$key} if($key eq "int01");#Entgelt TeilRad
$oac->{int93} = sprintf('%.3f', $oac->{int93});
$oac->{int98} = $oac->{int93} * 0.19 if($oac->{int93});#UmSt auf 7,5%
$oac->{int98} = sprintf('%.3f', $oac->{int98});
$oac->{int94} = $oac->{int01} / 100 * $ctf->{$key} * -1 if($key eq "int02");#po Disagio %
$oac->{int94} = sprintf('%.3f', $oac->{int94});
$oac->{int95} = $ctf->{$key} * -1 if($key eq "int04");#po Trans
@ -556,11 +570,10 @@ sub operator_accounting2calc {
$oac->{int96} = sprintf('%.3f', $oac->{int96});
$oac->{int97} = 0;
}
if($ctpos->{state} =~ /Kreditkarte/){
$oac->{int93} = $oac->{int01} / 100 * $ctf->{$key} if($key eq "int01");#7,5%
$oac->{int93} = $oac->{int01} / 100 * $ctf->{$key} if($key eq "int01");#Entgelt TeilRad
$oac->{int93} = sprintf('%.3f', $oac->{int93});
$oac->{int98} = $oac->{int93} * 0.19 if($oac->{int93});#UmSt auf 7,5%
$oac->{int98} = sprintf('%.3f', $oac->{int98});
$oac->{int94} = $oac->{int01} / 100 * $ctf->{$key} * -1 if($key eq "int03");#po Disagio %
$oac->{int94} = sprintf('%.3f', $oac->{int94});
$oac->{int95} = $ctf->{$key} * -1 if($key eq "int05");#po Trans
@ -570,16 +583,19 @@ sub operator_accounting2calc {
$oac->{int97} = $ctf->{$key} * -1 if($key eq "int07");#po CC Zuordnung
$oac->{int97} = sprintf('%.3f', $oac->{int97});
}
#operator accounting
$oac->{int02} = $oac->{int01} + $oac->{int94} + $oac->{int95} + $oac->{int96} + $oac->{int97};
$oac->{int02} = sprintf('%.3f', $oac->{int02});
#operator invoice
#$oac->{int100} = $oac->{int93} + $oac->{int98};#brutto
$oac->{int100} = $oac->{int93};#netto
$oac->{int100} = sprintf('%.3f', $oac->{int100});
}
}
#operator accounting
$oac->{int02} = $oac->{int01} + $oac->{int94} + $oac->{int95} + $oac->{int96} + $oac->{int97};
$oac->{int02} = sprintf('%.3f', $oac->{int02});
#operator invoice
$oac->{int100} = $oac->{int93};#netto
$oac->{int100} = sprintf('%.3f', $oac->{int100});
print FILE "oac:\n" . Dumper($oac) . "\n" if($debug);
close(FILE) if($debug);
return $oac;
}

View file

@ -111,16 +111,6 @@ sub delete_account {
return "$i_rows-$u_rows-$d_rows";
}
sub check_account(){
my $self = shift;
my ($column2,$op2,$content2,$column3,$op3,$content3) = @_;
my $table = "contentadr";
$content2 = $q->escapeHTML("$content2");
my $account_check = $db->get_like2sort("contentadr","","","$column2","$op2","$content2","$column3","$op3","$content3");
return $account_check;
}
#create_account is alwas done on primary first
sub create_account(){
my $self = shift;
@ -440,8 +430,17 @@ sub save_account(){
if($valxx !~ /\w\@\w/){
$ret = "failure::$_#top";
}else{
my $account_check = &check_account("","txt08","ilike",$valxx,"c_id","!=",$c_id);
print FILE "$account_check->{c_id} && $account_check->{c_id} != $c_id\n" if($debug);
my $pref_ac = {
table => "contentadr",
fetch => "one",
txt08 => "ilike::$valxx",
c_id => "!=::$c_id",
order => "mtime",
};
my $account_check = $dbt->fetch_tablerecord($dbh,$pref_ac);
#my $account_check = $self->check_account("txt08","ilike",$valxx,"c_id","!=",$c_id);
print FILE "account_check email:$valxx, c_id:$account_check->{c_id} && $account_check->{c_id} != $c_id\n" if($debug);
if($account_check->{c_id} && $account_check->{c_id} != $c_id){
my $encoded_val = $uri_encode->encode($valxx);
$ret_conflict = "failure::conflict_$_=$encoded_val#top";
@ -525,6 +524,22 @@ sub save_account(){
my $vde_on_fail = $ctadr->{int12} || 3;#keep last or set 3
#check if iban from another user has Vde
my $pref_ac = {
table => "contentadr",
fetch => "one",
txt22 => "$iban",
int12 => ">=::1",
c_id => "!=::$c_id",
order => "mtime",
};
my $account_check = $dbt->fetch_tablerecord($dbh,$pref_ac);
print FILE "account_check iban:$iban, c_id:$account_check->{c_id} && $account_check->{c_id} != $c_id\n" if($debug);
if($account_check->{c_id} && $account_check->{c_id} != $c_id){
my $encoded_val = $uri_encode->encode($iban);
$ret_conflict = "failure::conflict_txt22=$encoded_val#top";
}
my $payone_mival = $payone->managemandate_main(\%varenv,$ctadr,"",$owner);
if($payone_mival && $payone_mival =~ /\w{2}-\d+/){
#define fictiv invoice to get 1 € test

View file

@ -234,7 +234,6 @@ sub tpl(){
###
my $bike_nodes = {};
my $tariff_all = {};
my $node = {
template_id => 205,
parent_id => 200013,
@ -243,6 +242,16 @@ sub tpl(){
};
$bike_nodes = $dbt->fetch_rel4tpl4nd($dbh,$node);
my $station_all = {};
my $pref_st = {
table => "content",
fetch => "all",
keyfield => "c_id",
template_id => 225,
};
$station_all = $dbt->fetch_record($dbh,$pref_st);
my $tariff_all = {};
my $tariff = {
table => "content",
fetch => "all",
@ -398,9 +407,19 @@ EOF
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
#print $q->td({-class=>'content1_cms'}, $q->textfield(-class=>'etxt',-name=>"int09",-default=>"$cttpos->{int09}",-size=>"5",-maxlength=>5), "Text", $q->textfield(-class=>'etxt',-name=>"txt04",-default=>"$cttpos->{txt04}",-size=>"30",-maxlength=>50)),"\n";
print $q->td({-class=>'content1_cms'}, "$cttpos->{int09} ($cttpos->{txt04})"),"\n";
}
#pos end station
elsif($key eq "int04" && "$size" eq "select" && $node_meta->{tpl_id} == 221){
my @_valxx = ("");
foreach my $rid (sort { $station_all->{$a}->{int04} <=> $station_all->{$b}->{int04} } keys (%$station_all)){
push (@_valxx, "$station_all->{$rid}->{int04}:$station_all->{$rid}->{int04} - $station_all->{$rid}->{txt01}");
}
print $q->Tr();
print $q->td({-class=>'left_italic_cms',-colspan=>'1'},"$des");
print $q->td({-class=>'content1_cms',-colspan=>'1'},"$prefix",$but->selector_class("$key","eselect2","width:250px;",$cttpos->{int04},@_valxx));
#Endstation
}elsif($key eq "int04"){
}
elsif($key eq "int04"){
print $q->Tr(),"\n";
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
print $q->td({-class=>'content1_cms'}, "$prefix", $q->textfield(-class=>'etxt2',-name=>"int04",-default=>"$cttpos->{int04}",-size=>"15",-maxlength=>40)),"\n";
@ -632,6 +651,18 @@ EOF
print $q->td({-class=>'content1_cms', -colspan=>'1'}, $but->checkbox("1","$key","$ctrel->{$key}"), $postdes),"\n";
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
}
#bike station
elsif($key eq "int04" && "$size" eq "select" && $node_meta->{tpl_id} == 205){
my @_valxx = ("");
foreach my $rid (sort { $station_all->{$a}->{int04} <=> $station_all->{$b}->{int04} } keys (%$station_all)){
push (@_valxx, "$station_all->{$rid}->{int04}:$station_all->{$rid}->{int04} - $station_all->{$rid}->{txt01}");
}
my $oprefix = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}";
print $q->Tr();
print $q->td({-class=>'left_italic_cms',-colspan=>'1'},"$des");
print $q->td({-class=>'content1_cms',-colspan=>'1'},"$oprefix",$but->selector_class("$key","eselect","width:250px;",$ctrel->{int04},@_valxx));
}
elsif($key eq "int04"){
my $oprefix = "";
$oprefix = "$dbt->{operator}->{$varenv{dbname}}->{oprefix}" if($node_meta->{tpl_id} == 225 || $node_meta->{tpl_id} == 205);
@ -710,41 +741,12 @@ EOF
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector_class("$key","eselect","",$ctrel->{$key},@_lock_valxx));
}
#elsif($key =~ /int/ && "$size" eq "select"){
# my @_valxx;
# my $selsize="50px";
# @_valxx = split(/\|/,$varenv{$seldes});
# $ctrel->{$key} =~ s/\.00//;
# print $q->Tr();
# print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
# print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
#}
elsif($key =~ /int/){
$ctrel->{$key} = "75" if($key eq "int06" && !$ctrel->{$key} && $node_meta->{tpl_id} == 225);
print $q->Tr();
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
print $q->td({-class=>'content1_cms',-colspan=>2},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$ctrel->{$key}"), $postdes),"\n";
}
elsif($key =~ /txt/ && "$size" eq "select" && "$des" =~ /Status|PiQuest|Zahlungsweise/){
my @_valxx;
my $selsize="150px";
@_valxx = split(/\|/,$varenv{$seldes}) if($varenv{$seldes});
print $q->Tr();
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
if($des eq "PiQuest"){
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize","",@_valxx)," $ctrel->{$key}");
}else{
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
}
}
elsif($key =~ /txt/ && "$size" eq "select" && "$des" =~ /System|Ziel Datei/){
my @_valxx;
my $selsize="150px";
@_valxx = split(/\|/,$varenv{$seldes}) if($varenv{$seldes});
print $q->Tr();
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
}
elsif($key =~ /txt/ && "$size" eq "select" && "$des" =~ /Land/){
my @_valxx;
my $selsize="150px";

View file

@ -338,9 +338,11 @@ sub tpl(){
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);
my $opos = "";
my $id = $cttpos->{$pid}->{ct_id};
if($ct4rel->{$id}->{c_id} == $cttpos->{$pid}->{ct_id}){
$ct_name = $ct4rel->{$id}->{ct_name};
$opos = "<span style='color:red;'>&bull;</span>" if($ct4rel->{$id}->{int14});
$ct_txt00 = $ct4rel->{$id}->{txt00};
$ct_txt01 = $ct4rel->{$id}->{txt01};
$ct_phone = $ct4rel->{$id}->{txt07};
@ -484,7 +486,7 @@ sub tpl(){
}
if($users_dms_primary->{u_id} && $users_dms->{u_id} && $users_dms->{int03} >= 1){
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;'}, "&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"},"$opos \#$ct_name")),"\n" if($c_id4trans && $tpl_id4trans);
print $q->div({-style=>'float:left;margin-left:1em;'}, "$user_device"),"\n";
}

View file

@ -957,7 +957,9 @@ EOF
}
elsif($key eq "ct_name" && $ct4rel->{$id}->{$key}){
if($table =~ /contenttrans|contenttver/){
print $q->td({-class=>'tdint',-style=>"font-weight:normal;$set_style4nr"},$q->a({-class=>"linknav3",-href=>"?ct_trans=open\&mode=manager\&c_id4trans=$ct4rel->{$id}->{c_id}\&tpl_id4trans=$ct4rel->{$id}->{template_id}\&kind_of_trans=$node_meta->{node_name}\&owner=$users_dms->{u_id}\&offset=$searchref->{offset}\&limit=$searchref->{limit}",-title=>"Terminal öffnen"},"$ct4rel->{$id}->{$key}"));
my $opos = "";
$opos = "<span style='color:red'>&bull;</span>" if($ct4rel->{$id}->{int14});
print $q->td({-class=>'tdint',-style=>"font-weight:normal;$set_style4nr", -nowrap=>1},$q->a({-class=>"linknav3",-href=>"?ct_trans=open\&mode=manager\&c_id4trans=$ct4rel->{$id}->{c_id}\&tpl_id4trans=$ct4rel->{$id}->{template_id}\&kind_of_trans=$node_meta->{node_name}\&owner=$users_dms->{u_id}\&offset=$searchref->{offset}\&limit=$searchref->{limit}",-title=>"Terminal öffnen"},"$opos $ct4rel->{$id}->{$key}"));
}elsif($table =~ /content$|contentadr|contentnel/){
print $q->td({-class=>"tdint",-style=>"font-weight:normal;$set_style4nr"},$q->a({-class=>"linknav3",-href=>"?node2edit=editpart\&mode=manager\&rel_id=$ct4rel->{$id}->{rel_id}\&offset=$searchref->{offset}\&limit=$searchref->{limit}",-title=>"Terminal öffnen"},"$ct4rel->{$id}->{$key}")),"\n";
}elsif(($node_meta->{tpl_order} !~ /barcode/) || ("$ct4rel->{$id}->{$key}" ne "$ct4rel->{$id}->{barcode}")){

View file

@ -107,6 +107,27 @@ if($todo eq "send_occupied2hotline"){
$sendmail = send_occupied2hotline($sendref);
}
#send_invoice_onwork once a week as reminder
if($todo eq "send_invoice_onwork"){
#loop operators DB
while (my ($key, $op_name) = each %{ $dbt->{operator} }) {
if($op_name->{database}->{dbname}){
my $rows = 0;
my $sharee_operator = $op_name->{database}->{dbname};
my $dbh = "";
$dbh = $dbt->dbconnect_extern($sharee_operator);
$oprefix = $op_name->{oprefix} || "";
$sendref->{syshost} = "$syshost";
$sendmail = send_invoice_onwork($dbh,$oprefix,$sendref);
if($sendmail->{c_id}){
sendmailjob($sendmail);
}
}
}
}
if($sendmail->{c_id}){
sendmailjob($sendmail);
}else{
@ -341,6 +362,7 @@ $sendref->{message} = <<EOF
Hallo,
folgende konräder sind seit über 3 Tagen gemietet:
$bike
Bitte MieterInnen kontaktieren und den verbleib klären.
@ -355,6 +377,68 @@ EOF
return;
}
#send_invoice_onwork, done by operaor loop
sub send_invoice_onwork {
my $dbh = shift;
my $oprefix = shift || "";
my $sendref = shift;
my $ct_id = shift || "";
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname},"iso-8859-1");
my $pref_ctu = {
table => "contentuser",
fetch => "one",
c_id => "1",#primary hotline
};
my $uadr = { c_id => 0 };
$uadr = $dbt->fetch_tablerecord($dbh_primary,$pref_ctu);
$sendref->{mail_to} = $uadr->{txt08};
my $pref = {
table => "contenttrans",
fetch => "all",
keyfield => "c_id",
txt22 => "in Arbeit",
state => "is::null",
};
my $ctt = $dbt->fetch_tablerecord($dbh,$pref);
my $ct_onwork = "";
foreach my $id (sort { $ctt->{$b}->{c_id} <=> $ctt->{$a}->{c_id} } keys(%$ctt)){
$ct_onwork .= $oprefix . " Faktura ID:$ctt->{$id}->{c_id}, " . " Nummer: " . $ctt->{$id}->{ct_name} . "\n";
$sendref->{c_id} = $ctt->{$id}->{c_id};#just one
print "$ctt->{$id}->{c_id}: $ct_onwork $sendref->{c_id}";
}
if($ct_onwork){
$ct_onwork =~ s/,$//;
$sendref->{subject} = "$oprefix wöchentliche Faktura in Arbeit Übersicht";
$sendref->{message} = <<EOF
Hallo,
folgende ungebuchte Rechnungen sind "in Arbeit":
$ct_onwork
Nicht aus dem Blick verlieren.
Grüße vom cron
EOF
;
$sendref->{message} =~ s/\n/\<br \/\>/g;
return $sendref;
}
return;
}#end send_invoice_onwork
#prepare email by cms markup
sub prepare_content {
my $sendref = shift;

View file

@ -189,7 +189,6 @@ print "Neue NutzerInnen mit Bonus Tarif: $swk_reg\n";
table => "contenttranspos",
fetch => "all",
keyfield => "c_id",
#int04 => "!=::99",#virtual end-station
int05 => "is::null",#not if sub workflow doc
int06 => "!=::99",#virtual start-station
int29 => "$bike_type_id",#nodes.type_id
@ -213,11 +212,7 @@ print "Neue NutzerInnen mit Bonus Tarif: $swk_reg\n";
$swk_i++;
}
if($pos->{$id}->{int06} && exists($start_station->{$pos->{$id}->{int06}})){
$start_station->{$pos->{$id}->{int06}} += 1;
}elsif($pos->{$id}->{int04} && exists($start_station->{$pos->{$id}->{int04}})){
$start_station->{$pos->{$id}->{int04}} += 1;
}
$start_station->{$pos->{$id}->{int06}} += 1 if($pos->{$id}->{int06} && exists($start_station->{$pos->{$id}->{int06}}));
$end_station->{$pos->{$id}->{int04}} += 1 if($pos->{$id}->{int04} && exists($start_station->{$pos->{$id}->{int04}}));
$diff_station += 1 if($pos->{$id}->{int06} && $pos->{$id}->{int04} && $pos->{$id}->{int06} != $pos->{$id}->{int04});

View file

@ -150,7 +150,7 @@ sub tpl(){
# print $q->div({-style=>'margin-top:1em;'},"<div type='text' onClick='javascript:request_apiauth(\"$varenv->{wwwhost}\",\"/$varenv->{mandant}/$varenv->{profile}\")' name='login_sharee' value='Login' class='btn btn-primary btn-lg btn-block'>Anmelden</div>"),"\n";
print $q->div({-style=>'margin-top:1em;text-align:center;'},"<button type='submit' name='login_sharee' value='Login' class='btn btn-primary btn-lg btn-block' style='border:1px solid #$bgcolor1;background-color:#$bgcolor1;'>$varenv->{cms}->{'iframe-login'}->{txt}</button>"),"\n";
print $q->div({-style=>'margin-top:1em;text-align:center;'},$q->a({-class=>"btn btn-default btn-lg btn-block", -style=>"background-color:#ffffff;color:#$bgcolor1;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account/$varenv->{accounting_1}"}, "$varenv->{cms}->{'iframe-request-pw'}->{txt}")),"\n";
print $q->div({-style=>'margin-top:1em;text-align:center;'},$q->a({-class=>"btn btn-default btn-lg btn-block", -style=>"background-color:#ffffff;color:#$bgcolor1;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account/$varenv->{accounting_1}"}, "$varenv->{cms}->{'iframe-new-account'}->{txt}")),"\n";
print $q->div({-style=>'margin-top:1em;text-align:center;'},$q->a({-class=>"", -style=>"background-color:#ffffff;color:#$bgcolor1;font-size:1.1em;text-decoration:underline;", -role=>"button", -href=>"$varenv->{wwwhost}/$varenv->{mandant}/Account"}, "$varenv->{cms}->{'iframe-request-pw'}->{txt}")),"\n";