Class busLineItem

The LineItem class used to hold and manipulate the Invoice lineitems. This class provides an interface both to a single LineItem as well as a group of lineitems which is represented by the Details table (wws_lineitems_LIST).

The bulk of this class' customizations deals with the operation of the list and recalculation.

Westwind.BusinessObjects.wwBusiness
public class busLineItem : wwBusiness

Class Members

MemberDescription

IsTemporaryLineItem

AddItem

Adds an item generically to the lineitems DataTable (wws_lineitems_list). This method does not call Save() to write to the database. A separate call to LineItems.SaveLineItems() is required to save the full collection.

public virtual bool AddItem( int InvPk,
    string Sku,
    int Qty );

public virtual bool AddItem( busLineItem LineItem );

CalculateItemTotal

Calculates the item total based on qty price, discount and tax rate

public decimal CalculateItemTotal();

public decimal CalculateItemTotal( DataRow LineItemRow );

DeleteLineItems

Deletes the lineitems of the invoice.

public virtual bool DeleteLineItems( int InvPk );

public virtual bool DeleteLineItems();

GetTypedDataRow

public virtual wws_lineitemsRow GetTypedDataRow( bool LoadColumns );

public wws_lineitemsRow GetTypedDataRow();

LoadLineItems

Creates a DataSet with LineItems_List cursor. (or TLineItems_List)

public virtual int LoadLineItems( int InvPk );

New

Retrieves a new lineitem and sets the Item Total values to 0 to avoid null values.

public virtual bool New();

public virtual bool New( int InvPk,
    string Sku,
    int Qty );

RemoveLineItem

Method used to delete a line item from the database. Requires a InvPk in order to allow only the 'current' user to remove items and not to delete other user's items. Deletes the items only from the database not from the LineItem collection busLineItem::RemoveLineItemFromCollection

public bool RemoveLineItem( int Pk,
    int InvPk );

RemoveLineItemFromCollection

Removes the Lineitem from the LineItems collection (wws_lineitems_list table). No items are removed from disk. Use LineItems.Save() to save the data.

public bool RemoveLineItemFromCollection( int Pk,
    int InvPk );

Save

Overridden to update inventory for the current item.

public virtual bool Save();

SaveFromTemporaryLineItems

Copies the temporary lineitems to the 'real' lineitems table and cleans out the tlineitems.

public bool SaveFromTemporaryLineItems( int InvPk );

SaveLineItems

Saves the lineitems currently loaded in the this.Tablename + "_List" data table

public virtual bool SaveLineItems( bool UpdateInventory );

UpdateInventoryFromLineItems

Goes through the list of lineitems in the 'List' table and updates the inventory based on whether the items have changed or been added.

public bool UpdateInventoryFromLineItems();

Requirements

Namespace: Westwind.WebStore

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