Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ba9e2e01

Von Sven Schöling vor etwa 8 Jahren hinzugefügt

  • ID ba9e2e01d2662182f04da256e0ff7ce258428332
  • Vorgänger 15363af3
  • Nachfolger 5975ee07

GDPDU: customer, vendor und chart auf einige wenige Spalten beschränken

Unterschiede anzeigen:

SL/GDPDU.pm
33 33
# keep:        arrayref of columns that should be saved for further referencing
34 34
# tables:      arrayref with one column and one or many table.column references that were kept earlier
35 35
my %known_tables = (
36
  chart                 => { name => t8('Charts'),                  description => t8('Chart of Accounts'),       primary_key => 'accno'     },
37
  customer              => { name => t8('Customers'),               description => t8('Customer Master Data'),                                    },
38
  vendor                => { name => t8('Vendors'),                 description => t8('Vendor Master Data'),                                               },
36
  chart    => { name => t8('Charts'),    description => t8('Chart of Accounts'),    primary_key => 'accno', columns => [ qw(id accno description) ],     },
37
  customer => { name => t8('Customers'), description => t8('Customer Master Data'), columns => [ qw(id name department_1 department_2 street zipcode city country contact phone fax email notes customernumber taxnumber obsolete ustid) ] },
38
  vendor   => { name => t8('Vendors'),   description => t8('Vendor Master Data'),   columns => [ qw(id name department_1 department_2 street zipcode city country contact phone fax email notes customernumber taxnumber obsolete ustid) ] },
39 39
);
40 40

  
41 41
my %datev_column_defs = (
......
219 219
  my ($table) = @_;
220 220
  my $package = SL::DB::Helper::Mappings::get_package_for_table($table);
221 221

  
222
  my %white_list;
223
  my $use_white_list = 0;
224
  if ($known_tables{$table}{columns}) {
225
    $use_white_list = 1;
226
    $white_list{$_} = 1 for @{ $known_tables{$table}{columns} || [] };
227
  }
228

  
222 229
  # PrimaryKeys must come before regular columns, so partition first
223 230
  partition_by {
224 231
    $known_tables{$table}{primary_key}
225 232
      ? 1 * ($_ eq $known_tables{$table}{primary_key})
226 233
      : 1 * $_->is_primary_key_member
234
  } grep {
235
    $use_white_list ? $white_list{$_->name} : 1
227 236
  } $package->meta->columns;
228 237
}
229 238

  

Auch abrufbar als: Unified diff