Revision abd56be1
Von Rolf Fluehmann vor fast 8 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
260 | 260 |
$self->_post_add_acctrans({ $params{ar_id} => $self->amount * -1 }); |
261 | 261 |
|
262 | 262 |
$self->_post_update_allocated($data{allocated}); |
263 |
|
|
264 |
$self->_post_book_rounding($data{rounding}); |
|
263 | 265 |
}; |
264 | 266 |
|
265 | 267 |
if ($self->db->in_transaction) { |
... | ... | |
296 | 298 |
} |
297 | 299 |
} |
298 | 300 |
|
301 |
sub _post_book_rounding { |
|
302 |
my ($self, $rounding) = @_; |
|
303 |
|
|
304 |
my $tax_id = SL::DB::Manager::Tax->find_by(taxkey => 0)->id; |
|
305 |
my $rnd_accno = $rounding == 0 ? 0 |
|
306 |
: $rounding > 0 ? SL::DB::Default->get->rndgain_accno_id |
|
307 |
: SL::DB::Default->get->rndloss_accno_id |
|
308 |
; |
|
309 |
if ($rnd_accno != 0) { |
|
310 |
SL::DB::AccTransaction->new(trans_id => $self->id, |
|
311 |
chart_id => $rnd_accno, |
|
312 |
amount => $rounding, |
|
313 |
tax_id => $tax_id, |
|
314 |
taxkey => 0, |
|
315 |
project_id => $self->globalproject_id, |
|
316 |
transdate => $self->transdate, |
|
317 |
chart_link => $rnd_accno)->save; |
|
318 |
} |
|
319 |
} |
|
320 |
|
|
299 | 321 |
sub add_ar_amount_row { |
300 | 322 |
my ($self, %params ) = @_; |
301 | 323 |
|
Auch abrufbar als: Unified diff
added roundings for periodic invoices