payone sequence by form transaction

This commit is contained in:
Rainer Gümpelein 2022-02-19 13:20:23 +01:00
parent 9eec83fa3d
commit 32213a7b46
4 changed files with 27 additions and 26 deletions

View file

@ -231,7 +231,7 @@ EOF
}
if(($c_idpos == $cttpos->{$id}->{c_id}) && ($R::trans2edit && $R::trans2edit =~ /transpos/)){
if($key =~ /ct_name/){
print $q->td({-class=>'element',-style=>"$set_style text-align:right;"}, $q->textfield(-class=>'etxt',-style=>"text-align:right;min-width:120px;",-name=>"ct_name",-default=>"$ct_pos", -override=>'1',-size=>10,-readonly=>'1'),"\n");
print $q->td({-class=>'element',-style=>"$set_style text-align:right;"}, $q->textfield(-class=>'etxt',-style=>"text-align:right;min-width:120px;",-name=>"ct_name",-default=>"$ct_pos", -override=>'1',-size=>10,-readonly=>'1')),"\n";
}elsif($key eq "int26"){
my $co2saving = "";
if($cttpos->{$id}->{int26}){
@ -248,7 +248,7 @@ EOF
}elsif($key =~ /int03/){
#TODO, autocalc Menge Preis by time-range
#Menge
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10, -autofocus=>1),"\n");
print $q->td({-colspan=>'1',-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>10, -autofocus=>1)),"\n";
}elsif($key =~ /int02/){
#Einzelpreis
print $q->td({-class=>'element',-style=>"$txtstyle $set_style"},$q->textfield(-class=>'etxt',-style=>"$txtstyle",-name=>"col_$key",-default=>"$cttpos->{$id}->{$key}", -override=>'1',-size=>"$isize",-maxlength=>100),"\n");
@ -425,7 +425,7 @@ EOF
my $m= 1 + $k - $n;
$m++;
print "<tr>\n";
print "<td class='element6' colspan='$m'>$payment_text</td>\n";
print "<td colspan='$m'><div class='element6'>$payment_text</div></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";
@ -470,6 +470,7 @@ EOF
#if(!$ctt->{close_time} && $varenv{Zahlungsweise} && $users_dms->{u_id} == $dbt->{copri_conf}->{superu_id}){
if($users_dms->{int03} == 2){
#only if user is also a primary DMS user with invoice rw
print $q->hidden(-name=>'printer_id', -value=>"PDF - Normalpapier", -override=>'1');
my $dbh_primary = $dbt->dbconnect_extern("sharee_primary");
my $users_dms_primary = { u_id => 0 };
$users_dms_primary = $dbt->select_users($dbh_primary,$users_dms->{u_id},"and int03=2");
@ -490,7 +491,11 @@ EOF
}
$kind_of_payment = "$ctt->{state}" if($ctt->{state});
print $q->hidden(-name=>'printer_id', -value=>"PDF - Normalpapier", -override=>'1');
#further payone capture are only allowed if OPOS && sequence && TXID is set
if($ctt->{int14} && $ctt->{int18} && $ctt->{txt16}){
print $q->div({-class=>'element6',-style=>'float:right;'},"seq", $q->textfield(-class=>'etxt',-name=>"payone_sequence",-default=>"", -override=>'1',-size=>"1",-maxlength=>1)),"\n";
}
my $send_invoice_checkbox = 1;
$send_invoice_checkbox = 0 if($ctt->{txt30});
print $q->div({-class=>'element6',-style=>'float:right;'},
@ -519,7 +524,7 @@ EOF
my $style = "color:red;" if($ctt->{int01} ne $sum_paid);
my $opos = "";
$opos = "OPOS" if($ctt->{int14} && $ctt->{int14} > 0);
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"[<span style='color:red;'>$opos</span> $vibuchen_mtime Gebucht $ctt->{int01} € \"$ctt->{state}\"]") if($ctt->{state});
print $q->div({-style=>"padding:0.5em;font-size:0.81em;width:98%;text-align:right;"},"<span style='color:red;'>$opos</span> $vibuchen_mtime Gebucht $ctt->{int01} € \"$ctt->{state}\"") if($ctt->{state});
}
if( -f "$varenv{pdf}/$praefix-$ctt->{ct_name}.pdf" && $varenv{metahost}){