some minor prepaid fixes

This commit is contained in:
ragu 2024-01-11 06:40:31 +01:00
parent 2dc53f4087
commit f731aa352b
12 changed files with 53 additions and 32 deletions

View file

@ -47,6 +47,7 @@ my $ct_id = $ARGV[3] || "";
my $temppw = $ARGV[4] || "";
my $cmstext_select = $ARGV[5] || "";
my $with_pdf = $ARGV[6] || "";
my $app_name = $ARGV[7] || "";
open(EMA, ">> $dbt->{copri_conf}->{logdir}/mailTransportcms.log");
print EMA "\n$now_dt, start mailTransportcms.pl syshost: $syshost, todo:$todo, adr_id:$adr_id, ct_id:$ct_id, temppw:$temppw, cmstext_select:$cmstext_select, with_pdf:$with_pdf\n";
@ -96,7 +97,7 @@ if(looks_like_number($adr_id)){
#send_payonelink
if($todo eq "send_payonelink"){
$sendmail = send_payonelink($todo,$sendref,$ctadr,$ct_id,$cmstext_select);
$sendmail = send_payonelink($todo,$sendref,$ctadr,$ct_id,$cmstext_select,$app_name);
}
#send_emailack
@ -231,6 +232,8 @@ sub send_payonelink {
my $ctadr = shift;
my $ctpos_id = shift;
my $cms_message_key = shift || "";
my $app_name = shift || "";
my $lang = $ctadr->{txt11} || $ctadr->{txt10};
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname},"iso-8859-1");
@ -253,13 +256,13 @@ sub send_payonelink {
my $record_pos = { c_id => 0 };
$record_pos = $dbt->fetch_tablerecord($dbh_primary,$pref_pos) if($ctpos_id);
$sendref = prepare_content($sendref,$ctadr,$uadr,$record_pos,$varenv{cms}->{$cms_message_key}->{txt});
$sendref = prepare_content($sendref,$ctadr,$uadr,$record_pos,$varenv{cms}->{$cms_message_key}->{txt},'',$app_name);
my $update_pos = {
table => "contenttranspos",
c_id => "$ctpos_id",
};
my $log_stamp = strftime "%d.%m.%Y %H:%M:%S", localtime;
my $log_stamp = strftime "%d.%m.%Y %H:%M", localtime;
my $mailing_log = $record_pos->{txt25} . "\n- $log_stamp mailing: $cms_message_key";
$dbt->update_one($dbh_primary,$update_pos,"txt25='$mailing_log'");
@ -571,9 +574,13 @@ sub prepare_content {
my $ctt = shift || {};
my $cms_prim = shift || "";
my $with_pdf = shift || "";
my $app_name = shift || "";
my $app_name = "Mietrad App";
$app_name = $dbt->{operator}->{$varenv{dbname}}->{app_name};
if(!$app_name && $dbt->{operator}->{$varenv{dbname}}->{app_name}){
$app_name = $dbt->{operator}->{$varenv{dbname}}->{app_name};
}else{
$app_name = "Mietrad App";
}
my $invoice_name = "";
my $invoice_nr = "";
my $total_sum = "";