Announcement

Collapse
No announcement yet.

Custom Entity Quote : Agency Commission

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

  • Custom Entity Quote : Agency Commission

    Hi,
    I want to add a new entity in Quote as Agency Commission which is %age based on a total amount accumulative before tax. In simple, its same as Shipping cost but its in %age. How do I add it? What's the procedure and how to make it auto-calculate?

  • #2
    Hello
    what's about Formula usage?
    https://github.com/espocrm/documenta...ion/formula.md

    Comment


    • #3
      I created this function

      Code:
      agencyCommission=agencyCommissionPerc*amount/100;
      
      ifThenElse(addAgencyComission==true, 
      grandTotalAmount=agencyCommission+grandTotalAmount
      );

      but there is on issue, whenever I save my quote, it increase the price of grand total.
      I had set the amount to 15% , first save it was 375, it changed to 400, on next save it was 425... what am i doing wrong?

      Comment


      • #4
        After every saving!!! , if addAgencyComission is TRUE, grandTotalAmount increases by agencyCommision

        Comment


        • #5
          isn't grandTotalAmount generated on the runtime? by adding amount - discount + tax + shipping?

          Comment


          • #6
            Sorry, Before save fields are recalculated. You don't set full formula for grandTotalAmount, you used dependency on previous value. I think, if you set
            grandTotalAmount = agencyCommission + amount - discount + tax + shipping, it will work correctly

            Comment

            Working...
            X