Sage 100

 View Only
  • 1.  Recalc Cost in Sales Order

    Posted 06-09-2022 18:18
    Have a client on v2020 Advanced.  They noticed that when using repeating sales orders, the item cost is brought in from the date the repeating order was created.  There is no way to edit this either.  I understand this field is not used for assigning actual costs at time of sale, but this cost field is important to my client for forecasting purposes.  There is a Recalc Price button.  But this does not update the costs at all.  Has anyone encountered this issue before?  Is there something already out there to address?  A Recalc Cost button would be great.  The client uses average cost.

    ------------------------------
    Jon Parkinson
    Timac Business Systems
    ------------------------------


  • 2.  RE: Recalc Cost in Sales Order

    Posted 06-11-2022 16:09
    Should be able to use a script on the pre-write event of the SO_SalesOrderDetail table but you may or may not need to have it filtered for specific criteria, such as only for new lines being copied from a repeating order unless you want to update costs on every line on ever order whenever the line is modified. 
    There is an inherited method called GetItemCosts that you can pass the item code and warehouse code to, along with variables to hold four different costs which are returned into the variables.  You can then use SetValue on the UnitCost column with whichever cost you want to use.


    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 3.  RE: Recalc Cost in Sales Order

    Posted 06-13-2022 03:52
    I could never figure out how to use GetItemCost, but this old fashion method works as a pre-write script and could be conditional on whether the order was from a repeating order or to lookup a different cost basis:
    Set oItem = oBusObj.AsObject(oBusObj.GetChildHandle("ItemCode")) 
    r = oItem.GetValue("StandardUnitCost", nStandardUnitCost)
    r = oBusObj.SetValue("UnitCost", nStandardUnitCost)​


    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    ------------------------------



  • 4.  RE: Recalc Cost in Sales Order

    Posted 06-13-2022 14:06
    Thank you for your help.  I'm not experienced enough with scripting to attempt this myself.  My idea is to create a button that would re-write an entire sales order line by line - item, description, qty, price, memo and delete the original lines.  Sage will automatically update the costs to the current cost per item regardless of the costing method.  Open to anyone who would like to give this a go and willing to subcontract at an appropriate price.

    ------------------------------
    Jon Parkinson
    Timac Business Systems
    ------------------------------



  • 5.  RE: Recalc Cost in Sales Order

    Posted 06-14-2022 17:30
    Wouldn't it be best to preserve the line?  I can't recall off the top of my head if there are some fields at the line level for repeating orders like there are for master orders but this seems likely it would be very straightforward if you get the cost you want to use and set the value in the pre-write event of SO_SalesOrderDetail.  If you use the GetItemCosts method you could even customize the hierarchy in the script to control the order of cost used when one of them is zero.  You could also use the method Dan mentioned to get each cost separately but getting the average cost from IM_ItemWarehouse will require an object handle to the IM_ItemWarehouse_Svc class and so i think it makes more sense to just use GetItemCosts.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 6.  RE: Recalc Cost in Sales Order

    Posted 06-14-2022 21:56
    What object inherits the "GetItemCosts" method?

    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    ------------------------------



  • 7.  RE: Recalc Cost in Sales Order

    Posted 06-14-2022 23:15
    It is in SO_CommonEntryDetail and is inherited by SO_SalesOrderDetail_bus and SO_InvoiceDetail_bus.

    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------