pi - 2b930d42df25

org.openbravo.erpCommon.ad_forms
Class AcctServer

java.lang.Object
  extended by org.openbravo.erpCommon.ad_forms.AcctServer
Direct Known Subclasses:
DocAmortization, DocBank, DocCash, DocDoubtfulDebt, DocDPManagement, DocFINBankStatement, DocFINFinAccTransaction, DocFINPayment, DocFINReconciliation, DocGLJournal, DocInOut, DocInventory, DocInvoice, DocMatchInv, DocMovement, DocOrder, DocPayment, DocProduction

public abstract class AcctServer
extends Object


Field Summary
static String ACCTTYPE_BankAsset
          Account Type - Bank Statement
static String ACCTTYPE_BankInTransit
           
static String ACCTTYPE_BankInTransitDefault
           
static String ACCTTYPE_C_Receivable
           
static String ACCTTYPE_CashAsset
          Account Type - Cash
static String ACCTTYPE_CashDifference
           
static String ACCTTYPE_CashExpense
           
static String ACCTTYPE_CashReceipt
           
static String ACCTTYPE_CashTransfer
           
static String ACCTTYPE_Charge
          Account Type - Invoice
static String ACCTTYPE_ConvertChargeDefaultAmt
           
static String ACCTTYPE_ConvertChargeGainAmt
           
static String ACCTTYPE_ConvertChargeLossAmt
           
static String ACCTTYPE_ConvertGainDefaultAmt
           
static String ACCTTYPE_DiscountExp
          Account Type - Allocation
static String ACCTTYPE_DiscountRev
           
static String ACCTTYPE_InterestExp
           
static String ACCTTYPE_InterestRev
           
static String ACCTTYPE_InvDifferences
          Inventory Accounts
static String ACCTTYPE_NotInvoicedReceipts
           
static String ACCTTYPE_PaymentSelect
           
static String ACCTTYPE_PPVOffset
          GL Accounts
static String ACCTTYPE_ProjectAsset
          Project Accounts
static String ACCTTYPE_ProjectWIP
           
static String ACCTTYPE_UnallocatedCash
          Account Type - Payment
static String ACCTTYPE_V_Liability
           
static String ACCTTYPE_V_Liability_Services
           
static String ACCTTYPE_WriteOff
           
static String ACCTTYPE_WriteOff_Revenue
           
static String ACCTTYPE_WriteOffDefault
           
static String ACCTTYPE_WriteOffDefault_Revenue
           
 String AD_Client_ID
           
 String AD_Org_ID
           
 String AD_OrgTrx_ID
           
 String AD_Table_ID
           
 String[] Amounts
           
static int AMTTYPE_Allocation
           
static int AMTTYPE_Charge
           
static int AMTTYPE_Discount
           
static int AMTTYPE_Gross
          Amount Type - Invoice
static int AMTTYPE_Invoice
          Amount Type - Allocation
static int AMTTYPE_Net
           
static int AMTTYPE_WriteOff
           
 String batchSize
           
 String BP_C_SalesRegion_ID
           
 String C_Activity_ID
           
 String C_BankAccount_ID
           
 String C_BPartner_ID
           
 String C_BPartner_Location_ID
           
 String C_Campaign_ID
           
 String C_CashBook_ID
           
 String C_Charge_ID
           
 String C_Costcenter_ID
           
 String C_Currency_ID
           
 String C_DocType_ID
           
 String C_LocFrom_ID
           
 String C_LocTo_ID
           
 String C_Period_ID
           
 String C_Project_ID
           
 String C_SalesRegion_ID
           
 String ChargeAmt
           
protected  ConnectionProvider connectionProvider
           
 Date dateAcct
           
 String DateAcct
           
 String DateDoc
           
static String DOCTYPE_Allocation
          CashManagement Allocations
static String DOCTYPE_Amortization
          Amortization
static String DOCTYPE_APCredit
          AP Credit Memo
static String DOCTYPE_APInvoice
          AP Invoices
static String DOCTYPE_APPayment
          AP Payment
static String DOCTYPE_ARCredit
          AR Credit Memo
static String DOCTYPE_ARInvoice
          AR Invoices
static String DOCTYPE_ARProForma
          AR ProForma
static String DOCTYPE_ARReceipt
          AR Receipt
static String DOCTYPE_BankStatement
          CashManagement Bank Statement
static String DOCTYPE_CashJournal
          CashManagement Cash Journals
static String DOCTYPE_DPManagement
           
static String DOCTYPE_FinAccTransaction
           
static String DOCTYPE_FinBankStatement
           
static String DOCTYPE_GLJournal
          GL Journal
static String DOCTYPE_MatInventory
          Material Inventory
static String DOCTYPE_MatMatchInv
          Match Invoice
static String DOCTYPE_MatMatchPO
          Match PO
static String DOCTYPE_MatMovement
          Material Movement
static String DOCTYPE_MatProduction
          Material Production
static String DOCTYPE_MatReceipt
          Material Receipt
static String DOCTYPE_MatShipment
          Material Shipment
static String DOCTYPE_POrder
          Purchase Order
static String DOCTYPE_Reconciliation
           
static String DOCTYPE_RMSalesInvoice
          Return Material Sales Invoice
static String DOCTYPE_SOrder
          Sales Order
 String DocumentNo
           
 String DocumentType
           
 int errors
           
static String EXCHANGE_DOCTYPE_Invoice
          Deprecated. 
static String EXCHANGE_DOCTYPE_Payment
          Deprecated. 
static String EXCHANGE_DOCTYPE_Transaction
          Deprecated. 
 String GL_Category_ID
           
 String groupLines
           
 String IsReturn
           
 String IsReversal
           
 AcctSchema[] m_as
           
 DocLine_Payment[] m_debt_payments
           
 Fact[] m_fact
           
 String m_IsOpening
           
 String M_Product_ID
           
 String M_Warehouse_ID
           
 boolean MultiCurrency
          Is (Source) Multi-Currency Document - i.e.
 String Name
           
protected static String NO_CURRENCY
          No Currency in Document Indicator
 DocLine[] p_lines
           
 String Posted
           
 String Qty
           
 String Record_ID
           
 String Status
           
static String STATUS_BackgroundDisabled
          Document Status
static String STATUS_DocumentDisabled
          Document Status
static String STATUS_DocumentLocked
          Document Status
static String STATUS_Error
          Document Status
static String STATUS_InvalidAccount
          Document Status
static String STATUS_InvalidCost
          Document Status
static String STATUS_NoAccountingDate
          Document Status
static String STATUS_NoRelatedPO
          Document Status
static String STATUS_NotBalanced
          Document Status
static String STATUS_NotCalculatedCost
          Document Status
static String STATUS_NotConvertible
          Document Status
static String STATUS_NotPosted
          Document Status
static String STATUS_PeriodClosed
          Document Status
static String STATUS_Posted
          Document Status
static String STATUS_PostPrepared
          Document Status
static String STATUS_TableDisabled
          Document Status
 String strDateColumn
           
static String TABLEID_Invoice
          Table IDs for document level conversion rates
static String TABLEID_Payment
           
static String TABLEID_Reconciliation
           
static String TABLEID_Transaction
           
 String tableName
           
 String TaxIncluded
           
 String User1_ID
           
 String User2_ID
           
 BigDecimal ZERO
           
 
Constructor Summary
AcctServer()
           
AcctServer(String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider)
          Constructor
 
Method Summary
static BigDecimal applyRate(BigDecimal _amount, ConversionRateDoc conversionRateDoc, boolean multiply)
           
 boolean checkDocuments()
           
 boolean checkDocuments(String dateFrom, String dateTo)
           
 BigDecimal convertAmount(BigDecimal _amount, boolean isReceipt, String dateAcct, 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 dateAcct, 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 document
 Account 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 getAccount(String AcctType, AcctSchema as, ConnectionProvider conn)
          Get the account for Accounting Schema
 Account getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, boolean isDoubtfuldebt, ConnectionProvider conn)
          Get the account for Accounting Schema
 Account getAccountBPartner(String cBPartnerId, AcctSchema as, boolean isReceipt, boolean isPrepayment, ConnectionProvider conn)
          Get the account for Accounting Schema
 Account getAccountBPartnerAllowanceForDoubtfulDebt(String BPartnerId, AcctSchema as, ConnectionProvider conn)
          It gets Account to be used to provision for the selected Business Partner
 Account getAccountBPartnerBadDebt(String BPartnerId, boolean isExpense, AcctSchema as, ConnectionProvider conn)
          It gets Account to be used to provision for the selected Business Partner
 Account getAccountFee(AcctSchema as, FIN_FinancialAccount finAccount, ConnectionProvider conn)
           
 Account getAccountGLItem(GLItem glItem, AcctSchema as, boolean bIsReceipt, ConnectionProvider conn)
          Get the account for GL Item
 String getAmount()
          Get Amount with index 0
 String getAmount(int AmtType)
          Get the Amount (loaded in loadDocumentDetails)
abstract  BigDecimal getBalance()
          Get Source Currency Balance - subtracts line (and tax) amounts from total - no rounding
 ConnectionProvider getConnectionProvider()
           
 ConversionRateDoc 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, ConnectionProvider conn)
          Convert an amount
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, String client, String org, String recordId, String docType, ConnectionProvider conn)
          Deprecated. 
static 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> getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex)
          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. Keep as deprecated noop in case any module may call it.
 boolean isBackground()
           
 boolean isBalanced()
          Is the Source Document Balanced
 boolean isConvertible(AcctSchema acctSchema, ConnectionProvider conn)
          Is Document convertible to currency and Conversion Type
 boolean isPeriodOpen()
          Is Period Open
 boolean 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)
          Matching
 boolean 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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_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_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_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

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 Documents
connectionProvider - 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 Documents
AD_Client_ID - Client ID of Documents
connectionProvider - 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)

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 FROM
CurTo_ID - The C_Currency_ID TO
ConvDate - The Conversion date - if null - use current date
RateType - The Conversion rate type - if null/empty - use Spot
Amt - 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)
Matching
  Derive 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 id
as - 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 id
as - 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 Partner
isExpense - : Provision Expense Account. If not it applies to Provision Applied account
as - : Accounting Schema
conn - : 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 Partner
as - : Accounting Schema
conn - : 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 dateAcct,
                                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 dateAcct,
                                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 Details
ps - Previous Payment Schedule
psi - Invoice Payment Schedule of actual Payment Detail
pso - Order Payment Schedule of actual Payment Detail
currentPaymentDetailIndex - Index

getPaymentDetailWriteOffAndAmount

public HashMap<String,BigDecimal> getPaymentDetailWriteOffAndAmount(List<FIN_PaymentDetail> paymentDetails,
                                                                    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:
paymentDetails - List of payment Details
ps - Previous Payment Schedule
psi - Invoice Payment Schedule of actual Payment Detail
pso - Order Payment Schedule of actual Payment Detail
currentPaymentDetailIndex - Index

pi - 2b930d42df25