Class busInvoice

The invoice class is the most powerful class in the Web store application. 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
  System.MarshalByRefObject
    Westwind.BusinessObjects.wwBusiness
      <b>Westwind.WebStore.busInvoice</b>
public class busInvoice : wwBusiness

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.

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();

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();

GetTypedDataRow

public wws_invoiceRow GetTypedDataRow( bool LoadColumns );

public wws_invoiceRow 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 );

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 );

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 a Credit using AccessPoint (at this point). 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();

SearchInvoices

Runs an invoice search and returns the results.

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: webstorebusiness.dll

© West Wind Technologies, 1996-2018 • Updated: 05/04/05
Comment or report problem with topic