VbzCart/tables/ord lines

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | tables
Revision as of 00:36, 26 October 2014 by Woozle (talk | contribs) (usage note)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: what's inside each order
  • Refers to:
  1. REDIRECT Template:l/vc/table (parent), cat_item
  • Usage: Although in theory we could just use shop_cart_line, this table stores additional information about each item at checkout time in case those parameters change -- so it's not redundant. We don't want to put those fields in shop_cart_line because that would take up extra room in abandoned carts.
  • Notes:
    • For installations without legacy data to accomodate, the following fields should probably be NOT NULL: CatNum, Descr, QtyOrd, Price, ShipPkg, ShipItem, WhenAdded
    • The whole isShipEst thing is awkward and not very useful. We might just want to ditch it and state that all shipping charges are subject to revision but we will wait for customer approval if the shipping charge is over the price quoted.
    • The fields VbzUser and Machine should probably go away; that sort of thing should be in an event log. These fields were only ever used during migration, and no timestamp was stored here along with the migration note, so they should just be deleted.

SQL

<mysql>CREATE TABLE `ord_lines` (

  `ID`             INT          NOT NULL AUTO_INCREMENT,
  `ID_Order`       INT          NOT NULL      COMMENT "core_orders.ID",
  `Seq`            INT          DEFAULT NULL  COMMENT "sequence in which items were added to order",
  `ID_Item`        INT          NOT NULL      COMMENT "cat_item.ID",
  `CatNum`         VARCHAR(63)  DEFAULT NULL  COMMENT "catalog number as ordered",
  `Descr`          VARCHAR(255) DEFAULT NULL  COMMENT "description as ordered",
  `QtyOrd`         INT          DEFAULT NULL  COMMENT "quantity ordered",
  `Price`          DECIMAL(9,2) DEFAULT NULL  COMMENT "price quoted for this item",
  `ShipPkg`        DECIMAL(9,2) DEFAULT NULL  COMMENT "per-package shipping quoted",
  `ShipItm`        DECIMAL(9,2) DEFAULT NULL  COMMENT "per-item shipping quoted",
  `isShipEst`      BOOL         DEFAULT FALSE COMMENT "TRUE = shipping charge is an estimate",
  `WhenAdded`      DATETIME     DEFAULT NULL  COMMENT "when this item was added to the order",
  `Notes`          VARCHAR(255) DEFAULT NULL  COMMENT "admin-added notes",
  `VbzUser`        VARCHAR(127)               COMMENT "VbzCart username, for when we have a user system",
  `Machine`        VARCHAR(64)                COMMENT "network name (or IP address) of machine which added this line",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>