Freeside:3:Documentation:Developer/FS/did order

From Freeside
Jump to: navigation, search

NAME

FS::did_order - Object methods for did_order records

SYNOPSIS

 use FS::did_order;

 $record = new FS::did_order \%hash;
 $record = new FS::did_order { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::did_order object represents a bulk DID order. FS::did_order inherits from FS::Record. The following fields are currently supported:

ordernum
primary key
vendornum
vendornum
vendor_order_id
vendor_order_id
submitted
submitted
confirmed
confirmed
received
received

METHODS

new HASHREF
Creates a new bulk DID order. To add it to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
merge SOURCE_ORDER
Merges the DID order given by SOURCE_ORDER into THIS order.
The following fields from the source order are transferred, only if they aren't set in this order: -vendor order # -confirmed -customer
DID order items are transferred into this order. Per-order customer is cleared if any order items are assigned to a customer.
The source order is deleted.
The operation fails if: -either order has a received time; or -the DID vendors do not match between the orders
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid bulk DID order. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
did_order_item
Returns the did_order_items (see FS::did_order_item) associated with this bulk DID order.
cust_main
Returns all cust_main (see FS::cust_main), if any, associated with this bulk DID order.
has_stock
Returns true if and only if the order has any stock order items.
provisioned
Returns the provisioned DIDs, if any, as phone_avail (see FS::phone_avail) objects.

SEE ALSO

FS::Record, schema.html from the base documentation.