Question

Schedule Calculate Shop Order Costs

  • 2 December 2019
  • 13 replies
  • 953 views

Userlevel 6
Badge +13
  • Hero (Customer)
  • 346 replies

Does anyone know if it’s possible to schedule the “Calculate Order Cost” for all Shop Orders on a particular site or can this job only be run manually one shop order at a time?

 

 

Thanks

 


13 replies

Userlevel 6
Badge +12

Hi, Calculate Order Costs, which calculates/recalculates the shop order cost estimate amounts, is calculated automatically when you (1)create anorder or (2) modify an order. When it comes to (2) system recalculates the shop order estimate cost when the shop order status is: Planned, Released, Reserved. You can manually calculate a shop order which is Started.

The logic looks at the components and operations that are connected to the specific Shop Order.

Do you really need to schedule this job?

-Mats

Userlevel 6
Badge +13

We are looking to do some reporting based on Estimated SO Costs.  Our material costs change frequently.  We create our Shop Orders in advance and don’t really modify them. 

So, for example, material cost on SOs created at the beginning of the month may change throughout the month so the estimated cost at the beginning may differ from start of month to end.  

If we are reporting daily or weekly and don’t run the re-calc and don’t modify the SO we’ll not pick up the change in cost.

Scheduling the re-calc would also then mean we could state the reporting was as at ‘x’ period of time (ie when job ran).

Hope that makes sense!

Linda

Userlevel 6
Badge +12

Hi again,

Perhaps you know below already… Anyway here we go:

If estimated level- and accumulated cost per shop order is good enough you can run the “Aggregate Shop Order Costs per Shop Order” job. You can schedule this job. The result is visible in the overview screen Shop Orders Costs, however as I indicated, result is per Shop Order and not per Shop Order AND Cost Bucket level.

-Mats

Userlevel 6
Badge +13

Hi @majose

Thanks for the information.  

Could you clarify?  You seem to indicate the “Aggregate...” job does the same as the RMB/Calculate Order Costs but then say result is not per Shop Order and Cost Bucket.  I’m not sure I follow?

Regards

Linda

Userlevel 6
Badge +12

Aggregate Shop Order Costs per Shop Order job basically uses the same logic as Calculate Order Costs, but result is aggregated per Shop Order, while Calculate Order Costs saves data per Cost Bucket. In above screen the Total Estimated Cost should match with the sum in “Shop Order Costs/Order Cost Estimates” tab, if they are calculated at the same date.

Cheers

-Mats

Userlevel 6
Badge +14

@PRODQ 

If you need the bucket cost. E.g. data from SHOP_ORDER_VARIANCE2 or SHOP_ORDER_COST_BUCKET you have to either open each order in the shop order costs window or run the procedure SHOP_ORDER_COST_UTIL_API.Calc_Shop_Order_Cost_Details from somewhere (someone correct me if i’m wrong).

Attached is an event action that make the calculation when a SO is closed. You can also do it inside a loop of SO’s, but that will require a Database task. 

I am not sure about the unique_user_id_, but someone else might help with that.

 

Userlevel 6
Badge +13

Thanks for the input, folks.  This is turning into a really interesting thread and helping my understanding too.  

Yes, I do need the “Cost Bucket” rather than the “Aggregate” because we’re reporting only against the Material Cost (bucket 110).  

I can certainly move forward with your event action, Hans, with our tech supporter.  Many thanks for sharing.  

Linda

Badge +3

@PRODQ did you ever get this resolved?  We are running into the same situation and though @Hans Andersen ‘s idea is great, I cannot seem to get the wrapper working.

Userlevel 6
Badge +13

Hi @Hans Andersen   I’m afraid I didn’t pursue this … and then Covid got in the way!

Badge +3

Thank you @PRODQ .  I was able to get this to work by setting up a migration job.  Basically, the migration job uses SHOP_ORD as the Source and then uses the  API call to run the process. 

 

 

 

 

 

 

Userlevel 6
Badge +14

@aprough , can you be more specific about what you are trying?

Badge +3

@Hans Andersen .  Apologies; I have this figured out.  Like the OP, I had a requirement to calculate the bucket level costs and the variances for a large number of Shop Orders.  Since IFS only does those calculations when the SO is called up in the Shop Order Costs screen, I was trying to find a way to do it “behind the scenes.”

 

I had found the API call that I needed using Debug Console (and that you mention above) but could not figure out how to create a loop or other “wrapper” function to get it to do it for all SOs.  However, I was finally able to create a Migration Job that uses the information in SHOP_ORD table to call the API.  Roundabout way to do it, but it works like a charm.

 

My last response above was my solution in case anyone else needs to do something similar in the future. 

Userlevel 6
Badge +14

A migration job sounds like a splendid idea. I would give that a best answer.

Reply