Bill of materials for Opportunities

The purpose of this post  is to describe the first customization made on Zurmo Covering the minimal use case “Bill of Materials for Opportunities”.

Introduction

In this use case, Opportunities will be treated as garments that we need to produce, and the garments are assembled using Materials (Ex: Fabrics, trims, etc…).

In this first iteration we implement a very basic case but with some important requirements:

  • Attach images to both Opportunities (Garments) and Materials.
  • Thumbnail view of the material in search view.
  • Associate materials to opportunities, having the list in the OpportunityEditAndDetailsView.
  • Each Time a Material is associated to an Opportunity the total cost of the Materials must be calculated converting to the currency specified in the Opportunity->Amount field.
  • We should be able to remove Materials from the opportunity.
  • Some extra operations can be realized via CBR (Custom Business Rules) to multiple selected materials in the list.

The following sections will describe how each of these requirements have been implemented.

Attach images to both Opportunities (Garments) and Materials

Using the “Image Gallery” module it has been very easy to add images.

Materials Module

A new customized module has been added to define Materials.

Thumbnail view of the material in search view

To implement this request some changes has been made to the “Image Gallery” in order to return the thumbnail image in the appropriate size, and a new column adapter has been used in the MaterialsListView.

Associate materials to opportunities, having the list in the OpportunityEditAndDetailsView

In order to associate Materials to Opportunities a new module called bomdetails has been customized.

This module holds the information of the link between a Material and an Opportunity.

After the link is done using a new customized view based on the RelatedListView, the data is presented in the Opportunities module.

Field to calculate total price of Materials

Using an action element that has been added to the “toolbar” section of the RelatedListView, some Ajax and a new function in the model, we have been able to add the field that sums the total prices of materials converting to the specified currency

We should be able to remove Materials from the opportunity id required

A new column adapter has been added to allow deletion of individual lines.

Extra operations can be realized via CBR to multiple selected materials in the list

In order to allow the selection of elements the Bom details related ListView inherits from SecuredRelatedSelectableListView, this way we can reuse the standard behavior from Zurmo.

After the elements are selected it’s very easy to retrieve them elements and operate on them using an action element.

This is all for this post, the solution will continue to evolve and we’ll keep you informed on the evolution in new posts.

Leave a Comment

  • Luca Mainieri

    Hi,
    I’ve just started playing around with Zurmo and it looks great, but I do not understand how to proceed to create a custom module or add different modules like you are showing in this post. There is any tutorial and how to on this topic I can read? thank you

  • William Green

    @raystoeckicht:disqus Is there a repository that has the code for this customization? There are several pieces to this example that would be great to dig into and try to implement. Thanks.

    • Ray Stoeckicht

      @windsor might have it (http://zurmo.org/forums/index.php?/user/2490-windsor/). He was trying to track it down. If you join the Dev Session next week, he should be on and we can ask him.

      • William Green

        Thanks @raystoeckicht:disqus , but I won’t be able to attend the Dev Session next week. Hopefully, Windsor has it and can post it to this thread for the entire user community. Fingers crossed.