Fixing Cost Center entries

Good day all

Trust you are healthy and well ?!

I am running V13.26 and i picked up something on my GL not all entries are linked to
a cost center. I did some investigation and it is my fault …

I read this post …

Can I assume that I can fix this on the backend with some SQL-queries ?

Yes you can fix it with py script or sql updates.

Thank you so much @Pawan .

I just wanted to make sure I am not going to break anything !!

Yes as long as you update the correct tables you should be fine. Always take a DB backup before doing something like this.

You are absolutely right ! I shall make a backup.

I did also test the SQL commands on a test-system. I updated tabGL Entry and
tabPurchase Invoice and on the front-end interface, I can see the GL is updated
and opening an invoice that previously had no Cost-Center field, now displayes the
Cost Center field.

The only thing is … I will have to do the entries one by one because when I created an
SQL statement with a “*” in it complained. So, either I do one by one or try writing a script.
The thing with a script is , one has to be very sure it does what you want it to do … otherwise one can start a script and it can run through my entire database and perhaps do other things !! And also, its not like the corrections must be performed from entry 1 -40 …
its a few corrections here … and then a few further on…etc.

Anyway. its better than to have to scrap the server and enter all invoices again by hand !!!
I see there are cost_center fields for
tabPurchase Invoice
tabPayment Entry
tabGL Entry
so these are the tables I shall tackle one by one.

Thanks for your time ! Appreciate it !