Package org.compiere.acct
Class Fact
java.lang.Object
org.compiere.acct.Fact
- Version:
- $Id: Fact.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $ BF [ 2789949 ] Multicurrency in matching posting
- Author:
- Jorg Janke
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFact
(Doc document, MAcctSchema acctSchema, String defaultPostingType) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add Fact LineBalance Accounting Currency.void
Balance all segmentsCreate Source Line for Suspense Balancing.
Only if Suspense Balancing is enabled and not a multi-currency document (double check as, otherwise the rule should not have fired).boolean
Check Accounts of Fact LinescreateLine
(DocLine docLine, MAccount account, int C_Currency_ID, BigDecimal Amt) Create and convert Fact Line.createLine
(DocLine docLine, MAccount account, int C_Currency_ID, BigDecimal debitAmt, BigDecimal creditAmt) Create and convert Fact Line.createLine
(DocLine docLine, MAccount accountDr, MAccount accountCr, int C_Currency_ID, BigDecimal Amt) Create and convert Fact Line.void
dispose()
Disposeboolean
GL Distribution of Fact LinesGet Transaction Nameprotected BigDecimal
Return Accounting BalanceGet AcctSchemaFactLine[]
getLines()
Get Linesprotected BigDecimal
Get Source Balance Amountboolean
Are the lines Accounting Balancedboolean
Is convertedboolean
isPostingType
(String PostingType) Is Posting Typeboolean
Are all segments balancedboolean
isSegmentBalanced
(String segmentType) Is Source Segment balanced.boolean
Are the lines Source Balancedvoid
Remove Fact Lineboolean
Save Fact LinestoString()
String representation
-
Field Details
-
POST_Actual
Actual Balance Type- See Also:
-
POST_Budget
Budget Balance Type- See Also:
-
POST_Commitment
Encumbrance Posting- See Also:
-
POST_Reservation
Encumbrance Posting- See Also:
-
-
Constructor Details
-
Fact
Constructor- Parameters:
document
- pointer to documentacctSchema
- Account Schema to create accountsdefaultPostingType
- the default Posting type (actual,..) for this posting
-
-
Method Details
-
dispose
public void dispose()Dispose -
createLine
public FactLine createLine(DocLine docLine, MAccount account, int C_Currency_ID, BigDecimal debitAmt, BigDecimal creditAmt) Create and convert Fact Line. Used to create a DR and/or CR entry- Parameters:
docLine
- the document line or nullaccount
- if null, line is not createdC_Currency_ID
- the currencydebitAmt
- debit amount, can be nullcreditAmt
- credit amount, can be null- Returns:
- Fact Line
-
add
Add Fact Line- Parameters:
line
- fact line
-
remove
Remove Fact Line- Parameters:
line
- fact line
-
createLine
public FactLine createLine(DocLine docLine, MAccount accountDr, MAccount accountCr, int C_Currency_ID, BigDecimal Amt) Create and convert Fact Line. Used to create either a DR or CR entry- Parameters:
docLine
- Document Line or nullaccountDr
- Account to be used if Amt is DR balanceaccountCr
- Account to be used if Amt is CR balanceC_Currency_ID
- CurrencyAmt
- if negative Cr else Dr- Returns:
- FactLine
-
createLine
Create and convert Fact Line. Used to create either a DR or CR entry- Parameters:
docLine
- Document line or nullaccount
- Account to be usedC_Currency_ID
- CurrencyAmt
- if negative Cr else Dr- Returns:
- FactLine
-
isPostingType
Is Posting Type- Parameters:
PostingType
- - see POST_*- Returns:
- true if document is posting type
-
isConverted
public boolean isConverted()Is converted- Returns:
- true if converted
-
getAcctSchema
Get AcctSchema- Returns:
- AcctSchema
-
isSourceBalanced
public boolean isSourceBalanced()Are the lines Source Balanced- Returns:
- true if source lines balanced
-
getSourceBalance
Get Source Balance Amount- Returns:
- source balance
-
balanceSource
Create Source Line for Suspense Balancing.
Only if Suspense Balancing is enabled and not a multi-currency document (double check as, otherwise the rule should not have fired).
If not balanced, create balancing entry in currency of the document.- Returns:
- Balancing FactLine or null
-
isSegmentBalanced
public boolean isSegmentBalanced()Are all segments balanced- Returns:
- true if segments are balanced
-
isSegmentBalanced
Is Source Segment balanced.- Parameters:
segmentType
- - see AcctSchemaElement.SEGMENT_*.
Implemented only for Org. Other sensible candidates are Project, User1/2.- Returns:
- true if segments are balanced
-
balanceSegments
public void balanceSegments()Balance all segments. - For all balancing segments - For all segment values - If balance <> 0 create dueTo/dueFrom line overwriting the segment value -
isAcctBalanced
public boolean isAcctBalanced()Are the lines Accounting Balanced- Returns:
- true if accounting lines are balanced
-
getAcctBalance
Return Accounting Balance- Returns:
- true if accounting lines are balanced
-
balanceAccounting
Balance Accounting Currency.If the accounting currency is not balanced, if Currency balancing is enabled create a new line using the currency balancing account with zero source balance or adjust the line with the largest balance sheet account or if no balance sheet account exist, the line with the largest amount
- Returns:
- FactLine
-
checkAccounts
public boolean checkAccounts()Check Accounts of Fact Lines- Returns:
- true if success
-
distribute
public boolean distribute()GL Distribution of Fact Lines- Returns:
- true if success
-
toString
String representation -
getLines
Get Lines- Returns:
- FactLine Array
-
save
Save Fact Lines- Parameters:
trxName
- transaction- Returns:
- true if all lines were saved
-
get_TrxName
Get Transaction Name- Returns:
- trx nam
-