mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 03:36:30 +01:00
Some mailing and sms sender fixes
This commit is contained in:
parent
03ade2a406
commit
b32214c15d
11 changed files with 38 additions and 24 deletions
|
@ -1460,7 +1460,7 @@ sub booking_update(){
|
|||
int23 => $user_miniquest_count,
|
||||
atime => "now()",
|
||||
};
|
||||
$rows = $dbt->update_record($dbh,$update23,$auth_prim);
|
||||
$rows = $dbt->update_record($dbh,$update23,$auth_prim) if($dbt->{copri_conf}->{contributors} && $auth_prim->{c_id} !~ /$dbt->{copri_conf}->{contributors}/);
|
||||
}
|
||||
}#end mini_quest
|
||||
|
||||
|
@ -1990,7 +1990,7 @@ sub bikes_available(){
|
|||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$tariff_content->{$tid}->{int36} € / $time_unit"];
|
||||
}elsif($td_template->{$td}->{int17} && $tariff_content->{$tid}->{int17} && $tariff_content->{$tid}->{int17} > 0){
|
||||
$tariff_content->{$tid}->{int17} =~ s/\./,/ if($lang eq "de");
|
||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / 24 Std"];
|
||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||
|
|
|
@ -278,7 +278,7 @@ sub sig_available {
|
|||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$tariff_content->{$tid}->{int36} € / $time_unit"];
|
||||
}elsif($td_template->{$td}->{int17} && $tariff_content->{$tid}->{int17} && $tariff_content->{$tid}->{int17} > 0){
|
||||
$tariff_content->{$tid}->{int17} =~ s/\./,/ if($lang eq "de");
|
||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / Tag"];
|
||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / 24 Std"];
|
||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
||||
|
|
|
@ -75,10 +75,13 @@ print<<EOF
|
|||
</script>
|
||||
EOF
|
||||
;
|
||||
print $q->div({-id=>'retm'},"$feedb->{message} $debug"),"\n" if($feedb->{message} && $feedb->{message} =~ /[a-z]/ && $feedb->{message} !~ /failure::/);
|
||||
if($feedb->{message} && $feedb->{message} =~ /[a-z]/ && $feedb->{message} !~ /failure::/){
|
||||
print $q->div({-id=>'retm'},"$feedb->{message} $debug"),"\n";
|
||||
}else{
|
||||
print $q->div({-id=>'retm'},"$node_meta->{node_name} angelegt $debug"),"\n" if($feedb->{i_rows});
|
||||
print $q->div({-id=>'retm'},"$node_meta->{node_name} aktualisiert $debug"),"\n" if($feedb->{u_rows});
|
||||
print $q->div({-id=>'retm'},"$node_meta->{node_name} gelöscht $debug"),"\n" if($feedb->{d_rows});
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -672,7 +672,7 @@ sub collect_post(){
|
|||
$sql = "SELECT cp.*, ct.state FROM $fetch->{table_pos} cp, $fetch->{table} ct WHERE $cp_where and cp.ct_id=ct.c_id and $ct_where order by cp.mtime ASC";#mtime aufsteigend get last (newest) entry
|
||||
$sth = $dbh->prepare($sql);
|
||||
}
|
||||
#$bw->log("DBtank collect_post ",$sql,"") if($debug);
|
||||
$bw->log("DBtank collect_post ",$sql,"") if($debug);
|
||||
my $rc = $sth->execute();
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
|
|
|
@ -82,6 +82,7 @@ sub mail_transport(){
|
|||
|
||||
if($dbt->{copri_conf}->{stage} ne "live"){
|
||||
$mail_to = $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
||||
#$mail_to = 'admin2@sharee.bike';
|
||||
$subject = "* offline Test * " . $sendref->{subject};
|
||||
}
|
||||
|
||||
|
@ -104,16 +105,14 @@ sub mail_transport(){
|
|||
$smtp->data();
|
||||
$smtp->datasend("To: $mail_to\n");
|
||||
$smtp->datasend("Subject: $subject\n");
|
||||
$smtp->datasend("MIME-Version: 1.0\n");
|
||||
$smtp->datasend("Content-type: multipart/mixed;\n\tboundary=\"$boundary\"\n");
|
||||
$smtp->datasend("\n");
|
||||
$smtp->datasend("\n") if(!$attachBinaryFile);
|
||||
$smtp->datasend("MIME-Version: 1.0\n");
|
||||
$smtp->datasend("Content-type: multipart/mixed;\n\tboundary=\"$boundary\"\n");
|
||||
$smtp->datasend("\n");
|
||||
|
||||
$smtp->datasend("--$boundary\n");
|
||||
#$smtp->datasend("Content-type: text/plain\n");
|
||||
#$smtp->datasend("\nToday\'s files are attached:\n\nHave a nice day! :)\n");
|
||||
|
||||
$smtp->datasend("Content-Type: text/html; charset=UTF-8 \n\n");
|
||||
$smtp->datasend($html);
|
||||
$smtp->datasend("--$boundary\n");
|
||||
$smtp->datasend("Content-Type: text/html; charset=UTF-8 \n\n");
|
||||
$smtp->datasend("$html\n\n\n\n\n\n\n\n\n\n");
|
||||
$smtp->datasend("\n");
|
||||
|
||||
if($attachBinaryFile){
|
||||
|
@ -134,12 +133,11 @@ sub mail_transport(){
|
|||
}
|
||||
$smtp->datasend("\n");
|
||||
close(DAT);
|
||||
$smtp->datasend("--$boundary\r\n\r");
|
||||
}
|
||||
|
||||
$smtp->datasend("--$boundary\r\n\r");
|
||||
$smtp->dataend();
|
||||
$smtp->quit;
|
||||
} else {
|
||||
print EMA $smtp->message();
|
||||
}
|
||||
|
||||
|
|
|
@ -535,6 +535,7 @@ sub save_contenttranspos {
|
|||
$end_time = $dt1->strftime("%Y-%m-%d %H:%M:%S");
|
||||
}
|
||||
|
||||
$bw->log("save_contenttranspos time-check: $c_id && $start_time && $end_time",$c_id,"");
|
||||
if($c_id && $start_time && $end_time && $dt0 < $dtnow && $dt1 < $dtnow){
|
||||
|
||||
my $pref = {
|
||||
|
@ -618,6 +619,7 @@ sub save_contenttranspos {
|
|||
$ctpos2ck = $dbt->collect_post($dbh,$pref2ck);
|
||||
|
||||
#update bike content only if there is no later rental start
|
||||
$bw->log("update bike content only if there is no later rental start: $ctpos->{cc_id} && !$ctpos2ck->{c_id}",$c_id,"");
|
||||
if($ctpos->{cc_id} && !$ctpos2ck->{c_id}){
|
||||
my $ctpref = {
|
||||
table => "content",
|
||||
|
@ -658,6 +660,8 @@ sub save_contenttranspos {
|
|||
$feedb->{message} = "failure::Fehler, Änderung abgelehnt da Rechnung bereits gebucht";
|
||||
}
|
||||
|
||||
}else{
|
||||
$bw->log("save_contenttranspos time-check fails by: $c_id && $start_time && $end_time",$c_id,"");
|
||||
}
|
||||
}elsif($R::int02 && $R::int03){
|
||||
$R::int02 =~ s/,/\./ if($R::int02 =~ /\,/);
|
||||
|
|
|
@ -394,7 +394,7 @@ sub fetch_rentalfeed {
|
|||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$ctpos->{int36} € / $time_unit"];
|
||||
}elsif($td_template->{$td}->{int17} && $ctpos->{int17} && $ctpos->{int17} > 0){
|
||||
$ctpos->{int17} =~ s/\./,/ if($lang eq "de");
|
||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / Tag"];
|
||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / 24 Std"];
|
||||
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||
$time_unit = $dbt->time_format($ctpos->{time02});
|
||||
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||
|
|
|
@ -85,7 +85,12 @@ sub sms_ack_digest {
|
|||
|
||||
print FILE "---> request:\n" . Dumper($request);
|
||||
|
||||
my $ret_json = $self->get_sms_gtx($request);
|
||||
my $ret_json = "";
|
||||
if($sms_to =~ /^\+1/){
|
||||
#no routing fix
|
||||
$dbt->update_one($dbh,$ctadr,"int13=1");
|
||||
}else{
|
||||
$ret_json = $self->get_sms_gtx($request);
|
||||
|
||||
eval {
|
||||
$response_in = decode_json($ret_json);
|
||||
|
@ -95,6 +100,7 @@ sub sms_ack_digest {
|
|||
print FILE "<--- failure raw response_in:\n" . Dumper($ret_json) . "\n";
|
||||
warn $@;
|
||||
}
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
|
||||
|
|
|
@ -564,11 +564,11 @@ EOF
|
|||
my $opos = "";
|
||||
$opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0);
|
||||
if($ctt->{int16} && $ctt->{int16} > 0){
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € gebucht per \"$ctt->{state}\", Payone Saldo $ctt->{int16} € vom $vibuchen_mtime "),"\n";
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € gebucht per \"$ctt->{state}\" | Payone Saldo $ctt->{int16} € | $vibuchen_mtime "),"\n";
|
||||
}else{
|
||||
my $fibutext = "";
|
||||
$fibutext = "<span style='color:silver;'>(Fibu Gebühr $ctt->{int08})</span>" if($ctt->{int08});
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € $fibutext gebucht per \"$ctt->{state}\" am $vibuchen_mtime "),"\n";
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> Summe $ctt->{int01} € $fibutext gebucht per \"$ctt->{state}\" | $vibuchen_mtime "),"\n";
|
||||
}
|
||||
}else{
|
||||
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:silver;'>Summe ist nicht gebucht!</span>"),"\n";
|
||||
|
|
|
@ -372,8 +372,11 @@ sub prepare_content {
|
|||
# $app_name =~ s/$app_name/$merchant->{app_name}/ if($merchant->{app_name} && $ctadr->{int15} && $ctadr->{int15} == $merchant->{id});
|
||||
#}
|
||||
$app_name = $dbt->{operator}->{$varenv{dbname}}->{app_name};
|
||||
my $invoice_name = "$ctt->{txt00}-$varenv{dbname}-$ctt->{ct_name}.pdf";
|
||||
$sendref->{attachment} = "$invoice_name";
|
||||
my $invoice_name = "";
|
||||
if(ref($ctt) eq "HASH" && $ctt->{ct_name}){
|
||||
$invoice_name = "$ctt->{txt00}-$varenv{dbname}-$ctt->{ct_name}.pdf";
|
||||
$sendref->{attachment} = "$invoice_name";
|
||||
}
|
||||
|
||||
my $subject = "TeilRad Mietradsystem";#default
|
||||
$subject = $1 if($cms_prim =~ /--subject--(.*)--subject--/);
|
||||
|
@ -403,7 +406,7 @@ EOF
|
|||
$sendref->{message} = $cms_prim;
|
||||
$sendref->{message} =~ s/::user_name::/$ctadr->{txt01}/;
|
||||
$sendref->{message} =~ s/::app_name::/$app_name/g;
|
||||
$sendref->{message} =~ s/::invoice_name::/$invoice_name/;
|
||||
$sendref->{message} =~ s/::invoice_name::/$invoice_name/ if($invoice_name);
|
||||
$sendref->{message} =~ s/::txid::/$ctt->{txt16}/;
|
||||
$sendref->{message} =~ s/::email_temppassword::/\<b\>$ctadr->{txt04}\<\/b\>/g;
|
||||
$sendref->{message} =~ s/::email_ack_digest::/\<b\>$ctadr->{txt34}\<\/b\>/g;#send_emailack
|
||||
|
|
|
@ -347,7 +347,7 @@ sub tplselect(){
|
|||
if(($R::ct_trans !~ /close/) && ($ct_table =~ /contenttrans/) && ($R::ct_trans || $R::trans2edit || $R::ctpos_activ || $R::select_part || $R::set_main_id)){
|
||||
&Modalbox::mobox($node_meta,$users_dms,$return);
|
||||
}elsif(($R::ct_trans !~ /close/) && ($ct_table =~ /content$|contentadr|contentuser|contentpos|users$|contenttranspos/ && ($R::ct_trans || $R::rel_edit || $R::base_edit)) || ($R::node2edit && $R::node2edit =~ /edit/)){
|
||||
&Modalbox3::mobox3($node_meta,$users_dms,$feedb,$return,$mode) if($R::rel_edit !~ /delete|save/ && $R::ct_trans !~ /delete/ && $R::base_edit !~ /delete/ && !$R::service_id);
|
||||
&Modalbox3::mobox3($node_meta,$users_dms,$feedb,$return,$mode) if($R::rel_edit !~ /delete|save/ && $R::ct_trans !~ /delete/ && $R::base_edit !~ /delete|save_pos/ && !$R::service_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue