X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=2b4fd59ef9fa9ca305715ef3c42db5c501901041;hb=d8275f6e998ac5f51c6edd786f6e4ae9db6f577f;hp=c5c29dd8ed8351665b3d491d01f8f1e78805a253;hpb=844a541e0d8f59644540413f675e8f07cd154cf6;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index c5c29dd8e..2b4fd59ef 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -16,6 +16,7 @@ use SL::DB::Helper::LinkedRecords; use SL::DB::Helper::PDF_A; use SL::DB::Helper::PriceTaxCalculator; use SL::DB::Helper::PriceUpdater; +use SL::DB::Helper::SalesPurchaseInvoice; use SL::DB::Helper::TransNumberGenerator; use SL::DB::Helper::ZUGFeRD; use SL::Locale::String qw(t8); @@ -539,7 +540,11 @@ 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; + return 'invoice_for_advance_payment_storno' if $self->type eq 'invoice_for_advance_payment' && $self->amount < 0 && $self->storno; + return 'invoice_for_advance_payment' if $self->type eq 'invoice_for_advance_payment'; + return 'final_invoice' if $self->type eq 'final_invoice'; + # 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'; @@ -558,6 +563,9 @@ sub displayable_type { return t8('Credit Note') if $self->invoice_type eq 'credit_note'; return t8('Invoice') . "(" . t8('Storno') . ")" if $self->invoice_type eq 'invoice_storno'; return t8('Credit Note') . "(" . t8('Storno') . ")" if $self->invoice_type eq 'credit_note_storno'; + return t8('Invoice for Advance Payment') if $self->invoice_type eq 'invoice_for_advance_payment'; + return t8('Invoice for Advance Payment') . "(" . t8('Storno') . ")" if $self->invoice_type eq 'invoice_for_advance_payment_storno'; + return t8('Final Invoice') if $self->invoice_type eq 'final_invoice'; return t8('Invoice'); } @@ -572,6 +580,9 @@ sub abbreviation { return t8('Credit note (one letter abbreviation)') if $self->invoice_type eq 'credit_note'; return t8('Invoice (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->invoice_type eq 'invoice_storno'; return t8('Credit note (one letter abbreviation)') . "(" . t8('Storno (one letter abbreviation)') . ")" if $self->invoice_type eq 'credit_note_storno'; + return t8('Invoice for Advance Payment (one letter abbreviation)') if $self->invoice_type eq 'invoice_for_advance_payment'; + return t8('Invoice for Advance Payment with Storno (abbreviation)') if $self->invoice_type eq 'invoice_for_advance_payment_storno'; + return t8('Final Invoice (one letter abbreviation)') if $self->invoice_type eq 'final_invoice'; return t8('Invoice (one letter abbreviation)'); }