From: Jan Büren Date: Mon, 10 Jun 2013 11:22:18 +0000 (+0200) Subject: SQL-Fix für vergessene currency_id bei AP X-Git-Tag: release-3.1.0beta1~348 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0e523230382ba442bf726a1669b50eb68862218f;p=kivitendo-erp.git SQL-Fix für vergessene currency_id bei AP currency_id auch in der if-bedingung schreiben, nicht nur im else-Zweig --- diff --git a/SL/AP.pm b/SL/AP.pm index bc5a36202..7a148d610 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -170,9 +170,10 @@ sub post_transaction { $uid = substr($uid, 2, 75); $query = - qq|INSERT INTO ap (invnumber, employee_id) | . - qq|VALUES (?, (SELECT e.id FROM employee e WHERE e.login = ?))|; - do_query($form, $dbh, $query, $uid, $form->{login}); + qq|INSERT INTO ap (invnumber, employee_id,currency_id) | . + qq|VALUES (?, (SELECT e.id FROM employee e WHERE e.login = ?), + (SELECT id FROM currencies WHERE name = ?) )|; + do_query($form, $dbh, $query, $uid, $form->{login}, $form->{currency}); $query = qq|SELECT a.id FROM ap a WHERE a.invnumber = ?|;