Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ab09ebd1

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID ab09ebd14155b5848023264fb98cb34e51c7eebf
  • Vorgänger d0b1c344
  • Nachfolger 2f596686

Kosmetik: Ausrichtung

Unterschiede anzeigen:

SL/Controller/RecordLinks.pm
39 39
);
40 40

  
41 41
my @link_type_specifics = (
42
  { title => t8('Requirement spec'),        type => 'requirement_spec',        model => 'RequirementSpec', number => 'id', project => 'project', description => 'title', date => undef, filter => 'working_copy_filter', },
43
  { title => t8('Shop Order'),              type => 'shop_order',              model => 'ShopOrder',       number => 'shop_ordernumber', date => 'order_date', project => undef, description => undef, },
44
  { title => t8('Sales quotation'),         type => 'sales_quotation',         model => 'Order',           number => 'quonumber', },
45
  { title => t8('Sales Order Intake'),      type => 'sales_order_intake',      model => 'Order',           number => 'ordnumber', },
46
  { title => t8('Sales Order'),             type => 'sales_order',             model => 'Order',           number => 'ordnumber', },
47
  { title => t8('Sales delivery order'),    type => 'sales_delivery_order',    model => 'DeliveryOrder',   number => 'donumber',  },
48
  { title => t8('RMA delivery order'),      type => 'rma_delivery_order',      model => 'DeliveryOrder',   number => 'rdonumber', },
49
  { title => t8('Sales Reclamation'),       type => 'sales_reclamation',       model => 'Reclamation',     number => 'record_number',},
50
  { title => t8('Sales Invoice'),           type => 'invoice',                 model => 'Invoice',         number => 'invnumber', },
51
  { title => t8('Request for Quotation'),   type => 'request_quotation',       model => 'Order',           number => 'quonumber', },
52
  { title => t8('Purchase Quotation Intake'), type => 'purchase_quotation_intake', model => 'Order',       number => 'quonumber', },
53
  { title => t8('Purchase Order'),          type => 'purchase_order',          model => 'Order',           number => 'ordnumber', },
54
  { title => t8('Purchase delivery order'), type => 'purchase_delivery_order', model => 'DeliveryOrder',   number => 'donumber',  },
55
  { title => t8('Supplier delivery order'), type => 'supplier_delivery_order', model => 'DeliveryOrder',   number => 'sdonumber', },
56
  { title => t8('Purchase Reclamation'),    type => 'purchase_reclamation',    model => 'Reclamation',     number => 'record_number',},
57
  { title => t8('Purchase Invoice'),        type => 'purchase_invoice',        model => 'PurchaseInvoice', number => 'invnumber', },
58
  { title => t8('Letter'),                  type => 'letter',                  model => 'Letter',          number => 'letternumber', description => 'subject', description_title => t8('Subject'), date => 'date', project => undef },
59
  { title => t8('Email'),                   type => 'email_journal',           model => 'EmailJournal',    number => 'id', description => 'subject', description_title => t8('Subject'), project => undef, date => 'sent_on',},
60
  { title => t8('AR Transaction'),          type => 'ar_transaction',          model => 'Invoice',         number => 'invnumber', },
61
  { title => t8('AP Transaction'),          type => 'ap_transaction',          model => 'PurchaseInvoice', number => 'invnumber', },
62
  { title => t8('Dunning'),                 type => 'dunning',                 model => 'Dunning',         number => 'dunning_id', project => undef, description => undef,},
63
  { title => t8('GL Transaction'),          type => 'gl_transaction',          model => 'GLTransaction',   number => 'reference', project => undef},
42
  { title => t8('Requirement spec'),          type => 'requirement_spec',          model => 'RequirementSpec', number => 'id', project => 'project', description => 'title', date => undef, filter => 'working_copy_filter', },
43
  { title => t8('Shop Order'),                type => 'shop_order',                model => 'ShopOrder',       number => 'shop_ordernumber', date => 'order_date', project => undef, description => undef, },
44
  { title => t8('Sales quotation'),           type => 'sales_quotation',           model => 'Order',           number => 'quonumber',     },
45
  { title => t8('Sales Order Intake'),        type => 'sales_order_intake',        model => 'Order',           number => 'ordnumber',     },
46
  { title => t8('Sales Order'),               type => 'sales_order',               model => 'Order',           number => 'ordnumber',     },
47
  { title => t8('Sales delivery order'),      type => 'sales_delivery_order',      model => 'DeliveryOrder',   number => 'donumber',      },
48
  { title => t8('RMA delivery order'),        type => 'rma_delivery_order',        model => 'DeliveryOrder',   number => 'rdonumber',     },
49
  { title => t8('Sales Reclamation'),         type => 'sales_reclamation',         model => 'Reclamation',     number => 'record_number', },
50
  { title => t8('Sales Invoice'),             type => 'invoice',                   model => 'Invoice',         number => 'invnumber',     },
51
  { title => t8('Request for Quotation'),     type => 'request_quotation',         model => 'Order',           number => 'quonumber',     },
52
  { title => t8('Purchase Quotation Intake'), type => 'purchase_quotation_intake', model => 'Order',           number => 'quonumber',     },
53
  { title => t8('Purchase Order'),            type => 'purchase_order',            model => 'Order',           number => 'ordnumber',     },
54
  { title => t8('Purchase delivery order'),   type => 'purchase_delivery_order',   model => 'DeliveryOrder',   number => 'donumber',      },
55
  { title => t8('Supplier delivery order'),   type => 'supplier_delivery_order',   model => 'DeliveryOrder',   number => 'sdonumber',     },
56
  { title => t8('Purchase Reclamation'),      type => 'purchase_reclamation',      model => 'Reclamation',     number => 'record_number', },
57
  { title => t8('Purchase Invoice'),          type => 'purchase_invoice',          model => 'PurchaseInvoice', number => 'invnumber',     },
58
  { title => t8('Letter'),                    type => 'letter',                    model => 'Letter',          number => 'letternumber', description => 'subject', description_title => t8('Subject'), date => 'date', project => undef },
59
  { title => t8('Email'),                     type => 'email_journal',             model => 'EmailJournal',    number => 'id',           description => 'subject', description_title => t8('Subject'), project => undef, date => 'sent_on', },
60
  { title => t8('AR Transaction'),            type => 'ar_transaction',            model => 'Invoice',         number => 'invnumber',     },
61
  { title => t8('AP Transaction'),            type => 'ap_transaction',            model => 'PurchaseInvoice', number => 'invnumber',     },
62
  { title => t8('Dunning'),                   type => 'dunning',                   model => 'Dunning',         number => 'dunning_id',   project => undef, description => undef, },
63
  { title => t8('GL Transaction'),            type => 'gl_transaction',            model => 'GLTransaction',   number => 'reference',    project => undef },
64 64
);
65 65

  
66 66
my @link_types = map { +{ %link_type_defaults, %{ $_ } } } @link_type_specifics;
SL/Presenter/Record.pm
43 43
  my %groups = _sort_grouped_lists(_group_records($list));
44 44
  my $output = '';
45 45

  
46
  $output .= _requirement_spec_list(       $groups{requirement_specs},        %params) if $groups{requirement_specs};
47
  $output .= _shop_order_list(             $groups{shop_orders},              %params) if $groups{shop_orders};
48
  $output .= _sales_quotation_list(        $groups{sales_quotations},         %params) if $groups{sales_quotations};
49
  $output .= _sales_order_intake_list(     $groups{sales_order_intakes},      %params) if $groups{sales_order_intakes};
50
  $output .= _sales_order_list(            $groups{sales_orders},             %params) if $groups{sales_orders};
51
  $output .= _sales_delivery_order_list(   $groups{sales_delivery_orders},    %params) if $groups{sales_delivery_orders};
52
  $output .= _rma_delivery_order_list(     $groups{rma_delivery_orders},      %params) if $groups{rma_delivery_orders};
53
  $output .= _sales_reclamation_list(      $groups{sales_reclamation},        %params) if $groups{sales_reclamation};
54
  $output .= _sales_invoice_list(          $groups{sales_invoices},           %params) if $groups{sales_invoices};
55
  $output .= _ar_transaction_list(         $groups{ar_transactions},          %params) if $groups{ar_transactions};
56

  
57
  $output .= _request_quotation_list(      $groups{purchase_quotations},      %params) if $groups{purchase_quotations};
46
  $output .= _requirement_spec_list(          $groups{requirement_specs},          %params) if $groups{requirement_specs};
47
  $output .= _shop_order_list(                $groups{shop_orders},                %params) if $groups{shop_orders};
48
  $output .= _sales_quotation_list(           $groups{sales_quotations},           %params) if $groups{sales_quotations};
49
  $output .= _sales_order_intake_list(        $groups{sales_order_intakes},        %params) if $groups{sales_order_intakes};
50
  $output .= _sales_order_list(               $groups{sales_orders},               %params) if $groups{sales_orders};
51
  $output .= _sales_delivery_order_list(      $groups{sales_delivery_orders},      %params) if $groups{sales_delivery_orders};
52
  $output .= _rma_delivery_order_list(        $groups{rma_delivery_orders},        %params) if $groups{rma_delivery_orders};
53
  $output .= _sales_reclamation_list(         $groups{sales_reclamation},          %params) if $groups{sales_reclamation};
54
  $output .= _sales_invoice_list(             $groups{sales_invoices},             %params) if $groups{sales_invoices};
55
  $output .= _ar_transaction_list(            $groups{ar_transactions},            %params) if $groups{ar_transactions};
56

  
57
  $output .= _request_quotation_list(         $groups{purchase_quotations},        %params) if $groups{purchase_quotations};
58 58
  $output .= _purchase_quotation_intake_list( $groups{purchase_quotation_intakes}, %params) if $groups{purchase_quotation_intakes};
59
  $output .= _purchase_order_list(         $groups{purchase_orders},          %params) if $groups{purchase_orders};
60
  $output .= _purchase_delivery_order_list($groups{purchase_delivery_orders}, %params) if $groups{purchase_delivery_orders};
61
  $output .= _supplier_delivery_order_list($groups{supplier_delivery_orders}, %params) if $groups{supplier_delivery_orders};
62
  $output .= _purchase_reclamation_list(   $groups{purchase_reclamation},     %params) if $groups{purchase_reclamation};
63
  $output .= _purchase_invoice_list(       $groups{purchase_invoices},        %params) if $groups{purchase_invoices};
64
  $output .= _ap_transaction_list(         $groups{ap_transactions},          %params) if $groups{ap_transactions};
59
  $output .= _purchase_order_list(            $groups{purchase_orders},            %params) if $groups{purchase_orders};
60
  $output .= _purchase_delivery_order_list(   $groups{purchase_delivery_orders},   %params) if $groups{purchase_delivery_orders};
61
  $output .= _supplier_delivery_order_list(   $groups{supplier_delivery_orders},   %params) if $groups{supplier_delivery_orders};
62
  $output .= _purchase_reclamation_list(      $groups{purchase_reclamation},       %params) if $groups{purchase_reclamation};
63
  $output .= _purchase_invoice_list(          $groups{purchase_invoices},          %params) if $groups{purchase_invoices};
64
  $output .= _ap_transaction_list(            $groups{ap_transactions},            %params) if $groups{ap_transactions};
65 65

  
66
  $output .= _gl_transaction_list(         $groups{gl_transactions},          %params) if $groups{gl_transactions};
66
  $output .= _gl_transaction_list(            $groups{gl_transactions},            %params) if $groups{gl_transactions};
67 67

  
68
  $output .= _bank_transactions(           $groups{bank_transactions},        %params) if $groups{bank_transactions};
68
  $output .= _bank_transactions(              $groups{bank_transactions},          %params) if $groups{bank_transactions};
69 69

  
70
  $output .= _sepa_collection_list(        $groups{sepa_collections},         %params) if $groups{sepa_collections};
71
  $output .= _sepa_transfer_list(          $groups{sepa_transfers},           %params) if $groups{sepa_transfers};
70
  $output .= _sepa_collection_list(           $groups{sepa_collections},           %params) if $groups{sepa_collections};
71
  $output .= _sepa_transfer_list(             $groups{sepa_transfers},             %params) if $groups{sepa_transfers};
72 72

  
73
  $output .= _letter_list(                 $groups{letters},                  %params) if $groups{letters};
74
  $output .= _email_journal_list(          $groups{email_journals},           %params) if $groups{email_journals};
73
  $output .= _letter_list(                    $groups{letters},                    %params) if $groups{letters};
74
  $output .= _email_journal_list(             $groups{email_journals},             %params) if $groups{email_journals};
75 75

  
76
  $output .= _dunning_list(                $groups{dunnings},                 %params) if $groups{dunnings};
76
  $output .= _dunning_list(                   $groups{dunnings},                   %params) if $groups{dunnings};
77 77

  
78
  $output  = SL::Presenter->get->render('presenter/record/grouped_record_list', %params, output => $output);
78
  $output  = SL::Presenter->get->render('presenter/record/grouped_record_list',    %params, output => $output);
79 79

  
80 80
  return $output;
81 81
}
......
187 187
sub _group_records {
188 188
  my ($list) = @_;
189 189
  my %matchers = (
190
    requirement_specs        => sub { (ref($_[0]) eq 'SL::DB::RequirementSpec')                                         },
191
    shop_orders              => sub { (ref($_[0]) eq 'SL::DB::ShopOrder')       &&  $_[0]->id                           },
192
    sales_quotations         => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_quotation')   },
193
    sales_order_intakes      => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_order_intake') },
194
    sales_orders             => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_order')       },
195
    sales_delivery_orders    => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('sales_delivery_order') },
196
    rma_delivery_orders      => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('rma_delivery_order')   },
197
    sales_reclamation        => sub { (ref($_[0]) eq 'SL::DB::Reclamation')     &&  $_[0]->is_type('sales_reclamation') },
198
    sales_invoices           => sub { (ref($_[0]) eq 'SL::DB::Invoice')         &&  $_[0]->invoice                      },
199
    ar_transactions          => sub { (ref($_[0]) eq 'SL::DB::Invoice')         && !$_[0]->invoice                      },
200
    purchase_quotations      => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('request_quotation') },
201
    purchase_quotation_intakes => sub { (ref($_[0]) eq 'SL::DB::Order')         &&  $_[0]->is_type('purchase_quotation_intake') },
202
    purchase_orders          => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('purchase_order')    },
203
    purchase_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('purchase_delivery_order') },
204
    supplier_delivery_orders => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('supplier_delivery_order') },
205
    purchase_reclamation     => sub { (ref($_[0]) eq 'SL::DB::Reclamation')     &&  $_[0]->is_type('purchase_reclamation')},
206
    purchase_invoices        => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') &&  $_[0]->invoice                      },
207
    ap_transactions          => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') && !$_[0]->invoice                      },
208
    sepa_collections         => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem')  &&  $_[0]->ar_id                        },
209
    sepa_transfers           => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem')  &&  $_[0]->ap_id                        },
210
    gl_transactions          => sub { (ref($_[0]) eq 'SL::DB::GLTransaction')                                           },
211
    bank_transactions        => sub { (ref($_[0]) eq 'SL::DB::BankTransaction') &&  $_[0]->id                           },
212
    letters                  => sub { (ref($_[0]) eq 'SL::DB::Letter')          &&  $_[0]->id                           },
213
    email_journals           => sub { (ref($_[0]) eq 'SL::DB::EmailJournal')    &&  $_[0]->id                           },
214
    dunnings                 => sub { (ref($_[0]) eq 'SL::DB::Dunning')                                                 },
190
    requirement_specs          => sub { (ref($_[0]) eq 'SL::DB::RequirementSpec')                                         },
191
    shop_orders                => sub { (ref($_[0]) eq 'SL::DB::ShopOrder')       &&  $_[0]->id                           },
192
    sales_quotations           => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_quotation')   },
193
    sales_order_intakes        => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_order_intake') },
194
    sales_orders               => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('sales_order')       },
195
    sales_delivery_orders      => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('sales_delivery_order') },
196
    rma_delivery_orders        => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('rma_delivery_order')   },
197
    sales_reclamation          => sub { (ref($_[0]) eq 'SL::DB::Reclamation')     &&  $_[0]->is_type('sales_reclamation') },
198
    sales_invoices             => sub { (ref($_[0]) eq 'SL::DB::Invoice')         &&  $_[0]->invoice                      },
199
    ar_transactions            => sub { (ref($_[0]) eq 'SL::DB::Invoice')         && !$_[0]->invoice                      },
200
    purchase_quotations        => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('request_quotation') },
201
    purchase_quotation_intakes => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('purchase_quotation_intake') },
202
    purchase_orders            => sub { (ref($_[0]) eq 'SL::DB::Order')           &&  $_[0]->is_type('purchase_order')    },
203
    purchase_delivery_orders   => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('purchase_delivery_order') },
204
    supplier_delivery_orders   => sub { (ref($_[0]) eq 'SL::DB::DeliveryOrder')   &&  $_[0]->is_type('supplier_delivery_order') },
205
    purchase_reclamation       => sub { (ref($_[0]) eq 'SL::DB::Reclamation')     &&  $_[0]->is_type('purchase_reclamation')},
206
    purchase_invoices          => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') &&  $_[0]->invoice                      },
207
    ap_transactions            => sub { (ref($_[0]) eq 'SL::DB::PurchaseInvoice') && !$_[0]->invoice                      },
208
    sepa_collections           => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem')  &&  $_[0]->ar_id                        },
209
    sepa_transfers             => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem')  &&  $_[0]->ap_id                        },
210
    gl_transactions            => sub { (ref($_[0]) eq 'SL::DB::GLTransaction')                                           },
211
    bank_transactions          => sub { (ref($_[0]) eq 'SL::DB::BankTransaction') &&  $_[0]->id                           },
212
    letters                    => sub { (ref($_[0]) eq 'SL::DB::Letter')          &&  $_[0]->id                           },
213
    email_journals             => sub { (ref($_[0]) eq 'SL::DB::EmailJournal')    &&  $_[0]->id                           },
214
    dunnings                   => sub { (ref($_[0]) eq 'SL::DB::Dunning')                                                 },
215 215
  );
216 216

  
217 217
  my %groups;

Auch abrufbar als: Unified diff