Powered by Blogger.

vTiger Inventory Modules Customization [Case Studies]

Over the past few months, we have been building some amazing customization to vTiger inventory modules, adding some other modules information and features to it.

Customizing vTiger 5.x Inventory modules implies modifying at least 3 or 4 files to make it work. In this post we are going to review three types of customizations we have done multiple times, over the last few months.
Additional Columns in Product’s Blocks

One customization we regularly work on, is to add custom columns inside Inventory Modules product’s blocks.

In this example we have added four different columns: Two date fields that use jQuery DatePicker, one picklist, and one text field, all inside the standard product block.

To make this work, you need to add the user interface for the new field by editing the Smarty Files (Both ProductDetais.tpl and ProductDetailsEditView.tpl) and the Inventory.js file, that handles the add new line feature. Therefore, you need to add the new columns in that JS file as well.

To save the information you will need to modify include/utils/InventoryUtils.php and look for the function saveInventoryProductDetails.

Once you have managed to save the new information in vtiger DB, you need to display it (DetailViewUtils.php – function getDetailAssociatedProducts) and show it in the edit view (EditViewUtils.php - getAssociatedProducts function).

As you can see, there is no easy way to add new fields in products’ blocks, but it is still possible to do it.
Custom pricebooks or discounts for each account

Another really useful customization is to load a price, discount, commission, etc. that is related to any other field of the inventory module. For example: Each account has a discount or price based on a product category. Another example is when you need a product to be available or not under a give condition, for example between a set of dates, etc.

In this case, you need to edit the first set of files, create a new module and a new ajax call, inside Inventory.js that will handle the pricing validation for the product. (Look at loadTaxes_Ajax inside Inventory.js for an example of this case).
Adding a Custom Module Information

The last set of customization its is bit more complex since its a combination of the last two. It involves displaying a whole set of data from a custom module inside the vtiger inventory module as the following:

As I mentioned before, this a combination of tasks such as modifying the Smarty files, custom ajax calls, etc.

As you can see the customization possibilities are endless and it depends on what your company really needs.
    Blogger Comment
    Facebook Comment