Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bfdfc9ee

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

  • ID bfdfc9eecd2ea922782f4e1b179b08370b41f2de
  • Vorgänger 44655653
  • Nachfolger 20e80349

warnings unter 5.12.4

Unterschiede anzeigen:

sql/Pg-upgrade2/currencies.pl
69 69
    return 2;
70 70
  }
71 71

  
72
  if ($main::form->{continue_options} eq 'break_up') {
73
    return 0;
74
  }
72
  if (defined $::form->{continue_options}) {
73
    if ($::form->{continue_options} eq 'break_up') {
74
      return 0;
75
    }
75 76

  
76
  if ($main::form->{continue_options} eq 'insert') {
77
    for my $i (0..($rowcount-1)){
78
      push @currency_array, $main::form->{"curr_$i"};
77
    if ($::form->{continue_options} eq 'insert') {
78
      for my $i (0..($rowcount-1)){
79
        push @currency_array, $main::form->{"curr_$i"};
80
      }
81
      create_and_fill_table($self, @currency_array);
82
      return 1;
79 83
    }
80
    create_and_fill_table($self, @currency_array);
81
    return 1;
82
  }
83 84

  
84
  my $still_orphaned;
85
  if ($main::form->{continue_options} eq 'replace') {
86
    for my $i (0..($rowcount - 1)){
87
      $still_orphaned = 1;
88
      for my $item (@currency_array){
89
        if ($main::form->{"curr_$i"} eq $item){
90
          $still_orphaned = 0;
91
          $query = qq|DELETE FROM exchangerate WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
92
          $self->db_query($query);
93
          $query = qq|UPDATE ap SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
94
          $self->db_query($query);
95
          $query = qq|UPDATE ar SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
96
          $self->db_query($query);
97
          $query = qq|UPDATE oe SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
98
          $self->db_query($query);
99
          $query = qq|UPDATE customer SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
100
          $self->db_query($query);
101
          $query = qq|UPDATE delivery_orders SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
102
          $self->db_query($query);
103
          $query = qq|UPDATE vendor SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
104
          $self->db_query($query);
105
          last;
85
    my $still_orphaned;
86
    if ($::form->{continue_options} eq 'replace') {
87
      for my $i (0..($rowcount - 1)){
88
        $still_orphaned = 1;
89
        for my $item (@currency_array){
90
          if ($main::form->{"curr_$i"} eq $item){
91
            $still_orphaned = 0;
92
            $query = qq|DELETE FROM exchangerate WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
93
            $self->db_query($query);
94
            $query = qq|UPDATE ap SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
95
            $self->db_query($query);
96
            $query = qq|UPDATE ar SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
97
            $self->db_query($query);
98
            $query = qq|UPDATE oe SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
99
            $self->db_query($query);
100
            $query = qq|UPDATE customer SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
101
            $self->db_query($query);
102
            $query = qq|UPDATE delivery_orders SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
103
            $self->db_query($query);
104
            $query = qq|UPDATE vendor SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|;
105
            $self->db_query($query);
106
            last;
107
          }
108
        }
109
        if ($still_orphaned){
110
          $main::form->{continue_options} = '';
111
          return do_update();
106 112
        }
107 113
      }
108
      if ($still_orphaned){
109
        $main::form->{continue_options} = '';
110
        return do_update();
111
      }
114
      create_and_fill_table($self, @currency_array);
115
      return 1;
112 116
    }
113
    create_and_fill_table($self, @currency_array);
114
    return 1;
115 117
  }
116 118

  
117 119
  #No orphaned currencies, so create table:
sql/Pg-upgrade2/defaults_posting_config.pl
18 18
  # kivitendo behaviour isn't changed by this update
19 19
  # if payments_changeable is not set in config set it to 0
20 20
  my $payments_changeable = 0;
21
  if ($::lx_office_conf{features}->{payments_changeable} == 1 ) {
22
    $payments_changeable = 1;
23
  } elsif ($::lx_office_conf{features}->{payments_changeable} == 2 ) {
24
    $payments_changeable = 2;
21
  if (defined $::lx_office_conf{features}{payments_changeable}) {
22
    if ($::lx_office_conf{features}->{payments_changeable} == 1 ) {
23
      $payments_changeable = 1;
24
    } elsif ($::lx_office_conf{features}->{payments_changeable} == 2 ) {
25
      $payments_changeable = 2;
26
    }
25 27
  }
26 28

  
27 29
  my $update_column = "UPDATE defaults SET payments_changeable = '$payments_changeable';";
sql/Pg-upgrade2/erzeugnisnummern.pl
13 13
sub run {
14 14
  my ($self) = @_;
15 15

  
16
  if ($::form->{upgrade_action} eq 'filter_parts') {
16
  if (defined $::form->{upgrade_action} && $::form->{upgrade_action} eq 'filter_parts') {
17 17
    return $self->filter_parts($self);
18 18
  }
19 19

  
sql/Pg-upgrade2/warehouse.pl
140 140
    print_question();
141 141
    return 2;
142 142
  } else {
143
    if ($::form->{do_migrate} eq 'Y') {
143
    if (defined $::form->{do_migrate} && $::form->{do_migrate} eq 'Y') {
144 144
      # if yes, both warehouse and bin must be given
145 145
      if (!$::form->{import_warehouse} || !$::form->{bin_default}) {
146 146
        print_question();
......
150 150
      $do_sql_migration = 1;
151 151
    }
152 152
  }
153
  my $warehouse = $::form->{import_warehouse} ne '' ? $::form->{import_warehouse} : "Transfer";
154
  my $bin       = $::form->{bin_default}      ne '' ? $::form->{bin_default}      : "1";
153
  my $warehouse = defined $::form->{import_warehouse} && $::form->{import_warehouse} ne '' ? $::form->{import_warehouse} : "Transfer";
154
  my $bin       = defined $::form->{bin_default}      && $::form->{bin_default}      ne '' ? $::form->{bin_default}      : "1";
155 155

  
156 156
  $warehouse    = $self->dbh->quote($warehouse);
157 157
  $bin          = $self->dbh->quote($bin);
t/rdbo_consistency.t
49 49

  
50 50
sub test_use_in_all_exists_as_db {
51 51
  foreach my $package (map { m/^use\s+(.+?);/; $1 } grep { '^use SL::DB::' } split m/\n/, $all_content) {
52
    next unless $package;
52 53
    next unless $package =~ m/^SL::DB::(.+)/;
53 54
    my $file = $1;
54 55
    $file    =~ s{::}{/}g;

Auch abrufbar als: Unified diff