Editing bill catergories

hi,

my book keeper has put all our bills on freeagent, but many are in the
wrong categories as they dont understand which category certain purchases
shoudl go into. - not a problem, how would they know.

Thats fine, i thought i’d create a little php app which would set all bills
from a particular supplier to the same cost of sale category.

but im struggling.

Im pretty sure my code is right as it sometimes works… but.

for some income categories it says “Cost of Sales or Admin Expenses
category expected, got Income Category” - im definatly passing a cost of
sale code (106). Odd cos it works in some cost of sales eg (100).

also on some bills it comes up with “manual_sales_tax_amount is locked and
cannot be changed” i am literally just sending the category in the put
command, im not trying to change the tax, and the cat its changing from and
to both have the same tax setup.

The GUI allows me to make both of these changes without any issues, so i
think the api has a bug.

kind regards

stuart

Hi Stuart,

I’m sorry to hear you’re having problems with the API. Looking at our logs
I think I’ve found your requests. You seem to be sometimes sending the
category as a URL and other times you’re just sending the nominal code
through. Why is this and are you seeing errors coming back with both forms
or just one of them? The correct way to update a category is to send the
new category as a URL as described in the docs -
https://dev.freeagent.com/docs/bills.

I’m not sure why you are seeing a manual_sales_tax error. Can you show me a
request for a bill where you get this error please?

Regards,
Harry MillsOn Thu, Jul 17, 2014 at 4:06 PM, sjeffrey133@gmail.com wrote:

hi,

my book keeper has put all our bills on freeagent, but many are in the
wrong categories as they dont understand which category certain purchases
shoudl go into. - not a problem, how would they know.

Thats fine, i thought i’d create a little php app which would set all
bills from a particular supplier to the same cost of sale category.

but im struggling.

Im pretty sure my code is right as it sometimes works… but.

for some income categories it says “Cost of Sales or Admin Expenses
category expected, got Income Category” - im definatly passing a cost of
sale code (106). Odd cos it works in some cost of sales eg (100).

also on some bills it comes up with “manual_sales_tax_amount is locked
and cannot be changed” i am literally just sending the category in the put
command, im not trying to change the tax, and the cat its changing from and
to both have the same tax setup.

The GUI allows me to make both of these changes without any issues, so i
think the api has a bug.

kind regards

stuart


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

Hi Stuart,

Sorry it has taken so long to get back to you. I’m still looking in to why
you cannot move that particular bill between those categories and I’ll let
you know what I find. In general for the other problems you’re having I’m
sorry the API bug is causing such trouble. We’re certainly looking at
scheduling a fix but I’m afraid I can’t give you a timeframe for it. Your
best bet may be to use your batch approach for those that it works for and
record the ones that don’t work in a manner that makes it easy to change
through the app.

The problem with categories having the same name only affects the API and
doesn’t have any affect on anything in the main GUI.

Regards,
Harry MillsOn Thu, Jul 24, 2014 at 10:15 AM, sjeffrey133@gmail.com wrote:

ok thanks for the reply.

i understand what you are saying.

But i have setup some unique categories, and it does in some circumstances
work now. but i would have thought i could move bill - 3346933 to new
(unique) cost of sale category 110 as it is also comeing from a unique cost
of sale to start with, and also in an unlocked period. but Im still
getting “manual_sales_tax_amount is locked and cannot be changed”

im trying to avoid doing each bill individually through the GUI but it
looks like it might have been the easiest way of doing this. (as a coder
i’d prefer to create an interface to allow me to do this in batches quicker
then individually) - do you think there is any hope for me to get this
working, including changing items in locked periods, as achievable through
the gui? any idea when you will resolve the API issue?

also i presume having income and outgoing categories with the same name,
isnt affecting anything through the main gui… eg my nominals and
corporation tax calculation?

thanks

stuart


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

ok i think it does work, but not if there is a payment against the bill.

any way that can be fixed? basically i can change the category of pretty
much any bill in the gui, even if its in a locked vat quarter or got
payments, but the API seems to be very fussy.

thanks

stu

Hi Stuart,

Sorry I haven’t replied to you sooner. I’ve spent a bit more time digging
into the problem and I’ve found what the cause of both issues is. As you
suspected, we do unfortunately have a bug in the API.

On your account you have two categories with the same name; one Income
category and one Cost of Sales category. When the API looks up categories
it uses the category name as well as the nominal code and so, in the first
case, thinks the new category is an Income category when it’s expecting a
Cost of Sales category. In the second case it thinks the current category
of the Bill is an Income category therefore changing to the new category
would change the VAT on the bill.

There is a potential workaround. If you can move all of the transactions
explained against the custom category to a different category temporarily
you will be able to rename the category so the names are all unique.
However, if some of these transactions are in a locked VAT period then
unfortunately that won’t be possible and I think you’ll need to change the
categories through the UI.

Regards,
Harry MillsOn Tue, Jul 22, 2014 at 12:24 PM, sjeffrey133@gmail.com wrote:

was this information of any use to help you diagnose?

On Monday, July 21, 2014 8:56:59 AM UTC+1, sjeff...@gmail.com wrote:

hi Harry

when i set invoice id 3316312 to cat 106 i get “Cost of Sales or Admin
Expenses category expected, got Income Category”

when i set invoice id 3280553 to cat 270 i get " manual_sales_tax_amount
is locked and cannot be changed"

i origionaly coded with the category URL, and then tried as just the
number, just trying to get it working.

kind regards

stuart


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

HI Just wondering if this is fixed yet?

thanks

stuartOn Thursday, August 14, 2014 9:40:10 PM UTC+1, sjeff...@gmail.com wrote:

ok i think it does work, but not if there is a payment against the bill.

any way that can be fixed? basically i can change the category of pretty
much any bill in the gui, even if its in a locked vat quarter or got
payments, but the API seems to be very fussy.

thanks

stu

hi harry,

did you find anything on that bill?

stu

Hi Stu,

Sorry it’s taken so long to get back to you. I’ve managed to find a way for
you to successfully update bills that are reporting the
manual_sales_tax_amount changing. When you change category we take the
amount of VAT from the category unless it’s already set or if you tell us
otherwise. When changing the category if you pass a “sales_tax_value”
parameter of “AUTO” it’ll allow you to change the category of the bill
without trying to set the manual_sales_tax_amount.

This is because if you don’t specify the amount we use the already
specified VAT amount (reported as sales_tax_value as it’s calculated by
FreeAgent) and change it to be a manual_sales_tax_amount so it’s not
overridden by changing the category (as you haven’t asked to change the
sales tax, just the category). Because it’s in a locked period this fails.
Telling us you want to use the new categories VAT rate (using AUTO) will
allow you to switch between categories with the same VAT rate. The
following shows the working JSON I’ve used when testing this.

{
“bill”: {
“url”: “https://api.freeagent.com/v2/bills/40”,
“category”: “https://api.freeagent.com/v2/categories/270”,
“sales_tax_rate”: “AUTO”
}
}

Regards,
Harry MillsOn Wed, Aug 6, 2014 at 11:10 AM, sjeffrey133@gmail.com wrote:

hi harry,

did you find anything on that bill?

stu


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

hi Harry

when i set invoice id 3316312 to cat 106 i get “Cost of Sales or Admin
Expenses category expected, got Income Category”

when i set invoice id 3280553 to cat 270 i get " manual_sales_tax_amount is
locked and cannot be changed"

i origionaly coded with the category URL, and then tried as just the
number, just trying to get it working.

kind regards

stuart

was this information of any use to help you diagnose?On Monday, July 21, 2014 8:56:59 AM UTC+1, sjeff...@gmail.com wrote:

hi Harry

when i set invoice id 3316312 to cat 106 i get “Cost of Sales or Admin
Expenses category expected, got Income Category”

when i set invoice id 3280553 to cat 270 i get " manual_sales_tax_amount
is locked and cannot be changed"

i origionaly coded with the category URL, and then tried as just the
number, just trying to get it working.

kind regards

stuart

ok thanks for the reply.

i understand what you are saying.

But i have setup some unique categories, and it does in some circumstances
work now. but i would have thought i could move bill - 3346933 to new
(unique) cost of sale category 110 as it is also comeing from a unique cost
of sale to start with, and also in an unlocked period. but Im still
getting “manual_sales_tax_amount is locked and cannot be changed”

im trying to avoid doing each bill individually through the GUI but it
looks like it might have been the easiest way of doing this. (as a coder
i’d prefer to create an interface to allow me to do this in batches quicker
then individually) - do you think there is any hope for me to get this
working, including changing items in locked periods, as achievable through
the gui? any idea when you will resolve the API issue?

also i presume having income and outgoing categories with the same name,
isnt affecting anything through the main gui… eg my nominals and
corporation tax calculation?

thanks

stuart

hi harry.

any reply to this, or is the API just not going to achieve what i need it
to.

stu

hi harry,

im still struggling with this.

if i try and change invoice 3346785 to cat 285 it says sales_tax_rate is
locked and cannot be changed, this is when i also do as you suggest and set
the sales tax rate to auto.

sorry im so desperate to use this which ive coded.

stu

hi,

sorry for raising this very old thread, but i see this issue still isnt fixes.

its not possible to change the category of bills in the api if a payment has been made, even though this is possible in the web GUI.

This is causing us big issues.

thanks

stuart.