use SL::DB::Helper::ALL; # since we work on meta data, we need everything
use SL::DB::Helper::Mappings;
use SL::Locale::String qw(t8);
use SL::DB::Helper::ALL; # since we work on meta data, we need everything
use SL::DB::Helper::Mappings;
use SL::Locale::String qw(t8);
use Rose::Object::MakeMethods::Generic (
scalar => [ qw(from to writer company location) ],
use Rose::Object::MakeMethods::Generic (
scalar => [ qw(from to writer company location) ],
taxkey => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Taxkey'), },
tax_accname => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Tax Account Name'), },
tax_accno => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Tax Account'), },
taxkey => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Taxkey'), },
tax_accname => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Tax Account Name'), },
tax_accno => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Tax Account'), },
- transdate => { type => 'Rose::DB::Object::Metadata::Column::Date', text => t8('Invoice Date'), },
+ transdate => { type => 'Rose::DB::Object::Metadata::Column::Date', text => t8('Transdate'), },
vcnumber => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Customer/Vendor Number'), },
customer_id => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Customer (database ID)'), },
vendor_id => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Vendor (database ID)'), },
itime => { type => 'Rose::DB::Object::Metadata::Column::Date', text => t8('Create Date'), },
vcnumber => { type => 'Rose::DB::Object::Metadata::Column::Text', text => t8('Customer/Vendor Number'), },
customer_id => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Customer (database ID)'), },
vendor_id => { type => 'Rose::DB::Object::Metadata::Column::Integer', text => t8('Vendor (database ID)'), },
itime => { type => 'Rose::DB::Object::Metadata::Column::Date', text => t8('Create Date'), },
- my $tax_amount = defined $amount->{net_amount}
- ? $::form->format_amount($myconfig, abs($amount->{amount}) - abs($amount->{net_amount}), 5)
- : 0;
+ my $tax_amount = defined $amount->{net_amount} ? abs($amount->{amount}) - abs($amount->{net_amount}) : 0;
+
+ $tax = {} if abs($tax_amount) < 0.001;
my %row = (
amount => $::form->format_amount($myconfig, abs($amount->{amount}),5),
debit_accno => $soll->{accno},
debit_accname => $soll->{accname},
debit_amount => $::form->format_amount($myconfig, abs(-$soll->{amount}),5),
my %row = (
amount => $::form->format_amount($myconfig, abs($amount->{amount}),5),
debit_accno => $soll->{accno},
debit_accname => $soll->{accname},
debit_amount => $::form->format_amount($myconfig, abs(-$soll->{amount}),5),
credit_accno => $haben->{accno},
credit_accname => $haben->{accname},
credit_amount => $::form->format_amount($myconfig, abs($haben->{amount}),5),,
credit_accno => $haben->{accno},
credit_accname => $haben->{accname},
credit_amount => $::form->format_amount($myconfig, abs($haben->{amount}),5),,
- credit_tax => $haben->{tax_accno} ? $tax_amount : 0,
- tax => $tax_amount,
+ credit_tax => $haben->{tax_accno} ? $::form->format_amount($myconfig, $tax_amount, 5) : 0,
+ tax => $::form->format_amount($myconfig, $tax_amount, 5),
notes => $haben->{notes},
(map { ($_ => $tax->{$_}) } qw(taxkey tax_accname tax_accno taxdescription)),
notes => $haben->{notes},
(map { ($_ => $tax->{$_}) } qw(taxkey tax_accname tax_accno taxdescription)),
my $query = "SELECT " . join(', ', @select_tokens) . " FROM $table $where_clause";
my $sth = $::form->get_standard_dbh->prepare($query);
my $query = "SELECT " . join(', ', @select_tokens) . " FROM $table $where_clause";
my $sth = $::form->get_standard_dbh->prepare($query);
my $person = $::myconfig{name};
my $contact = join ', ',
(t8("Email") . ": $::myconfig{email}" ) x!! $::myconfig{email},
my $person = $::myconfig{name};
my $contact = join ', ',
(t8("Email") . ": $::myconfig{email}" ) x!! $::myconfig{email},