Connection conn = null;
try {
if (this.conn==null) conn = getConn(); else conn = this.conn;
WarehousePK pk = (WarehousePK)gridParams.getOtherGridParams().get(ApplicationConsts.WAREHOUSE_CODE);
String sql =
"select WAR04_WAREHOUSE_MOTIVES.QTY_SIGN,WAR04_WAREHOUSE_MOTIVES.ITEM_TYPE,WAR02_WAREHOUSE_MOVS.PROGRESSIVE,WAR02_WAREHOUSE_MOVS.COMPANY_CODE_SYS01,"+
"WAR02_WAREHOUSE_MOVS.WAREHOUSE_CODE_WAR01,WAR02_WAREHOUSE_MOVS.ITEM_CODE_ITM01,WAR02_WAREHOUSE_MOVS.PROGRESSIVE_HIE01,"+
"SYS10_LOC.DESCRIPTION,WAR02_WAREHOUSE_MOVS.MOVEMENT_DATE,WAR02_WAREHOUSE_MOVS.USERNAME,WAR02_WAREHOUSE_MOVS.NOTE,"+
"WAR02_WAREHOUSE_MOVS.DELTA_QTY,WAR02_WAREHOUSE_MOVS.WAREHOUSE_MOTIVE_WAR04,SYS10_WAR04.DESCRIPTION,SYS10_ITM01.DESCRIPTION,"+
"WAR01_WAREHOUSES.DESCRIPTION,"+
"WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM06,WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM11,"+
"WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM07,WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM12,"+
"WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM08,WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM13,"+
"WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM09,WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM14,"+
"WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM10,WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM15 "+
" from "+
"WAR04_WAREHOUSE_MOTIVES,WAR02_WAREHOUSE_MOVS,SYS10_COMPANY_TRANSLATIONS SYS10_LOC,SYS10_TRANSLATIONS SYS10_WAR04,"+
"SYS10_COMPANY_TRANSLATIONS SYS10_ITM01,WAR01_WAREHOUSES,ITM01_ITEMS where "+
"WAR02_WAREHOUSE_MOVS.WAREHOUSE_MOTIVE_WAR04=WAR04_WAREHOUSE_MOTIVES.WAREHOUSE_MOTIVE and "+
"WAR04_WAREHOUSE_MOTIVES.PROGRESSIVE_SYS10=SYS10_WAR04.PROGRESSIVE and "+
"SYS10_WAR04.LANGUAGE_CODE=? and "+
"WAR02_WAREHOUSE_MOVS.COMPANY_CODE_SYS01=SYS10_LOC.COMPANY_CODE_SYS01 and "+
"WAR02_WAREHOUSE_MOVS.PROGRESSIVE_HIE01=SYS10_LOC.PROGRESSIVE and "+
"SYS10_LOC.LANGUAGE_CODE=? and "+
"WAR02_WAREHOUSE_MOVS.COMPANY_CODE_SYS01=ITM01_ITEMS.COMPANY_CODE_SYS01 and "+
"WAR02_WAREHOUSE_MOVS.ITEM_CODE_ITM01=ITM01_ITEMS.ITEM_CODE and "+
"ITM01_ITEMS.PROGRESSIVE_SYS10=SYS10_ITM01.PROGRESSIVE and "+
"SYS10_ITM01.LANGUAGE_CODE=? and "+
"WAR02_WAREHOUSE_MOVS.COMPANY_CODE_SYS01=WAR01_WAREHOUSES.COMPANY_CODE_SYS01 and "+
"WAR02_WAREHOUSE_MOVS.WAREHOUSE_CODE_WAR01=WAR01_WAREHOUSES.WAREHOUSE_CODE and "+
"WAR01_WAREHOUSES.COMPANY_CODE_SYS01=? and " +
"WAR01_WAREHOUSES.WAREHOUSE_CODE=? ";
Map attribute2dbField = new HashMap();
attribute2dbField.put("qtySignWAR04","WAR04_WAREHOUSE_MOTIVES.QTY_SIGN");
attribute2dbField.put("itemTypeWAR04","WAR04_WAREHOUSE_MOTIVES.ITEM_TYPE");
attribute2dbField.put("progressiveWAR02","WAR02_WAREHOUSE_MOVS.PROGRESSIVE");
attribute2dbField.put("companyCodeSys01WAR02","WAR02_WAREHOUSE_MOVS.COMPANY_CODE_SYS01");
attribute2dbField.put("warehouseCodeWar01WAR02","WAR02_WAREHOUSE_MOVS.WAREHOUSE_CODE_WAR01");
attribute2dbField.put("itemCodeItm01WAR02","WAR02_WAREHOUSE_MOVS.ITEM_CODE_ITM01");
attribute2dbField.put("progressiveHie01WAR02","WAR02_WAREHOUSE_MOVS.PROGRESSIVE_HIE01");
attribute2dbField.put("locationDescriptionSYS10","SYS10_LOC.DESCRIPTION");
attribute2dbField.put("movementDateWAR02","WAR02_WAREHOUSE_MOVS.MOVEMENT_DATE");
attribute2dbField.put("usernameWAR02","WAR02_WAREHOUSE_MOVS.USERNAME");
attribute2dbField.put("noteWAR02","WAR02_WAREHOUSE_MOVS.NOTE");
attribute2dbField.put("deltaQtyWAR02","WAR02_WAREHOUSE_MOVS.DELTA_QTY");
attribute2dbField.put("warehouseMotiveWar04WAR02","WAR02_WAREHOUSE_MOVS.WAREHOUSE_MOTIVE_WAR04");
attribute2dbField.put("motiveDescriptionSYS10","SYS10_WAR04.DESCRIPTION");
attribute2dbField.put("itemDescriptionSYS10","SYS10_ITM01.DESCRIPTION");
attribute2dbField.put("descriptionWAR01","WAR01_WAREHOUSES.DESCRIPTION");
attribute2dbField.put("variantTypeItm06WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM06");
attribute2dbField.put("variantCodeItm11WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM11");
attribute2dbField.put("variantTypeItm07WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM07");
attribute2dbField.put("variantCodeItm12WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM12");
attribute2dbField.put("variantTypeItm08WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM08");
attribute2dbField.put("variantCodeItm13WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM13");
attribute2dbField.put("variantTypeItm09WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM09");
attribute2dbField.put("variantCodeItm14WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM14");
attribute2dbField.put("variantTypeItm10WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_TYPE_ITM10");
attribute2dbField.put("variantCodeItm15WAR02","WAR02_WAREHOUSE_MOVS.VARIANT_CODE_ITM15");
ArrayList values = new ArrayList();
values.add(serverLanguageId);
values.add(serverLanguageId);
values.add(serverLanguageId);
values.add(pk.getCompanyCodeSys01WAR01());
values.add(pk.getWarehouseCodeWAR01());
// read from WAR02 table...
Response answer = QueryUtil.getQuery(
conn,