IP.Board  3.3.0
invoice Class Reference

Public Member Functions

 __construct ($id=0)
 __get ($key)
 __set ($key, $value)
 addItem ($item)
 addRenewal ($purchase, $price=NULL, $expire=NULL)
 adjustTax ($k, $percentage)
 calculateTax ($country, $state)
 chargeToCard ()
 getLinePrice ($k)
 getOrderProgress ()
 getPurchases ()
 markPaid ()
 markUnpaid ($infoOnly, $status='canc')
 recalculateTotal ()
 removeItem ($id)
 save ($system=FALSE, $log=TRUE)
 sendNotification ($key, $member=0, $extra=NULL)
 setQuantity ($_item, $quantity)
 setShipping ($item, $method)

Static Public Member Functions

static formatPrices ($prices)

Data Fields

 $takeAction = TRUE
const OS_BILLING = 1
const OS_SHIPPING = 2

Constructor & Destructor Documentation

__construct ( id = 0)

Constructor

Parameters:
int|nullProvide ID number to load existing invoice, or null to create new
Returns:
bool

Member Function Documentation

__get ( key)

Get data

Parameters:
stringkey
Returns:
string data
__set ( key,
value 
)

Set data

Parameters:
stringkey
stringvalue
Returns:
bool
addItem ( item)

Add item

Parameters:
array
addRenewal ( purchase,
price = NULL,
expire = NULL 
)

Add Renewal

Parameters:
arrayRow from nexus_purchases
float|nullPrice override
adjustTax ( k,
percentage 
)

Adjust Tax

Parameters:
intItem number
intPercentage of current tax to take
calculateTax ( country,
state 
)

Calculate Tax

Parameters:
stringCountry code
stringState code

Charge To Card

Returns:
void
Exceptions:
Exception
static formatPrices ( prices) [static]

Format Prices Takes an array of prices and quantities and formats for display

getLinePrice ( k)

Get Line Price

Parameters:
intItem number
intPrice

Get purchases

Returns:
array Items from nexus_purchases
markPaid ( )

Mark as paid Generates purchases, updates renewal dates, etc.

Parameters:
boolWhether or not to save the invoice. Unless done after calling function, should be true.
markUnpaid ( infoOnly,
status = 'canc' 
)

Mark Unpaid

Parameters:
bool$infoOnlyIf true, won't actually make changes
string$statusThe status we're setting it to
Returns:
array Information about changes

Recalculate Total

removeItem ( id)

Remove item

Parameters:
intThe item ID
save ( system = FALSE,
log = TRUE 
)

Save data

sendNotification ( key,
member = 0,
extra = NULL 
)

Send Notification

Parameters:
stringNotification key
idMember ID if not invoice ownwe
setQuantity ( _item,
quantity 
)

Set Quantity

Parameters:
intItem
intQuantity
Returns:
array 'line' => Line price, 'prices' => see self::formatPrices
setShipping ( item,
method 
)

Set Shipping Method

Parameters:
intItem
intShipping Method

Field Documentation

$takeAction = TRUE

Take Action If false, markAsPaid() etc, will not be ran

const OS_BILLING = 1

Get Order Progress

Returns:
array Array with steps

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables