public abstract class AbstractOrder extends DBPersist
Modifier and Type | Method and Description |
---|---|
int |
addProduct(JDCConnection oConn,
java.lang.String sProductId,
float fQuantity)
Add Product from Catalog to an Order or Invoice line
|
int |
addProduct(JDCConnection oConn,
java.lang.String sProductId,
java.lang.String sProductNm,
java.math.BigDecimal dSalePr,
float fQuantity,
java.math.BigDecimal dTotalPr,
float fTax,
short iTaxIncluded,
java.lang.String sPromotion,
java.lang.String sOptions)
Add Product to Order or Invoice line
This method may be used to add order lines for products not present at
k_products table.
|
int |
addProduct(JDCConnection oConn,
java.lang.String sProductId,
java.lang.String sProductNm,
float fQuantity,
java.lang.String sPromotion,
java.lang.String sOptions)
Add a Product from a Catalog to an Order or Invoice line
This method takes into account pr_sale, pr_list, dt_start and dt_end fields.
|
java.math.BigDecimal |
computeSubtotal()
Sum over pr_total price of order lines taking quantities into account
This method will compute the sum of order line prices without taxes or other charges
|
java.math.BigDecimal |
computeSubtotal(JDCConnection oConn)
Get total price for all lines without taxes
|
java.math.BigDecimal |
computeTaxes()
Get total tax amount for all lines
|
java.math.BigDecimal |
computeTaxes(JDCConnection oConn) |
java.math.BigDecimal |
computeTotal()
Compute Order total
Sum of all line subtotals including taxes.
|
java.math.BigDecimal |
computeTotal(JDCConnection oConn)
Compute Order total
Sum of all line subtotals including taxes.
|
Address |
getBillAddress(JDCConnection oConn)
Get billing address for this order
Address is loaded from value of gu_bill_addr column.
|
java.lang.String |
getCurrencyFormat() |
DBSubset |
getLines()
Get order lines as a DBSubset
|
abstract DBSubset |
getLines(JDCConnection oConn) |
java.util.Locale |
getLocale() |
boolean |
load(JDCConnection oConn,
java.lang.Object[] PKVals)
Load the internal value set from a register at a database table
|
void |
removeAllProducts(JDCConnection oConn)
Remove all products from invoice or order (empty basket)
|
void |
removeProduct(JDCConnection oConn,
java.lang.String sProductId)
Remove Product from Order given its GUID
|
void |
setCurrencyFormat(java.lang.String sFormat) |
void |
setLocale(java.util.Locale oLoc) |
void |
setLocale(java.lang.String sLanguage) |
void |
setLocale(java.lang.String sLanguage,
java.lang.String sCountry) |
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, delete, 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, load, 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, store, toLowerCase, toUpperCase, toXML, toXML, toXML, values
public java.lang.String getCurrencyFormat()
public void setCurrencyFormat(java.lang.String sFormat) throws java.lang.NullPointerException
java.lang.NullPointerException
public void setLocale(java.util.Locale oLoc)
public void setLocale(java.lang.String sLanguage, java.lang.String sCountry)
public void setLocale(java.lang.String sLanguage)
public java.util.Locale getLocale()
public Address getBillAddress(JDCConnection oConn) throws java.sql.SQLException
Get billing address for this order
Address is loaded from value of gu_bill_addr column. If gu_bill_addr is null then this function returns null.oConn
- JDCConnectionjava.sql.SQLException
public DBSubset getLines() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If this method is called without having
loaded the order lines first.public abstract DBSubset getLines(JDCConnection oConn) throws java.sql.SQLException
java.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.Object[] PKVals) throws java.sql.SQLException
DBPersist
Load the internal value set from a register at a database table
public int addProduct(JDCConnection oConn, java.lang.String sProductId, java.lang.String sProductNm, java.math.BigDecimal dSalePr, float fQuantity, java.math.BigDecimal dTotalPr, float fTax, short iTaxIncluded, java.lang.String sPromotion, java.lang.String sOptions) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.NullPointerException
Add Product to Order or Invoice line
This method may be used to add order lines for products not present at k_products table.oConn
- Database ConnectionsProductId
- Product GUID (optional, if not set a new one will be
automatically assigned).sProductNm
- Product NamedSalePr
- Product Unitary Sale PricefQuantity
- Quantity ordereddTotalPr
- Total Price for Quantity including taxesfTax
- Percentage of tax rate applicableiTaxIncluded
- 1 if tax is included in unitary price, 0 if tax is not included.sPromotion
- Promotional TextsOptions
- Additional Optionsjava.sql.SQLException
java.lang.IllegalArgumentException
- If sProductId does not existjava.lang.NullPointerException
public int addProduct(JDCConnection oConn, java.lang.String sProductId, java.lang.String sProductNm, float fQuantity, java.lang.String sPromotion, java.lang.String sOptions) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.NullPointerException
Add a Product from a Catalog to an Order or Invoice line
This method takes into account pr_sale, pr_list, dt_start and dt_end fields.oConn
- Database ConenctionsProductId
- Product GUID (required)sProductNm
- Product NamefQuantity
- Quantity ordered.sPromotion
- Promotional TextsOptions
- Additional Optionsjava.sql.SQLException
java.lang.IllegalArgumentException
- If sProductId does not existjava.lang.NullPointerException
public int addProduct(JDCConnection oConn, java.lang.String sProductId, float fQuantity) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.NullPointerException
Add Product from Catalog to an Order or Invoice line
oConn
- Database ConnectionsProductId
- Product GUIDfQuantity
- Quantityjava.sql.SQLException
java.lang.IllegalArgumentException
java.lang.NullPointerException
public void removeProduct(JDCConnection oConn, java.lang.String sProductId) throws java.sql.SQLException
Remove Product from Order given its GUID
oConn
- Database ConnectionsProductId
- GUID of product to be removed.java.sql.SQLException
public void removeAllProducts(JDCConnection oConn) throws java.sql.SQLException
Remove all products from invoice or order (empty basket)
oConn
- Database Connectionjava.sql.SQLException
public java.math.BigDecimal computeSubtotal() throws java.lang.IllegalStateException
Sum over pr_total price of order lines taking quantities into account
This method will compute the sum of order line prices without taxes or other chargesjava.lang.IllegalStateException
- if order lines have not been previously loadedpublic java.math.BigDecimal computeSubtotal(JDCConnection oConn) throws java.sql.SQLException
Get total price for all lines without taxes
oConn
- JDCConnectionjava.sql.SQLException
public java.math.BigDecimal computeTaxes() throws java.lang.IllegalStateException
Get total tax amount for all lines
java.lang.IllegalStateException
public java.math.BigDecimal computeTaxes(JDCConnection oConn) throws java.sql.SQLException
java.sql.SQLException
public java.math.BigDecimal computeTotal() throws java.lang.IllegalStateException
Compute Order total
Sum of all line subtotals including taxes.java.lang.IllegalStateException
- if order lines have not been previously loadedpublic java.math.BigDecimal computeTotal(JDCConnection oConn) throws java.sql.SQLException, java.lang.IllegalStateException
Compute Order total
Sum of all line subtotals including taxes.java.sql.SQLException
java.lang.IllegalStateException
- if order lines have not been previously loaded