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;
}
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();
}
Aggregations