Revision 92e904d1
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/IO.pm | ||
---|---|---|
77 | 77 |
$main::lxdebug->leave_sub(); |
78 | 78 |
} |
79 | 79 |
|
80 |
sub get_active_taxes_for_chart { |
|
81 |
my ($self, $chart_id, $transdate, $tax_id) = @_; |
|
82 |
|
|
83 |
my $chart = SL::DB::Chart->new(id => $chart_id)->load; |
|
84 |
my $active_taxkey = $chart->get_active_taxkey($transdate); |
|
85 |
|
|
86 |
my $where = [ chart_categories => { like => '%' . $chart->category . '%' } ]; |
|
87 |
|
|
88 |
if ( defined $tax_id && $tax_id >= 0 ) { |
|
89 |
$where = [ or => [ chart_categories => { like => '%' . $chart->category . '%' }, |
|
90 |
id => $tax_id |
|
91 |
] |
|
92 |
]; |
|
93 |
} |
|
94 |
|
|
95 |
my $taxes = SL::DB::Manager::Tax->get_all( |
|
96 |
where => $where, |
|
97 |
sort_by => 'taxkey, rate', |
|
98 |
); |
|
99 |
|
|
100 |
my $default_tax = first { $active_taxkey->tax_id == $_->id } @{ $taxes }; |
|
101 |
$default_tax->{is_default} = 1 if $default_tax; |
|
102 |
|
|
103 |
return @{ $taxes }; |
|
104 |
} |
|
80 | 105 |
|
81 | 106 |
1; |
Auch abrufbar als: Unified diff
InvoiceItem: Hinzufügen der Felder für Konten und Steuer
Es werden die Wert von relink_accounts als Default genommen und der
Nutzer kann dies ändern. Es werden alle nötigen Steuerdaten in die Form
geschrieben.