Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 92f6fae1

Von Moritz Bunkus vor mehr als 3 Jahren hinzugefügt

  • ID 92f6fae1e8c4861460ae364ac7dc243b429a9cb6
  • Vorgänger f65440cb
  • Nachfolger 6ac03ba6

Order-Controller: Workflow Lieferantenauftrag → Preisanfrage

Unterschiede anzeigen:

SL/Controller/Order.pm
600 600

  
601 601
# workflow from sales order to sales quotation
602 602
sub action_sales_quotation {
603
  $_[0]->workflow_sales_quotation();
603
  $_[0]->workflow_sales_or_request_for_quotation();
604
}
605

  
606
# workflow from sales order to sales quotation
607
sub action_request_for_quotation {
608
  $_[0]->workflow_sales_or_request_for_quotation();
604 609
}
605 610

  
606 611
# workflow from sales quotation to sales order
......
1585 1590
  return $errors;
1586 1591
}
1587 1592

  
1588
sub workflow_sales_quotation {
1593
sub workflow_sales_or_request_for_quotation {
1589 1594
  my ($self) = @_;
1590 1595

  
1591 1596
  # always save
......
1596 1601
    return $self->js->render();
1597 1602
  }
1598 1603

  
1599
  my $destination_type = sales_quotation_type();
1604
  my $destination_type = $::form->{type} eq sales_order_type() ? sales_quotation_type() : request_quotation_type();
1600 1605

  
1601 1606
  $self->order(SL::DB::Order->new_from($self->order, destination_type => $destination_type));
1602 1607
  $self->{converted_from_oe_id} = delete $::form->{id};
......
1791 1796
          submit   => [ '#order_form', { action => "Order/sales_quotation" } ],
1792 1797
          only_if  => (any { $self->type eq $_ } (sales_order_type())),
1793 1798
        ],
1799
        action => [
1800
          t8('Save and RFQ'),
1801
          submit   => [ '#order_form', { action => "Order/request_for_quotation" } ],
1802
          only_if  => (any { $self->type eq $_ } (purchase_order_type())),
1803
        ],
1794 1804
        action => [
1795 1805
          t8('Save and Sales Order'),
1796 1806
          submit   => [ '#order_form', { action => "Order/sales_order" } ],
......
2203 2213

  
2204 2214
=item * credit limit
2205 2215

  
2206
=item * more workflows (rfq)
2207

  
2208 2216
=item * price sources: little symbols showing better price / better discount
2209 2217

  
2210 2218
=item * select units in input row?
SL/DB/Order.pm
311 311
    { from => 'sales_order',       to => 'purchase_order',    abbr => 'sopo' },
312 312
    { from => 'purchase_order',    to => 'sales_order',       abbr => 'poso' },
313 313
    { from => 'sales_order',       to => 'sales_quotation',   abbr => 'sosq' },
314
    { from => 'purchase_order',    to => 'request_quotation', abbr => 'porq' },
314 315
  );
315 316
  my $from_to = (grep { $_->{from} eq $source->type && $_->{to} eq $destination_type} @from_tos)[0];
316 317
  croak("Cannot convert from '" . $source->type . "' to '" . $destination_type . "'") if !$from_to;
......
355 356
  if ( $is_abbr_any->(qw(soso)) ) {
356 357
    $args{periodic_invoices_config} = $source->periodic_invoices_config->clone_and_reset if $source->periodic_invoices_config;
357 358
  }
358
  if ( $is_abbr_any->(qw(sosq)) ) {
359
  if ( $is_abbr_any->(qw(sosq porq)) ) {
359 360
    $args{ordnumber} = undef;
360 361
    $args{quonumber} = undef;
361 362
    $args{reqdate}   = DateTime->today_local->next_workday();

Auch abrufbar als: Unified diff