wareController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
WarehouseVO vo = (WarehouseVO)wareController.getLookupVO();
controlWarehouseCode.setValue(vo.getWarehouseCodeWAR01());
controlWareDescr.setValue(vo.getDescriptionWAR01());
}
public void beforeLookupAction(ValueObject parentVO) {}
public void forceValidate() {}
});
// payments lookup...
payDataLocator.setGridMethodName("loadPayments");
payDataLocator.setValidationMethodName("validatePaymentCode");
controlPayCode.setLookupController(payController);
controlPayCode.setControllerMethodName("getPaymentsList");
payController.setLookupDataLocator(payDataLocator);
payController.setFrameTitle("payments");
payController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentVO");
// payController.addLookup2ParentLink("paymentCodeREG10", "paymentCodeReg10SAL07");
// payController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionSYS10");
payController.setAllColumnVisible(false);
payController.setVisibleColumn("paymentCodeREG10", true);
payController.setVisibleColumn("descriptionSYS10", true);
payController.setPreferredWidthColumn("descriptionSYS10",200);
new CustomizedColumns(new BigDecimal(212),payController);
payController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
PaymentVO vo = (PaymentVO)payController.getLookupVO();
controlPayCode.setValue(vo.getPaymentCodeREG10());
controlPayDescr.setValue(vo.getDescriptionSYS10());
}
public void beforeLookupAction(ValueObject parentVO) {
}
public void forceValidate() {}
});
// pricelist lookup...
pricelistDataLocator.setGridMethodName("loadPricelists");
pricelistDataLocator.setValidationMethodName("validatePricelistCode");
controlPricelistCode.setLookupController(pricelistController);
controlPricelistCode.setControllerMethodName("getSalePricesList");
pricelistController.setLookupDataLocator(pricelistDataLocator);
// pricelistController.setForm(form);
pricelistController.setFrameTitle("pricelists");
pricelistController.setLookupValueObjectClassName("org.jallinone.sales.pricelist.java.PricelistVO");
// pricelistController.addLookup2ParentLink("pricelistCodeSAL01","pricelistCodeSal01DOC01");
// pricelistController.addLookup2ParentLink("descriptionSYS10", "pricelistDescriptionDOC01");
// pricelistController.addLookup2ParentLink("currencyCodeReg03SAL01","currencyCodeReg03DOC01");
pricelistController.setAllColumnVisible(false);
pricelistController.setVisibleColumn("pricelistCodeSAL01", true);
pricelistController.setVisibleColumn("descriptionSYS10", true);
pricelistController.setVisibleColumn("currencyCodeReg03SAL01", true);
pricelistController.setPreferredWidthColumn("descriptionSYS10", 250);
pricelistController.setFramePreferedSize(new Dimension(420,500));
pricelistController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
PricelistVO vo = (PricelistVO)pricelistController.getLookupVO();
controlPricelistCode.setValue(vo.getPricelistCodeSAL01());
controlPricelistDescr.setValue(vo.getDescriptionSYS10());
controlCurrencyCode.setValue(vo.getCurrencyCodeReg03SAL01());
}
public void beforeLookupAction(ValueObject parentVO) {
}
public void forceValidate() {}
});
// initialize pricelist lookup parameters...
DetailCallOutRequestVO vo = (DetailCallOutRequestVO)frame.getCalloutPanel().getVOModel().getValueObject();
pricelistDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
pricelistDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
wareDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
wareDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
// credit account code lookup...
creditDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
creditDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
controlCreditsCode.setLookupController(creditController);
controlCreditsCode.setControllerMethodName("getAccounts");
creditController.setLookupDataLocator(creditDataLocator);
creditDataLocator.setGridMethodName("loadAccounts");
creditDataLocator.setValidationMethodName("validateAccountCode");
creditController.setFrameTitle("accounts");
creditController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
// creditController.addLookup2ParentLink("accountCodeACC02", "creditAccountCodeAcc02SAL07");
// creditController.addLookup2ParentLink("descriptionSYS10","creditAccountDescrSAL07");
creditController.setFramePreferedSize(new Dimension(400,400));
creditController.setAllColumnVisible(false);
creditController.setVisibleColumn("accountCodeACC02", true);
creditController.setVisibleColumn("descriptionSYS10", true);
creditController.setPreferredWidthColumn("accountCodeACC02", 100);
creditController.setPreferredWidthColumn("descriptionSYS10", 290);
creditController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
AccountVO vo = (AccountVO)creditController.getLookupVO();
controlCreditsCode.setValue(vo.getAccountCodeACC02());
controlCreditsDescr.setValue(vo.getDescriptionSYS10());
}
public void beforeLookupAction(ValueObject parentVO) {
}
public void forceValidate() {}
});
// items account code lookup...
itemsDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
itemsDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
controlItemsCode.setLookupController(itemsController);
controlItemsCode.setControllerMethodName("getAccounts");
itemsController.setLookupDataLocator(itemsDataLocator);
itemsDataLocator.setGridMethodName("loadAccounts");
itemsDataLocator.setValidationMethodName("validateAccountCode");
itemsController.setFrameTitle("accounts");
itemsController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
// itemsController.addLookup2ParentLink("accountCodeACC02", "itemsAccountCodeAcc02SAL07");
// itemsController.addLookup2ParentLink("descriptionSYS10","itemsAccountDescrSAL07");
itemsController.setFramePreferedSize(new Dimension(400,400));
itemsController.setAllColumnVisible(false);
itemsController.setVisibleColumn("accountCodeACC02", true);
itemsController.setVisibleColumn("descriptionSYS10", true);
itemsController.setPreferredWidthColumn("accountCodeACC02", 100);
itemsController.setPreferredWidthColumn("descriptionSYS10", 290);
itemsController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
AccountVO vo = (AccountVO)itemsController.getLookupVO();
controlItemsCode.setValue(vo.getAccountCodeACC02());
controlItemsDescr.setValue(vo.getDescriptionSYS10());
}
public void beforeLookupAction(ValueObject parentVO) { }
public void forceValidate() {}
});
// activities account code lookup...
actDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
actDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
controlActCode.setLookupController(actController);
controlActCode.setControllerMethodName("getAccounts");
actController.setLookupDataLocator(actDataLocator);
actDataLocator.setGridMethodName("loadAccounts");
actDataLocator.setValidationMethodName("validateAccountCode");
actController.setFrameTitle("accounts");
actController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
// actController.addLookup2ParentLink("accountCodeACC02", "activitiesAccountCodeAcc02SAL07");
// actController.addLookup2ParentLink("descriptionSYS10","activitiesAccountDescrSAL07");
actController.setFramePreferedSize(new Dimension(400,400));
actController.setAllColumnVisible(false);
actController.setVisibleColumn("accountCodeACC02", true);
actController.setVisibleColumn("descriptionSYS10", true);
actController.setPreferredWidthColumn("accountCodeACC02", 100);
actController.setPreferredWidthColumn("descriptionSYS10", 290);
actController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
AccountVO vo = (AccountVO)actController.getLookupVO();
controlActCode.setValue(vo.getAccountCodeACC02());
controlActDescr.setValue(vo.getDescriptionSYS10());
}
public void beforeLookupAction(ValueObject parentVO) { }
public void forceValidate() {}
});
// charges account code lookup...
chargesDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
chargesDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
controlChargesCode.setLookupController(chargesController);
controlChargesCode.setControllerMethodName("getAccounts");
chargesController.setLookupDataLocator(chargesDataLocator);
chargesDataLocator.setGridMethodName("loadAccounts");
chargesDataLocator.setValidationMethodName("validateAccountCode");
chargesController.setFrameTitle("accounts");
chargesController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
// chargesController.addLookup2ParentLink("accountCodeACC02", "chargesAccountCodeAcc02SAL07");
// chargesController.addLookup2ParentLink("descriptionSYS10","chargesAccountDescrSAL07");
chargesController.setFramePreferedSize(new Dimension(400,400));
chargesController.setAllColumnVisible(false);
chargesController.setVisibleColumn("accountCodeACC02", true);
chargesController.setVisibleColumn("descriptionSYS10", true);
chargesController.setPreferredWidthColumn("accountCodeACC02", 100);
chargesController.setPreferredWidthColumn("descriptionSYS10", 290);
chargesController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
AccountVO vo = (AccountVO)chargesController.getLookupVO();
controlChargesCode.setValue(vo.getAccountCodeACC02());
controlChargesDescr.setValue(vo.getDescriptionSYS10());
}
public void beforeLookupAction(ValueObject parentVO) { }
public void forceValidate() {}
});
// set default values...
HashMap map = new HashMap();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.CREDITS_ACCOUNT);
Response response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
controlCreditsCode.setValue(code);
controlCreditsCode.getLookupController().forceValidate();
}
map.clear();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ITEMS_ACCOUNT);
response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
controlItemsCode.setValue(code);
controlItemsCode.getLookupController().forceValidate();
}
map.clear();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.ACTIVITIES_ACCOUNT);
response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
controlActCode.setValue(code);
controlActCode.getLookupController().forceValidate();
}
map.clear();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01SCH03());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.CHARGES_ACCOUNT);
response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
controlChargesCode.setValue(code);
controlChargesCode.getLookupController().forceValidate();
}
// check if there exist a customer with the specified progressive in REG04...
String subjectTypeREG04 = null;
if (vo.getSubjectTypeReg04SCH03().equals(ApplicationConsts.SUBJECT_ORGANIZATION))
subjectTypeREG04 = ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER;
else
subjectTypeREG04 = ApplicationConsts.SUBJECT_PEOPLE_CUSTOMER;
CustomerPK pk = new CustomerPK(vo.getCompanyCodeSys01SCH03(),vo.getProgressiveReg04SCH03(),subjectTypeREG04);
Response res = ClientUtils.getData("loadCustomer",pk);
if (!res.isError()) {
if (subjectTypeREG04.equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
OrganizationCustomerVO custVO = (OrganizationCustomerVO)((VOResponse)res).getVo();
controlCustCode.setValue(custVO.getCustomerCodeSAL07());