Class busInvoice

The invoice class is the topmost class in the Web store application around which most of the others are centered.

It's the main interface to the developer working with the Web Store as it acts as a high level object through which you can reach the various other objects including the lineitems and customer objects.

Most operations in the store are managed through invoice objects.

The underlying table is wws_invoice.

Namespace: Westwind.WebStore Inherits: wwBusiness

System.Object
  Westwind.BusinessObjects.wwBusiness
    Westwind.BusinessObjects.wwBusiness<InvoiceEntity>
      Westwind.WebStore.busInvoice

public class busInvoice : wwBusiness<InvoiceEntity>

Class Members

MemberDescription
Constructor
Customer Customer business object reference
LineItems Lineitems business object reference.
ShipInfo Sub object - contains information about how this item is to be shipped or not shipped. Properties can be set here and then used in the CalculateShipping() method to calculate a shipping total when complete invoice information is not available (such as on a Web page)
SubTotal Internally calculated Subtotal value that is otherwise not stored in the data itself.
TemporaryLineItems Determines if we're accessing temporary lineitems. Use for Web while no customer info is available and the invoice isn't finalized yet.
UpdateInventoryOnDelete Determines whether inventory is updated when an invoice is deleted. This flag can be set when purging invoices to avoid updating the inventory.
AddPoCharge Adds a POCHARGE item to a the invoice lineitems
public void AddPoCharge( bool Remove );
ApplyPromoCodes Applies on or more promo codes to an order
public virtual bool ApplyPromoCodes( string Codes );
CalculateShipping Calculates the shipping for the invoice. The method returns the shipping total as well as updating the InvTotal field in the current DataRow.
public virtual decimal CalculateShipping();
CalculateTax Default behavior: Calculates any state tax for the state specified using the designated Tax Rate from the configuration settings. Assume: Current Invoice record is set.
public virtual decimal CalculateTax();
CanAutoConfirm This method checks to see if the current invoice is capable of being confirmed electronically by checking each lineitem and its regauto flag.
public virtual bool CanAutoConfirm();
CheckStockForLineItems Checks the stock of each of the lineitmes
public bool CheckStockForLineItems()
ClearCreditCardNumbers Removes the Credit Card Numbers for all entries that have been processed
public int ClearCreditCardNumbers();
Delete Deletes the current invoice and associated lineitems.
public virtual bool Delete( int InvPk );
GetAddress Returns address information as a string
public string GetAddress( bool IsShipping );

public string GetAddress();

GetHiddenCC Returns a CC number as a partially hidden CC number.
public string GetHiddenCC();
GetInvoiceListByCustomer Returns a list of invoices for a given customer
public int GetInvoiceListByCustomer( int CustPk,
string FieldList,
string Filter,
string CursorName );
GetTypedDataRow The following code is optional. The wws_ object is generated using the DataContainer Generator tool.
public InvoiceEntity GetTypedDataRow( bool LoadColumns );

public InvoiceEntity GetTypedDataRow();

HtmlLineItems Displays an invoice's lineitems as HTML in a variety of formats
public string HtmlLineItems( int LinkMode,
bool Totals );
InvoiceTotal Totals the invoice by summing up the lineitems and updating the Invoice total fields of the table. Assume: this.CountryId and this.State can be set externally to avoid Customer object requirement
public decimal InvoiceTotal( bool NoShippingCalculation );

public decimal InvoiceTotal();

Load Override to load invoice, lineitems and customer objects
public virtual bool Load( int Pk );
LoadByInvNo Loads an invoice by Invoice Number rather than by Pk
public bool LoadByInvNo( string InvNo );
LoadCustomer Loads the customer record associated with this invoice by Pk
public virtual bool LoadCustomer( int CustPk );
LoadEmptyInvoiceEntity
public InvoiceEntity LoadEmptyInvoiceEntity();
LoadInvoiceEntity Retrieves an invoice entity object that contains child objects for Customer and LineItems
public InvoiceEntity LoadInvoiceEntity( int InvPk );
LoadLineItems Loads the lineitems into the invoice
public virtual bool LoadLineItems( int InvPk );

public virtual bool LoadLineItems();

MaintInvoiceList Returns an invoice list used for displaying on the Admin page. Retrieves data from the invoice and customer objects.
public int MaintInvoiceList( string CursorName );

public int MaintInvoiceList( string Filter,
int MaxCount,
string CursorName,
IDbDataParameter[] Parameters );

public int MaintInvoiceList( int MaxCount,
string CursorName );

New Overridden to provide support for the invoice/customer/lineitems hierarchy.
public bool New( bool NoNewId,
int CustPk );

public virtual bool New( bool NoNewId );

ProcessCreditCard Processes credit cards for the provider set in App.Configuration.CCMerchant Works with the WebStoreConfig settings for setting the appropriate processing parameters: CCAccessPointUrl CCMerchantId CCReferingOrderUrl All other values are retrieved from the current invoice.
public bool ProcessCreditCard();
PurgeInvoicesByDate Purges invoices after a provided date.
public int PurgeInvoicesByDate( DateTime PurgeBefore );
Save Saves the current invoice by reading the lineitems from the temporary lineitems and copying them to real lineitems.
public bool Save( bool SaveFromTemporaryLineItems );

public virtual bool Save();

SaveInvoiceEntity
public bool SaveInvoiceEntity( InvoiceEntity Inv );
SearchInvoices Runs an invoice search and returns the results. Uses an InvoiceSearch structure for parameters
public int SearchInvoices( InvoiceSearch InvSearch,
string Tablename );
SendEmail Sends an email.
public bool SendEmail( string Subject,
string MessageText,
string ContentType,
string Recipient );

public bool SendEmail( string Subject,
string MessageText,
string ContentType );

SendEmailConfirmation Sends a Confirmation email for the order by looping through all the lineitems and sending the confirmation notice from each.
public bool SendEmailConfirmation();
UpdateShippingAddress Copies data from an ShippingAddress object to the current invoice
public void UpdateShippingAddress( busShippingAddress ShippingAddress );
Validate Validates the invoice. Checks for Invalid CC card info. Note customer object is not recursively validated - this must be performed separately.
public virtual bool Validate();
LineItemCount

Requirements

Namespace: Westwind.WebStore
Assembly: westwind.webstore.business.dll


 Last Updated: 3/7/2007 | Send topic feedback