Specifically, the emissions delete workspace deletes any emissions for locations that belong to the MP, but some of those emissions could belong to another MP for some quarters.
Additionally, the delete of QA_CERT_EVENT_SUPP_DATA is in the QA delete workspace although it is an emissions file with a FK to QA_CERT_EVENT, which is a QA file.
Programming Changes:
delete_monitor_plan_emissions_data_from_workspace: Currently the procedure deletes any emissions for locations associated with the specified MP. It should only delete them for the RPT_PERIOD_ID of EMISSION_EVALUATION rows with the MP.
delete_monitor_plan_qa_data_from_workspace: Includes the delete for QA_CERT_EVENT_SUPP_DATA, which is an emissions table. QA_CERT_EVENT_SUPP_DATA has an FK to QA_CERT_EVENT, but that FK has a cascade delete, so if the QA_CERT_EVENT is deleted first, the QA_CERT_EVENT_SUPP_DATA will also be deleted. So, this delete should move to the delete_monitor_plan_emissions_data_from_workspace procedure.
Correct the SP Used to revert workspace MP.
Programming Changes: