Codota Logo
ExternalChargeInvoiceItem
Code IndexAdd Codota to your IDE (free)

How to use
ExternalChargeInvoiceItem
in
com.ning.billing.invoice.model

Best Java code snippets using com.ning.billing.invoice.model.ExternalChargeInvoiceItem (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: com.ning.billing/killbill-invoice

@Override
public String getDescription() {
  if (getPlanName() == null) {
    return "External charge";
  } else {
    return String.format("%s (external charge)", getPlanName());
  }
}
origin: com.ning.billing/killbill-invoice

final BigDecimal amount = BigDecimal.TEN;
final Currency currency = Currency.GBP;
final ExternalChargeInvoiceItem item = new ExternalChargeInvoiceItem(id, invoiceId, accountId, bundleId, description,
                                   effectiveDate, amount, currency);
Assert.assertEquals(item.getAccountId(), accountId);
Assert.assertEquals(item.getAmount(), amount);
Assert.assertEquals(item.getBundleId(), bundleId);
Assert.assertEquals(item.getCurrency(), currency);
Assert.assertEquals(item.getInvoiceItemType(), InvoiceItemType.EXTERNAL_CHARGE);
Assert.assertEquals(item.getPlanName(), description);
Assert.assertNull(item.getEndDate());
Assert.assertNull(item.getLinkedItemId());
Assert.assertNull(item.getPhaseName());
Assert.assertNull(item.getRate());
Assert.assertNull(item.getSubscriptionId());
final ExternalChargeInvoiceItem otherItem = new ExternalChargeInvoiceItem(id, invoiceId, UUID.randomUUID(), bundleId,
                                     description, effectiveDate, amount, currency);
Assert.assertNotEquals(otherItem, item);
final ExternalChargeInvoiceItem itemBefore = new ExternalChargeInvoiceItem(id, invoiceId, accountId, bundleId, description,
                                      effectiveDate.minusDays(1), amount, currency);
Assert.assertFalse(itemBefore.matches(item));
final ExternalChargeInvoiceItem itemAfter = new ExternalChargeInvoiceItem(id, invoiceId, accountId, bundleId, description,
                                     effectiveDate.plusDays(1), amount, currency);
Assert.assertFalse(itemAfter.matches(item));
origin: com.ning.billing/killbill-invoice

@Test(groups = "slow")
public void testExternalChargeInvoiceSqlDao() throws Exception {
  final UUID invoiceId = UUID.randomUUID();
  final UUID accountId = account.getId();
  final UUID bundleId = UUID.randomUUID();
  final String description = UUID.randomUUID().toString();
  final LocalDate startDate = new LocalDate(2012, 4, 1);
  final InvoiceItem externalChargeInvoiceItem = new ExternalChargeInvoiceItem(invoiceId, accountId, bundleId, description,
                                        startDate, TEN, Currency.USD);
  invoiceUtil.createInvoiceItem(externalChargeInvoiceItem, context);
  final InvoiceItemModelDao savedItem = invoiceUtil.getInvoiceItemById(externalChargeInvoiceItem.getId(), context);
  assertSameInvoiceItem(externalChargeInvoiceItem, savedItem);
}
origin: com.ning.billing/killbill-invoice

@Override
public InvoiceItem getExternalChargeById(final UUID externalChargeId, final TenantContext context) throws InvoiceApiException {
  final InvoiceItem externalChargeItem = InvoiceItemFactory.fromModelDao(dao.getExternalChargeById(externalChargeId, internalCallContextFactory.createInternalTenantContext(externalChargeId, ObjectType.INVOICE_ITEM, context)));
  if (externalChargeItem == null) {
    throw new InvoiceApiException(ErrorCode.INVOICE_NO_SUCH_EXTERNAL_CHARGE, externalChargeId);
  }
  return new ExternalChargeInvoiceItem(externalChargeItem.getId(), externalChargeItem.getInvoiceId(), externalChargeItem.getAccountId(),
                     externalChargeItem.getPlanName(), externalChargeItem.getStartDate(),
                     externalChargeItem.getAmount(), externalChargeItem.getCurrency());
}
origin: com.ning.billing/killbill-invoice

switch (type) {
  case EXTERNAL_CHARGE:
    item = new ExternalChargeInvoiceItem(id, createdDate, invoiceId, accountId, bundleId, planName, startDate, amount, currency);
    break;
  case FIXED:
com.ning.billing.invoice.modelExternalChargeInvoiceItem

Most used methods

  • <init>
  • getPlanName
  • getAccountId
  • getAmount
  • getBundleId
  • getCurrency
  • getEndDate
  • getInvoiceItemType
  • getLinkedItemId
  • getPhaseName
  • getRate
  • getSubscriptionId
  • getRate,
  • getSubscriptionId,
  • matches

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now