Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9f4ef62c

Von Bernd Bleßmann vor mehr als 4 Jahren hinzugefügt

  • ID 9f4ef62c42dceef5a27ad3a0d8c8d260ffef9848
  • Vorgänger 994dab13
  • Nachfolger 299dba8f

CsvImport für Lieferscheine

Unterschiede anzeigen:

SL/Controller/CsvImport.pm
20 20
use SL::Controller::CsvImport::Shipto;
21 21
use SL::Controller::CsvImport::Project;
22 22
use SL::Controller::CsvImport::Order;
23
use SL::Controller::CsvImport::DeliveryOrder;
23 24
use SL::Controller::CsvImport::ARTransaction;
24 25
use SL::JSON;
25 26
use SL::Controller::CsvImport::BankTransaction;
26 27
use SL::BackgroundJob::CsvImport;
27 28
use SL::System::TaskServer;
28 29

  
29
use List::MoreUtils qw(none);
30
use List::MoreUtils qw(any none);
30 31
use List::Util qw(min);
31 32

  
32 33
use parent qw(SL::Controller::Base);
......
306 307
sub check_type {
307 308
  my ($self) = @_;
308 309

  
309
  die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts inventories customers_vendors addresses contacts projects orders bank_transactions ar_transactions);
310
  die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts inventories customers_vendors addresses contacts projects orders delivery_orders bank_transactions ar_transactions);
310 311
  $self->type($::form->{profile}->{type});
311 312
}
312 313

  
......
353 354
            : $self->type eq 'inventories'       ? $::locale->text('CSV import: inventories')
354 355
            : $self->type eq 'projects'          ? $::locale->text('CSV import: projects')
355 356
            : $self->type eq 'orders'            ? $::locale->text('CSV import: orders')
357
            : $self->type eq 'delivery_orders'   ? $::locale->text('CSV import: delivery orders')
356 358
            : $self->type eq 'bank_transactions' ? $::locale->text('CSV import: bank transactions')
357 359
            : $self->type eq 'ar_transactions'   ? $::locale->text('CSV import: ar transactions')
358 360
            : die;
359 361

  
360
  if ($self->{type} eq 'customers_vendors' or $self->{type} eq 'orders' or $self->{type} eq 'ar_transactions' ) {
362
  if ( any { $_ eq $self->{type} } qw(customers_vendors orders delivery_orders ar_transactions) ) {
361 363
    $self->all_taxzones(SL::DB::Manager::TaxZone->get_all_sorted(query => [ obsolete => 0 ]));
362 364
  };
363 365

  
......
721 723
       : $self->{type} eq 'inventories'       ? SL::Controller::CsvImport::Inventory->new(@args)
722 724
       : $self->{type} eq 'projects'          ? SL::Controller::CsvImport::Project->new(@args)
723 725
       : $self->{type} eq 'orders'            ? SL::Controller::CsvImport::Order->new(@args)
726
       : $self->{type} eq 'delivery_orders'   ? SL::Controller::CsvImport::DeliveryOrder->new(@args)
724 727
       : $self->{type} eq 'bank_transactions' ? SL::Controller::CsvImport::BankTransaction->new(@args)
725 728
       : $self->{type} eq 'ar_transactions'   ? SL::Controller::CsvImport::ARTransaction->new(@args)
726 729
       :                                        die "Program logic error";

Auch abrufbar als: Unified diff