Page 1 of 1

Multi-company issue with GETing CostCenters in contractorInvoices endpoint

Posted: Wed Jul 03, 2024 9:46 am
by Grace
Hi,

We moved to a multi-company setup and noticed that GET from the API endopoint `api/v1.0/companies/{company_id}/contractorInvoices/{invoice_id}` stopped returning "CostCenters" as it used to in a single company setup.
Below is snippet of what we currently receive:
```
"CostCenters": [
{
"ContractorJob": 2236,
"CostCenter": {
"ID": null,
"Name": "Default Account",
"ExpenseAccountNo": "331"
}, ...
```
Every "CostCenter" is now null and every "Name" is "Default Account", whereas before we had a proper ID and name.

Similarly, when looking up invoices via UI, the displayed Cost Center is now "Default Account", which makes me think it might be a bug.
Can you confirm?

Re: Multi-company issue with GETing CostCenters in contractorInvoices endpoint

Posted: Mon Jul 08, 2024 12:36 am
by SimproAPITeam
Hi Grace,
When you invoice a contractor job. For example in Simpro there is a drop down list for cost centre. This is defaulted to "Default Account".

When selecting this it will show default account. You can select a different cost centre in this list and it should show the selected cost centre on the invoice, both in Simpro and the API.

Can you test and see if this changes your result?

I don't think this has anything to do with your company moving to multi company.

Regards

Re: Multi-company issue with GETing CostCenters in contractorInvoices endpoint

Posted: Mon Jul 08, 2024 10:04 am
by Grace
Hi,
Thanks for getting back to me.
I checked with our colleagues who process the invoices and they said that they don't actually manually change the default cost center on Simpro UI for contractor invoices. I agree that that this is not a bug in Simpro, it was actually a bug in our requests after we moved to multicompany :oops: . Sorry for making you investigate this and thank you for you time. You can close this ticket.

Kind regards
Grace

Re: Multi-company issue with GETing CostCenters in contractorInvoices endpoint

Posted: Mon Jul 08, 2024 11:39 pm
by SimproAPITeam
Hi Grace,
That's okay. I'm glad you got it sorted and can update your queries.

Regards