private MCash createCash() { MCash cash = new MCash(getCtx(), 0, get_TrxName()); cash.setName(p_Name); cash.setDescription(p_Description); cash.setDateAcct(p_DateAcct); cash.setStatementDate(p_StatementDate); cash.setC_CashBook_ID(p_C_CashBook_ID); if (!cash.save()) { throw new IllegalStateException("Could not create Cash"); } return cash; } // createCash
/** Generate CashJournal */ private void generateBankTransfer() { // Create Cash & CashLines MCash cash = createCash(); MCashLine cashLines[] = createCashLines(cash); StringBuffer processMsg = new StringBuffer(cash.getDocumentNo()); cash.setDocAction(p_docAction); if (!cash.processIt(p_docAction)) { processMsg.append(" (NOT Processed)"); log.warning("Cash Processing failed: " + cash + " - " + cash.getProcessMsg()); addLog( cash.getC_Cash_ID(), cash.getStatementDate(), null, "Cash Processing failed: " + cash + " - " + cash.getProcessMsg() + " / please complete it manually"); } if (!cash.save()) { throw new IllegalStateException("Could not create Cash"); } // Add processing information to process log addLog(cash.getC_Cash_ID(), cash.getStatementDate(), null, processMsg.toString()); m_created++; } // generateBankTransfer