use of org.compiere.model.I_C_BankStatementLine in project metasfresh-webui-api by metasfresh.
the class C_BankStatement_ReconcileWithSinglePayment method paymentLookupProvider.
@ProcessParamLookupValuesProvider(parameterName = PARAM_C_Payment_ID, numericKey = true, lookupSource = DocumentLayoutElementFieldDescriptor.LookupSource.lookup, lookupTableName = I_C_Payment.Table_Name)
private LookupValuesList paymentLookupProvider() {
if (bpartnerId == null) {
return LookupValuesList.EMPTY;
}
final I_C_BankStatementLine bankStatementLine = getSingleSelectedBankStatementLine();
final int limit = 20;
final Set<PaymentId> paymentIds = bankStatementPaymentBL.findEligiblePaymentIds(bankStatementLine, bpartnerId, limit);
return LookupDataSourceFactory.instance.searchInTableLookup(I_C_Payment.Table_Name).findByIdsOrdered(paymentIds);
}
use of org.compiere.model.I_C_BankStatementLine in project metasfresh-webui-api by metasfresh.
the class C_BankStatement_UnReconcileLine method checkSingleLineSelectedWhichIsReconciled.
private final ProcessPreconditionsResolution checkSingleLineSelectedWhichIsReconciled(@NonNull final IProcessPreconditionsContext context) {
// there should be a single line selected
final Set<TableRecordReference> bankStatemementLineRefs = context.getSelectedIncludedRecords();
if (bankStatemementLineRefs.size() != 1) {
return ProcessPreconditionsResolution.rejectWithInternalReason("a single line shall be selected");
}
final TableRecordReference bankStatemementLineRef = bankStatemementLineRefs.iterator().next();
final BankStatementLineId bankStatementLineId = BankStatementLineId.ofRepoId(bankStatemementLineRef.getRecord_ID());
final I_C_BankStatementLine line = bankStatementBL.getLineById(bankStatementLineId);
if (!line.isReconciled()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("line shall be reconciled");
}
return ProcessPreconditionsResolution.accept();
}
Aggregations