Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a4d74009

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID a4d740099476b4383a40a21ab5472e75806f3f4f
  • Vorgänger 714a28b1
  • Nachfolger 96dbc076

Verbesserungen in Upgrade-Scripten

In den Scripten currencies.pl rm_whitespaces wurden einige Ver-
besserungen durchgeführt:
1. Umbenennung von Spalten curr in currency_id in allen Tabellen
außer currencies.
2. Umbenennung von Spalte curr in name in Tabelle currencies.
3. Update in rm_whitespaces wird jetzt in einer Schleife erledigt
anstatt für jede Tabelle eigenen Code zu schreiben.
4. Tabelle currencies hat jetzt id als Primärschlüssel und nicht
mehr curr.

Die oben aufgeführten Änderungen führen natürlich auch zu notwendigen
Änderungen im Programm, welche dieses Commit ebenfalls enthält.

Unterschiede anzeigen:

SL/IR.pm
77 77
      &reverse_invoice($dbh, $form);
78 78
    } else {
79 79
      ($form->{id}) = selectrow_query($form, $dbh, qq|SELECT nextval('glid')|);
80
      do_query($form, $dbh, qq|INSERT INTO ap (id, invnumber, curr) VALUES (?, '', (SELECT id FROM currencies WHERE curr=?))|, $form->{id}, $form->{currency});
80
      do_query($form, $dbh, qq|INSERT INTO ap (id, invnumber, currency_id) VALUES (?, '', (SELECT id FROM currencies WHERE name=?))|, $form->{id}, $form->{currency});
81 81
    }
82 82
  }
83 83

  
......
940 940
  $query = qq|SELECT cp_id, invnumber, transdate AS invdate, duedate,
941 941
                orddate, quodate, globalproject_id,
942 942
                ordnumber, quonumber, paid, taxincluded, notes, taxzone_id, storno, gldate,
943
                intnotes, (SELECT cu.curr FROM currencies cu WHERE cu.id=ap.curr) AS currency, direct_debit
943
                intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit
944 944
              FROM ap
945 945
              WHERE id = ?|;
946 946
  $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id}));
......
1087 1087
         v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
1088 1088
         v.creditlimit, v.terms, v.notes AS intnotes,
1089 1089
         v.email, v.cc, v.bcc, v.language_id, v.payment_id,
1090
         v.street, v.zipcode, v.city, v.country, v.taxzone_id, (SELECT cu.curr FROM currencies cu WHERE cu.id=v.curr) AS curr, v.direct_debit,
1090
         v.street, v.zipcode, v.city, v.country, v.taxzone_id, (SELECT cu.name FROM currencies cu WHERE cu.id=v.currency_id) AS curr, v.direct_debit,
1091 1091
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
1092 1092
         b.description AS business
1093 1093
       FROM vendor v
......
1109 1109
  $query = qq|SELECT o.amount,
1110 1110
                (SELECT e.sell
1111 1111
                 FROM exchangerate e
1112
                 WHERE (e.curr = o.curr)
1112
                 WHERE (e.currency_id = o.currency_id)
1113 1113
                   AND (e.transdate = o.transdate)) AS exch
1114 1114
              FROM oe o
1115 1115
              WHERE (o.vendor_id = ?) AND (o.quotation = '0') AND (o.closed = '0')|;
......
1384 1384
  # fax and phone and email as vendor*
1385 1385
  my $query =
1386 1386
    qq|SELECT ct.*, cp.*, ct.notes as vendornotes, phone as vendorphone, fax as vendorfax, email as vendoremail,
1387
         (SELECT cu.curr FROM currencies cu WHERE cu.id=ct.curr) AS currency
1387
         (SELECT cu.name FROM currencies cu WHERE cu.id=ct.currency_id) AS currency
1388 1388
       FROM vendor ct
1389 1389
       LEFT JOIN contacts cp ON (ct.id = cp.cp_cv_id)
1390 1390
       WHERE (ct.id = ?) $contact

Auch abrufbar als: Unified diff