@Override protected Result onCompleteProcess(Context context) { List<ClientTransactionItem> items = get(ITEMS).getValue(); List<ClientTransactionItem> accounts = get(ACCOUNTS).getValue(); if (items.isEmpty() && accounts.isEmpty()) { return new Result(); } Vendor supplier = get(VENDOR).getValue(); creditCardCharge.setVendor(supplier.getID()); Contact contact = get(CONTACT).getValue(); creditCardCharge.setContact(toClientContact(contact)); ClientFinanceDate date = get(DATE).getValue(); creditCardCharge.setDate(date.getDate()); creditCardCharge.setType(ClientTransaction.TYPE_CREDIT_CARD_CHARGE); String number = get(NUMBER).getValue(); creditCardCharge.setNumber(number); String paymentMethod = get(PAYMENT_METHOD).getValue(); creditCardCharge.setPaymentMethod(paymentMethod); String phone = get(PHONE).getValue(); creditCardCharge.setPhone(phone); Account account = get(PAY_FROM).getValue(); creditCardCharge.setPayFrom(account.getID()); ClientFinanceDate deliveryDate = get(DELIVERY_DATE).getValue(); creditCardCharge.setDeliveryDate(deliveryDate); items.addAll(accounts); creditCardCharge.setTransactionItems(items); ClientCompanyPreferences preferences = context.getPreferences(); if (preferences.isTrackTax() && !preferences.isTaxPerDetailLine()) { TAXCode taxCode = get(TAXCODE).getValue(); for (ClientTransactionItem item : items) { item.setTaxCode(taxCode.getID()); } } creditCardCharge.setCurrency(supplier.getCurrency().getID()); creditCardCharge.setCurrencyFactor((Double) get(CURRENCY_FACTOR).getValue()); String memo = get(MEMO).getValue(); creditCardCharge.setMemo(memo); updateTotals(context, creditCardCharge, false); create(creditCardCharge, context); return null; }