public class Order extends AbstractOrder
Shopping Order.
Modifier and Type | Field and Description |
---|---|
static short |
ClassId |
Constructor and Description |
---|
Order()
Create empty Order
|
Order(JDCConnection oConn,
java.lang.String sOrderId)
Load Order from database including all its lines
|
Order(java.lang.String sOrderId)
Create Order and set its GUID
|
Modifier and Type | Method and Description |
---|---|
void |
activate(JDCConnection oConn,
java.lang.String sOrderId)
Activate an Order
For a given WorkArea only one order can be active at a time.
|
DespatchAdvice |
createDespatchAdvice(JDCConnection oConn,
boolean bIncludePrices)
Create a Dispatch Note for this Order
The new Dispatch Note is given the same GUID as the current order
|
Invoice |
createInvoice(JDCConnection oConn)
Create an Invoice for this Order
The new Invoice is given the same GUID as the current order
|
boolean |
delete(JDCConnection oConn)
Delete Order
|
static boolean |
delete(JDCConnection oConn,
java.lang.String sOrderId)
Delete order
|
boolean |
despatched()
Whether or not this order has an associated despatch advice
|
static Order |
getActiveOrder(JDCConnection oConn,
java.lang.String sWorkAreaId)
Get active order for a WorkArea
|
java.lang.String |
getDespatchAdvice()
Get despatch advice associated to this order
|
java.lang.String |
getInvoice()
Get invoice associated to this order
|
OrderLine |
getLine(JDCConnection oConn,
int iPgLine)
Get order line by number
|
DBSubset |
getLines(JDCConnection oConn)
Get Order Lines as a DBSubset
|
boolean |
invoiced()
Whether or not this order has an associated invoice
|
boolean |
load(JDCConnection oConn,
java.lang.Object[] PKVals)
Load Order with its associated Addresses
|
boolean |
load(JDCConnection oConn,
java.lang.String sGuOrder)
Load Order with its associated Addresses
|
boolean |
store(JDCConnection oConn)
Store Order
|
java.lang.String |
toXML()
Get order as an XML document
Character encoding is set to UTF-8
|
java.lang.String |
toXML(JDCConnection oConn,
java.lang.String sLocale)
Get despatch advice as an XML document
Character encoding is set to UTF-8
|
java.lang.String |
toXML(java.lang.String sIdent)
Get order as an XML document
Character encoding is set to UTF-8
|
java.lang.String |
toXML(java.lang.String sIdent,
java.lang.String sDelim)
Get order as an XML document
Character encoding is set to UTF-8
|
addProduct, addProduct, addProduct, computeSubtotal, computeSubtotal, computeTaxes, computeTaxes, computeTotal, computeTotal, getBillAddress, getCurrencyFormat, getLines, getLocale, removeAllProducts, removeProduct, setCurrencyFormat, setLocale, setLocale, setLocale
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getIntArray, getInteger, getIntegerArray, getIntervalPart, getItemMap, getItems, getMoney, getPrimaryKey, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTime, getTimeOfDay, getTimestamp, isEmpty, isNull, iterator, keySet, parseXML, put, put, put, put, put, put, 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, setPrimaryKey, size, toLowerCase, toUpperCase, values
public static final short ClassId
public Order()
public Order(java.lang.String sOrderId)
public Order(JDCConnection oConn, java.lang.String sOrderId) throws java.sql.SQLException
Load Order from database including all its lines
oConn
- Database ConnectionsOrderId
- Order GUIDjava.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.Object[] PKVals) throws java.sql.SQLException
load
in class AbstractOrder
oConn
- JDCConnectionPKVals
- Array with a single element Object[1]{(String)gu_order}java.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.String sGuOrder) throws java.sql.SQLException
public boolean store(JDCConnection oConn) throws java.sql.SQLException
store
in class DBPersist
oConn
- Database Connection
If gu_order is null then a new GUID is automatically assigned.java.sql.SQLException
public boolean delete(JDCConnection oConn) throws java.sql.SQLException
Delete Order
public OrderLine getLine(JDCConnection oConn, int iPgLine) throws java.sql.SQLException
oConn
- JDCConnectioniPgLine
- int Line number [1..n] as as at k_order_lines.pg_linejava.sql.SQLException
public DBSubset getLines(JDCConnection oConn) throws java.sql.SQLException
getLines
in class AbstractOrder
oConn
- Database Connectiongu_order | pg_line | gu_product | nm_product | pr_sale | nu_quantity | id_unit | pr_total | pct_tax_rate | is_tax_included | tx_promotion | tx_options | gu_item | id_ref |
Order GUID | Line Number | Product GUID | Product Name | Sale Price | Quantity Ordered | Unit for quantity | Total Price | % of Tax Rate | 1 if tax included | Promotion Text | Additional Options | GUID of ordered item |
java.sql.SQLException
public java.lang.String getDespatchAdvice()
public java.lang.String getInvoice()
public DespatchAdvice createDespatchAdvice(JDCConnection oConn, boolean bIncludePrices) throws java.sql.SQLException
Create a Dispatch Note for this Order
The new Dispatch Note is given the same GUID as the current orderoConn
- JDCConnectionbIncludePrices
- boolean whether or not to save prices at the new Dispatch Orderjava.sql.SQLException
public Invoice createInvoice(JDCConnection oConn) throws java.sql.SQLException
Create an Invoice for this Order
The new Invoice is given the same GUID as the current orderoConn
- JDCConnectionjava.sql.SQLException
public void activate(JDCConnection oConn, java.lang.String sOrderId) throws java.sql.SQLException
Activate an Order
For a given WorkArea only one order can be active at a time.oConn
- Database ConnectionsOrderId
- GUID of Order to Activatejava.sql.SQLException
public boolean despatched()
public boolean invoiced()
public java.lang.String toXML() throws java.lang.IllegalStateException
Get order as an XML document
Character encoding is set to UTF-8toXML
in class DBPersist
java.lang.IllegalStateException
- if order lines are not loaded or buyer is not set or seller is not setpublic java.lang.String toXML(java.lang.String sIdent, java.lang.String sDelim) throws java.lang.IllegalStateException
Get order as an XML document
Character encoding is set to UTF-8toXML
in class DBPersist
sIdent
- Number of blank spaces for left padding at every line.sDelim
- Line delimiter (usually "\n" or "\r\n")java.lang.IllegalStateException
- if order lines are not loaded or buyer is not set or seller is not setpublic java.lang.String toXML(java.lang.String sIdent) throws java.lang.IllegalStateException
Get order as an XML document
Character encoding is set to UTF-8toXML
in class DBPersist
sIdent
- Number of blank spaces for left padding at every line.java.lang.IllegalStateException
- if order lines are not loaded or buyer is not set or seller is not setpublic java.lang.String toXML(JDCConnection oConn, java.lang.String sLocale) throws java.lang.IllegalStateException
Get despatch advice as an XML document
Character encoding is set to UTF-8oConn
- JDCConnection Openend JDBC database connectionsLocale
- String Locale for output formattingjava.lang.IllegalStateException
- if invoice lines are not loaded or buyer is not set or seller is not setpublic static boolean delete(JDCConnection oConn, java.lang.String sOrderId) throws java.sql.SQLException
oConn
- JDCConnectionsOrderId
- String Order GUIDjava.sql.SQLException
public static Order getActiveOrder(JDCConnection oConn, java.lang.String sWorkAreaId) throws java.sql.SQLException
oConn
- JDCConnectionsWorkAreaId
- String WorkArea GUIDjava.sql.SQLException