public class Invoice extends AbstractOrder
Modifier and Type | Field and Description |
---|---|
static short |
ClassId |
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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
|
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 Invoice()
public Invoice(java.lang.String sInvoiceId)
public Invoice(JDCConnection oConn, java.lang.String sInvoiceId) throws java.sql.SQLException
oConn
- JDCConnectionsInvoiceId
- String Invoice GUIDjava.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
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 nullpublic 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_invoice}java.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.String sGuInvoice) throws 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.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 effectoConn
- 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 effectoConn
- 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
public InvoiceLine getLine(JDCConnection oConn, int iPgLine) throws java.sql.SQLException
oConn
- JDCConnectioniPgLine
- int Line number [1..n] as at k_invoice_lines.pg_linejava.sql.SQLException
public DBSubset getLines(JDCConnection oConn) throws java.sql.SQLException
getLines
in class AbstractOrder
oConn
- JDCConnectionjava.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-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 java.lang.String toXML() throws java.lang.IllegalStateException
Get invoice as an XML document
Character encoding is set to UTF-8toXML
in class DBPersist
java.lang.IllegalStateException
- if invoice 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 invoice 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 invoice 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 invoice 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 invoice lines are not loaded or buyer is not set or seller is not setpublic 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 belongsjava.sql.SQLException
public static int nextVal(JDCConnection oConn, java.lang.String sGuWorkArea) throws java.sql.SQLException
oConn
- JDCConnection JDBC ConnectionsGuWorkArea
- String WorkArea GUIDjava.sql.SQLException