Package org.compiere.apps.form
Class Match
java.lang.Object
org.compiere.apps.form.Match
- Direct Known Subclasses:
WMatch
Form to perform Matching between Purchase Order, Vendor Invoice and Material Receipt.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Indexes in Tablestatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncmd_matchFrom
(String selection) Get applicable match to options for match fromvoid
cmd_process
(IMiniTable xMatchedTable, IMiniTable xMatchedToTable, int matchMode, int matchFrom, String matchTo, BigDecimal m_xMatched) Process Matchingcmd_search
(IMiniTable xMatchedTable, int display, String matchToString, Integer Product, Integer Vendor, Timestamp from, Timestamp to, boolean matched) Retrieve available match from recordscmd_searchTo
(IMiniTable xMatchedTable, IMiniTable xMatchedToTable, String displayString, int matchToType, boolean sameBPartner, boolean sameProduct, boolean sameQty, boolean matched) Retrieve available match to recordsprotected boolean
createMatchRecord
(boolean invoice, int M_InOutLine_ID, int Line_ID, BigDecimal qty, String trxName) Create Matching RecordGet column names for tablegetMatchTypeText
(int matchType) Get display text for matching typevoid
setTrxName
(String trxName) protected void
tableInit
(int display, int matchToType, boolean matched, KeyNamePair lineMatched) Initialize Table - build SQL, set dateColumn and qtyColumn.protected void
tableLoad
(IMiniTable table) Fill table with records retrieve using m_sql
-
Field Details
-
MATCH_INVOICE
public static final int MATCH_INVOICE- See Also:
-
MATCH_SHIPMENT
public static final int MATCH_SHIPMENT- See Also:
-
MATCH_ORDER
public static final int MATCH_ORDER- See Also:
-
MODE_NOTMATCHED
public static final int MODE_NOTMATCHED- See Also:
-
MODE_MATCHED
public static final int MODE_MATCHED- See Also:
-
I_ID
public static final int I_IDIndexes in Table- See Also:
-
I_DocumentNo
public static final int I_DocumentNo- See Also:
-
I_DocumentDate
public static final int I_DocumentDate- See Also:
-
I_BPartner
public static final int I_BPartner- See Also:
-
I_Line
public static final int I_Line- See Also:
-
I_Product
public static final int I_Product- See Also:
-
I_QTY
public static final int I_QTY- See Also:
-
I_MATCHED
public static final int I_MATCHED- See Also:
-
-
Constructor Details
-
Match
public Match()
-
-
Method Details
-
cmd_matchFrom
Get applicable match to options for match from- Parameters:
selection
- match from- Returns:
- list of applicable match to options
-
cmd_search
public IMiniTable cmd_search(IMiniTable xMatchedTable, int display, String matchToString, Integer Product, Integer Vendor, Timestamp from, Timestamp to, boolean matched) Retrieve available match from records- Parameters:
xMatchedTable
- table to fill with retrieved recordsdisplay
- match from (MATCH_* constant), to popular xMatchedTable.matchToString
- match to (invoice, material receipt or purchase order)Product
- optional M_Product_IDVendor
- optional C_BPartner_IDfrom
- optional from dateto
- optional to datematched
- true for partial or fully match, false for not matched
-
cmd_process
public void cmd_process(IMiniTable xMatchedTable, IMiniTable xMatchedToTable, int matchMode, int matchFrom, String matchTo, BigDecimal m_xMatched) Process Matching- Parameters:
xMatchedTable
- Match from tablexMatchedToTable
- Match to tablematchMode
-MODE_NOTMATCHED
orMODE_MATCHED
matchFrom
- Match from document typematchTo
- Match to document typem_xMatched
- Difference to match
-
cmd_searchTo
public IMiniTable cmd_searchTo(IMiniTable xMatchedTable, IMiniTable xMatchedToTable, String displayString, int matchToType, boolean sameBPartner, boolean sameProduct, boolean sameQty, boolean matched) Retrieve available match to records- Parameters:
xMatchedTable
- Match from table, to get line id from selected rowxMatchedToTable
- Match to table, to fill with retrieved recordsdisplayString
- Match from, to populate xMatchedToTablematchToType
- Document to match with displayString (MATCH_* constant)sameBPartner
-sameProduct
-sameQty
-matched
- true for partial or fully match, false for not matched
-
tableInit
Initialize Table - build SQL, set dateColumn and qtyColumn.
The driving table is "hdr", e.g. for hdr.C_BPartner_ID=..
The line table is "lin", e.g. for lin.M_Product_ID=..
You use the dateColumn/qtyColumn variable directly as it is table specific.
The sql is dependent on MatchMode:
- If Matched - all (fully or partially) matched records are listed
- If Not Matched - all not fully matched records are listed- Parameters:
display
- (Match from - Invoice, Material Receipt, Order) see MATCH_*matchToType
- (Match to - Invoice, Material Receipt, Order) see MATCH_*matched
- false for not matched, true for full/partially matchedlineMatched
-
-
tableLoad
Fill table with records retrieve using m_sql- Parameters:
table
- table
-
createMatchRecord
protected boolean createMatchRecord(boolean invoice, int M_InOutLine_ID, int Line_ID, BigDecimal qty, String trxName) Create Matching Record- Parameters:
invoice
- true if matching invoice false if matching POM_InOutLine_ID
- shipment lineLine_ID
- C_InvoiceLine_ID or C_OrderLine_IDqty
- quantitytrxName
-- Returns:
- true if created
-
setTrxName
- Parameters:
trxName
-
-
getTrxName
- Returns:
- trxName
-
getMatchTypeText
Get display text for matching type- Parameters:
matchType
- MATCH_INVOICE, MATCH_SHIPMENT or MATCH_ORDER- Returns:
- display text for match type
-
getColumnLayout
Get column names for table- Returns:
ColumnInfo
array
-