supplierController.addLookupListener(new LookupListener() {
public void codeValidated(boolean validated) {}
public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
GridSupplierVO vo = (GridSupplierVO)supplierController.getLookupVO();
if (vo.getSupplierCodePUR01()==null || vo.getSupplierCodePUR01().equals("")) {
controlSupplierName1.setText("");
controlSupplierName2.setText("");
grid.getOtherGridParams().remove(ApplicationConsts.COMPANY_CODE_SYS01);
grid.getOtherGridParams().remove(ApplicationConsts.PROGRESSIVE_REG04);
}
else {
controlCodSupplier.setValue(vo.getSupplierCodePUR01());
controlSupplierName1.setText(vo.getName_1REG04());
controlSupplierName2.setText(vo.getName_2REG04());
controlCodCustomer.setValue("");
controlCustName1.setText("");
controlCustName2.setText("");
grid.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
grid.getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,vo.getProgressiveREG04());
}
}
public void beforeLookupAction(ValueObject parentVO) {}
public void forceValidate() {}
});
controlStartDate.addDateChangedListener(new DateChangedListener() {
public void dateChanged(Date oldDate,Date newDate) {
if (newDate!=null)
grid.getOtherGridParams().put(ApplicationConsts.START_DATE,newDate);
else
grid.getOtherGridParams().remove(ApplicationConsts.START_DATE);
}
});
controlEndDate.addDateChangedListener(new DateChangedListener() {
public void dateChanged(Date oldDate,Date newDate) {
if (newDate!=null)
grid.getOtherGridParams().put(ApplicationConsts.END_DATE,newDate);
else
grid.getOtherGridParams().remove(ApplicationConsts.END_DATE);
}
});
final Domain d = new Domain("INVOICE_DOC_TYPES");
d.addDomainPair("","all invoices");
d.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
d.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale invoice");
d.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase invoice");
controlDocType.setDomain(d);
controlDocType.getComboBox().addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == e.SELECTED) {
if (controlDocType.getValue()==null ||
controlDocType.getValue().equals(""))
grid.getOtherGridParams().remove(ApplicationConsts.DOC_TYPE);
else
grid.getOtherGridParams().put(ApplicationConsts.DOC_TYPE,controlDocType.getValue());
}
}
});
controlShowPayed.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (controlShowPayed.isSelected())
// show all expirations: remove filter...
grid.getOtherGridParams().remove(ApplicationConsts.PAYED);
else
// show NOT yet payed expirations: apply filter on "N" (not payed)
grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");
}
});
// controlShowPayed.setSelected(true);
grid.getOtherGridParams().put(ApplicationConsts.PAYED,"N");
colValue.setDynamicSettings(this);
colPayedValue.setDynamicSettings(this);
colAlreadyPayed.setDynamicSettings(this);
Domain docTypeDomain = new Domain("DOC_TYPE");
docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_DOC_TYPE,"purchase invoice");
docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_DN_DOC_TYPE,"purchase invoice from delivery notes");
docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_INVOICE_FROM_PD_DOC_TYPE,"purchase invoice from purchase document");
docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_DEBIT_NOTE_DOC_TYPE,"debiting note");
docTypeDomain.addDomainPair(ApplicationConsts.PURCHASE_GENERIC_INVOICE,"purchase generic document");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_DOC_TYPE,"sale invoice");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_DN_DOC_TYPE,"sale invoice from delivery notes");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_INVOICE_FROM_SD_DOC_TYPE,"sale invoice from sale document");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_CREDIT_NOTE_DOC_TYPE,"credit note");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_GENERIC_INVOICE,"sale generic document");
docTypeDomain.addDomainPair(ApplicationConsts.SALE_DESK_DOC_TYPE,"desk selling");
colDocType.setDomain(docTypeDomain);
// payment lookup...
payTypeDataLocator.setGridMethodName("loadPaymentTypes");
payTypeDataLocator.setValidationMethodName("validatePaymentTypeCode");
colRealPayTipeCode.setLookupController(payTypeController);
colRealPayTipeCode.setControllerMethodName("getPaymentTypesList");
payTypeController.setLookupDataLocator(payTypeDataLocator);
payTypeController.setFrameTitle("payment types");
payTypeController.setLookupValueObjectClassName("org.jallinone.registers.payments.java.PaymentTypeVO");
payTypeController.addLookup2ParentLink("paymentTypeCodeREG11", "realPaymentTypeCodeReg11DOC19");
payTypeController.addLookup2ParentLink("descriptionSYS10","realPaymentDescriptionSYS10");
payTypeController.setAllColumnVisible(false);
payTypeController.setVisibleColumn("paymentTypeCodeREG11", true);
payTypeController.setVisibleColumn("descriptionSYS10", true);
new CustomizedColumns(new BigDecimal(222),payTypeController);
payTypeController.addLookupListener(new LookupListener() {
public void beforeLookupAction(ValueObject parentVO) {
}
public void codeChanged(ValueObject parentVO,
Collection parentChangedAttributes) {
PaymentTypeVO vo = (PaymentTypeVO)payTypeController.getLookupVO();
ExpirationVO expVO = (ExpirationVO)parentVO;
if (vo==null || vo.getAccountCodeAcc02REG11()==null) {
expVO.setRealAccountCodeAcc02DOC19(null);
expVO.setRealAcc02DescriptionSYS10(null);
}
else {
expVO.setRealAccountCodeAcc02DOC19(vo.getAccountCodeAcc02REG11());
expVO.setRealAcc02DescriptionSYS10(vo.getAcc02DescriptionSYS10());
}
}
public void codeValidated(boolean validated) {
}