Choose your language

Choose your login

Support

Create or change a cost script

This page applies to:

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.

A screenshot showing the New Order form, showing cost estimations.

An exmaple of the New Order form, showing cost estimations.

The costing information that is displayed on the New Order form for each product is defined in JavaScript. Job Ticketing comes with sample cost estimate scripts that you can use out-of-the box, or modify to suit your needs. Providing a scripting environment allows an enormous amount of flexibility for you to customize your cost estimates, however, you do need to be comfortable working with JavaScript.

For more information about JavaScript, see: Using JavaScript .

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.

Updating a cost script

  1. In the Operator interface, in the bottom left corner of the screen, click Settings.

  2. 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.

A screenshot of the cost script editor, where you can create or edit your cost scripts.

A screenshot of the cost script editor, where you can create or edit your cost scripts.

  1. In Name, type the name of the cost script.

  2. (optional) In Description, type a description of the script, for example Booklet cost script.

  3. 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.
  4. 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
  1. Open the cost script you want to copy.
  2. Press Ctrl+A to select all.
  3. Press Ctrl+C to copy.
To paste the script you want over the top of the template script
  1. Create a new cost script in the relevant room.
  2. Press Ctrl+A to select all.
  3. Press Ctrl+V to paste.

Assigning a cost script to a draft product


  1. Click the Products tab.
  2. In the Cost script column, select the cost script you want to apply to each product.
  3. View the changes on the New Order form:
    1. Click New Order.
    2. Select the product using that cost script.
    3. Create an order to see how the costs are calculated and displayed.
    4. Click Cancel.
  4. Tweak the cost script as required; then click Save and Close.

Deleting a cost script

  1. Click a script on the Cost script tab
  2. Click Delete button at the bottom of the page.

Next Step: Step 4: Assign a cost script to each product

Comments