qq| a.shippingpoint, a.storno, a.storno_id, a.globalproject_id, | .
qq| a.marge_total, a.marge_percent, | .
qq| a.transaction_description, a.direct_debit, | .
+ qq| a.type, | .
qq| pr.projectnumber AS globalprojectnumber, | .
qq| c.name, c.customernumber, c.country, c.ustid, b.description as customertype, | .
qq| c.id as customer_id, | .
my ($self) = @_;
return 'ar_transaction' if !$self->invoice;
+ 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';
# 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 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('Invoice');
}
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('Invoice (one letter abbreviation)');
}
my $is_storno = $ar->{storno} && $ar->{storno_id};
my $has_storno = $ar->{storno} && !$ar->{storno_id};
- $ar->{type} =
- $has_storno ? $locale->text("Invoice with Storno (abbreviation)") :
- $is_storno ? $locale->text("Storno (one letter abbreviation)") :
- $ar->{amount} < 0 ? $locale->text("Credit note (one letter abbreviation)") :
- $ar->{invoice} ? $locale->text("Invoice (one letter abbreviation)") :
- $locale->text("AR Transaction (abbreviation)");
+ if ($ar->{type} eq 'invoice_for_advance_payment') {
+ $ar->{type} =
+ $has_storno ? $locale->text("Invoice for Advance Payment with Storno (abbreviation)") :
+ $is_storno ? $locale->text("Storno (one letter abbreviation)") :
+ $locale->text("Invoice for Advance Payment (one letter abbreviation)");
+
+ } else {
+ $ar->{type} =
+ $has_storno ? $locale->text("Invoice with Storno (abbreviation)") :
+ $is_storno ? $locale->text("Storno (one letter abbreviation)") :
+ $ar->{amount} < 0 ? $locale->text("Credit note (one letter abbreviation)") :
+ $ar->{invoice} ? $locale->text("Invoice (one letter abbreviation)") :
+ $locale->text("AR Transaction (abbreviation)");
+ }
map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(netamount tax amount paid due marge_total marge_percent);
'Invoice email and Contact Person' => 'E-Mail des Rechnungsempfängers und CC an Ansprechpartner',
'Invoice email settings' => 'E-Mail Rechnungsversand',
'Invoice filter' => 'Rechnungsfilter',
+ 'Invoice for Advance Payment (one letter abbreviation)' => 'A',
+ 'Invoice for Advance Payment with Storno (abbreviation)' => 'A(S)',
'Invoice for fees' => 'Rechnung über Gebühren',
'Invoice has already been storno\'d!' => 'Diese Rechnung wurde bereits storniert.',
'Invoice number' => 'Rechnungsnummer',
'Invoice email and Contact Person' => '',
'Invoice email settings' => '',
'Invoice filter' => '',
+ 'Invoice for Advance Payment (one letter abbreviation)' => '',
+ 'Invoice for Advance Payment with Storno (abbreviation)' => '',
'Invoice for fees' => '',
'Invoice has already been storno\'d!' => '',
'Invoice number' => '',