Populating INVOICE table when creating a CRegistration object

Hello,
 We are using the iBO.NET version 1.0.2964.25045 with iMIS version 10.6.30.07 to register users for events and process their payments. When we use the iBOs a row IS NOT entered into the INVOICE table. But a row IS entered into the INVOICE table when using the iMIS desktop application. I have looked at the CInvoice class, but it does not contain a Save method. Can you tell me what I need to do in order to get the iBOs to populate the INVOICE table. I have included the relevant code below.

Thanks in advance.

CStaffUser StaffUser = CStaffUser.Login(login, password);
CEvent cEvent = new CEvent(StaffUser, "eventcode");
CFunction function = cEvent.Functions[0];

CRegistration registration = new CRegistration(StaffUser, cEvent.EventCode, contact.ContactId, true, true);
registration.RegistrantClass = "RegistrantClass";

CRegistrationLineItem lineItem = registration.NewLineItem(cEvent.Functions[0].FunctionCode, 1, true);
lineItem.UnitPrice = 100.0;

CAddressBasic billingAddress = new CAddressBasic(user);
billingAddress.Address1 = "555 Foo St.";
billingAddress.City = "San Francisco";
billingAddress.StateProvince = "CA";

CPayment payment = registration.Payment;
payment.PaymentType = EnumPaymentType.CreditCard;
payment.CashAccountCode = "AMEX";
payment.CreditCardNumber = "4111111111111111";
payment.CreditCardSecurityCode = "123";
payment.CreditDebitCardHoldersName = "Test User";
payment.CreditCardExpiration = "1009";
payment.Amount = registration.TotalCharges;
if (payment.Validate()) {
 PaymentGatewayResponse paymentGatewayResponse = payment.ProcessPayment(TransactionType.Sale, billingAddress);
}

CBatch batch = new CBatch(user);
batch.BatchNumber = "100";
batch.Description = "Description";
batch.CashGLAccount = "AMEX";
batch.CashAccountCode = "AMEX";

if (batch.Validate()) {
  batch.Save();
}

registration.BatchNumber = batch.BatchNumber;

if (registration.Validate()) {
 registration.Save();
}

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You need to post the batch

For some reason, it behaves differently from iBO as opposed to back office.

You will have to post the batch for it to appear in the invoice table.

Let me know if that works for you.

Nasser