mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-23 04:06:27 +01:00
invoice_nr nextNr
This commit is contained in:
parent
3ea4b37b78
commit
b9af62e5fc
3 changed files with 59 additions and 42 deletions
|
@ -853,9 +853,9 @@ sub update_one(){
|
||||||
|
|
||||||
my $one = $one_in;
|
my $one = $one_in;
|
||||||
if($update->{table} =~ /^users|relation|node|template/){
|
if($update->{table} =~ /^users|relation|node|template/){
|
||||||
$one .= ",change='now()'";
|
$one .= ",change='now()'" if($update->{change} ne "no_time");
|
||||||
}else{
|
}else{
|
||||||
$one .= ",mtime='now()'";
|
$one .= ",mtime='now()'" if($update->{mtime} ne "no_time");
|
||||||
}
|
}
|
||||||
$one .= ",owner=$update->{owner}" if($update->{owner});
|
$one .= ",owner=$update->{owner}" if($update->{owner});
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@ my $uri_encode = URI::Encode->new( { encode_reserved => 1 } );
|
||||||
|
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
use Lib::Config;
|
use Lib::Config;
|
||||||
use Mod::Libenz;
|
|
||||||
use Mod::Libenzdb;
|
|
||||||
use Mod::Callib;
|
use Mod::Callib;
|
||||||
use Mod::DBtank;
|
use Mod::DBtank;
|
||||||
use Mod::Basework;
|
use Mod::Basework;
|
||||||
|
@ -28,8 +26,6 @@ use Data::Dumper;
|
||||||
|
|
||||||
my $q = new CGI;
|
my $q = new CGI;
|
||||||
my $cf = new Config;
|
my $cf = new Config;
|
||||||
my $lb = new Libenz;
|
|
||||||
my $db = new Libenzdb;
|
|
||||||
my $cal = new Callib;
|
my $cal = new Callib;
|
||||||
my $dbt = new DBtank;
|
my $dbt = new DBtank;
|
||||||
my $bw = new Basework;
|
my $bw = new Basework;
|
||||||
|
@ -644,17 +640,31 @@ sub payone_capture(){
|
||||||
my $return_text = "";
|
my $return_text = "";
|
||||||
my $dbh = "";
|
my $dbh = "";
|
||||||
|
|
||||||
|
my $update_ctt = {
|
||||||
|
table => "contenttrans",
|
||||||
|
mtime => "now()",
|
||||||
|
owner => $owner,
|
||||||
|
int01 => $sum_paid,
|
||||||
|
int14 => 2,
|
||||||
|
};
|
||||||
|
|
||||||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||||
my $node = $db->get_node4multi($main_id,$lang);#Rechnung node
|
my $node = $dbt->get_node($dbh,$main_id);#Rechnung node
|
||||||
if($node->{int06} > 0){
|
if($node->{invoice_nr} > 0){
|
||||||
if($ctt->{ct_name} !~ /\d/){
|
if($ctt->{ct_name} !~ /\d/){
|
||||||
my $nextNr = $node->{int06};
|
my $nextNr = $node->{invoice_nr};
|
||||||
$db->update_content4change("contenttrans",$ctt->{c_id},$nextNr,$nextNr,"barcode");
|
$update_ctt->{ct_name} = "$nextNr";
|
||||||
my $int06 = $node->{int06} + 1;
|
$update_ctt->{barcode} = "$nextNr";
|
||||||
$db->updater("nodes","main_id",$main_id,"int06",$int06,"","","","","no_time");
|
my $update_node = {
|
||||||
|
table => "nodes",
|
||||||
|
main_id => "$main_id",
|
||||||
|
change => "no_time",
|
||||||
|
};
|
||||||
|
my $invoice_nr = $node->{invoice_nr} + 1;
|
||||||
|
$dbt->update_one($dbh,$update_node,"invoice_nr='$invoice_nr'");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$return_text = "payone_cron Payment.pm exit, $node->{int06} | $ctt->{ct_name} can not generate invoice number\n";
|
$return_text = "payone_cron Payment.pm exit, $node->{invoice_nr} | $ctt->{ct_name} can not generate invoice number\n";
|
||||||
return $return_text;
|
return $return_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,19 +683,11 @@ sub payone_capture(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $update_ctt = {
|
$update_ctt->{state} = "$state";
|
||||||
table => "contenttrans",
|
|
||||||
mtime => "now()",
|
|
||||||
owner => $owner,
|
|
||||||
int01 => $sum_paid,
|
|
||||||
int14 => 2,
|
|
||||||
state => "$state",
|
|
||||||
};
|
|
||||||
$dbt->update_record($dbh,$update_ctt,$ctt);
|
$dbt->update_record($dbh,$update_ctt,$ctt);
|
||||||
|
|
||||||
#in cron we set OPOS anyway. If payone captured, it will be set int14=null
|
#in cron we set OPOS anyway. If payone captured, it will be set int14=null
|
||||||
if(!$state || $state !~ /payone/){
|
if(!$state || $state !~ /payone/){
|
||||||
#$db->updater("contenttrans","c_id",$ctt->{c_id},"txt22","cronjob fail","","","","","");
|
|
||||||
$return_text = "Payment.pm can not preauthorization because of absent payment-data in ctadr.c_id:$ctadr->{c_id}, SEPA/CC:$ctadr->{int03}, $ctadr->{ct_name}, we exit\n";
|
$return_text = "Payment.pm can not preauthorization because of absent payment-data in ctadr.c_id:$ctadr->{c_id}, SEPA/CC:$ctadr->{int03}, $ctadr->{ct_name}, we exit\n";
|
||||||
return $return_text;
|
return $return_text;
|
||||||
}
|
}
|
||||||
|
@ -701,7 +703,13 @@ sub payone_capture(){
|
||||||
}
|
}
|
||||||
|
|
||||||
#check if preauth txid is done by payone
|
#check if preauth txid is done by payone
|
||||||
$ctt = $db->get_content1("contenttrans",$ctt->{c_id});
|
my $pref = {
|
||||||
|
table => "contenttrans",
|
||||||
|
fetch => "one",
|
||||||
|
template_id => 218,
|
||||||
|
c_id => $ctt->{c_id},
|
||||||
|
};
|
||||||
|
$ctt = $dbt->fetch_record($dbh,$pref);
|
||||||
|
|
||||||
#SEPA capture
|
#SEPA capture
|
||||||
if($ctt->{int03} == 1 && $ctt->{txt16} && $ctt->{state} =~ /SEPA/){#SEPA
|
if($ctt->{int03} == 1 && $ctt->{txt16} && $ctt->{state} =~ /SEPA/){#SEPA
|
||||||
|
|
|
@ -594,23 +594,36 @@ sub preinit(){
|
||||||
my ($node,$ct_exist);
|
my ($node,$ct_exist);
|
||||||
return "failure::Bitte erst einen Formular-Typ wählen" if($R::set_main_id <= "300000");
|
return "failure::Bitte erst einen Formular-Typ wählen" if($R::set_main_id <= "300000");
|
||||||
$u_rows += $db->update_relation2("",$lang,$R::set_main_id,"",$rel->{rel_id}) if(!$R::close_time && $rel->{rel_id});
|
$u_rows += $db->update_relation2("",$lang,$R::set_main_id,"",$rel->{rel_id}) if(!$R::close_time && $rel->{rel_id});
|
||||||
$node = $db->get_node4multi($R::set_main_id,$lang);
|
#$node = $db->get_node4multi($R::set_main_id,$lang);
|
||||||
if($node->{main_id} > 300000){
|
$node = $dbt->get_node($dbh,$R::set_main_id);
|
||||||
my $rows = $node->{int10} + 1;
|
#if($node->{main_id} > 300000){
|
||||||
$db->updater("nodes","main_id",$node->{main_id},"int10",$rows);
|
# my $rows = $node->{int10} + 1;
|
||||||
}
|
# $db->updater("nodes","main_id",$node->{main_id},"int10",$rows);
|
||||||
|
#}
|
||||||
|
|
||||||
|
my $update_ctt = {
|
||||||
|
table => "contenttrans",
|
||||||
|
mtime => "now()",
|
||||||
|
owner => $users_dms->{u_id},
|
||||||
|
};
|
||||||
|
|
||||||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||||
if(($node->{int06} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){
|
if(($node->{invoice_nr} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){
|
||||||
|
|
||||||
my $nextNr = $node->{int06};
|
my $nextNr = $node->{invoice_nr};
|
||||||
$u_rows += $db->update_content4change($table,$c_id,$nextNr,$nextNr,"barcode");
|
$update_ctt->{ct_name} = "$nextNr";
|
||||||
my $int06 = $node->{int06} + 1;
|
$update_ctt->{barcode} = "$nextNr";
|
||||||
$u_rows += $db->updater("nodes","main_id",$R::set_main_id,"int06",$int06,"","","","","no_time");
|
my $update_node = {
|
||||||
|
table => "nodes",
|
||||||
|
main_id => "$R::set_main_id",
|
||||||
|
change => "no_time",
|
||||||
|
};
|
||||||
|
my $invoice_nr = $node->{invoice_nr} + 1;
|
||||||
|
$dbt->update_one($dbh,$update_node,"invoice_nr='$invoice_nr'");
|
||||||
|
|
||||||
|
|
||||||
}elsif($ctt->{ct_name} !~ /\d/){
|
#}elsif($ctt->{ct_name} !~ /\d/){
|
||||||
$db->update_content4change($table,$c_id,$c_id,$c_id,"barcode") ;
|
#$db->update_content4change($table,$c_id,$c_id,$c_id,"barcode") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Change Formular Type -----------------------------------------------
|
#Change Formular Type -----------------------------------------------
|
||||||
|
@ -634,13 +647,9 @@ sub preinit(){
|
||||||
$sum_paid = $R::sum_paid;
|
$sum_paid = $R::sum_paid;
|
||||||
$sum_paid =~ s/,/\./;
|
$sum_paid =~ s/,/\./;
|
||||||
}
|
}
|
||||||
my $update_ctt = {
|
|
||||||
table => "contenttrans",
|
$update_ctt->{int01} = "$sum_paid";
|
||||||
mtime => "now()",
|
$update_ctt->{state} = "$state";
|
||||||
owner => $users_dms->{u_id},
|
|
||||||
int01 => $sum_paid,
|
|
||||||
state => "$state",
|
|
||||||
};
|
|
||||||
$update_ctt->{int14} = 2 if($state =~ /payone/);#set OPOS
|
$update_ctt->{int14} = 2 if($state =~ /payone/);#set OPOS
|
||||||
$dbt->update_record($dbh,$update_ctt,$ctt);
|
$dbt->update_record($dbh,$update_ctt,$ctt);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue