Tabnine Logo
InvoiceItemFactory
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.ning.billing/killbill-invoice

  @Override
  public InvoiceItem apply(final InvoiceItemModelDao input) {
    return InvoiceItemFactory.fromModelDao(input);
  }
}));
origin: com.ning.billing/killbill-invoice

  @Override
  public InvoiceItem apply(final InvoiceItemModelDao input) {
    return InvoiceItemFactory.fromModelDao(input);
  }
}));
origin: com.ning.billing/killbill-invoice

  @Override
  public InvoiceItem apply(final InvoiceItemModelDao input) {
    return InvoiceItemFactory.fromModelDao(input);
  }
}),
origin: com.ning.billing/killbill-invoice

@Override
public InvoiceItem insertExternalChargeForInvoiceAndBundle(final UUID accountId, @Nullable final UUID invoiceId, @Nullable final UUID bundleId,
                              final BigDecimal amount, @Nullable final String description, final LocalDate effectiveDate,
                              final Currency currency, final CallContext context) throws InvoiceApiException {
  if (amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
    throw new InvoiceApiException(ErrorCode.EXTERNAL_CHARGE_AMOUNT_INVALID, amount);
  }
  final InvoiceItemModelDao externalCharge = dao.insertExternalCharge(accountId, invoiceId, bundleId, description, amount, effectiveDate, currency, internalCallContextFactory.createInternalCallContext(accountId, context));
  return InvoiceItemFactory.fromModelDao(externalCharge);
}
origin: com.ning.billing/killbill-invoice

@Override
public InvoiceItem insertInvoiceItemAdjustment(final UUID accountId, final UUID invoiceId, final UUID invoiceItemId,
                        final LocalDate effectiveDate, @Nullable final BigDecimal amount,
                        @Nullable final Currency currency, final CallContext context) throws InvoiceApiException {
  if (amount != null && amount.compareTo(BigDecimal.ZERO) <= 0) {
    throw new InvoiceApiException(ErrorCode.INVOICE_ITEM_ADJUSTMENT_AMOUNT_SHOULD_BE_POSITIVE, amount);
  }
  final InvoiceItemModelDao adjustment = dao.insertInvoiceItemAdjustment(accountId, invoiceId, invoiceItemId, effectiveDate, amount, currency, internalCallContextFactory.createInternalCallContext(accountId, context));
  return InvoiceItemFactory.fromModelDao(adjustment);
}
origin: com.ning.billing/killbill-invoice

@Override
public InvoiceItem insertCreditForInvoice(final UUID accountId, final UUID invoiceId, final BigDecimal amount,
                     final LocalDate effectiveDate, final Currency currency, final CallContext context) throws InvoiceApiException {
  if (amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
    throw new InvoiceApiException(ErrorCode.CREDIT_AMOUNT_INVALID, amount);
  }
  final InvoiceItemModelDao credit = dao.insertCredit(accountId, invoiceId, amount, effectiveDate, currency, internalCallContextFactory.createInternalCallContext(accountId, context));
  return InvoiceItemFactory.fromModelDao(credit);
}
origin: com.ning.billing/killbill-invoice

  private void assertSameInvoiceItem(final InvoiceItem initialItem, final InvoiceItemModelDao fromDao) {
    final InvoiceItem newItem = InvoiceItemFactory.fromModelDao(fromDao);
    Assert.assertEquals(newItem.getId(), initialItem.getId());
    Assert.assertTrue(newItem.matches(initialItem));

  }
}
origin: com.ning.billing/killbill-invoice

@Override
public InvoiceItem getCreditById(final UUID creditId, final TenantContext context) throws InvoiceApiException {
  final InvoiceItem creditItem = InvoiceItemFactory.fromModelDao(dao.getCreditById(creditId, internalCallContextFactory.createInternalTenantContext(creditId, ObjectType.INVOICE_ITEM, context)));
  if (creditItem == null) {
    throw new InvoiceApiException(ErrorCode.INVOICE_NO_SUCH_CREDIT, creditId);
  }
  return new CreditAdjInvoiceItem(creditItem.getId(), creditItem.getCreatedDate(), creditItem.getInvoiceId(), creditItem.getAccountId(),
                  creditItem.getStartDate(), creditItem.getAmount().negate(), creditItem.getCurrency());
}
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());
}
com.ning.billing.invoice.modelInvoiceItemFactory

Most used methods

  • fromModelDao

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • findViewById (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now