try {
controlSN.setEnabled(false);
// validate variants barcode...
DetailSaleDocRowVO vo = (DetailSaleDocRowVO)getDetailPanel().getVOModel().getValueObject();
LookupValidationParams pars = new LookupValidationParams((String)controlBarCode.getValue(),new HashMap());
pars.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,getParentVO().getCompanyCodeSys01DOC01());
Response res = ClientUtils.getData("validateVariantBarcode",pars);
if (!res.isError()) {
java.util.List rows = ( (VOListResponse) res).getRows();
if (rows.size() == 1) {
// found variants barcode: pre-fill code and qty in variants matrix...
VariantBarcodeVO itemVO = (VariantBarcodeVO)rows.get(0);
vo.setSerialNumbers(new ArrayList());
vo.setCompanyCodeSys01DOC02(itemVO.getCompanyCodeSys01ITM22());
vo.setItemCodeItm01DOC02(itemVO.getItemCodeItm01ITM22());
vo.setVariantTypeItm06DOC02(itemVO.getVariantTypeItm06ITM22());
vo.setVariantCodeItm11DOC02(itemVO.getVariantCodeItm11ITM22());
vo.setVariantTypeItm07DOC02(itemVO.getVariantTypeItm07ITM22());
vo.setVariantCodeItm12DOC02(itemVO.getVariantCodeItm12ITM22());
vo.setVariantTypeItm08DOC02(itemVO.getVariantTypeItm08ITM22());
vo.setVariantCodeItm13DOC02(itemVO.getVariantCodeItm13ITM22());
vo.setVariantTypeItm09DOC02(itemVO.getVariantTypeItm09ITM22());
vo.setVariantCodeItm14DOC02(itemVO.getVariantCodeItm14ITM22());
vo.setVariantTypeItm10DOC02(itemVO.getVariantTypeItm10ITM22());
vo.setVariantCodeItm15DOC02(itemVO.getVariantCodeItm15ITM22());
variantsPanel.setVariantsBarcode(itemVO);
variantsPanel.setSN(null);
controlItemCode.setValue(itemVO.getItemCodeItm01ITM22());
itemController.forceValidate();
controlBarCode.setValue(null);
return;
}
}
else {
// validate item barcode...
pars = new LookupValidationParams((String)controlBarCode.getValue(),new HashMap());
pars.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,getParentVO().getCompanyCodeSys01DOC01());
pars.getLookupValidationParameters().put(ApplicationConsts.PRICELIST,getParentVO().getPricelistCodeSal01DOC01());
pars.getLookupValidationParameters().put(ApplicationConsts.VALIDATE_BARCODE,Boolean.TRUE);
res = ClientUtils.getData("validatePriceItemCode",pars);
if (!res.isError()) {
java.util.List rows = ((VOListResponse)res).getRows();
if (rows.size()==1) {
PriceItemVO itemVO = (PriceItemVO)rows.get(0);