X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=54f5483e861066bfd600101de1a001fae35e0e32;hb=e0fb092b1a1ac0429036b41abc0a85a011e0d9a8;hp=23847553dc5fcd6296d73949cfaaf1518c8d8e23;hpb=1baea8cb6d9de284e35c8dc981c7a9559e9e9888;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 23847553d..54f5483e8 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -173,7 +173,8 @@ sub new_from { $terms = $source->customer->payment_terms if !defined $terms && $source->customer; 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), + cp_id language_id taxzone_id tax_point globalproject_id transaction_description currency_id delivery_term_id + billing_address_id), @columns), transdate => $params{transdate} // DateTime->today_local, gldate => DateTime->today_local, duedate => $terms ? $terms->calc_date(reference_date => DateTime->today_local) : DateTime->today_local, @@ -538,7 +539,8 @@ sub invoice_type { my ($self) = @_; return 'ar_transaction' if !$self->invoice; - return 'credit_note' if $self->type eq 'credit_note' && $self->amount < 0 && !$self->storno; + # stornoed credit_notes are still credit notes and not invoices + return 'credit_note' if $self->type eq 'credit_note' && $self->amount < 0; return 'invoice_storno' if $self->type ne 'credit_note' && $self->amount < 0 && $self->storno; return 'credit_note_storno' if $self->type eq 'credit_note' && $self->amount > 0 && $self->storno; return 'invoice';