Closed stb-kslater3 closed 3 years ago
It works correctly in RSPilot, so what is different about Production?
In any case. There are 2 possibilities off the top of my head for why this would be double placing a body PO. Either, getPOs( ) is double giving me that Body PO, or loadPOsFromPOLines( ) has a mistake in the logic when it goes and says find the body and take it out of the "others" list.
I checked and it definitely only gives 1 body in the call to getPOs( ). So it comes down to finding out why I added it twice within loadPOsFromPOLines( ). . . . Okay I found the culprit. I was using Javascripts Array.prototype.find instead of Array.prototype.findIndex on "others" and so when I went to Splice I wasn't splicing on the correct index. Also, I performed a check before splicing that used the return value of find which if 0 would be falsy, so if the first other found was body then it would not splice it. Anyway fixed those
The Body PO on this admin checklist is getting pulled as both a Body and an Other. The first couple things that come to mind for potential sources: