Way to set Price to Cost on Sales Order?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffreysgrossman
    Senior Member
    • Jan 2025
    • 144

    #1

    Way to set Price to Cost on Sales Order?

    We are trying to come up with a way to set the price of items on a sales order to change over from price to cost. These are only for a select few accounts that are internal accounts. We tried setting up price books to do this. But I was not able to figure it out. Is this something that is possible with price books? Without having to create a price book for every product?

    Then I thought I could use the workflow module to have a manual workflow to set the price field and change it to the cost field on the product. I do believe this is possible but I have not yet been able to figure out how..

    So if anyone can help me figure out the way to have a workflow button do it or set up a pricebook to do it I would be very appreciative.
  • lazovic
    Super Moderator
    • Jan 2022
    • 1187

    #2
    jeffreysgrossman,

    Example:
    1. Create a new Price Book or use the existing one.
    2. Create a new Price Rule Condition with the following details:

      Click image for larger version

Name:	image.png
Views:	0
Size:	19.8 KB
ID:	122751
    3. Go to Price Book from step 1 and create a new related Rule in the bottom panel (choose Conditional target and created condition; the rule must be based on Cost):

      Click image for larger version

Name:	image.png
Views:	0
Size:	25.9 KB
ID:	122752
    4. Create a Sales Order with the account with Partner type and created Price Book; choose the product in the item list:

      Click image for larger version

Name:	image.png
Views:	0
Size:	51.9 KB
ID:	122753
    Thus, the price for products will be set as Cost Price if an account with a specific type and a price book with a condition that responds specifically to this type are selected in the Sales Order.

    Please let us know if everything works as you need.​​

    Comment

    • lazovic
      Super Moderator
      • Jan 2022
      • 1187

      #3
      jeffreysgrossman,

      Please also note that for correct functionality, your Sales Pack extension version must be the latest (you can download it from the EspoCRM customer portal).

      Comment

      • jeffreysgrossman
        Senior Member
        • Jan 2025
        • 144

        #4
        Thank You lazovic I see now how to set the price off of the cost.. However this brings up something else. We use the template to set case size and load all the correct cases to a variant for case size. We calculate out the correct case size by multiplying the unit cost times the case count. Works really well for selling pre defined cases. However the cost field is read only on the variants? The main product will let you put a cost but when you have a variant it will not let you adjust the cost for the variant? This feels more like a bug than a feature? Do you understand why this limitation is there?

        Is there a way to write in the price book to multiply the cost times the custom field we have for case unit count? Or can the reason for the cost to be read only on the variant be explained. It does not seem like a good feature to restrict us from being able to calculate the correct cost based on unit count for a case?

        Click image for larger version

Name:	image.png
Views:	0
Size:	28.4 KB
ID:	122764

        You can see here how I am getting the Unit Ct field to represent the actual unit count but we have calculated the list price to be the unit price times that number. We did this because it seems like the only way to get the correct cases to be filtered when filling delivery orders. Now the only problem is the cost wont let us set it per variant. The correct cost should be 18 * $17.72 = $318.96.. Our scripts are trying to set this correct price in ESPO but ESPO will not let us? Anyone know why or how to fix this?

        If anyone knows how to change the system to allow us to set cost specifically on variants differently than the main product that would be great info.

        Comment

        • victor
          Active Community Member
          • Aug 2022
          • 1044

          #5
          how to change the system to allow us to set cost specifically on variants differently than the main product that would be great info.

          1. Create a separate Price Book with the desired price (screenshot 1).
          2. Create a Product with the Template type with different Options. And generate Variants based on your created Options (screenshot 2).
          3. Go to the desired Variant and select a price specifically for it from the separate Price Book from point 1 (screenshot 3).

          You should simply select this created Variant only when you are working with Sales Order. When you work with, for example, Quote - just select another Variant.
          Attached Files
          Last edited by victor; Yesterday, 03:47 PM.

          Comment

          • jeffreysgrossman
            Senior Member
            • Jan 2025
            • 144

            #6
            victor thank you for this. I think it looks like this approach would require us to set every product up on the price section. This is not going to work for us unless we can use an API script to build this Price Book? Is that possible? Can we actually write to a price book from the API to put in all the correct (price) which is actually cost x cause unit count.

            Do you have any insight on why the cost field on Variants is not editable? I think i will put a new post on that specifically. If we had that ability we are set. But right now the system locks us out from setting different costs on Variant level. We can set diff price, just not cost.

            Comment

            • yuri
              EspoCRM product developer
              • Mar 2014
              • 9501

              #7
              Hi Jeff,


              Regarding the Variant Cost Price. Is it not editable for you? I cannot reproduce this problem. Maybe you have set the Cost Price to be synced with the Template in the Product entity type settings? Administration > Entity Manager > Product > Edit > Variant Sync Fields. If the Cost Price field was added there, it will be read-only.

              Regards
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment


              • jeffreysgrossman
                jeffreysgrossman commented
                Editing a comment
                That was it!!!!! OMG thank you sooooooooooo much! we are now off to the races!
            Working...