Page 1 of 1
Setting material cost and markup through the API
Posted: Mon Mar 22, 2021 11:47 pm
by alexydm
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
})
Re: Setting material cost and markup through the API
Posted: Tue Mar 23, 2021 3:27 am
by Muqeet
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
}
}
Re: Setting material cost and markup through the API
Posted: Tue Mar 23, 2021 10:03 pm
by alexydm
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.

Re: Setting material cost and markup through the API
Posted: Wed Mar 24, 2021 12:10 am
by Muqeet
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.
Re: Setting material cost and markup through the API
Posted: Thu Mar 25, 2021 7:55 am
by alexydm
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...
Re: Setting material cost and markup through the API
Posted: Thu Mar 25, 2021 7:58 am
by alexydm
Correction: the estimate is appearing to be correct in my test