static update(date, location, name, gain, lost) {
    let DepID = "13"
    if (name === "Red Paw" || name === "Blue Paw" || name === "Black Paw" ||
      name === "UPC, Paws, Red" || name === "UPC, Paws, Blue" || name === "UPC, Paws, Black" ||
      name === "Core" || name === "Screw" || name === "Shipping Envelope" ||
      name === "Blister" || name === "Blister Card"){ 
        DepID = "25"
      } else if (name === "Red Plastic Sheet" || name === "Blue Plastic Sheet" || name === "Black Plastic Sheet" ||
      name === "UPC, Truck, Red" || name === "UPC, Truck, Blue" || name === "UPC, Truck, Black" ||
      name === "UPC, Noteboard, Red" || name === "UPC, Noteboard, Blue" || name === "UPC, Noteboard, Black" ||
      name === "Grommet" || name === "Velcro" || name === "Sticker, Truck" ||
      name === "Grill Box" || name === "Sticker, Noteboard"){
       DepID = "18"
      } else if (location === "Main") {
        DepID = "29"
      }
    return db.query( 
      'INSERT INTO amounts (Date, DepID, MatID, InStock, Lost) \
      SELECT * FROM ( \
        SELECT DISTINCT ?, ?, MatID, ? AS MatsInStock, ? AS MatsLost \
        FROM departments INNER JOIN amounts ON DepartmentID = DepID \
          INNER JOIN materials ON MaterialID = MatID \
        WHERE MaterialName LIKE ? \
      ) AS temp \
      ON DUPLICATE KEY UPDATE InStock = InStock + temp.MatsInStock, Lost = Lost + temp.MatsLost',
    [date, DepID, gain, lost, name])
  }
// Inserts a new record. Updates any previous record with the same date, depID, and matID.
Inserts a new record. Updates any previous record with the same date, depID, and matID.
Inserts a new record . Updates any previous record with the same date depID and matID .
static update(date, location, name, gain, lost) {
    let DepID = "13"
    if (name === "Red Paw" || name === "Blue Paw" || name === "Black Paw" ||
      name === "UPC, Paws, Red" || name === "UPC, Paws, Blue" || name === "UPC, Paws, Black" ||
      name === "Core" || name === "Screw" || name === "Shipping Envelope" ||
      name === "Blister" || name === "Blister Card"){ 
        DepID = "25"
      } else if (name === "Red Plastic Sheet" || name === "Blue Plastic Sheet" || name === "Black Plastic Sheet" ||
      name === "UPC, Truck, Red" || name === "UPC, Truck, Blue" || name === "UPC, Truck, Black" ||
      name === "UPC, Noteboard, Red" || name === "UPC, Noteboard, Blue" || name === "UPC, Noteboard, Black" ||
      name === "Grommet" || name === "Velcro" || name === "Sticker, Truck" ||
      name === "Grill Box" || name === "Sticker, Noteboard"){
       DepID = "18"
      } else if (location === "Main") {
        DepID = "29"
      }
    return db.query( 
      'INSERT INTO amounts (Date, DepID, MatID, InStock, Lost) \
      SELECT * FROM ( \
        SELECT DISTINCT ?, ?, MatID, ? AS MatsInStock, ? AS MatsLost \
        FROM departments INNER JOIN amounts ON DepartmentID = DepID \
          INNER JOIN materials ON MaterialID = MatID \
        WHERE MaterialName LIKE ? \
      ) AS temp \
      ON DUPLICATE KEY UPDATE InStock = InStock + temp.MatsInStock, Lost = Lost + temp.MatsLost',
    [date, DepID, gain, lost, name])
  }
static update ( date , location , name , gain , lost ) { let DepID = "13" if ( name === "Red Paw" || name === "Blue Paw" || name === "Black Paw" || name === "UPC, Paws, Red" || name === "UPC, Paws, Blue" || name === "UPC, Paws, Black" || name === "Core" || name === "Screw" || name === "Shipping Envelope" || name === "Blister" || name === "Blister Card" ) { DepID = "25" } else if ( name === "Red Plastic Sheet" || name === "Blue Plastic Sheet" || name === "Black Plastic Sheet" || name === "UPC, Truck, Red" || name === "UPC, Truck, Blue" || name === "UPC, Truck, Black" || name === "UPC, Noteboard, Red" || name === "UPC, Noteboard, Blue" || name === "UPC, Noteboard, Black" || name === "Grommet" || name === "Velcro" || name === "Sticker, Truck" || name === "Grill Box" || name === "Sticker, Noteboard" ) { DepID = "18" } else if ( location === "Main" ) { DepID = "29" } return db . query ( 'INSERT INTO amounts (Date, DepID, MatID, InStock, Lost) \
      SELECT * FROM ( \
        SELECT DISTINCT ?, ?, MatID, ? AS MatsInStock, ? AS MatsLost \
        FROM departments INNER JOIN amounts ON DepartmentID = DepID \
          INNER JOIN materials ON MaterialID = MatID \
        WHERE MaterialName LIKE ? \
      ) AS temp \
      ON DUPLICATE KEY UPDATE InStock = InStock + temp.MatsInStock, Lost = Lost + temp.MatsLost' , [ date , DepID , gain , lost , name ] ) }
Inserts a new record.
Inserts a new record .