SilverCommerce\OrdersAdmin\Model\Estimate
Represents an estimate (an unofficial quotation that has not yet been paid for)
Synopsis
class Estimate
extends DataObject
implements
PermissionProvider
{
- // members
- private static string $table_name = 'Estimate';
- private static integer $default_end = 30;
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $field_labels = ;
- private static array $export_fields = ;
- private static array $extensions = ;
- private static array $versioning = ;
- private static array $default_sort = ;
- // methods
- public string DisplayLink()
- public string PDFLink()
- public array getExportFields()
- public string getFullRef()
- public string getPersonalDetails()
- public string getBillingAddress()
- public string getCountryFull()
- public string getCountryUC()
- public string getDeliveryAddress()
- public string getDeliveryCountryFull()
- public string getDeliveryCountryUC()
- public int getTotalItems()
- public float getTotalWeight()
- public float getSubTotal()
- public float getTaxTotal()
- public ArrayList getTaxList()
- public float getTotal()
- public Invoice convertToInvoice()
- public string getItemSummary()
- public string getItemSummaryHTML()
- public boolean isDeliverable()
- public boolean isLocked()
- public FieldList getCMSFields()
- public void requireDefaultRecords()
- protected string get_prefix()
- protected int getBaseNumber()
- protected void generate_order_number()
- protected string generateOrderNumber()
- protected void generate_random_string()
- protected boolean validOrderNumber()
- protected boolean validAccessKey()
- public DataObject duplicate()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void onBeforeDelete()
- public void providePermissions()
- public boolean canView()
- public boolean canCreate()
- public boolean canEdit()
- public boolean canDelete()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Implements
- SilverStripe\Security\PermissionProvider
Members
private
- $casting
—
array
Cast methods for templates - $db
—
array
Standard DB columns - $default_end
—
integer
The amount of days that by default that this estimate will end (cease to be valid). - $default_sort
—
array
Default sort order for ORM - $export_fields
—
array
Fields to show in summary views - $extensions
—
array
Add extension classes - $field_labels
—
array
Human readable labels for fields - $has_many
—
array
One to many assotiations - $has_one
—
array
Foreign key associations - $searchable_fields
—
array
Fields to search - $summary_fields
—
array
Fields to show in summary views - $table_name
- $versioning
—
array
Declare version history
Methods
protected
- generateOrderNumber() — Generate an incremental estimate / invoice number.
- generate_order_number() — legacy method name - soon to be depreciated
- generate_random_string()
- getBaseNumber() — Get a base ID for the last Estimate in the DataBase
- get_prefix() — Retrieve an order prefix from siteconfig for an Estimate
- validAccessKey() — Check if the access key generated for this estimate is valid (exists on another object)
- validOrderNumber() — Check if the currently generated order number is valid (not duplicated)
public
- DisplayLink() — Generate a link to view the associated front end display for this order
- PDFLink() — Generate a link to view the associated front end display for this order
- canCreate() — Anyone can create orders, even guest users
- canDelete() — No one should be able to delete an order once it has been created
- canEdit() — Only users with EDIT admin rights can view an order
- canView() — Only order creators or users with VIEW admin rights can view
- convertToInvoice() — Factory method to convert this estimate to an order.
- duplicate() — Create a duplicate of this order/estimate as well as duplicating associated items
- getBillingAddress() — Get the complete billing address for this order
- getCMSFields() — Scaffold CMS form fields
- getCountryFull() — Get the rendered name of the billing country, based on the local
- getCountryUC() — Get the uppercase name of this country
- getDeliveryAddress() — Get the complete delivery address for this order
- getDeliveryCountryFull() — Get the rendered name of the delivery country, based on the local
- getDeliveryCountryUC() — Get the uppercase name of this country
- getExportFields() — Get the default export fields for this object
- getFullRef() — Get the full reference number for this estimate/invoice.
- getItemSummary() — Return a list string summarising each item in this order
- getItemSummaryHTML() — Return a list string summarising each item in this order
- getPersonalDetails() — Generate a string of the customer's personal details
- getSubTotal() — Total values of items in this order (without any tax)
- getTaxList() — Get a list of all taxes used and an associated value
- getTaxTotal() — Total values of items in this order
- getTotal() — Total value of order
- getTotalItems() — Find the total quantity of items in the shopping cart
- getTotalWeight() — Find the total weight of all items in the shopping cart
- isDeliverable() — Determine if the current estimate contains delivereable items.
- isLocked() — Determine if the current estimate contains only locked items.
- onAfterWrite() — API Callback after this object is written to the DB
- onBeforeDelete() — API Callback before this object is removed from to the DB
- onBeforeWrite()
- providePermissions()
- requireDefaultRecords()