4Site
Support Request System
View Patch #50.024.003
Description
Patch ID:
Date Implemented:
Patch Title:
Patch Type:
Request IDs:
Bug
Enhancement
Other
02497 -
Wrong company on PR costing
Symptoms:
1. If you uncheck 'copy costing' it opens up a text box and a combo box for costing. No validation is done to ensure the entered costing is for the same company as the PR's divouid - 3 places to fix. 2. PR copy allows WH as a cost type. No validation to ensure it is valid for the type or PR nor the divouid. This is also only valid type in Bids. The code that did the validation of the warehouse in ValidatedCopyCosting in route VALIDATEWH didn't have a period between the column name and the table alias 3. In testing this in debug I found it was going through code unnecessarily. I was also looping through the validation code multiple times for each entry. 4. If you copied a PR created in Bids (srcdoctype = B) then you got an SQL error 'NULLUNION'. No space between the words NULL and UNION under this scenario. In cmdButton Click module InsertPrLines. The 2nd error if the PR was created in Bids was an invalid column prefix 's' because it used the aliased column s.supseqno even though it didn't join to the prsup table if it was a Bid. Even if you copied a non-Bid PR there was no space before UNION but in this case it could distinguish between the 'A' and UNION. I still fixed it.
Solution:
1. Fixed the bug that allowed the costing to be from a different company than the PR.divouid. It now checks that the entered cost code is for the same company. As part of this I also changed the default costing that would come from the approving dept. This was the other way you could get mixed costing. If the approver was in company APP and the orgunit has a default cost account of A08 but the PR was for company ARP the default costing if you unchecked the 'copy costing' would be A08- acct. If the user continued with the copy the ARP PR would have APP costing which is wrong. After my change this would get caught but I changed the cost to not even load a default if it would be invalid. 2. The cost type's were AC, WO and WH. I removed WH as a possible value for you to change to. If you copy the PR with its costing of WH it will do the copy as is. This costtype was only intended for Bids originally. It has caused problems with creating PO's from these type of PR's. Besides, the code wasn't validating to ensure the stock existed in that warehouse, that it was for the right divouid or that there were even lines with stocid's on them. I did fix the SQL to have a period after the table alias, not that it should ever be called again. 3. In the AC and WO validation, it was doing checks for status and other things even if no record had been retrieved. Moved this code inside the If recordcount > 0 code. There were also other places where it did processing on records even though the scostcode was blank -it is inefficient plus could cause problems in the case of WO costing since the scodecode got set to 00000. I put code in to check if scodecode = "" then skip by validations. 4. Fixed the SQL for all 3 problems
Browse Patches
Find a Patch
Return to Request System Menu