4Site
Support Request System
View Patch #50.012.005
Description
Patch ID:
Date Implemented:
Patch Title:
Patch Type:
Request IDs:
Bug
Enhancement
Other
02200 -
Can't post a receipt - duplicate index on sreqline error
Symptoms:
Posting a receipt got the error: "unable to insert current record into the stores table sreqline table. The statement has been terminated. Cannot insert duplicate key row in object sreqline with unique index strqln."
Solution:
1. Patch 4.19.5 changed the setup of sreqline.line so that it always equalled rcline.line. But for expensed GST lines there is no receipt line. So the reqline.line was blank. While not correct, it did work most of the time since the sreqid + blank did yield a unique line key. However, if there were multiple tax codes on the polines with different expensed GST accounts it would have still caused the problem since it would create > 1 sreqline as blank. To fix it I went back to the original code for creating the tax lines only - create the tax lines sreqline.line as isReqLineCnt, the counter of the number of sreqlines so far. The counter already counts the number of lines to load into sreqhdr.nextline. This allows for multiple tax lines. It is also what it used prior to patch 4.19.5. I left the restriction that sreqline.line = rcline.line for regular receipt lines since it fixed the original problem.
Browse Patches
Find a Patch
Return to Request System Menu