use of org.compiere.model.I_C_Payment in project metasfresh-webui-api by metasfresh.
the class ReconcilePaymentsCommandTest method createPaymentRow.
@Builder(builderMethodName = "paymentRow", builderClassName = "PaymentRowBuilder")
private PaymentToReconcileRow createPaymentRow(@NonNull final Boolean inboundPayment, @NonNull final BPartnerId customerId, @NonNull final Money paymentAmt, final boolean reconciled) {
final DefaultPaymentBuilder builder = inboundPayment ? paymentBL.newInboundReceiptBuilder() : paymentBL.newOutboundPaymentBuilder();
final I_C_Payment payment = builder.adOrgId(OrgId.ANY).bpartnerId(customerId).orgBankAccountId(euroOrgBankAccountId).currencyId(paymentAmt.getCurrencyId()).payAmt(paymentAmt.toBigDecimal()).dateAcct(paymentDate).dateTrx(paymentDate).tenderType(TenderType.Check).createAndProcess();
payment.setDocumentNo("documentNo-" + payment.getC_Payment_ID());
paymentDAO.save(payment);
if (reconciled) {
paymentBL.markReconciledAndSave(payment);
}
final PaymentId paymentId = PaymentId.ofRepoId(payment.getC_Payment_ID());
return rowsRepo.getPaymentToReconcileRowsByIds(ImmutableSet.of(paymentId)).get(0);
}
use of org.compiere.model.I_C_Payment in project metasfresh-webui-api by metasfresh.
the class PaymentsViewAllocateCommandTest method createPaymentRow.
@Builder(builderMethodName = "paymentRow", builderClassName = "PaymentRowBuilder")
private PaymentRow createPaymentRow(@NonNull final PaymentDirection direction, @NonNull final Amount payAmt) {
final I_C_Payment paymentRecord = newInstance(I_C_Payment.class);
saveRecord(paymentRecord);
final PaymentId paymentId = PaymentId.ofRepoId(paymentRecord.getC_Payment_ID());
return PaymentRow.builder().paymentId(paymentId).clientAndOrgId(ClientAndOrgId.ofClientAndOrg(ClientId.METASFRESH, orgId)).documentNo("paymentNo_" + paymentId.getRepoId()).dateTrx(LocalDate.of(2020, Month.APRIL, 25)).bpartner(IntegerLookupValue.of(bpartnerId.getRepoId(), "BPartner")).payAmt(payAmt).openAmt(payAmt).paymentDirection(direction).build();
}
Aggregations