Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 77350196

Von Jan Büren vor fast 10 Jahren hinzugefügt

  • ID 77350196300e930abc7de0df7dbf42e8cd6193b8
  • Vorgänger d557935a
  • Nachfolger b922ab4c

Ticket 29 Verknüpfte Belege -> keine Verknüpfung von Rechnung nach Auftrag

Verknüpfung von Rechnung nach Angebot, sowie Auftrag nach Angebot umgesetzt.
Ferner ein einfaches delete $form->{variable_die_resettet_wird} foreach an dieser Stelle
eingebaut (ohne map).
Ferner die Verknüpfung der Belege in eine Schleife gesetzt.

Unterschiede anzeigen:

SL/OE.pm
673 673
  $form->save_status($dbh);
674 674

  
675 675
  # Link this record to the records it was created from.
676
  # check every record type we may link. i am not happy with converting the string to array back
677
  # should be a array from the start (OE.pm -> retrieve).
678
  #  and that i need the local array ref for close_quotation_rfqs. better ideas welcome
676 679
  $form->{convert_from_oe_ids} =~ s/^\s+//;
677 680
  $form->{convert_from_oe_ids} =~ s/\s+$//;
678 681
  my @convert_from_oe_ids      =  split m/\s+/, $form->{convert_from_oe_ids};
679 682
  delete $form->{convert_from_oe_ids};
680

  
681
  if (scalar @convert_from_oe_ids) {
682
    RecordLinks->create_links('dbh'        => $dbh,
683
                              'mode'       => 'ids',
684
                              'from_table' => 'oe',
685
                              'from_ids'   => \@convert_from_oe_ids,
686
                              'to_table'   => 'oe',
687
                              'to_id'      => $form->{id},
688
      );
689

  
683
  @{ $form->{convert_from_oe_ids} }      =  @convert_from_oe_ids;
684
  foreach (qw(ar oe)) {
685
    if ($form->{"convert_from_${_}_ids"}) {
686
      RecordLinks->create_links('dbh'        => $dbh,
687
                                'mode'       => 'ids',
688
                                'from_table' => $_,
689
                                'from_ids'   => $form->{"convert_from_${_}_ids"},
690
                                'to_table'   => 'oe',
691
                                'to_id'      => $form->{id},
692
        );
693
      delete $form->{"convert_from_${_}_ids"};
694
    }
690 695
    $self->_close_quotations_rfqs('dbh'     => $dbh,
691 696
                                  'from_id' => \@convert_from_oe_ids,
692
                                  'to_id'   => $form->{id});
697
                                  'to_id'   => $form->{id}) if $_ eq 'oe';
693 698
  }
694 699

  
695 700
  if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
bin/mozilla/io.pl
843 843
  $form->{old_employee_id} = $form->{employee_id};
844 844
  $form->{old_salesman_id} = $form->{salesman_id};
845 845

  
846
  map { delete $form->{$_} } qw(id printed emailed queued);
846
  # link doc invoice -> quotation (single id no multi mode)
847
  $form->{convert_from_ar_ids} = delete $form->{id};
848

  
849
  delete $form->{$_} foreach (qw(printed emailed queued));
847 850
  my $buysell;
848 851
  if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') {
849 852
    $form->{title} = $locale->text('Add Purchase Order');
......
906 909
  if ($form->{type} =~  /(sales|purchase)_order/) {
907 910
    $form->{"converted_from_orderitems_id_$_"} = delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
908 911
  }
912
  # link doc order -> quotation (single id no multi mode)
913
  $form->{convert_from_oe_ids} = delete $form->{id};
914

  
909 915
  if ($form->{second_run}) {
910 916
    $form->{print_and_post} = 0;
911 917
  }
912
  map { delete $form->{$_} } qw(id printed emailed queued);
918
  delete $form->{$_} foreach (qw(printed emailed queued));
913 919

  
914 920
  my $buysell;
915 921
  if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') {
templates/webpages/oe/form_header.html
19 19
[%- END %]
20 20

  
21 21
    <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
22
    <input type="hidden" name="convert_from_ar_ids" value="[% HTML.escape(convert_from_ar_ids) %]">
22 23

  
23 24
    <input type="hidden" name="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
24 25
    <input type="hidden" name="follow_up_trans_type_1" value="[% HTML.escape(type) %]">

Auch abrufbar als: Unified diff