Search in sources :

Example 1 with InvoiceWithMetadata

use of org.killbill.billing.invoice.generator.InvoiceWithMetadata in project killbill by killbill.

the class TestInvoiceDao method testRefundedInvoiceWithInvoiceItemAdjustmentWithRepair.

@Test(groups = "slow")
public void testRefundedInvoiceWithInvoiceItemAdjustmentWithRepair() throws InvoiceApiException, EntityPersistenceException {
    final UUID accountId = account.getId();
    final UUID subscriptionId = UUID.randomUUID();
    final UUID bundleId = UUID.randomUUID();
    final LocalDate startDate = new LocalDate(2010, 1, 1);
    ((ClockMock) clock).setDay(startDate);
    final LocalDate recuringStartDate = clock.getUTCNow().plusDays(30).toLocalDate();
    final LocalDate recuringEndDate = recuringStartDate.plusMonths(1);
    final LocalDate targetDate = recuringStartDate.plusDays(1);
    // FIRST CREATE INITIAL INVOICE WITH ONE RECURRING ITEM
    final Invoice invoice = new DefaultInvoice(accountId, targetDate, targetDate, Currency.USD);
    final UUID invoiceId = invoice.getId();
    final InvoiceItem invoiceItem = new RecurringInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, "test-plan", "test-phase-rec", recuringStartDate, recuringEndDate, new BigDecimal("239.00"), new BigDecimal("239.00"), Currency.USD);
    invoice.addInvoiceItem(invoiceItem);
    invoiceUtil.createInvoice(invoice, context);
    ((ClockMock) clock).addDays(1);
    // SECOND CREATE THE PAYMENT
    final BigDecimal paymentAmount = new BigDecimal("239.00");
    final UUID paymentId = UUID.randomUUID();
    final DefaultInvoicePayment defaultInvoicePayment = new DefaultInvoicePayment(InvoicePaymentType.ATTEMPT, paymentId, invoiceId, clock.getUTCNow(), paymentAmount, Currency.USD, Currency.USD, "cookie", true);
    invoiceDao.notifyOfPaymentCompletion(new InvoicePaymentModelDao(defaultInvoicePayment), context);
    // AND THEN THIRD THE REFUND
    final Map<UUID, BigDecimal> invoiceItemMap = new HashMap<UUID, BigDecimal>();
    invoiceItemMap.put(invoiceItem.getId(), new BigDecimal("239.00"));
    invoiceDao.createRefund(paymentId, paymentAmount, true, invoiceItemMap, UUID.randomUUID().toString(), context);
    final InvoiceModelDao savedInvoice = invoiceDao.getById(invoiceId, context);
    assertNotNull(savedInvoice);
    assertEquals(savedInvoice.getInvoiceItems().size(), 2);
    final List<Invoice> invoices = new ArrayList<Invoice>();
    invoices.add(new DefaultInvoice(savedInvoice));
    // NOW COMPUTE A DIFFERENT ITEM TO TRIGGER REPAIR
    final BillingEventSet events = new MockBillingEventSet();
    final SubscriptionBase subscription = getZombieSubscription(subscriptionId);
    final Plan plan = Mockito.mock(Plan.class);
    Mockito.when(plan.getName()).thenReturn("plan");
    final PlanPhase phase1 = Mockito.mock(PlanPhase.class);
    Mockito.when(phase1.getName()).thenReturn("plan-phase1");
    final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, recuringStartDate.toDateTimeAtStartOfDay(), plan, phase1, null, TEN, Currency.USD, BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE, "new-event", 1L, SubscriptionBaseTransitionType.CREATE);
    events.add(event1);
    final InvoiceWithMetadata newInvoiceWithMetadata = generator.generateInvoice(account, events, invoices, targetDate, Currency.USD, context);
    final Invoice newInvoice = newInvoiceWithMetadata.getInvoice();
    invoiceUtil.createInvoice(newInvoice, context);
    // VERIFY THAT WE STILL HAVE ONLY 2 ITEMS, MEANING THERE WERE NO REPAIR AND NO CBA GENERATED
    final Invoice firstInvoice = new DefaultInvoice(invoiceDao.getById(invoiceId, context));
    assertNotNull(firstInvoice);
    assertEquals(firstInvoice.getInvoiceItems().size(), 2);
}
Also used : Invoice(org.killbill.billing.invoice.api.Invoice) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) FixedPriceInvoiceItem(org.killbill.billing.invoice.model.FixedPriceInvoiceItem) RecurringInvoiceItem(org.killbill.billing.invoice.model.RecurringInvoiceItem) InvoiceItem(org.killbill.billing.invoice.api.InvoiceItem) ExternalChargeInvoiceItem(org.killbill.billing.invoice.model.ExternalChargeInvoiceItem) CreditAdjInvoiceItem(org.killbill.billing.invoice.model.CreditAdjInvoiceItem) RepairAdjInvoiceItem(org.killbill.billing.invoice.model.RepairAdjInvoiceItem) ParentInvoiceItem(org.killbill.billing.invoice.model.ParentInvoiceItem) ItemAdjInvoiceItem(org.killbill.billing.invoice.model.ItemAdjInvoiceItem) CreditBalanceAdjInvoiceItem(org.killbill.billing.invoice.model.CreditBalanceAdjInvoiceItem) RecurringInvoiceItem(org.killbill.billing.invoice.model.RecurringInvoiceItem) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ClockMock(org.killbill.clock.ClockMock) MockPlan(org.killbill.billing.catalog.MockPlan) Plan(org.killbill.billing.catalog.api.Plan) InvoiceWithMetadata(org.killbill.billing.invoice.generator.InvoiceWithMetadata) LocalDate(org.joda.time.LocalDate) BigDecimal(java.math.BigDecimal) DefaultInvoicePayment(org.killbill.billing.invoice.model.DefaultInvoicePayment) SubscriptionBase(org.killbill.billing.subscription.api.SubscriptionBase) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) BillingEventSet(org.killbill.billing.junction.BillingEventSet) PlanPhase(org.killbill.billing.catalog.api.PlanPhase) MockPlanPhase(org.killbill.billing.catalog.MockPlanPhase) BillingEvent(org.killbill.billing.junction.BillingEvent) UUID(java.util.UUID) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) Test(org.testng.annotations.Test)

Example 2 with InvoiceWithMetadata

use of org.killbill.billing.invoice.generator.InvoiceWithMetadata in project killbill by killbill.

the class TestInvoiceDao method testInvoiceForFreeTrial.

@Test(groups = "slow")
public void testInvoiceForFreeTrial() throws InvoiceApiException, CatalogApiException {
    final Currency currency = Currency.USD;
    final DefaultPrice price = new DefaultPrice(BigDecimal.ZERO, Currency.USD);
    final MockInternationalPrice fixedPrice = new MockInternationalPrice(price);
    final MockPlanPhase phase = new MockPlanPhase(null, fixedPrice);
    final MockPlan plan = new MockPlan(phase);
    final SubscriptionBase subscription = getZombieSubscription();
    final DateTime effectiveDate = invoiceUtil.buildDate(2011, 1, 1).toDateTimeAtStartOfDay();
    final BillingEvent event = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate, plan, phase, fixedPrice.getPrice(currency), null, currency, BillingPeriod.MONTHLY, 15, BillingMode.IN_ADVANCE, "testEvent", 1L, SubscriptionBaseTransitionType.CREATE);
    final BillingEventSet events = new MockBillingEventSet();
    events.add(event);
    final LocalDate targetDate = invoiceUtil.buildDate(2011, 1, 15);
    final InvoiceWithMetadata invoiceWithMetadata = generator.generateInvoice(account, events, null, targetDate, Currency.USD, context);
    final Invoice invoice = invoiceWithMetadata.getInvoice();
    assertNotNull(invoice);
}
Also used : Invoice(org.killbill.billing.invoice.api.Invoice) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) InvoiceWithMetadata(org.killbill.billing.invoice.generator.InvoiceWithMetadata) LocalDate(org.joda.time.LocalDate) MockInternationalPrice(org.killbill.billing.catalog.MockInternationalPrice) DateTime(org.joda.time.DateTime) SubscriptionBase(org.killbill.billing.subscription.api.SubscriptionBase) MockPlan(org.killbill.billing.catalog.MockPlan) MockPlanPhase(org.killbill.billing.catalog.MockPlanPhase) Currency(org.killbill.billing.catalog.api.Currency) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) BillingEventSet(org.killbill.billing.junction.BillingEventSet) BillingEvent(org.killbill.billing.junction.BillingEvent) DefaultPrice(org.killbill.billing.catalog.DefaultPrice) Test(org.testng.annotations.Test)

Example 3 with InvoiceWithMetadata

use of org.killbill.billing.invoice.generator.InvoiceWithMetadata in project killbill by killbill.

the class InvoiceDispatcher method processAccountWithLockAndInputTargetDate.

private Invoice processAccountWithLockAndInputTargetDate(final UUID accountId, final LocalDate targetDate, final BillingEventSet billingEvents, final boolean isDryRun, final InternalCallContext context) throws InvoiceApiException {
    try {
        final ImmutableAccountData account = accountApi.getImmutableAccountDataById(accountId, context);
        final List<Invoice> invoices = billingEvents.isAccountAutoInvoiceOff() ? ImmutableList.<Invoice>of() : ImmutableList.<Invoice>copyOf(Collections2.transform(invoiceDao.getInvoicesByAccount(context), new Function<InvoiceModelDao, Invoice>() {

            @Override
            public Invoice apply(final InvoiceModelDao input) {
                return new DefaultInvoice(input);
            }
        }));
        final Currency targetCurrency = account.getCurrency();
        final InvoiceWithMetadata invoiceWithMetadata = generator.generateInvoice(account, billingEvents, invoices, targetDate, targetCurrency, context);
        final DefaultInvoice invoice = invoiceWithMetadata.getInvoice();
        // Compute future notifications
        final FutureAccountNotifications futureAccountNotifications = createNextFutureNotificationDate(invoiceWithMetadata, context);
        //
        if (invoice == null) {
            if (isDryRun) {
                log.info("Generated null dryRun invoice for accountId='{}', targetDate='{}'", accountId, targetDate);
            } else {
                log.info("Generated null invoice for accountId='{}', targetDate='{}'", accountId, targetDate);
                final BusInternalEvent event = new DefaultNullInvoiceEvent(accountId, clock.getUTCToday(), context.getAccountRecordId(), context.getTenantRecordId(), context.getUserToken());
                commitInvoiceAndSetFutureNotifications(account, null, futureAccountNotifications, context);
                postEvent(event);
            }
            return null;
        }
        // Generate missing credit (> 0 for generation and < 0 for use) prior we call the plugin
        final InvoiceItem cbaItemPreInvoicePlugins = computeCBAOnExistingInvoice(invoice, context);
        DefaultInvoice tmpInvoiceForInvoicePlugins = invoice;
        if (cbaItemPreInvoicePlugins != null) {
            tmpInvoiceForInvoicePlugins = (DefaultInvoice) tmpInvoiceForInvoicePlugins.clone();
            tmpInvoiceForInvoicePlugins.addInvoiceItem(cbaItemPreInvoicePlugins);
        }
        //
        // Ask external invoice plugins if additional items (tax, etc) shall be added to the invoice
        //
        final CallContext callContext = buildCallContext(context);
        final List<InvoiceItem> additionalInvoiceItemsFromPlugins = invoicePluginDispatcher.getAdditionalInvoiceItems(tmpInvoiceForInvoicePlugins, isDryRun, callContext);
        if (additionalInvoiceItemsFromPlugins.isEmpty()) {
            // PERF: avoid re-computing the CBA if no change was made
            if (cbaItemPreInvoicePlugins != null) {
                invoice.addInvoiceItem(cbaItemPreInvoicePlugins);
            }
        } else {
            invoice.addInvoiceItems(additionalInvoiceItemsFromPlugins);
            // Use credit after we call the plugin (https://github.com/killbill/killbill/issues/637)
            final InvoiceItem cbaItemPostInvoicePlugins = computeCBAOnExistingInvoice(invoice, context);
            if (cbaItemPostInvoicePlugins != null) {
                invoice.addInvoiceItem(cbaItemPostInvoicePlugins);
            }
        }
        if (!isDryRun) {
            // Compute whether this is a new invoice object (or just some adjustments on an existing invoice), and extract invoiceIds for later use
            final Set<UUID> uniqueInvoiceIds = getUniqueInvoiceIds(invoice);
            final boolean isRealInvoiceWithItems = uniqueInvoiceIds.remove(invoice.getId());
            final Set<UUID> adjustedUniqueOtherInvoiceId = uniqueInvoiceIds;
            logInvoiceWithItems(account, invoice, targetDate, adjustedUniqueOtherInvoiceId, isRealInvoiceWithItems);
            // Transformation to Invoice -> InvoiceModelDao
            final InvoiceModelDao invoiceModelDao = new InvoiceModelDao(invoice);
            final List<InvoiceItemModelDao> invoiceItemModelDaos = transformToInvoiceModelDao(invoice.getInvoiceItems());
            invoiceModelDao.addInvoiceItems(invoiceItemModelDaos);
            // Commit invoice on disk
            final boolean isThereAnyItemsLeft = commitInvoiceAndSetFutureNotifications(account, invoiceModelDao, futureAccountNotifications, context);
            final boolean isRealInvoiceWithNonEmptyItems = isThereAnyItemsLeft ? isRealInvoiceWithItems : false;
            setChargedThroughDates(invoice.getInvoiceItems(FixedPriceInvoiceItem.class), invoice.getInvoiceItems(RecurringInvoiceItem.class), context);
            if (InvoiceStatus.COMMITTED.equals(invoice.getStatus())) {
                notifyAccountIfEnabled(account, invoice, isRealInvoiceWithNonEmptyItems, context);
            }
        }
        return invoice;
    } catch (final AccountApiException e) {
        log.error("Failed handling SubscriptionBase change.", e);
        return null;
    } catch (final SubscriptionBaseApiException e) {
        log.error("Failed handling SubscriptionBase change.", e);
        return null;
    }
}
Also used : ImmutableAccountData(org.killbill.billing.account.api.ImmutableAccountData) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) Invoice(org.killbill.billing.invoice.api.Invoice) RecurringInvoiceItem(org.killbill.billing.invoice.model.RecurringInvoiceItem) InvoiceItem(org.killbill.billing.invoice.api.InvoiceItem) ItemAdjInvoiceItem(org.killbill.billing.invoice.model.ItemAdjInvoiceItem) FixedPriceInvoiceItem(org.killbill.billing.invoice.model.FixedPriceInvoiceItem) ParentInvoiceItem(org.killbill.billing.invoice.model.ParentInvoiceItem) RecurringInvoiceItem(org.killbill.billing.invoice.model.RecurringInvoiceItem) InvoiceModelDao(org.killbill.billing.invoice.dao.InvoiceModelDao) FixedPriceInvoiceItem(org.killbill.billing.invoice.model.FixedPriceInvoiceItem) BusInternalEvent(org.killbill.billing.events.BusInternalEvent) InvoiceWithMetadata(org.killbill.billing.invoice.generator.InvoiceWithMetadata) CallContext(org.killbill.billing.util.callcontext.CallContext) InternalCallContext(org.killbill.billing.callcontext.InternalCallContext) DefaultNullInvoiceEvent(org.killbill.billing.invoice.api.user.DefaultNullInvoiceEvent) InvoiceItemModelDao(org.killbill.billing.invoice.dao.InvoiceItemModelDao) Currency(org.killbill.billing.catalog.api.Currency) AccountApiException(org.killbill.billing.account.api.AccountApiException) UUID(java.util.UUID) PlanPhasePriceOverride(org.killbill.billing.catalog.api.PlanPhasePriceOverride) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) SubscriptionBaseApiException(org.killbill.billing.subscription.api.user.SubscriptionBaseApiException)

Example 4 with InvoiceWithMetadata

use of org.killbill.billing.invoice.generator.InvoiceWithMetadata in project killbill by killbill.

the class TestInvoiceDao method testInvoiceGenerationForImmediateChanges.

/*
     *
     * this test verifies that immediate changes give the correct results
     *
     */
@Test(groups = "slow")
public void testInvoiceGenerationForImmediateChanges() throws InvoiceApiException, CatalogApiException, EntityPersistenceException {
    final UUID accountId = account.getId();
    final List<Invoice> invoiceList = new ArrayList<Invoice>();
    final LocalDate targetDate = new LocalDate(2011, 2, 16);
    final Currency currency = Currency.USD;
    // generate first invoice
    final DefaultPrice price1 = new DefaultPrice(TEN, Currency.USD);
    final MockInternationalPrice recurringPrice = new MockInternationalPrice(price1);
    final MockPlanPhase phase1 = new MockPlanPhase(recurringPrice, null, BillingPeriod.MONTHLY, PhaseType.TRIAL);
    final MockPlan plan1 = new MockPlan(phase1);
    final SubscriptionBase subscription = getZombieSubscription();
    final DateTime effectiveDate1 = new DateTime(2011, 2, 1, 0, 0, 0);
    final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate1, plan1, phase1, null, recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE, "testEvent1", 1L, SubscriptionBaseTransitionType.CREATE);
    final BillingEventSet events = new MockBillingEventSet();
    events.add(event1);
    final InvoiceWithMetadata invoiceWithMetadata1 = generator.generateInvoice(account, events, invoiceList, targetDate, Currency.USD, context);
    final Invoice invoice1 = invoiceWithMetadata1.getInvoice();
    assertEquals(invoice1.getBalance(), KillBillMoney.of(TEN, invoice1.getCurrency()));
    invoiceList.add(invoice1);
    // generate second invoice
    final DefaultPrice price2 = new DefaultPrice(TWENTY, Currency.USD);
    final MockInternationalPrice recurringPrice2 = new MockInternationalPrice(price2);
    final MockPlanPhase phase2 = new MockPlanPhase(recurringPrice, null, BillingPeriod.MONTHLY, PhaseType.TRIAL);
    final MockPlan plan2 = new MockPlan(phase2);
    final DateTime effectiveDate2 = new DateTime(2011, 2, 15, 0, 0, 0);
    final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate2, plan2, phase2, null, recurringPrice2.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE, "testEvent2", 2L, SubscriptionBaseTransitionType.CREATE);
    events.add(event2);
    // second invoice should be for one half (14/28 days) the difference between the rate plans
    // this is a temporary state, since it actually contains an adjusting item that properly belong to invoice 1
    final InvoiceWithMetadata invoiceWithMetadata2 = generator.generateInvoice(account, events, invoiceList, targetDate, Currency.USD, context);
    final Invoice invoice2 = invoiceWithMetadata2.getInvoice();
    assertEquals(invoice2.getBalance(), KillBillMoney.of(FIVE, invoice2.getCurrency()));
    invoiceList.add(invoice2);
    invoiceUtil.createInvoice(invoice1, context);
    invoiceUtil.createInvoice(invoice2, context);
    final InvoiceModelDao savedInvoice1 = invoiceDao.getById(invoice1.getId(), context);
    assertEquals(InvoiceModelDaoHelper.getBalance(savedInvoice1), KillBillMoney.of(TEN, savedInvoice1.getCurrency()));
    final InvoiceModelDao savedInvoice2 = invoiceDao.getById(invoice2.getId(), context);
    assertEquals(InvoiceModelDaoHelper.getBalance(savedInvoice2), KillBillMoney.of(FIVE, savedInvoice2.getCurrency()));
}
Also used : Invoice(org.killbill.billing.invoice.api.Invoice) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) ArrayList(java.util.ArrayList) InvoiceWithMetadata(org.killbill.billing.invoice.generator.InvoiceWithMetadata) LocalDate(org.joda.time.LocalDate) MockInternationalPrice(org.killbill.billing.catalog.MockInternationalPrice) DateTime(org.joda.time.DateTime) SubscriptionBase(org.killbill.billing.subscription.api.SubscriptionBase) MockPlan(org.killbill.billing.catalog.MockPlan) MockPlanPhase(org.killbill.billing.catalog.MockPlanPhase) Currency(org.killbill.billing.catalog.api.Currency) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) BillingEventSet(org.killbill.billing.junction.BillingEventSet) BillingEvent(org.killbill.billing.junction.BillingEvent) UUID(java.util.UUID) DefaultPrice(org.killbill.billing.catalog.DefaultPrice) Test(org.testng.annotations.Test)

Example 5 with InvoiceWithMetadata

use of org.killbill.billing.invoice.generator.InvoiceWithMetadata in project killbill by killbill.

the class TestInvoiceDao method testInvoiceNumber.

@Test(groups = "slow")
public void testInvoiceNumber() throws InvoiceApiException, EntityPersistenceException {
    final Currency currency = Currency.USD;
    final DateTime targetDate1 = clock.getUTCNow().plusMonths(1);
    final DateTime targetDate2 = clock.getUTCNow().plusMonths(2);
    final SubscriptionBase subscription = getZombieSubscription();
    final Plan plan = Mockito.mock(Plan.class);
    Mockito.when(plan.getName()).thenReturn("plan");
    final PlanPhase phase1 = Mockito.mock(PlanPhase.class);
    Mockito.when(phase1.getName()).thenReturn("plan-phase1");
    final PlanPhase phase2 = Mockito.mock(PlanPhase.class);
    Mockito.when(phase2.getName()).thenReturn("plan-phase2");
    final BillingEventSet events = new MockBillingEventSet();
    final List<Invoice> invoices = new ArrayList<Invoice>();
    final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, targetDate1, plan, phase1, null, TEN, currency, BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE, "testEvent1", 1L, SubscriptionBaseTransitionType.CHANGE);
    events.add(event1);
    InvoiceWithMetadata invoiceWithMetadata1 = generator.generateInvoice(account, events, invoices, new LocalDate(targetDate1), Currency.USD, context);
    Invoice invoice1 = invoiceWithMetadata1.getInvoice();
    invoices.add(invoice1);
    invoiceUtil.createInvoice(invoice1, context);
    invoice1 = new DefaultInvoice(invoiceDao.getById(invoice1.getId(), context));
    assertNotNull(invoice1.getInvoiceNumber());
    final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, targetDate1, plan, phase2, null, TWENTY, currency, BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE, "testEvent2", 2L, SubscriptionBaseTransitionType.CHANGE);
    events.add(event2);
    InvoiceWithMetadata invoiceWithMetadata2 = generator.generateInvoice(account, events, invoices, new LocalDate(targetDate2), Currency.USD, context);
    Invoice invoice2 = invoiceWithMetadata2.getInvoice();
    invoiceUtil.createInvoice(invoice2, context);
    invoice2 = new DefaultInvoice(invoiceDao.getById(invoice2.getId(), context));
    assertNotNull(invoice2.getInvoiceNumber());
}
Also used : Invoice(org.killbill.billing.invoice.api.Invoice) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) ArrayList(java.util.ArrayList) MockPlan(org.killbill.billing.catalog.MockPlan) Plan(org.killbill.billing.catalog.api.Plan) InvoiceWithMetadata(org.killbill.billing.invoice.generator.InvoiceWithMetadata) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) SubscriptionBase(org.killbill.billing.subscription.api.SubscriptionBase) Currency(org.killbill.billing.catalog.api.Currency) MockBillingEventSet(org.killbill.billing.invoice.MockBillingEventSet) BillingEventSet(org.killbill.billing.junction.BillingEventSet) PlanPhase(org.killbill.billing.catalog.api.PlanPhase) MockPlanPhase(org.killbill.billing.catalog.MockPlanPhase) BillingEvent(org.killbill.billing.junction.BillingEvent) DefaultInvoice(org.killbill.billing.invoice.model.DefaultInvoice) Test(org.testng.annotations.Test)

Aggregations

Invoice (org.killbill.billing.invoice.api.Invoice)8 InvoiceWithMetadata (org.killbill.billing.invoice.generator.InvoiceWithMetadata)8 DefaultInvoice (org.killbill.billing.invoice.model.DefaultInvoice)8 LocalDate (org.joda.time.LocalDate)7 MockBillingEventSet (org.killbill.billing.invoice.MockBillingEventSet)7 BillingEventSet (org.killbill.billing.junction.BillingEventSet)7 Test (org.testng.annotations.Test)7 MockPlan (org.killbill.billing.catalog.MockPlan)6 MockPlanPhase (org.killbill.billing.catalog.MockPlanPhase)6 Currency (org.killbill.billing.catalog.api.Currency)6 BillingEvent (org.killbill.billing.junction.BillingEvent)6 SubscriptionBase (org.killbill.billing.subscription.api.SubscriptionBase)6 DateTime (org.joda.time.DateTime)5 ArrayList (java.util.ArrayList)4 UUID (java.util.UUID)4 DefaultPrice (org.killbill.billing.catalog.DefaultPrice)4 MockInternationalPrice (org.killbill.billing.catalog.MockInternationalPrice)4 BigDecimal (java.math.BigDecimal)3 Plan (org.killbill.billing.catalog.api.Plan)2 PlanPhase (org.killbill.billing.catalog.api.PlanPhase)2