libero: MRP : fixed indentation

This commit is contained in:
teo_sarca 2009-01-27 14:20:45 +00:00
parent d79fca0414
commit 1dd83ecbb2
1 changed files with 34 additions and 63 deletions

View File

@ -1105,15 +1105,12 @@ public class MRP extends SvrProcess
* @param DemandDateStartSchedule * @param DemandDateStartSchedule
* @return * @return
*/ */
private BigDecimal getNetRequierements( private BigDecimal getNetRequierements(int AD_Client_ID, int AD_Org_ID,
int AD_Client_ID, int M_Warehouse_ID, MProduct M_Product,
int AD_Org_ID, Timestamp DemandDateStartSchedule)
int M_Warehouse_ID ,
MProduct M_Product,
Timestamp DemandDateStartSchedule)
{ {
BigDecimal QtyNetReqs = QtyProjectOnHand.subtract(QtyGrossReqs); BigDecimal QtyNetReqs = QtyProjectOnHand.subtract(QtyGrossReqs);
String whereClause = " AD_Client_ID=? AND AD_Org_ID=?" final String whereClause = " AD_Client_ID=? AND AD_Org_ID=?"
+ " AND M_Product_ID = ?" + " AND M_Product_ID = ?"
+ " AND M_Warehouse_ID = ?" + " AND M_Warehouse_ID = ?"
+ " AND DocStatus IN (?,?) AND IsAvailable = ? AND TypeMRP = ?"; + " AND DocStatus IN (?,?) AND IsAvailable = ? AND TypeMRP = ?";
@ -1124,56 +1121,45 @@ public class MRP extends SvrProcess
parameters.add(M_Warehouse_ID); parameters.add(M_Warehouse_ID);
parameters.add(DocAction.STATUS_Completed); parameters.add(DocAction.STATUS_Completed);
parameters.add(DocAction.STATUS_InProgress); parameters.add(DocAction.STATUS_InProgress);
parameters.add("Y"); parameters.add(true);
parameters.add(MPPMRP.TYPEMRP_Supply); parameters.add(MPPMRP.TYPEMRP_Supply);
Collection<MPPMRP> mrps = new Query(getCtx(), MPPMRP.Table_Name, whereClause, get_TrxName()) Collection<MPPMRP> mrps = new Query(getCtx(), MPPMRP.Table_Name, whereClause, get_TrxName())
.setParameters(parameters) .setParameters(parameters)
.list(); .setOrderBy(MPPMRP.COLUMNNAME_DateStartSchedule)
.list();
for (MPPMRP mrp : mrps) for (MPPMRP mrp : mrps)
{ {
QtyScheduledReceipts = QtyScheduledReceipts.add(mrp.getQty()); QtyScheduledReceipts = QtyScheduledReceipts.add(mrp.getQty());
if(DemandDateStartSchedule != null) if(DemandDateStartSchedule != null)
{ {
//MRP-030 De-Expedite Action Notice //MRP-030 De-Expedite Action Notice
//Indicates that a schedule supply order is due before it is needed and should be delayed, //Indicates that a schedule supply order is due before it is needed and should be delayed,
//or demand rescheduled to an earlier date. //or demand rescheduled to an earlier date.
if(QtyNetReqs.negate().signum() > 0 && mrp.getDateStartSchedule().compareTo(DemandDateStartSchedule) < 0 ) if(QtyNetReqs.negate().signum() > 0
&& mrp.getDateStartSchedule().compareTo(DemandDateStartSchedule) < 0)
{ {
String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DateStartSchedule) String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DateStartSchedule)
+ ":" + mrp.getDateStartSchedule() + ":" + mrp.getDateStartSchedule()
+ " " + Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised) + " " + Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised)
+ ":" + DemandDateStartSchedule; + ":" + DemandDateStartSchedule;
createMRPNote("MRP-030", AD_Org_ID, mrp.get_ID(), M_Product,
createMRPNote( MPPMRP.getDocumentNo(mrp.get_ID()), mrp.getQty(), comment);
"MRP-030",
AD_Org_ID,
mrp.get_ID(),
M_Product, MPPMRP.getDocumentNo(mrp.get_ID()),
mrp.getQty(), comment
);
} }
//MRP-040 Expedite Action Notice //MRP-040 Expedite Action Notice
//Indicates that a scheduled supply order is due after is needed and should be rescheduled to an earlier date //Indicates that a scheduled supply order is due after is needed and should be rescheduled to
//or demand rescheduled to a later date. //an earlier date or demand rescheduled to a later date.
if(QtyNetReqs.negate().signum() < 0 && mrp.getDateStartSchedule().compareTo(DemandDateStartSchedule) > 0 ) if(QtyNetReqs.negate().signum() < 0
&& mrp.getDateStartSchedule().compareTo(DemandDateStartSchedule) > 0)
{ {
String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DateStartSchedule) String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DateStartSchedule)
+ ":" + mrp.getDateStartSchedule() + ":" + mrp.getDateStartSchedule()
+ " " + Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised) + " " + Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised)
+ ":" + DemandDateStartSchedule; + ":" + DemandDateStartSchedule;
createMRPNote("MRP-040", AD_Org_ID, mrp.get_ID(), M_Product,
createMRPNote( MPPMRP.getDocumentNo(mrp.get_ID()), mrp.getQty(), comment);
"MRP-040",
AD_Org_ID,
mrp.get_ID(),
M_Product, MPPMRP.getDocumentNo(mrp.get_ID()),
mrp.getQty(), comment
);
} }
//TODO vpj-cd I need to create logic for MRP-060 Release Due For Action Notice in time //TODO vpj-cd I need to create logic for MRP-060 Release Due For Action Notice in time
@ -1188,19 +1174,12 @@ public class MRP extends SvrProcess
//MRP-110 Past Due Action Notice //MRP-110 Past Due Action Notice
//Indicates that a schedule supply order receipt is past due. //Indicates that a schedule supply order receipt is past due.
if(mrp.getDatePromised().compareTo(Today) < 0 ) if(mrp.getDatePromised().compareTo(Today) < 0)
{ {
String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised) String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised)
+ ":" + mrp.getDatePromised(); + ":" + mrp.getDatePromised();
createMRPNote("MRP-110", AD_Org_ID, mrp.get_ID(), M_Product,
createMRPNote( MPPMRP.getDocumentNo(mrp.get_ID()), mrp.getQty(), comment);
"MRP-110",
AD_Org_ID,
mrp.get_ID(),
M_Product,
MPPMRP.getDocumentNo(mrp.get_ID()),
mrp.getQty(), comment
);
} }
mrp.setIsAvailable(false); mrp.setIsAvailable(false);
@ -1208,28 +1187,21 @@ public class MRP extends SvrProcess
QtyNetReqs.add(mrp.getQty()); QtyNetReqs.add(mrp.getQty());
if (QtyNetReqs.signum() == 0 ) if (QtyNetReqs.signum() == 0)
{ {
return QtyNetReqs; return QtyNetReqs;
} }
} }
else else
{ {
//MRP-050 Cancel Action Notice //MRP-050 Cancel Action Notice
//Indicate that a scheduled supply order is no longer needed and should be deleted. //Indicate that a scheduled supply order is no longer needed and should be deleted.
if(QtyScheduledReceipts.signum() > 0) if(QtyScheduledReceipts.signum() > 0)
{ {
String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised) String comment = Msg.translate(getCtx(), MPPMRP.COLUMNNAME_DatePromised)
+ ":" + mrp.getDatePromised(); + ":" + mrp.getDatePromised();
createMRPNote("MRP-050", AD_Org_ID, mrp.get_ID(), M_Product,
createMRPNote( MPPMRP.getDocumentNo(mrp.get_ID()), mrp.getQty(), comment);
"MRP-050",
AD_Org_ID,
mrp.get_ID(),
M_Product,
MPPMRP.getDocumentNo(mrp.get_ID()),
mrp.getQty(), comment
);
} }
QtyNetReqs.add(mrp.getQty()); QtyNetReqs.add(mrp.getQty());
mrp.setIsAvailable(false); mrp.setIsAvailable(false);
@ -1237,7 +1209,6 @@ public class MRP extends SvrProcess
} }
} }
return QtyNetReqs; return QtyNetReqs;
} }
} }