Announcement

Collapse
No announcement yet.

Opportunity » Amount Value Update

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Opportunity » Amount Value Update

    Good afternoon,

    We have implemented the EspoCRM and we have made some customizations at "Opportinity Items" in base to our needs.

    This customizations are all about new fields and formulas which already works perfectly.
    In attach there are some images about them.

    The problem happens when the opportunity is saved.
    The field amount at "Opportinuty" doesnt update properly with the amount value (SubTotal) at "Opportunity Item".

    As you can see in the images attached, the amount at Opportunity gets the previous value any time that we save/edit the opportunity.

    Could someone help us?

    Best Regards!

  • #2
    Afternoon,

    we have solved this problem making some changes at opportunity-calculation-handler.js file

    But we make some different formulas per opportunity item since the brand of them where equals to a value.
    The problem is that we cant get the brand at opportunity item because it is a value from a related entity.

    How could we solve this problem?

    We have tried create a foreign field at opportunity item but it only show us the name of the product.

    Thank you.

    Comment


    • #3
      Hi,

      In calculation handler you can extend selectProduct method. Copy product brand field to OpportunityItem brand (not existing by default) field. You need to create a custom field for OpportunityItem that will store brand name (or ID).

      Comment


      • #4
        Morning Yuri,

        I have already made a relationship between "Opportunity Item" and "Product Brand", but it's still not working and I don't really know why.

        All product added at the EspoCRM have a brand associated but when I chose them at Oppotunity Items, the brand doesnt appear.

        Do you know what am I doing wrong?

        Thank you,
        Best Regards!

        Comment


        • #5
          I have already got the brand at opportunity item but now its happening something different.

          The formulas now work properly but the problem starts when try to plus the values from each opportunity item it give a value quite diferently.

          Why is this happening? Could someone help?

          Comment


          • #6
            Might be calculation on the server side differs? On server side calculation should be also customized.

            Comment


            • AGil
              AGil commented
              Editing a comment
              The formulas that I have shared were made at the files .js available at server.

          • #7
            There are two ways to make formulas for us:

            a) (unitPricequantity)-(partnerDiscount/100)(unitPricequantity); when the product its diferent from "Ubiquiti or Perle" Brand
            b) (unitPrice
            quantity)+(partnerDiscount/100)(unitPricequantity); when the product its "Ubiquiti or Perle" Brand

            so in the last img that I have shared, we have two item opportunities where the first one is a product diferent than ubiquiti or perle and the second one its ubiquiti one.

            The value per line its ok, but when the systems try to plus both and update the amout at opportinity entity, the system plus both lines as they were both products different from Ubiquiti.

            As you can see with my explanation at in the img, thats not right!

            So, where should be the problem this time? What should we do?

            If someone could help, we are lost with this problem :s

            Comment


            • #8
              HI AGil,

              Can you please share how you add the additional fields from 'Items'?

              Comment

              Working...
              X