Update Home Landed and Suppliers Cost  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Update Home Landed and Suppliers Cost

Postby DannyC » Wed Aug 31, 2022 12:46 pm

How feasible would it be to knock up a plugin which only updates the purchasing Home Landed Cost and Suppliers Cost, currently ticked in Sys Configuration for Purchase Orders, GRNs and Purchase Invoices, to only update if the existing costs are lower?
My client doesn't want any costs to update if something was purchased from their suppliers at some kind of special, discount etc. Particularly IN_Main.LCost. That should remain at the highest cost.

cheers
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Update Home Landed and Suppliers Cost

Postby Mike.Sheen » Wed Aug 31, 2022 12:54 pm

DannyC wrote:My client doesn't want any costs to update if something was purchased from their suppliers at some kind of special, discount etc. Particularly IN_Main.LCost. That should remain at the highest cost.


You're preventing the price from EVER going down by doing that. I get you want to preclude specials / promotions, but is by only ever allowing an increase might not be the best way - what about a way of flagging the PO or PO Line as being a promotional price and THAT being what determines if the last cost gets updated?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Update Home Landed and Suppliers Cost

Postby DannyC » Wed Aug 31, 2022 5:04 pm

You're preventing the price from EVER going down by doing that

Yep. The client knows that.

what about a way of flagging the PO or PO Line as being a promotional price and THAT being what determines if the last cost gets updated?

Good idea.
Progressing that thought, I think for this client it would be most relevant to put a custom field on the purchase invoice line. So if I add a checkbox to PI lines, how then would I stop the costs getting updated? I know how to read the custom field, its the prevention of updating which I am a bit stumped on.
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Update Home Landed and Suppliers Cost  Topic is solved

Postby Mike.Sheen » Wed Aug 31, 2022 5:16 pm

There is a system setting, UpdateLastCost - which when set to False will cause Purchase Invoices, GRN's and Shipment BookIns to NOT set the last cost (IN_Main.LCost) when activating.

As our business logic objects all typically follow a pattern where the system settings they are interested in are cached into a SystemSettings class at the time of the business logic being created, a Plugin could selectively set that value to control the behaviour.

So, PurchaseInvoice.SystemSettings.UpdateLastCost set to False won't change the actual system setting, but the cached copy it uses, which makes the Purchase Invoice behave as if it was set to False. Same applies to Purchase Orders and BookIns.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Update Home Landed and Suppliers Cost

Postby DannyC » Wed Aug 31, 2022 5:29 pm

Righto. That gives me something to go on.
Appreciate the help. :)
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 32 guests