Und noch mehr Optionen.
[kivitendo-erp.git] / SL / IS.pm
index e703fcc..6286939 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -421,7 +421,7 @@ sub customer_details {
   # get contact id, set it if nessessary
   $form->{cp_id} *= 1;
 
-  my @values;
+  my @values =  (conv_i($form->{customer_id}));
 
   my $where = "";
   if ($form->{cp_id}) {
@@ -438,7 +438,6 @@ sub customer_details {
        WHERE (ct.id = ?) $where
        ORDER BY cp.cp_id
        LIMIT 1|;
-  push(@values, conv_i($form->{customer_id}));
   my $ref = selectfirst_hashref_query($form, $dbh, $query, @values);
 
   # remove id and taxincluded before copy back
@@ -1370,16 +1369,11 @@ sub retrieve_invoice {
 
   $query =
     qq|SELECT
-         (SELECT c.accno FROM chart c
-          WHERE d.inventory_accno_id = c.id) AS inventory_accno,
-         (SELECT c.accno FROM chart c
-          WHERE d.income_accno_id = c.id) AS income_accno,
-         (SELECT c.accno FROM chart c
-          WHERE d.expense_accno_id = c.id) AS expense_accno,
-         (SELECT c.accno FROM chart c
-          WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
-         (SELECT c.accno FROM chart c
-          WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+         (SELECT c.accno FROM chart c WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+         (SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id)    AS income_accno,
+         (SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id)   AS expense_accno,
+         (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id)    AS fxgain_accno,
+         (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id)    AS fxloss_accno,
          d.curr AS currencies
          ${query_transdate}
        FROM defaults d|;