Search in sources :

Example 11 with PaymentId

use of de.metas.payment.PaymentId 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);
}
Also used : PaymentId(de.metas.payment.PaymentId) I_C_BankStatementLine(org.compiere.model.I_C_BankStatementLine) ProcessParamLookupValuesProvider(de.metas.ui.web.process.descriptor.ProcessParamLookupValuesProvider)

Example 12 with PaymentId

use of de.metas.payment.PaymentId in project metasfresh-webui-api by metasfresh.

the class PaymentsViewFactory method createView.

@Override
public PaymentsView createView(final CreateViewRequest request) {
    final ViewId viewId = request.getViewId();
    viewId.assertWindowId(WINDOW_ID);
    final Set<PaymentId> paymentIds = PaymentId.fromIntSet(request.getFilterOnlyIds());
    if (paymentIds.isEmpty()) {
        throw new AdempiereException("@NoSelection@");
    }
    final PaymentAndInvoiceRows paymentAndInvoiceRows = rowsRepo.getByPaymentIds(paymentIds);
    return PaymentsView.builder().paymentViewId(viewId).rows(paymentAndInvoiceRows).paymentsProcesses(getPaymentRelatedProcessDescriptors()).invoicesProcesses(getInvoiceRelatedProcessDescriptors()).build();
}
Also used : AdempiereException(org.adempiere.exceptions.AdempiereException) ViewId(de.metas.ui.web.view.ViewId) PaymentId(de.metas.payment.PaymentId)

Aggregations

PaymentId (de.metas.payment.PaymentId)12 ViewId (de.metas.ui.web.view.ViewId)5 AdempiereException (org.adempiere.exceptions.AdempiereException)5 BankStatementLineRow (de.metas.ui.web.bankstatement_reconciliation.BankStatementLineRow)2 PaymentToReconcileRow (de.metas.ui.web.bankstatement_reconciliation.PaymentToReconcileRow)2 Builder (lombok.Builder)2 I_C_BankStatementLine (org.compiere.model.I_C_BankStatementLine)2 I_C_Payment (org.compiere.model.I_C_Payment)2 Test (org.junit.jupiter.api.Test)2 PaySelectionId (de.metas.banking.PaySelectionId)1 Amount (de.metas.currency.Amount)1 CurrencyCode (de.metas.currency.CurrencyCode)1 CurrencyId (de.metas.money.CurrencyId)1 DefaultPaymentBuilder (de.metas.payment.api.DefaultPaymentBuilder)1 I_ESR_ImportLine (de.metas.payment.esr.model.I_ESR_ImportLine)1 ProcessParamLookupValuesProvider (de.metas.ui.web.process.descriptor.ProcessParamLookupValuesProvider)1 FillMandatoryException (org.adempiere.exceptions.FillMandatoryException)1 I_C_BankStatement (org.compiere.model.I_C_BankStatement)1 I_C_PaySelectionLine (org.compiere.model.I_C_PaySelectionLine)1