Differentiate Fibu fees on accounting

This commit is contained in:
ragu 2023-07-07 08:50:13 +02:00
parent b32214c15d
commit a3d251e643
7 changed files with 74 additions and 22 deletions

View file

@ -137,7 +137,7 @@ sub handler {
c_id => $ctadr->{c_id},
};
$ctadr = $dbt->fetch_tablerecord($dbh,$fetch_ctadr) if($ctadr->{c_id});
my $vde_on_fail = $ctadr->{int12} || 1;#keep last or set 1
my $vde_on_fail = $ctadr->{int12} || 2;#keep last or set 1 #2023-07-05 changed to set 2
if($ctt->{c_id} > 0){

View file

@ -565,7 +565,8 @@ sub preinit(){
my $sum_paid = "null";
my $sum_operatorcredit = "null";
my $sum_fibugeb = "null";
my $sumgeb_teil = "null";
my $sumgeb_bank = "null";
my $state = $R::state || "";
$update_ctt->{state} = "$state";
$update_ctt->{int14} = 2;#set OPOS
@ -583,10 +584,16 @@ sub preinit(){
$update_ctt->{int14} = "null";
}
if($R::set_state eq "buchen" && $R::sum_fibugeb){
$sum_fibugeb = $R::sum_fibugeb;
$sum_fibugeb =~ s/,/\./;
$update_ctt->{int08} = $sum_fibugeb;
if($R::set_state eq "buchen" && $R::sumgeb_teil){
$sumgeb_teil = $R::sumgeb_teil;
$sumgeb_teil =~ s/,/\./;
$update_ctt->{int08} = $sumgeb_teil;
}
if($R::set_state eq "buchen" && $R::sumgeb_bank){
$sumgeb_bank = $R::sumgeb_bank;
$sumgeb_bank =~ s/,/\./;
$update_ctt->{int07} = $sumgeb_bank;
}
$u_rows += $dbt->update_record($dbh,$update_ctt,$ctt);

View file

@ -526,15 +526,17 @@ sub operator_accounting2calc {
int100 => 0,
};
#TODO #accounting Bank Gebühren
foreach(@tplf_order){
my ($key,$val,$size) = split /=/,$_;
if($key =~ /int/){
my $invoice_brutto = 0;
if($key eq "int01" && $ctpos->{int01}){
$invoice_brutto = $ctpos->{int01};
#substract Fibu Gebühren like Rücklastschrift or Mahnung
#substract TeilRad Gebühren
$invoice_brutto = $ctpos->{int01} - $ctpos->{int08} if($ctpos->{int08} && $ctpos->{int08} > 0);
#substract Bank Gebühren
$invoice_brutto = $ctpos->{int01} - $ctpos->{int07} if($ctpos->{int07} && $ctpos->{int07} > 0);
$oac->{int99} = $invoice_brutto;
#invoice capture netto
$oac->{int01} = $invoice_brutto / 119 * 100;

View file

@ -88,7 +88,14 @@ sub sms_ack_digest {
my $ret_json = "";
if($sms_to =~ /^\+1/){
#no routing fix
$dbt->update_one($dbh,$ctadr,"int13=1");
my $upsms_ack = {
table => "contentadr",
mtime => "now()",
owner => "$owner",
c_id => "$ctadr->{c_id}",
};
$dbt->update_one($dbh,$upsms_ack,"int13=1");
print FILE "no routing fix for $sms_to\n";
}else{
$ret_json = $self->get_sms_gtx($request);