[ adempiere-Bugs-2708789 ] CalloutInOut.docType should read C_DocType.IsSOTrx

This commit is contained in:
Heng Sin Low 2009-03-24 08:38:24 +00:00
parent 2078a6e5ab
commit e47ef397ba
1 changed files with 14 additions and 13 deletions

View File

@ -104,10 +104,10 @@ public class CalloutInOut extends CalloutEngine
return ""; return "";
String sql = "SELECT d.DocBaseType, d.IsDocNoControlled, s.CurrentNext, " //1..3 String sql = "SELECT d.DocBaseType, d.IsDocNoControlled, s.CurrentNext, " //1..3
+ "s.AD_Sequence_ID, s.StartNewYear, s.DateColumn " //4..6 + "s.AD_Sequence_ID, s.StartNewYear, s.DateColumn, d.IsSOTrx " //4..7
+ "FROM C_DocType d, AD_Sequence s " + "FROM C_DocType d "
+ "WHERE C_DocType_ID=?" // 1 + "LEFT OUTER JOIN AD_Sequence s ON (d.DocNoSequence_ID=s.AD_Sequence_ID) "
+ " AND d.DocNoSequence_ID=s.AD_Sequence_ID(+)"; + "WHERE C_DocType_ID=?"; // 1
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
@ -120,29 +120,30 @@ public class CalloutInOut extends CalloutEngine
{ {
// Set Movement Type // Set Movement Type
String DocBaseType = rs.getString("DocBaseType"); String DocBaseType = rs.getString("DocBaseType");
// BF [2708789] Read IsSOTrx from C_DocType
String trxFlag = rs.getString(7);
mTab.setValue("IsSOTrx", trxFlag);
if (DocBaseType.equals("MMS")) // Material Shipments if (DocBaseType.equals("MMS")) // Material Shipments
/**solve 1648131 bug vpj-cd e-evolution */ /**solve 1648131 bug vpj-cd e-evolution */
//mTab.setValue("MovementType", "C-"); // Customer Shipments
{ {
boolean IsSOTrx = "Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")); boolean IsSOTrx = "Y".equals(trxFlag);
if (IsSOTrx) if (IsSOTrx)
mTab.setValue("MovementType", "C-"); mTab.setValue("MovementType", "C-"); // Customer Shipments
else else
mTab.setValue("MovementType", "V-"); mTab.setValue("MovementType", "V-"); // Vendor Return
} }
/**END vpj-cd e-evolution */ /**END vpj-cd e-evolution */
else if (DocBaseType.equals("MMR")) // Material Receipts else if (DocBaseType.equals("MMR")) // Material Receipts
/**solve 1648131 bug vpj-cd e-evolution */ /**solve 1648131 bug vpj-cd e-evolution */
//mTab.setValue("MovementType", "V+"); // Vendor Receipts
{ {
boolean IsSOTrx = "Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")); boolean IsSOTrx = "Y".equals(trxFlag);
if (IsSOTrx) if (IsSOTrx)
mTab.setValue("MovementType", "C+"); mTab.setValue("MovementType", "C+"); // Customer Return
else else
mTab.setValue("MovementType", "V+"); mTab.setValue("MovementType", "V+"); // Vendor Receipts
} }
/**END vpj-cd e-evolution */ /**END vpj-cd e-evolution */
// DocumentNo // DocumentNo
if (rs.getString("IsDocNoControlled").equals("Y")) if (rs.getString("IsDocNoControlled").equals("Y"))