diff --git a/copri4/main/src/Mod/APIfunc.pm b/copri4/main/src/Mod/APIfunc.pm
index 18e7d8a..1a946a0 100755
--- a/copri4/main/src/Mod/APIfunc.pm
+++ b/copri4/main/src/Mod/APIfunc.pm
@@ -921,8 +921,8 @@ sub booking_request(){
fetch => "one",
main_id => 300008,
template_id => 218,
- #ca_id => "$auth->{c_id}",#future change
- int10 => "$auth->{c_id}",
+ ca_id => "$auth->{c_id}",
+ #int10 => "$auth->{c_id}",#deprecated
state => "null",
close_time => "is::null",
};
@@ -1482,10 +1482,15 @@ sub booking_update(){
int23 => $user_miniquest_count,
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
+ #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);
@@ -3174,7 +3179,7 @@ sub authcookie_manager {
}
$registered_cookies =~ s/\|$//;
- #$bw->log("generated authcookie",$authcookie,"");
+ $bw->log("generated authcookie",$authcookie,"");
#return still existing authcookie
if($registered_cookies && $registered_cookies =~ /$authcookie/){
diff --git a/copri4/main/src/Mod/APIjsonserver.pm b/copri4/main/src/Mod/APIjsonserver.pm
index f7a850b..a14cd20 100755
--- a/copri4/main/src/Mod/APIjsonserver.pm
+++ b/copri4/main/src/Mod/APIjsonserver.pm
@@ -68,7 +68,7 @@ my $response = {
apiserver => "$apiserver",
response => "$respreq",
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
- copri_version => "4.1.23.17",
+ copri_version => "4.1.23.18",
user_id => "",
authcookie => "",
new_authcoo => "0",
@@ -123,6 +123,7 @@ if(!$coo && !$q->param('merchant_id')){
$response->{bike_info_html} = "$dbt->{project_conf}->{Freiburg}->{bike_info_html}";
if($lang ne "de"){
$response->{tariff_info_html} =~ s/\.html/_en\.html/;
+ $response->{bike_info_html} =~ s/\.html/_en\.html/;
}
}
elsif($return_merchant->{project_id} eq "Konstanz"){
diff --git a/copri4/main/src/Mod/Basework.pm b/copri4/main/src/Mod/Basework.pm
index ffb0311..0af714b 100755
--- a/copri4/main/src/Mod/Basework.pm
+++ b/copri4/main/src/Mod/Basework.pm
@@ -133,7 +133,7 @@ sub isuser_rentable {
my $varenv = shift;
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;
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
diff --git a/copri4/main/src/Mod/Buttons.pm b/copri4/main/src/Mod/Buttons.pm
index 6fe55d8..7090a2c 100755
--- a/copri4/main/src/Mod/Buttons.pm
+++ b/copri4/main/src/Mod/Buttons.pm
@@ -243,9 +243,9 @@ sub selector(){
my @selopt = ();
foreach my $opt (@selval){
- my $id = $opt;
- my $value = $opt;
- ($id,$value) = split /:/,$opt if($opt =~ /\w+\:.*/);
+ my $id = $opt || "";
+ my $value = $opt || "";
+ ($id,$value) = split /:/,$opt if($opt && $opt =~ /\w+\:.*/);
if($sel eq $id){
push @selopt, "\n";
}else{
@@ -259,14 +259,18 @@ sub selector(){
# select tag with class
sub selector_class(){
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 = ();
foreach my $opt (@selval){
my $des_style = "";
- my $id = $opt;
- my $value = $opt;
- ($id,$value) = split /:/,$opt if($opt =~ /\:/);
+ my $id = $opt || "";
+ my $value = $opt || "";
+ ($id,$value) = split /:/,$opt if($opt && $opt =~ /\:/);
$des_style = "color:grey;" if(!$id);
if($sel eq $id){
push @selopt, "\n";
diff --git a/copri4/main/src/Mod/DBtank.pm b/copri4/main/src/Mod/DBtank.pm
index ba596bf..ff8e993 100755
--- a/copri4/main/src/Mod/DBtank.pm
+++ b/copri4/main/src/Mod/DBtank.pm
@@ -705,7 +705,11 @@ sub collect_post(){
$cp_where .= " and cp.$key $op $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";
+ }
}elsif($fetch->{catch} && $key eq "template_id" && $value){
$cp_where .= " and cp.$key $op $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 .
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 $rc = $sth->execute();
- #$bw->log("DBtank fetch_record : $rc",$sql,"") if($debug);
my $record = { c_id => 0 };
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+)$/){
$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',";
}elsif(looks_like_number($value) || ($value && $value eq "null")){
$set .= " $key=$value,";
@@ -1045,7 +1049,7 @@ sub update_record(){
my $sql = "UPDATE $update->{table} set $set $where";
my $sth = $dbh->prepare($sql);
$rows = $sth->execute();
- #$bw->log("DBtank update_record : $rows",$sql,"") if($debug);
+ $bw->log("DBtank update_record : $rows",$sql,"") if($debug);
}
return $rows;
}#update_record
@@ -1565,7 +1569,7 @@ sub insert_pos(){
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");
}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 $last_id;
@@ -1594,8 +1598,12 @@ sub insert_contenttrans(){
my $invoice_nr = shift || "----";
my $owner = shift || 0;
+ my $doc_name = "Rechnung";
+ $doc_name = "Prepaid Account" if($tpl_id == 219);
$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 $last_id;
diff --git a/copri4/main/src/Mod/Indexsharee.pm b/copri4/main/src/Mod/Indexsharee.pm
index 7304f35..88d65de 100755
--- a/copri4/main/src/Mod/Indexsharee.pm
+++ b/copri4/main/src/Mod/Indexsharee.pm
@@ -435,14 +435,21 @@ sub handler {
#print redirect("mailto:$sendref->{mail_to}?subject=$sendref->{subject}\&body=$sendref->{message}");
#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" || "";
$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){
$feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans);
}
+ #in future the prelogic modul should be disabled at all
$return .= "|";
$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");
exit 0;
}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;
}else{
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=3$session_and\&$returnwww");
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}){
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_1}?cum=4$session_and\&$returnwww");
exit 0;
}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;
}else{
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=4$session_and\&$returnwww");
diff --git a/copri4/main/src/Mod/Prelib.pm b/copri4/main/src/Mod/Prelib.pm
index 48679d8..4cc0561 100755
--- a/copri4/main/src/Mod/Prelib.pm
+++ b/copri4/main/src/Mod/Prelib.pm
@@ -49,6 +49,74 @@ my %varenv = $cf->envonline();
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
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
sub longterm_occupied {
my $self = shift;
@@ -605,7 +673,7 @@ sub save_contenttranspos {
table => "contenttrans",
table_pos => "contenttranspos",
fetch => "one",
- template_id => "218",#Mietjournal tpl_id
+ template_id => "218",#open invoice tpl_id
c_id => $c_id,
"ct.state" => "is::null",
};
@@ -673,7 +741,7 @@ sub save_contenttranspos {
table => "contenttrans",
table_pos => "contenttranspos",
fetch => "one",
- template_id => "218",#Mietjournal tpl_id
+ template_id => "218",#open invoice tpl_id
start_time => ">::$end_time",
barcode => $ctpos->{barcode},
"ct.state" => "is::null",
@@ -737,7 +805,7 @@ sub save_contenttranspos {
table => "contenttrans",
table_pos => "contenttranspos",
fetch => "one",
- template_id => "218",#Mietjournal tpl_id
+ template_id => "IN::(218,219)",#open invoices and prepaid tpl_id
c_id => $c_id,
"ct.state" => "is::null",
};
@@ -756,11 +824,25 @@ sub save_contenttranspos {
};
if($ctpos->{c_id}){
$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{
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits gebucht";
}
}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{
$feedb->{message} = "failure::Fehler, fehlerhafte Eingaben oder Datensatz nicht gefunden!";
diff --git a/copri4/main/src/Mod/Pricing.pm b/copri4/main/src/Mod/Pricing.pm
index e551242..2ec8894 100755
--- a/copri4/main/src/Mod/Pricing.pm
+++ b/copri4/main/src/Mod/Pricing.pm
@@ -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);
#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 = {
table => "contenttranspos",
fetch => "all",
@@ -88,6 +88,7 @@ sub count_freedrental {
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)";
}
+
my $record_pos = { c_id => 0 };
$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)){
diff --git a/copri4/main/src/Mod/Shareework.pm b/copri4/main/src/Mod/Shareework.pm
index 56c7226..755a87a 100755
--- a/copri4/main/src/Mod/Shareework.pm
+++ b/copri4/main/src/Mod/Shareework.pm
@@ -133,11 +133,15 @@ sub save_account(){
my $c_id = shift;
my $varmerch = shift || "";
my $owner = shift || 0;
- my $feedb = { message => "" };
my $table = "contentadr";
$q->import_names('R');
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 %varenv = $cf->envonline();
@@ -163,9 +167,10 @@ sub save_account(){
template_id => "202",
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",
mtime => "now()",
owner => "$owner",
@@ -208,7 +213,7 @@ sub save_account(){
}elsif(length($valxx) >= 8){
my $pwmd5 = md5_hex($valxx) || "";
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
@@ -227,15 +232,15 @@ sub save_account(){
foreach my $keys (keys %txt17) {
push(@operators,$keys);
}
- $u_rows = $dbt->update_one($dbh,$update_primary,"txt17='@operators'");
+ $update_adr->{txt17} = "@operators";
}
#Rabatt|payone cron-intervall|Ilockit-Admin|miniq
elsif($_ =~ /int07|int16|int19|int23/){
- $u_rows = $dbt->update_one("",$update_primary,"$_=$valxx");
+ $update_adr->{$_} = $valxx;
}
#Text Sonstiges
elsif($_ =~ /txt29/){
- $u_rows = $dbt->update_one("",$update_primary,"$_='$valxx'");
+ $update_adr->{$_} = "$valxx";
}
#txt15=Bonus- oder Freischalcode (falls vorhanden)=15
@@ -326,7 +331,7 @@ sub save_account(){
push(@operators,$keys) if($keys =~/sharee_/);
}
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
my $ctadr_operator = $dbt->fetch_record($dbh_operator,$authref);
@@ -418,14 +423,14 @@ sub save_account(){
}else{
#smsAck reset
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 =~ s/\s//g;
my $confirm_digest = sha1_base64($email . $phone);
$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);
#user alias email
@@ -450,37 +455,32 @@ sub save_account(){
}
#mailAck reset
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
- $u_rows = $dbt->update_one($dbh,$update_primary,"$_=$valxx");
- $u_rows = $dbt->update_one($dbh,$update_primary,"txt05=null") if($valxx != 1);
+ $update_adr->{$_} = $valxx;
+ $update_adr->{txt05} = "" if($valxx != 1);#delete also cookies
}elsif($_ eq "int12" && $varenv{dbname} ne $dbt->{primary}->{sharee_primary}->{database}->{dbname}){
my $vde_on_fail = 0;
$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/){
- $u_rows = $dbt->update_one($dbh,$update_primary,"$_=$valxx");
+ $update_adr->{$_} = $valxx;
}elsif($_ eq "ct_name" && $R::base_edit){
- $u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
+ $update_adr->{$_} = "$valxx";
}elsif($_ =~ /txt22|txt23/){
$valxx =~ s/\s//g;
- $u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
+ $update_adr->{$_} = "$valxx";
}elsif($_ !~ /ct_name|txt15/){
- $u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
+ $update_adr->{$_} = "$valxx";
}
#Additionals after default updater
#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})){
- $u_rows += $dbt->update_one($dbh,$update_primary,"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'");
+ $update_adr->{ct_name} = "$c_id";
}
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));
}#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
#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})
#fraud workaround
my $iban = $ctadr->{txt22} || "";
@@ -564,17 +569,21 @@ sub save_account(){
$ctt->{txt16} = "$payone_txid";
$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);
#int12=0 should be set after capture success in payment module
}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{
- $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){
@@ -587,10 +596,10 @@ sub save_account(){
$rval =~ s/confirm_//g;#PW confirm
$rval =~ s/conflict_//g;#conflict
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}/){
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);
@@ -715,10 +724,10 @@ sub save_transact(){
my $pref = {
table => "contenttrans",
fetch => "one",
- main_id => 300008,#must be Rechnung (and not Storno)
+ main_id => 300008,
template_id => 218,
- #ca_id => "$ctadr->{c_id}",
- int10 => "$ctadr_operator->{c_id}",
+ ca_id => "$ctadr_operator->{c_id}",
+ #int10 => "$ctadr_operator->{c_id}",#deprecated
state => "is::null",
close_time => "is::null",
};
diff --git a/copri4/main/src/Tpl/Address3.pm b/copri4/main/src/Tpl/Address3.pm
index b4c9b9b..369a555 100755
--- a/copri4/main/src/Tpl/Address3.pm
+++ b/copri4/main/src/Tpl/Address3.pm
@@ -61,7 +61,7 @@ sub tpl(){
my $pref = {
table => "contenttrans",
fetch => "one",
- template_id => "IN::(208,209,218)",
+ template_id => "IN::(208,209,218,219)",
c_id => $users_dms->{c_id4trans},
};
$ctt = $dbt->fetch_record($dbh,$pref);
diff --git a/copri4/main/src/Tpl/BaseEdit.pm b/copri4/main/src/Tpl/BaseEdit.pm
index 427a380..cdd8f34 100755
--- a/copri4/main/src/Tpl/BaseEdit.pm
+++ b/copri4/main/src/Tpl/BaseEdit.pm
@@ -526,6 +526,13 @@ EOF
print $q->Tr(),"\n";
print $q->td({-class=>'content1_cms',-colspan=>2},"sigapi-log
$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
$cttpos->{$key}"),"\n";
+ }
}elsif($key =~ /txt/){
print $q->Tr(),"\n";
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
@@ -769,7 +776,9 @@ EOF
}
print $q->Tr();
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/){
@@ -845,13 +854,30 @@ EOF
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));
}
- }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 = ("");
@_valxx = split(/,/,$varenv{$seldes}) if($varenv{$seldes});
my $selsize = "80px";
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 =~ /area$/){
@@ -921,14 +947,6 @@ EOF
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";
}
- #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/){
print $q->Tr();
print $q->td({-class=>'left_italic_cms'},"$des"),"\n";
@@ -984,6 +1002,7 @@ EOF
--subject-- --subject-- → eMail Betreff
::user_name:: → Kunden Name
::app_name:: → App Name
+ ::prepaid_id:: → Prepaid-ID (Verwendungszweck)
::invoice_nr:: → Faktura Beleg Nr
::total_sum:: → Rechnungsbetrag Summe €
::invoice_name:: → Faktura PDF Name
diff --git a/copri4/main/src/Tpl/Calorin.pm b/copri4/main/src/Tpl/Calorin.pm
index cc2256d..cd6f74d 100755
--- a/copri4/main/src/Tpl/Calorin.pm
+++ b/copri4/main/src/Tpl/Calorin.pm
@@ -100,7 +100,7 @@ sub tpl(){
table => "contenttrans",
fetch => "all",
keyfield => "c_id",
- template_id => "IN::(209,218)",
+ template_id => "IN::(209,218,219)",
};
my $ct4rel = { c_id => 0 };
$ct4rel = $dbt->fetch_record($dbh,$pref_ct);
@@ -417,7 +417,7 @@ sub tpl(){
my $charge = "";
$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});
- 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"));
$user_device = "";
$user_device .= " → endAck" if($cttpos->{$pid}->{int27});
@@ -478,9 +478,10 @@ sub tpl(){
}
- #Gebühren und Gutscheine
- if($cttpos->{$pid}->{template_id} && $cttpos->{$pid}->{template_id} =~ /224|229/){
- print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time → $part_path Nr.$bikenr → $kunde → $u_name/$u_name_end $comment_view"),"\n";
+ #Parts and prepaids
+ if($cttpos->{$pid}->{template_id} && $cttpos->{$pid}->{template_id} =~ /219|224|229/){
+ $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{
print $q->div({-style=>"float:left;margin-left:$c_left"}, "$i) $edit_pos $pos_id → $start_time – $end_time → $kunde → Start Station $start_station → End Station $end_station → Bike $bikenr $status $lock_state → $u_name/$u_name_end
$charge $track_info $comment_view"),"\n";
}
diff --git a/copri4/main/src/Tpl/Liste3.pm b/copri4/main/src/Tpl/Liste3.pm
index 4be6d83..b797fbf 100755
--- a/copri4/main/src/Tpl/Liste3.pm
+++ b/copri4/main/src/Tpl/Liste3.pm
@@ -151,7 +151,7 @@ sub tpl(){
$node_meta->{tpl_order} =~ s/txt19=[\w\s=]+,//;
}
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});
@@ -228,9 +228,9 @@ sub tpl(){
my $main_ids = "";
#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};
- $tplids = "218";
+ $tplids = "218,219";
if($node_meta->{node_name} =~ /OPOS/){
$R::detail_search="search";
@@ -428,7 +428,7 @@ EOF
$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 = retrieve($hashfile);
$tplids = $searchref->{tplids} if($searchref->{tplids});
@@ -453,8 +453,7 @@ EOF
}
#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" && $path !~ /letzte Suche/){
+ if(ref($searchref) eq "HASH"){
if($keycount > 0){
store $searchref, $hashfile;
}else{
@@ -889,7 +888,6 @@ EOF
print "\n";
}else{
- $ny = $nr if($path =~ /letzte Suche/);
print $q->td({-class=>'tdint',-style=>"$set_style color:grey;"},"$ny"),"\n" if($ecol <= "2");
}
@@ -922,7 +920,7 @@ EOF
$pos_details .= $did . " = " . $teaser . "" if($pos_hash->{$did});
}
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"));
}
print $q->td({-class=>'tdtxt',-style=>"font-weight:normal;$set_style4nr"},"$pos_id"),"\n";
diff --git a/copri4/main/src/Tpl/TransPositionen.pm b/copri4/main/src/Tpl/TransPositionen.pm
index 828c3b9..36b4e68 100755
--- a/copri4/main/src/Tpl/TransPositionen.pm
+++ b/copri4/main/src/Tpl/TransPositionen.pm
@@ -64,7 +64,7 @@ sub tpl(){
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
my $rows = 0;
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 $ctf = { c_id => 0 };
@@ -178,7 +178,7 @@ EOF
my $rental_feed = {};
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});
$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}){
print $q->td({-class=>'tdint', -nowrap=>1},"$pricing->{real_clock} $pricing->{freed_time}"),"\n";
}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/){
if($cttpos->{$id}->{int35} && $pricing->{start_time} && $pricing->{end_time}){
@@ -287,10 +287,10 @@ EOF
}
print "\n";
}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/){
- 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/){
print $q->td({-class=>'tdint',-nowrap=>"1"},"$gesamt €"),"\n";
}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});
print "