mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-07-01 19:56:50 +02:00
payone_cron refacoring
This commit is contained in:
parent
d5ea6afcd7
commit
43dbaba064
8 changed files with 50 additions and 573 deletions
|
@ -143,8 +143,8 @@ if($q->param('request') eq "auth_verify"){
|
|||
if(ref($auth) eq "HASH" && $auth->{authcookie}){
|
||||
$response = { %$response, %$auth };
|
||||
}else{
|
||||
$response->{response_state} = "Failure: cannote match authcookie";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ elsif($q->param('request') eq "authout"){
|
|||
$response->{response_text} = "Auf Wiedersehen.";
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
}
|
||||
#authorization
|
||||
|
@ -258,8 +258,8 @@ elsif($q->param('request') eq "booking_request"){
|
|||
$response->{timeCode} = 0;#if fails
|
||||
}
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1002: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,7 @@ elsif($q->param('request') eq "booking_cancel" || $q->param('request') eq "booki
|
|||
}
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ elsif($q->param('request') eq "user_rentals_history"){
|
|||
$response->{rentals} = $apif->rentals($record,$authraw,"0");
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -395,8 +395,8 @@ elsif($q->param('request') eq "user_bikes_occupied"){
|
|||
$response = { %$response, %$auth };
|
||||
($response->{bikes_occupied},$response->{uri_operator_array},$response->{user_group},$response->{user_tour}) = $jsc->loop_sharees($q,$authraw,$return_merchant);
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1001: authcookie on primary not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
|
||||
}else{
|
||||
|
@ -407,8 +407,8 @@ elsif($q->param('request') eq "user_bikes_occupied"){
|
|||
my $record = $apif->user_bikes_occupied($q,$authraw);
|
||||
$response->{bikes_occupied} = $apif->rentals($record,$authraw,"1");
|
||||
}else{
|
||||
$response->{response_state} = "Failure 1001: authcookie on operator not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Session wurde unterbrochen";
|
||||
$response->{response_state} = "Failure 1001: authcookie not defined";
|
||||
$response->{response_text} = "Entschuldigung, die Sitzung wurde unterbrochen";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -623,8 +623,8 @@ elsif($q->param('request') eq "stations_available"){
|
|||
|
||||
my ($auth,$authraw) = $apif->auth_verify($q);
|
||||
#Mein konrad App
|
||||
#if($dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} eq "176"){
|
||||
#if($aowner && $aowner eq "176"){
|
||||
#if($dbt->{merchant_ids}->{$varenv{merchant_id}}->{id} eq "176")
|
||||
#if($aowner && $aowner eq "176")
|
||||
#$response->{merchant_message} = "Herzlich Willkommen bei der neuen konrad App! Die App ist zwar schon installierbar, bis zur vollständigen Umstellung des Systems sind aber noch keine Räder ausleihbar. Das ist erst voraussichtlich Ende Januar der Fall und wird den Nutzern noch mitgeteilt. Danke für Ihr Verständnis! Ihr konrad-Team";
|
||||
#}
|
||||
$response = { %$response, %$auth };
|
||||
|
|
|
@ -351,7 +351,7 @@ sub barcodeable(){
|
|||
return ($ct_name,$barcode);
|
||||
}
|
||||
|
||||
#FIXME or change to barcode=c_id
|
||||
#TODO or change to barcode=c_id
|
||||
#get free barcode
|
||||
sub get_freenr(){
|
||||
my $self = shift;
|
||||
|
@ -367,31 +367,6 @@ sub get_freenr(){
|
|||
}
|
||||
}
|
||||
|
||||
#get free Rechnungs Nummer
|
||||
sub get_freeReNr(){
|
||||
my $self = shift;
|
||||
my ($table,$barcode_start,$barcode_end,$column,$content) = @_;
|
||||
my $now_time = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
my $freenr = $db->collect_content3("$table","$column","$content");
|
||||
my $s_id = $barcode_start;
|
||||
my $e_id = $barcode_end || 100000;
|
||||
$freenr->{$s_id}->{barcode} = "1000" if(!$freenr->{$s_id}->{barcode});
|
||||
for (; $s_id < $e_id; $s_id++){
|
||||
#if($freenr->{$s_id}->{barcode} != $s_id){
|
||||
if($freenr->{$s_id}->{ct_name} && $freenr->{$s_id}->{ct_name} !~ /^$s_id/){
|
||||
open(RENR, ">> $varenv{logdir}/get_freeReNr.log");
|
||||
print RENR "* $now_time --------------- \n";
|
||||
print RENR "$table,$barcode_start,$barcode_end,$column,$content\n";
|
||||
print RENR "for (; $s_id < $e_id; $s_id++){\n";
|
||||
print RENR "if($freenr->{$s_id}->{ct_name} && $freenr->{$s_id}->{ct_name} !~ /^$s_id/){\n";
|
||||
print RENR "return $s_id;\n";
|
||||
close RENR;
|
||||
return $s_id;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#CAsh
|
||||
sub cashme(){
|
||||
my $self = shift;
|
||||
|
|
|
@ -7,7 +7,7 @@ package Payment;
|
|||
#Adapted from payone_post.pl
|
||||
#
|
||||
#enable for syntax check
|
||||
#use lib "/var/www/copri4/shareedms-primary/src";
|
||||
#use lib "/var/www/copri-bike/shareedms-primary/src";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -543,7 +543,7 @@ sub pdfmandat {
|
|||
my $ctadr = $dbt->fetch_record($dbh,$authref);
|
||||
|
||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
open(EMA, ">> $varenv->{logdir}/SEPA-PDFprint.log");
|
||||
open(EMA, ">> $varenv->{logdir}/copri-print.log");
|
||||
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($ctadr->{txt27} && $ctadr->{txt27} =~ /active|pending/){
|
||||
|
@ -571,44 +571,26 @@ sub payone_capture(){
|
|||
|
||||
my $lang = "de";
|
||||
my $mandant_id = 100002;
|
||||
my $main_id = 300008;#Rechnung
|
||||
my $today4db = strftime("%Y-%m-%d %H:%M:%S",localtime(time));
|
||||
my $retval = {};
|
||||
my $return_text = "\n";
|
||||
#my $main_id = 300008;#Rechnung
|
||||
my $main_id = $ctt->{main_id};
|
||||
my $retval = "";
|
||||
my $return_text = "";
|
||||
my $dbh = "";
|
||||
|
||||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||
my $node = $db->get_node4multi($main_id,$lang);#Rechnung node
|
||||
if($node->{int06} > 0){
|
||||
if($ctt->{ct_name} !~ /\d/){
|
||||
#HoleCheck if ReNr available before ReNr counter
|
||||
my $ReNr_start = 40000;
|
||||
my $freeNr = $lb->get_freeReNr("contenttrans","$ReNr_start","$node->{int06}","txt00","$node->{node_name}");
|
||||
my $nextNr = $node->{int06};
|
||||
$nextNr = $freeNr if($freeNr && $freeNr < $node->{int06});
|
||||
$db->update_content4change("contenttrans",$ctt->{c_id},$nextNr,$nextNr,"barcode");
|
||||
if(!$freeNr){
|
||||
my $int06 = $node->{int06} + 1;
|
||||
$db->updater("nodes","main_id",$main_id,"int06",$int06,"","","","","no_time");
|
||||
}
|
||||
my $int06 = $node->{int06} + 1;
|
||||
$db->updater("nodes","main_id",$main_id,"int06",$int06,"","","","","no_time");
|
||||
}
|
||||
}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->{int06} | $ctt->{ct_name} can not generate invoice number\n";
|
||||
return $return_text;
|
||||
}
|
||||
|
||||
#We do it only if txt80 end_time in Firma is defined
|
||||
my $max_timestamp;
|
||||
if($ctf->{txt80} && $ctt->{txt20}){
|
||||
if($ctt->{txt20} =~ /(\d{2})\.(\d{2})\.(\d{4})$/){
|
||||
$max_timestamp = "$1.$2.$3 23:59";
|
||||
}else{
|
||||
$return_text = "---> Payment.pm max_timestamp: $max_timestamp fails and exit\n";
|
||||
return $return_text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $state = $ctt->{state};
|
||||
if($varenv->{Zahlungsweise}){
|
||||
my @_paymentstate = split(/\|/,$varenv->{Zahlungsweise});
|
||||
|
@ -631,18 +613,16 @@ sub payone_capture(){
|
|||
#in cron we set OPOS anyway. If payone captured, it will be set int14=null
|
||||
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;
|
||||
}
|
||||
|
||||
#preauth
|
||||
if($ctadr->{int03} && $ctadr->{int03} == 1 && $ctadr->{ct_name} && $ctadr->{ct_name} =~ /\w{2}-\d+/ && (!$ctt->{txt16} || $ctt->{int03} ne "1")){
|
||||
$return_text .= "---> trying payone preauthorizationSEPA\n";
|
||||
$self->preauthorizationSEPA_main($varenv,$ctadr,$ctt,$owner);
|
||||
|
||||
sleep 2;
|
||||
}elsif($ctadr->{int03} && $ctadr->{int03} == 2 && $ctadr->{ct_name} && length($ctadr->{ct_name}) >= 19 && (!$ctt->{txt16} || $ctt->{int03} ne "2")){
|
||||
$return_text .= "---> trying payone preauthorizationCC\n";
|
||||
$self->preauthorizationCC_main($varenv,$ctadr,$ctt,$owner);
|
||||
sleep 2;
|
||||
}
|
||||
|
@ -652,47 +632,35 @@ sub payone_capture(){
|
|||
|
||||
#SEPA capture
|
||||
if($ctt->{int03} == 1 && $ctt->{txt16} && $ctt->{state} =~ /SEPA/){#SEPA
|
||||
$return_text .= "---> trying payone captureSEPA\n";
|
||||
$self->captureSEPA_main($varenv,$ctadr,$ctt,$owner);
|
||||
}
|
||||
#CC capture
|
||||
if($ctt->{int03} == 2 && $ctt->{txt16} && $ctt->{state} =~ /Kreditkarte/){#CC
|
||||
$return_text .= "---> trying payone captureCC\n";
|
||||
elsif($ctt->{int03} == 2 && $ctt->{txt16} && $ctt->{state} =~ /Kreditkarte/){#CC
|
||||
$self->captureCC_main($varenv,$ctadr,$ctt,$owner);
|
||||
}
|
||||
|
||||
#Rechnungspositionen itime > end Abrechnunsgdatum --> results in generating new Invoice
|
||||
if($max_timestamp && $varenv->{wwwhost} =~ /tink/){
|
||||
my $ctpos_ck = $db->get_content7("contenttranspos","ct_id",$ctt->{c_id},"itime",">","$max_timestamp");
|
||||
if($ctpos_ck->{c_id}){
|
||||
my $ctadr = $db->get_content7("contentadr","c_id",$ctadr->{c_id});
|
||||
my $ct_id = $dbt->insert_contenttrans($dbh,$ctadr,"300008","218","----",$owner);
|
||||
$db->updater("contenttrans","c_id",$ct_id,"start_time","$ctt->{start_time}",$owner);
|
||||
$db->updater("contenttrans","c_id",$ct_id,"end_time","$ctt->{end_time}",$owner);
|
||||
|
||||
$db->updater("contenttranspos","ct_id",$ctt->{c_id},"ct_id",$ct_id,"","itime",">","$max_timestamp","no_time");
|
||||
}
|
||||
else{
|
||||
$return_text = "Payment.pm can not get TXID\n";
|
||||
}
|
||||
|
||||
#wkhtml
|
||||
#TODO to sharee
|
||||
if(1==1){
|
||||
my $praefix = "$ctt->{txt00}-TINK";
|
||||
my $praefix = "$ctt->{txt00}-$varenv->{praefix}";#like Rechnung-sharee_operator
|
||||
my $wc_line= $ctt->{int04};#Adresse.Tabelle
|
||||
my $topdf = "$varenv->{basedir}/src/wkhtmltopdf-amd64";
|
||||
my $print_return = `$topdf --page-size A4 "$varenv->{wwwhost}/Printpreview?printer_id=PDF\&mandant_main_id=$mandant_id\&main_id=$main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$owner\&wc=$wc_line" $varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf 2>&1`;
|
||||
$return_text .= "$topdf --page-size A4 \"$varenv->{wwwhost}/Printpreview?printer_id=PDF\&mandant_main_id=$mandant_id\&main_id=$main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$owner\&wc=$wc_line\" $varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf\n";
|
||||
|
||||
#FIXME to new mailTarnsport
|
||||
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
||||
open(EMA, ">> $varenv->{logdir}/copri-print.log");
|
||||
print EMA "$now_dt\n$topdf --page-size A4 \"$varenv->{wwwhost}/Printpreview?printer_id=PDF\&mandant_main_id=$mandant_id\&main_id=$main_id\&ct_name2print=$ctt->{ct_name}\&c_id4trans=$ctt->{c_id}\&u_id=$owner\&wc=$wc_line\" $varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf\n";
|
||||
|
||||
#send_invoice infomail
|
||||
#if(-f "$varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf"){
|
||||
# system(`$varenv->{basedir}/src/Mod/newsletter_tink.pl "$varenv->{basedir}" "$varenv->{wwwhost}" "send_invoice" "$ctadr->{c_id}" "$ctt->{ct_name}"`);
|
||||
# $return_text .= "---> Sent Invoice Info e-mail\n";
|
||||
#}
|
||||
|
||||
if(-f "$varenv->{pdf}/$praefix-$ctt->{ct_name}.pdf"){
|
||||
system(`$varenv->{basedir}/src/scripts/mailTransport.pl "$varenv->{syshost}" "send_invoice" "$ctt->{c_id}" "$praefix-$ctt->{ct_name}.pdf"`);
|
||||
print EMA "---> Sent Invoice Info e-mail\n";
|
||||
}
|
||||
close EMA;
|
||||
}
|
||||
#TODO
|
||||
#$retval = $db->get_content1("contenttrans",$ctt->{c_id});
|
||||
|
||||
return ($retval,$return_text);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ sub preinit(){
|
|||
my ($ct_last,$c_idnew);
|
||||
|
||||
my $table = "contenttrans";
|
||||
$table = "contenttver" if($users_dms->{kind_of_trans} =~ /Veranstaltung|Proje/);
|
||||
my $ctt = $db->get_content1($table,$users_dms->{c_id4trans});
|
||||
my $buchen_mtime = $lb->time4de($ctt->{mtime});
|
||||
|
||||
|
@ -167,45 +166,10 @@ sub preinit(){
|
|||
$table = "contenttrans";
|
||||
$foreign_key="ct_id";
|
||||
$main_id = $parent_trans->{main_id} if(!$R::main_id);
|
||||
}elsif($ib_key =~ /new_tver/){
|
||||
$table = "contenttver";
|
||||
$foreign_key="cv_id";
|
||||
$main_id = $parent_trans->{main_id} if(!$R::main_id);
|
||||
}
|
||||
my $node = $db->get_node4multi($main_id,$lang);
|
||||
|
||||
#new content for all sub_nodes
|
||||
if($varenv{dataflow} =~ /wiki/ && $table && $main_id){
|
||||
my $main_id2 = $main_id;
|
||||
$main_id2 = $node->{parent_id} if($main_id >= 300000);
|
||||
my ($dd1,$mo1,$yy1) = split(/\./,$R::s_start_date_time);
|
||||
my $dt1 = $yy1 . $mo1 . $dd1;
|
||||
my ($dd2,$mo2,$yy2) = split(/\./,$today);
|
||||
my $dt2 = $yy2 . $mo2 . $dd2;
|
||||
if($R::s_start_date_time && ($dt1 > $dt2)){
|
||||
return "failure::Der Vorgang wurde abgebrochen. Das anlegen von Datensätzen in die Zukunft ist nicht vorgesehen da problematisch Aufgrund der Übernahme der Inhalte aus \"Vereinbarungen\". ($R::s_start_date_time > $today alias $dt1 > $dt2)";
|
||||
}
|
||||
my $start_time = $R::s_start_date_time || $today;
|
||||
my $sub_nodes = $db->collect_node($main_id2,$lang,$users_dms->{u_id});
|
||||
#only sub-nodes 300000
|
||||
foreach my $id (sort { lc($sub_nodes->{$a}->{node_name}) cmp lc($sub_nodes->{$b}->{node_name}) } (keys (%$sub_nodes))){
|
||||
#print "$sub_nodes->{$id}->{main_id}|";
|
||||
my $ctrel;
|
||||
$ctrel = $db->get_ctrel2($table,"",$sub_nodes->{$id}->{main_id},$lang,"","",$R::template_id,"start_time","$start_time","=");
|
||||
if(!$ctrel->{c_id} && $sub_nodes->{$id}->{main_id} > 300000){
|
||||
$c_idnew = $db->insert_content($table,$ct_name,$users_dms->{u_id},$sort);
|
||||
$i_rows += 1 if($c_idnew > 0);
|
||||
$db->updater("$table","c_id",$c_idnew,"ct_name","$c_idnew");
|
||||
$db->updater("$table","c_id",$c_idnew,"start_time","$start_time");
|
||||
my $ctrel_desc = $db->get_ctrel2($table,"",$sub_nodes->{$id}->{main_id},$lang,"","",$R::template_id,"","","","start_time","DESC");#copy Vereinbarung und Wissenswertes
|
||||
$db->updater("$table","c_id",$c_idnew,"txt00","$ctrel_desc->{txt00}");
|
||||
#$db->updater("$table","c_id",$c_idnew,"txt01","$ctrel_desc->{txt01}");#don't copy
|
||||
my $rel_id = $db->insert_relationlist($table,$sub_nodes->{$id}->{main_id},$lang,$c_idnew,$R::template_id,$foreign_key);
|
||||
}
|
||||
}
|
||||
print redirect("$varenv{wwwhost}$script$path?detail_search=1\&s_start_date_time=$start_time\&s_end_date_time=$start_time\&return=$i_rows-$u_rows-$d_rows");
|
||||
exit 0;
|
||||
}elsif($table && $main_id && $R::kind_of_trans){
|
||||
if($table && $main_id){
|
||||
my $rel = $db->get_rel4tpl($main_id,$lang);
|
||||
$c_idnew = $db->insert_content2($table,$ct_name,$users_dms->{u_id},"");
|
||||
$i_rows += 1 if($c_idnew > 0);
|
||||
|
@ -223,7 +187,7 @@ sub preinit(){
|
|||
$db->update_content4change($table,$c_idnew,"","txt61,txt63","txt21") if($R::kind_of_trans =~ /Faktur|Verleih/);#Text-3
|
||||
}
|
||||
}else{
|
||||
return "failure::Fehler, Datensatz kann nicht angelegt werden weil folgende Informationen fehlen: ($main_id && $R::kind_of_trans)";
|
||||
return "failure::Fehler, Datensatz kann nicht angelegt werden weil folgende Informationen fehlen: ($main_id)";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -800,17 +764,10 @@ sub preinit(){
|
|||
#Node and HoleCkeck depended auto Rechnungs-Nummer
|
||||
if(($node->{int06} > 0) && ("$ctt->{ct_name}" !~ /\d/ || "$R::set_main_id" != "$rel->{main_id}")){
|
||||
|
||||
#HoleCheck if ReNr available before ReNr counter
|
||||
my $ReNr_start = 40000;
|
||||
my $freeNr = $lb->get_freeReNr("$table","$ReNr_start","$node->{int06}","txt00","$node->{node_name}");
|
||||
my $nextNr = $node->{int06};
|
||||
$nextNr = $freeNr if($freeNr && $freeNr < $node->{int06});
|
||||
|
||||
$u_rows += $db->update_content4change($table,$c_id,$nextNr,$nextNr,"barcode");
|
||||
if(!$freeNr){
|
||||
my $int06 = $node->{int06} + 1;
|
||||
$u_rows += $db->updater("nodes","main_id",$R::set_main_id,"int06",$int06,"","","","","no_time");
|
||||
}
|
||||
$u_rows += $db->update_content4change($table,$c_id,$nextNr,$nextNr,"barcode");
|
||||
my $int06 = $node->{int06} + 1;
|
||||
$u_rows += $db->updater("nodes","main_id",$R::set_main_id,"int06",$int06,"","","","","no_time");
|
||||
|
||||
|
||||
}elsif($ctt->{ct_name} !~ /\d/){
|
||||
|
@ -891,16 +848,6 @@ sub preinit(){
|
|||
$sum_kaution =~ s/,/\./;
|
||||
}
|
||||
|
||||
#We do it only if txt80 end_time in Firma is defined
|
||||
my $max_timestamp;
|
||||
if($ctf->{txt80} && $ctt->{txt20}){
|
||||
if($ctt->{txt20} =~ /(\d{2})\.(\d{2})\.(\d{4})$/){
|
||||
$max_timestamp = "$1.$2.$3 23:59";
|
||||
}else{
|
||||
return "failure::Abbruch, das Leistungsdatum muss als einfaches Datum (Bsp: 31.08.2016) oder als Zeitraum wie im folgenden Beispiel definiert sein: 01.08.2016 - 31.08.2016\n";
|
||||
}
|
||||
}
|
||||
|
||||
$u_rows += $db->update_content4change($table,$c_id,"","$sum_paid","int01");
|
||||
$db->update_content4change($table,$c_id,"",$state,"state");
|
||||
$db->update_content4change($table,$c_id,"","now()","mtime");
|
||||
|
@ -933,19 +880,6 @@ sub preinit(){
|
|||
}else{
|
||||
$db->updater($table,"c_id","$c_id","int14","null","","","","","");
|
||||
}
|
||||
|
||||
#Rechnungspositionen itime > end Abrechnunsgdatum
|
||||
if($max_timestamp){
|
||||
my $ctpos_ck = $db->get_content7("contenttranspos","ct_id","$c_id","itime",">","$max_timestamp");
|
||||
if($ctpos_ck->{c_id}){
|
||||
my $ctadr = $db->get_content7("contentadr","c_id",$ctt->{int10});
|
||||
my $ct_id = $dbt->insert_contenttrans($dbh,$ctadr,"300008","218","----",$users_dms->{u_id});
|
||||
$db->updater($table,"c_id",$ct_id,"start_time","$ctt->{start_time}",$users_dms->{u_id});
|
||||
$db->updater($table,"c_id",$ct_id,"end_time","$ctt->{end_time}",$users_dms->{u_id});
|
||||
|
||||
$i_rows = $db->updater("contenttranspos","ct_id","$c_id","ct_id","$ct_id","","itime",">","$max_timestamp","no_time");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -954,11 +888,9 @@ sub preinit(){
|
|||
my $c_id4print = $users_dms->{c_id4trans};
|
||||
$c_id4print= $R::c_id if($R::printer_id =~ /Adresse|Kunde/);
|
||||
if($c_id4print){
|
||||
my $print_return;
|
||||
my $print_return = "";
|
||||
my $exit_code = 1;
|
||||
my $table = "contenttrans";
|
||||
$table = "contenttver" if($rel->{ct_table} eq "contenttver");
|
||||
$table = "contentadr" if($R::printer_id =~ /Adresse|Kunde/);#jbw
|
||||
my $ctt = $db->get_content1($table,$c_id4print);
|
||||
my $praefix = "$ctt->{txt00}-$varenv{praefix}";#like Rechnung-sharee_operator
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue