headerFormPanel.executeReload();
if (getInvoices()!=null)
getInvoices().reloadCurrentBlockOfData();
// check if there is only one instalment and this instalment has 0 instalment days
DetailPurchaseDocVO vo = (DetailPurchaseDocVO)headerFormPanel.getVOModel().getValueObject();
res = ClientUtils.getData("validatePaymentCode",new LookupValidationParams(vo.getPaymentCodeReg10DOC06(),new HashMap()));
if (res.isError()) {
OptionPane.showMessageDialog(
ClientUtils.getParentFrame(this),
res.getErrorMessage(),
ClientSettings.getInstance().getResources().getResource("invoice closing"),
JOptionPane.ERROR_MESSAGE
);
}
else {
PaymentVO payVO = (PaymentVO)((VOListResponse)res).getRows().get(0);
if (payVO.getInstalmentNumberREG10().intValue()==1 &&
payVO.getStepREG10().intValue()==0 &&
payVO.getFirstInstalmentDaysREG10().intValue()==0 &&
payVO.getStartDayREG10().equals(ApplicationConsts.START_DAY_INVOICE_DATE)) {
// there is only one instalment and this instalment has 0 instalment days:
// prompt user for an immediate payment...
if (OptionPane.showConfirmDialog(
ClientUtils.getParentFrame(this),
"create payment immediately",
ClientSettings.getInstance().getResources().getResource("invoice closing"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE
)==JOptionPane.YES_OPTION) {
res = ClientUtils.getData("payImmediately",new Object[]{
vo.getCompanyCodeSys01DOC06(),
vo.getDocTypeDOC06(),
vo.getDocYearDOC06(),
vo.getDocNumberDOC06(),
vo.getDocSequenceDOC06()
});
if (res.isError())
OptionPane.showMessageDialog(
ClientUtils.getParentFrame(this),