Orders are records that relate a client to a product. You do not have to create order records in order to create invoices, but if you want an invoice to be generated automatically at regular intervals, you have to have an order record. Order records can be created manually by an administrator, or automatically when a user fills in an order form.

An order record represents a one-to-one relationship between a client and a product - you cannot have more than one product on an order (however, where multiple orders are due at the same time, they can all appear on the same invoice).

To access your list of orders, select Billing-­>Orders from the menu as shown in figure 5.8.

Figure 5.8 - Accessing the Order List

This will take you to the list of orders.

Order List

You can use the filter controls above the order list to narrow down the items shown to a particular client, product, date range, or 'relating to' value.  For the client and relating to filters, you can enter part of a name to show a list of all items that match.

You can select one or more orders (by checking the box to the left of them), and click on the 'Generate' toolbar button to generate any invoices that are due for the selected order(s). When you do this, you will be redirected to the invoice list, and told how many invoices were generated.

Tip: You can click on a product name to edit the product record or the client name to edit the client record. When you do this, after you finish editing the record, clicking save or cancel will bring you back here to the order list - not to the product or client list. If you had any filters specified (eg. a date range), these will still be specified on your return.

Tip: You can click on the Invoices icon to see all of the invoices that have been generated for a particular order.

When you click on an order number, or on the 'New' toolbar button, you will be taken to the order editor.

Basic Tab

Order Number

Typically, you would leave this blank when creating a new order. When the order is saved, the next available number (as defined on the vendor record) will be assigned. However, you can enter a number yourself if you wish (be careful if you want to avoid duplicates though).

Client

Select the client that you want to associate with a product.

Select Product

There are two dropdown lists: one for the category, and the second for the product.

Technical Note: The form will do a postback to the server when you select a category to fetch the products in the selected category. This is to avoid wasting server resources and bandwidth by loading all the details up-front where there are a lot of products, but it does mean a short wait while the screen refreshes.

Shipping Service

The dropdown list will contain an entry for each defined shipping rate that is applicable to the selected product (as defined on the product record).

Payment Frequency

Indicate the payment frequency for which a price has been defined on the product record. The value you select here will affect the price that is charged, and how often invoices are generated for the order.

Auto-Renew

If the order is for a one­-off price, this option has no effect. For products requiring recurring payments, you would typically leave this set to 'yes', as it dictates whether the next due date is updated each time an invoice is generated.

However, if you want to leave it up to your client whether or not to renew, you can set this to 'no', and set up a 'renewal due' reminder - which will e-mail the client a defined interval before the subscription runs out with a link that will enable them to make their next payment, and which will also generate the next invoice. If auto-renew is set to 'no', all payments are treated as one-offs, but using the price from the relevant payment frequency setting.

Currency

The dropdown list contains all of the currencies for which a price has been defined for the selected product.

Quantity

Enter the number of products ordered. This is used to calculate the net price and shipping costs, which are displayed at the end of the page.

Relating To

If your business offers a product or service of which customers might require more than one instance, you can specify which instance this order relates to here. This value will appear on the invoices that are generated for this order, in the format 'Product Name (for Relating To)'

For Example: If you sell website hosting accounts, a single client might have several different hosting accounts with you. In that case, you would probably enter the domain name for the account here, to differentiate it from their other accounts. The invoice might then say something like 'Bronze Hosting Account (for mydomain.com)'.

Start Date

This is the date that the order takes effect from - typically it will be the same as the date on which the order record is created.

Expiry Date (if applicable)

If you want recurring invoices to stop being generated after a particular date, you can enter the expiry date here. If entered manually by an administrator, this will have no effect on any recurring payment schedules that have already been set up with a payment service provider, so the actual payments will still have to be cancelled separately after this date, but the system will automatically stop producing invoices after this date. If the product ordered relates to a user subscription, the access level of the user will be downgraded as defined in the product record the next time the user logs in after expiry.

Some payment gateways will automatically enter an expiry date on order records that are created by the user submitting an order form - based on the expiry date of the credit or debit card that was used to make payment. That way, you can be sure that you are not raising invoices for payments that will not materialise. If using such a feature, it is advisable to set up a reminder record that will prompt you and/or the client to update their card details (or more typically, to set up a new payment schedule - see 'Order Payment Schedule' below) when the expiry date is reached.

Last Due Date

This is the date that the last invoice was due to be generated for this order (not necessarily the actual date the invoice was generated, but the date it became due). Whenever a new invoice is generated, the value from 'Next Due Date' (below) becomes the new 'Last Due Date', and the 'Next Due Date' is updated depending on the payment frequency specified above.

Next Due Date

The date that the next invoice is due to be generated. When the invoice generation process is run (either from the order list [see above], from the invoice list, or via a CRON job), an invoice will be generated for this order only if the next due date has been reached (or passed). The value from this field is then moved over to become the 'Last Due Date' (above), and the next due date is set according to the payment frequency specified above.

Order Status

You can select a value from the dropdown to indicate the status of the order. This can then be displayed in the component's front-end so that the user can check the status of their order. The status values available by default are: Under Review, Processing, Dispatched, Completed, and Cancelled. See also: How order status works.

  • Under Review: This would typically be used to indicate that the order is new (before any invoices are generated), and not necessarily finalised.
  • Processing: When a new order record is created after a user submits an order form, the status of the order will normally be set to 'Processing' unless the product is set to 'auto fulfil orders' (in which case the status will be set to 'Completed').
  • Dispatched: nBill itself never sets an order status to 'Dispatched'. It will only ever have this value if you as an administrator go into the order record and set the status yourself.
  • Completed: If the product to which this order relates is set to 'auto fulfil orders', the status of the order record will be set to 'Completed' as soon as the order is created (after a user submits an order form).
  • Cancelled: If a user cancels their order via the front-end, the status will be set to 'Cancelled', but you can also cancel it yourself by setting the status in the order record. Cancelled orders will no longer have any invoices generated, and if the order is for a user subscription product, the user's user group will be downgraded as specified in the product definition the next time the user logs in.

Tip: If you want to change the wording of the status options, you can edit the appropriate language file. The constants for status options are in:

/administrator/components/com_nbill/language/en-GB/xref.en-GB.php

...or the equivalent if you are using a different language.  In that file, if you scroll down, you will come across the constants defined like this:

define("NBILL_STATUS_PENDING", "Under Review");
define("NBILL_STATUS_PROCESSING", "Processing");
define("NBILL_STATUS_DISPATCHED", "Dispatched");
define("NBILL_STATUS_COMPLETED", "Completed");
define("NBILL_STATUS_CANCELLED", "Cancelled");

The words shown here in red are the only bits you should edit.

Cancellation Date (if applicable)

If the order is cancelled online by the user, this will be populated automatically. If you cancel it yourself by updating the order status (above), you should also enter the date here.

Cancellation Reason

If the order is cancelled online by the user, they will be given the opportunity to type in the reason they are cancelling. If they enter a value, it will be populated here automatically. Otherwise, you can just enter a value yourself, or leave it blank - it's up to you.

Parcel Tracking ID

If you use a courier that provides an online tracking service for the delivery of your products, you can enter a reference here that will be used to construct the URL to allow the user to track the item. The reference entered is inserted in the URL defined on the shipping record to generate the full tracking link (displayed on the 'My Orders' page in the front end).

Notes

You can enter anything you like in the notes - they are just for your reference as an administrator and are never displayed to the end user.

Invoice Details

This shows a summary of the prices that will appear on the invoices for this order. Any discounts or client credit amount will not appear in these figures - they will be applied at the time the invoice is generated. Also, note that the order record at this stage has no way of knowing whether there will be any other orders for the same client appearing on the same invoice as this one. Therefore, if you have a shipping rate which is set to use a fixed price per invoice, the fixed price will always show up in these figures for all of the orders, but it will only show up on the invoice once.

Tip: If you have negotiated a special rate with the client, you can override the values without having to go back and set up another separate product record for the reduced (or increased) amount. Just type over the figures with your own values (but bear in mind that if you change anything in the order record above, such as selecting a different payment frequency, the figures may be recalculated and your overridden values will be lost).

Attachments

You can attach one or more files to this client record using the supporting documents feature. Attached files are only visible to administrators, not to the client.

Order Payment Schedule

This only appears when editing an existing order, not when creating a new one. It simply displays a URL that you can copy and paste into an e-mail to a client if you want them to set up a payment schedule for this order. Typically, a recurring payment schedule is set up when a user submits an order form, so this link is not needed. If the order expires, or requires manual renewal, you can set up a reminder which will automatically e-mail an appropriate link to the user, so again this link would not be needed (see auto-renew, above).

However, if a payment schedule was set up (eg. when the user submitted an order form), but is then subsequently cancelled (eg. Paypal often cancels subscriptions without warning when a user changes their card details), you can send this link to the user to enable them to set up their recurring payments again. The user will be prompted to login before they are actually handed over to the payment gateway unless you specify that login is not required on the My Orders tab of the display options page.

Advanced Tab

Online Order?

Whether the order was made online or offline. The only effect this has is that if a tax rate applies to this order which has been set to allow exemption for online orders, then the tax will not be added if this value is set to 'yes'.

For Example: If you are based in the US, and use nBill to record details of both online and offline orders, you might have a tax record indicating the tax rate to apply for a given tax zone (eg. state or municipality). The tax record would be set to allow exemption for online orders. When a customer whose client record contains that tax zone buys a product or service from you directly (ie. not online), it would be subject to sales tax, so you would set the 'Online Order?' value to 'no'. Where someone orders the same product or service online, the 'Online Order?' value would be set to 'yes', and the tax would not be added.

Tax Exemption Code

The client's own VAT number or equivalent, or reseller certification number (for offline orders in the US). If a tax rate applies to this order which has been set to allow exemption for clients that have an exemption code, setting a value here will prevent the tax from being added to the price for this order. nBill does not check the validity of the code entered (but if the client enters the code themselves using a client profile field or a field on an order form, you can use the free VAT number checker extension to validate the VAT number they enter against the EU VIES database).

Tip: This value is populated automatically when you select a client from the dropdown on the Basic tab, based on the value held in the client record. Clients can also update their own exemption code in their profile by logging into the component's front end. If you don't want them to do that, you can unpublish the 'NBILL_CORE_tax_exemption_code' client profile field.

Unique Invoice?

If you want this order to always have its own unique invoice (rather than being lumped together with any other orders that may be due at the same time), you can set this to 'yes'.

Show Payment Link?

Whether or not to allow invoices for this order to be paid online (ie. for a 'pay now' link to appear next to the invoice in the user's invoice list). If there is a regular payment schedule already set up for this order, it is unlikely that you will want to show a payment link - otherwise the user may end up paying twice. By default, only invoices for orders with 'one-off' payment frequencies, or ad-hoc one-off invoices, will have a payment link, but you can change this on the display options screen, and override it again here. You can also override this value on the invoice itself.

Voucher Code

If a discount which uses a voucher code is applicable to this order, the voucher code can be entered here. This will ensure that the order qualifies for that discount whenever any invoices are generated for it.

Discounts used on this order

Discounts will only be applied to an order if they are assigned to it here. When a user fills in an order form, and an order record is created automatically, the relevant discount(s) will be assigned automatically (based on the qualifying rules defined on the discount record(s)). Just because a discount is assigned to the order does not mean that the discount will be applied to the order's invoices though - that will only happen if the order qualifies according to the rules defined on the discount record.

If a discount is assigned to an order with a recurring payment frequency, and the discount is defined as being applicable to recurring payments, a warning message will appear when you try to edit that discount record - to make sure you are aware that any changes you make to the discount will apply to existing order(s) when their next invoice is generated.

Order Form Field Values

When an order is created after a user has submitted an order form, the values for all of the fields on the form will be stored here for your reference.

Technical Note: If you are a programmer, and want to use values that were submitted on the order form in a script (eg. in a form event on the advanced tab of the order form), there is a built-in function (called 'nbf_frontend::get_form_field_value') that will extract the value from the database for you (as all the values are held in a single text field in the database, it has to be parsed to extract individual values).