// retrieve currency code related to the current company...
Response res = ClientUtils.getData("loadCompanyCurrency",controlCompaniesCombo.getValue());
if (!res.isError()) {
final CurrencyVO vo = (CurrencyVO)((VOResponse)res).getVo();
currencyDecimals = vo.getDecimalsREG03().intValue();
JournalHeaderWithVatVO jhVO = (JournalHeaderWithVatVO)headerPanel.getVOModel().getValueObject();
jhVO.setCurrencyCodeREG01(vo.getCurrencyCodeREG03());
// set currency settings on currency controls...
controlTaxableIncome.setCurrencySymbol(vo.getCurrencySymbolREG03());
controlTaxableIncome.setDecimals(vo.getDecimalsREG03().intValue());
controlTaxableIncome.setDecimalSymbol(vo.getDecimalSymbolREG03().charAt(0));
controlTaxableIncome.setGroupingSymbol(vo.getThousandSymbolREG03().charAt(0));
colTaxableIncome.setDynamicSettings(new CurrencyColumnSettings() {
public String getCurrencySymbol(int row) {
return vo.getCurrencySymbolREG03();
}
public int getDecimals(int row) {
return vo.getDecimalsREG03().intValue();
}
public double getMaxValue(int row) {
return Double.MAX_VALUE;
}
public double getMinValue(int row) {
return Double.MIN_VALUE;
}
public boolean isGrouping(int row) {
return true;
}
});
}
}
}
});
// set controller on the header form...
headerPanel.setFormController(controller);
// motive code lookup...
controlMotive.setLookupController(motiveController);
controlMotive.setControllerMethodName("getAccountMotives");
motiveController.setForm(headerPanel);
motiveController.setLookupDataLocator(motiveDataLocator);
motiveDataLocator.setGridMethodName("loadAccountingMotives");
motiveDataLocator.setValidationMethodName("validateAccountingMotiveCode");
motiveController.setFrameTitle("accountingMotives");
motiveController.setLookupValueObjectClassName("org.jallinone.accounting.accountingmotives.java.AccountingMotiveVO");
motiveController.addLookup2ParentLink("accountingMotiveCodeACC03", "accountingMotiveCodeAcc03ACC05");
motiveController.addLookup2ParentLink("descriptionSYS10","motiveDescrACC05");
motiveController.setFramePreferedSize(new Dimension(400,400));
motiveController.setAllColumnVisible(false);
motiveController.setVisibleColumn("accountingMotiveCodeACC03",true);
motiveController.setVisibleColumn("descriptionSYS10",true);
motiveController.setPreferredWidthColumn("descriptionSYS10",290);
motiveController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
}
public void beforeLookupAction(ValueObject parentVO) {
motiveDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
motiveDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
}
public void forceValidate() {}
});
// register code lookup...
controlRegCode.setLookupController(regController);
controlRegCode.setControllerMethodName("getVatRegisters");
regController.setForm(headerPanel);
regController.setLookupDataLocator(regDataLocator);
regDataLocator.setGridMethodName("loadVatRegisters");
regDataLocator.setValidationMethodName("validateVatRegisterCode");
regController.setFrameTitle("vat registers");
regController.setLookupValueObjectClassName("org.jallinone.accounting.vatregisters.java.VatRegisterVO");
regController.addLookup2ParentLink("registerCodeACC04", "registerCodeACC04");
regController.addLookup2ParentLink("descriptionSYS10","registerDescriptionACC04");
regController.addLookup2ParentLink("accountCodeAcc02ACC04","accountCodeAcc02ACC04");
regController.addLookup2ParentLink("accountDescriptionACC04","accountDescriptionACC04");
regController.setFramePreferedSize(new Dimension(400,400));
regController.setAllColumnVisible(false);
regController.setVisibleColumn("registerCodeACC04",true);
regController.setVisibleColumn("descriptionSYS10",true);
regController.setPreferredWidthColumn("descriptionSYS10",290);
regController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
}
public void beforeLookupAction(ValueObject parentVO) {
regDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
regDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
}
public void forceValidate() {}
});
// vat code lookup...
controlVatCode.setLookupController(vatController);
controlVatCode.setControllerMethodName("getVatsList");
vatController.setForm(detailPanel);
vatController.setLookupDataLocator(vatDataLocator);
vatDataLocator.setGridMethodName("loadVats");
vatDataLocator.setValidationMethodName("validateVatCode");
vatController.setFrameTitle("vats");
vatController.setLookupValueObjectClassName("org.jallinone.registers.vat.java.VatVO");
vatController.addLookup2ParentLink("vatCodeREG01", "vatCodeREG01");
vatController.addLookup2ParentLink("descriptionSYS10","vatDescriptionREG01");
vatController.addLookup2ParentLink("valueREG01","valueREG01");
vatController.addLookup2ParentLink("deductibleREG01","deductibleREG01");
vatController.setFramePreferedSize(new Dimension(400,400));
vatController.setAllColumnVisible(false);
vatController.setVisibleColumn("vatCodeREG01",true);
vatController.setVisibleColumn("descriptionSYS10",true);
vatController.setPreferredWidthColumn("descriptionSYS10",290);
vatController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}
public void beforeLookupAction(ValueObject parentVO) {}
public void forceValidate() {}
});
// payment code lookup...
controlPayCode.setLookupController(paymentController);
controlPayCode.setControllerMethodName("getPaymentsList");
paymentController.setForm(headerPanel);
paymentController.setLookupDataLocator(paymentDataLocator);
paymentDataLocator.setGridMethodName("loadPayments");
paymentDataLocator.setValidationMethodName("validatePaymentCode");
paymentController.setFrameTitle("payments");
paymentController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentVO");
paymentController.addLookup2ParentLink("paymentCodeREG10", "paymentCodeREG10");
paymentController.addLookup2ParentLink("descriptionSYS10","paymentDescriptionREG10");
paymentController.setFramePreferedSize(new Dimension(400,400));
paymentController.setAllColumnVisible(false);
paymentController.setVisibleColumn("paymentCodeREG10",true);
paymentController.setVisibleColumn("descriptionSYS10",true);
paymentController.setPreferredWidthColumn("descriptionSYS10",290);
paymentController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {}
public void beforeLookupAction(ValueObject parentVO) {
paymentDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
paymentDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
}
public void forceValidate() {}
});
// account code lookup...
controlAcode.setLookupController(accountController);
controlAcode.setControllerMethodName("getAccounts");
accountController.setForm(detailPanel);
accountController.setLookupDataLocator(accountDataLocator);
accountDataLocator.setGridMethodName("loadAccounts");
accountDataLocator.setValidationMethodName("validateAccountCode");
accountController.setFrameTitle("accounts");
accountController.setLookupValueObjectClassName("org.jallinone.accounting.accounts.java.AccountVO");
accountController.addLookup2ParentLink("accountCodeACC02", "accountCodeACC06");
accountController.addLookup2ParentLink("descriptionSYS10","accountDescriptionACC06");
accountController.setFramePreferedSize(new Dimension(400,400));
accountController.setAllColumnVisible(false);
accountController.setVisibleColumn("accountCodeACC02",true);
accountController.setVisibleColumn("descriptionSYS10",true);
accountController.setPreferredWidthColumn("descriptionSYS10",290);
accountController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
AccountVO accountVO = (AccountVO)accountController.getLookupVO();
JournalRowVO vo = (JournalRowVO)detailPanel.getVOModel().getValueObject();
vo.setAccountCodeAcc02ACC06(accountVO.getAccountCodeACC02());
vo.setAccountCodeACC06(accountVO.getAccountCodeACC02());
// controlAcode.setValue(accountVO.getAccountCodeACC02());
}
public void beforeLookupAction(ValueObject parentVO) {
accountDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
accountDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
}
public void forceValidate() {}
});
// customer lookup...
customerDataLocator.setGridMethodName("loadCustomers");
customerDataLocator.setValidationMethodName("validateCustomerCode");
controlCcode.setLookupController(customerController);
controlCcode.setControllerMethodName("getCustomersList");
customerController.setForm(headerPanel);
customerController.setLookupDataLocator(customerDataLocator);
customerController.setFrameTitle("customers");
customerController.setLookupValueObjectClassName("org.jallinone.sales.customers.java.GridCustomerVO");
customerController.addLookup2ParentLink("customerCodeSAL07","customerCodeSAL07");
customerController.addLookup2ParentLink("name_1REG04", "name_1REG04");
customerController.addLookup2ParentLink("progressiveREG04", "progressiveREG04");
customerController.setAllColumnVisible(false);
customerController.setVisibleColumn("companyCodeSys01REG04", true);
customerController.setVisibleColumn("customerCodeSAL07", true);
customerController.setVisibleColumn("name_1REG04", true);
customerController.setVisibleColumn("name_2REG04", true);
customerController.setVisibleColumn("cityREG04", true);
customerController.setVisibleColumn("provinceREG04", true);
customerController.setVisibleColumn("countryREG04", true);
customerController.setVisibleColumn("taxCodeREG04", true);
customerController.setHeaderColumnName("cityREG04", "city");
customerController.setHeaderColumnName("provinceREG04", "prov");
customerController.setHeaderColumnName("countryREG04", "country");
customerController.setHeaderColumnName("taxCodeREG04", "taxCode");
customerController.setPreferredWidthColumn("name_1REG04", 200);
customerController.setPreferredWidthColumn("name_2REG04", 150);
customerController.setFramePreferedSize(new Dimension(750,500));
customerDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
customerController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
GridCustomerVO custVO = (GridCustomerVO)customerController.getLookupVO();
JournalHeaderWithVatVO vo = (JournalHeaderWithVatVO)headerPanel.getVOModel().getValueObject();
vo.setCreditAccountCodeAcc02SAL07(custVO.getCreditAccountCodeAcc02SAL07());
}
public void beforeLookupAction(ValueObject parentVO) {
customerDataLocator.getLookupFrameParams().put(ApplicationConsts.SUBJECT_TYPE,ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER);
customerDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
customerDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
customerController.setHeaderColumnName("name_1REG04", "corporateName1");
customerController.setHeaderColumnName("name_2REG04", "corporateName2");
}
public void forceValidate() {}
});
// supplier lookup...
supplierDataLocator.setGridMethodName("loadSuppliers");
supplierDataLocator.setValidationMethodName("validateSupplierCode");
controlScode.setLookupController(supplierController);
controlScode.setControllerMethodName("getSuppliersList");
supplierController.setForm(headerPanel);
supplierController.setLookupDataLocator(supplierDataLocator);
supplierController.setFrameTitle("suppliers");
supplierController.setLookupValueObjectClassName("org.jallinone.purchases.suppliers.java.GridSupplierVO");
supplierController.addLookup2ParentLink("supplierCodePUR01","supplierCodePUR01");
supplierController.addLookup2ParentLink("name_1REG04", "name_1REG04");
supplierController.addLookup2ParentLink("progressiveREG04", "progressiveREG04");
supplierController.setAllColumnVisible(false);
supplierController.setVisibleColumn("companyCodeSys01REG04", true);
supplierController.setVisibleColumn("supplierCodePUR01", true);
supplierController.setVisibleColumn("name_1REG04", true);
supplierController.setVisibleColumn("name_2REG04", true);
supplierController.setVisibleColumn("cityREG04", true);
supplierController.setVisibleColumn("provinceREG04", true);
supplierController.setVisibleColumn("countryREG04", true);
supplierController.setVisibleColumn("taxCodeREG04", true);
supplierController.setHeaderColumnName("name_1REG04", "corporateName1");
supplierController.setHeaderColumnName("cityREG04", "city");
supplierController.setHeaderColumnName("provinceREG04", "prov");
supplierController.setHeaderColumnName("countryREG04", "country");
supplierController.setHeaderColumnName("taxCodeREG04", "taxCode");
supplierController.setPreferredWidthColumn("name_1REG04", 200);
supplierController.setPreferredWidthColumn("name_2REG04", 150);
supplierController.setFramePreferedSize(new Dimension(750,500));
supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.FILTER_COMPANY_FOR_INSERT,"ACC05_NEW_ITEM_VAT");
supplierController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
GridSupplierVO supplierVO = (GridSupplierVO)supplierController.getLookupVO();
JournalHeaderWithVatVO vo = (JournalHeaderWithVatVO)headerPanel.getVOModel().getValueObject();
vo.setDebitAccountCodeAcc02PUR01(supplierVO.getDebitAccountCodeAcc02PUR01());
}
public void beforeLookupAction(ValueObject parentVO) {
supplierDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());
supplierDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,controlCompaniesCombo.getValue());