request_quotation => 'OrderItem',
invoice => 'InvoiceItem',
invoice_for_advance_payment => 'InvoiceItem',
+ final_invoice => 'InvoiceItem',
purchase_invoice => 'InvoiceItem',
credit_note => 'InvoiceItem',
purchase_delivery_order => 'DeliveryOrderItem',
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';
+ 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 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');
}
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)');
}
invoice => $main::locale->text('Invoice'),
invoice_copy => $main::locale->text('Invoice Copy'),
invoice_for_advance_payment => $main::locale->text('Invoice for Advance Payment'),
+ final_invoice => $main::locale->text('Final Invoice'),
pick_list => $main::locale->text('Pick List'),
proforma => $main::locale->text('Proforma Invoice'),
purchase_order => $main::locale->text('Purchase Order'),
my ($self) = @_;
my $prefix =
- (first { $self->{type} eq $_ } qw(invoice invoice_for_advance_payment credit_note)) ? 'inv'
+ (first { $self->{type} eq $_ } qw(invoice invoice_for_advance_payment final_invoice credit_note)) ? 'inv'
: ($self->{type} =~ /_quotation$/) ? 'quo'
: ($self->{type} =~ /_delivery_order$/) ? 'do'
: ($self->{type} =~ /letter/) ? 'letter'
my $attachment_filename = $main::locale->unquote_special_chars('HTML', $self->get_formname_translation());
my $prefix = $self->get_number_prefix_for_type();
- if ($self->{preview} && (first { $self->{type} eq $_ } qw(invoice invoice_for_advance_payment credit_note))) {
+ if ($self->{preview} && (first { $self->{type} eq $_ } qw(invoice invoice_for_advance_payment final_invoice credit_note))) {
$attachment_filename .= ' (' . $recipient_locale->text('Preview') . ')' . $self->get_extension_for_format();
} elsif ($attachment_filename && $self->{"${prefix}number"}) {
# $main::locale->text('UNIMPORT')
# $main::locale->text('invoice')
# $main::locale->text('invoice_for_advance_payment')
+# $main::locale->text('final_invoice')
# $main::locale->text('proforma')
# $main::locale->text('sales_order')
# $main::locale->text('pick_list')
($form->{type} eq 'invoice_for_advance_payment') ? (
opthash("invoice_for_advance_payment", $form->{PD}{invoice_for_advance_payment}, $locale->text('Invoice for Advance Payment')),
) : undef,
+ ($form->{type} eq 'final_invoice') ? (
+ opthash("final_invoice", $form->{PD}{final_invoice}, $locale->text('Final Invoice')),
+ ) : undef,
($form->{type} =~ /_delivery_order$/) ? (
opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Delivery Order')),
opthash('pick_list', $form->{PD}{pick_list}, $locale->text('Pick List')),
# transdate madness.
my $transdate = "";
- if ( (any {$form->{type} eq $_} qw(invoice credit_note invoice_for_advance_payment)) or ($form->{script} eq 'ir.pl') ) {
+ if ( (any {$form->{type} eq $_} qw(invoice credit_note invoice_for_advance_payment final_invoice)) or ($form->{script} eq 'ir.pl') ) {
# use deliverydate for sales and purchase invoice, if it exists
# also use deliverydate for credit notes
$transdate = $form->{tax_point} || $form->{deliverydate} || $form->{invdate};
# entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen
my $taxdate = $form->{tax_point} ||$form->{deliverydate} || $form->{invdate};
- # better type? maybe define Invoice->invoice_type
- if (!$already_booked && $form->{type} ne 'invoice_for_advance_payment') {
+ if (!$already_booked && $form->{type} eq 'final_invoice') {
my $invoices_for_advance_payment = $self->_get_invoices_for_advance_payment($form->{convert_from_ar_ids} || $form->{id});
if (scalar @$invoices_for_advance_payment > 0) {
# reverse booking for invoices for advance payment
scalar => [ qw(type id number save dbh dbh_provided business_id) ],
);
-my @SUPPORTED_TYPES = qw(invoice invoice_for_advance_payment credit_note customer vendor sales_delivery_order purchase_delivery_order sales_order purchase_order sales_quotation request_quotation part service assembly assortment letter);
+my @SUPPORTED_TYPES = qw(invoice invoice_for_advance_payment final_invoice credit_note customer vendor sales_delivery_order purchase_delivery_order sales_order purchase_order sales_quotation request_quotation part service assembly assortment letter);
sub new {
my $class = shift;
my $type = $self->type;
my %filters = ( where => '' );
- if (any { $_ eq $type } qw(invoice invoice_for_advance_payment credit_note)) {
+ if (any { $_ eq $type } qw(invoice invoice_for_advance_payment final_invoice credit_note)) {
$filters{trans_number} = "invnumber";
$filters{numberfield} = $type eq 'credit_note' ? "cnnumber" : "invnumber";
$filters{table} = "ar";
$is_storno ? $locale->text("Storno (one letter abbreviation)") :
$locale->text("Invoice for Advance Payment (one letter abbreviation)");
+ } elsif ($ar->{type} eq 'final_invoice') {
+ $ar->{type} = t8('Final Invoice (one letter abbreviation)');
+
} else {
$ar->{type} =
$has_storno ? $locale->text("Invoice with Storno (abbreviation)") :
$form->{label} = $locale->text('Invoice for Advance Payment');
}
+ if ($form->{formname} eq "final_invoice") {
+ $form->{label} = $locale->text('Final Invoice');
+ }
+
if ($form->{formname} eq 'sales_order') {
$inv = "ord";
$due = "req";
}
$form->{TEMPLATE_DRIVER_OPTIONS} = { };
- if (any { $form->{type} eq $_ } qw(sales_quotation sales_order sales_delivery_order invoice invoice_for_advance_payment request_quotation purchase_order purchase_delivery_order credit_note)) {
+ if (any { $form->{type} eq $_ } qw(sales_quotation sales_order sales_delivery_order invoice invoice_for_advance_payment final_invoice request_quotation purchase_order purchase_delivery_order credit_note)) {
$form->{TEMPLATE_DRIVER_OPTIONS}->{variable_content_types} = $form->get_variable_content_types();
}
request_quotation => 'OrderItem',
invoice => 'InvoiceItem',
invoice_for_advance_payment => 'InvoiceItem',
+ final_invoice => 'InvoiceItem',
credit_note => 'InvoiceItem',
purchase_invoice => 'InvoiceItem',
purchase_delivery_order => 'DeliveryOrderItem',
} elsif ($form->{type} eq "invoice_for_advance_payment") {
$form->{title} = $locale->text('Add Invoice for Advance Payment');
+ } elsif ($form->{type} eq "final_invoice") {
+ $form->{title} = $locale->text('Final Invoice');
+
} else {
$form->{title} = $locale->text('Add Sales Invoice');
$form->{title} = $locale->text('Edit Invoice for Advance Payment');
$form->{title} = $locale->text('Edit Storno Invoice for Advance Payment') if $form->{storno};
+ } elsif ($form->{type} eq "final_invoice") {
+ $form->{title} = $locale->text('Edit Final Invoice');
+
} else {
$form->{title} = $locale->text('Edit Sales Invoice');
$form->{title} = $locale->text('Edit Storno Invoice') if $form->{storno};
$form->{type} = "invoice_for_advance_payment";
$form->{formname} = "invoice_for_advance_payment";
+ } elsif ($form->{type} eq "final_invoice") {
+ $form->{type} = "final_invoice";
+ $form->{formname} = "final_invoice";
+
} elsif ($form->{formname} eq "proforma" ) {
$form->{type} = "invoice";
$form->{convert_from_ar_ids} = $form->{id};
$form->{id} = '';
- $form->{type} = 'invoice';
+ $form->{type} = 'final_invoice';
$form->{title} = t8('Edit Final Invoice');
$form->{paidaccounts} = 1;
$form->{invdate} = $form->current_date(\%myconfig);
'Filter parts' => 'Artikel filtern',
'Filter record template' => 'Filter für Buchungsvorlagen',
'Final Invoice' => 'Schlussrechnung',
+ 'Final Invoice (one letter abbreviation)' => 'F',
'Financial Controlling' => 'Finanzcontrolling',
'Financial Controlling Report' => 'Finanzcontrollingbericht',
'Financial Overview' => 'Finanzübersicht',
'filename' => 'Dateiname',
'filename has not uploadable characters ' => 'Bitte Dateinamen ändern. Er hat für den Upload nicht verwendbare Sonderzeichen ',
'filesize too big: ' => 'Datei zu groß: ',
+ 'final_invoice' => 'Schlussrechnung',
'flat-rate position' => 'Pauschalposition',
'follow_up_list' => 'wiedervorlageliste',
'for' => 'für',
'Filter parts' => '',
'Filter record template' => '',
'Final Invoice' => '',
+ 'Final Invoice (one letter abbreviation)' => '',
'Financial Controlling' => '',
'Financial Controlling Report' => '',
'Financial Overview' => '',
'filename' => '',
'filename has not uploadable characters ' => '',
'filesize too big: ' => '',
+ 'final_invoice' => '',
'flat-rate position' => '',
'follow_up_list' => '',
'for' => '',
--- /dev/null
+invoice.tex
\ No newline at end of file