Search in sources :

Example 1 with I_C_PaySelectionLine

use of org.compiere.model.I_C_PaySelectionLine in project metasfresh-webui-api by metasfresh.

the class ReconcilePaymentsCommandTest method createPaySelectionLine.

private I_C_PaySelectionLine createPaySelectionLine(@NonNull final PaySelectionId paySelectionId, @NonNull final PaymentId paymentId) {
    final I_C_PaySelectionLine paySelectionLine = newInstance(I_C_PaySelectionLine.class);
    paySelectionLine.setC_PaySelection_ID(paySelectionId.getRepoId());
    paySelectionLine.setC_Payment_ID(paymentId.getRepoId());
    saveRecord(paySelectionLine);
    return paySelectionLine;
}
Also used : I_C_PaySelectionLine(org.compiere.model.I_C_PaySelectionLine)

Example 2 with I_C_PaySelectionLine

use of org.compiere.model.I_C_PaySelectionLine in project metasfresh-webui-api by metasfresh.

the class ReconcilePaymentsCommandTest method bankStatementLineIsLinkedToPaySelection.

@Test
public void bankStatementLineIsLinkedToPaySelection() {
    final BankStatementLineRow bankStatementLineRow = bankStatementLineRow().docStatus(DocStatus.Drafted).statementAmt(euro("1000")).build();
    final PaymentToReconcileRow paymentRow = paymentRow().inboundPayment(true).customerId(customerId).paymentAmt(euro("1000")).build();
    final PaymentId paymentId = paymentRow.getPaymentId();
    final PaySelectionId paySelectionId = createPaySelection();
    final I_C_PaySelectionLine paySelectionLine = createPaySelectionLine(paySelectionId, paymentId);
    assertThat(paySelectionLine.getC_Payment_ID()).isEqualTo(paymentId.getRepoId());
    assertThat(paySelectionLine.getC_BankStatement_ID()).isLessThanOrEqualTo(0);
    assertThat(paySelectionLine.getC_BankStatementLine_ID()).isLessThanOrEqualTo(0);
    assertThat(paySelectionLine.getC_BankStatementLine_Ref_ID()).isLessThanOrEqualTo(0);
    assertReconciled(paySelectionId).isFalse();
    executeReconcilePaymentsCommand(ReconcilePaymentsRequest.builder().selectedBankStatementLine(bankStatementLineRow).selectedPaymentToReconcile(paymentRow).build());
    InterfaceWrapperHelper.refresh(paySelectionLine);
    assertThat(paySelectionLine.getC_BankStatement_ID()).isGreaterThan(0);
    assertThat(paySelectionLine.getC_BankStatementLine_ID()).isEqualTo(bankStatementLineRow.getBankStatementLineId().getRepoId());
    assertThat(paySelectionLine.getC_BankStatementLine_Ref_ID()).isGreaterThan(0);
    assertReconciled(paySelectionId).isTrue();
}
Also used : PaymentId(de.metas.payment.PaymentId) PaySelectionId(de.metas.banking.PaySelectionId) BankStatementLineRow(de.metas.ui.web.bankstatement_reconciliation.BankStatementLineRow) PaymentToReconcileRow(de.metas.ui.web.bankstatement_reconciliation.PaymentToReconcileRow) I_C_PaySelectionLine(org.compiere.model.I_C_PaySelectionLine) Test(org.junit.jupiter.api.Test)

Aggregations

I_C_PaySelectionLine (org.compiere.model.I_C_PaySelectionLine)2 PaySelectionId (de.metas.banking.PaySelectionId)1 PaymentId (de.metas.payment.PaymentId)1 BankStatementLineRow (de.metas.ui.web.bankstatement_reconciliation.BankStatementLineRow)1 PaymentToReconcileRow (de.metas.ui.web.bankstatement_reconciliation.PaymentToReconcileRow)1 Test (org.junit.jupiter.api.Test)1