Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ee6fe6b9

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

  • ID ee6fe6b954ca6fd4997c7d72fa21cc7c194937c1
  • Vorgänger 5bd24d0d
  • Nachfolger 73192307

Auftrags-Eingang: Workflows

Unterschiede anzeigen:

SL/DB/Order.pm
351 351
  my $destination_type  = delete $params{destination_type};
352 352

  
353 353
  my @from_tos = (
354
    { from => 'sales_quotation',   to => 'sales_order',       abbr => 'sqso' },
355
    { from => 'request_quotation', to => 'purchase_order',    abbr => 'rqpo' },
356
    { from => 'sales_quotation',   to => 'sales_quotation',   abbr => 'sqsq' },
357
    { from => 'sales_order',       to => 'sales_order',       abbr => 'soso' },
358
    { from => 'request_quotation', to => 'request_quotation', abbr => 'rqrq' },
359
    { from => 'purchase_order',    to => 'purchase_order',    abbr => 'popo' },
360
    { from => 'sales_order',       to => 'purchase_order',    abbr => 'sopo' },
361
    { from => 'purchase_order',    to => 'sales_order',       abbr => 'poso' },
362
    { from => 'sales_order',       to => 'sales_quotation',   abbr => 'sosq' },
363
    { from => 'purchase_order',    to => 'request_quotation', abbr => 'porq' },
364
    { from => 'request_quotation', to => 'sales_quotation',   abbr => 'rqsq' },
365
    { from => 'request_quotation', to => 'sales_order',       abbr => 'rqso' },
366
    { from => 'sales_quotation',   to => 'request_quotation', abbr => 'sqrq' },
367
    { from => 'sales_order',       to => 'request_quotation', abbr => 'sorq' },
368
    { from => 'sales_reclamation', to => 'sales_order',       abbr => 'srso' },
369
    { from => 'purchase_reclamation', to => 'purchase_order', abbr => 'prpo' },
354
    { from => 'sales_quotation',    to => 'sales_order',        abbr => 'sqso'   },
355
    { from => 'request_quotation',  to => 'purchase_order',     abbr => 'rqpo'   },
356
    { from => 'sales_quotation',    to => 'sales_quotation',    abbr => 'sqsq'   },
357
    { from => 'sales_order',        to => 'sales_order',        abbr => 'soso'   },
358
    { from => 'request_quotation',  to => 'request_quotation',  abbr => 'rqrq'   },
359
    { from => 'purchase_order',     to => 'purchase_order',     abbr => 'popo'   },
360
    { from => 'sales_order',        to => 'purchase_order',     abbr => 'sopo'   },
361
    { from => 'purchase_order',     to => 'sales_order',        abbr => 'poso'   },
362
    { from => 'sales_order',        to => 'sales_quotation',    abbr => 'sosq'   },
363
    { from => 'purchase_order',     to => 'request_quotation',  abbr => 'porq'   },
364
    { from => 'request_quotation',  to => 'sales_quotation',    abbr => 'rqsq'   },
365
    { from => 'request_quotation',  to => 'sales_order',        abbr => 'rqso'   },
366
    { from => 'sales_quotation',    to => 'request_quotation',  abbr => 'sqrq'   },
367
    { from => 'sales_order',        to => 'request_quotation',  abbr => 'sorq'   },
368
    { from => 'sales_reclamation',  to => 'sales_order',        abbr => 'srso' },
369
    { from => 'purchase_reclamation', to => 'purchase_order',   abbr => 'prpo' },
370
    { from => 'sales_order_intake', to => 'sales_order_intake', abbr => 'soisoi' },
371
    { from => 'sales_order_intake', to => 'sales_quotation',    abbr => 'soisq'  },
372
    { from => 'sales_order_intake', to => 'request_quotation',  abbr => 'soirq'  },
373
    { from => 'sales_order_intake', to => 'sales_order',        abbr => 'soiso'  },
374
    { from => 'sales_order_intake', to => 'purchase_order',     abbr => 'soipo'  },
375
    { from => 'sales_quotation',    to => 'sales_order_intake', abbr => 'sqsoi'   },
370 376
  );
371 377
  my $from_to = (grep { $_->{from} eq $source->type && $_->{to} eq $destination_type} @from_tos)[0];
372 378
  croak("Cannot convert from '" . $source->type . "' to '" . $destination_type . "'") if !$from_to;
......
393 399
                                               transaction_description vendor_id billing_address_id
394 400
                                            )),
395 401
                 quotation => !!($destination_type =~ m{quotation$}),
402
                 intake    => !!($destination_type =~ m{intake$}),
396 403
                 closed    => 0,
397 404
                 delivered => 0,
398 405
                 transdate => DateTime->today_local,
......
427 434
   );
428 435
  }
429 436

  
430
  if ( $is_abbr_any->(qw(sopo poso rqso sosq porq rqsq sqrq sorq)) ) {
437
  if ( $is_abbr_any->(qw(soipo sopo poso rqso soisq sosq porq rqsq sqrq soirq sorq)) ) {
431 438
    $args{ordnumber} = undef;
432 439
    $args{quonumber} = undef;
433 440
  }
434
  if ( $is_abbr_any->(qw(sopo sqrq sorq)) ) {
441
  if ( $is_abbr_any->(qw(soipo sopo sqrq soirq sorq)) ) {
435 442
    $args{customer_id}      = undef;
436 443
    $args{salesman_id}      = undef;
437 444
    $args{payment_id}       = undef;
......
443 450
  if ( $is_abbr_any->(qw(soso)) ) {
444 451
    $args{periodic_invoices_config} = $source->periodic_invoices_config->clone_and_reset if $source->periodic_invoices_config;
445 452
  }
446
  if ( $is_abbr_any->(qw(sqrq sorq)) ) {
453
  if ( $is_abbr_any->(qw(sqrq soirq sorq)) ) {
447 454
    $args{cusordnumber} = undef;
448 455
  }
456
  if ( $is_abbr_any->(qw(soiso)) ) {
457
    $args{ordnumber} = undef;
458
  }
449 459

  
450 460
  # Custom shipto addresses (the ones specific to the sales/purchase
451 461
  # record and not to the customer/vendor) are only linked from
......
495 505
        custom_variables => \@custom_variables,
496 506
      );
497 507
    }
498
    if ( $is_abbr_any->(qw(sopo)) ) {
508
    if ( $is_abbr_any->(qw(soipo sopo)) ) {
499 509
      $current_oe_item->sellprice($source_item->lastcost);
500 510
      $current_oe_item->discount(0);
501 511
    }
......
594 604
  return if !$self->type;
595 605

  
596 606
  my %number_method = (
597
    sales_order       => 'ordnumber',
598
    sales_quotation   => 'quonumber',
599
    purchase_order    => 'ordnumber',
600
    request_quotation => 'quonumber',
607
    sales_order_intake => 'ordnumber',
608
    sales_order        => 'ordnumber',
609
    sales_quotation    => 'quonumber',
610
    purchase_order     => 'ordnumber',
611
    request_quotation  => 'quonumber',
601 612
  );
602 613

  
603 614
  return $self->${ \ $number_method{$self->type} }(@_);

Auch abrufbar als: Unified diff