mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
prepaid account coding. Some minor fixes.
This commit is contained in:
parent
b6100696a5
commit
01a9f06617
17 changed files with 296 additions and 121 deletions
|
@ -921,8 +921,8 @@ sub booking_request(){
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
main_id => 300008,
|
main_id => 300008,
|
||||||
template_id => 218,
|
template_id => 218,
|
||||||
#ca_id => "$auth->{c_id}",#future change
|
ca_id => "$auth->{c_id}",
|
||||||
int10 => "$auth->{c_id}",
|
#int10 => "$auth->{c_id}",#deprecated
|
||||||
state => "null",
|
state => "null",
|
||||||
close_time => "is::null",
|
close_time => "is::null",
|
||||||
};
|
};
|
||||||
|
@ -1482,10 +1482,15 @@ sub booking_update(){
|
||||||
int23 => $user_miniquest_count,
|
int23 => $user_miniquest_count,
|
||||||
atime => "now()",
|
atime => "now()",
|
||||||
};
|
};
|
||||||
$rows = $dbt->update_record($dbh,$update23,$auth_prim) if($dbt->{copri_conf}->{contributors} && $auth_prim->{c_id} !~ /$dbt->{copri_conf}->{contributors}/);
|
$rows = $dbt->update_record($dbh,$update23,$auth_prim) if($auth_prim->{c_id} && !$dbt->{copri_conf}->{betau_id}->{$auth_prim->{c_id}});
|
||||||
}
|
}
|
||||||
}#end mini_quest
|
}#end mini_quest
|
||||||
|
|
||||||
|
#reponse-log
|
||||||
|
if($booking_values->{response_text}){
|
||||||
|
my $response_log = $booking->{txt29} . "\n- $log_stamp $booking_values->{response_text}";
|
||||||
|
$dbt->update_one($dbh,$booking_pos,"txt29='$response_log'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ($rows,$booking_values);
|
return ($rows,$booking_values);
|
||||||
|
@ -3174,7 +3179,7 @@ sub authcookie_manager {
|
||||||
}
|
}
|
||||||
$registered_cookies =~ s/\|$//;
|
$registered_cookies =~ s/\|$//;
|
||||||
|
|
||||||
#$bw->log("generated authcookie",$authcookie,"");
|
$bw->log("generated authcookie",$authcookie,"");
|
||||||
|
|
||||||
#return still existing authcookie
|
#return still existing authcookie
|
||||||
if($registered_cookies && $registered_cookies =~ /$authcookie/){
|
if($registered_cookies && $registered_cookies =~ /$authcookie/){
|
||||||
|
|
|
@ -68,7 +68,7 @@ my $response = {
|
||||||
apiserver => "$apiserver",
|
apiserver => "$apiserver",
|
||||||
response => "$respreq",
|
response => "$respreq",
|
||||||
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
||||||
copri_version => "4.1.23.17",
|
copri_version => "4.1.23.18",
|
||||||
user_id => "",
|
user_id => "",
|
||||||
authcookie => "",
|
authcookie => "",
|
||||||
new_authcoo => "0",
|
new_authcoo => "0",
|
||||||
|
@ -123,6 +123,7 @@ if(!$coo && !$q->param('merchant_id')){
|
||||||
$response->{bike_info_html} = "$dbt->{project_conf}->{Freiburg}->{bike_info_html}";
|
$response->{bike_info_html} = "$dbt->{project_conf}->{Freiburg}->{bike_info_html}";
|
||||||
if($lang ne "de"){
|
if($lang ne "de"){
|
||||||
$response->{tariff_info_html} =~ s/\.html/_en\.html/;
|
$response->{tariff_info_html} =~ s/\.html/_en\.html/;
|
||||||
|
$response->{bike_info_html} =~ s/\.html/_en\.html/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($return_merchant->{project_id} eq "Konstanz"){
|
elsif($return_merchant->{project_id} eq "Konstanz"){
|
||||||
|
|
|
@ -133,7 +133,7 @@ sub isuser_rentable {
|
||||||
my $varenv = shift;
|
my $varenv = shift;
|
||||||
|
|
||||||
my $rentable_check=0;
|
my $rentable_check=0;
|
||||||
if($auth->{int03} && $auth->{ct_name} && ($auth->{int03} == 1 && $auth->{ct_name} =~ /\w{2}-\d+/) || ($auth->{int03} == 2 && length($auth->{ct_name}) >= 19) || ($auth->{int03} == 3 && $auth->{ct_name} =~ /Prepaid-\d+/i)){
|
if($auth->{int03} && $auth->{ct_name} && ($auth->{int03} == 1 && $auth->{ct_name} =~ /\w{2}-\d+/) || ($auth->{int03} == 2 && length($auth->{ct_name}) >= 19) || ($auth->{int03} == 3 && $auth->{ct_name} =~ /Prepay-\d+/i)){
|
||||||
$rentable_check=1;
|
$rentable_check=1;
|
||||||
if($auth->{txt08} && $auth->{int04} == 1 && $auth->{int13} == 1 && !$auth->{int12} && $auth->{int14}){
|
if($auth->{txt08} && $auth->{int04} == 1 && $auth->{int13} == 1 && !$auth->{int12} && $auth->{int14}){
|
||||||
$rentable_check=2;#if 2 then everything should be alright. rental is enabled
|
$rentable_check=2;#if 2 then everything should be alright. rental is enabled
|
||||||
|
|
|
@ -243,9 +243,9 @@ sub selector(){
|
||||||
|
|
||||||
my @selopt = ();
|
my @selopt = ();
|
||||||
foreach my $opt (@selval){
|
foreach my $opt (@selval){
|
||||||
my $id = $opt;
|
my $id = $opt || "";
|
||||||
my $value = $opt;
|
my $value = $opt || "";
|
||||||
($id,$value) = split /:/,$opt if($opt =~ /\w+\:.*/);
|
($id,$value) = split /:/,$opt if($opt && $opt =~ /\w+\:.*/);
|
||||||
if($sel eq $id){
|
if($sel eq $id){
|
||||||
push @selopt, "<option selected value=\"$id\">$value</option>\n";
|
push @selopt, "<option selected value=\"$id\">$value</option>\n";
|
||||||
}else{
|
}else{
|
||||||
|
@ -259,14 +259,18 @@ sub selector(){
|
||||||
# select tag with class
|
# select tag with class
|
||||||
sub selector_class(){
|
sub selector_class(){
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($column,$class,$style,$sel,@selval) = @_;
|
my $column = shift;
|
||||||
|
my $class = shift || "";
|
||||||
|
my $style = shift || "";
|
||||||
|
my $sel = shift || "";
|
||||||
|
my @selval = @_;
|
||||||
|
|
||||||
my @selopt = ();
|
my @selopt = ();
|
||||||
foreach my $opt (@selval){
|
foreach my $opt (@selval){
|
||||||
my $des_style = "";
|
my $des_style = "";
|
||||||
my $id = $opt;
|
my $id = $opt || "";
|
||||||
my $value = $opt;
|
my $value = $opt || "";
|
||||||
($id,$value) = split /:/,$opt if($opt =~ /\:/);
|
($id,$value) = split /:/,$opt if($opt && $opt =~ /\:/);
|
||||||
$des_style = "color:grey;" if(!$id);
|
$des_style = "color:grey;" if(!$id);
|
||||||
if($sel eq $id){
|
if($sel eq $id){
|
||||||
push @selopt, "<option style='$des_style' selected value='$id'>$value</option>\n";
|
push @selopt, "<option style='$des_style' selected value='$id'>$value</option>\n";
|
||||||
|
|
|
@ -705,7 +705,11 @@ sub collect_post(){
|
||||||
$cp_where .= " and cp.$key $op $value";
|
$cp_where .= " and cp.$key $op $value";
|
||||||
}
|
}
|
||||||
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
}elsif($key =~ /^(c_id|ca_id|ct_id|owner|barcode|int\d+)$/ && $value){
|
||||||
|
if($value eq "null"){
|
||||||
|
$cp_where .= " and (cp.$key is null OR cp.$key = 0)";
|
||||||
|
}else{
|
||||||
$cp_where .= " and cp.$key $op $value";
|
$cp_where .= " and cp.$key $op $value";
|
||||||
|
}
|
||||||
}elsif($fetch->{catch} && $key eq "template_id" && $value){
|
}elsif($fetch->{catch} && $key eq "template_id" && $value){
|
||||||
$cp_where .= " and cp.$key $op $value";
|
$cp_where .= " and cp.$key $op $value";
|
||||||
#}elsif(!$fetch->{catch} && $key =~ /main_id|template_id/ && $value){
|
#}elsif(!$fetch->{catch} && $key =~ /main_id|template_id/ && $value){
|
||||||
|
@ -831,9 +835,9 @@ sub fetch_record(){
|
||||||
|
|
||||||
#ct.* because of nd.txt01 and ct.txt01 .
|
#ct.* because of nd.txt01 and ct.txt01 .
|
||||||
my $sql = "SELECT ct.*,rel.*,nd.node_name,nd.parent_id,nd.type_id,nd.energy_id FROM $fetch->{table} ct, relation rel, nodes nd $where $order";
|
my $sql = "SELECT ct.*,rel.*,nd.node_name,nd.parent_id,nd.type_id,nd.energy_id FROM $fetch->{table} ct, relation rel, nodes nd $where $order";
|
||||||
|
#$bw->log("DBtank fetch_record : ",$sql,"") if($debug);
|
||||||
my $sth = $dbh->prepare($sql);
|
my $sth = $dbh->prepare($sql);
|
||||||
my $rc = $sth->execute();
|
my $rc = $sth->execute();
|
||||||
#$bw->log("DBtank fetch_record : $rc",$sql,"") if($debug);
|
|
||||||
|
|
||||||
my $record = { c_id => 0 };
|
my $record = { c_id => 0 };
|
||||||
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
||||||
|
@ -1021,7 +1025,7 @@ sub update_record(){
|
||||||
}
|
}
|
||||||
if($key =~ /^(barcode|contentadr_id|int\d+|time\d+|owner|owner_end|start_at\d+|end_at\d+)$/){
|
if($key =~ /^(barcode|contentadr_id|int\d+|time\d+|owner|owner_end|start_at\d+|end_at\d+)$/){
|
||||||
$value =~ s/,/\./ if($value);
|
$value =~ s/,/\./ if($value);
|
||||||
if($key =~ /int\d+|time\d+|start_at\d+|end_at\d+/ && $value && $value =~ /\d+:\d+/){#azn time format
|
if($key =~ /time\d+|start_at\d+|end_at\d+/ && $value && $value =~ /\d+:\d+/){#azn time format
|
||||||
$set .= " $key='$value',";
|
$set .= " $key='$value',";
|
||||||
}elsif(looks_like_number($value) || ($value && $value eq "null")){
|
}elsif(looks_like_number($value) || ($value && $value eq "null")){
|
||||||
$set .= " $key=$value,";
|
$set .= " $key=$value,";
|
||||||
|
@ -1045,7 +1049,7 @@ sub update_record(){
|
||||||
my $sql = "UPDATE $update->{table} set $set $where";
|
my $sql = "UPDATE $update->{table} set $set $where";
|
||||||
my $sth = $dbh->prepare($sql);
|
my $sth = $dbh->prepare($sql);
|
||||||
$rows = $sth->execute();
|
$rows = $sth->execute();
|
||||||
#$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
|
$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
}#update_record
|
}#update_record
|
||||||
|
@ -1565,7 +1569,7 @@ sub insert_pos(){
|
||||||
if($ct->{template_id} && $ct->{template_id} == 205){#Leihrad_list
|
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,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");
|
$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{
|
}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");
|
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int01,int02,int03,txt01,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}','0','$from_main_id','$fibumark','$from_template_id','$owner') RETURNING c_id");
|
||||||
}
|
}
|
||||||
my $rows = $sth->execute();
|
my $rows = $sth->execute();
|
||||||
my $last_id;
|
my $last_id;
|
||||||
|
@ -1594,8 +1598,12 @@ sub insert_contenttrans(){
|
||||||
my $invoice_nr = shift || "----";
|
my $invoice_nr = shift || "----";
|
||||||
my $owner = shift || 0;
|
my $owner = shift || 0;
|
||||||
|
|
||||||
|
my $doc_name = "Rechnung";
|
||||||
|
$doc_name = "Prepaid Account" if($tpl_id == 219);
|
||||||
$owner="199" if(!$owner);
|
$owner="199" if(!$owner);
|
||||||
my $sth = $dbh->prepare("INSERT INTO contenttrans (ct_name,txt00,int10,txt02,txt01,txt03,txt06,txt07,txt08,txt10,txt11,owner,itime) VALUES('$invoice_nr','Rechnung','$ctadr->{c_id}','$ctadr->{txt02}','$ctadr->{txt01}','$ctadr->{txt03}','$ctadr->{txt06}','$ctadr->{txt07}','$ctadr->{txt08}','$ctadr->{txt10}','$ctadr->{txt11}','$owner','now()') RETURNING c_id");
|
#int10 will be substituted by ca_id.
|
||||||
|
#keep in mind int10 will be mainly used by Prelogic and Printpreview, thats because we save it also
|
||||||
|
my $sth = $dbh->prepare("INSERT INTO contenttrans (ct_name,txt00,ca_id,int10,txt02,txt01,txt03,txt06,txt07,txt08,txt10,txt11,owner,itime) VALUES('$invoice_nr','$doc_name','$ctadr->{c_id}','$ctadr->{c_id}','$ctadr->{txt02}','$ctadr->{txt01}','$ctadr->{txt03}','$ctadr->{txt06}','$ctadr->{txt07}','$ctadr->{txt08}','$ctadr->{txt10}','$ctadr->{txt11}','$owner','now()') RETURNING c_id");
|
||||||
|
|
||||||
my $rows = $sth->execute();
|
my $rows = $sth->execute();
|
||||||
my $last_id;
|
my $last_id;
|
||||||
|
|
|
@ -435,14 +435,21 @@ sub handler {
|
||||||
#print redirect("mailto:$sendref->{mail_to}?subject=$sendref->{subject}\&body=$sendref->{message}");
|
#print redirect("mailto:$sendref->{mail_to}?subject=$sendref->{subject}\&body=$sendref->{message}");
|
||||||
#exit 0;
|
#exit 0;
|
||||||
|
|
||||||
}elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
|
}
|
||||||
|
elsif($R::detail_search && $R::detail_search eq "operator_accounting"){
|
||||||
my $ck4ex = "@R::ck4ex" || "";
|
my $ck4ex = "@R::ck4ex" || "";
|
||||||
$return = $pl->operator_accounting($q,$users_dms,$users_sharee,$R::accounting_type,$ck4ex);
|
$return = $pl->operator_accounting($q,$users_dms,$users_sharee,$R::accounting_type,$ck4ex);
|
||||||
}elsif($R::ct_trans || $R::set_state || $R::v_abschluss || $R::trans2edit){
|
}
|
||||||
#should do all else invoice text save , without positions and booking payment
|
#on prepaid account
|
||||||
|
elsif($R::ct_trans eq "save_pos" && $R::tpl_id4trans == 219 && $R::c_idpos){
|
||||||
|
$feedb = $pl->save_contenttranspos($q,$R::c_idpos,$users_dms->{u_id});
|
||||||
|
}
|
||||||
|
#should do all else invoice text save , without positions and booking payment
|
||||||
|
elsif($R::ct_trans || $R::set_state || $R::v_abschluss || $R::trans2edit){
|
||||||
if($R::ct_trans !~ /_pos|open/ && looks_like_number($R::c_id4trans) && !$R::v_abschluss && !$R::trans2edit){
|
if($R::ct_trans !~ /_pos|open/ && looks_like_number($R::c_id4trans) && !$R::v_abschluss && !$R::trans2edit){
|
||||||
$feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans);
|
$feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans);
|
||||||
}
|
}
|
||||||
|
#in future the prelogic modul should be disabled at all
|
||||||
$return .= "|";
|
$return .= "|";
|
||||||
$return .= $pre->preinit($q,$node_meta,$users_dms);
|
$return .= $pre->preinit($q,$node_meta,$users_dms);
|
||||||
}
|
}
|
||||||
|
@ -728,19 +735,21 @@ sub handler {
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?failure=$users_sharee->{txt31}$session_and#top");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?failure=$users_sharee->{txt31}$session_and#top");
|
||||||
exit 0;
|
exit 0;
|
||||||
}elsif(!$payable_check){
|
}elsif(!$payable_check){
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}$session");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}?cum=3$session_and\&$returnwww");
|
||||||
exit 0;
|
exit 0;
|
||||||
}else{
|
}else{
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=3$session_and\&$returnwww");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=3$session_and\&$returnwww");
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}elsif($users_sharee->{c_id} && ($path =~ /$varenv{mandant}\/Anmelden|$varenv{mandant}\/$varenv{profile}/)){
|
}
|
||||||
|
#disabled
|
||||||
|
elsif(1==2 && $users_sharee->{c_id} && ($path =~ /$varenv{mandant}\/Anmelden|$varenv{mandant}\/$varenv{profile}/)){
|
||||||
if(!$users_sharee->{int14}){
|
if(!$users_sharee->{int14}){
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?cum=4$session_and\&$returnwww");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?cum=4$session_and\&$returnwww");
|
||||||
exit 0;
|
exit 0;
|
||||||
}elsif(!$payable_check){
|
}elsif(!$payable_check){
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}$session");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1_5}?cum=4$session_and\&$returnwww");
|
||||||
exit 0;
|
exit 0;
|
||||||
}else{
|
}else{
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=4$session_and\&$returnwww");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=4$session_and\&$returnwww");
|
||||||
|
|
|
@ -49,6 +49,74 @@ my %varenv = $cf->envonline();
|
||||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||||
my $debug=1;
|
my $debug=1;
|
||||||
|
|
||||||
|
#payment-type prepaid request
|
||||||
|
sub prepaid_request {
|
||||||
|
my $self = shift;
|
||||||
|
my $dbh = shift;
|
||||||
|
my $ctadr = shift;
|
||||||
|
my $owner = shift;
|
||||||
|
|
||||||
|
my $feedb = {
|
||||||
|
u_rows => 0,
|
||||||
|
prepaid_account => "",
|
||||||
|
prepaid_id => 0,
|
||||||
|
message => "",
|
||||||
|
};
|
||||||
|
|
||||||
|
my $pref_ctt = {
|
||||||
|
table => "contenttrans",
|
||||||
|
fetch => "one",
|
||||||
|
main_id => 300023,
|
||||||
|
template_id => 219,#prepaid tpl
|
||||||
|
ca_id => "$ctadr->{c_id}",
|
||||||
|
state => "is::null",
|
||||||
|
close_time => "is::null",
|
||||||
|
};
|
||||||
|
my $ctt_prepaid = { c_id => 0 };
|
||||||
|
$ctt_prepaid = $dbt->fetch_record($dbh,$pref_ctt);
|
||||||
|
if(!$ctt_prepaid->{c_id}){
|
||||||
|
my $ct_id = $dbt->insert_contenttrans($dbh,$ctadr,"300023","219","----","$owner");
|
||||||
|
$pref_ctt->{c_id} = $ct_id;
|
||||||
|
$ctt_prepaid = $dbt->fetch_record($dbh,$pref_ctt) if($pref_ctt->{c_id});
|
||||||
|
}
|
||||||
|
|
||||||
|
my $pos_id = 0;
|
||||||
|
my $cttpos = { c_id => 0 };
|
||||||
|
if($ctt_prepaid->{c_id} > 0){
|
||||||
|
|
||||||
|
my $posref = {
|
||||||
|
table => "contenttrans",
|
||||||
|
table_pos => "contenttranspos",
|
||||||
|
fetch => "one",
|
||||||
|
keyfield => "c_id",
|
||||||
|
ca_id => "$ctadr->{c_id}",
|
||||||
|
int02 => "is::null",#0
|
||||||
|
};
|
||||||
|
$cttpos = $dbt->collect_post($dbh,$posref);
|
||||||
|
|
||||||
|
if(!$cttpos->{c_id}){
|
||||||
|
#pseudo part. not available in content
|
||||||
|
my $ct = {
|
||||||
|
c_id => 0,
|
||||||
|
barcode => 0,
|
||||||
|
ca_id => $ctadr->{c_id},
|
||||||
|
ct_id => $ctt_prepaid->{c_id},
|
||||||
|
int02 => 0,#prepaid price on request is 0
|
||||||
|
txt01 => 'Prepaid Position',
|
||||||
|
int16 => 3,#fibumark for prepaid
|
||||||
|
template_id => 219,
|
||||||
|
};
|
||||||
|
|
||||||
|
$cttpos->{c_id} = $dbt->insert_pos($dbh,$ctt_prepaid->{c_id},$ct,"",$ctadr,"","","","0",$owner,"");
|
||||||
|
$dbt->update_one($dbh,{table => 'contenttranspos',c_id => $cttpos->{c_id}},"barcode = $cttpos->{c_id},ct_name = '$cttpos->{c_id}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$feedb->{prepaid_account} = $ctt_prepaid->{c_id};
|
||||||
|
$feedb->{prepaid_id} = $cttpos->{c_id};
|
||||||
|
return $feedb;
|
||||||
|
}
|
||||||
|
|
||||||
#select rentals for messaging user if bike > 12h ... occupied
|
#select rentals for messaging user if bike > 12h ... occupied
|
||||||
sub longterm_occupied {
|
sub longterm_occupied {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -605,7 +673,7 @@ sub save_contenttranspos {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
table_pos => "contenttranspos",
|
table_pos => "contenttranspos",
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
template_id => "218",#Mietjournal tpl_id
|
template_id => "218",#open invoice tpl_id
|
||||||
c_id => $c_id,
|
c_id => $c_id,
|
||||||
"ct.state" => "is::null",
|
"ct.state" => "is::null",
|
||||||
};
|
};
|
||||||
|
@ -673,7 +741,7 @@ sub save_contenttranspos {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
table_pos => "contenttranspos",
|
table_pos => "contenttranspos",
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
template_id => "218",#Mietjournal tpl_id
|
template_id => "218",#open invoice tpl_id
|
||||||
start_time => ">::$end_time",
|
start_time => ">::$end_time",
|
||||||
barcode => $ctpos->{barcode},
|
barcode => $ctpos->{barcode},
|
||||||
"ct.state" => "is::null",
|
"ct.state" => "is::null",
|
||||||
|
@ -737,7 +805,7 @@ sub save_contenttranspos {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
table_pos => "contenttranspos",
|
table_pos => "contenttranspos",
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
template_id => "218",#Mietjournal tpl_id
|
template_id => "IN::(218,219)",#open invoices and prepaid tpl_id
|
||||||
c_id => $c_id,
|
c_id => $c_id,
|
||||||
"ct.state" => "is::null",
|
"ct.state" => "is::null",
|
||||||
};
|
};
|
||||||
|
@ -756,11 +824,25 @@ sub save_contenttranspos {
|
||||||
};
|
};
|
||||||
if($ctpos->{c_id}){
|
if($ctpos->{c_id}){
|
||||||
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
|
$u_rows += $dbt->update_record($dbh,$update_pos,$ctpos);
|
||||||
|
#prepaid account Vde management by booking prepaid amount
|
||||||
|
if($R::tpl_id4trans && $R::tpl_id4trans == 219){
|
||||||
|
my $update_adr = {
|
||||||
|
table => "contentadr",
|
||||||
|
owner => $owner,
|
||||||
|
mtime => "now()",
|
||||||
|
c_id => $ctpos->{ca_id},
|
||||||
|
int12 => "0",
|
||||||
|
};
|
||||||
|
my $ctadr = { c_id => $ctpos->{ca_id} };
|
||||||
|
$u_rows += $dbt->update_record($dbh,$update_adr,$ctadr);#check int12=0 update
|
||||||
|
#$dbt->update_one($dbh,$update_adr,"int12=0");#Vde
|
||||||
|
$dbt->update_operatorsloop($varenv{dbname},$ctadr->{c_id},"update");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits gebucht";
|
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits gebucht";
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$feedb->{message} = "failure::Fehler, es sind nur numerische Werte erlaubt.";
|
$feedb->{message} = "failure::Fehler, es sind nur numerische Werte erlaubt ($c_id && $R::int02 && $R::int03).";
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$feedb->{message} = "failure::Fehler, fehlerhafte Eingaben oder Datensatz nicht gefunden!";
|
$feedb->{message} = "failure::Fehler, fehlerhafte Eingaben oder Datensatz nicht gefunden!";
|
||||||
|
|
|
@ -67,7 +67,7 @@ sub count_freedrental {
|
||||||
print FILE "--> pos.c_id:$pos->{c_id}, user:$pos->{ca_id}, bike:$pos->{ct_name} rental_minute_all: $pricing->{rentalog}->{rental_minute_all} > 0\n" if($debug);
|
print FILE "--> pos.c_id:$pos->{c_id}, user:$pos->{ca_id}, bike:$pos->{ct_name} rental_minute_all: $pricing->{rentalog}->{rental_minute_all} > 0\n" if($debug);
|
||||||
|
|
||||||
#freed mangement will be only dony on accountable rental
|
#freed mangement will be only dony on accountable rental
|
||||||
if($pricing->{rentalog}->{rental_minute_all} > 0){
|
if($pricing->{rentalog}->{rental_minute_all} > 0 && $ca_id == $pos->{ca_id}){
|
||||||
my $pref_pos = {
|
my $pref_pos = {
|
||||||
table => "contenttranspos",
|
table => "contenttranspos",
|
||||||
fetch => "all",
|
fetch => "all",
|
||||||
|
@ -88,6 +88,7 @@ sub count_freedrental {
|
||||||
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
my ($nyear,$nmon,$nday) = Add_Delta_YMD($year,$mon,$day, 0,0,1);
|
||||||
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
$pref_pos->{time_range} = "((start_time >= '$year-$mon-$day' and start_time < '$nyear-$nmon-$nday' and start_time != end_time) OR int10=3)";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $record_pos = { c_id => 0 };
|
my $record_pos = { c_id => 0 };
|
||||||
$record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
$record_pos = $dbt->fetch_tablerecord($dbh,$pref_pos);
|
||||||
foreach my $pid (sort { $record_pos->{$a}->{c_id} <=> $record_pos->{$b}->{c_id} } keys (%$record_pos)){
|
foreach my $pid (sort { $record_pos->{$a}->{c_id} <=> $record_pos->{$b}->{c_id} } keys (%$record_pos)){
|
||||||
|
|
|
@ -133,11 +133,15 @@ sub save_account(){
|
||||||
my $c_id = shift;
|
my $c_id = shift;
|
||||||
my $varmerch = shift || "";
|
my $varmerch = shift || "";
|
||||||
my $owner = shift || 0;
|
my $owner = shift || 0;
|
||||||
my $feedb = { message => "" };
|
|
||||||
my $table = "contentadr";
|
my $table = "contentadr";
|
||||||
$q->import_names('R');
|
$q->import_names('R');
|
||||||
my @keywords = $q->param;
|
my @keywords = $q->param;
|
||||||
|
|
||||||
|
my $feedb = {
|
||||||
|
u_rows => 0,
|
||||||
|
prepaid_id => 0,
|
||||||
|
message => "",
|
||||||
|
};
|
||||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||||
my %varenv = $cf->envonline();
|
my %varenv = $cf->envonline();
|
||||||
|
|
||||||
|
@ -163,9 +167,10 @@ sub save_account(){
|
||||||
template_id => "202",
|
template_id => "202",
|
||||||
c_id => "$c_id",
|
c_id => "$c_id",
|
||||||
};
|
};
|
||||||
my $ctadr = $dbt->fetch_record($dbh,$authref);
|
my $ctadr = { c_id => 0 };
|
||||||
|
$ctadr = $dbt->fetch_record($dbh,$authref) if($c_id > 0);
|
||||||
|
|
||||||
my $update_primary = {
|
my $update_adr = {
|
||||||
table => "contentadr",
|
table => "contentadr",
|
||||||
mtime => "now()",
|
mtime => "now()",
|
||||||
owner => "$owner",
|
owner => "$owner",
|
||||||
|
@ -208,7 +213,7 @@ sub save_account(){
|
||||||
}elsif(length($valxx) >= 8){
|
}elsif(length($valxx) >= 8){
|
||||||
my $pwmd5 = md5_hex($valxx) || "";
|
my $pwmd5 = md5_hex($valxx) || "";
|
||||||
my $pwsha256=sha256_base64($pwmd5) || "";
|
my $pwsha256=sha256_base64($pwmd5) || "";
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt04='$pwsha256'") if(length($pwsha256) > 20);
|
$update_adr->{txt04} = "$pwsha256" if(length($pwsha256) > 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#operators, only if saved by operator DMS
|
#operators, only if saved by operator DMS
|
||||||
|
@ -227,15 +232,15 @@ sub save_account(){
|
||||||
foreach my $keys (keys %txt17) {
|
foreach my $keys (keys %txt17) {
|
||||||
push(@operators,$keys);
|
push(@operators,$keys);
|
||||||
}
|
}
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt17='@operators'");
|
$update_adr->{txt17} = "@operators";
|
||||||
}
|
}
|
||||||
#Rabatt|payone cron-intervall|Ilockit-Admin|miniq
|
#Rabatt|payone cron-intervall|Ilockit-Admin|miniq
|
||||||
elsif($_ =~ /int07|int16|int19|int23/){
|
elsif($_ =~ /int07|int16|int19|int23/){
|
||||||
$u_rows = $dbt->update_one("",$update_primary,"$_=$valxx");
|
$update_adr->{$_} = $valxx;
|
||||||
}
|
}
|
||||||
#Text Sonstiges
|
#Text Sonstiges
|
||||||
elsif($_ =~ /txt29/){
|
elsif($_ =~ /txt29/){
|
||||||
$u_rows = $dbt->update_one("",$update_primary,"$_='$valxx'");
|
$update_adr->{$_} = "$valxx";
|
||||||
}
|
}
|
||||||
|
|
||||||
#txt15=Bonus- oder Freischalcode (falls vorhanden)=15
|
#txt15=Bonus- oder Freischalcode (falls vorhanden)=15
|
||||||
|
@ -326,7 +331,7 @@ sub save_account(){
|
||||||
push(@operators,$keys) if($keys =~/sharee_/);
|
push(@operators,$keys) if($keys =~/sharee_/);
|
||||||
}
|
}
|
||||||
print FILE "txt17 saving operators on primary: @operators\n" if($debug);
|
print FILE "txt17 saving operators on primary: @operators\n" if($debug);
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt17='@operators'");
|
$update_adr->{txt17} = "@operators";
|
||||||
|
|
||||||
#collect operator addr with existing tariff setting
|
#collect operator addr with existing tariff setting
|
||||||
my $ctadr_operator = $dbt->fetch_record($dbh_operator,$authref);
|
my $ctadr_operator = $dbt->fetch_record($dbh_operator,$authref);
|
||||||
|
@ -418,14 +423,14 @@ sub save_account(){
|
||||||
}else{
|
}else{
|
||||||
#smsAck reset
|
#smsAck reset
|
||||||
if($phone ne $ctadr->{txt07}){
|
if($phone ne $ctadr->{txt07}){
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int13=0");
|
$update_adr->{int13} = 0;
|
||||||
}
|
}
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$phone'");
|
$update_adr->{$_} = "$phone";
|
||||||
$email = $q->escapeHTML("$R::txt08");
|
$email = $q->escapeHTML("$R::txt08");
|
||||||
$email =~ s/\s//g;
|
$email =~ s/\s//g;
|
||||||
my $confirm_digest = sha1_base64($email . $phone);
|
my $confirm_digest = sha1_base64($email . $phone);
|
||||||
$confirm_digest =~ s/[I1LO0]//ig;
|
$confirm_digest =~ s/[I1LO0]//ig;
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt34='$confirm_digest'");
|
$update_adr->{txt34} = "$confirm_digest";
|
||||||
}
|
}
|
||||||
print FILE "confirm_digest input after substitution: $email . $phone\n" if($debug);
|
print FILE "confirm_digest input after substitution: $email . $phone\n" if($debug);
|
||||||
#user alias email
|
#user alias email
|
||||||
|
@ -450,37 +455,32 @@ sub save_account(){
|
||||||
}
|
}
|
||||||
#mailAck reset
|
#mailAck reset
|
||||||
if($valxx ne $ctadr->{txt08}){
|
if($valxx ne $ctadr->{txt08}){
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int04=0");
|
$update_adr->{int04} = 0;
|
||||||
}
|
}
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
|
$update_adr->{$_} = "$valxx";
|
||||||
}
|
}
|
||||||
}elsif($_ eq "int05"){#Web-login
|
}elsif($_ eq "int05"){#Web-login
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_=$valxx");
|
$update_adr->{$_} = $valxx;
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt05=null") if($valxx != 1);
|
$update_adr->{txt05} = "" if($valxx != 1);#delete also cookies
|
||||||
}elsif($_ eq "int12" && $varenv{dbname} ne $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
}elsif($_ eq "int12" && $varenv{dbname} ne $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||||
my $vde_on_fail = 0;
|
my $vde_on_fail = 0;
|
||||||
$vde_on_fail = 2 if($valxx && $valxx == 1);
|
$vde_on_fail = 2 if($valxx && $valxx == 1);
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_=$vde_on_fail");
|
$update_adr->{$_} = $vde_on_fail;
|
||||||
}elsif($_ =~ /^int|barcode/){
|
}elsif($_ =~ /^int|barcode/){
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_=$valxx");
|
$update_adr->{$_} = $valxx;
|
||||||
}elsif($_ eq "ct_name" && $R::base_edit){
|
}elsif($_ eq "ct_name" && $R::base_edit){
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
|
$update_adr->{$_} = "$valxx";
|
||||||
}elsif($_ =~ /txt22|txt23/){
|
}elsif($_ =~ /txt22|txt23/){
|
||||||
$valxx =~ s/\s//g;
|
$valxx =~ s/\s//g;
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
|
$update_adr->{$_} = "$valxx";
|
||||||
}elsif($_ !~ /ct_name|txt15/){
|
}elsif($_ !~ /ct_name|txt15/){
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
|
$update_adr->{$_} = "$valxx";
|
||||||
}
|
}
|
||||||
|
|
||||||
#Additionals after default updater
|
#Additionals after default updater
|
||||||
#on IBAN/BIC change set override Mandantsreferenz to c_id to trigger payone
|
#on IBAN/BIC change set override Mandantsreferenz to c_id to trigger payone
|
||||||
if(($_ eq "txt22" && $valxx ne $ctadr->{txt22}) || ($_ eq "txt23" && $valxx ne $ctadr->{txt23})){
|
if(($_ eq "txt22" && $valxx ne $ctadr->{txt22}) || ($_ eq "txt23" && $valxx ne $ctadr->{txt23})){
|
||||||
$u_rows += $dbt->update_one($dbh,$update_primary,"ct_name='$c_id'");
|
$update_adr->{ct_name} = "$c_id";
|
||||||
}
|
|
||||||
if($_ =~ /txt22/ && $valxx){
|
|
||||||
my $currency = "EUR";
|
|
||||||
#$currency = "CHF" if($valxx =~ /^(CH)/i);
|
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt24='$currency'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print FILE "-----> $_: $valxx\n" if($debug);
|
print FILE "-----> $_: $valxx\n" if($debug);
|
||||||
|
@ -512,11 +512,16 @@ sub save_account(){
|
||||||
print FILE "ret: $ret | ret_conflict: $ret_conflict\n" if($debug && ($ret || $ret_conflict));
|
print FILE "ret: $ret | ret_conflict: $ret_conflict\n" if($debug && ($ret || $ret_conflict));
|
||||||
}#end foreach keyword
|
}#end foreach keyword
|
||||||
|
|
||||||
|
$u_rows = 0;
|
||||||
|
#reread after update
|
||||||
|
if($ctadr->{c_id} > 0){
|
||||||
|
$u_rows = $dbt->update_record($dbh,$update_adr,$ctadr);
|
||||||
|
$ctadr = $dbt->fetch_record($dbh,$authref);
|
||||||
|
}
|
||||||
|
|
||||||
#payone only if SEPA Mandat checked
|
#payone only if SEPA Mandat checked
|
||||||
#Testbuchhung mit 1 € preauthorization and 0 € capture
|
#Testbuchhung mit 1 € preauthorization and 0 € capture
|
||||||
$ctadr = $dbt->fetch_record($dbh,$authref);
|
#print FILE "+++ $R::request && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id} \n" if($debug);
|
||||||
print FILE "+++ $R::request && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id} \n" if($debug);
|
|
||||||
|
|
||||||
#if($R::request eq "managemandate" && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id})
|
#if($R::request eq "managemandate" && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id})
|
||||||
#fraud workaround
|
#fraud workaround
|
||||||
my $iban = $ctadr->{txt22} || "";
|
my $iban = $ctadr->{txt22} || "";
|
||||||
|
@ -564,17 +569,21 @@ sub save_account(){
|
||||||
|
|
||||||
$ctt->{txt16} = "$payone_txid";
|
$ctt->{txt16} = "$payone_txid";
|
||||||
$vde_on_fail = 0 if($vde_on_fail != 2);
|
$vde_on_fail = 0 if($vde_on_fail != 2);
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int12=$vde_on_fail");#Vde
|
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||||
#$payone_txid = $payone->captureSEPA_main(\%varenv,$ctadr,$ctt,$owner);
|
#$payone_txid = $payone->captureSEPA_main(\%varenv,$ctadr,$ctt,$owner);
|
||||||
#int12=0 should be set after capture success in payment module
|
#int12=0 should be set after capture success in payment module
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int12=$vde_on_fail");#Vde
|
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int12=$vde_on_fail");#Vde
|
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||||
}
|
}
|
||||||
#$u_rows = $dbt->update_one($dbh,$update_primary,"int12=3");#Vde test fail
|
}
|
||||||
|
#prepaid
|
||||||
|
elsif($ctadr->{int03} == 3){
|
||||||
|
$feedb = $pl->prepaid_request($dbh,$ctadr,$owner);
|
||||||
|
$u_rows = $dbt->update_one($dbh,$update_adr,"ct_name='Prepay-$feedb->{prepaid_account}'");#Vde
|
||||||
}
|
}
|
||||||
|
|
||||||
if($R::txt04 && $R::confirm_txt04 && $R::txt04 ne $R::confirm_txt04){
|
if($R::txt04 && $R::confirm_txt04 && $R::txt04 ne $R::confirm_txt04){
|
||||||
|
@ -587,10 +596,10 @@ sub save_account(){
|
||||||
$rval =~ s/confirm_//g;#PW confirm
|
$rval =~ s/confirm_//g;#PW confirm
|
||||||
$rval =~ s/conflict_//g;#conflict
|
$rval =~ s/conflict_//g;#conflict
|
||||||
print FILE "ret: $ret | rval: $rval\n" if($debug);
|
print FILE "ret: $ret | rval: $rval\n" if($debug);
|
||||||
$dbt->update_one($dbh,$update_primary,"txt31='$rval'");
|
$dbt->update_one($dbh,$update_adr,"txt31='$rval'");
|
||||||
}elsif($fkeys =~ /$ctadr->{txt31}/){
|
}elsif($fkeys =~ /$ctadr->{txt31}/){
|
||||||
print FILE " No failure and empty txt31 (fkeys: $fkeys =~ /$ctadr->{txt31}/) \n" if($debug);
|
print FILE " No failure and empty txt31 (fkeys: $fkeys =~ /$ctadr->{txt31}/) \n" if($debug);
|
||||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt31=''");
|
$u_rows = $dbt->update_one($dbh,$update_adr,"txt31=''");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $ret_conflict if($ret_conflict);
|
$ret = $ret_conflict if($ret_conflict);
|
||||||
|
@ -715,10 +724,10 @@ sub save_transact(){
|
||||||
my $pref = {
|
my $pref = {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
main_id => 300008,#must be Rechnung (and not Storno)
|
main_id => 300008,
|
||||||
template_id => 218,
|
template_id => 218,
|
||||||
#ca_id => "$ctadr->{c_id}",
|
ca_id => "$ctadr_operator->{c_id}",
|
||||||
int10 => "$ctadr_operator->{c_id}",
|
#int10 => "$ctadr_operator->{c_id}",#deprecated
|
||||||
state => "is::null",
|
state => "is::null",
|
||||||
close_time => "is::null",
|
close_time => "is::null",
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,7 +61,7 @@ sub tpl(){
|
||||||
my $pref = {
|
my $pref = {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
fetch => "one",
|
fetch => "one",
|
||||||
template_id => "IN::(208,209,218)",
|
template_id => "IN::(208,209,218,219)",
|
||||||
c_id => $users_dms->{c_id4trans},
|
c_id => $users_dms->{c_id4trans},
|
||||||
};
|
};
|
||||||
$ctt = $dbt->fetch_record($dbh,$pref);
|
$ctt = $dbt->fetch_record($dbh,$pref);
|
||||||
|
|
|
@ -526,6 +526,13 @@ EOF
|
||||||
print $q->Tr(),"\n";
|
print $q->Tr(),"\n";
|
||||||
print $q->td({-class=>'content1_cms',-colspan=>2},"sigapi-log<br />$cttpos->{$key}"),"\n";
|
print $q->td({-class=>'content1_cms',-colspan=>2},"sigapi-log<br />$cttpos->{$key}"),"\n";
|
||||||
}
|
}
|
||||||
|
}elsif($key eq "txt29"){
|
||||||
|
if($cttpos->{$key} && $users_dms->{int03} > 1){
|
||||||
|
$cttpos->{$key} = $q->unescapeHTML("$cttpos->{$key}");
|
||||||
|
$cttpos->{$key} = $lb->newline($cttpos->{$key},"","");
|
||||||
|
print $q->Tr(),"\n";
|
||||||
|
print $q->td({-class=>'content1_cms',-colspan=>2},"response-log<br />$cttpos->{$key}"),"\n";
|
||||||
|
}
|
||||||
}elsif($key =~ /txt/){
|
}elsif($key =~ /txt/){
|
||||||
print $q->Tr(),"\n";
|
print $q->Tr(),"\n";
|
||||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||||
|
@ -769,7 +776,9 @@ EOF
|
||||||
}
|
}
|
||||||
print $q->Tr();
|
print $q->Tr();
|
||||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||||
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector_class("$key","eselect","",$ctrel->{$key},@_payment_type));
|
#print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector_class("$key","eselect","",$ctrel->{$key},@_payment_type));
|
||||||
|
print $q->td({-class=>'content1_cms',-colspan=>2},$q->textfield(-class=>'etxt', -style=>"width:$w;color:grey;",-name=>"intbyhidden", -default=>"$dbt->{copri_conf}->{payment_type}->{$ctrel->{$key}}", -readonly=>1)),"\n";
|
||||||
|
print $q->hidden(-name=>"$key",-override=>1,-value=>"$ctrel->{$key}");
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif($key =~ /int/){
|
elsif($key =~ /int/){
|
||||||
|
@ -845,13 +854,30 @@ EOF
|
||||||
print $q->td({-class=>'left_italic_cms',-style=>'vertical-align:top;',-colspan=>'1'},"$des");
|
print $q->td({-class=>'left_italic_cms',-style=>'vertical-align:top;',-colspan=>'1'},"$des");
|
||||||
print $q->td({-class=>'content1_cms',-colspan=>'1'},$but->selector2("$key","350px;","$height",$ctrel->{$key},@_valxx));
|
print $q->td({-class=>'content1_cms',-colspan=>'1'},$but->selector2("$key","350px;","$height",$ctrel->{$key},@_valxx));
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
#end _multiple select
|
||||||
|
else{
|
||||||
|
#Operator letzt Auswahl/Zuweisung
|
||||||
|
if($key eq "txt19" && $node_meta->{tpl_id} == 202){
|
||||||
|
if($varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||||
|
my @_valxx = ("");
|
||||||
|
foreach my $key (sort keys (%{ $dbt->{operator} })) {
|
||||||
|
push (@_valxx,$key);
|
||||||
|
}
|
||||||
|
print $q->Tr();
|
||||||
|
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||||
|
print $q->td({-class=>'content1_cms',-colspan=>'1'},$but->selector("$key","100px;",$ctrel->{$key},@_valxx),$postdes);
|
||||||
|
print $q->hidden(-name=>"txt17",-override=>1,-value=>"$ctrel->{txt17}");#used operators for loop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
my @_valxx = ("");
|
my @_valxx = ("");
|
||||||
@_valxx = split(/,/,$varenv{$seldes}) if($varenv{$seldes});
|
@_valxx = split(/,/,$varenv{$seldes}) if($varenv{$seldes});
|
||||||
my $selsize = "80px";
|
my $selsize = "80px";
|
||||||
print $q->Tr();
|
print $q->Tr();
|
||||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||||
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
|
print $q->td({-class=>'content1_cms',-colspan=>'2'},$but->selector("$key","$selsize",$ctrel->{$key},@_valxx));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($key =~ /txt/ && $size =~ /area$/){
|
elsif($key =~ /txt/ && $size =~ /area$/){
|
||||||
|
@ -921,14 +947,6 @@ EOF
|
||||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
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";
|
print $q->td({-class=>'content1_cms',-colspan=>'2'},$q->textfield(-class=>'etxt', -style=>"width:$w;",-name=>"$key", -override=>'1', -default=>"$ctrel->{$key}"), $postdes),"\n";
|
||||||
}
|
}
|
||||||
#Operators or Operators Antrag
|
|
||||||
elsif($key =~ /txt17|txt19/){
|
|
||||||
if($varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
|
||||||
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/ && $key !~ /txt12|txt15/){
|
elsif($key =~ /txt/ && $key !~ /txt12|txt15/){
|
||||||
print $q->Tr();
|
print $q->Tr();
|
||||||
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
|
||||||
|
@ -984,6 +1002,7 @@ EOF
|
||||||
--subject-- --subject-- → eMail Betreff<br />
|
--subject-- --subject-- → eMail Betreff<br />
|
||||||
::user_name:: → Kunden Name<br />
|
::user_name:: → Kunden Name<br />
|
||||||
::app_name:: → App Name<br />
|
::app_name:: → App Name<br />
|
||||||
|
::prepaid_id:: → Prepaid-ID (Verwendungszweck)<br />
|
||||||
::invoice_nr:: → Faktura Beleg Nr<br />
|
::invoice_nr:: → Faktura Beleg Nr<br />
|
||||||
::total_sum:: → Rechnungsbetrag Summe €<br />
|
::total_sum:: → Rechnungsbetrag Summe €<br />
|
||||||
::invoice_name:: → Faktura PDF Name<br />
|
::invoice_name:: → Faktura PDF Name<br />
|
||||||
|
|
|
@ -100,7 +100,7 @@ sub tpl(){
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
fetch => "all",
|
fetch => "all",
|
||||||
keyfield => "c_id",
|
keyfield => "c_id",
|
||||||
template_id => "IN::(209,218)",
|
template_id => "IN::(209,218,219)",
|
||||||
};
|
};
|
||||||
my $ct4rel = { c_id => 0 };
|
my $ct4rel = { c_id => 0 };
|
||||||
$ct4rel = $dbt->fetch_record($dbh,$pref_ct);
|
$ct4rel = $dbt->fetch_record($dbh,$pref_ct);
|
||||||
|
@ -417,7 +417,7 @@ sub tpl(){
|
||||||
my $charge = "";
|
my $charge = "";
|
||||||
$charge .= " → lock-charge $cttpos->{$pid}->{int14} %" if(looks_like_number($cttpos->{$pid}->{int14}));
|
$charge .= " → lock-charge $cttpos->{$pid}->{int14} %" if(looks_like_number($cttpos->{$pid}->{int14}));
|
||||||
$charge .= " → bike-charge $cttpos->{$pid}->{int19} %" if(looks_like_number($cttpos->{$pid}->{int19}) && $record_part->{$cttpos->{$pid}->{cc_id}}->{energy_id});
|
$charge .= " → bike-charge $cttpos->{$pid}->{int19} %" if(looks_like_number($cttpos->{$pid}->{int19}) && $record_part->{$cttpos->{$pid}->{cc_id}}->{energy_id});
|
||||||
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{betau_id}->{$users_dms_primary->{u_id}}){
|
||||||
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
|
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$pid')"},"$cttpos->{$pid}->{c_id}", $q->span({-class=>"popuptext",-id=>"$pid"},"$pos_details"));
|
||||||
$user_device = "";
|
$user_device = "";
|
||||||
$user_device .= " → endAck" if($cttpos->{$pid}->{int27});
|
$user_device .= " → endAck" if($cttpos->{$pid}->{int27});
|
||||||
|
@ -478,9 +478,10 @@ sub tpl(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#Gebühren und Gutscheine
|
#Parts and prepaids
|
||||||
if($cttpos->{$pid}->{template_id} && $cttpos->{$pid}->{template_id} =~ /224|229/){
|
if($cttpos->{$pid}->{template_id} && $cttpos->{$pid}->{template_id} =~ /219|224|229/){
|
||||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time → $part_path Nr.$bikenr → $kunde → $u_name/$u_name_end $comment_view"),"\n";
|
$part_path = "Prepaid";
|
||||||
|
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time → $part_path Nr. $bikenr → $kunde → $u_name/$u_name_end $comment_view"),"\n";
|
||||||
}else{
|
}else{
|
||||||
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → <span style='$time_style'>$start_time – $end_time</span> → $kunde → Start Station $start_station → End Station $end_station → Bike $bikenr $status $lock_state → $u_name/$u_name_end<br /><span style='padding-left:60px;'>$charge $track_info $comment_view</span>"),"\n";
|
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → <span style='$time_style'>$start_time – $end_time</span> → $kunde → Start Station $start_station → End Station $end_station → Bike $bikenr $status $lock_state → $u_name/$u_name_end<br /><span style='padding-left:60px;'>$charge $track_info $comment_view</span>"),"\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ sub tpl(){
|
||||||
$node_meta->{tpl_order} =~ s/txt19=[\w\s=]+,//;
|
$node_meta->{tpl_order} =~ s/txt19=[\w\s=]+,//;
|
||||||
}
|
}
|
||||||
if($table eq "contentadr" && $varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
if($table eq "contentadr" && $varenv{dbname} eq $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
|
||||||
$node_meta->{tpl_order} =~ s/Tarife/private Tarife/;
|
$node_meta->{tpl_order} =~ s/Tarif/privat-Tarif/;
|
||||||
}
|
}
|
||||||
$node_meta->{tpl_order} =~ s/c_id=raw=[\w\s=]+// if($users_dms->{u_id} != $dbt->{copri_conf}->{superu_id});
|
$node_meta->{tpl_order} =~ s/c_id=raw=[\w\s=]+// if($users_dms->{u_id} != $dbt->{copri_conf}->{superu_id});
|
||||||
|
|
||||||
|
@ -228,9 +228,9 @@ sub tpl(){
|
||||||
my $main_ids = "";
|
my $main_ids = "";
|
||||||
|
|
||||||
#Faktura actions
|
#Faktura actions
|
||||||
if($node_meta->{template_id} =~ /208|209|218/){
|
if($node_meta->{template_id} =~ /208|209|218|219/){
|
||||||
$main_id = $dbt->{shareedms_conf}->{faktura};
|
$main_id = $dbt->{shareedms_conf}->{faktura};
|
||||||
$tplids = "218";
|
$tplids = "218,219";
|
||||||
|
|
||||||
if($node_meta->{node_name} =~ /OPOS/){
|
if($node_meta->{node_name} =~ /OPOS/){
|
||||||
$R::detail_search="search";
|
$R::detail_search="search";
|
||||||
|
@ -428,7 +428,7 @@ EOF
|
||||||
$searchref->{end_pay_time} = $end_date_time;
|
$searchref->{end_pay_time} = $end_date_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$R::detail_search && -f $hashfile && $full_url eq $referer && ($path =~ /letzte Suche/ || $R::select_part || $R::ct_trans || $R::trans2edit || $R::node2edit || $R::base_edit || $R::rel_edit || $R::set_state)){
|
if(!$R::detail_search && -f $hashfile && $full_url eq $referer && ($R::select_part || $R::ct_trans || $R::trans2edit || $R::node2edit || $R::base_edit || $R::rel_edit || $R::set_state)){
|
||||||
$searchref = {};
|
$searchref = {};
|
||||||
$searchref = retrieve($hashfile);
|
$searchref = retrieve($hashfile);
|
||||||
$tplids = $searchref->{tplids} if($searchref->{tplids});
|
$tplids = $searchref->{tplids} if($searchref->{tplids});
|
||||||
|
@ -453,8 +453,7 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
#trying to save hashref
|
#trying to save hashref
|
||||||
#if(ref($searchref) eq "HASH" && $path !~ /letzte Suche/ && !$R::select_part && !$R::ct_trans && !$R::trans2edit && !$R::node2edit && !$R::base_edit && !$R::rel_edit && !$R::set_state){
|
if(ref($searchref) eq "HASH"){
|
||||||
if(ref($searchref) eq "HASH" && $path !~ /letzte Suche/){
|
|
||||||
if($keycount > 0){
|
if($keycount > 0){
|
||||||
store $searchref, $hashfile;
|
store $searchref, $hashfile;
|
||||||
}else{
|
}else{
|
||||||
|
@ -889,7 +888,6 @@ EOF
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$ny = $nr if($path =~ /letzte Suche/);
|
|
||||||
print $q->td({-class=>'tdint',-style=>"$set_style color:grey;"},"$ny"),"\n" if($ecol <= "2");
|
print $q->td({-class=>'tdint',-style=>"$set_style color:grey;"},"$ny"),"\n" if($ecol <= "2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -922,7 +920,7 @@ EOF
|
||||||
$pos_details .= $did . " = " . $teaser . "</br>" if($pos_hash->{$did});
|
$pos_details .= $did . " = " . $teaser . "</br>" if($pos_hash->{$did});
|
||||||
}
|
}
|
||||||
my $pos_id = "$ct4rel->{$id}->{c_id}";
|
my $pos_id = "$ct4rel->{$id}->{c_id}";
|
||||||
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{contributors} && $users_dms_primary->{u_id} =~ /$dbt->{copri_conf}->{contributors}/){
|
if($users_dms_primary->{u_id} && $dbt->{copri_conf}->{betau_id}->{$users_dms_primary->{u_id}}){
|
||||||
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$id')"},"$ct4rel->{$id}->{c_id}", $q->span({-class=>"popuptext",-id=>"$id"},"$pos_details"));
|
$pos_id = $q->div({-class=>"popup",-onclick=>"toggle_box('$id')"},"$ct4rel->{$id}->{c_id}", $q->span({-class=>"popuptext",-id=>"$id"},"$pos_details"));
|
||||||
}
|
}
|
||||||
print $q->td({-class=>'tdtxt',-style=>"font-weight:normal;$set_style4nr"},"$pos_id"),"\n";
|
print $q->td({-class=>'tdtxt',-style=>"font-weight:normal;$set_style4nr"},"$pos_id"),"\n";
|
||||||
|
|
|
@ -64,7 +64,7 @@ sub tpl(){
|
||||||
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
|
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
|
||||||
my $rows = 0;
|
my $rows = 0;
|
||||||
my $spart_ct_name = $R::spart_ct_name || "";
|
my $spart_ct_name = $R::spart_ct_name || "";
|
||||||
my $c_idpos = $R::c_idpos || $R::pos_id || "";
|
my $c_idpos = $R::c_idpos || $R::pos_id || 0;
|
||||||
my $cttpos = { c_id => 0 };
|
my $cttpos = { c_id => 0 };
|
||||||
|
|
||||||
my $ctf = { c_id => 0 };
|
my $ctf = { c_id => 0 };
|
||||||
|
@ -178,7 +178,7 @@ EOF
|
||||||
my $rental_feed = {};
|
my $rental_feed = {};
|
||||||
|
|
||||||
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
if($cttpos->{$id}->{int35} && $cttpos->{$id}->{start_time} && $cttpos->{$id}->{end_time}){
|
||||||
$pri->count_freedrental($q,\%varenv,$ctadr->{c_id},$cttpos->{$id});
|
$pri->count_freedrental($q,\%varenv,$ctt->{int10},$cttpos->{$id});
|
||||||
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id});
|
($pricing,$counting) = $pri->counting_rental(\%varenv,$cttpos->{$id});
|
||||||
|
|
||||||
$rental_feed = $pri->fetch_rentalfeed(\%varenv,\%varenv,$cttpos->{$id},$counting);
|
$rental_feed = $pri->fetch_rentalfeed(\%varenv,\%varenv,$cttpos->{$id},$counting);
|
||||||
|
@ -275,7 +275,7 @@ EOF
|
||||||
if($cttpos->{$id}->{int35} && $pricing->{start_time} && $pricing->{end_time}){
|
if($cttpos->{$id}->{int35} && $pricing->{start_time} && $pricing->{end_time}){
|
||||||
print $q->td({-class=>'tdint', -nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
|
print $q->td({-class=>'tdint', -nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
|
||||||
}else{
|
}else{
|
||||||
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10)),"\n";
|
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10)),"\n";
|
||||||
}
|
}
|
||||||
}elsif($key =~ /int02/){
|
}elsif($key =~ /int02/){
|
||||||
if($cttpos->{$id}->{int35} && $pricing->{start_time} && $pricing->{end_time}){
|
if($cttpos->{$id}->{int35} && $pricing->{start_time} && $pricing->{end_time}){
|
||||||
|
@ -287,10 +287,10 @@ EOF
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}else{
|
}else{
|
||||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100)),"\n";
|
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100)),"\n";
|
||||||
}
|
}
|
||||||
}elsif($key =~ /int07/){
|
}elsif($key =~ /int07/){
|
||||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style",-nowrap=>'1'},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),$but->selector("int08","40px","$cttpos->{$id}->{int08}",("0.00:%","1.00:€"))),"\n";
|
print $q->td({-class=>'element',-style=>"$txtstyle $set_style",-nowrap=>'1'},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),$but->selector("int08","40px","$cttpos->{$id}->{int08}",("0.00:%","1.00:€"))),"\n";
|
||||||
}elsif($key =~ /int04/){
|
}elsif($key =~ /int04/){
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
|
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
|
||||||
}elsif($key =~ /txt01/){
|
}elsif($key =~ /txt01/){
|
||||||
|
@ -302,7 +302,7 @@ EOF
|
||||||
my ($e_yy,$e_mo,$e_dd,$e_hh,$e_mi) = $lb->split_date($pricing->{end_time});
|
my ($e_yy,$e_mo,$e_dd,$e_hh,$e_mi) = $lb->split_date($pricing->{end_time});
|
||||||
|
|
||||||
print "<td class='tdtxt3' style='$txtstyle $set_style;$occupied_style;'>\n";
|
print "<td class='tdtxt3' style='$txtstyle $set_style;$occupied_style;'>\n";
|
||||||
print $q->textarea(-class=>'autos',-style=>"border: 1px solid #ededed;",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-rows=>"3",-cols=>60, -autofocus=>1),"<br />\n";
|
print $q->textarea(-class=>'autos',-style=>"border: 1px solid #ededed;",-name=>"$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-rows=>"3",-cols=>60, -autofocus=>1),"<br />\n";
|
||||||
|
|
||||||
#if Traiff Nr.
|
#if Traiff Nr.
|
||||||
if($cttpos->{$id}->{int09}){
|
if($cttpos->{$id}->{int09}){
|
||||||
|
@ -324,7 +324,7 @@ EOF
|
||||||
print "<br /><b>Bemerkung (Mietjournal)</b> $cttpos->{$id}->{txt23}\n" if($cttpos->{$id}->{txt23});
|
print "<br /><b>Bemerkung (Mietjournal)</b> $cttpos->{$id}->{txt23}\n" if($cttpos->{$id}->{txt23});
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}elsif($key =~ /txt/){
|
}elsif($key =~ /txt/){
|
||||||
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100)),"\n";
|
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100)),"\n";
|
||||||
}elsif($key =~ /int/){
|
}elsif($key =~ /int/){
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"}," "),"\n";
|
print $q->td({-class=>'tdint',-nowrap=>"1"}," "),"\n";
|
||||||
}
|
}
|
||||||
|
@ -381,11 +381,15 @@ EOF
|
||||||
$gesamt =~ s/\./,/;
|
$gesamt =~ s/\./,/;
|
||||||
print $q->td({-class=>'tdint',-nowrap=>1},"$gesamt €"),"\n";
|
print $q->td({-class=>'tdint',-nowrap=>1},"$gesamt €"),"\n";
|
||||||
}elsif($key =~ /int07/){
|
}elsif($key =~ /int07/){
|
||||||
my $proz="";
|
if($cttpos->{$id}->{$key}){
|
||||||
$proz = "%" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0);
|
my $proz="";
|
||||||
$proz = "€" if($cttpos->{$id}->{$key} && $cttpos->{$id}->{$key} != 0 && $cttpos->{$id}->{int08} && $cttpos->{$id}->{int08} == 1);
|
$proz = "%" if($cttpos->{$id}->{$key} != 0);
|
||||||
$cttpos->{$id}->{$key} =~ s/\./,/;
|
$proz = "€" if($cttpos->{$id}->{$key} != 0 && $cttpos->{$id}->{int08} && $cttpos->{$id}->{int08} == 1);
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$cttpos->{$id}->{$key} $proz"),"\n";
|
$cttpos->{$id}->{$key} =~ s/\./,/;
|
||||||
|
print $q->td({-class=>'tdint',-nowrap=>"1"},"$cttpos->{$id}->{$key} $proz"),"\n";
|
||||||
|
}else{
|
||||||
|
print $q->td({-class=>'tdint',-nowrap=>"1"},""),"\n";
|
||||||
|
}
|
||||||
}elsif($key =~ /txt01/){
|
}elsif($key =~ /txt01/){
|
||||||
$cttpos->{$id}->{$key} = $q->unescapeHTML("$cttpos->{$id}->{$key}");
|
$cttpos->{$id}->{$key} = $q->unescapeHTML("$cttpos->{$id}->{$key}");
|
||||||
$cttpos->{$id}->{$key} = $lb->newline($cttpos->{$id}->{$key},"","");
|
$cttpos->{$id}->{$key} = $lb->newline($cttpos->{$id}->{$key},"","");
|
||||||
|
@ -480,14 +484,16 @@ EOF
|
||||||
if($key =~ /txt5\d/){
|
if($key =~ /txt5\d/){
|
||||||
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
|
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
|
||||||
$ctf->{$key} = $lb->newline($ctf->{$key},"","");
|
$ctf->{$key} = $lb->newline($ctf->{$key},"","");
|
||||||
$ctt->{state} =~ s/\(payone.*//;
|
if($ctt->{state}){
|
||||||
if($des =~ /$ctt->{state}/){
|
$ctt->{state} =~ s/\(payone.*//;
|
||||||
|
if($des =~ /$ctt->{state}/){
|
||||||
if($sum_parts19 < 0){
|
if($sum_parts19 < 0){
|
||||||
$payment_text = "$ctf->{txt58}";
|
$payment_text = "$ctf->{txt58}";
|
||||||
}else{
|
}else{
|
||||||
$payment_text = "$ctf->{$key}";
|
$payment_text = "$ctf->{$key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,18 +506,14 @@ EOF
|
||||||
print $q->Tr("\n");
|
print $q->Tr("\n");
|
||||||
print $q->td(" ");
|
print $q->td(" ");
|
||||||
|
|
||||||
if($node_meta->{node_name} !~ /steuerfrei/){
|
|
||||||
print $q->Tr("\n"); $line_count2++;
|
print $q->Tr("\n"); $line_count2++;
|
||||||
print $q->td({-class=>'tdint'},"Nettobetrag:");
|
print $q->td({-class=>'tdint'},"Nettobetrag:");
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_netto19 €");
|
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_netto19 €");
|
||||||
|
|
||||||
if($sum_netto19 != 0){
|
|
||||||
print $q->Tr("\n");$line_count2++;
|
print $q->Tr("\n");$line_count2++;
|
||||||
#print $q->td({-class=>'tdint',-nowrap=>"1"},"$umst1619% UmSt auf $sum_netto19 €:");
|
#print $q->td({-class=>'tdint',-nowrap=>"1"},"$umst1619% UmSt auf $sum_netto19 €:");
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"19% UmSt auf $sum_netto19 €:");
|
print $q->td({-class=>'tdint',-nowrap=>"1"},"19% UmSt auf $sum_netto19 €:");
|
||||||
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_umst19 €");
|
print $q->td({-class=>'tdint',-nowrap=>"1"},"$sum_umst19 €");
|
||||||
}
|
|
||||||
}
|
|
||||||
my $summe = "Summe";
|
my $summe = "Summe";
|
||||||
print $q->Tr("\n");$line_count2++;
|
print $q->Tr("\n");$line_count2++;
|
||||||
print $q->td({-class=>'tdsum'},"<b>$summe:</b>");
|
print $q->td({-class=>'tdsum'},"<b>$summe:</b>");
|
||||||
|
|
|
@ -438,6 +438,7 @@ EOF
|
||||||
$sum += $gesamt;
|
$sum += $gesamt;
|
||||||
$gesamt = $lb->round($gesamt);
|
$gesamt = $lb->round($gesamt);
|
||||||
$gesamt = sprintf('%.2f',$gesamt);
|
$gesamt = sprintf('%.2f',$gesamt);
|
||||||
|
$gesamt =~ s/\./,/;
|
||||||
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
print $q->td({-class=>'tdint', -style=>"$occupied_style", -nowrap=>1},"$rabatt $gesamt €"),"\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -656,7 +657,7 @@ EOF
|
||||||
}elsif($p_id == 2){
|
}elsif($p_id == 2){
|
||||||
print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$p_id","$checked_creditcard",$q->img({-id=>"pic-payment" ,-style=>'height:25px;', -title=>"$dbt->{copri_conf}->{payment_type}->{$p_id}",-src=>"$varenv->{metahost}/img/payment-creditcard2.png"}))),"\n";
|
print $q->div({ -class=>'radio', -style=>'padding-top:20px;' },$but->radiobox_vertical("$key","$p_id","$checked_creditcard",$q->img({-id=>"pic-payment" ,-style=>'height:25px;', -title=>"$dbt->{copri_conf}->{payment_type}->{$p_id}",-src=>"$varenv->{metahost}/img/payment-creditcard2.png"}))),"\n";
|
||||||
}elsif($p_id == 3){
|
}elsif($p_id == 3){
|
||||||
print $q->div({ -class=>'radio', -style=>'padding-top:25px;' },$but->radiobox_vertical("$key","$p_id","$checked_prepaid","<span style='padding-left:25px;font-size:1.2em;'>Prepaid</span>")),"\n" if($ctrel->{c_id} =~ /$dbt->{copri_conf}->{contributors}/);#testing by contributors
|
print $q->div({ -class=>'radio', -style=>'padding-top:25px;' },$but->radiobox_vertical("$key","$p_id","$checked_prepaid","<span style='padding-left:25px;font-size:1.2em;'>Prepaid</span>")),"\n" if($ctrel->{c_id} && $dbt->{copri_conf}->{betau_id}->{$ctrel->{c_id}});#testing by contributors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
|
print $q->hidden(-name=>"$key",-override=>1,-value=>"null");
|
||||||
|
|
|
@ -11,6 +11,7 @@ use Mod::Buttons;
|
||||||
use Mod::Basework;
|
use Mod::Basework;
|
||||||
use Mod::Shareework;
|
use Mod::Shareework;
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
|
use Mod::Pricing;
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
@ -34,8 +35,8 @@ sub tpl(){
|
||||||
my $bw = new Basework;
|
my $bw = new Basework;
|
||||||
my $tk = new Shareework;
|
my $tk = new Shareework;
|
||||||
my $dbt = new DBtank;
|
my $dbt = new DBtank;
|
||||||
|
my $pri = new Pricing;
|
||||||
my $but = new Buttons;
|
my $but = new Buttons;
|
||||||
my $hostname = hostname;
|
|
||||||
|
|
||||||
$q->import_names('R');
|
$q->import_names('R');
|
||||||
my @keywords = $q->param;
|
my @keywords = $q->param;
|
||||||
|
@ -132,12 +133,42 @@ sub tpl(){
|
||||||
}#end SEPA
|
}#end SEPA
|
||||||
#prepay
|
#prepay
|
||||||
elsif($tpl_id == 313){
|
elsif($tpl_id == 313){
|
||||||
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-prepay-account'}->{txt}"),"\n";
|
|
||||||
|
|
||||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/\n/<br \/>/g;
|
my $posref = {
|
||||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::app_name::/<b>$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{app_name}<\/b>/g;
|
table => "contenttrans",
|
||||||
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::user_id::/<b>$ctadr->{c_id}<\/b>/g;
|
table_pos => "contenttranspos",
|
||||||
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-prepay-prolog'}->{txt}"),"\n";
|
fetch => "all",
|
||||||
|
keyfield => "c_id",
|
||||||
|
ca_id => "$ctadr->{c_id}",
|
||||||
|
'ct.state' => "is::null",
|
||||||
|
'ct.int14' => "is::null",
|
||||||
|
};
|
||||||
|
my $cttpos = { c_id => 0 };
|
||||||
|
$cttpos = $dbt->collect_post($dbh,$posref);
|
||||||
|
#TODO negative counting booked operator invoices
|
||||||
|
my $total_prepaid = 0;
|
||||||
|
my $prepay_id = 0;
|
||||||
|
foreach my $id (sort { $cttpos->{$b}->{c_id} <=> $cttpos->{$a}->{c_id} } keys(%$cttpos)){
|
||||||
|
#print $cttpos->{$id}->{barcode} . ":" . $cttpos->{$id}->{int02},"<br>";
|
||||||
|
if($cttpos->{$id}->{int02} > 0){
|
||||||
|
$total_prepaid += $cttpos->{$id}->{int02};
|
||||||
|
}
|
||||||
|
if($cttpos->{$id}->{int02} == 0){
|
||||||
|
$prepay_id = $cttpos->{$id}->{barcode};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print $q->div({-class=>'content_title3'},"$varenv->{cms}->{'iframe-prepay-account'}->{txt}"),"\n";
|
||||||
|
if(!$prepay_id){
|
||||||
|
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-failure-contact-hotline'}->{txt} $prepay_id"),"\n";
|
||||||
|
}else{
|
||||||
|
$total_prepaid = sprintf('%.2f',$total_prepaid);
|
||||||
|
$total_prepaid =~ s/\./,/;
|
||||||
|
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/\n/<br \/>/g;
|
||||||
|
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::total_prepaid::/<b>$total_prepaid €<\/b>/g;
|
||||||
|
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::app_name::/<b>$dbt->{merchant_ids}->{$varenv->{merchant_id}}->{app_name}<\/b>/g;
|
||||||
|
$varenv->{cms}->{'iframe-prepay-prolog'}->{txt} =~ s/::prepaid_id::/<b>$prepay_id<\/b>/g;
|
||||||
|
print $q->div({-class=>'content2'}, "$varenv->{cms}->{'iframe-prepay-prolog'}->{txt}"),"\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,8 @@
|
||||||
superu_id = "1234567"
|
superu_id = "1234567"
|
||||||
logdir = "/var/log/copri4"
|
logdir = "/var/log/copri4"
|
||||||
basedir = "/var/www/copri4"
|
basedir = "/var/www/copri4"
|
||||||
|
<betau_id>
|
||||||
|
</betau_id>
|
||||||
<type_id>
|
<type_id>
|
||||||
300101 = "cargo"
|
300101 = "cargo"
|
||||||
300103 = "city"
|
300103 = "city"
|
||||||
|
@ -231,10 +233,12 @@
|
||||||
<lock_system>
|
<lock_system>
|
||||||
2 = "Ilockit"
|
2 = "Ilockit"
|
||||||
</lock_system>
|
</lock_system>
|
||||||
<access>
|
<payment_type>
|
||||||
0 = "nein"
|
0 = ""
|
||||||
1 = "ja"
|
1 = "SEPA Bankeinzug"
|
||||||
</access>
|
2 = "CreditCard"
|
||||||
|
3 = "Prepaid"
|
||||||
|
</payment_type>
|
||||||
<permission>
|
<permission>
|
||||||
0 = "keine"
|
0 = "keine"
|
||||||
1 = "lesen"
|
1 = "lesen"
|
||||||
|
|
Loading…
Add table
Reference in a new issue