atg.commerce.order
Class InvoiceRequest

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.commerce.order.PaymentGroupImpl
          extended by atg.commerce.order.InvoiceRequest
All Implemented Interfaces:
ChangedProperties, CommerceIdentifier, CommerceItemRelationshipContainer, OrderRelationshipContainer, PaymentAddressContainer, PaymentGroup, ShippingGroupRelationshipContainer, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
InvoiceRequest

public class InvoiceRequest
extends PaymentGroupImpl
implements PaymentAddressContainer

This payment method represents the information needed to produce an invoice for use in billing a customer for all or part of an order. The required information includes the purchase order number and the billing address to which the invoice should be sent.

Applications can also specify the preferred format for the invoice (text, html, etc), and the preferred delivery mode (email, fax, postal delivery, etc). It is up to the application to decide whether these properties are required or optional, and how to react in cases where the values are unspecified or the requested values are not supported by that particular application.

Applications can also specify optional payment terms for the invoice. Payment terms are traditionally specified as net days (payment due in full with no discount), discount days (discount offered if invoice paid within this many days), and discount percent (percentage discount for paying within "discount days").

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
protected  Address mBillingAddress
           
 
Constructor Summary
InvoiceRequest()
          Default constructor
 
Method Summary
 Address getBillingAddress()
          Returns the billing address to use for this invoice.
 java.lang.Integer getPaymentDiscountDays()
          Get the "discount days" component of this invoice's payment terms.
 java.lang.Double getPaymentDiscountPercent()
          Get the "discount percentage" component of this invoice's payment terms.
 java.util.Date getPaymentDueDate()
          Get the date on which payment is nominally due.
 java.lang.Integer getPaymentNetDays()
          Get the "net days" component of this invoice's payment terms.
 java.lang.String getPONumber()
          Return the purchase order number for this invoice, obtained by looking at the PONumber property of the underlying repository item.
 java.lang.String getPreferredDeliveryMode()
          Get the preferred delivery mode (email, postal mail, fax, etc) for this invoice.
 java.lang.String getPreferredFormat()
          Get the preferred delivery format (text, HTML, XML DTD specification, etc.
 void setBillingAddress(Address pBillingAddress)
           
 void setPaymentDiscountDays(java.lang.Integer pPaymentDiscountDays)
          Set the "discount days" component of this invoice's payment terms.
 void setPaymentDiscountPercent(java.lang.Double pPaymentDiscountPercent)
          Set the "discount percentage" component of this invoice's payment terms.
 void setPaymentDueDate(java.util.Date pPaymentDueDate)
          Set the date on which payment is nominally due.
 void setPaymentNetDays(java.lang.Integer pPaymentNetDays)
          Set the "net days" component of this invoice's payment terms.
 void setPONumber(java.lang.String pPONumber)
          Set the purchase order number for this invoice.
 void setPreferredDeliveryMode(java.lang.String pPreferredDeliveryMode)
          Set the preferred delivery mode (email, postal mail, fax, etc) for this invoice.
 void setPreferredFormat(java.lang.String pPreferredFormat)
          Set the preferred delivery format (text, HTML, XML DTD specification, etc.) for this invoice.
 
Methods inherited from class atg.commerce.order.PaymentGroupImpl
addAuthorizationStatus, addChangedProperty, addCommerceItemRelationship, addCommerceItemRelationship, addCreditStatus, addDebitStatus, addOrderRelationship, addShippingGroupRelationship, addShippingGroupRelationship, clearChangedProperties, getAmount, getAmountAuthorized, getAmountCredited, getAmountDebited, getAuthorizationStatus, getChangedProperties, getCommerceItemRelationship, getCommerceItemRelationshipCount, getCommerceItemRelationships, getCreditStatus, getCurrencyCode, getDebitStatus, getOrderRelationship, getOrderRelationshipCount, getPaymentGroupClassType, getPaymentMethod, getPropertyValue, getRepositoryItem, getRequisitionNumber, getSaveAllProperties, getShippingGroupRelationship, getShippingGroupRelationshipCount, getShippingGroupRelationships, getSpecialInstructions, getState, getStateAsString, getStateAsUserResource, getStateDetail, getSubmittedDate, isChanged, removeAllCommerceItemRelationships, removeAllShippingGroupRelationships, removeCommerceItemRelationship, removeOrderRelationship, removeShippingGroupRelationship, setAmount, setAmountAuthorized, setAmountCredited, setAmountDebited, setChanged, setCurrencyCode, setPaymentGroupClassType, setPaymentMethod, setPropertyValue, setRepositoryItem, setRequisitionNumber, setSaveAllProperties, setSpecialInstructions, setState, setStateAsString, setStateDetail, setSubmittedDate, toString, update
 
Methods inherited from class atg.commerce.order.CommerceIdentifierImpl
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface atg.commerce.order.CommerceIdentifier
getId
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

mBillingAddress

protected Address mBillingAddress
Constructor Detail

InvoiceRequest

public InvoiceRequest()
Default constructor

Method Detail

setPONumber

public void setPONumber(java.lang.String pPONumber)
Set the purchase order number for this invoice. This modifies the PONumber property of the underlying repository item.


getPONumber

public java.lang.String getPONumber()
Return the purchase order number for this invoice, obtained by looking at the PONumber property of the underlying repository item.


getBillingAddress

public Address getBillingAddress()
Returns the billing address to use for this invoice.

The object returned will actually be an instance of atg.order.RepositoryContactInfo, a subclass of ContactInfo that overrides every method to set or get properties of an underlying repository item, in this case the repository item corresponding to this InvoiceRequest object. So the properties of the billing address are actually flattened into the invoiceRequest repository item when they are read and written.

This somewhat unconventional approach was adopted from the DCS CreditCard implementation. The alternative would be to endow the invoiceRequest repository item with a property of type contactInfo, then add code somewhere in the pipeline that would load the invoiceRequest repository item, construct the wrapper object for it, find its billingAddress property (which would be of type RepositoryItem), build a wrapper class around that, and add the address wrapper to the invoice wrapper.

Using flattened properties as we do here is less intuitive, but also requires less custom coding.

Specified by:
getBillingAddress in interface PaymentAddressContainer

setBillingAddress

public void setBillingAddress(Address pBillingAddress)
Specified by:
setBillingAddress in interface PaymentAddressContainer

setPreferredFormat

public void setPreferredFormat(java.lang.String pPreferredFormat)
Set the preferred delivery format (text, HTML, XML DTD specification, etc.) for this invoice.

The value specified here must be one of those recognized as legal for the "preferredFormat" property of the "deliveryInfo" repository item in the "Invoice" repository. Applications should typically use an instance of atg.repository.servlet.PossibleValues to obtain the list of permissible values, then present a user interface that restricts the user to choosing among these values.

See Also:
PossibleValues

getPreferredFormat

public java.lang.String getPreferredFormat()
Get the preferred delivery format (text, HTML, XML DTD specification, etc. for this invoice.


setPreferredDeliveryMode

public void setPreferredDeliveryMode(java.lang.String pPreferredDeliveryMode)
Set the preferred delivery mode (email, postal mail, fax, etc) for this invoice.

The value specified here must be one of those recognized as legal for the "preferredDeliveryMode" property of the "deliveryInfo" repository item in the "Invoice" repository. Applications should typically use an instance of atg.repository.servlet.PossibleValues to obtain the list of permissible values, then present a user interface that restricts the user to choosing among these values.

See Also:
PossibleValues

getPreferredDeliveryMode

public java.lang.String getPreferredDeliveryMode()
Get the preferred delivery mode (email, postal mail, fax, etc) for this invoice.


setPaymentDueDate

public void setPaymentDueDate(java.util.Date pPaymentDueDate)
Set the date on which payment is nominally due.


getPaymentDueDate

public java.util.Date getPaymentDueDate()
Get the date on which payment is nominally due.


setPaymentNetDays

public void setPaymentNetDays(java.lang.Integer pPaymentNetDays)
Set the "net days" component of this invoice's payment terms.


getPaymentNetDays

public java.lang.Integer getPaymentNetDays()
Get the "net days" component of this invoice's payment terms.


setPaymentDiscountDays

public void setPaymentDiscountDays(java.lang.Integer pPaymentDiscountDays)
Set the "discount days" component of this invoice's payment terms.


getPaymentDiscountDays

public java.lang.Integer getPaymentDiscountDays()
Get the "discount days" component of this invoice's payment terms.


setPaymentDiscountPercent

public void setPaymentDiscountPercent(java.lang.Double pPaymentDiscountPercent)
Set the "discount percentage" component of this invoice's payment terms.


getPaymentDiscountPercent

public java.lang.Double getPaymentDiscountPercent()
Get the "discount percentage" component of this invoice's payment terms.