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/AR.pm
56 56

  
57 57
  my $dbh = $provided_dbh ? $provided_dbh : $form->dbconnect_noauto($myconfig);
58 58
  $form->{defaultcurrency} = $form->get_default_currency($myconfig);
59
  delete $form->{currency} unless $form->{defaultcurrency};
59 60

  
60 61
  # set exchangerate
61 62
  $form->{exchangerate} = ($form->{currency} eq $form->{defaultcurrency}) ? 1 :
......
134 135
    } else {
135 136
      $query = qq|SELECT nextval('glid')|;
136 137
      ($form->{id}) = selectrow_query($form, $dbh, $query);
137
      $query = qq|INSERT INTO ar (id, invnumber, employee_id, curr) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE curr=?))|;
138
      do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency});
138
      $query = qq|INSERT INTO ar (id, invnumber, employee_id) VALUES (?, 'dummy', ?)|;
139
      do_query($form, $dbh, $query, $form->{id}, $form->{employee_id});
139 140
      $form->{invnumber} = $form->update_defaults($myconfig, "invnumber", $dbh) unless $form->{invnumber};
140 141
    }
141 142
  }
......
155 156
      qq|UPDATE ar set
156 157
           invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?,
157 158
           taxincluded = ?, amount = ?, duedate = ?, paid = ?,
158
           netamount = ?, notes = ?, department_id = ?,
159
           netamount = ?, curr = ?, notes = ?, department_id = ?,
159 160
           employee_id = ?, storno = ?, storno_id = ?, globalproject_id = ?,
160 161
           direct_debit = ?
161 162
         WHERE id = ?|;
162 163
    my @values = ($form->{invnumber}, $form->{ordnumber}, conv_date($form->{transdate}), conv_i($form->{customer_id}), $form->{taxincluded} ? 't' : 'f', $form->{amount},
163
                  conv_date($form->{duedate}), $form->{paid}, $form->{netamount}, $form->{notes}, conv_i($form->{department_id}),
164
                  conv_date($form->{duedate}), $form->{paid}, $form->{netamount}, $form->{currency}, $form->{notes}, conv_i($form->{department_id}),
164 165
                  conv_i($form->{employee_id}), $form->{storno} ? 't' : 'f', $form->{storno_id},
165 166
                  conv_i($form->{globalproject_id}), $form->{direct_debit} ? 't' : 'f', conv_i($form->{id}));
166 167
    do_query($form, $dbh, $query, @values);
......
425 426

  
426 427
  $form->{exchangerate}    = $form->format_amount($myconfig, $form->{exchangerate});
427 428
  $form->{defaultcurrency} = $form->get_default_currency($myconfig);
429
  delete $form->{currency} unless $form->{defaultcurrency};
428 430

  
429 431
  # Get the AR accno (which is normally done by Form::create_links()).
430 432
  $query =

Auch abrufbar als: Unified diff