mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
CMS-Text for App infos and units. mailx with bcc
This commit is contained in:
parent
de824a241a
commit
3c52345c5e
10 changed files with 135 additions and 41 deletions
|
@ -1897,7 +1897,7 @@ sub bikes_available(){
|
||||||
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_node) eq "ARRAY" && @{$bike_node}[0]);
|
$record = $dbt->fetch_record($dbh,$pref) if(ref($bike_node) eq "ARRAY" && @{$bike_node}[0]);
|
||||||
my $op_return = {};
|
my $op_return = {};
|
||||||
|
|
||||||
my $td_template = $dbt->rental_description_template();
|
my $td_template = $dbt->rental_description_template($varenv);
|
||||||
|
|
||||||
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
|
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
|
||||||
$return->{$id}->{authed} = "$authed";
|
$return->{$id}->{authed} = "$authed";
|
||||||
|
@ -1973,8 +1973,8 @@ sub bikes_available(){
|
||||||
$return->{$id}->{rental_description}->{tarif_type} = "$adrtarif_hash->{$tariff_content->{$tid}->{barcode}}";
|
$return->{$id}->{rental_description}->{tarif_type} = "$adrtarif_hash->{$tariff_content->{$tid}->{barcode}}";
|
||||||
$return->{$id}->{rental_description}->{reserve_timerange} = "15";
|
$return->{$id}->{rental_description}->{reserve_timerange} = "15";
|
||||||
$return->{$id}->{rental_description}->{reserve_timerange} = "30" if($record->{$id}->{int11} == 3);#sig timeout time
|
$return->{$id}->{rental_description}->{reserve_timerange} = "30" if($record->{$id}->{int11} == 3);#sig timeout time
|
||||||
$return->{$id}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"] if($record->{$id}->{int25});
|
$return->{$id}->{rental_description}->{rental_info}->{1} = ["Tracking","$varenv->{cms}->{'info-tracking-degree'}->{txt}"] if($record->{$id}->{int25});
|
||||||
$return->{$id}->{rental_description}->{rental_info}->{2} = ["AAFahrten","Dieses E-Lastenrad darf nur an der Station zurück gegeben werden an der es ausgeliehen wurde!"] if($record_st->{$record->{$id}->{int04}}->{int42});
|
$return->{$id}->{rental_description}->{rental_info}->{2} = ["AAFahrten","$varenv->{cms}->{'info-aa-ride'}->{txt}"] if($record_st->{$record->{$id}->{int04}}->{int42});
|
||||||
#$return->{$id}->{rental_description}->{rental_info}->{3} = ["Lowcharge","Die Akkukapazität war zuletzt niedrig. Bitte überprüfen sie vor der Fahrt die Ladung am Fahrraddisplay. Die Miete kann innerhalb 5 Minuten kostenlos abgebrochen werden."] if($record->{$id}->{energy_id} && (!$record->{$id}->{int19} || $record->{$id}->{int19} < 20));
|
#$return->{$id}->{rental_description}->{rental_info}->{3} = ["Lowcharge","Die Akkukapazität war zuletzt niedrig. Bitte überprüfen sie vor der Fahrt die Ladung am Fahrraddisplay. Die Miete kann innerhalb 5 Minuten kostenlos abgebrochen werden."] if($record->{$id}->{energy_id} && (!$record->{$id}->{int19} || $record->{$id}->{int19} < 20));
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
|
@ -1983,18 +1983,18 @@ sub bikes_available(){
|
||||||
|
|
||||||
if($td_template->{$td}->{int35} && $tariff_content->{$tid}->{int35} && $tariff_content->{$tid}->{int35} > 0){
|
if($td_template->{$td}->{int35} && $tariff_content->{$tid}->{int35} && $tariff_content->{$tid}->{int35} > 0){
|
||||||
$tariff_content->{$tid}->{int35} =~ s/\./,/ if($lang eq "de");
|
$tariff_content->{$tid}->{int35} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time01});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time01});
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$tariff_content->{$tid}->{int35} € / $time_unit"];
|
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$tariff_content->{$tid}->{int35} € / $time_unit"];
|
||||||
}elsif($td_template->{$td}->{int36} && $tariff_content->{$tid}->{int36} && $tariff_content->{$tid}->{int36} > 0){
|
}elsif($td_template->{$td}->{int36} && $tariff_content->{$tid}->{int36} && $tariff_content->{$tid}->{int36} > 0){
|
||||||
$tariff_content->{$tid}->{int36} =~ s/\./,/ if($lang eq "de");
|
$tariff_content->{$tid}->{int36} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time01});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time01});
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$tariff_content->{$tid}->{int36} € / $time_unit"];
|
$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){
|
}elsif($td_template->{$td}->{int17} && $tariff_content->{$tid}->{int17} && $tariff_content->{$tid}->{int17} > 0){
|
||||||
$tariff_content->{$tid}->{int17} =~ s/\./,/ if($lang eq "de");
|
$tariff_content->{$tid}->{int17} =~ s/\./,/ if($lang eq "de");
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / 24 Std"];
|
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / 24 $varenv->{cms}->{'unit-hour'}->{txt}"];
|
||||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time02});
|
||||||
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
$time_unit .= " / $varenv->{cms}->{'unit-day'}->{txt}" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||||
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
$return->{$id}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||||
}
|
}
|
||||||
}#end new rental_description
|
}#end new rental_description
|
||||||
|
|
|
@ -84,7 +84,7 @@ sub sig_available {
|
||||||
c_id => "1",
|
c_id => "1",
|
||||||
};
|
};
|
||||||
my $hotline_data = $dbt->fetch_record($dbh,$hotline_hash);
|
my $hotline_data = $dbt->fetch_record($dbh,$hotline_hash);
|
||||||
my $td_template = $dbt->rental_description_template();
|
my $td_template = $dbt->rental_description_template($varenv);
|
||||||
|
|
||||||
open(FILE,">>$varenv->{logdir}/APIsigclient.log");
|
open(FILE,">>$varenv->{logdir}/APIsigclient.log");
|
||||||
print FILE "\n0. *** $now_dt 'sig_available' ctadr: $ctadr->{c_id}\n";
|
print FILE "\n0. *** $now_dt 'sig_available' ctadr: $ctadr->{c_id}\n";
|
||||||
|
@ -262,26 +262,26 @@ sub sig_available {
|
||||||
$response_out->{$bike}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
$response_out->{$bike}->{rental_description}->{name} = "$tariff_content->{$tid}->{ct_name}";
|
||||||
$response_out->{$bike}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
$response_out->{$bike}->{rental_description}->{id} = "$tariff_content->{$tid}->{barcode}";
|
||||||
$response_out->{$bike}->{rental_description}->{reserve_timerange} = "30";
|
$response_out->{$bike}->{rental_description}->{reserve_timerange} = "30";
|
||||||
$response_out->{$bike}->{rental_description}->{rental_info}->{1} = ["Tracking","Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"];# if($resp->{gps_tracker_id});
|
$response_out->{$bike}->{rental_description}->{rental_info}->{1} = ["$varenv->{cms}->{'info-tracking-degree'}->{txt}"];# if($resp->{gps_tracker_id});
|
||||||
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AAFahrten","Dieses E-Lastenrad darf nur an der Station zurück gegeben werden an der es ausgeliehen wurde!"] if($resp->{site}->{address} && $resp->{site}->{address} !~ /Passau/i);
|
$response_out->{$bike}->{rental_description}->{rental_info}->{2} = ["AAFahrten","$varenv->{cms}->{'info-aa-ride'}->{txt}"] if($resp->{site}->{address} && $resp->{site}->{address} !~ /Passau/i);
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
foreach my $td (sort keys (%$td_template)){
|
foreach my $td (sort keys (%$td_template)){
|
||||||
my $time_unit = "";
|
my $time_unit = "";
|
||||||
if($td_template->{$td}->{int35} && $tariff_content->{$tid}->{int35} && $tariff_content->{$tid}->{int35} > 0){
|
if($td_template->{$td}->{int35} && $tariff_content->{$tid}->{int35} && $tariff_content->{$tid}->{int35} > 0){
|
||||||
$tariff_content->{$tid}->{int35} =~ s/\./,/ if($lang eq "de");
|
$tariff_content->{$tid}->{int35} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time01});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time01});
|
||||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$tariff_content->{$tid}->{int35} € / $time_unit"];
|
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$tariff_content->{$tid}->{int35} € / $time_unit"];
|
||||||
}elsif($td_template->{$td}->{int36} && $tariff_content->{$tid}->{int36} && $tariff_content->{$tid}->{int36} > 0){
|
}elsif($td_template->{$td}->{int36} && $tariff_content->{$tid}->{int36} && $tariff_content->{$tid}->{int36} > 0){
|
||||||
$tariff_content->{$tid}->{int36} =~ s/\./,/ if($lang eq "de");
|
$tariff_content->{$tid}->{int36} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time01});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time01});
|
||||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$tariff_content->{$tid}->{int36} € / $time_unit"];
|
$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){
|
}elsif($td_template->{$td}->{int17} && $tariff_content->{$tid}->{int17} && $tariff_content->{$tid}->{int17} > 0){
|
||||||
$tariff_content->{$tid}->{int17} =~ s/\./,/ if($lang eq "de");
|
$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} € / 24 Std"];
|
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$tariff_content->{$tid}->{int17} € / 24 $varenv->{cms}->{'unit-hour'}->{txt}"];
|
||||||
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $tariff_content->{$tid}->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($tariff_content->{$tid}->{time02});
|
$time_unit = $dbt->time_format($varenv,$tariff_content->{$tid}->{time02});
|
||||||
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / Tag"];
|
$response_out->{$bike}->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit / $varenv->{cms}->{'unit-day'}->{txt}"];
|
||||||
}
|
}
|
||||||
}#end new rental_description
|
}#end new rental_description
|
||||||
|
|
||||||
|
|
|
@ -1328,30 +1328,32 @@ sub get_freetpl(){
|
||||||
|
|
||||||
sub rental_description_template {
|
sub rental_description_template {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $varenv = shift;
|
||||||
my $tpl_order = {
|
my $tpl_order = {
|
||||||
1 => {int35 => "Mietgebühr"},#unit_price1
|
1 => {int35 => "$varenv->{cms}->{'tarif-rental-fee'}->{txt}"},#unit_price1
|
||||||
2 => {int36 => "ab 2. Tag"},#unit_price2
|
2 => {int36 => "$varenv->{cms}->{'tarif-rental-fee-from-second-day'}->{txt}"},#unit_price2
|
||||||
#3 => {int37 => "Grundgebühr"},#startup_price
|
#3 => {int37 => "Grundgebühr"},#startup_price
|
||||||
4 => {int17 => "Max. Gebühr"},#max_fee/day
|
4 => {int17 => "$varenv->{cms}->{'tarif-max-fee'}->{txt}"},#max_fee/day
|
||||||
5 => {time01 => "Zeiteinheit"},#unit_time
|
5 => {time01 => "$varenv->{cms}->{'tarif-time-unit'}->{txt}"},#unit_time
|
||||||
6 => {time02 => "Gratis Mietzeit"},#free_time
|
6 => {time02 => "$varenv->{cms}->{'tarif-rental-free-time'}->{txt}"},#free_time
|
||||||
7 => {xduration => "Aktuelle Mietzeit"},
|
7 => {xduration => "$varenv->{cms}->{'tarif-current-rental-period'}->{txt}"},
|
||||||
8 => {xprice => "Aktuelle Mietkosten"},
|
8 => {xprice => "$varenv->{cms}->{'tarif-current-rental-cost'}->{txt}"},
|
||||||
};
|
};
|
||||||
return $tpl_order;
|
return $tpl_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub time_format {
|
sub time_format {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my $varenv = shift;
|
||||||
my $time = shift;
|
my $time = shift;
|
||||||
my $time_unit = "";
|
my $time_unit = "";
|
||||||
my $day = "";
|
my $day = "";
|
||||||
if($time =~ /(\d+) day/){
|
if($time =~ /(\d+) day/){
|
||||||
$day = $1;
|
$day = $1;
|
||||||
if($1 > 0 && $1 <= 1){
|
if($1 > 0 && $1 <= 1){
|
||||||
$day .= " Tag ";
|
$day .= " $varenv->{cms}->{'unit-day'}->{txt} ";
|
||||||
}else{
|
}else{
|
||||||
$day .= " Tage ";
|
$day .= " $varenv->{cms}->{'unit-days'}->{txt} ";
|
||||||
}
|
}
|
||||||
$time_unit .= $day;
|
$time_unit .= $day;
|
||||||
$time =~ s/\d+ day //;
|
$time =~ s/\d+ day //;
|
||||||
|
@ -1359,8 +1361,8 @@ sub time_format {
|
||||||
my ($std,$min,$sec) = split(/:/,$time);
|
my ($std,$min,$sec) = split(/:/,$time);
|
||||||
$std =~ s/^0//;
|
$std =~ s/^0//;
|
||||||
$min =~ s/^0//;
|
$min =~ s/^0//;
|
||||||
$time_unit .= "$std Std " if($std > 0);
|
$time_unit .= "$std $varenv->{cms}->{'unit-hour'}->{txt} " if($std > 0);
|
||||||
$time_unit .= "$min Min " if($min > 0);
|
$time_unit .= "$min $varenv->{cms}->{'unit-minute'}->{txt} " if($min > 0);
|
||||||
return $time_unit;
|
return $time_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ sub handler {
|
||||||
my $netloc = $q->url(-base=>1);
|
my $netloc = $q->url(-base=>1);
|
||||||
my $dbh = "";
|
my $dbh = "";
|
||||||
my $script = $q->script_name();
|
my $script = $q->script_name();
|
||||||
|
my $referer = $q->referer();
|
||||||
my $path = $q->path_info();
|
my $path = $q->path_info();
|
||||||
$path = "$script" . "$path";
|
$path = "$script" . "$path";
|
||||||
$path =~ s/\.html//;
|
$path =~ s/\.html//;
|
||||||
|
@ -716,7 +717,7 @@ sub handler {
|
||||||
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=2$session_and\&$returnwww");
|
print redirect("$varenv{wwwhost}/$varenv{mandant}/Account/$varenv{accounting_3}?cum=2$session_and\&$returnwww");
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
}elsif($path =~ /$varenv{mandant}\/$varenv{profile}/){
|
}elsif($path =~ /$varenv{mandant}\/$varenv{profile}/ && $referer !~ /failure=\w/){
|
||||||
if((!$users_sharee->{int14}) || ($users_sharee->{txt31} && $tpl->{tpl_order} =~ /$users_sharee->{txt31}/)){
|
if((!$users_sharee->{int14}) || ($users_sharee->{txt31} && $tpl->{tpl_order} =~ /$users_sharee->{txt31}/)){
|
||||||
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;
|
||||||
|
|
|
@ -67,6 +67,7 @@ sub mail_transport(){
|
||||||
|
|
||||||
my $mail_from = $sendref->{mail_from} || $mailxconf->{$sendref->{mailxcfg}}->{mail_from};
|
my $mail_from = $sendref->{mail_from} || $mailxconf->{$sendref->{mailxcfg}}->{mail_from};
|
||||||
my $mail_to = $sendref->{mail_to} || $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
my $mail_to = $sendref->{mail_to} || $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
||||||
|
my $mail_bcc = $sendref->{mail_bcc} || $mailxconf->{$sendref->{mailxcfg}}->{mail_bcc} || "";
|
||||||
my $subject = $sendref->{subject};
|
my $subject = $sendref->{subject};
|
||||||
|
|
||||||
my ($buf, $picture);
|
my ($buf, $picture);
|
||||||
|
@ -82,10 +83,16 @@ sub mail_transport(){
|
||||||
|
|
||||||
if($dbt->{copri_conf}->{stage} ne "live"){
|
if($dbt->{copri_conf}->{stage} ne "live"){
|
||||||
$mail_to = $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
$mail_to = $mailxconf->{$sendref->{mailxcfg}}->{mail_to};
|
||||||
#$mail_to = 'admin2@sharee.bike';
|
|
||||||
$subject = "* offline Test * " . $sendref->{subject};
|
$subject = "* offline Test * " . $sendref->{subject};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#TODO procmail
|
||||||
|
#Should not used for now by standard invoicing. We will set it only by Zahlungserinnerung/Mahnung.
|
||||||
|
#Keep in mind, copri mailing will be done by cron or manually by fibu-user
|
||||||
|
my $sharee_ticket = "";
|
||||||
|
$sharee_ticket = " [SID " . $1 . "]" if($sendref->{attachment} =~ /([a-z0-9]+\-\d+)\./ && $mail_bcc);
|
||||||
|
$subject .= $sharee_ticket if($sharee_ticket);
|
||||||
|
|
||||||
print EMA "\n$now_dt, start mailing to: $mail_to | subject: $subject\n";
|
print EMA "\n$now_dt, start mailing to: $mail_to | subject: $subject\n";
|
||||||
print EMA "attachment: $pdfpath/$sendref->{attachment} | filesize: $filesize\n";
|
print EMA "attachment: $pdfpath/$sendref->{attachment} | filesize: $filesize\n";
|
||||||
|
|
||||||
|
@ -102,8 +109,12 @@ sub mail_transport(){
|
||||||
|
|
||||||
|
|
||||||
if ($smtp->to($mail_to)) {
|
if ($smtp->to($mail_to)) {
|
||||||
|
$smtp->mail("shareemail");
|
||||||
|
$smtp->to($mail_to);
|
||||||
|
$smtp->bcc($mail_bcc) if($mail_bcc);
|
||||||
$smtp->data();
|
$smtp->data();
|
||||||
$smtp->datasend("To: $mail_to\n");
|
$smtp->datasend("To: $mail_to\n");
|
||||||
|
$smtp->datasend("Bcc: $mail_bcc\n") if($mail_bcc);
|
||||||
$smtp->datasend("Subject: $subject\n");
|
$smtp->datasend("Subject: $subject\n");
|
||||||
$smtp->datasend("\n") if(!$attachBinaryFile);
|
$smtp->datasend("\n") if(!$attachBinaryFile);
|
||||||
$smtp->datasend("MIME-Version: 1.0\n");
|
$smtp->datasend("MIME-Version: 1.0\n");
|
||||||
|
|
|
@ -319,7 +319,7 @@ sub fetch_rentalfeed {
|
||||||
my $returned_counting = shift || {};
|
my $returned_counting = shift || {};
|
||||||
my $lang = "de";
|
my $lang = "de";
|
||||||
|
|
||||||
my $td_template = $dbt->rental_description_template();
|
my $td_template = $dbt->rental_description_template($varenv);
|
||||||
my $bike_group = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int29}" || "";
|
my $bike_group = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$ctpos->{int29}" || "";
|
||||||
|
|
||||||
my $return = {};
|
my $return = {};
|
||||||
|
@ -376,7 +376,7 @@ sub fetch_rentalfeed {
|
||||||
|
|
||||||
$return->{aa_ride} = "0";
|
$return->{aa_ride} = "0";
|
||||||
if($ctpos->{int42}){
|
if($ctpos->{int42}){
|
||||||
$return->{rental_description}->{rental_info}->{2} = ["AAFahrten","Dieses E-Lastenrad darf nur an der Station zurück gegeben werden an der es ausgeliehen wurde!"];
|
$return->{rental_description}->{rental_info}->{2} = ["AAFahrten","$varenv->{cms}->{'info-aa-ride'}->{txt}"];
|
||||||
$return->{aa_ride} = "1";
|
$return->{aa_ride} = "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,21 +384,21 @@ sub fetch_rentalfeed {
|
||||||
my $time_unit = "";
|
my $time_unit = "";
|
||||||
if($td_template->{$td}->{int35} && $ctpos->{int35} && $ctpos->{int35} > 0){
|
if($td_template->{$td}->{int35} && $ctpos->{int35} && $ctpos->{int35} > 0){
|
||||||
$ctpos->{int35} =~ s/\./,/ if($lang eq "de");
|
$ctpos->{int35} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($ctpos->{time01});
|
$time_unit = $dbt->time_format($varenv,$ctpos->{time01});
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$ctpos->{int35} € / $time_unit"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int35}","$ctpos->{int35} € / $time_unit"];
|
||||||
}elsif($td_template->{$td}->{int36} && $ctpos->{int36} && $ctpos->{int36} > 0){
|
}elsif($td_template->{$td}->{int36} && $ctpos->{int36} && $ctpos->{int36} > 0){
|
||||||
$ctpos->{int36} =~ s/\./,/ if($lang eq "de");
|
$ctpos->{int36} =~ s/\./,/ if($lang eq "de");
|
||||||
$time_unit = $dbt->time_format($ctpos->{time01});
|
$time_unit = $dbt->time_format($varenv,$ctpos->{time01});
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$ctpos->{int36} € / $time_unit"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int36}", "$ctpos->{int36} € / $time_unit"];
|
||||||
}elsif($td_template->{$td}->{int17} && $ctpos->{int17} && $ctpos->{int17} > 0){
|
}elsif($td_template->{$td}->{int17} && $ctpos->{int17} && $ctpos->{int17} > 0){
|
||||||
$ctpos->{int17} =~ s/\./,/ if($lang eq "de");
|
$ctpos->{int17} =~ s/\./,/ if($lang eq "de");
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / 24 Std"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{int17}","$ctpos->{int17} € / 24 $varenv->{cms}->{'unit-hour'}->{txt}"];
|
||||||
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{time02} && $ctpos->{time02} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($ctpos->{time02});
|
$time_unit = $dbt->time_format($varenv,$ctpos->{time02});
|
||||||
$time_unit .= " / Tag" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
$time_unit .= " / $varenv->{cms}->{'unit-day'}->{txt}" if($dbt->{operator}->{$varenv->{dbname}}->{project} ne "Konstanz");
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{time02}","$time_unit"];
|
||||||
}elsif($td_template->{$td}->{xduration} && $returned_counting->{real_clock} && $returned_counting->{real_clock} =~ /[1-9]/){
|
}elsif($td_template->{$td}->{xduration} && $returned_counting->{real_clock} && $returned_counting->{real_clock} =~ /[1-9]/){
|
||||||
$time_unit = $dbt->time_format($returned_counting->{real_clock});
|
$time_unit = $dbt->time_format($varenv,$returned_counting->{real_clock});
|
||||||
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{xduration}","$time_unit"];
|
$return->{rental_description}->{tarif_elements}->{$td} = ["$td_template->{$td}->{xduration}","$time_unit"];
|
||||||
}elsif($td_template->{$td}->{xprice} && $returned_counting->{total_price} && $returned_counting->{total_price} > 0){
|
}elsif($td_template->{$td}->{xprice} && $returned_counting->{total_price} && $returned_counting->{total_price} > 0){
|
||||||
$returned_counting->{total_price} =~ s/\./,/ if($lang eq "de");
|
$returned_counting->{total_price} =~ s/\./,/ if($lang eq "de");
|
||||||
|
|
|
@ -642,6 +642,19 @@ EOF
|
||||||
print $q->end_form;
|
print $q->end_form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#TODO
|
||||||
|
if(1==2){
|
||||||
|
my $sharee_ticket = "";
|
||||||
|
my $subject = "";
|
||||||
|
if("$praefix-$ctt->{ct_name}" =~ /([a-z0-9]+\-\d+)/){
|
||||||
|
$sharee_ticket = " [SID " . $1 . "]";
|
||||||
|
$subject .= $sharee_ticket if($sharee_ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
print $q->div({-style=>"padding:0.5em;font-size:0.91em;width:98%;text-align:left;"}, "eMail subject: $subject"),"\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if( -f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf"){
|
if( -f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf"){
|
||||||
print $q->div({-style=>'padding:0.5em;font-size:0.91em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, "$praefix-$ctt->{ct_name}.pdf")),"\n";
|
print $q->div({-style=>'padding:0.5em;font-size:0.91em;width:98%;text-align:right;'}, "Download: ", $q->a({-href=>"$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf&sessionid=$coo", -target=>"_blank" , -type=>'application/octet-stream', -style=>'text-decoration:underline;'}, "$praefix-$ctt->{ct_name}.pdf")),"\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,9 @@ my $sendref = {
|
||||||
mailxcfg => "mailx_default",
|
mailxcfg => "mailx_default",
|
||||||
#mailxcfg => "mailx_admin",#just for tests
|
#mailxcfg => "mailx_admin",#just for tests
|
||||||
syshost => "$syshost",
|
syshost => "$syshost",
|
||||||
|
mail_from => "",
|
||||||
mail_to => "",
|
mail_to => "",
|
||||||
|
mail_bcc => "",
|
||||||
c_id => 0,
|
c_id => 0,
|
||||||
subject => "",
|
subject => "",
|
||||||
message => "",
|
message => "",
|
||||||
|
@ -77,10 +79,16 @@ if(looks_like_number($adr_id)){
|
||||||
|
|
||||||
#send_invoice
|
#send_invoice
|
||||||
if($todo eq "send_invoice" && looks_like_number($ct_id)){
|
if($todo eq "send_invoice" && looks_like_number($ct_id)){
|
||||||
$sendref->{mailxcfg} = "mailx_rechnung";
|
$sendref->{mailxcfg} = "mailx_invoice";
|
||||||
$sendmail = send_invoice($todo,$sendref,$ctadr,$ct_id);
|
$sendmail = send_invoice($todo,$sendref,$ctadr,$ct_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#send_warninginvoice
|
||||||
|
if($todo eq "send_warninginvoice" && looks_like_number($ct_id)){
|
||||||
|
$sendref->{mailxcfg} = "mailx_invoice_bcc";
|
||||||
|
$sendmail = send_warninginvoice($todo,$sendref,$ctadr,$ct_id);
|
||||||
|
}
|
||||||
|
|
||||||
#send_emailack
|
#send_emailack
|
||||||
if($todo eq "send_emailack"){
|
if($todo eq "send_emailack"){
|
||||||
$sendmail = send_emailack($todo,$sendref,$ctadr);
|
$sendmail = send_emailack($todo,$sendref,$ctadr);
|
||||||
|
@ -175,6 +183,47 @@ sub send_invoice {
|
||||||
return $sendref;
|
return $sendref;
|
||||||
}#end send_invoice
|
}#end send_invoice
|
||||||
|
|
||||||
|
#TODO with CMS-Text selection
|
||||||
|
#send_warninginvoice
|
||||||
|
sub send_warninginvoice {
|
||||||
|
my $todo = shift;
|
||||||
|
my $sendref = shift;
|
||||||
|
my $ctadr = shift;
|
||||||
|
my $ct_id = shift;
|
||||||
|
|
||||||
|
my $project = $dbt->{operator}->{$varenv{dbname}}->{project} || "";
|
||||||
|
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname},"iso-8859-1");
|
||||||
|
$varenv{cms} = $dbt->fetch_cms($dbh_primary,{ lang => $ctadr->{txt10} });
|
||||||
|
my $cms_message_key = "email-invoice";
|
||||||
|
|
||||||
|
my $dbh = $dbt->dbconnect_extern($dbt->{operator}->{$varenv{dbname}}->{database}->{dbname},"iso-8859-1");
|
||||||
|
my $pref_ctu = {
|
||||||
|
table => "contentuser",
|
||||||
|
fetch => "one",
|
||||||
|
c_id => "100002",
|
||||||
|
};
|
||||||
|
my $uadr = { c_id => 0 };
|
||||||
|
$uadr = $dbt->fetch_tablerecord($dbh,$pref_ctu);
|
||||||
|
|
||||||
|
my $fetchctt = {
|
||||||
|
table => "contenttrans",
|
||||||
|
fetch => "one",
|
||||||
|
c_id => "=::$ct_id",
|
||||||
|
};
|
||||||
|
my $ctt = { c_id => 0 };
|
||||||
|
$ctt = $dbt->fetch_tablerecord($dbh,$fetchctt);
|
||||||
|
|
||||||
|
$sendref = prepare_content($sendref,$ctadr,$uadr,$ctt,$varenv{cms}->{$cms_message_key}->{txt});
|
||||||
|
|
||||||
|
my $updatectt = {
|
||||||
|
table => "contenttrans",
|
||||||
|
c_id => "$ct_id",
|
||||||
|
};
|
||||||
|
#$dbt->update_one($dbh,$updatectt,"txt30='$now_dt, $ctt->{txt00} per eMail versandt'");
|
||||||
|
|
||||||
|
return $sendref;
|
||||||
|
}#end send_warninginvoice
|
||||||
|
|
||||||
|
|
||||||
#send_emailack
|
#send_emailack
|
||||||
sub send_emailack {
|
sub send_emailack {
|
||||||
|
@ -400,7 +449,7 @@ sub send_invoice_onwork {
|
||||||
table => "contenttrans",
|
table => "contenttrans",
|
||||||
fetch => "all",
|
fetch => "all",
|
||||||
keyfield => "c_id",
|
keyfield => "c_id",
|
||||||
txt22 => "in Arbeit",
|
txt22 => "IN::('in Arbeit','eMail gesendet')",
|
||||||
state => "is::null",
|
state => "is::null",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -422,7 +471,7 @@ sub send_invoice_onwork {
|
||||||
$sendref->{message} = <<EOF
|
$sendref->{message} = <<EOF
|
||||||
Hallo,
|
Hallo,
|
||||||
|
|
||||||
folgende ungebuchte Rechnungen sind "in Arbeit":
|
folgende ungebuchte Rechnungen haben den Status "in Arbeit" oder "eMail gesendet":
|
||||||
|
|
||||||
$ct_onwork
|
$ct_onwork
|
||||||
Nicht aus dem Blick verlieren.
|
Nicht aus dem Blick verlieren.
|
||||||
|
|
|
@ -147,7 +147,7 @@ if(1==1){
|
||||||
|
|
||||||
#sharee AGB
|
#sharee AGB
|
||||||
if(!$users_sharee->{int14}){
|
if(!$users_sharee->{int14}){
|
||||||
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$node1->{$id1}->{node_name}", -href=>"/$viewsel[0]/Account/$node1->{$id1}->{node_name}$session"}, "$node1->{$id1}->{node_name}")),"\n";
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$node1->{$id1}->{node_name}", -href=>"/$viewsel[0]/Account/$node1->{$id1}->{node_name}$session"}, $q->img({-src=>"$varenv->{metahost}/img/Account_Kundendaten.svg"}))),"\n";
|
||||||
}
|
}
|
||||||
elsif(!$users_sharee->{int03}){
|
elsif(!$users_sharee->{int03}){
|
||||||
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->img({-src=>"$varenv->{metahost}/img/Account_Kundendaten.svg"}))),"\n";
|
print $q->li($q->a({-style=>"$mstyle_1",-title=>"$varenv->{accounting_1}", -href=>"/$viewsel[0]/Account/$varenv->{accounting_1}$session"}, $q->img({-src=>"$varenv->{metahost}/img/Account_Kundendaten.svg"}))),"\n";
|
||||||
|
|
|
@ -1,10 +1,28 @@
|
||||||
#e-mail config
|
#e-mail config
|
||||||
<mailx_default>
|
<mailx_default>
|
||||||
mail_to = "admin@example.tld"
|
mail_to = "admin@example.tld"
|
||||||
|
mail_bcc = "";
|
||||||
mail_from = "post@example.tld"
|
mail_from = "post@example.tld"
|
||||||
mail_gateway = "smtp.mailxchanger.tld"
|
mail_gateway = "smtp.mailxchanger.tld"
|
||||||
sasl_username = "post@example.tld"
|
sasl_username = "post@example.tld"
|
||||||
sasl_password = "xxxxxxxxxxxxxxx"
|
sasl_password = "xxxxxxxxxxxxxxx"
|
||||||
</mailx_default>
|
</mailx_default>
|
||||||
|
|
||||||
|
<mailx_invoice>
|
||||||
|
mail_to = "invoice@example.tld"
|
||||||
|
mail_bcc = "";
|
||||||
|
mail_from = "post@example.tld"
|
||||||
|
mail_gateway = "smtp.mailxchanger.tld"
|
||||||
|
sasl_username = "post@example.tld"
|
||||||
|
sasl_password = "xxxxxxxxxxxxxxx"
|
||||||
|
</mailx_invoice>
|
||||||
|
|
||||||
|
<mailx_invoice_bcc>
|
||||||
|
mail_to = "invoice@example.tld"
|
||||||
|
mail_bcc = "invoice-bcc@example.tld"
|
||||||
|
mail_from = "post@example.tld"
|
||||||
|
mail_gateway = "smtp.mailxchanger.tld"
|
||||||
|
sasl_username = "post@example.tld"
|
||||||
|
sasl_password = "xxxxxxxxxxxxxxx"
|
||||||
|
</mailx_invoice_bcc>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue