VbzCart/docs/tables/ord lines: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | tables
Jump to navigation Jump to search
imported>Woozle
(extracted from "tables" page)
 
m (Woozle moved page VbzCart/VbzCart/tables/ord lines to VbzCart/docs/tables/ord lines without leaving a redirect: part 4/5)
 
(2 intermediate revisions by one other user not shown)
Line 2: Line 2:
* '''Purpose''': what's inside each order
* '''Purpose''': what's inside each order
* '''Refers to''': {{vbzcart/table|core_orders}} (parent), {{vbzcart/table|cat_item}}
* '''Refers to''': {{vbzcart/table|core_orders}} (parent), {{vbzcart/table|cat_item}}
* '''Usage''': Although in theory we could just use {{vbzcart/table|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''':
* '''Notes''':
** For installations without legacy data to accomodate, the following fields should probably be NOT NULL: '''CatNum, Descr, QtyOrd, Price, ShipPkg, ShipItem, WhenAdded'''
** For installations without legacy data to accomodate, the following fields should probably be NOT NULL: '''CatNum, Descr, QtyOrd, Price, ShipPkg, ShipItem, WhenAdded'''
Line 7: Line 8:
** 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.
** 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==
==SQL==
<section begin=sql /><mysql>CREATE TABLE `ord_lines` (
<mysql>CREATE TABLE `ord_lines` (
   `ID`            INT          NOT NULL AUTO_INCREMENT,
   `ID`            INT          NOT NULL AUTO_INCREMENT,
   `ID_Order`      INT          NOT NULL      COMMENT "core_orders.ID",
   `ID_Order`      INT          NOT NULL      COMMENT "core_orders.ID",
Line 26: Line 27:
  )
  )
  ENGINE = MYISAM;</mysql>
  ENGINE = MYISAM;</mysql>
<section end=sql />

Latest revision as of 01:57, 25 February 2024

About

  • Purpose: what's inside each order
  • Refers to: Template:Vbzcart/table (parent), Template:Vbzcart/table
  • Usage: Although in theory we could just use Template:Vbzcart/table, 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>