Updated my new PO procedure. Converted several sections of the procedure into dynamic SQL so that I can assign all of the necessary values at the top of the procedure and then reference them later on using only variables.