From 209ae3b0a164a907a0f8e53b3b82015cbab7cdbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Sun, 5 Dec 2021 21:20:15 +0100 Subject: [PATCH] =?utf8?q?RecordLinks=20f=C3=BCr=20neue=20Lieferscheintype?= =?utf8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RecordLinks.pm | 2 ++ SL/Presenter/DeliveryOrder.pm | 27 ++++++++++++++++++ SL/Presenter/Record.pm | 54 +++++++++++++++++++++++++++++++++-- locale/de/all | 4 +++ 4 files changed, 85 insertions(+), 2 deletions(-) diff --git a/SL/Controller/RecordLinks.pm b/SL/Controller/RecordLinks.pm index 900123ef8..c5d30c72f 100644 --- a/SL/Controller/RecordLinks.pm +++ b/SL/Controller/RecordLinks.pm @@ -43,10 +43,12 @@ my @link_type_specifics = ( { title => t8('Sales quotation'), type => 'sales_quotation', model => 'Order', number => 'quonumber', }, { title => t8('Sales Order'), type => 'sales_order', model => 'Order', number => 'ordnumber', }, { title => t8('Sales delivery order'), type => 'sales_delivery_order', model => 'DeliveryOrder', number => 'donumber', }, + { title => t8('RMA delivery order'), type => 'rma_delivery_order', model => 'DeliveryOrder', number => 'rdonumber', }, { title => t8('Sales Invoice'), type => 'invoice', model => 'Invoice', number => 'invnumber', }, { title => t8('Request for Quotation'), type => 'request_quotation', model => 'Order', number => 'quonumber', }, { title => t8('Purchase Order'), type => 'purchase_order', model => 'Order', number => 'ordnumber', }, { title => t8('Purchase delivery order'), type => 'purchase_delivery_order', model => 'DeliveryOrder', number => 'donumber', }, + { title => t8('Supplier delivery order'), type => 'supplier_delivery_order', model => 'DeliveryOrder', number => 'sdonumber', }, { title => t8('Purchase Invoice'), type => 'purchase_invoice', model => 'PurchaseInvoice', number => 'invnumber', }, { title => t8('Letter'), type => 'letter', model => 'Letter', number => 'letternumber', description => 'subject', description_title => t8('Subject'), date => 'date', project => undef }, { title => t8('Email'), type => 'email_journal', model => 'EmailJournal', number => 'id', description => 'subject', description_title => t8('Subject'), }, diff --git a/SL/Presenter/DeliveryOrder.pm b/SL/Presenter/DeliveryOrder.pm index 79123b1d2..7c1a2dbc2 100644 --- a/SL/Presenter/DeliveryOrder.pm +++ b/SL/Presenter/DeliveryOrder.pm @@ -15,12 +15,39 @@ sub sales_delivery_order { return _do_record($delivery_order, 'sales_delivery_order', %params); } +sub rma_delivery_order { + my ($delivery_order, %params) = @_; + + return _do_new_record($delivery_order, 'rma_delivery_order', %params); +} + sub purchase_delivery_order { my ($delivery_order, %params) = @_; return _do_record($delivery_order, 'purchase_delivery_order', %params); } +sub supplier_delivery_order { + my ($delivery_order, %params) = @_; + + return _do_new_record($delivery_order, 'supplier_delivery_order', %params); +} + +sub _do_new_record { + my ($delivery_order, $type, %params) = @_; + + $params{display} ||= 'inline'; + + croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/; + + my $text = join '', ( + $params{no_link} ? '' : '', + escape($delivery_order->donumber), + $params{no_link} ? '' : '', + ); + is_escaped($text); +} + sub _do_record { my ($delivery_order, $type, %params) = @_; diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index db68fa651..592af556a 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -48,12 +48,14 @@ sub grouped_record_list { $output .= _sales_quotation_list( $groups{sales_quotations}, %params) if $groups{sales_quotations}; $output .= _sales_order_list( $groups{sales_orders}, %params) if $groups{sales_orders}; $output .= _sales_delivery_order_list( $groups{sales_delivery_orders}, %params) if $groups{sales_delivery_orders}; + $output .= _rma_delivery_order_list( $groups{rma_delivery_orders}, %params) if $groups{rma_delivery_orders}; $output .= _sales_invoice_list( $groups{sales_invoices}, %params) if $groups{sales_invoices}; $output .= _ar_transaction_list( $groups{ar_transactions}, %params) if $groups{ar_transactions}; $output .= _request_quotation_list( $groups{purchase_quotations}, %params) if $groups{purchase_quotations}; $output .= _purchase_order_list( $groups{purchase_orders}, %params) if $groups{purchase_orders}; $output .= _purchase_delivery_order_list($groups{purchase_delivery_orders}, %params) if $groups{purchase_delivery_orders}; + $output .= _supplier_delivery_order_list($groups{supplier_delivery_orders}, %params) if $groups{supplier_delivery_orders}; $output .= _purchase_invoice_list( $groups{purchase_invoices}, %params) if $groups{purchase_invoices}; $output .= _ap_transaction_list( $groups{ap_transactions}, %params) if $groups{ap_transactions}; @@ -183,12 +185,14 @@ sub _group_records { shop_orders => sub { (ref($_[0]) eq 'SL::DB::ShopOrder') && $_[0]->id }, sales_quotations => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('sales_quotation') }, sales_orders => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('sales_order') }, - sales_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_sales }, + sales_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_type('sales_delivery_order') }, + rma_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_type('rma_delivery_order') }, sales_invoices => sub { (ref($_[0]) eq 'SL::DB::Invoice') && $_[0]->invoice }, ar_transactions => sub { (ref($_[0]) eq 'SL::DB::Invoice') && !$_[0]->invoice }, purchase_quotations => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('request_quotation') }, purchase_orders => sub { (ref($_[0]) eq 'SL::DB::Order') && $_[0]->is_type('purchase_order') }, - purchase_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && !$_[0]->is_sales }, + purchase_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_type('purchase_delivery_order') }, + supplier_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder') && $_[0]->is_type('supplier_delivery_order') }, purchase_invoices => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') && $_[0]->invoice }, ap_transactions => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') && !$_[0]->invoice }, sepa_collections => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem') && $_[0]->ar_id }, @@ -364,6 +368,27 @@ sub _sales_delivery_order_list { ); } +sub _rma_delivery_order_list { + my ($list, %params) = @_; + + return record_list( + $list, + title => $::locale->text('RMA Delivery Orders'), + type => 'rma_delivery_order', + columns => [ + [ $::locale->text('Delivery Order Date'), 'transdate' ], + [ $::locale->text('Delivery Order Number'), sub { $_[0]->presenter->rma_delivery_order(display => 'table-cell') } ], + [ $::locale->text('Order Number'), 'ordnumber' ], + [ $::locale->text('Customer'), 'customer' ], + [ $::locale->text('Transaction description'), 'transaction_description' ], + [ $::locale->text('Project'), 'globalproject', ], + [ $::locale->text('Delivered'), 'delivered' ], + [ $::locale->text('Closed'), 'closed' ], + ], + %params, + ); +} + sub _purchase_delivery_order_list { my ($list, %params) = @_; @@ -385,6 +410,27 @@ sub _purchase_delivery_order_list { ); } +sub _supplier_delivery_order_list { + my ($list, %params) = @_; + + return record_list( + $list, + title => $::locale->text('Supplier Delivery Orders'), + type => 'supplier_delivery_order', + columns => [ + [ $::locale->text('Delivery Order Date'), 'transdate' ], + [ $::locale->text('Delivery Order Number'), sub { $_[0]->presenter->supplier_delivery_order(display => 'table-cell') } ], + [ $::locale->text('Order Number'), 'ordnumber' ], + [ $::locale->text('Vendor'), 'vendor' ], + [ $::locale->text('Transaction description'), 'transaction_description' ], + [ $::locale->text('Project'), 'globalproject', ], + [ $::locale->text('Delivered'), 'delivered' ], + [ $::locale->text('Closed'), 'closed' ], + ], + %params, + ); +} + sub _sales_invoice_list { my ($list, %params) = @_; @@ -662,6 +708,8 @@ The order in which the records are grouped is: =item * sales delivery orders +=item * rma delivery orders + =item * sales invoices =item * AR transactions @@ -672,6 +720,8 @@ The order in which the records are grouped is: =item * purchase delivery orders +=item * supplier delivery orders + =item * purchase invoices =item * AP transactions diff --git a/locale/de/all b/locale/de/all index 966406237..6db4aa3cf 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2793,6 +2793,8 @@ $self->{texts} = { 'RFQ Date' => 'Anfragedatum', 'RFQ Number' => 'Anfragenummer', 'RFQs' => 'Preisanfragen', + 'RMA Delivery Orders' => 'Retouren-Lieferscheine', + 'RMA delivery order' => 'Retouren-Lieferschein', 'ROP' => 'Mindestlagerbestand', 'Ranges of numbers' => 'Nummernkreise', 'Re-numbering all sections and function blocks in the order they are currently shown cannot be undone.' => 'Das Neu-Nummerieren aller Abschnitte und Funktionsblöcke kann nicht rückgängig gemacht werden.', @@ -3361,6 +3363,8 @@ $self->{texts} = { 'Sun' => 'So', 'Sunday' => 'Sonntag', 'Superuser name' => 'Datenbankadministrator', + 'Supplier Delivery Orders' => 'Beistell-Lieferscheine', + 'Supplier delivery order' => 'Beistell-Lieferschein', 'Supplies' => 'Lieferungen', 'Surname' => 'Nachname', 'Switzerland' => 'Schweiz', -- 2.20.1