|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.dataobjs.DBPersist
com.knowgate.hipergate.AbstractOrder
com.knowgate.hipergate.Invoice
public class Invoice
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary | |
|---|---|
static short |
ClassId
|
| 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 | |
|---|---|
Invoice()
Default constructor |
|
Invoice(JDCConnection oConn,
int iInvoicePg,
java.lang.String sWorkArea)
|
|
Invoice(JDCConnection oConn,
java.lang.String sInvoiceId)
Load Invoice from database |
|
Invoice(java.lang.String sInvoiceId)
Create Invoice and set its GUID |
|
| Method Summary | |
|---|---|
int |
addLine(JDCConnection oConn,
java.math.BigDecimal oPrSale,
float fQuantity,
java.lang.String sIdUnit,
java.math.BigDecimal oPrTotal,
float fTaxRate,
short bTaxIncluded,
java.lang.String sNmProduct,
java.lang.String sGuProduct,
java.lang.String sGuItem,
java.lang.String sTxPromo,
java.lang.String sTxOptions)
Add an Invoice line This method updates k_invoices.dt_modified to current datetime as a side effect |
boolean |
delete(JDCConnection oConn)
Delete Invoice |
static java.lang.String |
getIdFromNumber(JDCConnection oConn,
int iInvoicePg,
java.lang.String sWorkArea)
Get invoice GUID given its number |
InvoiceLine |
getLine(JDCConnection oConn,
int iPgLine)
Get invoice line by number |
DBSubset |
getLines(JDCConnection oConn)
Get a DBSubset with all lines of this Invoice |
java.lang.String[] |
getOrders()
Get Orders for this Invoice Orders can only be get if Invoice has been previously loaded, else this method will return null |
boolean |
load(JDCConnection oConn,
java.lang.Object[] PKVals)
Load Invoice with its associated Order and Addresses |
boolean |
load(JDCConnection oConn,
java.lang.String sGuInvoice)
Load Invoice with its associated Order and Addresses |
static int |
nextVal(JDCConnection oConn,
java.lang.String sGuWorkArea)
Get next value for field pg_invoice in a given WorkArea |
boolean |
store(JDCConnection oConn)
Store invoice If no value for gu_invoice is specified then a new one is automatically assigned. |
boolean |
storeLine(JDCConnection oConn,
int iLine,
java.math.BigDecimal oPrSale,
float fQuantity,
java.lang.String sIdUnit,
java.math.BigDecimal oPrTotal,
float fTaxRate,
short bTaxIncluded,
java.lang.String sNmProduct,
java.lang.String sGuProduct,
java.lang.String sGuItem,
java.lang.String sTxPromo,
java.lang.String sTxOptions)
Add or update an Invoice line This method updates k_invoices.dt_modified to current datetime as a side effect |
java.lang.String |
toXML()
Get invoice as an XML document Character encoding is set to UTF-8 |
java.lang.String |
toXML(JDCConnection oConn,
java.lang.String sLocale)
Get invoice as an XML document Character encoding is set to UTF-8 |
java.lang.String |
toXML(java.lang.String sIdent)
Get invoice as an XML document Character encoding is set to UTF-8 |
java.lang.String |
toXML(java.lang.String sIdent,
java.lang.String sDelim)
Get invoice as an XML document Character encoding is set to UTF-8 |
| 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, 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, 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 |
| Field Detail |
|---|
public static final short ClassId
| Constructor Detail |
|---|
public Invoice()
public Invoice(java.lang.String sInvoiceId)
public Invoice(JDCConnection oConn,
java.lang.String sInvoiceId)
throws java.sql.SQLException
oConn - JDCConnectionsInvoiceId - String Invoice GUID
java.sql.SQLException
public Invoice(JDCConnection oConn,
int iInvoicePg,
java.lang.String sWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniInvoicePg - int Invoice number (as at pg_invoice column of k_invoices table)sWorkArea - String WorkArea to which invoice belongs (as at gu_workarea column of k_invoices table)
java.sql.SQLException| Method Detail |
|---|
public java.lang.String[] getOrders()
Get Orders for this Invoice
Orders can only be get if Invoice has been previously loaded, else this method will return null
public boolean load(JDCConnection oConn,
java.lang.Object[] PKVals)
throws java.sql.SQLException
load in class AbstractOrderoConn - JDCConnectionPKVals - Array with a single element Object[1]{(String)gu_invoice}
java.sql.SQLException
public boolean load(JDCConnection oConn,
java.lang.String sGuInvoice)
throws java.sql.SQLException
load in class DBPersistoConn - JDCConnectionsGuInvoice - Invoice GUID
java.sql.SQLException
public boolean store(JDCConnection oConn)
throws java.sql.SQLException
Store invoice
If no value for gu_invoice is specified then a new one is automatically assigned.
store in class DBPersistoConn - JDCConnection
java.sql.SQLException
public boolean storeLine(JDCConnection oConn,
int iLine,
java.math.BigDecimal oPrSale,
float fQuantity,
java.lang.String sIdUnit,
java.math.BigDecimal oPrTotal,
float fTaxRate,
short bTaxIncluded,
java.lang.String sNmProduct,
java.lang.String sGuProduct,
java.lang.String sGuItem,
java.lang.String sTxPromo,
java.lang.String sTxOptions)
throws java.sql.SQLException
Add or update an Invoice line
This method updates k_invoices.dt_modified to current datetime as a side effect
oConn - JDCConnectioniLine - int Line NumberoPrSale - BigDecimal Sale price for one unitfQuantity - float Number of units soldsIdUnit - String Measure Unit Identifier, if null then is set to "UNIT" by defaultoPrTotal - BigDecimal Total price (oPrSale*fQuantity+oPrSale*fQuantity*fTaxRate)fTaxRate - float Percentage of taxes [0..0.99]bTaxIncluded - short 1 if oPrSale includes taxes 0 if notsNmProduct - String Product NamesGuProduct - String Product GUID (from k_product.gu_product)sGuItem - String Item GUID (for products that require a serial number to be assigned when sold)sTxPromo - String Promotions (free text)sTxOptions - String Other Options (free text)
java.sql.SQLException
public int addLine(JDCConnection oConn,
java.math.BigDecimal oPrSale,
float fQuantity,
java.lang.String sIdUnit,
java.math.BigDecimal oPrTotal,
float fTaxRate,
short bTaxIncluded,
java.lang.String sNmProduct,
java.lang.String sGuProduct,
java.lang.String sGuItem,
java.lang.String sTxPromo,
java.lang.String sTxOptions)
throws java.sql.SQLException
Add an Invoice line
This method updates k_invoices.dt_modified to current datetime as a side effect
oConn - JDCConnectionoPrSale - BigDecimal Sale price for one unitfQuantity - float Number of units soldsIdUnit - String Measure Unit Identifier, if null then is set to "UNIT" by defaultoPrTotal - BigDecimal Total price (oPrSale*fQuantity+oPrSale*fQuantity*fTaxRate)fTaxRate - float Percentage of taxes [0..0.99]bTaxIncluded - short 1 if oPrSale includes taxes 0 if notsNmProduct - String Product NamesGuProduct - String Product GUID (from k_product.gu_product)sGuItem - String Item GUID (for products that require a serial number to be assigned when sold)sTxPromo - String Promotions (free text)sTxOptions - String Other Options (free text)
java.sql.SQLException
public boolean delete(JDCConnection oConn)
throws java.sql.SQLException
Delete Invoice
delete in class DBPersistoConn - Database Connection
java.sql.SQLException
public InvoiceLine getLine(JDCConnection oConn,
int iPgLine)
throws java.sql.SQLException
oConn - JDCConnectioniPgLine - int Line number [1..n] as at k_invoice_lines.pg_line
java.sql.SQLException
public DBSubset getLines(JDCConnection oConn)
throws java.sql.SQLException
getLines in class AbstractOrderoConn - JDCConnection
java.sql.SQLException
public java.lang.String toXML(JDCConnection oConn,
java.lang.String sLocale)
throws java.lang.IllegalStateException
Get invoice as an XML document
Character encoding is set to UTF-8
oConn - JDCConnection Openend JDBC database connectionsLocale - String Locale for output formatting
java.lang.IllegalStateException - if invoice lines are not loaded or buyer is not set or seller is not set
public java.lang.String toXML()
throws java.lang.IllegalStateException
Get invoice as an XML document
Character encoding is set to UTF-8
toXML in class DBPersistjava.lang.IllegalStateException - if invoice lines are not loaded or buyer is not set or seller is not set
public java.lang.String toXML(java.lang.String sIdent,
java.lang.String sDelim)
throws java.lang.IllegalStateException
Get invoice as an XML document
Character encoding is set to UTF-8
toXML in class DBPersistsIdent - Number of blank spaces for left padding at every line.sDelim - Line delimiter (usually "\n" or "\r\n")
java.lang.IllegalStateException - if invoice lines are not loaded or buyer is not set or seller is not set
public java.lang.String toXML(java.lang.String sIdent)
throws java.lang.IllegalStateException
Get invoice as an XML document
Character encoding is set to UTF-8
toXML in class DBPersistsIdent - Number of blank spaces for left padding at every line.
java.lang.IllegalStateException - if invoice lines are not loaded or buyer is not set or seller is not set
public static java.lang.String getIdFromNumber(JDCConnection oConn,
int iInvoicePg,
java.lang.String sWorkArea)
throws java.sql.SQLException
oConn - JDCConnectioniInvoicePg - int Invoice number (pg_invoice column at k_invoices table)sWorkArea - GUID of WorkArea to which invoice belongs
java.sql.SQLException
public static int nextVal(JDCConnection oConn,
java.lang.String sGuWorkArea)
throws java.sql.SQLException
oConn - JDCConnection JDBC ConnectionsGuWorkArea - String WorkArea GUID
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||