IDEMPIERE-1904 Incorrect document status when void a document with completed document status

This commit is contained in:
Elaine Tan 2014-04-18 12:51:08 +08:00
parent 80f1cafe49
commit 1e2cf53d61
3 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,16 @@
-- Apr 18, 2014 12:41:00 PM SGT
-- IDEMPIERE-1904 Incorrect document status when void a document with completed document status
UPDATE C_AllocationHdr SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE C_Invoice SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE C_Payment SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE GL_Journal SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE GL_JournalBatch SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE HR_Process SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_InOut SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_Inventory SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_Movement SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE PP_Cost_Collector SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
SELECT register_migration_script('201404181241_IDEMPIERE-1904.sql') FROM dual
;

View File

@ -0,0 +1,16 @@
-- Apr 18, 2014 12:41:00 PM SGT
-- IDEMPIERE-1904 Incorrect document status when void a document with completed document status
UPDATE C_AllocationHdr SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE C_Invoice SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE C_Payment SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE GL_Journal SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE GL_JournalBatch SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE HR_Process SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_InOut SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_Inventory SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE M_Movement SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
UPDATE PP_Cost_Collector SET DocStatus = 'RE' WHERE DocStatus = 'VO' AND Reversal_ID > 0;
SELECT register_migration_script('201404181241_IDEMPIERE-1904.sql') FROM dual
;

View File

@ -532,7 +532,8 @@ public class DocumentEngine implements DocAction
if (m_document.voidIt())
{
m_status = STATUS_Voided;
m_document.setDocStatus(m_status);
if (!m_document.getDocStatus().equals(STATUS_Reversed))
m_document.setDocStatus(m_status);
return true;
}
return false;