From: Bernd Bleßmann Date: Mon, 6 Dec 2021 14:49:12 +0000 (+0100) Subject: Anzahlungs-Rg.: eigener Typ for Schlussrechnung (final_invoice (F)) X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~217^2~28 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=475b7a3ff7259102d938b91bfeac8012dbe69d45;p=kivitendo-erp.git Anzahlungs-Rg.: eigener Typ for Schlussrechnung (final_invoice (F)) --- diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index ba2d74e47..c0c113cd0 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -84,6 +84,7 @@ sub _make_record_item { request_quotation => 'OrderItem', invoice => 'InvoiceItem', invoice_for_advance_payment => 'InvoiceItem', + final_invoice => 'InvoiceItem', purchase_invoice => 'InvoiceItem', credit_note => 'InvoiceItem', purchase_delivery_order => 'DeliveryOrderItem', diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 7e7ff1c8d..45259a064 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -541,6 +541,7 @@ sub invoice_type { 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; @@ -563,6 +564,7 @@ sub displayable_type { 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'); } @@ -579,6 +581,7 @@ sub abbreviation { 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)'); } diff --git a/SL/Form.pm b/SL/Form.pm index 6a7f285f9..d6be25751 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1090,6 +1090,7 @@ sub get_formname_translation { 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'), @@ -1132,7 +1133,7 @@ sub get_number_prefix_for_type { 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' @@ -1171,7 +1172,7 @@ sub generate_attachment_filename { 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"}) { @@ -2946,6 +2947,7 @@ sub save_status { # $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') diff --git a/SL/Helper/PrintOptions.pm b/SL/Helper/PrintOptions.pm index 614760c6f..2b07ee707 100644 --- a/SL/Helper/PrintOptions.pm +++ b/SL/Helper/PrintOptions.pm @@ -72,6 +72,9 @@ sub get_print_options { ($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')), diff --git a/SL/IC.pm b/SL/IC.pm index e0c8dcf3e..2a9460745 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -736,7 +736,7 @@ sub retrieve_accounts { # 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}; diff --git a/SL/IS.pm b/SL/IS.pm index 1340fcbfc..1b8534e65 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1061,8 +1061,7 @@ SQL # 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 diff --git a/SL/TransNumber.pm b/SL/TransNumber.pm index e299e2c25..25646dafb 100644 --- a/SL/TransNumber.pm +++ b/SL/TransNumber.pm @@ -15,7 +15,7 @@ use Rose::Object::MakeMethods::Generic 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; @@ -37,7 +37,7 @@ sub _get_filters { 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"; diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index b36d9210e..0ed071eca 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -1212,6 +1212,9 @@ sub ar_transactions { $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)") : diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index ca43b4939..2f0fb95cd 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1210,6 +1210,10 @@ sub print_form { $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"; @@ -1307,7 +1311,7 @@ sub print_form { } $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(); } @@ -1891,6 +1895,7 @@ sub _make_record_item { request_quotation => 'OrderItem', invoice => 'InvoiceItem', invoice_for_advance_payment => 'InvoiceItem', + final_invoice => 'InvoiceItem', credit_note => 'InvoiceItem', purchase_invoice => 'InvoiceItem', purchase_delivery_order => 'DeliveryOrderItem', diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 837bde7f9..e04139fba 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -95,6 +95,9 @@ sub add { } 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'); @@ -143,6 +146,9 @@ sub edit { $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}; @@ -253,6 +259,10 @@ sub prepare_invoice { $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"; @@ -1214,7 +1224,7 @@ sub final_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); diff --git a/locale/de/all b/locale/de/all index 87fa2e0c1..5fcd70b01 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1558,6 +1558,7 @@ $self->{texts} = { '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', @@ -4424,6 +4425,7 @@ $self->{texts} = { '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', diff --git a/locale/en/all b/locale/en/all index 247252af5..6e6d61bf4 100644 --- a/locale/en/all +++ b/locale/en/all @@ -1558,6 +1558,7 @@ $self->{texts} = { 'Filter parts' => '', 'Filter record template' => '', 'Final Invoice' => '', + 'Final Invoice (one letter abbreviation)' => '', 'Financial Controlling' => '', 'Financial Controlling Report' => '', 'Financial Overview' => '', @@ -4420,6 +4421,7 @@ $self->{texts} = { 'filename' => '', 'filename has not uploadable characters ' => '', 'filesize too big: ' => '', + 'final_invoice' => '', 'flat-rate position' => '', 'follow_up_list' => '', 'for' => '', diff --git a/templates/print/marei/final_invoice.tex b/templates/print/marei/final_invoice.tex new file mode 120000 index 000000000..b6a6ad821 --- /dev/null +++ b/templates/print/marei/final_invoice.tex @@ -0,0 +1 @@ +invoice.tex \ No newline at end of file