Setting material cost and markup through the API

Posts about the simPRO API. Help/support/how-to etc.
Forum rules
  • Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
  • No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
  • Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
  • Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
  • Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
  • Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
  • Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
  • Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Post Reply
alexydm
Posts: 11
Joined: Wed Dec 02, 2020 6:31 am

Setting material cost and markup through the API

Post by alexydm » Mon Mar 22, 2021 11:47 pm

Hi,

Is there a way to set the material cost so the materials markup can be calculated. When we set the SellPrice and BasePrice for the job cost centre catalog item via the API (as shown below), the Materials Cost field on the simPRO UI shows 0.

Code: Select all

job_cost_center_catalog_item = Simpro.create_job_cost_center_catalog_item(company['ID'], job_id, section['ID'], job_cost_center['ID'],{
        Catalog: simpro_catalog['ID'],        
        SellPrice: price.round(2),
        Total: {Qty: item.quantity}        
        Total: {Qty: item.quantity},
        BasePrice: simpro_nett_price || 0   
      })
Muqeet
Posts: 772
Joined: Mon Dec 03, 2018 3:24 am

Re: Setting material cost and markup through the API

Post by Muqeet » Tue Mar 23, 2021 3:27 am

Wasn't able to reproduce the issue.

I set the Base and Sell price of cost center catalog item through rest api, the UI then showed BasePrice in Price column and SellPrice in Sell Price column and markup automatically calculated and displayed accordingly.

Code: Select all

https://{build-url}/api/v1.0/companies/{companyID}/jobs/{jobID}/sections/{sectionID}/costCenters/{costCenterID}/catalogs/

Code: Select all

{
	"Catalog": {CatalogID},
	"BasePrice": 9,
	"SellPrice": 10,
	"Total": {
		"Qty": 1
	}
}
Muqeet
API Developer | simPRO Software Group
alexydm
Posts: 11
Joined: Wed Dec 02, 2020 6:31 am

Re: Setting material cost and markup through the API

Post by alexydm » Tue Mar 23, 2021 10:03 pm

It doesn't seem to appear on the summary for the Job Cost Centre or in the Job Summary itself. I'm not sure where those UI fields that you mentioned are.

Image
Muqeet
Posts: 772
Joined: Mon Dec 03, 2018 3:24 am

Re: Setting material cost and markup through the API

Post by Muqeet » Wed Mar 24, 2021 12:10 am

I was referring to the Parts and Labour tab on a cost center page. Didn't realise you were talking about summary table actual and estimate fields.

In UI, a catalog can be added to cost center which does not have to be in stock. When a catalog is added, only estimate in summary table will be updated and actual will be 0. This is supported in rest api through cost center catalog endpoint.

The other way in UI is to use an item for a cost center from inventory. When a stock item is added, actual amount will be updated as well. Adding items from inventory is not yet supported in rest api.
Muqeet
API Developer | simPRO Software Group
alexydm
Posts: 11
Joined: Wed Dec 02, 2020 6:31 am

Re: Setting material cost and markup through the API

Post by alexydm » Thu Mar 25, 2021 7:55 am

Hi Muqeet,

Thanks for the clarification. So are you saying that the summary tables on the Job and Job Cost Centre will not show the actual Materials Cost, not even as an estimate? At the moment, even the estimate is not showing the right number. Does it change even someone manually assigns inventory to the job once it has been created via the API first? That is the plan at the moment...
alexydm
Posts: 11
Joined: Wed Dec 02, 2020 6:31 am

Re: Setting material cost and markup through the API

Post by alexydm » Thu Mar 25, 2021 7:58 am

Correction: the estimate is appearing to be correct in my test
Post Reply