IDEMPIERE-2410 Add Phase parameter to Generate PO from Project process / peer review - add migration script generated from 2pack provided by Chuck Boecking

This commit is contained in:
Carlos Ruiz 2015-02-04 09:19:04 -05:00
parent f8b1bc586e
commit 1429f7eb25
3 changed files with 57 additions and 9 deletions

View File

@ -0,0 +1,23 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Feb 4, 2015 8:41:37 AM COT
-- IDEMPIERE-2410 Add Phase parameter to Generate PO from Project process
UPDATE AD_Process SET Updated=TO_DATE('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=225
;
-- Feb 4, 2015 8:43:14 AM COT
UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_DATE('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=367
;
-- Feb 4, 2015 8:43:14 AM COT
UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_DATE('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=354
;
-- Feb 4, 2015 8:43:15 AM COT
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200117,0,0,'Y',TO_DATE('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),100,'Project Phase','Phase of a Project',225,20,19,'N',165,10,'N','C_ProjectPhase_ID','Y','D',2073,'aed3df93-775d-4f37-9b17-160d6288de79','N')
;
SELECT register_migration_script('201502040847_IDEMPIERE-2410.sql') FROM dual
;

View File

@ -0,0 +1,20 @@
-- Feb 4, 2015 8:41:37 AM COT
-- IDEMPIERE-2410 Add Phase parameter to Generate PO from Project process
UPDATE AD_Process SET Updated=TO_TIMESTAMP('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=225
;
-- Feb 4, 2015 8:43:14 AM COT
UPDATE AD_Process_Para SET SeqNo=40,Updated=TO_TIMESTAMP('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=367
;
-- Feb 4, 2015 8:43:14 AM COT
UPDATE AD_Process_Para SET SeqNo=30,Updated=TO_TIMESTAMP('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=354
;
-- Feb 4, 2015 8:43:15 AM COT
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted) VALUES (200117,0,0,'Y',TO_TIMESTAMP('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-04 08:43:14','YYYY-MM-DD HH24:MI:SS'),100,'Project Phase','Phase of a Project',225,20,19,'N',165,10,'N','C_ProjectPhase_ID','Y','D',2073,'aed3df93-775d-4f37-9b17-160d6288de79','N')
;
SELECT register_migration_script('201502040847_IDEMPIERE-2410.sql') FROM dual
;

View File

@ -28,6 +28,7 @@ import org.compiere.model.MProductPO;
import org.compiere.model.MProject;
import org.compiere.model.MProjectLine;
import org.compiere.util.Env;
import org.compiere.util.Msg;
/**
* Generate Purchase Order from Project.
@ -89,16 +90,20 @@ public class ProjectGenPO extends SvrProcess
else if (m_C_ProjectPhase_ID != 0)
{
MProject project = new MProject (getCtx(), m_C_Project_ID, get_TrxName());
MProjectLine[] lines = project.getPhaseLines(m_C_ProjectPhase_ID);
for (int i = 0; i < lines.length; i++)
createPO (project, lines[i]);
for (MProjectLine line : project.getPhaseLines(m_C_ProjectPhase_ID)) {
if (line.isActive()) {
createPO (project, line);
}
}
}
else
{
MProject project = new MProject (getCtx(), m_C_Project_ID, get_TrxName());
MProjectLine[] lines = project.getLines();
for (int i = 0; i < lines.length; i++)
createPO (project, lines[i]);
for (MProjectLine line : project.getLines()) {
if (line.isActive()) {
createPO (project, line);
}
}
}
return "";
} // doIt
@ -198,10 +203,10 @@ public class ProjectGenPO extends SvrProcess
// update ProjectLine
projectLine.setC_OrderPO_ID(order.getC_Order_ID());
projectLine.saveEx();
addLog (order.getC_Order_ID(),
addBufferLog (order.getC_Order_ID(),
order.getDateOrdered(),
new BigDecimal(orderLine.getLine()),
"Order:"+order.getDocumentNo()+" Line:"+orderLine.getLine(),
Msg.getElement(Env.getAD_Language(Env.getCtx()), "C_Order_ID", false)+":"+order.getDocumentNo(),
order.get_Table_ID(),
order.getC_Order_ID());
} // createPOfromProjectLine