From: Sven Schöling Date: Fri, 5 Dec 2014 10:43:59 +0000 (+0100) Subject: RecordLinks: credit_notes verlinken, und Typ von Rechnungen anzeigen X-Git-Tag: release-3.2.0beta~199 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=001155e424a519b543499cdb1f1841f48cfae352;p=kivitendo-erp.git RecordLinks: credit_notes verlinken, und Typ von Rechnungen anzeigen --- diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index d734003a1..b6f1becd8 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -318,6 +318,16 @@ sub displayable_state { return $self->closed ? $::locale->text('closed') : $::locale->text('open'); } +sub displayable_type { + my ($self) = @_; + + return t8('AR Transaction') if $self->invoice_type eq 'ar_transaction'; + 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'); +} + sub abbreviation { my $self = shift; diff --git a/SL/IS.pm b/SL/IS.pm index 1398ed872..29886a5bb 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1174,6 +1174,17 @@ sub post_invoice { Common::webdav_folder($form); + if ($form->{convert_from_ar_ids}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'ar', + 'from_ids' => $form->{convert_from_ar_ids}, + 'to_table' => 'ar', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_ar_ids}; + } + # Link this record to the records it was created from. RecordLinks->create_links('dbh' => $dbh, 'mode' => 'ids', diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index 61bd5cc61..23c5d46ea 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -340,6 +340,7 @@ sub _sales_invoice_list { type => 'sales_invoice', columns => [ [ $::locale->text('Invoice Date'), 'transdate' ], + [ $::locale->text('Type'), sub { $_[0]->displayable_type } ], [ $::locale->text('Invoice Number'), sub { $self->sales_invoice($_[0], display => 'table-cell') } ], [ $::locale->text('Quotation Number'), 'quonumber' ], [ $::locale->text('Order Number'), 'ordnumber' ], @@ -382,6 +383,7 @@ sub _ar_transaction_list { type => 'ar_transaction', columns => [ [ $::locale->text('Invoice Date'), 'transdate' ], + [ $::locale->text('Type'), sub { $_[0]->displayable_type } ], [ $::locale->text('Invoice Number'), sub { $self->ar_transaction($_[0], display => 'table-cell') } ], [ $::locale->text('Customer'), 'customer' ], [ $::locale->text('Net amount'), 'netamount' ], diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 35b08b947..d2408ffff 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -390,7 +390,7 @@ sub form_header { max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 shiptocp_gender message email subject cc bcc taxaccounts cursor_fokus - convert_from_do_ids convert_from_oe_ids + convert_from_do_ids convert_from_oe_ids convert_from_ar_ids show_details ), @custom_hiddens, map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; @@ -959,6 +959,7 @@ sub credit_note { $form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1); + $form->{convert_from_ar_ids} = $form->{id}; $form->{id} = ''; $form->{rowcount}--;