mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-11 22:37:27 +02:00
copri Faktura ticket email integration. Table depended sort. Cleanup users table
This commit is contained in:
parent
1672564775
commit
e3d3713994
16 changed files with 219 additions and 238 deletions
|
@ -68,7 +68,7 @@ my $response = {
|
|||
apiserver => "$apiserver",
|
||||
response => "$respreq",
|
||||
uri_primary => "$dbt->{primary}->{sharee_primary}->{primaryApp}",
|
||||
copri_version => "4.1.23.15",
|
||||
copri_version => "4.1.23.16",
|
||||
user_id => "",
|
||||
authcookie => "",
|
||||
new_authcoo => "0",
|
||||
|
|
|
@ -31,7 +31,7 @@ sub ibuttons(){
|
|||
'barcode' => 'Barcode Label drucken',
|
||||
'buchen' => 'buchen',
|
||||
'send_invoice_again' => 'senden',
|
||||
'email_generate' => 'eMail generieren',
|
||||
'send_invoice_cms' => 'eMail senden',
|
||||
'new_contenttver' => 'Neues Arbeitsprofil',
|
||||
'new_content' => 'NEUER Datensatz',
|
||||
'new_contentcms' => 'NEUER Datensatz',
|
||||
|
|
|
@ -1679,9 +1679,9 @@ sub search_content(){
|
|||
my $searchref = shift;
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift;
|
||||
my $main_ids = shift || "";
|
||||
my $tplids = shift || "";
|
||||
my $ct_ids = shift || "";
|
||||
my $main_ids = shift || 0;
|
||||
my $tplids = shift || 0;
|
||||
my $ct_ids = shift || 0;
|
||||
my $v_journal = shift || "";
|
||||
my $ck4ex = shift || "";
|
||||
|
||||
|
@ -1692,13 +1692,13 @@ sub search_content(){
|
|||
$ck4ex =~ s/\s/,/g;
|
||||
$ck4ex =~ s/,$//;
|
||||
|
||||
my $owner = $users_dms->{u_id};
|
||||
my $sort_updown = $users_dms->{sort_updown};
|
||||
my $scol = $searchref->{scol};
|
||||
my $offset = $searchref->{offset};
|
||||
my $limit = $searchref->{limit};
|
||||
my $export = $searchref->{export};
|
||||
my $opos = $searchref->{opos};
|
||||
my $owner = $users_dms->{u_id} || 0;
|
||||
my $sort_updown = $users_dms->{sort_updown} || "down";
|
||||
my $scol = $searchref->{scol} || "mtime";
|
||||
my $offset = $searchref->{offset} || 0;
|
||||
my $limit = $searchref->{limit} || 200;
|
||||
my $export = $searchref->{export} || "";
|
||||
my $opos = $searchref->{opos} || 0;
|
||||
|
||||
my $stamp_time = strftime("%d.%m.%Y %H:%M",localtime(time));
|
||||
my $debug=0;
|
||||
|
@ -1751,10 +1751,10 @@ sub search_content(){
|
|||
$cptxt_where .= " and cp.$key $opref->{$key} $valref->{$key}";
|
||||
}
|
||||
}else{
|
||||
if($key eq "ct_name" && $valref->{$key} =~ /^(\d+)(0\d)$/){
|
||||
if($key eq "ct_name" && $valref->{$key} =~ /^\d+$/){
|
||||
$txt_where .= " and (ct.$key ilike '$valref->{$key}' OR ct.barcode $opref->{$key} $valref->{$key})";
|
||||
}elsif($key eq "ct_name"){
|
||||
$txt_where .= " and ct.$key ilike '$valref->{$key}'";
|
||||
$txt_where .= " and ct.$key ilike '$valref->{$key}%'";
|
||||
}elsif($key =~ /_id|barcode|int\d+|sort|owner/ && (looks_like_number($valref->{$key}) || $valref->{$key} =~ /null|0/)){
|
||||
$txt_where .= " and ct.$key $opref->{$key} $valref->{$key}";
|
||||
}elsif($key =~ /txt|uri/){
|
||||
|
@ -1826,7 +1826,7 @@ sub search_content(){
|
|||
$txt_where .= " and ct.int14 is $opos" if($opos eq "null");
|
||||
}
|
||||
|
||||
$txt_where = " and ct.c_id IN ($ck4ex)" if($export =~ /check4export/);
|
||||
$txt_where = " and ct.c_id IN ($ck4ex)" if($export eq "check4export" && $ck4ex);
|
||||
my $sth = "";
|
||||
my $updown = "ASC";
|
||||
$updown = "DESC" if($sort_updown eq "down");
|
||||
|
|
|
@ -311,16 +311,17 @@ sub handler {
|
|||
my $today4db = strftime("%Y-%m-%d %H:%M",localtime(time));
|
||||
$db->users_up("cal_start","$today4db",$users_dms->{u_id});
|
||||
}
|
||||
if($R::col_sort){
|
||||
$db->users_up("col_sort",$R::col_sort,$users_dms->{u_id});
|
||||
}
|
||||
if($R::sort_updown){
|
||||
$db->users_up("sort_updown",$R::sort_updown,$users_dms->{u_id});
|
||||
}
|
||||
if($R::cal_sort_updown){
|
||||
$db->users_up("cal_sort_updown",$R::cal_sort_updown,$users_dms->{u_id});
|
||||
}
|
||||
|
||||
if($R::col_sort && $node_meta->{ct_table}){
|
||||
$db->users_up("col_sort_$node_meta->{ct_table}",$R::col_sort,$users_dms->{u_id});
|
||||
}
|
||||
if($R::sort_updown){
|
||||
$db->users_up("sort_updown_$node_meta->{ct_table}",$R::sort_updown,$users_dms->{u_id});
|
||||
}
|
||||
|
||||
#base_edit implements new DMS methodes without Pre* things
|
||||
#permissions
|
||||
#DMS Kunden rw
|
||||
|
@ -431,26 +432,23 @@ sub handler {
|
|||
$return = $pl->set_accounting2invoice($q,$users_dms,$R::c_id4trans,$R::set_main_id4workflow) if(looks_like_number($R::c_id4trans) && looks_like_number($R::tpl_id4trans) && looks_like_number($R::set_main_id4workflow));
|
||||
}elsif($R::ct_trans =~ /save_text|save_adr/){
|
||||
$feedb = $pl->save_text2contenttrans($q,$users_dms,$R::c_id4trans) if(looks_like_number($R::c_id4trans));
|
||||
}elsif($R::ct_trans =~ /email_generate/){
|
||||
#TODO
|
||||
my $sendref = $pl->prepare_email({},{ txt08 => 'xxxx@sharee.bike' }, {}, $varenv{cms}->{$R::email_select}->{txt});
|
||||
#print Dumper($sendref);
|
||||
my $email_body = $q->unescapeHTML($sendref->{message});
|
||||
$email_body =~ s/\r\n/\%0A/g;
|
||||
$email_body =~ s/\n/\%0A/g;
|
||||
#print "$email_body";
|
||||
print redirect("mailto:$sendref->{mail_to}?subject=$sendref->{subject}\&body=$email_body");
|
||||
exit 0;
|
||||
}
|
||||
#not used because of attachement
|
||||
elsif($R::ct_trans =~ /email_generate/ && $R::c_id4trans && $R::email_select){
|
||||
#my $sendref = $pl->prepare_email(\%varenv,$R::c_id4trans,$R::email_select);
|
||||
#print redirect("mailto:$sendref->{mail_to}?subject=$sendref->{subject}\&body=$sendref->{message}");
|
||||
#exit 0;
|
||||
|
||||
}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::v_abschluss || $R::trans2edit){
|
||||
}elsif($R::ct_trans || $R::set_state || $R::v_abschluss || $R::trans2edit){
|
||||
#should do all else invoice text save , without positions and booking payment
|
||||
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);
|
||||
}
|
||||
$return .= "|";
|
||||
$return .= $pre->preinit($q,$users_dms);#transactions logic
|
||||
$return .= $pre->preinit($q,$node_meta,$users_dms);
|
||||
}
|
||||
}elsif($R::ct_trans){
|
||||
$feedb->{message} = "failure::Abbruch. Schreibender Zugriff \"Faktura\" verweigert.";
|
||||
|
|
|
@ -612,9 +612,7 @@ sub update_users4trans(){
|
|||
my ($c_id4trans,$tpl_id4trans,$kind_of_trans,$u_id) = @_;
|
||||
my $sth = $dbh->prepare("UPDATE users SET
|
||||
c_id4trans='$c_id4trans',
|
||||
tpl_id4trans='$tpl_id4trans',
|
||||
ctpos_activ='0',
|
||||
kind_of_trans='Faktura'
|
||||
tpl_id4trans='$tpl_id4trans'
|
||||
where u_id=$u_id");
|
||||
my $rows = $sth->execute();
|
||||
return $rows;
|
||||
|
@ -625,15 +623,7 @@ sub cleanup_users(){
|
|||
my $u_id = shift;
|
||||
my $sth = $dbh->prepare("UPDATE users SET
|
||||
c_id4trans='0',
|
||||
tpl_id4trans='0',
|
||||
ctpos_activ='0',
|
||||
c_id4package='0',
|
||||
kind_of_trans='',
|
||||
parts_uri='',
|
||||
address_uri='',
|
||||
project_uri='',
|
||||
transaction_uri='',
|
||||
nel_uri=''
|
||||
tpl_id4trans='0'
|
||||
where u_id=$u_id");
|
||||
my $rows = $sth->execute();
|
||||
return $rows;
|
||||
|
@ -2103,7 +2093,6 @@ sub update_content4comp(){
|
|||
}
|
||||
my $val="0";
|
||||
$val=$menge if($menge);
|
||||
$val = $val * -1 if($table eq "content" && $kind_of_trans eq "Einkauf");
|
||||
my $ct_set = "int03=(int03 $operator $val)";
|
||||
my $sth = $dbh->prepare("UPDATE $table SET $ct_set where $where") if($c_id || $ct_name);
|
||||
my $rows = $sth->execute();
|
||||
|
|
|
@ -743,8 +743,8 @@ sub payone_capture(){
|
|||
|
||||
#send_invoice infomail, only if eMail never sent
|
||||
if(-f "$dbt->{copri_conf}->{basedir}/$varenv->{syshost}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf" && !$ctt->{txt30}){
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv->{syshost}/src/scripts/mailTransportcms.pl '$varenv->{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' ''");
|
||||
print EMA "---> Payment send_invoice e-mail command: $dbt->{copri_conf}->{basedir}/$varenv->{syshost}/src/scripts/mailTransportcms.pl '$varenv->{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '$praefix-$ctt->{ct_name}.pdf' ''\n";
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv->{syshost}/src/scripts/mailTransportcms.pl '$varenv->{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '' ''");
|
||||
print EMA "---> Payment send_invoice $praefix-$ctt->{ct_name}.pdf email command: $dbt->{copri_conf}->{basedir}/$varenv->{syshost}/src/scripts/mailTransportcms.pl '$varenv->{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '' ''\n";
|
||||
}
|
||||
close EMA;
|
||||
}
|
||||
|
|
|
@ -1479,14 +1479,49 @@ sub export_csv {
|
|||
return $feedb;
|
||||
}
|
||||
|
||||
#prepare email by cms markup
|
||||
#also done in mailTransportcms
|
||||
#prepare email standalone for extern email client posting
|
||||
#partly adapted from mailTransportcms
|
||||
#attachement breaks, that's because not used
|
||||
sub prepare_email {
|
||||
my $self = shift;
|
||||
my $sendref = shift;
|
||||
my $ctadr = shift;
|
||||
my $ctt = shift || {};
|
||||
my $cms_prim = shift;
|
||||
my $varenv = shift;
|
||||
my $ct_id = shift || "";
|
||||
my $email_select = shift || "";
|
||||
my $dbh = "";
|
||||
|
||||
my $cms_prim = $varenv->{cms}->{$email_select}->{txt};
|
||||
|
||||
#mailxcfg is shareeconf/mailx.cfg <block> selection!
|
||||
#hash data to send
|
||||
my $sendref = {
|
||||
mailxcfg => "mailx_default",
|
||||
syshost => "$varenv->{syshost}",
|
||||
mail_from => "",
|
||||
mail_to => "",
|
||||
mail_bcc => "",
|
||||
c_id => 0,
|
||||
subject => "",
|
||||
message => "",
|
||||
signature => "",
|
||||
attachment => "",
|
||||
};
|
||||
|
||||
my $fetchctt = {
|
||||
table => "contenttrans",
|
||||
fetch => "one",
|
||||
c_id => "=::$ct_id",
|
||||
};
|
||||
my $ctt = { c_id => 0 };
|
||||
$ctt = $dbt->fetch_tablerecord($dbh,$fetchctt);
|
||||
|
||||
my $dbh_primary = $dbt->dbconnect_extern($dbt->{primary}->{sharee_primary}->{database}->{dbname},"iso-8859-1");
|
||||
my $pref_adr = {
|
||||
table => "contentadr",
|
||||
fetch => "one",
|
||||
c_id => "$ctt->{int10}",
|
||||
};
|
||||
my $ctadr = { c_id => 0 };
|
||||
$ctadr = $dbt->fetch_tablerecord($dbh_primary,$pref_adr);
|
||||
|
||||
my $app_name = "Mietrad App";
|
||||
$app_name = $dbt->{operator}->{$varenv{dbname}}->{app_name};
|
||||
|
@ -1500,8 +1535,8 @@ sub prepare_email {
|
|||
|
||||
my $subject = "TeilRad Mietradsystem";#default
|
||||
$subject = $1 if($cms_prim =~ /--subject--(.*)--subject--/);
|
||||
$subject .= " $sharee_ticket" if($sharee_ticket);
|
||||
$cms_prim =~ s/--subject--$subject--subject--//;
|
||||
$subject .= " $sharee_ticket" if($sharee_ticket);
|
||||
$cms_prim =~ s/\n//;
|
||||
$cms_prim =~ s/\n//;
|
||||
|
||||
|
@ -1522,6 +1557,6 @@ sub prepare_email {
|
|||
#$sendref->{message} =~ s/\n/\<br \/\>/g;
|
||||
|
||||
return $sendref;
|
||||
}#end prepare_content
|
||||
}#end prepare_email
|
||||
|
||||
1;
|
||||
|
|
|
@ -37,6 +37,7 @@ sub new {
|
|||
sub preinit(){
|
||||
my $self = shift;
|
||||
my $q = shift;
|
||||
my $node_meta = shift;
|
||||
my $users_dms = shift;
|
||||
|
||||
$q->import_names('R');
|
||||
|
@ -115,15 +116,6 @@ sub preinit(){
|
|||
my $barcode=0;
|
||||
my $s_owner_id=0;
|
||||
|
||||
if($R::cash_sort){
|
||||
$db->users_up("cash_sort",$R::cash_sort,$users_dms->{u_id});
|
||||
}
|
||||
if($R::ctpos_close){
|
||||
$db->users_up("ctpos_activ","0",$users_dms->{u_id});
|
||||
}elsif($R::ctpos_activ){
|
||||
$db->users_up("ctpos_activ",$R::ctpos_activ,$users_dms->{u_id});
|
||||
}
|
||||
|
||||
if($R::s_start_date_time && $varenv{dataflow} =~ /wiki/){
|
||||
$db->users_up("cal_start","$R::s_start_date_time",$users_dms->{u_id});
|
||||
}
|
||||
|
@ -439,27 +431,12 @@ sub preinit(){
|
|||
}
|
||||
|
||||
my $pos_id = $R::c_idpos || $R::pos_id;
|
||||
#DELETE verpos
|
||||
if($ib_key eq "remove_verpos" && $pos_id){
|
||||
$table = "contenttverpos";
|
||||
$d_rows += $db->delete_content("$table","$pos_id");
|
||||
}
|
||||
|
||||
#DELETE pos
|
||||
if($ib_key =~ /delete_pos|delete_verpos/ && $pos_id){
|
||||
if($ib_key =~ /delete_pos/ && $pos_id){
|
||||
$table = "contenttranspos";
|
||||
$table = "contenttverpos" if($ib_key =~ /delete_verpos/);
|
||||
my $cttpos = $db->get_content1($table,$pos_id);
|
||||
|
||||
my $ctpos_sort;
|
||||
if($pos_id == $users_dms->{ctpos_activ}){
|
||||
my $ctt_subpos = $db->collect_content2($table,"ctpos_id","$pos_id");
|
||||
foreach my $id (keys(%$ctt_subpos)){
|
||||
$d_rows += $db->delete_content("$table","$ctt_subpos->{$id}->{c_id}");
|
||||
}
|
||||
}
|
||||
$d_rows += $db->delete_content("$table","$pos_id");
|
||||
$db->users_up("ctpos_activ","0",$users_dms->{u_id}) if("$pos_id" eq "$users_dms->{ctpos_activ}");
|
||||
$ct_name = $1 if($R::ct_name =~ /^(\d+)/);
|
||||
$u_rows += $db->update_content4comp("content",$ct_name,"$cttpos->{cc_id}","+","$cttpos->{int03}","","");
|
||||
}
|
||||
|
@ -478,7 +455,7 @@ sub preinit(){
|
|||
###SET Relation (like move doc-type)
|
||||
#executed by Terminal submit-buttons
|
||||
#2. counter for WaWi and ReNr
|
||||
if((!$R::close_time && $R::set_main_id) && ($R::set_relation || $R::set_state || $R::open_set_main_id > 300000 || $R::ct_trans =~ /print_pdf|print/i)){
|
||||
if((!$R::close_time && $R::set_main_id) && ($R::set_relation || $R::set_state || $R::open_set_main_id > 300000 || $R::ct_trans =~ /print_pdf/i)){
|
||||
if($R::open_set_main_id){
|
||||
$R::set_main_id = $R::open_set_main_id;
|
||||
$users_dms = $db->select_users($users_dms->{u_id});
|
||||
|
@ -630,8 +607,8 @@ sub preinit(){
|
|||
}
|
||||
###end SET Relation or state (V Terminal submit's)
|
||||
|
||||
my $c_id4print = $R::c_id4trans;
|
||||
$c_id4print= $R::c_id if($R::printer_id =~ /Adresse|Kunde/);
|
||||
my $c_id4print = "";
|
||||
$c_id4print = $R::c_id4trans if(looks_like_number($R::c_id4trans));
|
||||
if($c_id4print){
|
||||
open(EMA, ">> $varenv{logdir}/copri-print.log");
|
||||
print EMA "$today4db\n";
|
||||
|
@ -643,43 +620,54 @@ sub preinit(){
|
|||
my $praefix = "$ctt->{txt00}-$varenv{praefix}";#like Rechnung-sharee_operator
|
||||
|
||||
|
||||
###PRINT
|
||||
if($R::ct_trans =~ /print_pdf|print/i){
|
||||
my $main_id = $R::set_main_id || $R::main_id;
|
||||
my $node = $db->get_node4multi($main_id,$lang);
|
||||
#PDF generate
|
||||
if($R::ct_trans =~ /print_pdf/ || $R::print_pdf){
|
||||
my $psize="A4";
|
||||
if("$ctt->{txt00}" =~ /Quittung/){
|
||||
$psize="A5";
|
||||
#-B 0 -T 0 -L 0 -R 0 # testing paper-margin=0
|
||||
}
|
||||
my ($sysname, $nodename, $release, $version, $machine) = uname();
|
||||
my $topdf = "$varenv{basedir}/src/wkhtmltopdf-amd64";
|
||||
|
||||
if("$R::printer_id" =~ /PDF/){
|
||||
#without system() because we have to wait until PDF is ready
|
||||
$print_return = `$topdf --page-size $psize "$varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&pkey=$apikeyconf{pdfprinter}->{pkey}" "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" 2>&1`;
|
||||
$print_return = `$topdf --page-size $psize "$varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node_meta->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&pkey=$apikeyconf{pdfprinter}->{pkey}" "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" 2>&1`;
|
||||
$exit_code = $?;
|
||||
|
||||
my $filesize = -s "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf";
|
||||
print EMA "$topdf --page-size $psize $varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&pkey=$apikeyconf{pdfprinter}->{pkey} $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf\nreturn: $print_return\nfilesize: $filesize\nexit_code: $exit_code\nset_state: $R::set_state\n";
|
||||
print EMA "$topdf --page-size $psize $varenv{wwwhost}$script/Printpreview?printer_id=$R::printer_id\&mandant_main_id=$mandant_main_id\&main_id=$node_meta->{main_id}\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$c_id4print\&u_id=$users_dms->{u_id}\&pkey=$apikeyconf{pdfprinter}->{pkey} $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf\nreturn: $print_return\nfilesize: $filesize\nexit_code: $exit_code\nset_state: $R::set_state\n";
|
||||
|
||||
if($R::set_state ne "buchen"){#no redirect if buchen incl. print_pdf
|
||||
#no redirect
|
||||
if($R::ct_trans eq "print_pdf"){
|
||||
if( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf"){
|
||||
print "<script type=\"text/javascript\">window.open('$varenv{wwwhost}/FileOut?file=$praefix-$ctt->{ct_name}.pdf');</script>";
|
||||
}else{
|
||||
return "failure::PDF konnte nicht generiert werden, bitte Info an: admin\@sharee.bike\n $varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#PDF will be generated by "print_pdf" in context "buchen"
|
||||
#"send_invoice_again" will use formarly generated PDF
|
||||
if(-f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf" && (($R::set_state eq "buchen" && $R::send_invoice && $ctt->{int01} && $ctt->{int01} != 0) || ($ib_key eq "send_invoice_again"))){
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' ''");
|
||||
print EMA "---> Prelogic send_invoice e-mail command: $dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '$praefix-$ctt->{ct_name}.pdf'\n";
|
||||
|
||||
my $cms_message_key = "email-invoice";
|
||||
$varenv{cms} = $dbt->fetch_cms($dbh,{ lang => "de" });
|
||||
if(!$varenv{cms}->{$cms_message_key}->{txt}){
|
||||
return "failure::Achtung, CMS-Text '$cms_message_key' ist nicht vorhanden. Es wurde keine eMail versandt!";
|
||||
}
|
||||
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '' '$cms_message_key' '1'");
|
||||
print EMA "---> Prelogic send_invoice $praefix-$ctt->{ct_name}.pdf email command: $dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice' '$ctt->{int10}' '$ctt->{c_id}' '' '$cms_message_key' '1'\n";
|
||||
}
|
||||
#
|
||||
|
||||
if($ib_key eq "send_invoice_cms" && $R::cms_message_key){
|
||||
|
||||
$varenv{cms} = $dbt->fetch_cms($dbh,{ lang => "de" });
|
||||
if(!$varenv{cms}->{$R::cms_message_key}->{txt}){
|
||||
return "failure::Achtung, CMS-Text '$R::cms_message_key' ist nicht vorhanden. Es wurde keine eMail versandt!";
|
||||
}
|
||||
my $with_pdf = "";
|
||||
$with_pdf = 1 if(-f "$varenv{basedir}/pdfinvoice/$praefix-$ctt->{ct_name}.pdf" && $R::print_pdf);
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice_cms' '$ctt->{int10}' '$ctt->{c_id}' '' '$R::cms_message_key' '$with_pdf'");
|
||||
print EMA "---> Prelogic send_invoice_cms $praefix-$ctt->{ct_name}.pdf email command: $dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/mailTransportcms.pl '$varenv{syshost}' 'send_invoice_cms' '$ctt->{int10}' '$ctt->{c_id}' '' '$R::cms_message_key' '$with_pdf'\n";
|
||||
}
|
||||
|
||||
close EMA;
|
||||
}#end c_id4print
|
||||
|
||||
|
|
|
@ -410,20 +410,24 @@ sub save_account(){
|
|||
#phonenr
|
||||
}elsif($_ eq "txt07"){
|
||||
$valxx =~ s/[\s\-\/]//g;
|
||||
if($valxx !~ /\d{9}/ || length($valxx) > 16){
|
||||
my $email = "";
|
||||
my $phone = "";
|
||||
$phone = $1 if($valxx =~ /([+0-9]+)/);
|
||||
if(length($phone) < 9 || length($phone) > 16){
|
||||
$ret = "failure::$_#top";
|
||||
}else{
|
||||
#smsAck reset
|
||||
if($valxx ne $ctadr->{txt07}){
|
||||
if($phone ne $ctadr->{txt07}){
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"int13=0");
|
||||
}
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$valxx'");
|
||||
my $email = $R::txt08;
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"$_='$phone'");
|
||||
$email = $q->escapeHTML("$R::txt08");
|
||||
$email =~ s/\s//g;
|
||||
my $confirm_digest = sha1_base64($email . $valxx);
|
||||
my $confirm_digest = sha1_base64($email . $phone);
|
||||
$confirm_digest =~ s/[I1LO0]//ig;
|
||||
$u_rows = $dbt->update_one($dbh,$update_primary,"txt34='$confirm_digest'");
|
||||
}
|
||||
print FILE "confirm_digest input after substitution: $email . $phone\n" if($debug);
|
||||
#user alias email
|
||||
}elsif($_ eq "txt08"){
|
||||
$valxx =~ s/\s//g;
|
||||
|
@ -438,7 +442,6 @@ sub save_account(){
|
|||
order => "mtime",
|
||||
};
|
||||
my $account_check = $dbt->fetch_tablerecord($dbh,$pref_ac);
|
||||
#my $account_check = $self->check_account("txt08","ilike",$valxx,"c_id","!=",$c_id);
|
||||
|
||||
print FILE "account_check email:$valxx, c_id:$account_check->{c_id} && $account_check->{c_id} != $c_id\n" if($debug);
|
||||
if($account_check->{c_id} && $account_check->{c_id} != $c_id){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue