Search in sources :

Example 1 with MCashBook

use of org.compiere.model.MCashBook in project adempiere by adempiere.

the class ImmediateBankTransfer method isSameCurrency.

//	doIt
/**
	 * To check CashBook and Banks have the same currency 
	 * @return
	 */
private boolean isSameCurrency() {
    MCashBook mcash = new MCashBook(getCtx(), p_C_CashBook_ID, get_TrxName());
    MBankAccount mBankFrom = new MBankAccount(getCtx(), p_From_C_BankAccount_ID, get_TrxName());
    MBankAccount mBankTo = new MBankAccount(getCtx(), p_To_C_BankAccount_ID, get_TrxName());
    if ((mcash.getC_Currency_ID() != mBankFrom.getC_Currency_ID()) || (mcash.getC_Currency_ID() != mBankTo.getC_Currency_ID()))
        return false;
    m_C_Currency_ID = mcash.getC_Currency_ID();
    return true;
}
Also used : MCashBook(org.compiere.model.MCashBook) MBankAccount(org.compiere.model.MBankAccount)

Example 2 with MCashBook

use of org.compiere.model.MCashBook in project adempiere by adempiere.

the class Doc_Cash method loadDocumentDetails.

//	Doc_Cash
/**
	 *  Load Specific Document Details
	 *  @return error message or null
	 */
protected String loadDocumentDetails() {
    MCash cash = (MCash) getPO();
    setDateDoc(cash.getStatementDate());
    //	Amounts
    setAmount(Doc.AMTTYPE_Gross, cash.getStatementDifference());
    //  Set CashBook Org & Currency
    MCashBook cb = MCashBook.get(getCtx(), cash.getC_CashBook_ID());
    setC_CashBook_ID(cb.getC_CashBook_ID());
    setC_Currency_ID(cb.getC_Currency_ID());
    //	Contained Objects
    p_lines = loadLines(cash, cb);
    log.fine("Lines=" + p_lines.length);
    return null;
}
Also used : MCash(org.compiere.model.MCash) MCashBook(org.compiere.model.MCashBook)

Example 3 with MCashBook

use of org.compiere.model.MCashBook in project adempiere by adempiere.

the class MCashBookTest method testQuery.

public void testQuery() throws Exception {
    MCashBook cshbk = MCashBook.get(getCtx(), 11, 100);
    assertTrue("Must have cash book", cshbk.getC_CashBook_ID() == 101);
}
Also used : MCashBook(org.compiere.model.MCashBook)

Aggregations

MCashBook (org.compiere.model.MCashBook)3 MBankAccount (org.compiere.model.MBankAccount)1 MCash (org.compiere.model.MCash)1