Using the Reference Field for Material Selection and Labor Charges

Tyler MacDonald Updated by Tyler MacDonald

Creating labor rate charges that apply only when a specific material is selected from a drop-down menu is an excellent way to streamline pricing in shopVOX. This guide walks you through each step of the process, offering practical insights and tips to help you set up intelligent pricing structures with ease.

Understanding the Reference Field

The reference field in a drop-down menu can later be accessed for information about materials from another dropdown or default item.

For example, if you create a drop-down menu for laminates, the reference field allows you to retrieve details such as sheet width and sheet height. These values can then be used in conditional logic to dynamically calculate charges, like labor rates, based on the material selection. This makes the pricing structure both intelligent and adaptable.

Before Getting Started

1. Ensure Materials Are Available

You’ll need at least one material to use in your drop-down menu. This can include stock materials provided by shopVOX or custom materials that you create to suit your needs. Luckily, shopVOX includes many stock materials, and most users already have materials set up. If you need help adding materials, refer to this guide.

2. Set Up the Labor Charge

Before creating the product, it’s important to set up the labor charge. For this example, we’ll create a flat labor charge of $10. This technique is flexible and works for any labor rate. Here’s how:

  1. Navigate to Settings > Pricing > Labor Rates
  2. Click + Add New Labor Rate
  3. Fill in the details.
  4. Name the Labor Rate (e.g., "$10.00 Charge").
  5. Set the cost and price to $10.00 (or your desired rate).
  6. Production Rate: 1, Units: Unit, Per:Unit
  7. Save the labor rate.

Step-by-Step: Build Your Product

1. Create a New Product

  1. Navigate to Settings
  2. Products.
  3. Click + Add New Product.
  4. Select Custom Product.
  5. Fill in the following details:
    • Name: Enter a product name.
    • Interface: Custom
    • Type: Select a product type.
    • Category: Assign a category.
    • Assign an Income Account and a Cost of Goods Account.
  6. Click Save Product.

2. Enable the Product Template

  1. After saving, enable + Add Product Template.
  2. Scroll down to the product template and click to open the modifiers, dropdown menus and default items.

3. Configure Modifiers, Drop-down Menus, and Default Items

Modifiers
  1. Add a Width Modifier.
  2. Add a Height Modifier.
  1. In the Dropdown Menus section - Click + Add New.
    after clicking the "Add New Dropdown Menu" screen will appear.
  2. Fill in the Details
  3. Name the menu (e.g., "Lamination").
  4. Ensure the right Material Type and Category are selected.
  5. Set Item Kind to "Company Items".
  6. System Formula: "Area".
  7. Check Charge per LI Unit.
  8. Name the Reference Field "laminate" (all lowercase, no spaces).
  9. Save the drop-down menu.
Default Item for Labor Charge
  1. Under default items click "+Add New"
  2. Set Formula to "None".
  3. Set Multiplier to "1".
  4. Turn on Per LI Unit.
  5. Add the following custom code:
    (laminate_sheet_width > 0 && laminate_sheet_height > 0) ? 1 : 0;
  6. Click Save Default Item.

Review Product Template

The Product Template should look like this

Notice the reference called "laminate", under the drop down menu. This is the name you used as a reference in the default item

Explanation of the Code

The custom code ensures that the labor charge is applied only when valid material dimensions are selected. Here’s a detailed breakdown of how the logic works:

  1. Reference Field: The reference field "laminate" links the drop-down menu to the material attributes, enabling access to variables such as laminate_sheet_width and laminate_sheet_height.
  2. Logic Conditions: The code checks whether the width (laminate_sheet_width) and height (laminate_sheet_height) values are greater than zero. These values are populated when a valid material is selected.
    • Condition: (laminate_sheet_width > 0 && laminate_sheet_height > 0) evaluates to true only if both dimensions are greater than zero.
  3. Result:
    • If true: The ternary operator assigns a value of 1, which applies the $10 labor charge.
    • If false: The value is set to 0, removing the labor charge.
  4. Practical Application: This logic ensures that labor charges are conditionally applied, avoiding errors such as applying charges when no material is selected or dimensions are missing.

This approach combines simplicity and accuracy, making it easy to maintain and adapt to different scenarios.

Testing Your Product

Testing is critical to ensure your product setup works as intended. Follow these steps:

  1. Create a Test Transaction:
    • Add the new product to a test order.
  2. Select a Material:
    • Use the drop-down menu to select a material.
  3. Verify Charges:
    • Check that the labor charge is applied when a material is selected.
    • Confirm the labor charge is removed when no material is selected.
  4. Test Edge Cases:
    • Try invalid material selections or leave the selection blank to ensure the logic handles these scenarios correctly.

Tips for Success

  • Consistency in Naming: Use clear and consistent names for reference fields and modifiers. This simplifies troubleshooting and ensures easier navigation.
  • Detailed Testing: Test your product with a variety of scenarios, including valid and invalid inputs, to confirm the logic behaves as expected.
  • Documentation: Document your setup for future reference or for other team members to understand the product configuration.
  • Leverage Support: If you encounter issues, refer to shopVOX support resources or community forums for guidance.

Conclusion

By leveraging the reference field, you can create intelligent, flexible pricing structures that adapt to your needs. This method ensures accuracy, saves time, and enhances the efficiency of managing labor charges tied to material selection. Whether you’re a shopVOX novice or an experienced user, incorporating this approach into your workflow will provide robust, reliable results that streamline your pricing operations.

How did we do?

Product Templates - How to Turn on a Product Template

Mastering the Use of *, /, +, -, >, <, >=, <=, % in Ternary Operations

Contact