Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9557707c

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 9557707c3a18daeb9371f2366b8637a7e1f0fa3c
  • Vorgänger c1a8c632
  • Nachfolger ae27679f

Revert "Nutzung der Tabelle currencies"

This reverts commit be776964b83340e69fa2f02eae59b703c0c95b88.

Unterschiede anzeigen:

SL/AM.pm
1060 1060
  my %accnos;
1061 1061
  map { ($accnos{$_}) = split(m/--/, $form->{$_}) } qw(inventory_accno income_accno expense_accno fxgain_accno fxloss_accno ar_paid_accno);
1062 1062

  
1063
  $form->{curr}  =~ s/ //g;
1064
  my @currencies =  grep { $_ ne '' } split m/:/, $form->{curr};
1065
  my $currency   =  join ':', @currencies;
1066

  
1063 1067
  # these defaults are database wide
1064 1068

  
1065 1069
  my $query =
......
1083 1087
        assemblynumber     = ?,
1084 1088
        sdonumber          = ?,
1085 1089
        pdonumber          = ?,
1090
        curr               = ?,
1086 1091
        businessnumber     = ?,
1087 1092
        weightunit         = ?,
1088 1093
        language_id        = ?|;
......
1095 1100
                $form->{articlenumber},   $form->{servicenumber},
1096 1101
                $form->{assemblynumber},
1097 1102
                $form->{sdonumber},       $form->{pdonumber},
1103
                $currency,
1098 1104
                $form->{businessnumber},  $form->{weightunit},
1099 1105
                conv_i($form->{language_id}));
1100 1106
  do_query($form, $dbh, $query, @values);
1101 1107

  
1102
  $main::lxdebug->message(0, "es gibt rowcount: " . $form->{rowcount});
1103

  
1104
  for my $i (1..$form->{rowcount}) {
1105
    if ($form->{"curr_$i"} ne $form->{"old_curr_$i"}) {
1106
      $query = qq|UPDATE currencies SET curr = '| . $form->{"curr_$i"} . qq|' WHERE curr = '| . $form->{"old_curr_$i"} . qq|'|;
1107
      do_query($form, $dbh, $query);
1108
    }
1109
  }
1110

  
1111
  if (length($form->{new_curr}) > 0) {
1112
    $query = qq|INSERT INTO currencies (curr) VALUES ('| . $form->{new_curr} . qq|')|;
1113
    do_query($form, $dbh, $query);
1114
  }
1115

  
1116 1108
  $dbh->commit();
1117 1109

  
1118 1110
  $main::lxdebug->leave_sub();
......
1126 1118

  
1127 1119
  my $dbh = $form->get_standard_dbh($myconfig);
1128 1120

  
1129
  my ($businessnumber) = selectrow_query($form, $dbh, qq|SELECT businessnumber FROM defaults|);
1121
  my ($currency, $businessnumber) = selectrow_query($form, $dbh, qq|SELECT curr, businessnumber FROM defaults|);
1130 1122

  
1131 1123
  # update name
1132 1124
  my $query = qq|UPDATE employee SET name = ? WHERE login = ?|;
......
1134 1126

  
1135 1127
  my $rc = $dbh->commit();
1136 1128

  
1129
  # save first currency in myconfig
1130
  $currency               =~ s/:.*//;
1131
  $form->{currency}       =  $currency;
1132

  
1137 1133
  $form->{businessnumber} =  $businessnumber;
1138 1134

  
1139 1135
  $myconfig = User->new(login => $form->{login});

Auch abrufbar als: Unified diff