Create or change a cost script
The New Order form can display an estimate of the order cost. You can customize the information that is displayed in the cost section, and the way the costs are calculated for each product. The cost section can display any option or combination of options that you want. For example, you might choose to display the cost for each individual finishing option, or alternatively display all finishing options as a single cost.
Job Ticketing provides an easy to use editor to help you create cost scripts. The cost script editor offers enormous flexibility for you to customize the cost estimate section on the New Order form.
In the Operator interface, in the bottom left corner of the screen, click Settings.
Click the Cost scripts tab.
This tab displays a list of your costs scripts; both the template scripts that come with the template products you have added to your room, and any scripts your have created yourself. For more information abut the template scripts, see Example cost scripts.
From here you can either create a new cost script or edit an existing one.
- To create a new cost script, click Create cost script. The Create cost script page is displayed.
- To edit a script, click the script you want to open. The Edit cost script page is displayed.
The cost script editor provides a set of tools to help you create and edit scripts.
In Name, type the name of the cost script.
(optional) In Description, type a description of the script, for example Booklet cost script.
In Content, edit the cost script as required.
The Content pane contains the actual cost script. The estimateCost(order) function is the only required function; it defines the cost estimate information that is displayed on the New Order form. This function specifies the:
- formula for calculating each line item cost
- appearance of each line item
- formula for calculating the total estimated cost.
Click Save or Save and Close.
If there are any syntax errors, an error message with details of the problem will be displayed when you click Save. The right hand side bar in the Definition field will display a small red bar indicating where the problem is located.
If you want to create a script that is similar to an existing one, you might find it easier to copy the existing script and then modify it slightly for use with a different product or room.
To copy a script
- Open the cost script you want to copy.
- Press Ctrl+A to select all.
- Press Ctrl+C to copy.
To paste the script you want over the top of the template script
- Create a new cost script in the relevant room.
- Press Ctrl+A to select all.
- Press Ctrl+V to paste.
- Click the Products tab.
- In the Cost script column, select the cost script you want to apply to each product.
- View the changes on the New Order form:
- Click New Order.
- Select the product using that cost script.
- Create an order to see how the costs are calculated and displayed.
- Click Cancel.
- Tweak the cost script as required; then click Save and Close.
- Click a script on the Cost script tab
- Click Delete button at the bottom of the page.
Next Step: Step 4: Assign a cost script to each product