Package org.openbravo.erpCommon.ad_forms
Class AcctServer
- java.lang.Object
-
- org.openbravo.erpCommon.ad_forms.AcctServer
-
- Direct Known Subclasses:
DocAmortization
,DocBank
,DocCash
,DocCostAdjustment
,DocDoubtfulDebt
,DocDPManagement
,DocFINBankStatement
,DocFINFinAccTransaction
,DocFINPayment
,DocFINReconciliation
,DocGLJournal
,DocInOut
,DocInternalConsumption
,DocInventory
,DocInvoice
,DocLandedCost
,DocLCCost
,DocMatchInv
,DocMovement
,DocOrder
,DocPayment
,DocProduction
public abstract class AcctServer extends Object
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AcctServer()
AcctServer(String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BigDecimal
applyRate(BigDecimal _amount, ConversionRateDoc conversionRateDoc, boolean multiply)
boolean
checkDocuments()
boolean
checkDocuments(String dateFrom, String dateTo)
BigDecimal
convertAmount(BigDecimal _amount, boolean isReceipt, String acctDate, String table_ID, String record_ID, String currencyIDFrom, String currencyIDTo, DocLine line, AcctSchema as, Fact fact, String Fact_Acct_Group_ID, String seqNo, ConnectionProvider conn)
BigDecimal
convertAmount(BigDecimal _amount, boolean isReceipt, String acctDate, String table_ID, String record_ID, String currencyIDFrom, String currencyIDTo, DocLine line, AcctSchema as, Fact fact, String Fact_Acct_Group_ID, String seqNo, ConnectionProvider conn, boolean bookDifferences)
abstract Fact
createFact(AcctSchema as, ConnectionProvider conn, Connection con, VariablesSecureApp vars)
Create Facts (the accounting logic)boolean
filterDatesCheckDocuments(String dateFrom, String dateTo)
Deprecated.static AcctServer
get(String AD_Table_ID, String AD_Client_ID, String AD_Org_ID, ConnectionProvider connectionProvider)
Factory - Create Posting documentAccount
getAccount(String AcctType, AcctSchema as, ConnectionProvider conn)
Get the account for Accounting SchemaAccount
getAccount(ConnectionProvider conn, String use, FIN_FinancialAccountAccounting financialAccountAccounting, boolean bIsReceipt)
Get the account for Financial Account (Uses: INT - In Transit DEP - Deposit CLE - Clearing WIT - Withdraw)Account
getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, boolean isDoubtfuldebt, ConnectionProvider conn)
Get the account for Accounting SchemaAccount
getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, ConnectionProvider conn)
Get the account for Accounting SchemaAccount
getAccountBPartnerAllowanceForDoubtfulDebt(String BPartnerId, AcctSchema as, ConnectionProvider conn)
It gets Account to be used to provision for the selected Business PartnerAccount
getAccountBPartnerBadDebt(String BPartnerId, boolean isExpense, AcctSchema as, ConnectionProvider conn)
It gets Account to be used to provision for the selected Business PartnerAccount
getAccountFee(AcctSchema as, FIN_FinancialAccount finAccount, ConnectionProvider conn)
Account
getAccountGLItem(GLItem glItem, AcctSchema as, boolean bIsReceipt, ConnectionProvider conn)
Get the account for GL ItemString
getAmount()
Get Amount with index 0String
getAmount(int AmtType)
Get the Amount (loaded in loadDocumentDetails)abstract BigDecimal
getBalance()
Get Source Currency Balance - subtracts line (and tax) amounts from total - no roundingConnectionProvider
getConnectionProvider()
protected String
getConversionDate()
Get the Convertion DateConversionRateDoc
getConversionRateDoc(String table_ID, String record_ID, String curFrom_ID, String curTo_ID)
static int
getConversionRatePrecision(VariablesSecureApp vars)
static String
getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, String recordId, String docType, ConnectionProvider conn)
Deprecated.static String
getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, ConnectionProvider conn)
static String
getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, ConnectionProvider conn)
Convert an amountstatic BigDecimal
getConvertionRate(String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, ConnectionProvider conn)
abstract boolean
getDocumentConfirmation(ConnectionProvider conn, String strRecordId)
String
getInfo(String language)
String
getInfo(VariablesSecureApp vars)
Map<String,String>
getInvalidAccountParameters(String strAccount, String strEntity, String strAccountingSchema)
Map<String,String>
getInvalidCostParameters(String strProduct, String strDate)
OBError
getMessageResult()
Map<String,String>
getNotCalculatedCostParameters(MaterialTransaction trx)
FieldProvider[]
getObjectFieldProvider()
BigDecimal
getPaymentDetailAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Deprecated.HashMap<String,BigDecimal>
getPaymentDetailIdWriteOffAndAmount(List<String> paymentDetailsIds, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Returns the writeoff and the amount of a Payment Detail.HashMap<String,BigDecimal>
getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Deprecated.HashMap<String,BigDecimal>
getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex, FieldProvider fieldProvider)
Returns the writeoff and the amount of a Payment Detail.HashMap<String,BigDecimal>
getPaymentDetailWriteOffAndAmount(FIN_PaymentDetail paymentDetail, String paymentDetailNextId, String paymentDetailPreviousId, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, FieldProvider fieldProvider)
Returns the writeoff and the amount of a Payment Detail.String
getServletInfo()
String
getStatus()
boolean
insertNote(String aD_Client_ID, String aD_Org_ID, String AD_User_ID, String aD_Table_ID, String record_ID, String AD_MessageValue, String Text, String Reference, VariablesSecureApp vars, ConnectionProvider conn, Connection con)
Deprecated.During cleanup for 3.0 the entire table ad_node was removed from core, so this insertNote method doesn't serve have any purpose anymore.boolean
isBackground()
boolean
isBalanced()
Is the Source Document Balancedboolean
isConvertible(AcctSchema acctSchema, ConnectionProvider conn)
Is Document convertible to currency and Conversion Typeboolean
isPeriodOpen()
Is Period Openboolean
loadDocument(FieldProvider[] data, boolean force, ConnectionProvider conn)
Deprecated.boolean
loadDocument(FieldProvider[] data, boolean force, ConnectionProvider conn, Connection con)
abstract boolean
loadDocumentDetails(FieldProvider[] data, ConnectionProvider conn)
void
loadDocumentType()
void
loadDocumentType(boolean supressWarnings)
abstract void
loadObjectFieldProvider(ConnectionProvider conn, String aD_Client_ID, String Id)
int
match(VariablesSecureApp vars, ConnectionProvider conn, Connection con)
Matchingboolean
post(String strClave, boolean force, VariablesSecureApp vars, ConnectionProvider conn, Connection con)
This method handles the accounting of the record identified by strClave.void
reloadAcctSchemaArray()
void
run(VariablesSecureApp vars)
void
run(VariablesSecureApp vars, String strDateFrom, String strDateTo)
void
set(String m_AD_Table_ID, String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider, String tablename, String acctdatecolumn)
void
setBackground(boolean isBackground)
void
setBatchSize(String newbatchSize)
void
setC_Period_ID()
Calculate Period ID.void
setMessageResult(ConnectionProvider conn, String _strStatus, String strMessageType, Map<String,String> _parameters)
void
setMessageResult(ConnectionProvider conn, VariablesSecureApp vars, String strStatus, String strMessageType)
void
setMessageResult(ConnectionProvider conn, VariablesSecureApp vars, String _strStatus, String strMessageType, Map<String,String> _parameters)
void
setMessageResult(OBError error)
void
setObjectFieldProvider(FieldProvider[] fieldProvider)
void
setStatus(String strStatus)
-
-
-
Field Detail
-
connectionProvider
protected ConnectionProvider connectionProvider
-
batchSize
public String batchSize
-
ZERO
public BigDecimal ZERO
-
groupLines
public String groupLines
-
Qty
public String Qty
-
tableName
public String tableName
-
strDateColumn
public String strDateColumn
-
AD_Table_ID
public String AD_Table_ID
-
AD_Client_ID
public String AD_Client_ID
-
AD_Org_ID
public String AD_Org_ID
-
Status
public String Status
-
C_BPartner_ID
public String C_BPartner_ID
-
C_BPartner_Location_ID
public String C_BPartner_Location_ID
-
M_Product_ID
public String M_Product_ID
-
AD_OrgTrx_ID
public String AD_OrgTrx_ID
-
C_SalesRegion_ID
public String C_SalesRegion_ID
-
C_Project_ID
public String C_Project_ID
-
C_Campaign_ID
public String C_Campaign_ID
-
C_Activity_ID
public String C_Activity_ID
-
C_LocFrom_ID
public String C_LocFrom_ID
-
C_LocTo_ID
public String C_LocTo_ID
-
User1_ID
public String User1_ID
-
User2_ID
public String User2_ID
-
C_Costcenter_ID
public String C_Costcenter_ID
-
Name
public String Name
-
DocumentNo
public String DocumentNo
-
DateAcct
public String DateAcct
-
dateAcct
public Date dateAcct
-
DateDoc
public String DateDoc
-
C_Period_ID
public String C_Period_ID
-
C_Currency_ID
public String C_Currency_ID
-
C_DocType_ID
public String C_DocType_ID
-
C_Charge_ID
public String C_Charge_ID
-
ChargeAmt
public String ChargeAmt
-
C_BankAccount_ID
public String C_BankAccount_ID
-
FIN_Financial_Account_ID
public String FIN_Financial_Account_ID
-
C_CashBook_ID
public String C_CashBook_ID
-
M_Warehouse_ID
public String M_Warehouse_ID
-
Posted
public String Posted
-
DocumentType
public String DocumentType
-
TaxIncluded
public String TaxIncluded
-
GL_Category_ID
public String GL_Category_ID
-
Record_ID
public String Record_ID
-
IsReversal
public String IsReversal
-
IsReturn
public String IsReturn
-
NO_CURRENCY
protected static final String NO_CURRENCY
No Currency in Document Indicator- See Also:
- Constant Field Values
-
m_IsOpening
public String m_IsOpening
-
m_Record_Id2
public String m_Record_Id2
-
m_fact
public Fact[] m_fact
-
m_as
public AcctSchema[] m_as
-
Amounts
public String[] Amounts
-
p_lines
public DocLine[] p_lines
-
m_debt_payments
public DocLine_Payment[] m_debt_payments
-
MultiCurrency
public boolean MultiCurrency
Is (Source) Multi-Currency Document - i.e. the document has different currencies (if true, the document will not be source balanced)
-
AMTTYPE_Gross
public static final int AMTTYPE_Gross
Amount Type - Invoice- See Also:
- Constant Field Values
-
AMTTYPE_Net
public static final int AMTTYPE_Net
- See Also:
- Constant Field Values
-
AMTTYPE_Charge
public static final int AMTTYPE_Charge
- See Also:
- Constant Field Values
-
AMTTYPE_Invoice
public static final int AMTTYPE_Invoice
Amount Type - Allocation- See Also:
- Constant Field Values
-
AMTTYPE_Allocation
public static final int AMTTYPE_Allocation
- See Also:
- Constant Field Values
-
AMTTYPE_Discount
public static final int AMTTYPE_Discount
- See Also:
- Constant Field Values
-
AMTTYPE_WriteOff
public static final int AMTTYPE_WriteOff
- See Also:
- Constant Field Values
-
STATUS_NotPosted
public static final String STATUS_NotPosted
Document Status- See Also:
- Constant Field Values
-
STATUS_NotBalanced
public static final String STATUS_NotBalanced
Document Status- See Also:
- Constant Field Values
-
STATUS_NotConvertible
public static final String STATUS_NotConvertible
Document Status- See Also:
- Constant Field Values
-
STATUS_PeriodClosed
public static final String STATUS_PeriodClosed
Document Status- See Also:
- Constant Field Values
-
STATUS_InvalidAccount
public static final String STATUS_InvalidAccount
Document Status- See Also:
- Constant Field Values
-
STATUS_PostPrepared
public static final String STATUS_PostPrepared
Document Status- See Also:
- Constant Field Values
-
STATUS_Posted
public static final String STATUS_Posted
Document Status- See Also:
- Constant Field Values
-
STATUS_Error
public static final String STATUS_Error
Document Status- See Also:
- Constant Field Values
-
STATUS_InvalidCost
public static final String STATUS_InvalidCost
Document Status- See Also:
- Constant Field Values
-
STATUS_NotCalculatedCost
public static final String STATUS_NotCalculatedCost
Document Status- See Also:
- Constant Field Values
-
STATUS_NoRelatedPO
public static final String STATUS_NoRelatedPO
Document Status- See Also:
- Constant Field Values
-
STATUS_DocumentLocked
public static final String STATUS_DocumentLocked
Document Status- See Also:
- Constant Field Values
-
STATUS_DocumentDisabled
public static final String STATUS_DocumentDisabled
Document Status- See Also:
- Constant Field Values
-
STATUS_TableDisabled
public static final String STATUS_TableDisabled
Document Status- See Also:
- Constant Field Values
-
STATUS_BackgroundDisabled
public static final String STATUS_BackgroundDisabled
Document Status- See Also:
- Constant Field Values
-
STATUS_NoAccountingDate
public static final String STATUS_NoAccountingDate
Document Status- See Also:
- Constant Field Values
-
TABLEID_Invoice
public static final String TABLEID_Invoice
Table IDs for document level conversion rates- See Also:
- Constant Field Values
-
TABLEID_Payment
public static final String TABLEID_Payment
- See Also:
- Constant Field Values
-
TABLEID_Transaction
public static final String TABLEID_Transaction
- See Also:
- Constant Field Values
-
TABLEID_GLJournal
public static final String TABLEID_GLJournal
- See Also:
- Constant Field Values
-
TABLEID_Reconciliation
public static final String TABLEID_Reconciliation
- See Also:
- Constant Field Values
-
EXCHANGE_DOCTYPE_Invoice
@Deprecated public static final String EXCHANGE_DOCTYPE_Invoice
Deprecated.- See Also:
- Constant Field Values
-
EXCHANGE_DOCTYPE_Payment
@Deprecated public static final String EXCHANGE_DOCTYPE_Payment
Deprecated.- See Also:
- Constant Field Values
-
EXCHANGE_DOCTYPE_Transaction
@Deprecated public static final String EXCHANGE_DOCTYPE_Transaction
Deprecated.- See Also:
- Constant Field Values
-
DOCTYPE_ARInvoice
public static final String DOCTYPE_ARInvoice
AR Invoices- See Also:
- Constant Field Values
-
DOCTYPE_RMSalesInvoice
public static final String DOCTYPE_RMSalesInvoice
Return Material Sales Invoice- See Also:
- Constant Field Values
-
DOCTYPE_ARCredit
public static final String DOCTYPE_ARCredit
AR Credit Memo- See Also:
- Constant Field Values
-
DOCTYPE_ARReceipt
public static final String DOCTYPE_ARReceipt
AR Receipt- See Also:
- Constant Field Values
-
DOCTYPE_ARProForma
public static final String DOCTYPE_ARProForma
AR ProForma- See Also:
- Constant Field Values
-
DOCTYPE_APInvoice
public static final String DOCTYPE_APInvoice
AP Invoices- See Also:
- Constant Field Values
-
DOCTYPE_APCredit
public static final String DOCTYPE_APCredit
AP Credit Memo- See Also:
- Constant Field Values
-
DOCTYPE_APPayment
public static final String DOCTYPE_APPayment
AP Payment- See Also:
- Constant Field Values
-
DOCTYPE_BankStatement
public static final String DOCTYPE_BankStatement
CashManagement Bank Statement- See Also:
- Constant Field Values
-
DOCTYPE_CashJournal
public static final String DOCTYPE_CashJournal
CashManagement Cash Journals- See Also:
- Constant Field Values
-
DOCTYPE_Allocation
public static final String DOCTYPE_Allocation
CashManagement Allocations- See Also:
- Constant Field Values
-
DOCTYPE_Amortization
public static final String DOCTYPE_Amortization
Amortization- See Also:
- Constant Field Values
-
DOCTYPE_MatShipment
public static final String DOCTYPE_MatShipment
Material Shipment- See Also:
- Constant Field Values
-
DOCTYPE_MatReceipt
public static final String DOCTYPE_MatReceipt
Material Receipt- See Also:
- Constant Field Values
-
DOCTYPE_MatInventory
public static final String DOCTYPE_MatInventory
Material Inventory- See Also:
- Constant Field Values
-
DOCTYPE_MatMovement
public static final String DOCTYPE_MatMovement
Material Movement- See Also:
- Constant Field Values
-
DOCTYPE_MatProduction
public static final String DOCTYPE_MatProduction
Material Production- See Also:
- Constant Field Values
-
DOCTYPE_MatInternalConsumption
public static final String DOCTYPE_MatInternalConsumption
Material Internal Consumption- See Also:
- Constant Field Values
-
DOCTYPE_MatMatchInv
public static final String DOCTYPE_MatMatchInv
Match Invoice- See Also:
- Constant Field Values
-
DOCTYPE_MatMatchPO
public static final String DOCTYPE_MatMatchPO
Match PO- See Also:
- Constant Field Values
-
DOCTYPE_GLJournal
public static final String DOCTYPE_GLJournal
GL Journal- See Also:
- Constant Field Values
-
DOCTYPE_POrder
public static final String DOCTYPE_POrder
Purchase Order- See Also:
- Constant Field Values
-
DOCTYPE_SOrder
public static final String DOCTYPE_SOrder
Sales Order- See Also:
- Constant Field Values
-
DOCTYPE_DPManagement
public static final String DOCTYPE_DPManagement
- See Also:
- Constant Field Values
-
DOCTYPE_FinAccTransaction
public static final String DOCTYPE_FinAccTransaction
- See Also:
- Constant Field Values
-
DOCTYPE_Reconciliation
public static final String DOCTYPE_Reconciliation
- See Also:
- Constant Field Values
-
DOCTYPE_FinBankStatement
public static final String DOCTYPE_FinBankStatement
- See Also:
- Constant Field Values
-
DOCTYPE_CostAdjustment
public static final String DOCTYPE_CostAdjustment
- See Also:
- Constant Field Values
-
DOCTYPE_LandedCost
public static final String DOCTYPE_LandedCost
- See Also:
- Constant Field Values
-
DOCTYPE_LandedCostCost
public static final String DOCTYPE_LandedCostCost
- See Also:
- Constant Field Values
-
ACCTTYPE_Charge
public static final String ACCTTYPE_Charge
Account Type - Invoice- See Also:
- Constant Field Values
-
ACCTTYPE_C_Receivable
public static final String ACCTTYPE_C_Receivable
- See Also:
- Constant Field Values
-
ACCTTYPE_V_Liability
public static final String ACCTTYPE_V_Liability
- See Also:
- Constant Field Values
-
ACCTTYPE_V_Liability_Services
public static final String ACCTTYPE_V_Liability_Services
- See Also:
- Constant Field Values
-
ACCTTYPE_UnallocatedCash
public static final String ACCTTYPE_UnallocatedCash
Account Type - Payment- See Also:
- Constant Field Values
-
ACCTTYPE_BankInTransit
public static final String ACCTTYPE_BankInTransit
- See Also:
- Constant Field Values
-
ACCTTYPE_PaymentSelect
public static final String ACCTTYPE_PaymentSelect
- See Also:
- Constant Field Values
-
ACCTTYPE_WriteOffDefault
public static final String ACCTTYPE_WriteOffDefault
- See Also:
- Constant Field Values
-
ACCTTYPE_WriteOffDefault_Revenue
public static final String ACCTTYPE_WriteOffDefault_Revenue
- See Also:
- Constant Field Values
-
ACCTTYPE_BankInTransitDefault
public static final String ACCTTYPE_BankInTransitDefault
- See Also:
- Constant Field Values
-
ACCTTYPE_ConvertChargeDefaultAmt
public static final String ACCTTYPE_ConvertChargeDefaultAmt
- See Also:
- Constant Field Values
-
ACCTTYPE_ConvertGainDefaultAmt
public static final String ACCTTYPE_ConvertGainDefaultAmt
- See Also:
- Constant Field Values
-
ACCTTYPE_CashAsset
public static final String ACCTTYPE_CashAsset
Account Type - Cash- See Also:
- Constant Field Values
-
ACCTTYPE_CashTransfer
public static final String ACCTTYPE_CashTransfer
- See Also:
- Constant Field Values
-
ACCTTYPE_CashExpense
public static final String ACCTTYPE_CashExpense
- See Also:
- Constant Field Values
-
ACCTTYPE_CashReceipt
public static final String ACCTTYPE_CashReceipt
- See Also:
- Constant Field Values
-
ACCTTYPE_CashDifference
public static final String ACCTTYPE_CashDifference
- See Also:
- Constant Field Values
-
ACCTTYPE_DiscountExp
public static final String ACCTTYPE_DiscountExp
Account Type - Allocation- See Also:
- Constant Field Values
-
ACCTTYPE_DiscountRev
public static final String ACCTTYPE_DiscountRev
- See Also:
- Constant Field Values
-
ACCTTYPE_WriteOff
public static final String ACCTTYPE_WriteOff
- See Also:
- Constant Field Values
-
ACCTTYPE_WriteOff_Revenue
public static final String ACCTTYPE_WriteOff_Revenue
- See Also:
- Constant Field Values
-
ACCTTYPE_BankAsset
public static final String ACCTTYPE_BankAsset
Account Type - Bank Statement- See Also:
- Constant Field Values
-
ACCTTYPE_InterestRev
public static final String ACCTTYPE_InterestRev
- See Also:
- Constant Field Values
-
ACCTTYPE_InterestExp
public static final String ACCTTYPE_InterestExp
- See Also:
- Constant Field Values
-
ACCTTYPE_ConvertChargeLossAmt
public static final String ACCTTYPE_ConvertChargeLossAmt
- See Also:
- Constant Field Values
-
ACCTTYPE_ConvertChargeGainAmt
public static final String ACCTTYPE_ConvertChargeGainAmt
- See Also:
- Constant Field Values
-
ACCTTYPE_InvDifferences
public static final String ACCTTYPE_InvDifferences
Inventory Accounts- See Also:
- Constant Field Values
-
ACCTTYPE_NotInvoicedReceipts
public static final String ACCTTYPE_NotInvoicedReceipts
- See Also:
- Constant Field Values
-
ACCTTYPE_ProjectAsset
public static final String ACCTTYPE_ProjectAsset
Project Accounts- See Also:
- Constant Field Values
-
ACCTTYPE_ProjectWIP
public static final String ACCTTYPE_ProjectWIP
- See Also:
- Constant Field Values
-
ACCTTYPE_PPVOffset
public static final String ACCTTYPE_PPVOffset
GL Accounts- See Also:
- Constant Field Values
-
BP_C_SalesRegion_ID
public String BP_C_SalesRegion_ID
-
errors
public int errors
-
-
Constructor Detail
-
AcctServer
public AcctServer(String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider)
Constructor- Parameters:
m_AD_Client_ID
- Client ID of these DocumentsconnectionProvider
- Provider for db connections.
-
AcctServer
public AcctServer()
-
-
Method Detail
-
setBatchSize
public void setBatchSize(String newbatchSize)
-
run
public void run(VariablesSecureApp vars) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
run
public void run(VariablesSecureApp vars, String strDateFrom, String strDateTo) throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
isBackground
public boolean isBackground()
- Returns:
- the isBackground
-
setBackground
public void setBackground(boolean isBackground)
- Parameters:
isBackground
- the isBackground to set
-
get
public static AcctServer get(String AD_Table_ID, String AD_Client_ID, String AD_Org_ID, ConnectionProvider connectionProvider) throws javax.servlet.ServletException
Factory - Create Posting document- Parameters:
AD_Table_ID
- Table ID of DocumentsAD_Client_ID
- Client ID of DocumentsconnectionProvider
- Database connection provider- Returns:
- Document
- Throws:
javax.servlet.ServletException
-
set
public void set(String m_AD_Table_ID, String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider, String tablename, String acctdatecolumn)
-
reloadAcctSchemaArray
public void reloadAcctSchemaArray() throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
post
public boolean post(String strClave, boolean force, VariablesSecureApp vars, ConnectionProvider conn, Connection con) throws javax.servlet.ServletException
This method handles the accounting of the record identified by strClave. Due to the possibility of developing processes that may run after the standard accounting the commit of the transactions made in this method cannot be done here. The commit must be handled in the caller of this method appropriately. Realize that you must handle the commit of the transactions made through a normal or a DAL connection.- Throws:
javax.servlet.ServletException
-
loadDocument
@Deprecated public boolean loadDocument(FieldProvider[] data, boolean force, ConnectionProvider conn)
Deprecated.
-
loadDocument
public boolean loadDocument(FieldProvider[] data, boolean force, ConnectionProvider conn, Connection con)
-
loadDocumentType
public void loadDocumentType()
-
loadDocumentType
public void loadDocumentType(boolean supressWarnings)
-
insertNote
@Deprecated public boolean insertNote(String aD_Client_ID, String aD_Org_ID, String AD_User_ID, String aD_Table_ID, String record_ID, String AD_MessageValue, String Text, String Reference, VariablesSecureApp vars, ConnectionProvider conn, Connection con)
Deprecated.During cleanup for 3.0 the entire table ad_node was removed from core, so this insertNote method doesn't serve have any purpose anymore. Keep as deprecated noop in case any module may call it.
-
isBalanced
public boolean isBalanced()
Is the Source Document Balanced- Returns:
- true if (source) balanced
-
isConvertible
public boolean isConvertible(AcctSchema acctSchema, ConnectionProvider conn) throws javax.servlet.ServletException
Is Document convertible to currency and Conversion Type- Parameters:
acctSchema
- accounting schema- Returns:
- true, if convertible to accounting currency
- Throws:
javax.servlet.ServletException
-
getAmount
public String getAmount(int AmtType)
Get the Amount (loaded in loadDocumentDetails)- Parameters:
AmtType
- see AMTTYPE_*- Returns:
- Amount
-
getAmount
public String getAmount()
Get Amount with index 0- Returns:
- Amount (primary document amount)
-
getConversionDate
protected String getConversionDate()
Get the Convertion Date- Returns:
- DateAcct
-
getConvertedAmt
public static String getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, ConnectionProvider conn)
Convert an amount- Parameters:
CurFrom_ID
- The C_Currency_ID FROMCurTo_ID
- The C_Currency_ID TOConvDate
- The Conversion date - if null - use current dateRateType
- The Conversion rate type - if null/empty - use SpotAmt
- The amount to be converted- Returns:
- converted amount
-
getConvertedAmt
public static String getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, ConnectionProvider conn)
-
getConvertionRate
public static BigDecimal getConvertionRate(String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, ConnectionProvider conn)
-
isPeriodOpen
public boolean isPeriodOpen()
Is Period Open- Returns:
- true if period is open
-
setC_Period_ID
public void setC_Period_ID()
Calculate Period ID. Set to -1 if no period open, 0 if no period control
-
match
public int match(VariablesSecureApp vars, ConnectionProvider conn, Connection con)
MatchingDerive Invoice-Receipt Match from PO-Invoice and PO-Receipt Purchase Order (20) - Invoice1 (10) - Invoice2 (10) - Receipt1 (5) - Receipt2 (15) (a) Creates Directs - Invoice1 - Receipt1 (5) - Invoice2 - Receipt2 (10) (b) Creates Indirects - Invoice1 - Receipt2 (5) (Not imlemented)
- Returns:
- number of records created
-
getAccount
public final Account getAccount(String AcctType, AcctSchema as, ConnectionProvider conn)
Get the account for Accounting Schema- Parameters:
AcctType
- see ACCTTYPE_*as
- accounting schema- Returns:
- Account
-
getAccountBPartner
public final Account getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, ConnectionProvider conn) throws javax.servlet.ServletException
Get the account for Accounting Schema- Parameters:
cBPartnerId
- business partner idas
- accounting schema- Returns:
- Account
- Throws:
javax.servlet.ServletException
-
getAccountBPartner
public final Account getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, boolean isDoubtfuldebt, ConnectionProvider conn) throws javax.servlet.ServletException
Get the account for Accounting Schema- Parameters:
cBPartnerId
- business partner idas
- accounting schema- Returns:
- Account
- Throws:
javax.servlet.ServletException
-
getAccountBPartnerBadDebt
public final Account getAccountBPartnerBadDebt(String BPartnerId, boolean isExpense, AcctSchema as, ConnectionProvider conn) throws javax.servlet.ServletException
It gets Account to be used to provision for the selected Business Partner- Parameters:
BPartnerId
- : ID of the Business PartnerisExpense
- : Provision Expense Account. If not it applies to Provision Applied accountas
- : Accounting Schemaconn
- : Connection Provider- Returns:
- Account
- Throws:
javax.servlet.ServletException
-
getAccountBPartnerAllowanceForDoubtfulDebt
public final Account getAccountBPartnerAllowanceForDoubtfulDebt(String BPartnerId, AcctSchema as, ConnectionProvider conn) throws javax.servlet.ServletException
It gets Account to be used to provision for the selected Business Partner- Parameters:
BPartnerId
- : ID of the Business Partneras
- : Accounting Schemaconn
- : Connection Provider- Returns:
- Account
- Throws:
javax.servlet.ServletException
-
getAccountGLItem
public Account getAccountGLItem(GLItem glItem, AcctSchema as, boolean bIsReceipt, ConnectionProvider conn) throws javax.servlet.ServletException
Get the account for GL Item- Throws:
javax.servlet.ServletException
-
getAccountFee
public Account getAccountFee(AcctSchema as, FIN_FinancialAccount finAccount, ConnectionProvider conn) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
getAccount
public Account getAccount(ConnectionProvider conn, String use, FIN_FinancialAccountAccounting financialAccountAccounting, boolean bIsReceipt) throws javax.servlet.ServletException
Get the account for Financial Account (Uses: INT - In Transit DEP - Deposit CLE - Clearing WIT - Withdraw)- Throws:
javax.servlet.ServletException
-
getObjectFieldProvider
public FieldProvider[] getObjectFieldProvider()
-
setObjectFieldProvider
public void setObjectFieldProvider(FieldProvider[] fieldProvider)
-
loadObjectFieldProvider
public abstract void loadObjectFieldProvider(ConnectionProvider conn, String aD_Client_ID, String Id) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
loadDocumentDetails
public abstract boolean loadDocumentDetails(FieldProvider[] data, ConnectionProvider conn)
-
getBalance
public abstract BigDecimal getBalance()
Get Source Currency Balance - subtracts line (and tax) amounts from total - no rounding- Returns:
- positive amount, if total header is bigger than lines
-
createFact
public abstract Fact createFact(AcctSchema as, ConnectionProvider conn, Connection con, VariablesSecureApp vars) throws javax.servlet.ServletException
Create Facts (the accounting logic)- Parameters:
as
- accounting schema- Returns:
- Fact
- Throws:
javax.servlet.ServletException
-
getDocumentConfirmation
public abstract boolean getDocumentConfirmation(ConnectionProvider conn, String strRecordId)
-
getInfo
public String getInfo(VariablesSecureApp vars)
-
getInfo
public String getInfo(String language)
- Parameters:
language
-- Returns:
- a String representing the result of created
-
checkDocuments
public boolean checkDocuments() throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
checkDocuments
public boolean checkDocuments(String dateFrom, String dateTo) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
filterDatesCheckDocuments
@Deprecated public boolean filterDatesCheckDocuments(String dateFrom, String dateTo) throws javax.servlet.ServletException
Deprecated.- Throws:
javax.servlet.ServletException
-
setMessageResult
public void setMessageResult(OBError error)
-
setMessageResult
public void setMessageResult(ConnectionProvider conn, VariablesSecureApp vars, String strStatus, String strMessageType)
-
setMessageResult
public void setMessageResult(ConnectionProvider conn, String _strStatus, String strMessageType, Map<String,String> _parameters)
-
setMessageResult
public void setMessageResult(ConnectionProvider conn, VariablesSecureApp vars, String _strStatus, String strMessageType, Map<String,String> _parameters)
-
getInvalidAccountParameters
public Map<String,String> getInvalidAccountParameters(String strAccount, String strEntity, String strAccountingSchema)
-
getInvalidCostParameters
public Map<String,String> getInvalidCostParameters(String strProduct, String strDate)
-
getNotCalculatedCostParameters
public Map<String,String> getNotCalculatedCostParameters(MaterialTransaction trx)
-
getMessageResult
public OBError getMessageResult()
-
getServletInfo
public String getServletInfo()
-
getStatus
public String getStatus()
-
setStatus
public void setStatus(String strStatus)
-
getConnectionProvider
public ConnectionProvider getConnectionProvider()
-
getConversionRateDoc
public ConversionRateDoc getConversionRateDoc(String table_ID, String record_ID, String curFrom_ID, String curTo_ID)
-
convertAmount
public BigDecimal convertAmount(BigDecimal _amount, boolean isReceipt, String acctDate, String table_ID, String record_ID, String currencyIDFrom, String currencyIDTo, DocLine line, AcctSchema as, Fact fact, String Fact_Acct_Group_ID, String seqNo, ConnectionProvider conn) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
convertAmount
public BigDecimal convertAmount(BigDecimal _amount, boolean isReceipt, String acctDate, String table_ID, String record_ID, String currencyIDFrom, String currencyIDTo, DocLine line, AcctSchema as, Fact fact, String Fact_Acct_Group_ID, String seqNo, ConnectionProvider conn, boolean bookDifferences) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
getConvertedAmt
@Deprecated public static String getConvertedAmt(String Amt, String CurFrom_ID, String CurTo_ID, String ConvDate, String RateType, String client, String org, String recordId, String docType, ConnectionProvider conn)
Deprecated.
-
applyRate
public static BigDecimal applyRate(BigDecimal _amount, ConversionRateDoc conversionRateDoc, boolean multiply)
-
getConversionRatePrecision
public static int getConversionRatePrecision(VariablesSecureApp vars)
-
getPaymentDetailAmount
@Deprecated public BigDecimal getPaymentDetailAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Deprecated.Returns the amount of a Payment Detail. In case the related Payment Schedule Detail was generated for compensate the difference between an Order and a related Invoice, it merges it's amount with the next Payment Schedule Detail. Issue 19567: https://issues.openbravo.com/view.php?id=19567- Parameters:
paymentDetails
- List of payment Detailsps
- Previous Payment Schedulepsi
- Invoice Payment Schedule of actual Payment Detailpso
- Order Payment Schedule of actual Payment DetailcurrentPaymentDetailIndex
- Index
-
getPaymentDetailWriteOffAndAmount
@Deprecated public HashMap<String,BigDecimal> getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Deprecated.Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule Detail was generated for compensate the difference between an Order and a related Invoice, it merges it's amount with the next Payment Schedule Detail. Issue 19567: https://issues.openbravo.com/view.php?id=19567. UsegetPaymentDetailIdWriteOffAndAmount(List, FIN_PaymentSchedule, FIN_PaymentSchedule, FIN_PaymentSchedule, int)
instead- Parameters:
paymentDetails
- List of payment Detailsps
- Previous Payment Schedulepsi
- Invoice Payment Schedule of actual Payment Detailpso
- Order Payment Schedule of actual Payment DetailcurrentPaymentDetailIndex
- Index
-
getPaymentDetailIdWriteOffAndAmount
public HashMap<String,BigDecimal> getPaymentDetailIdWriteOffAndAmount(List<String> paymentDetailsIds, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule Detail was generated for compensate the difference between an Order and a related Invoice, it merges it's amount with the next Payment Schedule Detail. Issue 19567: https://issues.openbravo.com/view.php?id=19567- Parameters:
paymentDetailsIds
- List of payment Details Idsps
- Previous Payment Schedulepsi
- Invoice Payment Schedule of actual Payment Detailpso
- Order Payment Schedule of actual Payment DetailcurrentPaymentDetailIndex
- Index
-
getPaymentDetailWriteOffAndAmount
public HashMap<String,BigDecimal> getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex, FieldProvider fieldProvider)
Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule Detail was generated for compensate the difference between an Order and a related Invoice, it merges it's amount with the next Payment Schedule Detail. Issue 19567: https://issues.openbravo.com/view.php?id=19567
It does exactly the same as thegetPaymentDetailWriteOffAndAmount(List, FIN_PaymentSchedule, FIN_PaymentSchedule, FIN_PaymentSchedule, int)
method, but it also stores a new field "MergedPaymentDetailId" inside the fieldProvider with the merged payment detail id (if any).- Parameters:
paymentDetails
- List of payment Detailsps
- Previous Payment Schedulepsi
- Invoice Payment Schedule of actual Payment Detailpso
- Order Payment Schedule of actual Payment DetailcurrentPaymentDetailIndex
- IndexfieldProvider
- contains the FieldProvider with the Payment Detail currently being processed. Used to store the "MergedPaymentDetailId" (if any) as a new field of the fieldProvider
-
getPaymentDetailWriteOffAndAmount
public HashMap<String,BigDecimal> getPaymentDetailWriteOffAndAmount(FIN_PaymentDetail paymentDetail, String paymentDetailNextId, String paymentDetailPreviousId, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, FieldProvider fieldProvider)
Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule Detail was generated for compensate the difference between an Order and a related Invoice, it merges it's amount with the next Payment Schedule Detail. Issue 19567: https://issues.openbravo.com/view.php?id=19567
It does exactly the same as thegetPaymentDetailWriteOffAndAmount(List, FIN_PaymentSchedule, FIN_PaymentSchedule, FIN_PaymentSchedule, int)
method, but it also stores a new field "MergedPaymentDetailId" inside the fieldProvider with the merged payment detail id (if any).- Parameters:
paymentDetail
- Payment DetailpaymentDetailNextId
- Next Payment Detail idpaymentDetailPreviousId
- Previous Payment Detail idps
- Previous Payment Schedulepsi
- Invoice Payment Schedule of actual Payment Detailpso
- Order Payment Schedule of actual Payment DetailfieldProvider
- contains the FieldProvider with the Payment Detail currently being processed. Used to store the "MergedPaymentDetailId" (if any) as a new field of the fieldProvider
-
-