invoice mailing

This commit is contained in:
Rainer Gümpelein 2022-02-01 20:53:23 +01:00
parent 4d9395808c
commit f852443c6d
13 changed files with 97 additions and 126 deletions

1
copri4/main/img/images Symbolic link
View file

@ -0,0 +1 @@
../../../../sharee.bike/copri-bike/shareeconf/images

View file

@ -1477,6 +1477,10 @@ sub bikes_available(){
if($auth->{txt30}){ if($auth->{txt30}){
@adr_tariff = ("$auth->{txt30}"); @adr_tariff = ("$auth->{txt30}");
@adr_tariff = split(/\s+/,$auth->{txt30}) if($auth->{txt30} =~ /\w\s+\w/); @adr_tariff = split(/\s+/,$auth->{txt30}) if($auth->{txt30} =~ /\w\s+\w/);
}elsif(ref($tariff_content) eq "HASH"){
foreach my $tid (keys (%$tariff_content)){
push(@adr_tariff, "$tariff_content->{$tid}->{barcode}") if($tariff_content->{$tid}->{int18} eq 2);
}
} }
foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){ foreach my $id (sort { $record->{$a}->{barcode} <=> $record->{$b}->{barcode} } keys (%$record)){
@ -1506,7 +1510,7 @@ sub bikes_available(){
} }
if(ref($tariff_content) eq "HASH"){ if(ref($tariff_content) eq "HASH"){
foreach my $tid (sort { $tariff_content->{$a}->{barcode} <=> $tariff_content->{$b}->{barcode} } keys (%$tariff_content)){ foreach my $tid (sort { $tariff_content->{$a}->{barcode} <=> $tariff_content->{$b}->{barcode} } keys (%$tariff_content)){
#$bw->log("bikes_available tariff_content tariff_description if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $auth->{txt30} =~ /$tariff_content->{$tid}->{barcode}/) BIKE:",$return->{$id}->{bike},""); $bw->log("bikes_available tariff_content tariff_description $tariff_content->{$tid}->{int12} && $auth->{txt30} =~ /$tariff_content->{$tid}->{barcode}/ BIKE:",$return->{$id}->{bike},"");
foreach(@adr_tariff){ foreach(@adr_tariff){
if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $_ == $tariff_content->{$tid}->{barcode}){ if($record->{$id}->{main_id} == $tariff_content->{$tid}->{int12} && $_ == $tariff_content->{$tid}->{barcode}){

View file

@ -75,8 +75,9 @@ sub loop_sharees {
$users_serviceapp = $dbt->select_users($dbh_operator,$authraw->{c_id},"and int09=1"); $users_serviceapp = $dbt->select_users($dbh_operator,$authraw->{c_id},"and int09=1");
$bw->log("shareetool select_users $return_merchant->{aowner} on $value->{database}->{dbname} $authraw->{c_id} $authraw->{txt17}",$users_serviceapp->{u_id},""); $bw->log("shareetool select_users $return_merchant->{aowner} on $value->{database}->{dbname} $authraw->{c_id} $authraw->{txt17}",$users_serviceapp->{u_id},"");
} }
#every sharee client must have a merchant_id which associate a project
if($value->{operatorApp} && ($return_merchant->{project_id} eq $value->{project} || $users_serviceapp->{u_id})){ #if($value->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $value->{project} || $return_merchant->{project_id} eq "all"))){
if($value->{operatorApp} && ($users_serviceapp->{u_id} || ($return_merchant->{project_id} eq $value->{project}))){
$bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $value->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $value->{project} || $users_serviceapp->{u_id} > 0)\n","",""); $bw->log("--> LOOP-start ($return_merchant->{merchant_id}) jsonclient loop_sharees $key by operatorApp: $value->{operatorApp}, netloc: $netloc if($return_merchant->{project_id} eq $value->{project} || $users_serviceapp->{u_id} > 0)\n","","");
$ret_json = $self->fetch_operator_json($value->{operatorApp},$rest); $ret_json = $self->fetch_operator_json($value->{operatorApp},$rest);

View file

@ -45,7 +45,7 @@ sub mail_connect {
Port => 465, Port => 465,
Hello => 'sharee.bike', Hello => 'sharee.bike',
Timeout => 30, Timeout => 30,
Debug => 1, Debug => 0,
SSL => 1, SSL => 1,
); );
@ -62,7 +62,7 @@ sub mail_transport(){
my $sendref = shift; my $sendref = shift;
#print Dumper($smtp); #print Dumper($smtp);
my $ret = 1;
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime; my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
open(EMA, ">> $dbt->{copri_conf}->{logdir}/mailtransport.log"); open(EMA, ">> $dbt->{copri_conf}->{logdir}/mailtransport.log");
@ -73,9 +73,9 @@ sub mail_transport(){
my ($buf, $picture); my ($buf, $picture);
my $boundary = 'frontier'; my $boundary = 'frontier';
my $pdfpath = "$dbt->{copri_conf}->{basedir}/$sendref->{syshost}/pdf"; my $pdfpath = "$dbt->{copri_conf}->{basedir}/$sendref->{syshost}/pdf";
my $attachBinaryFile = "sharee.pdf"; my $attachBinaryFile = "";
if(-f "$pdfpath/Rechnung-sharee_fr01-21084-4.pdf"){ if(-f "$pdfpath/$sendref->{attachment}"){
$attachBinaryFile = "Rechnung-sharee_fr01-21084-4.pdf"; $attachBinaryFile = "$sendref->{attachment}";
} }
if($dbt->{copri_conf}->{stage} eq "test"){ if($dbt->{copri_conf}->{stage} eq "test"){
@ -99,10 +99,8 @@ sub mail_transport(){
if ($smtp->to($mail_to)) { if ($smtp->to($mail_to)) {
$smtp->data(); $smtp->data();
$smtp->datasend("To: $mail_to\n"); $smtp->datasend("To: $mail_to\n");
#$smtp->datasend("Subject: $subject\nMIME-Version: 1.0\nContent-Type: text/html; charset=UTF-8 \n\n");
$smtp->datasend("Subject: $subject\n"); $smtp->datasend("Subject: $subject\n");
$smtp->datasend("MIME-Version: 1.0\n"); $smtp->datasend("MIME-Version: 1.0\n");
#$smtp->datasend("Content-Type: text/html; charset=UTF-8 \n\n");
$smtp->datasend("Content-type: multipart/mixed;\n\tboundary=\"$boundary\"\n"); $smtp->datasend("Content-type: multipart/mixed;\n\tboundary=\"$boundary\"\n");
$smtp->datasend("\n"); $smtp->datasend("\n");
@ -114,15 +112,15 @@ sub mail_transport(){
$smtp->datasend($html); $smtp->datasend($html);
$smtp->datasend("\n"); $smtp->datasend("\n");
$smtp->datasend("--$boundary\n"); if($attachBinaryFile){
#$smtp->datasend("Content-Type: image/jpeg; name=\"$attachBinaryFile\"\n"); $smtp->datasend("--$boundary\n");
$smtp->datasend("Content-Type: application/pdf; name=\"$attachBinaryFile\"\n"); #$smtp->datasend("Content-Type: image/jpeg; name=\"$attachBinaryFile\"\n");
$smtp->datasend("Content-Type: application/pdf; name=\"$attachBinaryFile\"\n");
$smtp->datasend("Content-Transfer-Encoding: base64\n"); $smtp->datasend("Content-Transfer-Encoding: base64\n");
$smtp->datasend("Content-Disposition: attachment; filename=\"$attachBinaryFile\"\n"); $smtp->datasend("Content-Disposition: attachment; filename=\"$attachBinaryFile\"\n");
$smtp->datasend("\n"); $smtp->datasend("\n");
if(1==1){
open(DAT, "$pdfpath/$attachBinaryFile") || die("Could not open $pdfpath/$attachBinaryFile"); open(DAT, "$pdfpath/$attachBinaryFile") || die("Could not open $pdfpath/$attachBinaryFile");
binmode(DAT); binmode(DAT);
local $/=undef; local $/=undef;
@ -133,15 +131,16 @@ sub mail_transport(){
$smtp->datasend("\n"); $smtp->datasend("\n");
close(DAT); close(DAT);
} }
$smtp->datasend("--$boundary\r\n\r"); $smtp->datasend("--$boundary\r\n\r");
$smtp->dataend();#doesn't exit $smtp->dataend();
$smtp->quit; $smtp->quit;
} else { } else {
print EMA $smtp->message(); print EMA $smtp->message();
} }
sleep 1; sleep 1;
#return $?; $ret = $?;
} }
@ -150,6 +149,7 @@ sub mail_transport(){
close EMA; close EMA;
$bw->log("Success send_mail","",""); $bw->log("Success send_mail","","");
return $ret;
}#end mail_send }#end mail_send
1; 1;

View file

@ -549,7 +549,8 @@ sub pdfmandat {
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime; my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
open(EMA, ">> $varenv->{logdir}/SEPA-PDFprint.log"); open(EMA, ">> $varenv->{logdir}/SEPA-PDFprint.log");
print EMA "*** $now_dt trying pdf --> $varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf && $ctadr->{txt27}\n"; print EMA "*** $now_dt trying pdf --> $varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf && $ctadr->{txt27}\n";
if((! -f "$varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf") && $ctadr->{txt27} && $ctadr->{txt27} =~ /active|pending/){ #if((! -f "$varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf") && $ctadr->{txt27} && $ctadr->{txt27} =~ /active|pending/){
if($ctadr->{txt27} && $ctadr->{txt27} =~ /active|pending/){
my $topdf = "$varenv->{basedir}/src/wkhtmltopdf-amd64"; my $topdf = "$varenv->{basedir}/src/wkhtmltopdf-amd64";
my $print_return = `$topdf --page-size A4 "$varenv->{wwwhost}/PDFGenerator?printer_id=SEPA-Lastschriftmandat\&mandant_main_id=$dbt->{shareedms_conf}->{parent_id}\&id=$ctadr->{c_id}" $varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf 2>&1`; my $print_return = `$topdf --page-size A4 "$varenv->{wwwhost}/PDFGenerator?printer_id=SEPA-Lastschriftmandat\&mandant_main_id=$dbt->{shareedms_conf}->{parent_id}\&id=$ctadr->{c_id}" $varenv->{basedir}/pdfinvoice/SEPA-Lastschriftmandat-$varenv->{dbname}-$ctadr->{ct_name}.pdf 2>&1`;
my $exit_code = $?; my $exit_code = $?;

View file

@ -960,9 +960,7 @@ sub preinit(){
$table = "contenttver" if($rel->{ct_table} eq "contenttver"); $table = "contenttver" if($rel->{ct_table} eq "contenttver");
$table = "contentadr" if($R::printer_id =~ /Adresse|Kunde/);#jbw $table = "contentadr" if($R::printer_id =~ /Adresse|Kunde/);#jbw
my $ctt = $db->get_content1($table,$c_id4print); my $ctt = $db->get_content1($table,$c_id4print);
my $praefix = "$ctt->{txt00}-$varenv{praefix}"; my $praefix = "$ctt->{txt00}-$varenv{praefix}";#like Rechnung-sharee_operator
#$praefix = "$ctt->{txt00}-TINK" if($varenv{wwwhost} =~ /tink|konrad/);
#$praefix = "$ctt->{txt00}-sharee" if($varenv{wwwhost} =~ /sharee/);
###PRINT ###PRINT
@ -993,11 +991,11 @@ sub preinit(){
} }
if($R::set_state ne "buchen"){#no redirect if buchen incl. print_pdf if($R::set_state ne "buchen"){#no redirect if buchen incl. print_pdf
if( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" && $varenv{metahost}){ if( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf" && $varenv{metahost}){
#print redirect("$varenv{metahost}$script/pdf/$praefix-$ctt->{ct_name}.pdf"); #print redirect("$varenv{metahost}$script/pdf/$praefix-$ctt->{ct_name}.pdf");
#exit 0; #exit 0;
print "<script type=\"text/javascript\">window.open('$varenv{metahost}$script/pdf/$praefix-$ctt->{ct_name}.pdf');</script>"; print "<script type=\"text/javascript\">window.open('$varenv{metahost}$script/pdf/$praefix-$ctt->{ct_name}.pdf');</script>";
}elsif( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf"){ }elsif( -f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf"){
#print redirect("$varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf"); #print redirect("$varenv{wwwhost}/pdf/$praefix-$ctt->{ct_name}.pdf");
#exit 0; #exit 0;
print "<script type=\"text/javascript\">window.open('$varenv{wwwhost}$script/pdf/$praefix-$ctt->{ct_name}.pdf');</script>"; print "<script type=\"text/javascript\">window.open('$varenv{wwwhost}$script/pdf/$praefix-$ctt->{ct_name}.pdf');</script>";
@ -1009,17 +1007,13 @@ sub preinit(){
} }
} }
## ./src/Mod/newsletter_tink.pl '/var/www/copri3/tinkdms' 'https://tinkdms.copri.eu' 'send_invoice' '1842' '2866' if(-f "$varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf" && (($R::set_state eq "buchen" && $R::send_invoice) || ($ib_key eq "send_invoice_again"))){
#2018-01-12
#if(($R::send_invoice && $print_return =~ /Done/ && $exit_code == 0) || ($ib_key eq "send_invoice_again")){
if(-f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" && (($R::set_state eq "buchen" && $R::send_invoice) || ($ib_key eq "send_invoice_again"))){
#sleep 3;#PDF invoice sending disabled because of partly empty invoices #sleep 3;#PDF invoice sending disabled because of partly empty invoices
# #
#print "$varenv{basedir}/src/Mod/newsletter_tink.pl '$varenv{basedir}' '$varenv{wwwhost}' 'send_invoice' '$ctt->{int10}' '$ctt->{ct_name}'";
#Last check!!!!!
#my $key_pdf; #my $key_pdf;
#$key_pdf = `/usr/bin/pdftotext $varenv{pdf}/$praefix-$ctt->{ct_name}.pdf - | grep "Seite:"`; #$key_pdf = `/usr/bin/pdftotext $varenv{basedir}/pdf/$praefix-$ctt->{ct_name}.pdf - | grep "Seite:"`;
system(`$varenv{basedir}/src/Mod/newsletter_tink.pl "$varenv{basedir}" "$varenv{wwwhost}" "send_invoice" "$ctt->{int10}" "$ctt->{ct_name}"`);# if($key_pdf =~ /Seite:/); #system(`$varenv{basedir}/src/Mod/newsletter_tink.pl "$varenv{basedir}" "$varenv{wwwhost}" "send_invoice" "$ctt->{int10}" "$ctt->{ct_name}"`);# if($key_pdf =~ /Seite:/);
system(`$varenv{basedir}/src/scripts/mailTransport.pl "$varenv{syshost}" "send_invoice" "$ctt->{c_id}" "$praefix-$ctt->{ct_name}.pdf"`);
} }
# #
@ -1027,19 +1021,8 @@ sub preinit(){
#SET Tagesabschluss #SET Tagesabschluss
if($R::v_abschluss){ if($R::v_abschluss){
my $journal_tpl="999999"; my $journal_tpl="209";
my $journal_id="999999"; my $journal_id="300011";
my $Xjournal_id="999999";
if("$R::kind_of_trans" eq "Verkauf"){
$journal_id=$ctf->{txt23} if($ctf->{txt23});
$Xjournal_id=$ctf->{txt70} if($ctf->{txt70});
$journal_tpl=$ctf->{txt26} if($ctf->{txt26});
}
if($R::kind_of_trans =~ /Faktur|Verleih/){
$journal_id=$ctf->{txt25} if($ctf->{txt25});
$Xjournal_id=$ctf->{txt70} if($ctf->{txt70});
$journal_tpl=$ctf->{txt28} if($ctf->{txt28});
}
#test node #test node
my $n_exist = $db->get_node4multi($journal_id,$lang); my $n_exist = $db->get_node4multi($journal_id,$lang);
@ -1059,8 +1042,7 @@ sub preinit(){
my $sum_kasse = $R::sum_kasse || "0"; my $sum_kasse = $R::sum_kasse || "0";
$sum_start = $lb->checkint($sum_start); $sum_start = $lb->checkint($sum_start);
$sum_kasse = $lb->checkint($sum_kasse); $sum_kasse = $lb->checkint($sum_kasse);
my $c_id4kasse; my $c_id4kasse = "";
#my $journal_node = $db->get_node3("$parent_trans->{main_id}","Verkaufsjournal","$lang");
my $c_id4abschluss = $db->get_content6("$table","close_time","null","state","Kassenbestand","int09","$parent_trans->{parent_id}","","","$s_owner_id"); my $c_id4abschluss = $db->get_content6("$table","close_time","null","state","Kassenbestand","int09","$parent_trans->{parent_id}","","","$s_owner_id");
if($journal_id){ if($journal_id){
if($c_id4abschluss->{c_id} && $c_id4abschluss->{c_id} > 0){ if($c_id4abschluss->{c_id} && $c_id4abschluss->{c_id} > 0){
@ -1074,10 +1056,7 @@ sub preinit(){
$db->update_content4change("contenttrans",$c_id4kasse,"",$c_id4kasse,"int11");#last_ab $db->update_content4change("contenttrans",$c_id4kasse,"",$c_id4kasse,"int11");#last_ab
$db->update_content4change("contenttrans",$c_id4kasse,"",$journal_id,"int12");#main_id $db->update_content4change("contenttrans",$c_id4kasse,"",$journal_id,"int12");#main_id
#2021-04-30, check close_time if fails. 300011 not in main_ids #TODO $db->collect_noderec
#$db->update_content4change("contenttrans",$c_id4kasse,"","now()","close_time");
$db->update_content4change("contenttrans",$c_id4kasse,"",$n_exist->{node_name},"txt00");#node_name $db->update_content4change("contenttrans",$c_id4kasse,"",$n_exist->{node_name},"txt00");#node_name
#my $rel_id = $db->insert_relationlist($table,$journal_id,$lang,$c_id4kasse,$journal_tpl,"ct_id");
my $rel_id = $db->insert_relationlist($table,$journal_id,$lang,$c_id4kasse,$tpl_vk,"ct_id"); my $rel_id = $db->insert_relationlist($table,$journal_id,$lang,$c_id4kasse,$tpl_vk,"ct_id");
} }
$u_rows += $db->update_kasse($table,$c_id4kasse,$sum_kasse,$sum_start); $u_rows += $db->update_kasse($table,$c_id4kasse,$sum_kasse,$sum_start);
@ -1086,16 +1065,6 @@ sub preinit(){
my $opos="null"; my $opos="null";
$u_rows += $db->update_tagesabschluss($table,$c_id4kasse,$journal_id,$journal_tpl,$tpl_vk,$parent_trans->{parent_id},"$main_ids","$s_owner_id","$opos"); $u_rows += $db->update_tagesabschluss($table,$c_id4kasse,$journal_id,$journal_tpl,$tpl_vk,$parent_trans->{parent_id},"$main_ids","$s_owner_id","$opos");
#Move thinks which are in context to closed transactions
if(1==1){
my $Xlast = $db->collect_Xlast($c_id4kasse,$journal_id,$journal_tpl,$parent_trans->{parent_id});
foreach my $c_id (keys (%$Xlast)){
my @Xct_name = split(/-/,$Xlast->{$c_id}->{ct_name});
foreach(@Xct_name){
$u_rows += $db->update_Xabschluss($table,$c_id4kasse,$Xjournal_id,$journal_tpl,$tpl_vk,$parent_trans->{parent_id},"$main_ids","$s_owner_id","$_") if($_ > 10); #because of max workflow counter
}
}
}
if("$R::kind_of_trans" eq "Verkauf"){ if("$R::kind_of_trans" eq "Verkauf"){
$path =~ s/$R::kind_of_trans.*/$R::kind_of_trans\/Verkaufsjournal/; $path =~ s/$R::kind_of_trans.*/$R::kind_of_trans\/Verkaufsjournal/;

View file

@ -49,10 +49,9 @@ sub printpre(){
my $ct_name2print=$R::ct_name2print; my $ct_name2print=$R::ct_name2print;
my $wc= $1 if($R::wc =~ /(\d+\.\d+)/); my $wc= $1 if($R::wc =~ /(\d+\.\d+)/);
my $node = $db->get_node4multi($R::main_id,$lang); my $node = $db->get_node4multi($R::main_id,$lang);
#print "$u_id,$c_id,$mandant_main_id,$main_id,$ct_name2print,$wc";
print $q->start_html(-title=>'COPRIprint', print $q->start_html(-title=>'',
-base=>'true', -base=>'true',
-target=>'Printpre' -target=>'Printpre'
); );
@ -156,8 +155,8 @@ td {
#payone Bank #payone Bank
my $footer_bank = $ctf->{txt19}; my $footer_bank = $ctf->{txt19};
#sparkasse Bank #manuel Bank
$footer_bank = $ctf->{txt20} if($ctt->{state} !~ /payone/i); #$footer_bank = $ctf->{txt20} if($ctt->{state} !~ /payone/i);
my $ctt_users = $db->get_owner($ctt->{owner}); my $ctt_users = $db->get_owner($ctt->{owner});
@ -178,10 +177,10 @@ td {
my $tplf = $db->get_tpl("201");#Firma tpl my $tplf = $db->get_tpl("201");#Firma tpl
my @tplf_order = split /,/,$tplf->{tpl_order}; my @tplf_order = split /,/,$tplf->{tpl_order};
my $logo = "$ctf->{img01}" || "000empty"; my $logo = "$ctf->{img01}" || "";
if($printer_id =~ /Briefpapier/){ if($printer_id =~ /Briefpapier/){
#Ohne Logo da Briefpapier #Ohne Logo da Briefpapier
$logo = "000empty"; $logo = "";
} }
#logging siteformat #logging siteformat
@ -259,7 +258,7 @@ td {
my $position; my $position;
my $h_toppx = "$h_top" . "px"; my $h_toppx = "$h_top" . "px";
$position = "position:absolute; top: $h_toppx;" if($h_top); $position = "position:absolute; top: $h_toppx;" if($h_top);
print $q->div({-style=>"$position width:$width;text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"\n")); print $q->div({-style=>"$position width:$width;text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/images/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"\n"));
} }
#Briefkopf + Adresse #Briefkopf + Adresse
@ -269,7 +268,7 @@ td {
my $ctt = $db->get_content1("contenttrans",$c_id); my $ctt = $db->get_content1("contenttrans",$c_id);
$ctt->{txt01} = $lb->newline($ctt->{txt01},$users->{tiny_mce},"0"); $ctt->{txt01} = $lb->newline($ctt->{txt01},$users->{tiny_mce},"0");
print $q->div({-style=>"width:$width; text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"")),"\n"; print $q->div({-style=>"width:$width; text-align:right;border:0px solid black;margin:0 0 200px 0;"},$q->span({-style=>'margin:0em;'},$q->img({-src=>"$varenv{metahost}/img/images/$logo",-height=>'120px;'})),$q->span({-style=>'font-size:1em;'},"")),"\n";
print $q->start_table({-width=>'100%',-border=>'0',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; print $q->start_table({-width=>'100%',-border=>'0',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
print "<tr>\n"; print "<tr>\n";
@ -293,7 +292,7 @@ td {
my $txid = ""; my $txid = "";
$txid = "TXID: $ctt->{txt16}" if($ctt->{txt16} && $ctt->{state} =~ /payone/i); $txid = "Verwendungszweck TXID: $ctt->{txt16}" if($ctt->{txt16} && $ctt->{state} =~ /payone/i);
my $mailaccount = ""; my $mailaccount = "";
$mailaccount = "Account: $ctt->{txt08}" if($ctt->{txt08}); $mailaccount = "Account: $ctt->{txt08}" if($ctt->{txt08});
@ -340,7 +339,6 @@ td {
sub data_table(){ sub data_table(){
my ($h_top,$c_id,$scol,$ctt_dummy,$mandant_main_id,$kind_of_trans,$tpl_order,$break_table_wc,$max_table_wc,$ctt,$sum_break) = @_; my ($h_top,$c_id,$scol,$ctt_dummy,$mandant_main_id,$kind_of_trans,$tpl_order,$break_table_wc,$max_table_wc,$ctt,$sum_break) = @_;
#print "($h_top,$c_id,$scol,$ctt_dummy,$mandant_main_id,$kind_of_trans,$tpl_order,$break_table_wc,$max_table_wc)";
$ctf = $db->get_content1("contentuser","$mandant_main_id"); $ctf = $db->get_content1("contentuser","$mandant_main_id");
my $umst1619 = $lb->umst_breaking($ctt,""); my $umst1619 = $lb->umst_breaking($ctt,"");
@ -438,7 +436,6 @@ td {
if(($gesamt == 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){ if(($gesamt == 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){
$nullcount++; $nullcount++;
} }
#print "if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){";
if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){ if(($gesamt != 0) && ($cttpos_timestamp <= $max_timestamp || $ctt->{int05} == 1) && ($sum_parts19 <= $max_sum)){
$j++; $j++;
@ -455,12 +452,10 @@ td {
$gesamt = $lb->cashme($gesamt); $gesamt = $lb->cashme($gesamt);
#summieren #summieren
if("$cttpos->{$id}->{int05}" =~ /\d/){ if("$cttpos->{$id}->{int05}" =~ /\d/){
#print "xxx $gesamt $cttpos->{$id}->{int05} |";
$sum_parts0 += $gesamt if("$cttpos->{$id}->{int05}" == "0"); $sum_parts0 += $gesamt if("$cttpos->{$id}->{int05}" == "0");
$sum_parts7 += $gesamt if("$cttpos->{$id}->{int05}" == "7"); $sum_parts7 += $gesamt if("$cttpos->{$id}->{int05}" == "7");
$sum_parts19 += $gesamt if("$cttpos->{$id}->{int05}" >= "16"); $sum_parts19 += $gesamt if("$cttpos->{$id}->{int05}" >= "16");
}else{ }else{
#print "yyy $gesamt $ctf->{txt13} |";
$sum_parts0 += $gesamt if("$ctf->{txt13}" == "0"); $sum_parts0 += $gesamt if("$ctf->{txt13}" == "0");
$sum_parts7 += $gesamt if("$ctf->{txt13}" == "7"); $sum_parts7 += $gesamt if("$ctf->{txt13}" == "7");
$sum_parts19 += $gesamt if($ctf->{txt13} >= 16); $sum_parts19 += $gesamt if($ctf->{txt13} >= 16);
@ -525,9 +520,6 @@ td {
print $q->td({-class=>'tdint'},"$menge"),"\n"; print $q->td({-class=>'tdint'},"$menge"),"\n";
} }
if($ctt->{txt00} =~ /Lieferschein/){
print $q->td(""),"\n" if($key =~ /int02|int04/);
}else{
if($key =~ /int02/){ if($key =~ /int02/){
if($einzel == "0"){ if($einzel == "0"){
$einzel=""; $einzel="";
@ -553,21 +545,20 @@ td {
print $q->td({-nowrap=>'1',-class=>'tdint'},"$gesamt"),"\n"; print $q->td({-nowrap=>'1',-class=>'tdint'},"$gesamt"),"\n";
} }
} }
}
} }
} }
} }
}#end foreach }#end foreach
#Zahlungstext Text & Vorbelegungen #Zahlungstext Text & Vorbelegungen
my $payment_text; my $payment_text = "";
foreach(@tplf_order){ foreach(@tplf_order){
my ($key,$des,$size) = split /=/,$_; my ($key,$des,$size) = split /=/,$_;
if($key =~ /txt52|txt53|txt54|txt55|txt56|txt57|txt58|txt59|txt60/){ if($key =~ /txt5\d/){
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}"); $ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
$ctf->{$key} = $lb->newline($ctf->{$key},$users->{tiny_mce},""); $ctf->{$key} = $lb->newline($ctf->{$key},"","");
$ctt->{state} =~ s/\(payone.*//; $ctt->{state} =~ s/\(payone.*//;
if("$des" =~ /$ctt->{state}/ && ($j <= $max_table_wc || $break_table_wc)){ if($des =~ /$ctt->{state}/ && ($j <= $max_table_wc || $break_table_wc)){
if($sum_parts19 < 0){ if($sum_parts19 < 0){
$payment_text = "$ctf->{txt58}"; $payment_text = "$ctf->{txt58}";
}else{ }else{
@ -690,23 +681,10 @@ td {
my @rechnungstext = split(/\<br \/\>/,$ctf->{$key}); my @rechnungstext = split(/\<br \/\>/,$ctf->{$key});
if($ctt_txt21 =~ /$key/){ if($ctt_txt21 =~ /$key/){
foreach(@rechnungstext){ foreach(@rechnungstext){
if($_ =~ /signature/){
print $q->Tr();
print $q->td({-style=>'border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
print $q->td({-style=>'width:4em;height:2em;'},"&nbsp;");
print $q->td({-style=>'border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
print $q->Tr();
print $q->td({-class=>'tdpdf3'}, "&nbsp;&nbsp; Unterschrift Mieterin / Mieter &nbsp;&nbsp;","\n");
print $q->td("&nbsp;");
print $q->td({-class=>'tdpdf3'}, "Unterschrift ","\n");
print $q->Tr();
print $q->td({-colspan=>3, -style=>'border-bottom-width:2px;border-bottom-style:solid;border-bottom-color:black;'},"&nbsp;");
}else{
$style = "padding:0.4em;text-align:left;font-size:1em;"; $style = "padding:0.4em;text-align:left;font-size:1em;";
$style = "padding:0.4em;text-align:left;font-size:1em;" if($_ =~ s/\<b\>// && $node_name ne "Rückgabe"); $style = "padding:0.4em;text-align:left;font-size:1em;" if($_ =~ s/\<b\>// && $node_name ne "Rückgabe");
print $q->Tr(); print $q->Tr();
print $q->td({-style=>"$style",-colspan=>3},"$_"); print $q->td({-style=>"$style",-colspan=>3},"$_");
}
} }
} }
} }
@ -756,10 +734,6 @@ td {
print $q->start_table({-border=>'0',-align=>'left'}); print $q->start_table({-border=>'0',-align=>'left'});
print $q->Tr(); print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "TEL: $ctf->{txt08}","\n"); print $q->td({-class=>'tdpdf2'}, "TEL: $ctf->{txt08}","\n");
#if($ctf->{txt09}){
# print $q->Tr();
# print $q->td({-class=>'tdpdf2'}, "FAX: $ctf->{txt09}","\n");
#}
print $q->Tr(); print $q->Tr();
print $q->td({-class=>'tdpdf2'}, "$ctf->{txt10}","\n"); print $q->td({-class=>'tdpdf2'}, "$ctf->{txt10}","\n");
print $q->Tr(); print $q->Tr();

View file

@ -814,12 +814,14 @@ sub net_booking(){
#This is the automatic user tariff setter #This is the automatic user tariff setter
my $tariff_nr = ""; my $tariff_nr = "";
my @adr_tariff = (); my @adr_tariff = ();
@adr_tariff = ("$ctadr->{txt30}"); if($ctadr->{txt30}){
@adr_tariff = split(/\s+/,$ctadr->{txt30}) if($ctadr->{txt30} =~ /\w\s+\w/); @adr_tariff = ("$ctadr->{txt30}");
@adr_tariff = split(/\s+/,$ctadr->{txt30}) if($ctadr->{txt30} =~ /\w\s+\w/);
}
if(ref($ct) eq "HASH" && $ct->{main_id}){ if(ref($ct) eq "HASH" && $ct->{main_id}){
foreach my $id (keys (%$tariff_content)){ foreach my $id (keys (%$tariff_content)){
foreach(@adr_tariff){ foreach(@adr_tariff){
$bw->log("adr_tariff array form $ctadr->{txt30}",$_,"");
if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{int12} == $ct->{main_id} && $tariff_content->{$id}->{barcode} && $_ == $tariff_content->{$id}->{barcode}){ if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{int12} == $ct->{main_id} && $tariff_content->{$id}->{barcode} && $_ == $tariff_content->{$id}->{barcode}){
$bw->log("1. net_booking tariff loop matches:",$tariff_content->{$id}->{barcode},""); $bw->log("1. net_booking tariff loop matches:",$tariff_content->{$id}->{barcode},"");
$tariff_nr = $tariff_content->{$id}->{barcode}; $tariff_nr = $tariff_content->{$id}->{barcode};
@ -841,10 +843,11 @@ sub net_booking(){
if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{int12} == $ct->{main_id} && $tariff_content->{$id}->{barcode}){ if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{int12} == $ct->{main_id} && $tariff_content->{$id}->{barcode}){
$bw->log("2. net_booking tariff loop matches:",$tariff_content->{$id}->{barcode},""); $bw->log("2. net_booking tariff loop matches:",$tariff_content->{$id}->{barcode},"");
$tariff_nr = $tariff_content->{$id}->{barcode}; $tariff_nr = $tariff_content->{$id}->{barcode};
}
if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{barcode}){
push(@txt30, "$tariff_content->{$id}->{barcode}"); push(@txt30, "$tariff_content->{$id}->{barcode}");
} }
#if($tariff_content->{$id}->{int12} && $tariff_content->{$id}->{barcode}){
# push(@txt30, "$tariff_content->{$id}->{barcode}");
#}
} }
} }
$bw->log("--> NO user tariff defined, update user account to fallback default public or private or hidden",\@txt30,""); $bw->log("--> NO user tariff defined, update user account to fallback default public or private or hidden",\@txt30,"");

View file

@ -83,6 +83,7 @@ sub tpl(){
print $q->hidden(-name=>'owner',-override=>'1', -value=>"$users_dms->{u_id}"); print $q->hidden(-name=>'owner',-override=>'1', -value=>"$users_dms->{u_id}");
print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ct->{c_id}"); print $q->hidden(-name=>'c_id',-override=>'1', -value=>"$ct->{c_id}");
print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$rel->{rel_id}"); print $q->hidden(-name=>'rel_id',-override=>'1', -value=>"$rel->{rel_id}");
print $q->hidden(-name=>'main_id',-override=>'1', -value=>"$rel->{main_id}");
print $but->singlesubmit7("rel_edit","save_user","$ib{save}"); print $but->singlesubmit7("rel_edit","save_user","$ib{save}");
print "</td>\n"; print "</td>\n";
}else{ }else{
@ -96,13 +97,13 @@ sub tpl(){
foreach (@tpl_order){ foreach (@tpl_order){
$i++; $i++;
my ($key,$des,$size) = split /=/,$_; my ($key,$des,$size) = split /=/,$_;
$size = "60" if($key =~ /ct_name|txt/ && !$size); $size = "60" if($key =~ /ct_name|txt|img/ && !$size);
$ct->{$key} = $q->unescapeHTML("$ct->{$key}"); $ct->{$key} = $q->unescapeHTML("$ct->{$key}");
$ct->{$key} = $lb->newline($ct->{$key}); $ct->{$key} = $lb->newline($ct->{$key});
my $value = ""; my $value = "";
if($R::config2edit){ if($R::config2edit){
if($size eq "area"){ if($size eq "area"){
$value = "<textarea class='etxtarea' name='$key' rows=2 cols=40>$ct->{$key}</textarea>"; $value = "<textarea class='etxtarea' name='$key' rows=2 cols=60>$ct->{$key}</textarea>";
}elsif($size =~ /\w\+\w/){ }elsif($size =~ /\w\+\w/){
my ($a,$b) = split /\+/,$size; my ($a,$b) = split /\+/,$size;
my $a_checked; my $a_checked;
@ -110,18 +111,20 @@ sub tpl(){
$a_checked = "checked" if($ct->{$key} eq "$a" || !$ct->{$key}); $a_checked = "checked" if($ct->{$key} eq "$a" || !$ct->{$key});
$b_checked = "checked" if($ct->{$key} eq "$b"); $b_checked = "checked" if($ct->{$key} eq "$b");
$value = "$a <input type='radio' name='$key' value='$a' $a_checked> $b <input type='radio' name='$key' value='$b' $b_checked>"; $value = "$a <input type='radio' name='$key' value='$a' $a_checked> $b <input type='radio' name='$key' value='$b' $b_checked>";
}elsif($key =~ /txt|ct_name/){ }elsif($key =~ /txt/){
$value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=$size maxlength=200>"; $value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=$size maxlength=200>";
}elsif($key =~ /int/){ }elsif($key =~ /int/){
$value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=6 maxlength=10>"; $value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=6 maxlength=10>";
}elsif($key =~ /img/){ }elsif($key =~ /img/){
$value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=40 maxlength=40>"; $value = "<input class='etxt' type='text' name='$key' value='$ct->{$key}' size=$size maxlength=200>";
} }
}else{ }else{
$value = "$ct->{$key}"; $value = "$ct->{$key}";
} }
print $q->Tr(); print $q->Tr();
if($key =~ /header/){ if($key =~ /header01/){
print $q->td({-class=>'tdval2',-colspan=>'2'},$q->b("<br />$dbt->{operator}->{$varenv{dbname}}->{project} $dbt->{operator}->{$varenv{dbname}}->{oprefix} $dbt->{operator}->{$varenv{dbname}}->{database}->{dbname}")),"\n";
}elsif($key =~ /header/){
print $q->td({-class=>'tdval2',-colspan=>'2'},$q->b("<br />$des")),"\n"; print $q->td({-class=>'tdval2',-colspan=>'2'},$q->b("<br />$des")),"\n";
}elsif($users_dms->{u_id} eq $varenv{superu_id}){ }elsif($users_dms->{u_id} eq $varenv{superu_id}){
print $q->td({-class=>'tdescr2'},"$des ($key)"),"\n"; print $q->td({-class=>'tdescr2'},"$des ($key)"),"\n";

View file

@ -71,8 +71,10 @@ sub tpl(){
my $vibuchen_mtime = ""; my $vibuchen_mtime = "";
$vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time}); $vibuchen_mtime = "Payone post " . $lb->time4de($ctt->{pay_time},1) . " . " if($ctt->{pay_time});
my $tpl = $db->get_tpl($ctf->{txt36}); my $tpl = $db->get_tpl("208");
my @tpl_order = split /,/,$tpl->{tpl_order}; my @tpl_order = split /,/,$tpl->{tpl_order};
my $tplf = $db->get_tpl("201");#Firma tpl
my @tplf_order = split /,/,$tplf->{tpl_order};
my $txt20 = $R::txt20 || $ctt->{txt20} || "";#Leistungsdatum my $txt20 = $R::txt20 || $ctt->{txt20} || "";#Leistungsdatum
my $int05 = $R::int05 || $ctt->{int05} || "";#manuell my $int05 = $R::int05 || $ctt->{int05} || "";#manuell
@ -233,19 +235,10 @@ EOF
$gesamt = $lb->round($gesamt); $gesamt = $lb->round($gesamt);
$gesamt = $lb->cashme($gesamt); $gesamt = $lb->cashme($gesamt);
$ctf->{txt13} = $1 if($ctf->{txt13} =~ /(\d+)/); if($cttpos->{$id}->{int05} =~ /\d/){
if($node_name =~ /steuerfrei/){#dirty hack $sum_parts19 += $gesamt;
$sum_parts0 += $gesamt;
}elsif("$cttpos->{$id}->{int05}" =~ /\d/){
$sum_parts0 += $gesamt if("$cttpos->{$id}->{int05}" == "0");
$sum_parts7 += $gesamt if("$cttpos->{$id}->{int05}" == "7");
#$sum_parts19 += $gesamt if("$cttpos->{$id}->{int05}" == "19");
$sum_parts19 += $gesamt if($cttpos->{$id}->{int05} >= 16);
}else{ }else{
#print "yyy $gesamt $ctf->{txt13} |"; $sum_parts19 += $gesamt;
$sum_parts0 += $gesamt if("$ctf->{txt13}" == "0");
$sum_parts7 += $gesamt if("$ctf->{txt13}" == "7");
$sum_parts19 += $gesamt if("$ctf->{txt13}" >= "16");
} }
#1. Spalte #1. Spalte
@ -428,10 +421,30 @@ EOF
$sum_umst19 = $lb->cashme($sum_umst19,","); $sum_umst19 = $lb->cashme($sum_umst19,",");
$sum_paid = $lb->cashme($sum_paid,","); $sum_paid = $lb->cashme($sum_paid,",");
my $payment_text = "";
foreach(@tplf_order){
my ($key,$des,$size) = split /=/,$_;
if($key =~ /txt5\d/){
$ctf->{$key} = $q->unescapeHTML("$ctf->{$key}");
$ctf->{$key} = $lb->newline($ctf->{$key},"","");
$ctt->{state} =~ s/\(payone.*//;
if($des =~ /$ctt->{state}/){
if($sum_parts19 < 0){
$payment_text = "$ctf->{txt58}";
}else{
$payment_text = "$ctf->{$key}";
}
}
}
}
my $n="5"; my $n="5";
my $m= 1 + $k - $n; my $m= 1 + $k - $n;
$m++; $m++;
print "<tr><td colspan='$m'>&nbsp;</td><td style='font-size:1em;' colspan='$n'>\n"; print "<tr>\n";
print "<td class='element' style='border:0;' colspan='$m'>$payment_text</td>\n";
print "<td style='font-size:1em;' colspan='$n'>\n";
print $q->start_table({-class=>'list',-style=>'border-top:1px;border-style:solid;border-color:black;', -border=>'0', -width=>'100%',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n"; print $q->start_table({-class=>'list',-style=>'border-top:1px;border-style:solid;border-color:black;', -border=>'0', -width=>'100%',-align=>'center', -cellpadding=>'3', -cellspacing=>'0'}),"\n";
print $q->Tr("\n"); print $q->Tr("\n");
print $q->td("&nbsp;"); print $q->td("&nbsp;");

View file

@ -41,7 +41,8 @@ sub tpl(){
if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $dbt->{copri_conf}->{stage} eq "test")){ if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $dbt->{copri_conf}->{stage} eq "test")){
my $coo = $q->cookie('domcookie') || $q->param('sessionid') || ""; my $coo = $q->cookie('domcookie') || $q->param('sessionid') || "";
my $api_test = "sharee_kn"; #my $api_test = "sharee_kn";
my $api_test = "sharee_fr01";
print $q->div({-style=>'text-align:right;height:25px;padding:6px 15px 6px 0px;background-color:white'},$q->a({-style=>"color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test", -target=>'_blank'}," [ $api_test ] "),"$users_sharee->{txt08}",$q->a({-style=>"color:#$bgcolor1;", -href=>"logout_sharee$session"},"logout")),"\n"; print $q->div({-style=>'text-align:right;height:25px;padding:6px 15px 6px 0px;background-color:white'},$q->a({-style=>"color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test", -target=>'_blank'}," [ $api_test ] "),"$users_sharee->{txt08}",$q->a({-style=>"color:#$bgcolor1;", -href=>"logout_sharee$session"},"logout")),"\n";
} }

View file

@ -34,7 +34,7 @@ sub envonline(){
dbuser => $globalconf{$server_type}{$server_key}{database}->{user}, dbuser => $globalconf{$server_type}{$server_key}{database}->{user},
dbpassw => $globalconf{$server_type}{$server_key}{database}->{passwd}, dbpassw => $globalconf{$server_type}{$server_key}{database}->{passwd},
dbhost => $globalconf{$server_type}{$server_key}{database}->{host}, dbhost => $globalconf{$server_type}{$server_key}{database}->{host},
syshost => $globalconf{$server_type}{$server_key}->{dir_app}, syshost => $globalconf{$server_type}{$server_key}->{dir_dms},
wwwhost => $globalconf{$server_type}{$server_key}->{operatorDMS}, wwwhost => $globalconf{$server_type}{$server_key}->{operatorDMS},
praefix => $globalconf{$server_type}{$server_key}{database}->{dbname}, praefix => $globalconf{$server_type}{$server_key}{database}->{dbname},
systype => "sharee",#(azn) systype => "sharee",#(azn)

View file

@ -48,6 +48,7 @@ sub tpl(){
if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $users_sharee->{c_id} eq "22262" || $dbt->{copri_conf}->{stage} eq "test")){ if($users_sharee->{c_id} && $R::sharee_edit ne "delete_account2" && ($users_sharee->{c_id} eq $varenv->{superu_id} || $users_sharee->{c_id} eq "22262" || $dbt->{copri_conf}->{stage} eq "test")){
my $coo = $q->cookie('domcookie') || $q->param('sessionid') || ""; my $coo = $q->cookie('domcookie') || $q->param('sessionid') || "";
my $api_test = "sharee_kn"; my $api_test = "sharee_kn";
#my $api_test = "sharee_fr01";
print $q->div({-style=>'float:right;text-align:right;height:25px;padding:6px 15px;background-color:white'},$q->a({-style=>"color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test", -target=>'_blank'}," [ $api_test ] ")),"\n"; print $q->div({-style=>'float:right;text-align:right;height:25px;padding:6px 15px;background-color:white'},$q->a({-style=>"color:#$bgcolor1;", -href=>"$varenv->{metahost}/src/scripts/tests/index.pl?sessionid=$coo\&api_test=$api_test", -target=>'_blank'}," [ $api_test ] ")),"\n";
} }