Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL bug in Item Maintenance re. stock category
09-03-2013, 11:01 PM,
#1
SQL bug in Item Maintenance re. stock category
Have found that changing stock category causes an SQL error due to the syntax of the inserts into
gltrans - the generated SQL is missing the closing parenthesis, has quotes around numeric columns, and has a mis-spelt variable ($NewStockAccount - should be $NewStockAct). My corrected version is as follows (the other 3 gltrans inserts are modified similarly) :

$SQL = "INSERT INTO gltrans (type,
typeno,
trandate,
periodno,
account,
narrative,
amount)
VALUES ( 0,
" . $JournalNo . ",
'" . Date('Y-m-d') . "',
" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . ",
" . $NewStockAct . ",
'" . $StockID . ' ' . _('Change stock category') . "',
" . ($UnitCost* $StockQtyRow[0]) . ")";

As an aside, I always use "heredoc" syntax for statements like this, as it makes it so much easier
to embed quotes. Hope this helps.
Reply
09-04-2013, 06:47 AM,
#2
RE: SQL bug in Item Maintenance re. stock category
Thanks tomglare - looks like this is already fixed in the latest code.
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply
09-04-2013, 08:35 AM,
#3
RE: SQL bug in Item Maintenance re. stock category
(09-04-2013, 06:47 AM)phil Wrote: Thanks tomglare - looks like this is already fixed in the latest code.

Good afternoon,
Thanks for sending information about my problem. This is to prevent these errors, but once you have entered the information, as I do to correct the huge variations in Balance Sheet?. Would you please indicate which table stores individual transactions account.

Beforehand grateful.
Note: I deleted manually via phpmyadmin wrong income, but my mind over and Adjustment Inventory Inventory remains with billions of difference.
Javier G.
Reply
09-04-2013, 08:46 AM, (This post was last modified: 09-04-2013, 08:48 AM by phil.)
#4
RE: SQL bug in Item Maintenance re. stock category
Did you post to the correct thread here?
It sounds as though you have incorrect set up of GL accounts - I'd say you really need some professional support and your issues are not specific enough to be able to diagnose on the forum.
Don't be frightened to ask for paid support if you need someone to login and spend an hour sorting out a problem for you there is a list of support people at - this is a good way to give back to the people who make this software possible for everyone.
http://www.weberp.org/Support.html

You can delete general ledger transactions from the gltrans table and rerun the posting from Z_RePostGLFromPeriod.php However, you will end up with inconsistent transactions elsewhere and stock movements orphaned etc - ongoing problems will recurr. Deleting gltrans really needs professional support or deep knowledge of the system
Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)