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/IS.pm
458 458
  my $query =
459 459
    qq|SELECT ct.*, cp.*, ct.notes as customernotes,
460 460
         ct.phone AS customerphone, ct.fax AS customerfax, ct.email AS customeremail,
461
         (SELECT cu.curr FROM currencies cu WHERE cu.id=ct.curr) AS currency
461
         (SELECT cu.name FROM currencies cu WHERE cu.id=ct.currency_id) AS currency
462 462
       FROM customer ct
463 463
       LEFT JOIN contacts cp on ct.id = cp.cp_cv_id
464 464
       WHERE (ct.id = ?) $where
......
555 555
      $query = qq|SELECT nextval('glid')|;
556 556
      ($form->{"id"}) = selectrow_query($form, $dbh, $query);
557 557

  
558
      $query = qq|INSERT INTO ar (id, invnumber, curr) VALUES (?, ?, (SELECT id FROM currencies WHERE curr=?))|;
558
      $query = qq|INSERT INTO ar (id, invnumber, currency_id) VALUES (?, ?, (SELECT id FROM currencies WHERE name=?))|;
559 559
      do_query($form, $dbh, $query, $form->{"id"}, $form->{"id"}, $form->{currency});
560 560

  
561 561
      if (!$form->{invnumber}) {
......
1081 1081
                amount      = ?, netamount     = ?, paid          = ?,
1082 1082
                duedate     = ?, deliverydate  = ?, invoice       = ?, shippingpoint = ?,
1083 1083
                shipvia     = ?, terms         = ?, notes         = ?, intnotes      = ?,
1084
                curr        = (SELECT id FROM currencies WHERE curr= ?),
1084
                currency_id = (SELECT id FROM currencies WHERE name = ?),
1085 1085
                department_id = ?, payment_id    = ?, taxincluded   = ?,
1086 1086
                type        = ?, language_id   = ?, taxzone_id    = ?, shipto_id     = ?,
1087 1087
                employee_id = ?, salesman_id   = ?, storno_id     = ?, storno        = ?,
......
1574 1574
           a.orddate, a.quodate, a.globalproject_id,
1575 1575
           a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate,
1576 1576
           a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.taxzone_id,
1577
           a.duedate, a.taxincluded, (SELECT cu.curr FROM currencies cu WHERE cu.id=a.curr) AS currency, a.shipto_id, a.cp_id,
1577
           a.duedate, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.shipto_id, a.cp_id,
1578 1578
           a.employee_id, a.salesman_id, a.payment_id,
1579 1579
           a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
1580 1580
           a.transaction_description, a.donumber, a.invnumber_for_credit_note,
......
1750 1750
         c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
1751 1751
         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
1752 1752
         c.street, c.zipcode, c.city, c.country,
1753
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, (SELECT cu.curr FROM currencies cu WHERE cu.id=c.curr) AS curr,
1753
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, (SELECT cu.name FROM currencies cu WHERE cu.id=c.currency_id) AS curr,
1754 1754
         c.taxincluded_checked, c.direct_debit,
1755 1755
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
1756 1756
         b.discount AS tradediscount, b.description AS business
......
1795 1795
  $query =
1796 1796
    qq|SELECT o.amount,
1797 1797
         (SELECT e.buy FROM exchangerate e
1798
          WHERE e.curr = o.curr
1798
          WHERE e.currency_id = o.currency_id
1799 1799
            AND e.transdate = o.transdate)
1800 1800
       FROM oe o
1801 1801
       WHERE o.customer_id = ?

Auch abrufbar als: Unified diff