Using the Reference Field for Material Selection and Labor Charges
Using the Reference Field for Material Selection and Labor Charges
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:
Navigate to Settings > Pricing > Labor Rates
Click + Add New Labor Rate
Fill in the details.
Name the Labor Rate (e.g., "$10.00 Charge").
Set the cost and price to $10.00 (or your desired rate).
Production Rate: 1, Units: Unit, Per:Unit
Save the labor rate.
Step-by-Step: Build Your Product
1. Create a New Product
Navigate to Settings
Products.
Click + Add New Product.
Select Custom Product.
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.
Click Save Product.
2. Enable the Product Template
After saving, enable + Add Product Template.
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
Add a Width Modifier.
Add a Height Modifier.
Drop-down Menu
In the Dropdown Menus section - Click + Add New.after clicking the "Add New Dropdown Menu" screen will appear.
Fill in the Details
Name the menu (e.g., "Lamination").
Ensure the right Material Type and Category are selected.
Set Item Kind to "Company Items".
System Formula: "Area".
Check Charge per LI Unit.
Name the Reference Field "laminate" (all lowercase, no spaces).
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:
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.
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.
Result:
Iftrue: The ternary operator assigns a value of 1, which applies the $10 labor charge.
Iffalse: The value is set to 0, removing the labor charge.
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:
Create a Test Transaction:
Add the new product to a test order.
Select a Material:
Use the drop-down menu to select a material.
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.
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.