com.knowgate.hipergate
Class Quotation

java.lang.Object
  extended by com.knowgate.dataobjs.DBPersist
      extended by com.knowgate.hipergate.AbstractOrder
          extended by com.knowgate.hipergate.Quotation
All Implemented Interfaces:
java.io.Serializable, java.util.Map

public class Quotation
extends AbstractOrder

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.knowgate.hipergate.AbstractOrder
oBuyer, oLines, oSeller, sLinesTable, sPrimaryKey
 
Fields inherited from class com.knowgate.dataobjs.DBPersist
AllVals, sAuditCls, sAuditUsr, sTransactId
 
Constructor Summary
Quotation()
          Default Constructor
 
Method Summary
 Order createOrder(JDCConnection oConn)
          Create an Order for this Quotation The new Order is given the same GUID as the current Quotation
 boolean delete(JDCConnection oConn)
          Delete Quotation
 QuotationLine getLine(JDCConnection oConn, int iPgLine)
          Get quotation line by number
 DBSubset getLines(JDCConnection oConn)
          Get Quotation lines as a DBSubset
 boolean load(JDCConnection oConn, java.lang.Object[] PKVals)
          Load Quotation with its associated Address
static int nextVal(JDCConnection oConn, java.lang.String sGuWorkArea)
          Get next value for field pg_quotation in a given WorkArea
 boolean store(JDCConnection oConn)
          Store Quotation If no value for gu_quotation is specified then a new one is automatically assigned.
 
Methods inherited from class com.knowgate.hipergate.AbstractOrder
addProduct, addProduct, addProduct, computeSubtotal, computeSubtotal, computeTaxes, computeTaxes, computeTotal, computeTotal, formatCurrency, formatPercentage, getBillAddress, getCurrencyFormat, getDecimalFormated, getFloatFormated, getLines, getLocale, removeAllProducts, removeProduct, setCurrencyFormat, setLocale, setLocale, setLocale
 
Methods inherited from class com.knowgate.dataobjs.DBPersist
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getIntervalPart, getItemMap, getItems, getMoney, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, size, toLowerCase, toUpperCase, toXML, toXML, toXML, toXML, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

Quotation

public Quotation()
Default Constructor

Method Detail

getLine

public QuotationLine getLine(JDCConnection oConn,
                             int iPgLine)
                      throws java.sql.SQLException
Get quotation line by number

Parameters:
oConn - JDCConnection
iPgLine - int Line number [1..n] as as at k_order_lines.pg_line
Returns:
OrderLine or null if no line with such number was found
Throws:
java.sql.SQLException

getLines

public DBSubset getLines(JDCConnection oConn)
                  throws java.sql.SQLException
Get Quotation lines as a DBSubset

Specified by:
getLines in class AbstractOrder
Parameters:
oConn - Database Connection
Returns:
A DBSubset with the following columns:
gu_quotationpg_linegu_productnm_productpr_salenu_quantityid_unitpr_totalpct_tax_rateis_tax_includedtx_promotiontx_optionsgu_itemid_ref
Quotation GUIDLine NumberProduct GUIDProduct NameSale PriceQuantity OrderedUnit for quantityTotal Price% of Tax Rate1 if tax includedPromotion TextAdditional OptionsGUID of ordered item
Throws:
java.sql.SQLException

load

public boolean load(JDCConnection oConn,
                    java.lang.Object[] PKVals)
             throws java.sql.SQLException
Load Quotation with its associated Address

Overrides:
load in class AbstractOrder
Parameters:
oConn - JDCConnection
PKVals - Array with a single element Object[1]{(String)gu_quotation}
Returns:
boolean true is Quotation was found, false otherwise
Throws:
java.sql.SQLException

store

public boolean store(JDCConnection oConn)
              throws java.sql.SQLException

Store Quotation

If no value for gu_quotation is specified then a new one is automatically assigned.
If no value for pg_quotation is specified then a new one is automatically assigned by looking at k_quotation_next table and updating it afterwards.
This method updates dt_modified to current datetime as a side effect iif Quotation did not previously exist at the database.

Overrides:
store in class DBPersist
Parameters:
oConn - JDCConnection
Returns:
boolean
Throws:
java.sql.SQLException

delete

public boolean delete(JDCConnection oConn)
               throws java.sql.SQLException

Delete Quotation

Overrides:
delete in class DBPersist
Parameters:
oConn -
Returns:
Throws:
java.sql.SQLException

nextVal

public static int nextVal(JDCConnection oConn,
                          java.lang.String sGuWorkArea)
                   throws java.sql.SQLException
Get next value for field pg_quotation in a given WorkArea

Parameters:
oConn - JDCConnection JDBC Connection
sGuWorkArea - String WorkArea GUID
Returns:
int Next unused quotation number
Throws:
java.sql.SQLException

createOrder

public Order createOrder(JDCConnection oConn)
                  throws java.sql.SQLException

Create an Order for this Quotation

The new Order is given the same GUID as the current Quotation

Parameters:
oConn - JDCConnection
Returns:
Order
Throws:
java.sql.SQLException