IDEMPIERE-790 Voiding PO should unlink SO it was created from

This commit is contained in:
Carlos Ruiz 2013-04-13 19:38:53 -05:00
parent b6cb69938d
commit de75287a15
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,12 @@
-- Apr 13, 2013 7:23:49 PM COT
-- IDEMPIERE-790 Voiding PO should unlink SO it was created from
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2013-04-13 19:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322
;
-- Apr 13, 2013 7:24:14 PM COT
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_DATE('2013-04-13 19:24:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323
;
SELECT register_migration_script('201304131924_IDEMPIERE-790.sql') FROM dual
;

View File

@ -0,0 +1,12 @@
-- Apr 13, 2013 7:23:49 PM COT
-- IDEMPIERE-790 Voiding PO should unlink SO it was created from
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2013-04-13 19:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322
;
-- Apr 13, 2013 7:24:14 PM COT
UPDATE AD_Column SET IsAllowCopy='N',Updated=TO_TIMESTAMP('2013-04-13 19:24:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323
;
SELECT register_migration_script('201304131924_IDEMPIERE-790.sql') FROM dual
;

View File

@ -2401,6 +2401,11 @@ public class MOrder extends X_C_Order implements DocAction
if (m_processMsg != null) if (m_processMsg != null)
return false; return false;
if (getLink_Order_ID() > 0) {
MOrder so = new MOrder(getCtx(), getLink_Order_ID(), get_TrxName());
so.setLink_Order_ID(0);
so.saveEx();
}
MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID); MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID);
for (int i = 0; i < lines.length; i++) for (int i = 0; i < lines.length; i++)
{ {
@ -2418,6 +2423,11 @@ public class MOrder extends X_C_Order implements DocAction
{ {
deleteMatchPOCostDetail(line); deleteMatchPOCostDetail(line);
} }
if (line.getLink_OrderLine_ID() > 0) {
MOrderLine soline = new MOrderLine(getCtx(), line.getLink_OrderLine_ID(), get_TrxName());
soline.setLink_OrderLine_ID(0);
soline.saveEx();
}
} }
// update taxes // update taxes