use of org.compiere.model.MRefList in project adempiere by adempiere.
the class MRefListTest method testGet.
public void testGet() throws Exception {
//
// Should be found
MRefList rl = MRefList.get(getCtx(), X_AD_Table.ACCESSLEVEL_AD_Reference_ID, X_AD_Table.ACCESSLEVEL_Organization, getTrxName());
assertNotNull(rl);
assertEquals("Should be found", X_AD_Table.ACCESSLEVEL_Organization, rl.getValue());
//
// Should not be found
rl = MRefList.get(getCtx(), 7654321, "7654321", getTrxName());
assertNull("Should not be found", rl);
}
use of org.compiere.model.MRefList in project adempiere by adempiere.
the class GenerateWithdrawal method doIt.
@Override
protected String doIt() throws Exception {
MPaymentBatch paymentBatchFrom = new MPaymentBatch(getCtx(), 0, get_TrxName());
paymentBatchFrom.setName(getDescription());
paymentBatchFrom.setProcessingDate(getTransactionDate());
paymentBatchFrom.saveEx();
MPaymentBatch paymentBatchTo = new MPaymentBatch(getCtx(), 0, get_TrxName());
paymentBatchTo.setName(getDescription());
paymentBatchTo.setProcessingDate(getTransactionDate());
paymentBatchTo.saveEx();
List<MRefList> refLists = (List<MRefList>) getInstancesForSelection(get_TrxName());
refLists.stream().forEach(refList -> {
BigDecimal amount = getSelectionAsBigDecimal(refList.get_ID(), "TT_Amount");
String referenceNo = getSelectionAsString(refList.get_ID(), "TT_ReferenceNo");
if (amount.signum() > 0) {
createPayment(getBankAccountId(), getPOSTerminalId(), getBusinessPartnerId(), getDocumentNo(), paymentBatchFrom.getDocumentNo(), referenceNo, getDocumentTypeId(), getChargeId(), refList.getValue(), getCurrencyId(), amount, getTransactionDate(), getAccountDate(), false, paymentBatchFrom.get_ID());
createPayment(getTransferCashtrxtoId(), getPOSTerminalId(), getBusinessPartnerId(), getDocumentNo(), referenceNo, paymentBatchTo.getDocumentNo(), getCounterDocumentTypeId(), getChargeId(), refList.getValue(), getCurrencyId(), amount, getTransactionDate(), getAccountDate(), true, paymentBatchTo.get_ID());
}
});
return "@Ok@";
}
Aggregations