X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=0a607988580ec792ecba76d79993138c1f76af99;hb=0b36b2259c1300ee5360a9c8d5aee1f321abd364;hp=f33d75dca57ec582a405c492d1e7a77f5510814c;hpb=cf0455f57e7fe398b59a3c4a01f459d16b9db419;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index f33d75dca..0a6079885 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -174,7 +174,7 @@ sub new_from { my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes salesman_id cusordnumber ordnumber department_id cp_id language_id taxzone_id globalproject_id transaction_description currency_id delivery_term_id), @columns), - transdate => DateTime->today_local, + transdate => $params{transdate} // DateTime->today_local, gldate => DateTime->today_local, duedate => $terms ? $terms->calc_date(reference_date => DateTime->today_local) : DateTime->today_local, invoice => 1, @@ -275,7 +275,7 @@ sub post { $self->_post_add_acctrans($data{amounts_cogs}); $self->_post_add_acctrans($data{amounts}); - $self->_post_add_acctrans($data{taxes}); + $self->_post_add_acctrans($data{taxes_by_chart_id}); $self->_post_add_acctrans({ $params{ar_id} => $self->amount * -1 }); @@ -609,6 +609,12 @@ sub mark_as_paid { $self->update_attributes(paid => $self->amount); } +sub effective_tax_point { + my ($self) = @_; + + return $self->tax_point || $self->deliverydate || $self->transdate; +} + 1; __END__