[
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "Quote",
    "table": "xt.quheadinfo",
    "isRest": true,
    "idSequenceName": "quhead_quhead_id_seq",
    "lockable": true,
    "lockTable": "quhead",
    "comment": "Quote Map",
    "privileges": {
      "all": {
        "create": "MaintainQuotes",
        "read": "ViewQuotes",
        "update": "MaintainQuotes",
        "delete": "MaintainQuotes"
      },
      "attribute": {
        "margin": {
          "view": "ShowMarginsOnSalesOrder"
        },
        "quoteDate": {
          "create": "OverrideSODate",
          "update": "OverrideSODate"
        },
        "packDate": {
          "create": "AlterPackDate",
          "update": "AlterPackDate"
        }
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "quhead_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "quhead_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "customer",
        "toOne": {
          "isNested": true,
          "type": "CustomerProspectRelation",
          "column": "quhead_cust_id",
          "required": true
        }
      },
      {
        "name": "customerPurchaseOrderNumber",
        "attr": {
          "type": "String",
          "column": "quhead_custponumber"
         }
      },
      {
        "name": "quoteDate",
        "attr": {
          "type": "Date",
          "column": "quhead_quotedate",
          "required": true
        }
      },
      {
        "name": "packDate",
        "attr": {
          "type": "Date",
          "column": "quhead_packdate"
        }
      },
      {
        "name": "scheduleDate",
        "attr": {
          "type": "DueDate",
          "column": "schedule_date"
        }
      },
      {
        "name": "terms",
        "toOne": {
          "type": "Terms",
          "column": "quhead_terms_id",
          "required": true
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "quhead_salesrep_id",
          "required": true
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "quhead_commission"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "quhead_taxzone_id"
        }
      },
      {
        "name": "site",
        "toOne": {
          "type": "Site",
          "column": "quhead_warehous_id"
        }
      },
      {
        "name": "saleType",
        "toOne": {
          "type": "SaleType",
          "column": "quhead_saletype_id"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "quhead_status"
        }
      },
      {
        "name": "expireDate",
        "attr": {
          "type": "Date",
          "column": "quhead_expire"
        }
      },
      {
        "name": "billtoName",
        "attr": {
          "type": "String",
          "column": "quhead_billtoname"
        }
      },
      {
        "name": "billtoAddress1",
        "attr": {
          "type": "String",
          "column": "quhead_billtoaddress1"
        }
      },
      {
        "name": "billtoAddress2",
        "attr": {
          "type": "String",
          "column": "quhead_billtoaddress2"
        }
      },
      {
        "name": "billtoAddress3",
        "attr": {
          "type": "String",
          "column": "quhead_billtoaddress3"
        }
      },
      {
        "name": "billtoCity",
        "attr": {
          "type": "String",
          "column": "quhead_billtocity"
        }
      },
      {
        "name": "billtoState",
        "attr": {
          "type": "String",
          "column": "quhead_billtostate"
        }
      },
      {
        "name": "billtoCountry",
        "attr": {
          "type": "String",
          "column": "quhead_billtocountry"
        }
      },
      {
        "name": "billtoPostalCode",
        "attr": {
          "type": "String",
          "column": "quhead_billtozip"
        }
      },
      {
        "name": "billtoContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "quhead_billto_cntct_id"
        }
      },
      {
        "name": "billtoContactHonorific",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_honorific"
        }
      },
      {
        "name": "billtoContactFirstName",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_first_name"
        }
      },
      {
        "name": "billtoContactMiddleName",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_middle"
        }
      },
      {
        "name": "billtoContactLastName",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_last_name"
        }
      },
      {
        "name": "billtoContactSuffix",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_suffix"
        }
      },
      {
        "name": "billtoContactPhone",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_phone"
        }
      },
      {
        "name": "billtoContactTitle",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_title"
        }
      },
      {
        "name": "billtoContactFax",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_fax"
        }
      },
      {
        "name": "billtoContactEmail",
        "attr": {
          "type": "String",
          "column": "quhead_billto_cntct_email"
        }
      },
      {
        "name": "shipto",
        "toOne": {
          "isNested": true,
          "type": "CustomerShiptoRelation",
          "column": "quhead_shipto_id"
        }
      },
      {
        "name": "shiptoName",
        "attr": {
          "type": "String",
          "column": "quhead_shiptoname"
        }
      },
      {
        "name": "shiptoAddress1",
        "attr": {
          "type": "String",
          "column": "quhead_shiptoaddress1"
        }
      },
      {
        "name": "shiptoAddress2",
        "attr": {
          "type": "String",
          "column": "quhead_shiptoaddress2"
        }
      },
      {
        "name": "shiptoAddress3",
        "attr": {
          "type": "String",
          "column": "quhead_shiptoaddress3"
        }
      },
      {
        "name": "shiptoCity",
        "attr": {
          "type": "String",
          "column": "quhead_shiptocity"
        }
      },
      {
        "name": "shiptoState",
        "attr": {
          "type": "String",
          "column": "quhead_shiptostate"
        }
      },
      {
        "name": "shiptoCountry",
        "attr": {
          "type": "String",
          "column": "quhead_shiptocountry"
        }
      },
      {
        "name": "shiptoPostalCode",
        "attr": {
          "type": "String",
          "column": "quhead_shiptozipcode"
        }
      },
      {
        "name": "shiptoContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "quhead_shipto_cntct_id"
        }
      },
      {
        "name": "shiptoContactHonorific",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_honorific"
        }
      },
      {
        "name": "shiptoContactFirstName",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_first_name"
        }
      },
      {
        "name": "shiptoContactMiddleName",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_middle"
        }
      },
      {
        "name": "shiptoContactLastName",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_last_name"
        }
      },
      {
        "name": "shiptoContactSuffix",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_suffix"
        }
      },
      {
        "name": "shiptoContactPhone",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_phone"
        }
      },
      {
        "name": "shiptoContactTitle",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_title"
        }
      },
      {
        "name": "shiptoContactFax",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_fax"
        }
      },
      {
        "name": "shiptoContactEmail",
        "attr": {
          "type": "String",
          "column": "quhead_shipto_cntct_email"
        }
      },
      {
        "name": "orderNotes",
        "attr": {
          "type": "String",
          "column": "quhead_ordercomments"
        }
      },
      {
        "name": "shipNotes",
        "attr": {
          "type": "String",
          "column": "quhead_shipcomments"
        }
      },
      {
        "name": "fob",
        "attr": {
          "type": "String",
          "column": "quhead_fob"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "quhead_shipvia"
        }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "quhead_curr_id"
        }
      },
      {
        "name": "calculateFreight",
        "attr": {
          "type": "Boolean",
          "column": "quhead_calcfreight",
          "required": true
        }
      },
      {
        "name": "shipZone",
        "toOne": {
          "type": "ShipZone",
          "column": "quhead_shipzone_id"
        }
      },
      {
        "name": "margin",
        "attr": {
          "type": "Percent",
          "column": "margin"
        }
      },
      {
        "name": "freightWeight",
        "attr": {
          "type": "Number",
          "column": "freight_weight"
        }
      },
      {
        "name": "subtotal",
        "attr": {
          "type": "Number",
          "column": "subtotal"
        }
      },
      {
        "name": "taxTotal",
        "attr": {
          "type": "Number",
          "column": "tax_total"
        }
      },
      {
        "name": "miscCharge",
        "attr": {
          "type": "Number",
          "column": "quhead_misc"
        }
      },
      {
        "name": "freight",
        "attr": {
          "type": "Number",
          "column": "quhead_freight"
        }
      },
      {
        "name": "total",
        "attr": {
          "type": "Number",
          "column": "total"
        }
      },
      {
        "name": "lineItems",
        "toMany": {
          "isNested": true,
          "type": "QuoteLine",
          "column": "quhead_id",
          "inverse": "quote"
        }
      },
      {
        "name": "documents",
        "toMany": {
          "type": "DocumentAssociation",
          "column": "quhead_id",
          "inverse": "source",
          "sourceType": "Qquhead_id",
          "isNested": true
        }
      },
      {
        "name": "comments",
        "toMany": {
          "isNested": true,
          "type": "QuoteComment",
          "column": "quhead_id",
          "inverse": "source",
          "required": true
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteComment",
    "table": "comment",
    "idSequenceName": "comment_comment_id_seq",
    "comment": "Quote Comment Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": "EditOthersComments",
        "delete": false
      },
      "personal": {
        "update": "EditOwnComments",
        "properties": [
          "createdBy"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "comment_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "sourceType",
        "attr": {
          "type": "String",
          "column": "comment_source",
          "value": "Q"
        }
      },
      {
        "name": "source",
        "attr": {
          "type": "Number",
          "column": "comment_source_id"
        }
      },
      {
        "name": "commentType",
        "toOne": {
          "type": "CommentType",
          "column": "comment_cmnttype_id",
          "required": true
        }
      },
      {
        "name": "text",
        "attr": {
          "type": "String",
          "column": "comment_text"
        }
      },
      {
        "name": "isPublic",
        "attr": {
          "type": "Boolean",
          "column": "comment_public",
          "value": true
        }
      },
      {
        "name": "created",
        "attr": {
          "type": "Date",
          "column": "comment_date"
        }
      },
      {
        "name": "createdBy",
        "attr": {
          "type": "String",
          "column": "comment_user"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteLine",
    "table": "xt.quiteminfo",
    "isRest": true,
    "idSequenceName": "quitem_quitem_id_seq",
    "comment": "Quote Line Item Map",
    "privileges": {
      "all": {
        "create": "MaintainQuotes",
        "read": "ViewQuotes",
        "update": "MaintainQuotes",
        "delete": "MaintainQuotes"
      },
      "attribute": {
        "taxType": {
          "create": "OverrideTax",
          "update": "OverrideTax"
        },
        "margin": {
          "view": "ShowMarginsOnSalesOrder"
        },
        "unitCost": {
          "view": "ViewCosts"
        },
        "markup": {
          "view": "ViewCosts"
        }
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "quitem_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "quote",
        "attr": {
          "type": "Number",
          "column": "quitem_quhead_id",
          "required": true
        }
      },
      {
        "name": "lineNumber",
        "attr": {
          "type": "Number",
          "column": "quitem_linenumber",
          "required": true
        }
      },
      {
        "name": "item",
        "toOne": {
          "type": "ItemRelation",
          "column": "quitem_item_id",
          "isNested": true,
          "required": true
        }
      },
      {
        "name": "site",
        "toOne": {
          "type": "SiteRelation",
          "column": "quitem_order_warehous_id",
          "isNested": true
        }
      },
      {
        "name": "unitCost",
        "attr": {
          "type": "Cost",
          "column": "quitem_unitcost"
        }
      },
      {
        "name": "quantity",
        "attr": {
          "type": "Quantity",
          "column": "quitem_qtyord",
          "required": true
        }
      },
      {
        "name": "quantityUnit",
        "toOne": {
          "type": "Unit",
          "column": "quitem_qty_uom_id",
          "required": true
        }
      },
      {
        "name": "quantityUnitRatio",
        "attr": {
          "type": "UnitRatio",
          "column": "quitem_qty_invuomratio",
          "required": true
        }
      },
      {
        "name": "basePrice",
        "attr": {
          "type": "SalesPrice",
          "column": "base_price"
        }
      },
      {
        "name": "customerPrice",
        "attr": {
          "type": "SalesPrice",
          "column": "quitem_custprice",
          "required": true
        }
      },
      {
        "name": "discount",
        "attr": {
          "type": "Percent",
          "column": "cust_discount"
        }
      },
      {
        "name": "price",
        "attr": {
          "type": "SalesPrice",
          "column": "quitem_price",
          "required": true
        }
      },
      {
        "name": "scheduleDate",
        "attr": {
          "type": "DueDate",
          "column": "quitem_scheddate",
          "required": true
        }
      },
      {
        "name": "promiseDate",
        "attr": {
          "type": "Date",
          "column": "quitem_promdate"
        }
      },
      {
        "name": "markup",
        "attr": {
          "type": "Percent",
          "column": "markup"
        }
      },
      {
        "name": "listPrice",
        "attr": {
          "type": "Money",
          "column": "list_price"
        }
      },
      {
        "name": "listPriceDiscount",
        "attr": {
          "type": "Percent",
          "column": "list_price_discount"
        }
      },
      {
        "name": "customerPartNumber",
        "attr": {
          "type": "String",
          "column": "quitem_custpn"
        }
      },
      {
        "name": "priceUnit",
        "toOne": {
          "type": "Unit",
          "column": "quitem_price_uom_id",
          "required": true
        }
      },
      {
        "name": "priceUnitRatio",
        "attr": {
          "type": "UnitRatio",
          "column": "quitem_price_invuomratio",
          "required": true
        }
      },
      {
        "name": "extendedPrice",
        "attr": {
          "type": "ExtendedPrice",
          "column": "ext_price"
        }
      },
      {
        "name": "margin",
        "attr": {
          "type": "Percent",
          "column": "margin"
        }
      },
      {
        "name": "taxType",
        "toOne": {
          "type": "TaxType",
          "column": "quitem_taxtype_id"
        }
      },
      {
        "name": "tax",
        "attr": {
          "type": "Number",
          "column": "tax"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "quitem_memo"
        }
      },
      {
        "name": "comments",
        "toMany": {
          "type": "QuoteLineComment",
          "column": "quitem_id",
          "inverse": "quoteLine",
          "isNested": true
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "type": "QuoteLineCharacteristic",
          "column": "quitem_id",
          "inverse": "quoteLine",
          "isNested": true
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteLineCharacteristic",
    "table": "charass",
    "idSequenceName": "charass_charass_id_seq",
    "comment": "Quote Line Characteristic Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "charass_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "targetType",
        "attr": {
          "type": "String",
          "column": "charass_target_type",
          "value": "QI"
        }
      },
      {
        "name": "quoteLine",
        "attr": {
          "type": "Number",
          "column": "charass_target_id"
        }
      },
      {
        "name": "characteristic",
        "toOne": {
          "type": "Characteristic",
          "column": "charass_char_id",
          "required": true
        }
      },
      {
        "name": "value",
        "attr": {
          "type": "String",
          "column": "charass_value"
        }
      },
      {
        "name": "price",
        "attr": {
          "type": "Money",
          "column": "charass_price"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteLineComment",
    "table": "comment",
    "idSequenceName": "comment_comment_id_seq",
    "comment": "Quote Line Comment Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": "EditOthersComments",
        "delete": false
      },
      "personal": {
        "update": "EditOwnComments",
        "properties": [
          "createdBy"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "comment_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "sourceType",
        "attr": {
          "type": "String",
          "column": "comment_source",
          "value": "QI"
        }
      },
      {
        "name": "quoteLine",
        "attr": {
          "type": "Number",
          "column": "comment_source_id"
        }
      },
      {
        "name": "commentType",
        "toOne": {
          "type": "CommentType",
          "column": "comment_cmnttype_id",
          "required": true
        }
      },
      {
        "name": "text",
        "attr": {
          "type": "String",
          "column": "comment_text"
        }
      },
      {
        "name": "isPublic",
        "attr": {
          "type": "Boolean",
          "column": "comment_public",
          "value": true
        }
      },
      {
        "name": "created",
        "attr": {
          "type": "Date",
          "column": "comment_date"
        }
      },
      {
        "name": "createdBy",
        "attr": {
          "type": "String",
          "column": "comment_user"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteListItem",
    "table": "xt.quheadinfo",
    "isRest": true,
    "comment": "Quote List Item Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewQuotes MaintainQuotes",
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "quhead_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "quhead_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "customer",
        "toOne": {
          "isNested": true,
          "type": "CustomerProspectRelation",
          "column": "quhead_cust_id"
        }
      },
      {
        "name": "customerPurchaseOrderNumber",
        "attr": {
          "type": "String",
          "column": "quhead_custponumber"
         }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "quhead_status"
         }
      },
      {
        "name": "quoteDate",
        "attr": {
          "type": "Date",
          "column": "quhead_quotedate"
         }
      },
      {
        "name": "expireDate",
        "attr": {
          "type": "Date",
          "column": "quhead_expire"
         }
      },
      {
        "name": "orderNotes",
        "attr": {
          "type": "String",
          "column": "quhead_ordercomments"
         }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "quhead_curr_id"
         }
      },
      {
        "name": "total",
        "attr": {
          "type": "Number",
          "column": "total"
         }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "quhead_salesrep_id"
        }
      },
      {
        "name": "billtoName",
        "attr": {
          "type": "String",
          "column": "quhead_billtoname"
        }
      },
      {
        "name": "billtoCity",
        "attr": {
          "type": "String",
          "column": "quhead_billtocity"
        }
      },
      {
        "name": "billtoState",
        "attr": {
          "type": "String",
          "column": "quhead_billtostate"
        }
      },
      {
        "name": "billtoCountry",
        "attr": {
          "type": "String",
          "column": "quhead_billtocountry"
        }
      },
      {
        "name": "shiptoName",
        "attr": {
          "type": "String",
          "column": "quhead_shiptoname"
        }
      },
      {
        "name": "shiptoCity",
        "attr": {
          "type": "String",
          "column": "quhead_shiptocity"
        }
      },
      {
        "name": "shiptoState",
        "attr": {
          "type": "String",
          "column": "quhead_shiptostate"
        }
      },
      {
        "name": "shiptoCountry",
        "attr": {
          "type": "String",
          "column": "quhead_shiptocountry"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "QuoteRelation",
    "table": "xt.quheadinfo",
    "isRest": true,
    "comment": "Quote Relation Map",
    "privileges": {
      "all": {
        "create": "MaintainQuotes",
        "read": "ViewQuotes",
        "update": "MaintainQuotes",
        "delete": "MaintainQuotes"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "quhead_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "quhead_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "customer",
        "attr": {
          "type": "String",
          "column": "cust_number"
        }
      },
      {
        "name": "quoteDate",
        "attr": {
          "type": "Date",
          "column": "quhead_quotedate"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "quhead_shipvia"
        }
      },
      {
        "name": "total",
        "attr": {
          "type": "Money",
          "column": "total"
        }
      },
      {
        "name": "opportunity",
        "attr": {
          "type": "String",
          "column": "ophead_number"
        }
      }
    ],
    "isSystem": true
  }
]
