itemController.setVisibleColumn("itemCodeItm01PUR02", true);
itemController.setVisibleColumn("supplierItemCodePUR02", true);
itemController.setVisibleColumn("descriptionSYS10", true);
itemController.setPreferredWidthColumn("descriptionSYS10", 200);
itemController.setFramePreferedSize(new Dimension(650,500));
itemController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
// fill in the grid v.o., according to the selected item settings...
GridInDeliveryNoteRowVO vo = (GridInDeliveryNoteRowVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
if (vo.getItemCodeItm01DOC09()==null || vo.getItemCodeItm01DOC09().equals("")) {
vo.setSupplierItemCodePur02DOC09(null);
vo.setDescriptionSYS10(null);
vo.setUmCodeREG02(null);
vo.setUmCodeReg02PUR02(null);
vo.setQtyDOC09(null);
vo.setSupplierQtyDOC09(null);
vo.setQtyDOC09(null);
serialNumberRequired = false;
}
else {
if (vo.getSupplierQtyDOC09()!=null) {
vo.setQtyDOC09(vo.getSupplierQtyDOC09().divide(vo.getValueREG05(),vo.getDecimalsREG02().intValue(),BigDecimal.ROUND_HALF_UP));
grid.repaint();
}
serialNumberRequired = ((SupplierItemVO)itemController.getLookupVO()).getSerialNumberRequiredITM01().booleanValue();
}
}
public void beforeLookupAction(ValueObject parentVO) {
GridInDeliveryNoteRowVO vo = (GridInDeliveryNoteRowVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC09());
itemDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01DOC09());
treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02DOC09());
itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02DOC09());
}
public void forceValidate() {}
});
// warehouse position code lookup...
colPositionLookup.setColumnRequired(false);
colPositionLookup.setLookupController(posController);
posController.setLookupDataLocator(posDataLocator);
posController.setFrameTitle("warehouse positions");
posController.setCodeSelectionWindow(posController.TREE_FRAME);
treeLevelPosDataLocator.setServerMethodName("loadCompanyHierarchy");
posDataLocator.setTreeDataLocator(treeLevelPosDataLocator);
posDataLocator.setNodeNameAttribute("descriptionSYS10");
posController.setAllowTreeLeafSelectionOnly(false);
posController.setLookupValueObjectClassName("org.jallinone.hierarchies.java.CompanyHierarchyLevelVO");
posController.addLookup2ParentLink("progressiveHIE01", "progressiveHie01DOC09");
posController.addLookup2ParentLink("descriptionSYS10","locationDescriptionSYS10");
posController.setFramePreferedSize(new Dimension(400,400));
posController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) { }
public void beforeLookupAction(ValueObject parentVO) {
GridInDeliveryNoteRowVO vo = (GridInDeliveryNoteRowVO)parentVO;
vo.setProgressiveHie02DOC09( InDeliveryNoteRowsGridPanel.this.parentVO.getProgressiveHie02WAR01() );
treeLevelPosDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02DOC09());
}
public void forceValidate() {}
});
// purchase order lookup...
purOrderDataLocator.setGridMethodName("loadPurchaseDocs");
purOrderDataLocator.setValidationMethodName("validatePurchaseDocNumber");
purOrderController.setLookupDataLocator(purOrderDataLocator);
purOrderDataLocator.getLookupFrameParams().put(ApplicationConsts.DOC_STATE,ApplicationConsts.CONFIRMED);
purOrderDataLocator.getLookupValidationParameters().put(ApplicationConsts.DOC_STATE,ApplicationConsts.CONFIRMED);
controlPurOrderNr.setLookupController(purOrderController);
controlPurOrderNr.setControllerMethodName("getPurchaseOrdersList");
controlPurOrderNr.setAllowOnlyNumbers(true);
purOrderController.setFrameTitle("confirmed purchase orders");
purOrderController.setLookupValueObjectClassName("org.jallinone.purchases.documents.java.GridPurchaseDocVO");
purOrderController.addLookup2ParentLink("docTypeDOC06","docTypeDoc06DOC09");
purOrderController.addLookup2ParentLink("docYearDOC06", "docYearDoc06DOC09");
purOrderController.addLookup2ParentLink("docNumberDOC06","docNumberDoc06DOC09");
purOrderController.addLookup2ParentLink("docSequenceDOC06","docSequenceDoc06DOC09");
purOrderController.setAllColumnVisible(false);
purOrderController.setVisibleColumn("companyCodeSys01DOC06", true);
// purOrderController.setVisibleColumn("docTypeDOC06", true);
purOrderController.setVisibleColumn("docYearDOC06", true);
purOrderController.setVisibleColumn("docSequenceDOC06", true);
purOrderController.setVisibleColumn("name_1REG04", true);
purOrderController.setVisibleColumn("docDateDOC06", true);
// purOrderController.setVisibleColumn("docStateDOC06", true);
purOrderController.setHeaderColumnName("name_1REG04", "corporateName1");
purOrderController.setPreferredWidthColumn("name_1REG04",200);
purOrderController.setFramePreferedSize(new Dimension(700,500));
purOrderController.setGroupingEnabledColumn("docYearDOC06", false);
// purOrderController.setDomainColumn("docTypeDOC06","DOC_TYPE");
purOrderController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
// fill in the grid v.o., according to the selected item settings...
GridInDeliveryNoteRowVO vo = (GridInDeliveryNoteRowVO)detailPanel.getVOModel().getValueObject();
if (vo.getDocNumberDoc06DOC09()==null) {
orderRows.setMode(Consts.READONLY);
orderRows.clearData();
importButton.setEnabled(false);
}
else {
PurchaseDocPK pk = new PurchaseDocPK(
InDeliveryNoteRowsGridPanel.this.parentVO.getCompanyCodeSys01DOC08(),
vo.getDocTypeDoc06DOC09(),
vo.getDocYearDoc06DOC09(),
vo.getDocNumberDoc06DOC09()
);
orderRows.getOtherGridParams().put(ApplicationConsts.PURCHASE_DOC_PK,pk);
orderRows.reloadData();
}
}
public void beforeLookupAction(ValueObject parentVO) { }
public void forceValidate() {}
});
orderRows.setGridDataLocator(orderRowsDataLocator);
orderRowsDataLocator.setServerMethodName("loadPurchaseDocAndDelivNoteRows");
orderRows.setController(new GridController() {
public void loadDataCompleted(boolean error) {
if (error || orderRows.getVOListTableModel().getRowCount()==0)
return;
orderRows.setMode(Consts.EDIT);
Response res = ClientUtils.getData("getCompanyRootLevel",new Object[]{parentVO.getCompanyCodeSys01DOC08(),parentVO.getProgressiveHie02WAR01()});
if (!res.isError()) {
CompanyHierarchyLevelVO posVO = (CompanyHierarchyLevelVO)((VOResponse)res).getVo();
GridInDeliveryNoteRowVO rowVO = null;
for(int i=0;i<orderRows.getVOListTableModel().getRowCount();i++) {
rowVO = (GridInDeliveryNoteRowVO)orderRows.getVOListTableModel().getObjectForRow(i);
rowVO.setProgressiveHie01DOC09(posVO.getProgressiveHIE01());
rowVO.setLocationDescriptionSYS10(posVO.getDescriptionSYS10());
}
}
orderRows.repaint();
importButton.setEnabled(true);
}
});
// warehouse position code in purchase rows grid lookup...
colPurchasePositionLookup.setLookupController(posPurchaseController);
posPurchaseController.setLookupDataLocator(posPurchaseDataLocator);
posPurchaseController.setFrameTitle("warehouse positions");
posPurchaseController.setCodeSelectionWindow(posController.TREE_FRAME);
treeLevelPosPurchaseDataLocator.setServerMethodName("loadCompanyHierarchy");
posPurchaseDataLocator.setTreeDataLocator(treeLevelPosPurchaseDataLocator);
posPurchaseDataLocator.setNodeNameAttribute("descriptionSYS10");
posPurchaseController.setAllowTreeLeafSelectionOnly(false);
posPurchaseController.setLookupValueObjectClassName("org.jallinone.hierarchies.java.CompanyHierarchyLevelVO");
posPurchaseController.addLookup2ParentLink("progressiveHIE01", "progressiveHie01DOC09");
posPurchaseController.addLookup2ParentLink("descriptionSYS10","locationDescriptionSYS10");
posPurchaseController.setFramePreferedSize(new Dimension(400,400));
posPurchaseController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) { }