// *** Generated Source File *** // Portions Copyright (c) 1996-2001, SilverStream Software, Inc., All Rights Reserved package com.sssw.gen.forms; // generated by SilverStream: do not edit //Object Imports import java.awt.*; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.List; import java.math.*; import com.sssw.rt.gui.*; import com.sssw.rt.util.*; import com.sssw.rt.event.*; import java.awt.event.*; import com.sssw.rt.expr.*; import javax.swing.*; import javax.swing.event.*; import java.io.*; import java.util.Date; import com.sssw.rt.tview.*; import com.sssw.rt.jform.*; import com.sssw.rt.form.*; import javax.swing.table.*; //Form Imports import org.apache.log4j.Logger; import com.gpc.frame.FwiFormEdit; import com.gpc.frame.FwiFormProcess; import com.gpc.frame.process.FwoFormThread; import com.gpc.tams.dso.TsoGenericBandDescriptor; import com.gpc.backofficecommon.app.TamsCacheMgr; import com.gpc.backofficecommon.FwoSessionMgr; import com.gpc.client.backoffice.util.FwoFormat; import com.gpc.backofficecommon.report.TsoReportHelper; import com.gpc.backofficecommon.report.criteria.TsiQuestionConstants; import com.gpc.backofficecommon.util.SilverStreamExceptionHelper; import com.gpc.backofficecommon.constants.schema.Sch_Tables; import com.gpc.backofficecommon.constants.schema.Sch_ARProfile; import com.gpc.backofficecommon.constants.schema.Sch_Customer; import com.gpc.backofficecommon.constants.schema.Sch_CustomerAR; import com.gpc.backofficecommon.constants.schema.Sch_ARStatementMonitor; import com.gpc.backofficecommon.constants.schema.Sch_StoreTransactionDate; import com.gpc.backofficecommon.constants.schema.Sch_CustomerStatement; import com.gpc.backofficecommon.constants.schema.Sch_CustomerStatementIncludedCustomer; import com.gpc.backofficecommon.constants.schema.Sch_Employee; import com.gpc.backofficecommon.constants.schema.Sch_ARTerms; import com.gpc.backofficecommon.constants.schema.Sch_StoreProfile; import com.gpc.backofficecommon.report.criteria.StandardARCriteria; import com.gpc.valueobjects.report.FwoRefReport; import com.gpc.valueobjects.report.FwoRefReportRequest; import com.gpc.valueobjects.report.FwoReportResponse; import com.gpc.valueobjects.report.FwoPrinterSelectionSettings; import com.gpc.valueobjects.report.FwoPrintSettings; import com.gpc.valueobjects.report.criteria.FwoReportCriteria; import com.gpc.valueobjects.report.criteria.FwoRefReportCriteria; import com.gpc.valueobjects.report.criteria.FwoQuestionAnswer; import com.gpc.valueobjects.report.criteria.FwoQuestionAnswerMap; import com.gpc.valueobjects.profile.ARProfileVO; import com.gpc.valueobjects.profile.StoreProfileVO; import com.gpc.valueobjects.report.GenericReportRequest; import com.gpc.valueobjects.report.FwoReportResponse; import com.gpc.valueobjects.report.FwoReportRequest; import com.gpc.valueobjects.sql.ExecuteSQLResultsVO; import com.gpc.valueobjects.sql.ExecuteSQLVO; import com.gpc.valueobjects.common.ResultsVO; import com.gpc.valueobjects.customerstatement.ARStatementMonitorVO; import com.gpc.valueobjects.customerstatement.ClosingStatementRequestVO; import com.gpc.valueobjects.customerstatement.GenerateCustomerStatementFileRequestVO; import com.gpc.valueobjects.customerstatement.TransmitOnlineStatementsRequestVO; import com.gpc.client.backoffice.app.TamsFormMaster; import com.gpc.client.backoffice.FwoFormMaster; import com.gpc.client.backoffice.FwoToolBarDirector; import com.gpc.client.backoffice.table.TsoJTableMgr; import com.gpc.client.backoffice.customerstatement.StatementHelper; import com.gpc.client.backoffice.util.FwoUnsupportedObjectException; import com.gpc.client.backoffice.util.InvokerBridge; import com.gpc.client.backoffice.FwoNavigationMgr; import com.gpc.client.backoffice.progress.ServerTaskRunner; import com.gpc.client.common.progress.ProgressTask; import com.gpc.client.common.progress.ProgressRangeModel; import com.gpc.client.common.progress.ProgressDlg; import com.gpc.client.common.focusmanager.FocusDecider; import com.gpc.client.common.table.cell.FwoWholeNumberCell; import com.gpc.client.common.table.cell.FwoDecimalNumberCell; import com.gpc.client.common.util.Browser; import com.gpc.client.common.ClientApplicationContext; import com.gpc.common.constants.refvalues.RefARStatementForm; import com.gpc.common.constants.refvalues.RefCustomerType; import com.gpc.common.constants.refvalues.RefOnlineStatementStatus; import com.gpc.common.constants.refvalues.RefStatementFormat; import com.gpc.common.constants.CustomerStatementConstants; import com.gpc.common.exception.ApplicationException; import com.gpc.common.ResourceBundleReader; import com.gpc.common.pattern.DatePatternFormatException; import com.gpc.common.pattern.PatternParseException; import com.gpc.common.pattern.FwoDatePattern; import com.gpc.common.pattern.FwoPattern; import com.gpc.common.ApplicationContext; import com.gpc.common.FwiConstant; import com.gpc.common.SystemConfig; import com.gpc.common.TsoConstant; import com.gpc.common.Profile; public class FrmAR_CustomerStatements_Closing extends AgfForm // generated by SilverStream: do not edit implements FocusDecider, ActionListener, FwiFormProcess, FwiFormEdit, ListSelectionListener { public com.sssw.rt.jform.AgcJLabel lblStmtPrinted; public com.sssw.rt.jform.AgcJTable tblPrintedStatements; public javax.swing.JScrollPane tblPrintedStatementsScrollPane; public com.sssw.rt.jform.AgcJDateField fldStatementClosingDate; public javax.swing.ButtonGroup DefaultJButtonGroup = new javax.swing.ButtonGroup(); public com.sssw.rt.jform.AgcJButton pbTermRemove; public com.sssw.rt.jform.AgcJButton pbCustRemove; public com.sssw.rt.jform.AgcJButton pbRepRemove; public com.sssw.rt.form.AgcData agcTerms; public com.sssw.rt.form.AgcData agcEmployee; public com.sssw.rt.jform.AgcJTextField fldTermsCodesTo; public com.sssw.rt.jform.AgcJLabel lblTermsCodesTo; public com.sssw.rt.jform.AgcJTextField fldTermsCodesFrom; public com.sssw.rt.jform.AgcJLabel lblTermsCodes; public com.sssw.rt.jform.AgcJLabel lblAllTermsCode; public com.sssw.rt.jform.AgcJCheckBox ckbAddTermsCode; public com.sssw.rt.jform.AgcJLabel lblAddTermsCode; public com.sssw.rt.jform.AgcJTextField fldAddTermsCode; public com.sssw.rt.jform.AgcJList listAddTermCode; public javax.swing.JScrollPane listAddTermCodeScrollPane; public com.sssw.rt.form.AgcRectangle Rectangle4; public com.sssw.rt.jform.AgcJTextField Field2; public com.sssw.rt.jform.AgcJLabel Label2; public com.sssw.rt.jform.AgcJButton pbSelectTermsCodes; public com.sssw.rt.jform.AgcJButton pbSelectSalesRep; public com.sssw.rt.jform.AgcJTextField fldAddSalesRep; public com.sssw.rt.jform.AgcJLabel lblAddSalesRep; public com.sssw.rt.jform.AgcJList listAddSalesRep; public javax.swing.JScrollPane listAddSalesRepScrollPane; public com.sssw.rt.form.AgcRectangle Rectangle3; public com.sssw.rt.jform.AgcJTextField Field1; public com.sssw.rt.jform.AgcJLabel Label1; public com.sssw.rt.jform.AgcJLabel lblAddCustomer; public com.sssw.rt.jform.AgcJList listAddCustomer; public javax.swing.JScrollPane listAddCustomerScrollPane; public com.sssw.rt.jform.AgcJTextField fldAddCustomer; public com.sssw.rt.jform.AgcJButton pbSelectCust; public com.sssw.rt.form.AgcRectangle Rectangle2; public com.sssw.rt.jform.AgcJRadioButton rbNotPrinted; public com.sssw.rt.jform.AgcJRadioButton rbPrinted; public com.sssw.rt.form.AgcData agcDsoGen; public com.sssw.rt.form.AgcData agcStoreTransactionDate; public com.sssw.rt.form.AgcData agcCustomers; public com.sssw.rt.form.AgcData agcAllPrinted; public com.sssw.rt.form.AgcData agcPrintedStatements; public javax.swing.ButtonGroup printSequenceGroup = new javax.swing.ButtonGroup(); public com.sssw.rt.jform.AgcJRadioButton rbBalancePriorityZipCode; public com.sssw.rt.jform.AgcJComboBox cbAccountingDay; public javax.swing.ButtonGroup zeroBalanceGroup = new javax.swing.ButtonGroup(); public com.sssw.rt.jform.AgcJRadioButton rbIncludeZeroBalanceNo; public com.sssw.rt.jform.AgcJRadioButton rbIncludeZeroBalanceYes; public com.sssw.rt.form.AgcRectangle rectIncludeZeroBalanceStatements; public javax.swing.ButtonGroup paidInvoiceGroup = new javax.swing.ButtonGroup(); public com.sssw.rt.jform.AgcJRadioButton rbIncludeInvoicesYes; public com.sssw.rt.jform.AgcJRadioButton rbIncludeInvoicesNo; public com.sssw.rt.jform.AgcJCheckBox cbxAllSalesRepresenatives; public com.sssw.rt.jform.AgcJLabel lblAllSalesRepresenatives; public com.sssw.rt.jform.AgcJLabel lblSalesRepresenativeNumberRange; public com.sssw.rt.jform.AgcJTextField fldSalesRepFrom; public com.sssw.rt.jform.AgcJLabel lblSalesRepTo; public com.sssw.rt.jform.AgcJTextField fldSalesRepTo; public com.sssw.rt.jform.AgcJCheckBox cbxAllCustomers; public com.sssw.rt.jform.AgcJLabel lblAllCustomers; public com.sssw.rt.jform.AgcJLabel lblCustomerNumberRange; public com.sssw.rt.jform.AgcJTextField fldFromCustomerNumber; public com.sssw.rt.jform.AgcJLabel lblCustomerNumberRangeTo; public com.sssw.rt.jform.AgcJTextField fldToCustomerNumber; public com.sssw.rt.jform.AgcJRadioButton rbCustomerNumberOnly; public com.sssw.rt.jform.AgcJRadioButton rbBalancePriorityCustomerNumber; public com.sssw.rt.jform.AgcJRadioButton rbStoreResponsibilityBalancePriorityCustomerNumber; public com.sssw.rt.jform.AgcJTextField fldMessageOnStatement; public com.sssw.rt.jform.AgcJLabel lblPreviousAccountingDayData; public com.sssw.rt.jform.AgcJLabel lblPreviousClosingDateData; public com.sssw.rt.jform.AgcJButton pbFinalize; public com.sssw.rt.jform.AgcJButton pbViewStatement; public com.sssw.rt.jform.AgcJButton pbAbort; public com.sssw.rt.jform.AgcJButton pbPrintStatements; public com.sssw.rt.jform.AgcJButton pbPrintTrialBalance; public com.sssw.rt.jform.AgcJLabel lblPreviousClosingDate; public com.sssw.rt.jform.AgcJLabel lblPreviousAccountingDay; public com.sssw.rt.jform.AgcJLabel lblAccountingDay; public com.sssw.rt.jform.AgcJLabel lblStatementClosingDate; public com.sssw.rt.form.AgcRectangle RecClosingDate; public com.sssw.rt.jform.AgcJLabel lblTitle; public com.sssw.rt.form.AgcRectangle rectPrintedStatements; public com.sssw.rt.form.AgcRectangle rectTerms; public com.sssw.rt.form.AgcRectangle rectSalesRepresenative; public com.sssw.rt.form.AgcRectangle rectCustomer; public com.sssw.rt.form.AgcRectangle rectMessageForStatement; public com.sssw.rt.form.AgcRectangle rectIncludePaidInvoices; public com.sssw.rt.jform.AgcJRadioButton rbCustomerNameOnly; public com.sssw.rt.form.AgcRectangle rectPrintSequence; private static final Logger logger = Logger.getLogger(FrmAR_CustomerStatements_Closing.class); ClientApplicationContext clientApplicationContext = ClientApplicationContext.getClientApplicationContext(); private TamsFormMaster FM; private TsoJTableMgr m_TblMgr; private boolean m_isReprintInEffect = false; private Short m_refArStatementFormId; private java.util.List m_rePrintCustomers; String m_orientation; Boolean m_duplex; Integer m_printerID; Integer m_copies; Integer m_refPaperSizeID; private FwoPrintSettings m_prtSettings; private boolean m_bContinuePrintingTask = true; //Bug# 30810 Declared a global variable numDays private static final int numDays=20; // Bug 31165 Added global variables to keep status of validation and // value of closing date entered by user. private boolean checkValidationForClosingDate = false; private java.util.Date closingDate = null; private Map acctDayMap = null; private int numStatementsTransmitted; private boolean finalizeSuccessful = false; private ClosingStatementRequestVO csrVO = null; class FinalizeTask extends ProgressTask { private boolean m_bComplete = false; private Integer processId; FinalizeTask(Integer processId) { this.processId = processId; } public ProgressRangeModel getProgressModel() { ProgressRangeModel brm = new ProgressRangeModel(0, 0, 3); brm.setComplete(m_bComplete); return brm; } public void run() { finalizeCustomerStatements(processId); // this allows inclusion of client side additional tasks // as well as dealing with the server side returning complete too soon (???) m_bComplete = true; if (finalizeSuccessful) { if (onlineStatementsExist()) { new Thread(new Runnable() { public void run() { processOnlineStatements(); } }).start(); } else { // Finalization was successful, clean up the monitor record and close // the form javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { deleteMonitorRecord(); closeForm(); } }); } } else { // Finalization failed, just close the form javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { closeForm(); } }); } } } class PrintStatementsTask extends ProgressTask { private boolean m_bComplete = false; private Integer processId; PrintStatementsTask(Integer processId) { this.processId = processId; } public void cancelTask() { m_bContinuePrintingTask = false; } public ProgressRangeModel getProgressModel() { ProgressRangeModel brm = new ProgressRangeModel(0, 0, 3); brm.setComplete(m_bComplete & m_bContinuePrintingTask); brm.setCancelled(!m_bContinuePrintingTask); return brm; } public void run() { m_bContinuePrintingTask = true; if (m_isReprintInEffect) { reprintStatements(processId); } else { printStatements(processId); } m_bComplete = true; } } class TransmitStatementsTask extends ProgressTask { private boolean m_bComplete = false; public ProgressRangeModel getProgressModel() { ProgressRangeModel brm = new ProgressRangeModel(0, 0, 1); brm.setComplete(m_bComplete); return brm; } public void run() { transmitOnlineStatements(); m_bComplete = true; } } public FrmAR_CustomerStatements_Closing() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === } public void init() throws Exception { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === // Initialize form and data this.setTransparent(false); this.setBackground(Color.white); this.setBackgroundImageMode(2); agData.setDataMode(AgoData.DATA_MODE_FIRST_RECORD); agDataMgr.setAutomaticValidationUI(true); this.setName("FrmAR_CustomerStatements_Closing"); this.setBounds(10,10,1016,663); // Initialize lblStmtPrinted lblStmtPrinted = new com.sssw.rt.jform.AgcJLabel(); lblStmtPrinted.setName("lblStmtPrinted"); lblStmtPrinted.setBounds(415,420,245,18); lblStmtPrinted.setVisible(false); lblStmtPrinted.setText("All statements have printed."); lblStmtPrinted.setOpaque(false); lblStmtPrinted.setTextStyle(0); lblStmtPrinted.setForeground(Color.black); lblStmtPrinted.setTextShadowColor(Color.darkGray); lblStmtPrinted.setTextHighlightColor(Color.gray); lblStmtPrinted.setBackground(Color.lightGray); lblStmtPrinted.setHorizontalAlignment(SwingConstants.CENTER); lblStmtPrinted.setVerticalAlignment(SwingConstants.CENTER); lblStmtPrinted.setHorizontalTextPosition(SwingConstants.RIGHT); lblStmtPrinted.setVerticalTextPosition(SwingConstants.CENTER); lblStmtPrinted.setWordWrap(false); lblStmtPrinted.setFont(new Font("SansSerif", 1, 12)); // Initialize tblPrintedStatements tblPrintedStatements = new com.sssw.rt.jform.AgcJTable(); tblPrintedStatements.setName("tblPrintedStatements"); tblPrintedStatementsScrollPane = new JScrollPane(tblPrintedStatements); tblPrintedStatementsScrollPane.setBounds(19,485,973,117); tblPrintedStatements.setEditable(false); tblPrintedStatements.setCellSelectionEnabled(false); tblPrintedStatements.setColumnSelectionAllowed(false); tblPrintedStatements.setRowSelectionAllowed(true); tblPrintedStatements.setShowGrid(true); tblPrintedStatements.setGridColor(Color.gray); tblPrintedStatements.setForeground(Color.black); tblPrintedStatements.setBackground(Color.white); tblPrintedStatements.setSelectionForeground(Color.white); tblPrintedStatements.setSelectionBackground(AgoColorManager.getColor(0, 0, 128)); tblPrintedStatements.setRowHeight(16); tblPrintedStatements.setRowMargin(1); tblPrintedStatements.getColumnModel().setColumnMargin(1); tblPrintedStatements.setFont(new Font("SansSerif", 0, 12)); // Initialize fldStatementClosingDate fldStatementClosingDate = new com.sssw.rt.jform.AgcJDateField(); fldStatementClosingDate.setName("fldStatementClosingDate"); fldStatementClosingDate.setBounds(175,49,80,20); fldStatementClosingDate.setFont(new Font("SansSerif", 0, 12)); fldStatementClosingDate.setHorizontalAlignment(2); fldStatementClosingDate.setMargin(new Insets(1, 1, 1, 1)); fldStatementClosingDate.setEditable(true); fldStatementClosingDate.setForeground(Color.black); fldStatementClosingDate.setBackground(Color.white); fldStatementClosingDate.setDisplayStyle(100); fldStatementClosingDate.setMaxLength(AgcJTextField.NO_LIMIT); fldStatementClosingDate.setMinLength(AgcJTextField.NO_LIMIT); // Initialize pbTermRemove pbTermRemove = new com.sssw.rt.jform.AgcJButton(); pbTermRemove.setName("pbTermRemove"); pbTermRemove.setBounds(740,370,90,25); pbTermRemove.setContentAreaFilled(true); pbTermRemove.setBorderPainted(true); pbTermRemove.setMargin(new Insets(1, 1, 1, 1)); pbTermRemove.setHorizontalAlignment(SwingConstants.CENTER); pbTermRemove.setVerticalAlignment(SwingConstants.CENTER); pbTermRemove.setHorizontalTextPosition(SwingConstants.RIGHT); pbTermRemove.setVerticalTextPosition(SwingConstants.CENTER); pbTermRemove.setText("Remove"); pbTermRemove.setFont(new Font("SansSerif", 1, 12)); pbTermRemove.setForeground(Color.black); pbTermRemove.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize pbCustRemove pbCustRemove = new com.sssw.rt.jform.AgcJButton(); pbCustRemove.setName("pbCustRemove"); pbCustRemove.setBounds(70,370,90,25); pbCustRemove.setContentAreaFilled(true); pbCustRemove.setBorderPainted(true); pbCustRemove.setMargin(new Insets(1, 1, 1, 1)); pbCustRemove.setHorizontalAlignment(SwingConstants.CENTER); pbCustRemove.setVerticalAlignment(SwingConstants.CENTER); pbCustRemove.setHorizontalTextPosition(SwingConstants.RIGHT); pbCustRemove.setVerticalTextPosition(SwingConstants.CENTER); pbCustRemove.setText("Remove"); pbCustRemove.setFont(new Font("SansSerif", 1, 12)); pbCustRemove.setForeground(Color.black); pbCustRemove.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize pbRepRemove pbRepRemove = new com.sssw.rt.jform.AgcJButton(); pbRepRemove.setName("pbRepRemove"); pbRepRemove.setBounds(410,370,90,25); pbRepRemove.setContentAreaFilled(true); pbRepRemove.setBorderPainted(true); pbRepRemove.setMargin(new Insets(1, 1, 1, 1)); pbRepRemove.setHorizontalAlignment(SwingConstants.CENTER); pbRepRemove.setVerticalAlignment(SwingConstants.CENTER); pbRepRemove.setHorizontalTextPosition(SwingConstants.RIGHT); pbRepRemove.setVerticalTextPosition(SwingConstants.CENTER); pbRepRemove.setText("Remove"); pbRepRemove.setFont(new Font("SansSerif", 1, 12)); pbRepRemove.setForeground(Color.black); pbRepRemove.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize agcTerms agcTerms = new com.sssw.rt.form.AgcData(); agcTerms.setName("agcTerms"); agcTerms.setBounds(700,680,56,58); agcTerms.setExpressionCount(3); agcTerms.setExpression(0, 0, "ID", 0); agcTerms.setExpression(1, 1, "LOC", 1); agcTerms.setExpression(2, 2, "DESCRIPTION", 2); // Initialize agcEmployee agcEmployee = new com.sssw.rt.form.AgcData(); agcEmployee.setName("agcEmployee"); agcEmployee.setBounds(615,680,75,58); agcEmployee.setExpressionCount(5); agcEmployee.setExpression(0, 3, "ID", 0); agcEmployee.setExpression(1, 4, "LOC", 1); agcEmployee.setExpression(2, 5, "EMPLOYEE_NUM", 2); agcEmployee.setExpression(3, 6, "LAST_NAME", 3); agcEmployee.setExpression(4, 7, "FIRST_NAME", 4); // Initialize fldTermsCodesTo fldTermsCodesTo = new com.sssw.rt.jform.AgcJTextField(); fldTermsCodesTo.setName("fldTermsCodesTo"); fldTermsCodesTo.setBounds(890,225,105,20); fldTermsCodesTo.setFont(new Font("SansSerif", 0, 12)); fldTermsCodesTo.setHorizontalAlignment(2); fldTermsCodesTo.setMargin(new Insets(1, 1, 1, 1)); fldTermsCodesTo.setEditable(true); fldTermsCodesTo.setForeground(Color.black); fldTermsCodesTo.setBackground(Color.white); fldTermsCodesTo.setMaxLength(AgcJTextField.NO_LIMIT); fldTermsCodesTo.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblTermsCodesTo lblTermsCodesTo = new com.sssw.rt.jform.AgcJLabel(); lblTermsCodesTo.setName("lblTermsCodesTo"); lblTermsCodesTo.setBounds(845,225,45,18); lblTermsCodesTo.setText("to"); lblTermsCodesTo.setOpaque(false); lblTermsCodesTo.setTextStyle(0); lblTermsCodesTo.setForeground(Color.black); lblTermsCodesTo.setTextShadowColor(Color.darkGray); lblTermsCodesTo.setTextHighlightColor(Color.gray); lblTermsCodesTo.setBackground(Color.lightGray); lblTermsCodesTo.setHorizontalAlignment(SwingConstants.CENTER); lblTermsCodesTo.setVerticalAlignment(SwingConstants.CENTER); lblTermsCodesTo.setHorizontalTextPosition(SwingConstants.RIGHT); lblTermsCodesTo.setVerticalTextPosition(SwingConstants.CENTER); lblTermsCodesTo.setWordWrap(false); lblTermsCodesTo.setFont(new Font("SansSerif", 1, 12)); // Initialize fldTermsCodesFrom fldTermsCodesFrom = new com.sssw.rt.jform.AgcJTextField(); fldTermsCodesFrom.setName("fldTermsCodesFrom"); fldTermsCodesFrom.setBounds(745,225,105,20); fldTermsCodesFrom.setFont(new Font("SansSerif", 0, 12)); fldTermsCodesFrom.setHorizontalAlignment(2); fldTermsCodesFrom.setMargin(new Insets(1, 1, 1, 1)); fldTermsCodesFrom.setEditable(true); fldTermsCodesFrom.setForeground(Color.black); fldTermsCodesFrom.setBackground(Color.white); fldTermsCodesFrom.setMaxLength(AgcJTextField.NO_LIMIT); fldTermsCodesFrom.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblTermsCodes lblTermsCodes = new com.sssw.rt.jform.AgcJLabel(); lblTermsCodes.setName("lblTermsCodes"); lblTermsCodes.setBounds(680,225,55,18); lblTermsCodes.setText("Range"); lblTermsCodes.setOpaque(false); lblTermsCodes.setTextStyle(0); lblTermsCodes.setForeground(Color.black); lblTermsCodes.setTextShadowColor(Color.darkGray); lblTermsCodes.setTextHighlightColor(Color.gray); lblTermsCodes.setBackground(Color.lightGray); lblTermsCodes.setHorizontalAlignment(SwingConstants.RIGHT); lblTermsCodes.setVerticalAlignment(SwingConstants.CENTER); lblTermsCodes.setHorizontalTextPosition(SwingConstants.RIGHT); lblTermsCodes.setVerticalTextPosition(SwingConstants.CENTER); lblTermsCodes.setWordWrap(false); lblTermsCodes.setFont(new Font("SansSerif", 1, 12)); // Initialize lblAllTermsCode lblAllTermsCode = new com.sssw.rt.jform.AgcJLabel(); lblAllTermsCode.setName("lblAllTermsCode"); lblAllTermsCode.setBounds(711,250,35,20); lblAllTermsCode.setText("All"); lblAllTermsCode.setOpaque(false); lblAllTermsCode.setTextStyle(0); lblAllTermsCode.setForeground(Color.black); lblAllTermsCode.setTextShadowColor(Color.darkGray); lblAllTermsCode.setTextHighlightColor(Color.gray); lblAllTermsCode.setBackground(AgoColorManager.getColor(212, 208, 200)); lblAllTermsCode.setHorizontalAlignment(SwingConstants.LEFT); lblAllTermsCode.setVerticalAlignment(SwingConstants.CENTER); lblAllTermsCode.setHorizontalTextPosition(SwingConstants.RIGHT); lblAllTermsCode.setVerticalTextPosition(SwingConstants.CENTER); lblAllTermsCode.setWordWrap(false); lblAllTermsCode.setFont(new Font("SansSerif", 1, 12)); // Initialize ckbAddTermsCode ckbAddTermsCode = new com.sssw.rt.jform.AgcJCheckBox(); ckbAddTermsCode.setName("ckbAddTermsCode"); ckbAddTermsCode.setBounds(690,250,13,20); ckbAddTermsCode.setContentAreaFilled(false); ckbAddTermsCode.setBorderPainted(false); ckbAddTermsCode.setFont(new Font("SansSerif", 0, 12)); ckbAddTermsCode.setForeground(Color.black); ckbAddTermsCode.setBackground(Color.white); // Initialize lblAddTermsCode lblAddTermsCode = new com.sssw.rt.jform.AgcJLabel(); lblAddTermsCode.setName("lblAddTermsCode"); lblAddTermsCode.setBounds(750,255,135,25); lblAddTermsCode.setText("Add Terms Code"); lblAddTermsCode.setOpaque(false); lblAddTermsCode.setTextStyle(0); lblAddTermsCode.setForeground(Color.black); lblAddTermsCode.setTextShadowColor(Color.darkGray); lblAddTermsCode.setTextHighlightColor(Color.gray); lblAddTermsCode.setBackground(Color.lightGray); lblAddTermsCode.setHorizontalAlignment(SwingConstants.RIGHT); lblAddTermsCode.setVerticalAlignment(SwingConstants.CENTER); lblAddTermsCode.setHorizontalTextPosition(SwingConstants.RIGHT); lblAddTermsCode.setVerticalTextPosition(SwingConstants.CENTER); lblAddTermsCode.setWordWrap(false); lblAddTermsCode.setFont(new Font("SansSerif", 1, 12)); // Initialize fldAddTermsCode fldAddTermsCode = new com.sssw.rt.jform.AgcJTextField(); fldAddTermsCode.setName("fldAddTermsCode"); fldAddTermsCode.setBounds(895,255,95,20); fldAddTermsCode.setFont(new Font("SansSerif", 0, 12)); fldAddTermsCode.setHorizontalAlignment(2); fldAddTermsCode.setMargin(new Insets(1, 1, 1, 1)); fldAddTermsCode.setEditable(true); fldAddTermsCode.setForeground(Color.black); fldAddTermsCode.setBackground(Color.white); fldAddTermsCode.setMaxLength(AgcJTextField.NO_LIMIT); fldAddTermsCode.setMinLength(AgcJTextField.NO_LIMIT); // Initialize listAddTermCode listAddTermCode = new com.sssw.rt.jform.AgcJList(); DefaultListModel listAddTermCodeModel = new DefaultListModel(); listAddTermCode.setModel(listAddTermCodeModel); listAddTermCode.setFont(new Font("SansSerif", 0, 12)); listAddTermCode.setName("listAddTermCode"); listAddTermCodeScrollPane = new JScrollPane(listAddTermCode); listAddTermCodeScrollPane.setBounds(745,280,245,75); // Initialize Rectangle4 Rectangle4 = new com.sssw.rt.form.AgcRectangle(); Rectangle4.setName("Rectangle4"); Rectangle4.setBounds(740,250,255,115); Rectangle4.setColor(Color.lightGray); Rectangle4.setBorderStyle(1); Rectangle4.setText(""); Rectangle4.setFont(new Font("SansSerif", 0, 12)); Rectangle4.setForeground(Color.black); Rectangle4.setTransparent(false); // Initialize Field2 Field2 = new com.sssw.rt.jform.AgcJTextField(); Field2.setName("Field2"); Field2.setBounds(880,255,95,20); Field2.setFont(new Font("SansSerif", 0, 12)); Field2.setHorizontalAlignment(2); Field2.setMargin(new Insets(1, 1, 1, 1)); Field2.setEditable(true); Field2.setForeground(Color.black); Field2.setBackground(Color.white); Field2.setMaxLength(AgcJTextField.NO_LIMIT); Field2.setMinLength(AgcJTextField.NO_LIMIT); // Initialize Label2 Label2 = new com.sssw.rt.jform.AgcJLabel(); Label2.setName("Label2"); Label2.setBounds(765,253,100,25); Label2.setText("Add Sales Rep"); Label2.setOpaque(false); Label2.setTextStyle(0); Label2.setForeground(Color.black); Label2.setTextShadowColor(Color.darkGray); Label2.setTextHighlightColor(Color.gray); Label2.setBackground(Color.lightGray); Label2.setHorizontalAlignment(SwingConstants.RIGHT); Label2.setVerticalAlignment(SwingConstants.CENTER); Label2.setHorizontalTextPosition(SwingConstants.RIGHT); Label2.setVerticalTextPosition(SwingConstants.CENTER); Label2.setWordWrap(false); Label2.setFont(new Font("SansSerif", 1, 12)); // Initialize pbSelectTermsCodes pbSelectTermsCodes = new com.sssw.rt.jform.AgcJButton(); pbSelectTermsCodes.setName("pbSelectTermsCodes"); pbSelectTermsCodes.setBounds(905,370,90,25); pbSelectTermsCodes.setContentAreaFilled(true); pbSelectTermsCodes.setBorderPainted(true); pbSelectTermsCodes.setMargin(new Insets(1, 1, 1, 1)); pbSelectTermsCodes.setHorizontalAlignment(SwingConstants.CENTER); pbSelectTermsCodes.setVerticalAlignment(SwingConstants.CENTER); pbSelectTermsCodes.setHorizontalTextPosition(SwingConstants.RIGHT); pbSelectTermsCodes.setVerticalTextPosition(SwingConstants.CENTER); pbSelectTermsCodes.setText("Select"); pbSelectTermsCodes.setFont(new Font("SansSerif", 1, 12)); pbSelectTermsCodes.setForeground(Color.black); pbSelectTermsCodes.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize pbSelectSalesRep pbSelectSalesRep = new com.sssw.rt.jform.AgcJButton(); pbSelectSalesRep.setName("pbSelectSalesRep"); pbSelectSalesRep.setBounds(570,370,90,25); pbSelectSalesRep.setContentAreaFilled(true); pbSelectSalesRep.setBorderPainted(true); pbSelectSalesRep.setMargin(new Insets(1, 1, 1, 1)); pbSelectSalesRep.setHorizontalAlignment(SwingConstants.CENTER); pbSelectSalesRep.setVerticalAlignment(SwingConstants.CENTER); pbSelectSalesRep.setHorizontalTextPosition(SwingConstants.RIGHT); pbSelectSalesRep.setVerticalTextPosition(SwingConstants.CENTER); pbSelectSalesRep.setText("Select"); pbSelectSalesRep.setFont(new Font("SansSerif", 1, 12)); pbSelectSalesRep.setForeground(Color.black); pbSelectSalesRep.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize fldAddSalesRep fldAddSalesRep = new com.sssw.rt.jform.AgcJTextField(); fldAddSalesRep.setName("fldAddSalesRep"); fldAddSalesRep.setBounds(560,255,95,20); fldAddSalesRep.setFont(new Font("SansSerif", 0, 12)); fldAddSalesRep.setHorizontalAlignment(2); fldAddSalesRep.setMargin(new Insets(1, 1, 1, 1)); fldAddSalesRep.setEditable(true); fldAddSalesRep.setForeground(Color.black); fldAddSalesRep.setBackground(Color.white); fldAddSalesRep.setMaxLength(AgcJTextField.NO_LIMIT); fldAddSalesRep.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblAddSalesRep lblAddSalesRep = new com.sssw.rt.jform.AgcJLabel(); lblAddSalesRep.setName("lblAddSalesRep"); lblAddSalesRep.setBounds(410,255,140,25); lblAddSalesRep.setText("Add Sales Rep"); lblAddSalesRep.setOpaque(false); lblAddSalesRep.setTextStyle(0); lblAddSalesRep.setForeground(Color.black); lblAddSalesRep.setTextShadowColor(Color.darkGray); lblAddSalesRep.setTextHighlightColor(Color.gray); lblAddSalesRep.setBackground(Color.lightGray); lblAddSalesRep.setHorizontalAlignment(SwingConstants.RIGHT); lblAddSalesRep.setVerticalAlignment(SwingConstants.CENTER); lblAddSalesRep.setHorizontalTextPosition(SwingConstants.RIGHT); lblAddSalesRep.setVerticalTextPosition(SwingConstants.CENTER); lblAddSalesRep.setWordWrap(false); lblAddSalesRep.setFont(new Font("SansSerif", 1, 12)); // Initialize listAddSalesRep listAddSalesRep = new com.sssw.rt.jform.AgcJList(); DefaultListModel listAddSalesRepModel = new DefaultListModel(); listAddSalesRep.setModel(listAddSalesRepModel); listAddSalesRep.setFont(new Font("SansSerif", 0, 12)); listAddSalesRep.setName("listAddSalesRep"); listAddSalesRepScrollPane = new JScrollPane(listAddSalesRep); listAddSalesRepScrollPane.setBounds(410,280,245,75); // Initialize Rectangle3 Rectangle3 = new com.sssw.rt.form.AgcRectangle(); Rectangle3.setName("Rectangle3"); Rectangle3.setBounds(405,250,255,115); Rectangle3.setColor(Color.lightGray); Rectangle3.setBorderStyle(1); Rectangle3.setText(""); Rectangle3.setFont(new Font("SansSerif", 0, 12)); Rectangle3.setForeground(Color.black); Rectangle3.setTransparent(false); // Initialize Field1 Field1 = new com.sssw.rt.jform.AgcJTextField(); Field1.setName("Field1"); Field1.setBounds(515,252,95,20); Field1.setFont(new Font("SansSerif", 0, 12)); Field1.setHorizontalAlignment(2); Field1.setMargin(new Insets(1, 1, 1, 1)); Field1.setEditable(true); Field1.setForeground(Color.black); Field1.setBackground(Color.white); Field1.setMaxLength(AgcJTextField.NO_LIMIT); Field1.setMinLength(AgcJTextField.NO_LIMIT); // Initialize Label1 Label1 = new com.sssw.rt.jform.AgcJLabel(); Label1.setName("Label1"); Label1.setBounds(400,250,100,25); Label1.setText("Add Customer"); Label1.setOpaque(false); Label1.setTextStyle(0); Label1.setForeground(Color.black); Label1.setTextShadowColor(Color.darkGray); Label1.setTextHighlightColor(Color.gray); Label1.setBackground(Color.lightGray); Label1.setHorizontalAlignment(SwingConstants.RIGHT); Label1.setVerticalAlignment(SwingConstants.CENTER); Label1.setHorizontalTextPosition(SwingConstants.RIGHT); Label1.setVerticalTextPosition(SwingConstants.CENTER); Label1.setWordWrap(false); Label1.setFont(new Font("SansSerif", 1, 12)); // Initialize lblAddCustomer lblAddCustomer = new com.sssw.rt.jform.AgcJLabel(); lblAddCustomer.setName("lblAddCustomer"); lblAddCustomer.setBounds(85,255,125,25); lblAddCustomer.setText("Add Customer"); lblAddCustomer.setOpaque(false); lblAddCustomer.setTextStyle(0); lblAddCustomer.setForeground(Color.black); lblAddCustomer.setTextShadowColor(Color.darkGray); lblAddCustomer.setTextHighlightColor(Color.gray); lblAddCustomer.setBackground(Color.lightGray); lblAddCustomer.setHorizontalAlignment(SwingConstants.RIGHT); lblAddCustomer.setVerticalAlignment(SwingConstants.CENTER); lblAddCustomer.setHorizontalTextPosition(SwingConstants.RIGHT); lblAddCustomer.setVerticalTextPosition(SwingConstants.CENTER); lblAddCustomer.setWordWrap(false); lblAddCustomer.setFont(new Font("SansSerif", 1, 12)); // Initialize listAddCustomer listAddCustomer = new com.sssw.rt.jform.AgcJList(); DefaultListModel listAddCustomerModel = new DefaultListModel(); listAddCustomer.setModel(listAddCustomerModel); listAddCustomer.setFont(new Font("SansSerif", 0, 12)); listAddCustomer.setName("listAddCustomer"); listAddCustomerScrollPane = new JScrollPane(listAddCustomer); listAddCustomerScrollPane.setBounds(80,280,240,75); // Initialize fldAddCustomer fldAddCustomer = new com.sssw.rt.jform.AgcJTextField(); fldAddCustomer.setName("fldAddCustomer"); fldAddCustomer.setBounds(225,255,95,20); fldAddCustomer.setFont(new Font("SansSerif", 0, 12)); fldAddCustomer.setHorizontalAlignment(2); fldAddCustomer.setMargin(new Insets(1, 1, 1, 1)); fldAddCustomer.setEditable(true); fldAddCustomer.setForeground(Color.black); fldAddCustomer.setBackground(Color.white); fldAddCustomer.setMaxLength(AgcJTextField.NO_LIMIT); fldAddCustomer.setMinLength(AgcJTextField.NO_LIMIT); // Initialize pbSelectCust pbSelectCust = new com.sssw.rt.jform.AgcJButton(); pbSelectCust.setName("pbSelectCust"); pbSelectCust.setBounds(235,370,90,25); pbSelectCust.setContentAreaFilled(true); pbSelectCust.setBorderPainted(true); pbSelectCust.setMargin(new Insets(1, 1, 1, 1)); pbSelectCust.setHorizontalAlignment(SwingConstants.CENTER); pbSelectCust.setVerticalAlignment(SwingConstants.CENTER); pbSelectCust.setHorizontalTextPosition(SwingConstants.RIGHT); pbSelectCust.setVerticalTextPosition(SwingConstants.CENTER); pbSelectCust.setText("Select"); pbSelectCust.setFont(new Font("SansSerif", 1, 12)); pbSelectCust.setForeground(Color.black); pbSelectCust.setBackground(AgoColorManager.getColor(212, 208, 200)); // Initialize Rectangle2 Rectangle2 = new com.sssw.rt.form.AgcRectangle(); Rectangle2.setName("Rectangle2"); Rectangle2.setBounds(70,250,255,115); Rectangle2.setColor(Color.lightGray); Rectangle2.setBorderStyle(1); Rectangle2.setText(""); Rectangle2.setFont(new Font("SansSerif", 0, 12)); Rectangle2.setForeground(Color.black); Rectangle2.setTransparent(false); // Initialize rbNotPrinted rbNotPrinted = new com.sssw.rt.jform.AgcJRadioButton(); rbNotPrinted.setName("rbNotPrinted"); rbNotPrinted.setBounds(135,460,115,20); rbNotPrinted.setEnabled(false); rbNotPrinted.setContentAreaFilled(false); rbNotPrinted.setBorderPainted(false); rbNotPrinted.setMargin(new Insets(0, 0, 0, 0)); rbNotPrinted.setHorizontalAlignment(SwingConstants.LEFT); rbNotPrinted.setVerticalAlignment(SwingConstants.CENTER); rbNotPrinted.setHorizontalTextPosition(SwingConstants.RIGHT); rbNotPrinted.setVerticalTextPosition(SwingConstants.CENTER); rbNotPrinted.setText("Not Printed"); rbNotPrinted.setFont(new Font("SansSerif", 1, 12)); rbNotPrinted.setForeground(Color.black); rbNotPrinted.setBackground(AgoColorManager.getColor(212, 208, 200)); DefaultJButtonGroup.add(rbNotPrinted); // Initialize rbPrinted rbPrinted = new com.sssw.rt.jform.AgcJRadioButton(); rbPrinted.setName("rbPrinted"); rbPrinted.setBounds(25,460,90,20); rbPrinted.setEnabled(false); rbPrinted.setContentAreaFilled(false); rbPrinted.setBorderPainted(false); rbPrinted.setMargin(new Insets(0, 0, 0, 0)); rbPrinted.setHorizontalAlignment(SwingConstants.LEFT); rbPrinted.setVerticalAlignment(SwingConstants.CENTER); rbPrinted.setHorizontalTextPosition(SwingConstants.RIGHT); rbPrinted.setVerticalTextPosition(SwingConstants.CENTER); rbPrinted.setText("Printed"); rbPrinted.setFont(new Font("SansSerif", 1, 12)); rbPrinted.setForeground(Color.black); rbPrinted.setBackground(AgoColorManager.getColor(212, 208, 200)); DefaultJButtonGroup.add(rbPrinted); // Initialize agcDsoGen agcDsoGen = new com.sssw.rt.form.AgcData(); agcDsoGen.setName("agcDsoGen"); agcDsoGen.setBounds(540,700,66,58); agcDsoGen.setDataSource("com.gpc.tams.dso.dsoGeneric"); // Initialize agcStoreTransactionDate agcStoreTransactionDate = new com.sssw.rt.form.AgcData(); agcStoreTransactionDate.setName("agcStoreTransactionDate"); agcStoreTransactionDate.setBounds(456,689,65,58); agcStoreTransactionDate.setExpressionCount(5); agcStoreTransactionDate.setExpression(0, 8, "ID", 0); agcStoreTransactionDate.setExpression(1, 9, "LOC", 1); agcStoreTransactionDate.setExpression(2, 10, "ACCOUNTING_DAY", 2); agcStoreTransactionDate.setExpression(3, 11, "CALENDAR_DATE", 3); agcStoreTransactionDate.setExpression(4, 12, "SALES_YEAR_MONTH", 4); // Initialize agcCustomers agcCustomers = new com.sssw.rt.form.AgcData(); agcCustomers.setName("agcCustomers"); agcCustomers.setBounds(161,679,82,58); agcCustomers.setExpressionCount(6); agcCustomers.setExpression(0, 13, "ID", 0); agcCustomers.setExpression(1, 14, "CUSTOMER_NUM", 1); agcCustomers.setExpression(2, 15, "NAME", 2); agcCustomers.setExpression(3, 16, "LOC", 3); agcCustomers.setExpression(4, 17, "AR_CUSTOMER_ID", 4); agcCustomers.setExpression(5, 18, "AR_CUSTOMER_LOC", 5); // Initialize agcAllPrinted agcAllPrinted = new com.sssw.rt.form.AgcData(); agcAllPrinted.setName("agcAllPrinted"); agcAllPrinted.setBounds(91,679,57,58); agcAllPrinted.setDataSource("com.gpc.tams.dso.dsoGeneric"); // Initialize agcPrintedStatements agcPrintedStatements = new com.sssw.rt.form.AgcData(); agcPrintedStatements.setName("agcPrintedStatements"); agcPrintedStatements.setBounds(21,679,61,58); agcPrintedStatements.setDataSource("com.gpc.tams.dso.dsoGeneric"); // Initialize rbBalancePriorityZipCode rbBalancePriorityZipCode = new com.sssw.rt.jform.AgcJRadioButton(); rbBalancePriorityZipCode.setName("rbBalancePriorityZipCode"); rbBalancePriorityZipCode.setBounds(20,175,265,20); rbBalancePriorityZipCode.setContentAreaFilled(false); rbBalancePriorityZipCode.setBorderPainted(false); rbBalancePriorityZipCode.setMargin(new Insets(0, 0, 0, 0)); rbBalancePriorityZipCode.setHorizontalAlignment(SwingConstants.LEFT); rbBalancePriorityZipCode.setVerticalAlignment(SwingConstants.CENTER); rbBalancePriorityZipCode.setHorizontalTextPosition(SwingConstants.RIGHT); rbBalancePriorityZipCode.setVerticalTextPosition(SwingConstants.CENTER); rbBalancePriorityZipCode.setText("Balance Priority - Zip Code"); rbBalancePriorityZipCode.setCheckedValue("3"); rbBalancePriorityZipCode.setFont(new Font("SansSerif", 1, 12)); rbBalancePriorityZipCode.setForeground(Color.black); rbBalancePriorityZipCode.setBackground(Color.lightGray); printSequenceGroup.add(rbBalancePriorityZipCode); // Initialize cbAccountingDay cbAccountingDay = new com.sssw.rt.jform.AgcJComboBox(); cbAccountingDay.setName("cbAccountingDay"); cbAccountingDay.setBounds(395,47,140,25); cbAccountingDay.setEditable((boolean)false); cbAccountingDay.setFont(new Font("SansSerif", 0, 12)); DefaultComboBoxModel cbAccountingDayModel = new DefaultComboBoxModel(); cbAccountingDay.setModel(cbAccountingDayModel); // Initialize rbIncludeZeroBalanceNo rbIncludeZeroBalanceNo = new com.sssw.rt.jform.AgcJRadioButton(); rbIncludeZeroBalanceNo.setName("rbIncludeZeroBalanceNo"); rbIncludeZeroBalanceNo.setBounds(297,420,54,20); rbIncludeZeroBalanceNo.setContentAreaFilled(false); rbIncludeZeroBalanceNo.setBorderPainted(false); rbIncludeZeroBalanceNo.setMargin(new Insets(0, 0, 0, 0)); rbIncludeZeroBalanceNo.setHorizontalAlignment(SwingConstants.LEFT); rbIncludeZeroBalanceNo.setVerticalAlignment(SwingConstants.CENTER); rbIncludeZeroBalanceNo.setHorizontalTextPosition(SwingConstants.RIGHT); rbIncludeZeroBalanceNo.setVerticalTextPosition(SwingConstants.CENTER); rbIncludeZeroBalanceNo.setText("No"); rbIncludeZeroBalanceNo.setCheckedValue("N"); rbIncludeZeroBalanceNo.setFont(new Font("SansSerif", 1, 12)); rbIncludeZeroBalanceNo.setForeground(Color.black); rbIncludeZeroBalanceNo.setBackground(AgoColorManager.getColor(212, 208, 200)); zeroBalanceGroup.add(rbIncludeZeroBalanceNo); // Initialize rbIncludeZeroBalanceYes rbIncludeZeroBalanceYes = new com.sssw.rt.jform.AgcJRadioButton(); rbIncludeZeroBalanceYes.setName("rbIncludeZeroBalanceYes"); rbIncludeZeroBalanceYes.setBounds(226,420,57,20); rbIncludeZeroBalanceYes.setContentAreaFilled(false); rbIncludeZeroBalanceYes.setBorderPainted(false); rbIncludeZeroBalanceYes.setMargin(new Insets(0, 0, 0, 0)); rbIncludeZeroBalanceYes.setHorizontalAlignment(SwingConstants.LEFT); rbIncludeZeroBalanceYes.setVerticalAlignment(SwingConstants.CENTER); rbIncludeZeroBalanceYes.setHorizontalTextPosition(SwingConstants.RIGHT); rbIncludeZeroBalanceYes.setVerticalTextPosition(SwingConstants.CENTER); rbIncludeZeroBalanceYes.setText("Yes"); rbIncludeZeroBalanceYes.setCheckedValue("Y"); rbIncludeZeroBalanceYes.setFont(new Font("SansSerif", 1, 12)); rbIncludeZeroBalanceYes.setForeground(Color.black); rbIncludeZeroBalanceYes.setBackground(AgoColorManager.getColor(212, 208, 200)); zeroBalanceGroup.add(rbIncludeZeroBalanceYes); // Initialize rectIncludeZeroBalanceStatements rectIncludeZeroBalanceStatements = new com.sssw.rt.form.AgcRectangle(); rectIncludeZeroBalanceStatements.setName("rectIncludeZeroBalanceStatements"); rectIncludeZeroBalanceStatements.setBounds(190,400,213,47); rectIncludeZeroBalanceStatements.setColor(Color.lightGray); rectIncludeZeroBalanceStatements.setBorderStyle(4); rectIncludeZeroBalanceStatements.setText("Include Zero Balance Statements"); rectIncludeZeroBalanceStatements.setFont(new Font("SansSerif", 1, 12)); rectIncludeZeroBalanceStatements.setForeground(Color.black); rectIncludeZeroBalanceStatements.setTransparent(true); // Initialize rbIncludeInvoicesYes rbIncludeInvoicesYes = new com.sssw.rt.jform.AgcJRadioButton(); rbIncludeInvoicesYes.setName("rbIncludeInvoicesYes"); rbIncludeInvoicesYes.setBounds(24,420,71,20); rbIncludeInvoicesYes.setContentAreaFilled(false); rbIncludeInvoicesYes.setBorderPainted(false); rbIncludeInvoicesYes.setMargin(new Insets(0, 0, 0, 0)); rbIncludeInvoicesYes.setHorizontalAlignment(SwingConstants.LEFT); rbIncludeInvoicesYes.setVerticalAlignment(SwingConstants.CENTER); rbIncludeInvoicesYes.setHorizontalTextPosition(SwingConstants.RIGHT); rbIncludeInvoicesYes.setVerticalTextPosition(SwingConstants.CENTER); rbIncludeInvoicesYes.setText("Yes"); rbIncludeInvoicesYes.setCheckedValue("Y"); rbIncludeInvoicesYes.setFont(new Font("SansSerif", 1, 12)); rbIncludeInvoicesYes.setForeground(Color.black); rbIncludeInvoicesYes.setBackground(AgoColorManager.getColor(212, 208, 200)); paidInvoiceGroup.add(rbIncludeInvoicesYes); // Initialize rbIncludeInvoicesNo rbIncludeInvoicesNo = new com.sssw.rt.jform.AgcJRadioButton(); rbIncludeInvoicesNo.setName("rbIncludeInvoicesNo"); rbIncludeInvoicesNo.setBounds(105,420,60,20); rbIncludeInvoicesNo.setContentAreaFilled(false); rbIncludeInvoicesNo.setBorderPainted(false); rbIncludeInvoicesNo.setMargin(new Insets(0, 0, 0, 0)); rbIncludeInvoicesNo.setHorizontalAlignment(SwingConstants.LEFT); rbIncludeInvoicesNo.setVerticalAlignment(SwingConstants.CENTER); rbIncludeInvoicesNo.setHorizontalTextPosition(SwingConstants.RIGHT); rbIncludeInvoicesNo.setVerticalTextPosition(SwingConstants.CENTER); rbIncludeInvoicesNo.setText("No"); rbIncludeInvoicesNo.setCheckedValue("N"); rbIncludeInvoicesNo.setFont(new Font("SansSerif", 1, 12)); rbIncludeInvoicesNo.setForeground(Color.black); rbIncludeInvoicesNo.setBackground(AgoColorManager.getColor(212, 208, 200)); paidInvoiceGroup.add(rbIncludeInvoicesNo); // Initialize cbxAllSalesRepresenatives cbxAllSalesRepresenatives = new com.sssw.rt.jform.AgcJCheckBox(); cbxAllSalesRepresenatives.setName("cbxAllSalesRepresenatives"); cbxAllSalesRepresenatives.setBounds(355,250,13,20); cbxAllSalesRepresenatives.setContentAreaFilled(false); cbxAllSalesRepresenatives.setBorderPainted(false); cbxAllSalesRepresenatives.setFont(new Font("SansSerif", 0, 12)); cbxAllSalesRepresenatives.setForeground(Color.black); cbxAllSalesRepresenatives.setBackground(Color.white); // Initialize lblAllSalesRepresenatives lblAllSalesRepresenatives = new com.sssw.rt.jform.AgcJLabel(); lblAllSalesRepresenatives.setName("lblAllSalesRepresenatives"); lblAllSalesRepresenatives.setBounds(376,250,35,20); lblAllSalesRepresenatives.setText("All"); lblAllSalesRepresenatives.setOpaque(false); lblAllSalesRepresenatives.setTextStyle(0); lblAllSalesRepresenatives.setForeground(Color.black); lblAllSalesRepresenatives.setTextShadowColor(Color.darkGray); lblAllSalesRepresenatives.setTextHighlightColor(Color.gray); lblAllSalesRepresenatives.setBackground(AgoColorManager.getColor(212, 208, 200)); lblAllSalesRepresenatives.setHorizontalAlignment(SwingConstants.LEFT); lblAllSalesRepresenatives.setVerticalAlignment(SwingConstants.CENTER); lblAllSalesRepresenatives.setHorizontalTextPosition(SwingConstants.RIGHT); lblAllSalesRepresenatives.setVerticalTextPosition(SwingConstants.CENTER); lblAllSalesRepresenatives.setWordWrap(false); lblAllSalesRepresenatives.setFont(new Font("SansSerif", 1, 12)); // Initialize lblSalesRepresenativeNumberRange lblSalesRepresenativeNumberRange = new com.sssw.rt.jform.AgcJLabel(); lblSalesRepresenativeNumberRange.setName("lblSalesRepresenativeNumberRange"); lblSalesRepresenativeNumberRange.setBounds(345,225,55,18); lblSalesRepresenativeNumberRange.setText("Range"); lblSalesRepresenativeNumberRange.setOpaque(false); lblSalesRepresenativeNumberRange.setTextStyle(0); lblSalesRepresenativeNumberRange.setForeground(Color.black); lblSalesRepresenativeNumberRange.setTextShadowColor(Color.darkGray); lblSalesRepresenativeNumberRange.setTextHighlightColor(Color.gray); lblSalesRepresenativeNumberRange.setBackground(Color.lightGray); lblSalesRepresenativeNumberRange.setHorizontalAlignment(SwingConstants.RIGHT); lblSalesRepresenativeNumberRange.setVerticalAlignment(SwingConstants.CENTER); lblSalesRepresenativeNumberRange.setHorizontalTextPosition(SwingConstants.RIGHT); lblSalesRepresenativeNumberRange.setVerticalTextPosition(SwingConstants.CENTER); lblSalesRepresenativeNumberRange.setWordWrap(false); lblSalesRepresenativeNumberRange.setFont(new Font("SansSerif", 1, 12)); // Initialize fldSalesRepFrom fldSalesRepFrom = new com.sssw.rt.jform.AgcJTextField(); fldSalesRepFrom.setName("fldSalesRepFrom"); fldSalesRepFrom.setBounds(410,225,105,20); fldSalesRepFrom.setFont(new Font("SansSerif", 0, 12)); fldSalesRepFrom.setHorizontalAlignment(2); fldSalesRepFrom.setMargin(new Insets(1, 1, 1, 1)); fldSalesRepFrom.setEditable(true); fldSalesRepFrom.setForeground(Color.black); fldSalesRepFrom.setBackground(Color.white); fldSalesRepFrom.setMaxLength(AgcJTextField.NO_LIMIT); fldSalesRepFrom.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblSalesRepTo lblSalesRepTo = new com.sssw.rt.jform.AgcJLabel(); lblSalesRepTo.setName("lblSalesRepTo"); lblSalesRepTo.setBounds(510,225,50,18); lblSalesRepTo.setText("to"); lblSalesRepTo.setOpaque(false); lblSalesRepTo.setTextStyle(0); lblSalesRepTo.setForeground(Color.black); lblSalesRepTo.setTextShadowColor(Color.darkGray); lblSalesRepTo.setTextHighlightColor(Color.gray); lblSalesRepTo.setBackground(Color.lightGray); lblSalesRepTo.setHorizontalAlignment(SwingConstants.CENTER); lblSalesRepTo.setVerticalAlignment(SwingConstants.CENTER); lblSalesRepTo.setHorizontalTextPosition(SwingConstants.RIGHT); lblSalesRepTo.setVerticalTextPosition(SwingConstants.CENTER); lblSalesRepTo.setWordWrap(false); lblSalesRepTo.setFont(new Font("SansSerif", 1, 12)); // Initialize fldSalesRepTo fldSalesRepTo = new com.sssw.rt.jform.AgcJTextField(); fldSalesRepTo.setName("fldSalesRepTo"); fldSalesRepTo.setBounds(555,225,105,20); fldSalesRepTo.setFont(new Font("SansSerif", 0, 12)); fldSalesRepTo.setHorizontalAlignment(2); fldSalesRepTo.setMargin(new Insets(1, 1, 1, 1)); fldSalesRepTo.setEditable(true); fldSalesRepTo.setForeground(Color.black); fldSalesRepTo.setBackground(Color.white); fldSalesRepTo.setMaxLength(AgcJTextField.NO_LIMIT); fldSalesRepTo.setMinLength(AgcJTextField.NO_LIMIT); // Initialize cbxAllCustomers cbxAllCustomers = new com.sssw.rt.jform.AgcJCheckBox(); cbxAllCustomers.setName("cbxAllCustomers"); cbxAllCustomers.setBounds(20,250,13,20); cbxAllCustomers.setContentAreaFilled(false); cbxAllCustomers.setBorderPainted(false); cbxAllCustomers.setFont(new Font("SansSerif", 0, 12)); cbxAllCustomers.setForeground(Color.black); cbxAllCustomers.setBackground(Color.white); // Initialize lblAllCustomers lblAllCustomers = new com.sssw.rt.jform.AgcJLabel(); lblAllCustomers.setName("lblAllCustomers"); lblAllCustomers.setBounds(41,250,45,20); lblAllCustomers.setText("All"); lblAllCustomers.setOpaque(false); lblAllCustomers.setTextStyle(0); lblAllCustomers.setForeground(Color.black); lblAllCustomers.setTextShadowColor(Color.darkGray); lblAllCustomers.setTextHighlightColor(Color.gray); lblAllCustomers.setBackground(AgoColorManager.getColor(212, 208, 200)); lblAllCustomers.setHorizontalAlignment(SwingConstants.LEFT); lblAllCustomers.setVerticalAlignment(SwingConstants.CENTER); lblAllCustomers.setHorizontalTextPosition(SwingConstants.RIGHT); lblAllCustomers.setVerticalTextPosition(SwingConstants.CENTER); lblAllCustomers.setWordWrap(false); lblAllCustomers.setFont(new Font("SansSerif", 1, 12)); // Initialize lblCustomerNumberRange lblCustomerNumberRange = new com.sssw.rt.jform.AgcJLabel(); lblCustomerNumberRange.setName("lblCustomerNumberRange"); lblCustomerNumberRange.setBounds(10,225,55,18); lblCustomerNumberRange.setText("Range"); lblCustomerNumberRange.setOpaque(false); lblCustomerNumberRange.setTextStyle(0); lblCustomerNumberRange.setForeground(Color.black); lblCustomerNumberRange.setTextShadowColor(Color.darkGray); lblCustomerNumberRange.setTextHighlightColor(Color.gray); lblCustomerNumberRange.setBackground(Color.lightGray); lblCustomerNumberRange.setHorizontalAlignment(SwingConstants.RIGHT); lblCustomerNumberRange.setVerticalAlignment(SwingConstants.CENTER); lblCustomerNumberRange.setHorizontalTextPosition(SwingConstants.RIGHT); lblCustomerNumberRange.setVerticalTextPosition(SwingConstants.CENTER); lblCustomerNumberRange.setWordWrap(false); lblCustomerNumberRange.setFont(new Font("SansSerif", 1, 12)); // Initialize fldFromCustomerNumber fldFromCustomerNumber = new com.sssw.rt.jform.AgcJTextField(); fldFromCustomerNumber.setName("fldFromCustomerNumber"); fldFromCustomerNumber.setBounds(75,225,105,20); fldFromCustomerNumber.setFont(new Font("SansSerif", 0, 12)); fldFromCustomerNumber.setHorizontalAlignment(2); fldFromCustomerNumber.setMargin(new Insets(1, 1, 1, 1)); fldFromCustomerNumber.setEditable(true); fldFromCustomerNumber.setForeground(Color.black); fldFromCustomerNumber.setBackground(Color.white); fldFromCustomerNumber.setMaxLength(AgcJTextField.NO_LIMIT); fldFromCustomerNumber.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblCustomerNumberRangeTo lblCustomerNumberRangeTo = new com.sssw.rt.jform.AgcJLabel(); lblCustomerNumberRangeTo.setName("lblCustomerNumberRangeTo"); lblCustomerNumberRangeTo.setBounds(175,225,50,18); lblCustomerNumberRangeTo.setText("to"); lblCustomerNumberRangeTo.setOpaque(false); lblCustomerNumberRangeTo.setTextStyle(0); lblCustomerNumberRangeTo.setForeground(Color.black); lblCustomerNumberRangeTo.setTextShadowColor(Color.darkGray); lblCustomerNumberRangeTo.setTextHighlightColor(Color.gray); lblCustomerNumberRangeTo.setBackground(Color.lightGray); lblCustomerNumberRangeTo.setHorizontalAlignment(SwingConstants.CENTER); lblCustomerNumberRangeTo.setVerticalAlignment(SwingConstants.CENTER); lblCustomerNumberRangeTo.setHorizontalTextPosition(SwingConstants.RIGHT); lblCustomerNumberRangeTo.setVerticalTextPosition(SwingConstants.CENTER); lblCustomerNumberRangeTo.setWordWrap(false); lblCustomerNumberRangeTo.setFont(new Font("SansSerif", 1, 12)); // Initialize fldToCustomerNumber fldToCustomerNumber = new com.sssw.rt.jform.AgcJTextField(); fldToCustomerNumber.setName("fldToCustomerNumber"); fldToCustomerNumber.setBounds(220,225,105,20); fldToCustomerNumber.setFont(new Font("SansSerif", 0, 12)); fldToCustomerNumber.setHorizontalAlignment(2); fldToCustomerNumber.setMargin(new Insets(1, 1, 1, 1)); fldToCustomerNumber.setEditable(true); fldToCustomerNumber.setForeground(Color.black); fldToCustomerNumber.setBackground(Color.white); fldToCustomerNumber.setMaxLength(AgcJTextField.NO_LIMIT); fldToCustomerNumber.setMinLength(AgcJTextField.NO_LIMIT); // Initialize rbCustomerNumberOnly rbCustomerNumberOnly = new com.sssw.rt.jform.AgcJRadioButton(); rbCustomerNumberOnly.setName("rbCustomerNumberOnly"); rbCustomerNumberOnly.setBounds(305,152,350,20); rbCustomerNumberOnly.setContentAreaFilled(false); rbCustomerNumberOnly.setBorderPainted(false); rbCustomerNumberOnly.setMargin(new Insets(0, 0, 0, 0)); rbCustomerNumberOnly.setHorizontalAlignment(SwingConstants.LEFT); rbCustomerNumberOnly.setVerticalAlignment(SwingConstants.CENTER); rbCustomerNumberOnly.setHorizontalTextPosition(SwingConstants.RIGHT); rbCustomerNumberOnly.setVerticalTextPosition(SwingConstants.CENTER); rbCustomerNumberOnly.setText("Customer Number Only"); rbCustomerNumberOnly.setCheckedValue("2"); rbCustomerNumberOnly.setFont(new Font("SansSerif", 1, 12)); rbCustomerNumberOnly.setForeground(Color.black); rbCustomerNumberOnly.setBackground(AgoColorManager.getColor(212, 208, 200)); printSequenceGroup.add(rbCustomerNumberOnly); // Initialize rbBalancePriorityCustomerNumber rbBalancePriorityCustomerNumber = new com.sssw.rt.jform.AgcJRadioButton(); rbBalancePriorityCustomerNumber.setName("rbBalancePriorityCustomerNumber"); rbBalancePriorityCustomerNumber.setBounds(305,175,285,20); rbBalancePriorityCustomerNumber.setContentAreaFilled(false); rbBalancePriorityCustomerNumber.setBorderPainted(false); rbBalancePriorityCustomerNumber.setMargin(new Insets(0, 0, 0, 0)); rbBalancePriorityCustomerNumber.setHorizontalAlignment(SwingConstants.LEFT); rbBalancePriorityCustomerNumber.setVerticalAlignment(SwingConstants.CENTER); rbBalancePriorityCustomerNumber.setHorizontalTextPosition(SwingConstants.RIGHT); rbBalancePriorityCustomerNumber.setVerticalTextPosition(SwingConstants.CENTER); rbBalancePriorityCustomerNumber.setText("Balance Priority - Customer Number"); rbBalancePriorityCustomerNumber.setCheckedValue("4"); rbBalancePriorityCustomerNumber.setFont(new Font("SansSerif", 1, 12)); rbBalancePriorityCustomerNumber.setForeground(Color.black); rbBalancePriorityCustomerNumber.setBackground(AgoColorManager.getColor(212, 208, 200)); printSequenceGroup.add(rbBalancePriorityCustomerNumber); // Initialize rbStoreResponsibilityBalancePriorityCustomerNumber rbStoreResponsibilityBalancePriorityCustomerNumber = new com.sssw.rt.jform.AgcJRadioButton(); rbStoreResponsibilityBalancePriorityCustomerNumber.setName("rbStoreResponsibilityBalancePriorityCustomerNumber"); rbStoreResponsibilityBalancePriorityCustomerNumber.setBounds(595,175,484,20); rbStoreResponsibilityBalancePriorityCustomerNumber.setContentAreaFilled(false); rbStoreResponsibilityBalancePriorityCustomerNumber.setBorderPainted(false); rbStoreResponsibilityBalancePriorityCustomerNumber.setMargin(new Insets(0, 0, 0, 0)); rbStoreResponsibilityBalancePriorityCustomerNumber.setHorizontalAlignment(SwingConstants.LEFT); rbStoreResponsibilityBalancePriorityCustomerNumber.setVerticalAlignment(SwingConstants.CENTER); rbStoreResponsibilityBalancePriorityCustomerNumber.setHorizontalTextPosition(SwingConstants.RIGHT); rbStoreResponsibilityBalancePriorityCustomerNumber.setVerticalTextPosition(SwingConstants.CENTER); rbStoreResponsibilityBalancePriorityCustomerNumber.setText("Store Responsibility, Balance Priority - Customer Number"); rbStoreResponsibilityBalancePriorityCustomerNumber.setCheckedValue("5"); rbStoreResponsibilityBalancePriorityCustomerNumber.setFont(new Font("SansSerif", 1, 12)); rbStoreResponsibilityBalancePriorityCustomerNumber.setForeground(Color.black); rbStoreResponsibilityBalancePriorityCustomerNumber.setBackground(AgoColorManager.getColor(212, 208, 200)); printSequenceGroup.add(rbStoreResponsibilityBalancePriorityCustomerNumber); // Initialize fldMessageOnStatement fldMessageOnStatement = new com.sssw.rt.jform.AgcJTextField(); fldMessageOnStatement.setName("fldMessageOnStatement"); fldMessageOnStatement.setBounds(25,105,380,20); fldMessageOnStatement.setFont(new Font("SansSerif", 0, 12)); fldMessageOnStatement.setHorizontalAlignment(2); fldMessageOnStatement.setMargin(new Insets(1, 1, 1, 1)); fldMessageOnStatement.setEditable(true); fldMessageOnStatement.setForeground(Color.black); fldMessageOnStatement.setBackground(Color.white); fldMessageOnStatement.setMaxLength(AgcJTextField.NO_LIMIT); fldMessageOnStatement.setMinLength(AgcJTextField.NO_LIMIT); // Initialize lblPreviousAccountingDayData lblPreviousAccountingDayData = new com.sssw.rt.jform.AgcJLabel(); lblPreviousAccountingDayData.setName("lblPreviousAccountingDayData"); lblPreviousAccountingDayData.setBounds(966,50,30,18); lblPreviousAccountingDayData.setText("15"); lblPreviousAccountingDayData.setOpaque(false); lblPreviousAccountingDayData.setTextStyle(0); lblPreviousAccountingDayData.setForeground(Color.black); lblPreviousAccountingDayData.setTextShadowColor(Color.darkGray); lblPreviousAccountingDayData.setTextHighlightColor(Color.gray); lblPreviousAccountingDayData.setBackground(Color.lightGray); lblPreviousAccountingDayData.setHorizontalAlignment(SwingConstants.LEFT); lblPreviousAccountingDayData.setVerticalAlignment(SwingConstants.CENTER); lblPreviousAccountingDayData.setHorizontalTextPosition(SwingConstants.RIGHT); lblPreviousAccountingDayData.setVerticalTextPosition(SwingConstants.CENTER); lblPreviousAccountingDayData.setWordWrap(false); lblPreviousAccountingDayData.setFont(new Font("SansSerif", 0, 12)); // Initialize lblPreviousClosingDateData lblPreviousClosingDateData = new com.sssw.rt.jform.AgcJLabel(); lblPreviousClosingDateData.setName("lblPreviousClosingDateData"); lblPreviousClosingDateData.setBounds(705,50,90,18); lblPreviousClosingDateData.setText("07/15/2001"); lblPreviousClosingDateData.setOpaque(false); lblPreviousClosingDateData.setTextStyle(0); lblPreviousClosingDateData.setForeground(Color.black); lblPreviousClosingDateData.setTextShadowColor(Color.darkGray); lblPreviousClosingDateData.setTextHighlightColor(Color.gray); lblPreviousClosingDateData.setBackground(Color.lightGray); lblPreviousClosingDateData.setHorizontalAlignment(SwingConstants.LEFT); lblPreviousClosingDateData.setVerticalAlignment(SwingConstants.CENTER); lblPreviousClosingDateData.setHorizontalTextPosition(SwingConstants.RIGHT); lblPreviousClosingDateData.setVerticalTextPosition(SwingConstants.CENTER); lblPreviousClosingDateData.setWordWrap(false); lblPreviousClosingDateData.setFont(new Font("SansSerif", 0, 12)); // Initialize pbFinalize pbFinalize = new com.sssw.rt.jform.AgcJButton(); pbFinalize.setName("pbFinalize"); pbFinalize.setBounds(923,625,80,25); pbFinalize.setEnabled(false); pbFinalize.setContentAreaFilled(true); pbFinalize.setBorderPainted(true); pbFinalize.setMargin(new Insets(1, 1, 1, 1)); pbFinalize.setHorizontalAlignment(SwingConstants.CENTER); pbFinalize.setVerticalAlignment(SwingConstants.CENTER); pbFinalize.setHorizontalTextPosition(SwingConstants.RIGHT); pbFinalize.setVerticalTextPosition(SwingConstants.CENTER); pbFinalize.setText("Finalize"); pbFinalize.setFont(new Font("SansSerif", 1, 12)); pbFinalize.setForeground(Color.black); pbFinalize.setBackground(Color.lightGray); // Initialize pbViewStatement pbViewStatement = new com.sssw.rt.jform.AgcJButton(); pbViewStatement.setName("pbViewStatement"); pbViewStatement.setBounds(643,625,170,25); pbViewStatement.setContentAreaFilled(true); pbViewStatement.setBorderPainted(true); pbViewStatement.setMargin(new Insets(1, 1, 1, 1)); pbViewStatement.setHorizontalAlignment(SwingConstants.CENTER); pbViewStatement.setVerticalAlignment(SwingConstants.CENTER); pbViewStatement.setHorizontalTextPosition(SwingConstants.RIGHT); pbViewStatement.setVerticalTextPosition(SwingConstants.CENTER); pbViewStatement.setText("View Statement"); pbViewStatement.setFont(new Font("SansSerif", 1, 12)); pbViewStatement.setForeground(Color.black); pbViewStatement.setBackground(Color.lightGray); pbViewStatement.setEnabled(false); // Initialize pbAbort pbAbort = new com.sssw.rt.jform.AgcJButton(); pbAbort.setName("pbAbort"); pbAbort.setBounds(828,625,80,25); pbAbort.setContentAreaFilled(true); pbAbort.setBorderPainted(true); pbAbort.setMargin(new Insets(1, 1, 1, 1)); pbAbort.setHorizontalAlignment(SwingConstants.CENTER); pbAbort.setVerticalAlignment(SwingConstants.CENTER); pbAbort.setHorizontalTextPosition(SwingConstants.RIGHT); pbAbort.setVerticalTextPosition(SwingConstants.CENTER); pbAbort.setText("Abort"); pbAbort.setFont(new Font("SansSerif", 1, 12)); pbAbort.setForeground(Color.black); pbAbort.setBackground(Color.lightGray); // Initialize pbPrintStatements pbPrintStatements = new com.sssw.rt.jform.AgcJButton(); pbPrintStatements.setName("pbPrintStatements"); pbPrintStatements.setBounds(458,625,170,25); pbPrintStatements.setContentAreaFilled(true); pbPrintStatements.setBorderPainted(true); pbPrintStatements.setMargin(new Insets(1, 1, 1, 1)); pbPrintStatements.setHorizontalAlignment(SwingConstants.CENTER); pbPrintStatements.setVerticalAlignment(SwingConstants.CENTER); pbPrintStatements.setHorizontalTextPosition(SwingConstants.RIGHT); pbPrintStatements.setVerticalTextPosition(SwingConstants.CENTER); pbPrintStatements.setText("Print Statements"); pbPrintStatements.setFont(new Font("SansSerif", 1, 12)); pbPrintStatements.setForeground(Color.black); pbPrintStatements.setBackground(Color.lightGray); // Initialize pbPrintTrialBalance pbPrintTrialBalance = new com.sssw.rt.jform.AgcJButton(); pbPrintTrialBalance.setName("pbPrintTrialBalance"); pbPrintTrialBalance.setBounds(265,625,178,25); pbPrintTrialBalance.setContentAreaFilled(true); pbPrintTrialBalance.setBorderPainted(true); pbPrintTrialBalance.setMargin(new Insets(1, 1, 1, 1)); pbPrintTrialBalance.setHorizontalAlignment(SwingConstants.CENTER); pbPrintTrialBalance.setVerticalAlignment(SwingConstants.CENTER); pbPrintTrialBalance.setHorizontalTextPosition(SwingConstants.RIGHT); pbPrintTrialBalance.setVerticalTextPosition(SwingConstants.CENTER); pbPrintTrialBalance.setText("Print Trial Balance"); pbPrintTrialBalance.setFont(new Font("SansSerif", 1, 12)); pbPrintTrialBalance.setForeground(Color.black); pbPrintTrialBalance.setBackground(Color.lightGray); // Initialize lblPreviousClosingDate lblPreviousClosingDate = new com.sssw.rt.jform.AgcJLabel(); lblPreviousClosingDate.setName("lblPreviousClosingDate"); lblPreviousClosingDate.setBounds(540,50,151,18); lblPreviousClosingDate.setText("Previous Closing Date"); lblPreviousClosingDate.setOpaque(false); lblPreviousClosingDate.setTextStyle(0); lblPreviousClosingDate.setForeground(Color.black); lblPreviousClosingDate.setTextShadowColor(Color.darkGray); lblPreviousClosingDate.setTextHighlightColor(Color.gray); lblPreviousClosingDate.setBackground(Color.lightGray); lblPreviousClosingDate.setHorizontalAlignment(SwingConstants.RIGHT); lblPreviousClosingDate.setVerticalAlignment(SwingConstants.CENTER); lblPreviousClosingDate.setHorizontalTextPosition(SwingConstants.RIGHT); lblPreviousClosingDate.setVerticalTextPosition(SwingConstants.CENTER); lblPreviousClosingDate.setWordWrap(false); lblPreviousClosingDate.setFont(new Font("SansSerif", 1, 12)); // Initialize lblPreviousAccountingDay lblPreviousAccountingDay = new com.sssw.rt.jform.AgcJLabel(); lblPreviousAccountingDay.setName("lblPreviousAccountingDay"); lblPreviousAccountingDay.setBounds(790,50,159,19); lblPreviousAccountingDay.setText("Previous Accounting Day"); lblPreviousAccountingDay.setOpaque(false); lblPreviousAccountingDay.setTextStyle(0); lblPreviousAccountingDay.setForeground(Color.black); lblPreviousAccountingDay.setTextShadowColor(Color.darkGray); lblPreviousAccountingDay.setTextHighlightColor(Color.gray); lblPreviousAccountingDay.setBackground(Color.lightGray); lblPreviousAccountingDay.setHorizontalAlignment(SwingConstants.RIGHT); lblPreviousAccountingDay.setVerticalAlignment(SwingConstants.CENTER); lblPreviousAccountingDay.setHorizontalTextPosition(SwingConstants.RIGHT); lblPreviousAccountingDay.setVerticalTextPosition(SwingConstants.CENTER); lblPreviousAccountingDay.setWordWrap(false); lblPreviousAccountingDay.setFont(new Font("SansSerif", 1, 12)); // Initialize lblAccountingDay lblAccountingDay = new com.sssw.rt.jform.AgcJLabel(); lblAccountingDay.setName("lblAccountingDay"); lblAccountingDay.setBounds(265,50,111,19); lblAccountingDay.setText("Accounting Day"); lblAccountingDay.setOpaque(false); lblAccountingDay.setTextStyle(0); lblAccountingDay.setForeground(Color.black); lblAccountingDay.setTextShadowColor(Color.darkGray); lblAccountingDay.setTextHighlightColor(Color.gray); lblAccountingDay.setBackground(Color.lightGray); lblAccountingDay.setHorizontalAlignment(SwingConstants.RIGHT); lblAccountingDay.setVerticalAlignment(SwingConstants.CENTER); lblAccountingDay.setHorizontalTextPosition(SwingConstants.RIGHT); lblAccountingDay.setVerticalTextPosition(SwingConstants.CENTER); lblAccountingDay.setWordWrap(false); lblAccountingDay.setFont(new Font("SansSerif", 1, 12)); // Initialize lblStatementClosingDate lblStatementClosingDate = new com.sssw.rt.jform.AgcJLabel(); lblStatementClosingDate.setName("lblStatementClosingDate"); lblStatementClosingDate.setBounds(10,50,153,18); lblStatementClosingDate.setText("Statement Closing Date"); lblStatementClosingDate.setOpaque(false); lblStatementClosingDate.setTextStyle(0); lblStatementClosingDate.setForeground(Color.black); lblStatementClosingDate.setTextShadowColor(Color.darkGray); lblStatementClosingDate.setTextHighlightColor(Color.gray); lblStatementClosingDate.setBackground(Color.lightGray); lblStatementClosingDate.setHorizontalAlignment(SwingConstants.RIGHT); lblStatementClosingDate.setVerticalAlignment(SwingConstants.CENTER); lblStatementClosingDate.setHorizontalTextPosition(SwingConstants.RIGHT); lblStatementClosingDate.setVerticalTextPosition(SwingConstants.CENTER); lblStatementClosingDate.setWordWrap(false); lblStatementClosingDate.setFont(new Font("SansSerif", 1, 12)); // Initialize RecClosingDate RecClosingDate = new com.sssw.rt.form.AgcRectangle(); RecClosingDate.setName("RecClosingDate"); RecClosingDate.setBounds(9,32,996,45); RecClosingDate.setColor(Color.lightGray); RecClosingDate.setBorderStyle(4); RecClosingDate.setText("Closing Date"); RecClosingDate.setFont(new Font("SansSerif", 1, 12)); RecClosingDate.setForeground(Color.black); RecClosingDate.setTransparent(true); // Initialize lblTitle lblTitle = new com.sssw.rt.jform.AgcJLabel(); lblTitle.setName("lblTitle"); lblTitle.setBounds(277,5,700,27); lblTitle.setText("Closing Statement"); lblTitle.setOpaque(false); lblTitle.setTextStyle(0); lblTitle.setForeground(AgoColorManager.getColor(24, 24, 231)); lblTitle.setTextShadowColor(Color.darkGray); lblTitle.setTextHighlightColor(Color.gray); lblTitle.setBackground(Color.lightGray); lblTitle.setHorizontalAlignment(SwingConstants.RIGHT); lblTitle.setVerticalAlignment(SwingConstants.CENTER); lblTitle.setHorizontalTextPosition(SwingConstants.RIGHT); lblTitle.setVerticalTextPosition(SwingConstants.CENTER); lblTitle.setWordWrap(false); lblTitle.setFont(new Font("SansSerif", 3, 24)); // Initialize rectPrintedStatements rectPrintedStatements = new com.sssw.rt.form.AgcRectangle(); rectPrintedStatements.setName("rectPrintedStatements"); rectPrintedStatements.setBounds(10,445,996,173); rectPrintedStatements.setColor(Color.lightGray); rectPrintedStatements.setBorderStyle(4); rectPrintedStatements.setText("Printed Statements"); rectPrintedStatements.setFont(new Font("SansSerif", 1, 12)); rectPrintedStatements.setForeground(Color.black); rectPrintedStatements.setTransparent(true); // Initialize rectTerms rectTerms = new com.sssw.rt.form.AgcRectangle(); rectTerms.setName("rectTerms"); rectTerms.setBounds(680,205,325,195); rectTerms.setColor(Color.lightGray); rectTerms.setBorderStyle(4); rectTerms.setText("Terms Codes"); rectTerms.setFont(new Font("SansSerif", 1, 12)); rectTerms.setForeground(Color.black); rectTerms.setTransparent(true); // Initialize rectSalesRepresenative rectSalesRepresenative = new com.sssw.rt.form.AgcRectangle(); rectSalesRepresenative.setName("rectSalesRepresenative"); rectSalesRepresenative.setBounds(345,205,325,195); rectSalesRepresenative.setColor(Color.lightGray); rectSalesRepresenative.setBorderStyle(4); rectSalesRepresenative.setText("Sales Representative"); rectSalesRepresenative.setFont(new Font("SansSerif", 1, 12)); rectSalesRepresenative.setForeground(Color.black); rectSalesRepresenative.setTransparent(true); // Initialize rectCustomer rectCustomer = new com.sssw.rt.form.AgcRectangle(); rectCustomer.setName("rectCustomer"); rectCustomer.setBounds(9,205,325,195); rectCustomer.setColor(Color.lightGray); rectCustomer.setBorderStyle(4); rectCustomer.setText("Customer"); rectCustomer.setFont(new Font("SansSerif", 1, 12)); rectCustomer.setForeground(Color.black); rectCustomer.setTransparent(true); // Initialize rectMessageForStatement rectMessageForStatement = new com.sssw.rt.form.AgcRectangle(); rectMessageForStatement.setName("rectMessageForStatement"); rectMessageForStatement.setBounds(11,82,996,56); rectMessageForStatement.setColor(Color.lightGray); rectMessageForStatement.setBorderStyle(4); rectMessageForStatement.setText("Enter a Message to be Printed on the Statements"); rectMessageForStatement.setFont(new Font("SansSerif", 1, 12)); rectMessageForStatement.setForeground(Color.black); rectMessageForStatement.setTransparent(true); // Initialize rectIncludePaidInvoices rectIncludePaidInvoices = new com.sssw.rt.form.AgcRectangle(); rectIncludePaidInvoices.setName("rectIncludePaidInvoices"); rectIncludePaidInvoices.setBounds(12,400,170,47); rectIncludePaidInvoices.setColor(Color.lightGray); rectIncludePaidInvoices.setBorderStyle(4); rectIncludePaidInvoices.setText("Include paid invoices"); rectIncludePaidInvoices.setFont(new Font("SansSerif", 1, 12)); rectIncludePaidInvoices.setForeground(Color.black); rectIncludePaidInvoices.setTransparent(true); // Initialize rbCustomerNameOnly rbCustomerNameOnly = new com.sssw.rt.jform.AgcJRadioButton(); rbCustomerNameOnly.setName("rbCustomerNameOnly"); rbCustomerNameOnly.setBounds(20,152,275,20); rbCustomerNameOnly.setContentAreaFilled(false); rbCustomerNameOnly.setBorderPainted(false); rbCustomerNameOnly.setMargin(new Insets(0, 0, 0, 0)); rbCustomerNameOnly.setHorizontalAlignment(SwingConstants.LEFT); rbCustomerNameOnly.setVerticalAlignment(SwingConstants.CENTER); rbCustomerNameOnly.setHorizontalTextPosition(SwingConstants.RIGHT); rbCustomerNameOnly.setVerticalTextPosition(SwingConstants.CENTER); rbCustomerNameOnly.setText("Customer Name Only"); rbCustomerNameOnly.setCheckedValue("1"); rbCustomerNameOnly.setFont(new Font("SansSerif", 1, 12)); rbCustomerNameOnly.setForeground(Color.black); rbCustomerNameOnly.setBackground(AgoColorManager.getColor(212, 208, 200)); printSequenceGroup.add(rbCustomerNameOnly); // Initialize rectPrintSequence rectPrintSequence = new com.sssw.rt.form.AgcRectangle(); rectPrintSequence.setName("rectPrintSequence"); rectPrintSequence.setBounds(9,139,997,61); rectPrintSequence.setColor(Color.lightGray); rectPrintSequence.setBorderStyle(4); rectPrintSequence.setText("Print Sequence"); rectPrintSequence.setFont(new Font("SansSerif", 1, 12)); rectPrintSequence.setForeground(Color.black); rectPrintSequence.setTransparent(true); addControls(); addBindings(); // Setup tab order Component[] tabOrder = { fldStatementClosingDate, cbAccountingDay, fldMessageOnStatement, rbCustomerNameOnly, rbCustomerNumberOnly, rbBalancePriorityZipCode, rbBalancePriorityCustomerNumber, rbStoreResponsibilityBalancePriorityCustomerNumber, fldFromCustomerNumber, fldToCustomerNumber, cbxAllCustomers, fldSalesRepFrom, fldSalesRepTo, cbxAllSalesRepresenatives, fldTermsCodesFrom, fldTermsCodesTo, ckbAddTermsCode, rbIncludeInvoicesYes, rbIncludeInvoicesNo, rbIncludeZeroBalanceYes, rbIncludeZeroBalanceNo, tblPrintedStatements, pbPrintTrialBalance, pbPrintStatements, pbViewStatement, pbAbort, pbFinalize, rbPrinted, rbNotPrinted, fldAddCustomer, listAddCustomer, fldAddSalesRep, listAddSalesRep, fldAddTermsCode, listAddTermCode, pbCustRemove, pbSelectCust, pbRepRemove, pbSelectSalesRep, pbTermRemove, pbSelectTermsCodes, Field1, Field2, }; setUserDefinedTabOrder(tabOrder); return; } protected void addAllFormControls() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === this.add(lblStmtPrinted); this.add(tblPrintedStatementsScrollPane); tblPrintedStatements.getSelectionModel().addListSelectionListener(this); this.add(fldStatementClosingDate); this.add(pbTermRemove); pbTermRemove.addActionListener(this); this.add(pbCustRemove); pbCustRemove.addActionListener(this); this.add(pbRepRemove); pbRepRemove.addActionListener(this); this.add(agcTerms); this.add(agcEmployee); this.add(fldTermsCodesTo); this.add(lblTermsCodesTo); this.add(fldTermsCodesFrom); this.add(lblTermsCodes); this.add(lblAllTermsCode); this.add(ckbAddTermsCode); ckbAddTermsCode.addActionListener(this); this.add(lblAddTermsCode); this.add(fldAddTermsCode); this.add(listAddTermCodeScrollPane); this.add(Rectangle4); this.add(Field2); this.add(Label2); this.add(pbSelectTermsCodes); pbSelectTermsCodes.addActionListener(this); this.add(pbSelectSalesRep); pbSelectSalesRep.addActionListener(this); this.add(fldAddSalesRep); this.add(lblAddSalesRep); this.add(listAddSalesRepScrollPane); this.add(Rectangle3); this.add(Field1); this.add(Label1); this.add(lblAddCustomer); this.add(listAddCustomerScrollPane); this.add(fldAddCustomer); this.add(pbSelectCust); pbSelectCust.addActionListener(this); this.add(Rectangle2); this.add(rbNotPrinted); rbNotPrinted.addActionListener(this); this.add(rbPrinted); rbPrinted.addActionListener(this); this.add(agcDsoGen); this.add(agcStoreTransactionDate); this.add(agcCustomers); this.add(agcAllPrinted); this.add(agcPrintedStatements); this.add(rbBalancePriorityZipCode); this.add(cbAccountingDay); this.add(rbIncludeZeroBalanceNo); this.add(rbIncludeZeroBalanceYes); this.add(rectIncludeZeroBalanceStatements); this.add(rbIncludeInvoicesYes); this.add(rbIncludeInvoicesNo); this.add(cbxAllSalesRepresenatives); cbxAllSalesRepresenatives.addActionListener(this); this.add(lblAllSalesRepresenatives); this.add(lblSalesRepresenativeNumberRange); this.add(fldSalesRepFrom); this.add(lblSalesRepTo); this.add(fldSalesRepTo); this.add(cbxAllCustomers); cbxAllCustomers.addActionListener(this); this.add(lblAllCustomers); this.add(lblCustomerNumberRange); this.add(fldFromCustomerNumber); this.add(lblCustomerNumberRangeTo); this.add(fldToCustomerNumber); this.add(rbCustomerNumberOnly); this.add(rbBalancePriorityCustomerNumber); this.add(rbStoreResponsibilityBalancePriorityCustomerNumber); this.add(fldMessageOnStatement); this.add(lblPreviousAccountingDayData); this.add(lblPreviousClosingDateData); this.add(pbFinalize); pbFinalize.addActionListener(this); this.add(pbViewStatement); pbViewStatement.addActionListener(this); this.add(pbAbort); pbAbort.addActionListener(this); this.add(pbPrintStatements); pbPrintStatements.addActionListener(this); this.add(pbPrintTrialBalance); pbPrintTrialBalance.addActionListener(this); this.add(lblPreviousClosingDate); this.add(lblPreviousAccountingDay); this.add(lblAccountingDay); this.add(lblStatementClosingDate); this.add(RecClosingDate); this.add(lblTitle); this.add(rectPrintedStatements); this.add(rectTerms); this.add(rectSalesRepresenative); this.add(rectCustomer); this.add(rectMessageForStatement); this.add(rectIncludePaidInvoices); this.add(rbCustomerNameOnly); this.add(rectPrintSequence); } protected void addBindings() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === addExpDependencies(); } private boolean customerStatementsExist(java.sql.Date stmtClosingDate) { boolean rtnVal = false; Hashtable hsh = new Hashtable(); agcDsoGen.setDataSource(TsoConstant.DSO_GENERIC); TsoGenericBandDescriptor bd = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER_STATEMENT, Sch_Tables.CUSTOMER_STATEMENT); bd.addColumn("EXIST", DatatypeCodes.TYPE_INT, true); StringBuffer query = new StringBuffer(); query.append("SELECT IF EXISTS(SELECT customer_statement.id FROM customer_statement, customer_statement_included_customer, customer_statement_line_item"); query.append(" WHERE customer_statement.statement_date = '").append(stmtClosingDate).append("' AND customer_statement.loc = "); query.append(ClientApplicationContext.getClientApplicationContext().getLocation()); query.append(" AND customer_statement.statement_type = 'C' AND customer_statement.finalized = 'N'"); query.append(" AND customer_statement.id = customer_statement_included_customer.customer_statement_id"); query.append(" AND customer_statement.loc = customer_statement_included_customer.loc"); query.append(" AND customer_statement_included_customer.id = customer_statement_line_item.customer_statement_included_customer_id"); query.append(" AND customer_statement_included_customer.loc = customer_statement_line_item.loc) THEN 1 ELSE 0 ENDIF "); logger.debug("query = "+query.toString()); hsh.put(com.gpc.tams.dso.dsoGeneric.SQL, query.toString()); hsh.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bd); try { SilverStreamExceptionHelper.invokeQuery(agcDsoGen,hsh); if (agcDsoGen.gotoFirst() && agcDsoGen.getProperty("EXIST") != null && ((Integer)agcDsoGen.getProperty("EXIST")).intValue() == 1 ) { rtnVal = true; } } catch (ApplicationException e) { logger.error("ApplicationException in customerStatementsExist(): "+e.toString(),e); } catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in customerStatementsExist(): "+e.toString(),e); } catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in customerStatementsExist(): "+e.toString(),e); } catch (AgoSecurityException e) { logger.error("AgoSecurityException in customerStatementsExist(): "+e.toString(),e); } finally { return rtnVal; } } protected void formActivate(){ //business rule: if AR_Statement_Monitor record has been created and there are records in Customer_Statement //for that statement date, then display the reprint modal. ARStatementMonitorVO arStmtVO = getARStatementMonitor(); if (arStmtVO != null && customerStatementsExist(new java.sql.Date(arStmtVO.getStatementClosingDate().getTime()))) { // let form activation continue... javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { displayReprintMessage(); } }); } else { FM.setComponentFocus(fldStatementClosingDate); } } protected void formLoaded(){ //set permissions Hashtable permissions = new Hashtable(); FwoToolBarDirector toolBarDirector = new FwoToolBarDirector(); FM = new TamsFormMaster(this, (FwiFormProcess)this.getParentForm(), null, toolBarDirector); Vector components = new Vector(); components.add(fldStatementClosingDate); components.add(cbAccountingDay); components.add(pbPrintTrialBalance); components.add(pbPrintStatements); components.add(pbViewStatement); components.add(pbAbort); components.add(pbFinalize); components.add(pbCustRemove); components.add(pbRepRemove); components.add(pbTermRemove); components.add(rbPrinted); components.add(rbNotPrinted); FM.setFormEnabledDisabledComps(components); ARProfileVO arProfileVO = ApplicationContext.getInstance().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()) .getARProfile(); Short refArStatementFormId = arProfileVO.getRefARStatementFormID(); if (refArStatementFormId.intValue() == RefARStatementForm.LASER_USER_DEFINED_LOGO && !isARStatementImageExist()) { final AgfForm thisForm = (AgfForm) this; SwingUtilities.invokeLater(new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr() .showMessage(thisForm, "1538"); doClose(); } }); } fldStatementClosingDate.putClientProperty(FocusDecider.NAME, this); Hashtable requiredFields = new Hashtable(); Profile profile = clientApplicationContext.getProfile(Profile.BACKOFFICE_CLIENT, FM.m_loc.intValue()); try { Integer intZero = new Integer(0); Integer intOne = new Integer(1); Integer intNines = new Integer(999999999); FM.addValidatedTextComponent(fldMessageOnStatement,FwiConstant.ANY,58); FM.addValidatedWholeNumberComponent(fldFromCustomerNumber,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldToCustomerNumber,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldAddCustomer,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldSalesRepFrom,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldSalesRepTo,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldAddSalesRep,intZero ,intNines,false,true); FM.addValidatedWholeNumberComponent(fldAddTermsCode,intOne,FwiConstant.SHORT_MAX_VALUE,false,true); FM.addValidatedWholeNumberComponent(fldTermsCodesFrom,intOne,FwiConstant.SHORT_MAX_VALUE,false,true); FM.addValidatedWholeNumberComponent(fldTermsCodesTo,intOne,FwiConstant.SHORT_MAX_VALUE,false,true); FM.addValidatedDateComponent(fldStatementClosingDate,FwiConstant.DATE_INPUT_VALIDATION,true); requiredFields.put(lblStatementClosingDate, fldStatementClosingDate); FM.setRequiredFields(requiredFields); }catch (FwoUnsupportedObjectException e) { logger.error("FwoUnsupportedObjectException in formloaded"+e.toString(),e); } cbxAllCustomers.setSelected(true); cbxAllSalesRepresenatives.setSelected(true); ckbAddTermsCode.setSelected(true); rbIncludeInvoicesNo.setSelected(true); rbIncludeZeroBalanceNo.setSelected(true); FM.setMode(FwoFormMaster.EDIT_MODE_EDITING); initPrintedStatementsDSOPropertyNames(); buildTable(); pbCustRemove.setEnabled(false); pbRepRemove.setEnabled(false); pbTermRemove.setEnabled(false); FM.enableFormComponents(); fldAddCustomer.putClientProperty(FocusDecider.NAME, this); fldAddSalesRep.putClientProperty(FocusDecider.NAME, this); fldAddTermsCode.putClientProperty(FocusDecider.NAME, this); refresh(); if (!hasStoreTransactionDateRecords(null)) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(FrmAR_CustomerStatements_Closing.this, "1058"); closeForm(); }}); } } private void populateCBAccountingDay() { try { cbAccountingDay.removeAllItems(); //Added the code to store the "accounting day" as the key and //"sales year month" as the value in a HashMap for each accounting //day populated in the "Accounting Day" drop down. if (acctDayMap == null) { acctDayMap = new HashMap(); } else { acctDayMap.clear(); } do { Byte accountingDay = (Byte) agcStoreTransactionDate .getProperty(Sch_StoreTransactionDate.ACCOUNTING_DAY); java.util.Date salesYearMth = (java.util.Date) agcStoreTransactionDate .getProperty(Sch_StoreTransactionDate.SALES_YEAR_MONTH); cbAccountingDay.addItem(accountingDay); acctDayMap.put(accountingDay.toString(), salesYearMth); pbPrintStatements.setEnabled(true); } while (agcStoreTransactionDate.gotoNext()); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in populateCBAccountingDay: "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in populateCBAccountingDay: "+e.toString(),e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in populateCBAccountingDay "+e.toString(),e); } } public boolean fValidateComponent(javax.swing.JComponent jComponent1){ Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); if (jComponent1 == fldStatementClosingDate) { // Bug 31165 Added if condition to skip validation if it has been done already if(checkValidationForClosingDate == true && cbAccountingDay.getValue() != null && closingDate != null && closingDate == (java.util.Date)fldStatementClosingDate.getValue()) { checkValidationForClosingDate = false; return true; } // Bug 31165 end java.util.Date statementClosingDate = (java.util.Date)fldStatementClosingDate.getValue(); if (statementClosingDate != null && !statementClosingDate.equals("")) { rbPrinted.setEnabled(true); rbNotPrinted.setEnabled(true); if(!isDateAfterLastStmtRun(statementClosingDate)){ return false; } if (hasStoreTransactionDateRecords(statementClosingDate)) { populateCBAccountingDay(); } else { queryStoreTransactionDate(statementClosingDate); } //bug 30924 if (lblPreviousClosingDateData.getText() == null || lblPreviousClosingDateData.getText().trim().equals("")) { //New Store! contact TAMS support ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this, "091"); return false; } //Bug# 30810 Added the if statement to also validate the system suggested date. if(fldStatementClosingDate.getValue()!=null){ statementClosingDate = (java.util.Date)fldStatementClosingDate.getValue(); //Warn user is closing date they entered is less than 21 days after last statement run Calendar calLastStmt = Calendar.getInstance(); int storeDateFormat = ClientApplicationContext.getClientApplicationContext() .getProfile(Profile.BACKOFFICE_CLIENT,(int) ClientApplicationContext .getClientApplicationContext().getLocation()).getStoreProfile() .getRefDateFormatId().intValue(); calLastStmt.setTime(new java.util.Date(getFormattedDate( lblPreviousClosingDateData.getText(), storeDateFormat))); int lastStatementDate = calLastStmt.get(Calendar.DATE); //Bug# 30810 Commented the below line and added the following line of code //calLastStmt.add(Calendar.DATE, lastStatementDate + 20); calLastStmt.add(Calendar.DATE, numDays); Calendar currStmtCal = Calendar.getInstance(); currStmtCal.setTime(statementClosingDate); if (currStmtCal.before(calLastStmt)) { String param[] = {lblPreviousClosingDateData.getText()}; boolean dateOK = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"1535",param); if (!dateOK) { fldStatementClosingDate.setText(""); // Bug 31165 removing all items from cbAccountingDay if user clicks no on this message cbAccountingDay.removeAllItems(); } checkValidationForClosingDate = true; } } }else{ rbPrinted.setEnabled(false); rbNotPrinted.setEnabled(false); cbAccountingDay.removeAllItems(); } } // validate the user entering the Customer TO Range if (jComponent1 == fldFromCustomerNumber) { if(!"".equals(fldFromCustomerNumber.getText().trim())){ cbxAllCustomers.setSelected(false); if("".equals(fldToCustomerNumber.getText().trim())){ fldToCustomerNumber.setText(fldFromCustomerNumber.getText().trim()); } return true; } } if(jComponent1 == fldToCustomerNumber) { if(!"".equals(fldToCustomerNumber.getText().trim())){ cbxAllCustomers.setSelected(false); Integer toCustNumber = new Integer(fldToCustomerNumber.getText()); if("".equals(fldFromCustomerNumber.getText().trim())){ Integer fromCustNumber = new Integer(0); fldFromCustomerNumber.setText("0"); } Integer fromCustNumber = new Integer(fldFromCustomerNumber.getText()); if (toCustNumber.intValue() < fromCustNumber.intValue()) { String param[] = {fromCustNumber.toString(),toCustNumber.toString()}; //"Customer Number Range - To" cannot be greater than "Customer Number Range - From". ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"894",param); return false; } else { fldFromCustomerNumber.setText(""); fldToCustomerNumber.setText(""); String customerQuery = Sch_Tables.CUSTOMER + "." + Sch_Customer.CUST_NUMBER + " >= " + fromCustNumber.toString() + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.CUST_NUMBER + " <= " + toCustNumber.toString() + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.REF_CUSTOMER_TYPE_CD + " = '" + RefCustomerType.REGULAR_ACCOUNT + "'" + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.LOC + " = " + FM.m_loc; boolean customerExistsInDB = queryCustomer(customerQuery,agcCustomers); if (customerExistsInDB) { addToListBox(agcCustomers, Sch_Customer.CUST_NUMBER, Sch_Customer.NAME, listAddCustomer); } } } return true; } // validate user adding a customer number to listbox if (jComponent1 == fldAddCustomer) { cbxAllCustomers.setSelected(false); Integer enteredCustomerNumber = null; if (fldAddCustomer.getText() != null && !"".equals(fldAddCustomer.getText())) { enteredCustomerNumber = new Integer(fldAddCustomer.getText()); } else { return true; } // Validate customer exists String customerQuery = Sch_Tables.CUSTOMER + "." + Sch_Customer.CUST_NUMBER + " = " + enteredCustomerNumber.toString() + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.REF_CUSTOMER_TYPE_CD + " = '" + RefCustomerType.REGULAR_ACCOUNT + "'" + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.LOC + " = " + FM.m_loc; boolean customerExistsInDB = queryCustomer(customerQuery, agcCustomers); if (!customerExistsInDB) { String param = enteredCustomerNumber.toString(); //The customer does not exist. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"408",param); return false; } // check to see if customer number exist in customer list box int itemCount = listAddCustomer.getItemCount(); boolean customerNumberExists = false; for (int x=0; x < itemCount; x ++) { Object existingCustomerNumber= (Object)listAddCustomer.getItemValue(x); if (enteredCustomerNumber.toString().equals(existingCustomerNumber.toString())) { // need to prompt user to confirm delete String param = enteredCustomerNumber.toString(); //Remove Customer $1 from List. boolean response = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"419",param); if (response == true) { listAddCustomer.removeItemAt(x); checkButtons(); return true; } else { return true; } } } // if we get here the customer was not found in the listbox, so we need to add it addToListBox(agcCustomers, Sch_Customer.CUST_NUMBER, Sch_Customer.NAME, listAddCustomer); return true; } // end if fldAddCustomerNumber if (jComponent1 == fldSalesRepFrom) { if(!"".equals(fldSalesRepFrom.getText().trim())){ cbxAllSalesRepresenatives.setSelected(false); if("".equals(fldSalesRepTo.getText().trim())){ fldSalesRepTo.setText(fldSalesRepFrom.getText().trim()); } return true; } } if(jComponent1 == fldSalesRepTo) { if(!"".equals(fldSalesRepTo.getText().trim())){ cbxAllSalesRepresenatives.setSelected(false); Integer salesRepTo = new Integer(fldSalesRepTo.getText()); if("".equals(fldSalesRepFrom.getText().trim())){ Integer salesRepFrom = new Integer(0); fldSalesRepFrom.setText("0"); } Integer salesRepFrom = new Integer(fldSalesRepFrom.getText()); if (salesRepTo.intValue() < salesRepFrom.intValue()) { // "Sales Representative Number Range - To cannot be greater than Sales Representative Number Range - From" ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage("893"); return false; } else { fldSalesRepFrom.setText(""); fldSalesRepTo.setText(""); // Validate Sales Rep exists String salesRepQuery = Sch_Tables.EMPLOYEE + '.' + Sch_Employee.EMPLOYEE_NUM + ">=" + salesRepFrom + " AND " + Sch_Tables.EMPLOYEE + '.' + Sch_Employee.EMPLOYEE_NUM + "<=" + salesRepTo + " AND " + Sch_Tables.EMPLOYEE + '.' + Sch_Employee.LOC + '=' + FM.m_loc; boolean salesRepExistsInDB = queryCustomer(salesRepQuery, agcEmployee); if (salesRepExistsInDB) { addToListBox(agcEmployee, Sch_Employee.EMPLOYEE_NUM, Sch_Employee.LAST_NAME, Sch_Employee.FIRST_NAME, listAddSalesRep); return true; } } } }// end if fldSalesRepTo if (jComponent1 == fldAddSalesRep) { cbxAllSalesRepresenatives.setSelected(false); Integer enteredSalesRep = null; if (fldAddSalesRep.getText() != null && !"".equals(fldAddSalesRep.getText())) { enteredSalesRep = new Integer(fldAddSalesRep.getText()); } else { return true; } // Validate Sales Rep exists String salesRepQuery = Sch_Tables.EMPLOYEE + '.' + Sch_Employee.EMPLOYEE_NUM + '=' + enteredSalesRep.toString() + " AND " + Sch_Tables.EMPLOYEE + '.' + Sch_Employee.LOC + '=' + FM.m_loc; boolean salesRepExistsInDB = queryCustomer(salesRepQuery, agcEmployee); if (!salesRepExistsInDB) { //Invalid entry. The record does not exist. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"711"); return false; } // check to see if customer number exist in customer list box int itemCount = listAddSalesRep.getItemCount(); boolean salesRepExists = false; for (int x=0; x < itemCount; x ++) { Object existingSalesRep = (Object)listAddSalesRep.getItemValue(x); if (enteredSalesRep.toString().equals(existingSalesRep.toString())) { // need to prompt user to confirm delete String param[] = {rectSalesRepresenative.getText(),enteredSalesRep.toString()}; //Remove $1 $2 from List. boolean response = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"1099",param); if (response == true) { listAddSalesRep.removeItemAt(x); checkButtons(); return true; } else { return true; } } } // if we get here the customer was not found in the listbox, so we need to add it addToListBox(agcEmployee, Sch_Employee.EMPLOYEE_NUM, Sch_Employee.LAST_NAME, Sch_Employee.FIRST_NAME, listAddSalesRep); return true; } // end if fldAddSalesRep if(jComponent1 == fldTermsCodesFrom) { if(!"".equals(fldTermsCodesFrom.getText().trim())){ ckbAddTermsCode.setSelected(false); if("".equals(fldTermsCodesTo.getText().trim())){ fldTermsCodesTo.setText(fldTermsCodesFrom.getText().trim()); } return true; } } if(jComponent1 == fldTermsCodesTo) { if(!"".equals(fldTermsCodesTo.getText().trim())){ ckbAddTermsCode.setSelected(false); Short termsCodeTo = new Short(fldTermsCodesTo.getText()); if("".equals(fldTermsCodesFrom.getText().trim())){ Short termsCodeFrom = new Short((short)0); fldTermsCodesFrom.setText("0"); } Short termsCodeFrom = new Short(fldTermsCodesFrom.getText()); if (termsCodeTo.shortValue() < termsCodeFrom.shortValue()) { String param[] = {termsCodeFrom.toString(),termsCodeTo.toString()}; //$1 to $2 is not a vaild Terms Codes range. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"892",param); return false; } else { fldTermsCodesFrom.setText(""); fldTermsCodesTo.setText(""); String termsCodeQuery = Sch_Tables.AR_TERMS + '.' + Sch_ARTerms.ID + ">=" + termsCodeFrom + " AND " + Sch_Tables.AR_TERMS + '.' + Sch_ARTerms.ID + "<=" + termsCodeTo + " AND " + Sch_Tables.AR_TERMS + '.' + Sch_ARTerms.LOC + '=' + FM.m_loc; boolean termsCodeExistsInDB = queryCustomer(termsCodeQuery, agcTerms); if (termsCodeExistsInDB) { addToListBox(agcTerms, Sch_ARTerms.ID, Sch_ARTerms.DESCRIPTION, listAddTermCode); } return true; } } } if (jComponent1 == fldAddTermsCode) { ckbAddTermsCode.setSelected(false); Integer enteredTermsCode = null; if (fldAddTermsCode.getText() != null && !"".equals(fldAddTermsCode.getText())) { enteredTermsCode = new Integer(fldAddTermsCode.getText()); } else { return true; } // Validate Sales Rep exists String termsCodeQuery = Sch_Tables.AR_TERMS + "." + Sch_ARTerms.ID + " = " + enteredTermsCode.toString() + " AND " + Sch_Tables.AR_TERMS + "." + Sch_ARTerms.LOC + " = " + FM.m_loc; boolean termsCodeExistsInDB = queryCustomer(termsCodeQuery, agcTerms); if (!termsCodeExistsInDB) { //Invalid entry. The record does not exist. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"711"); return false; } // check to see if terms code exist in term codes list box int itemCount = listAddTermCode.getItemCount(); for (int x=0; x < itemCount; x ++) { Object existingTermsCode = (Object)listAddTermCode.getItemValue(x); if (enteredTermsCode.toString().equals(existingTermsCode.toString())) { // need to prompt user to confirm delete String param[] = {rectTerms.getText(),enteredTermsCode.toString()}; //Remove $1 $2 from List. boolean response = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"1099",param); if (response == true) { listAddTermCode.removeItemAt(x); checkButtons(); return true; } else { return true; } } } // if we get here the customer was not found in the listbox, so we need to add it addToListBox(agcTerms, Sch_ARTerms.ID, Sch_ARTerms.DESCRIPTION, listAddTermCode); return true; } // end if fldAddTermsCode return true; } /** * This method checks whether the statement closing date is less than or equal to the last * statement run date. * * @param statementClosingDate contains Statement Closing Date * @return false if statement closing date is less than or equal to last statement run date else * true. */ private boolean isDateAfterLastStmtRun(Date statementClosingDate) { ARProfileVO arvo = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()) .getARProfile(); Date lastStmtRunDate = arvo.getLastStmtRunDate(); if (lastStmtRunDate != null && statementClosingDate.compareTo(lastStmtRunDate) <= 0) { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage( this, "1058"); cbAccountingDay.removeAllItems(); fldStatementClosingDate.setText(""); fldStatementClosingDate.requestFocus(); return false; } return true; } // start from the bottom! private void removeSelectedItems(AgcJList list) { int[] selectedIndices = list.getSelectedIndices(); for(int i=selectedIndices.length; i > 0; i--) { list.removeItemAt(selectedIndices[i-1]); } list.clearSelection(); list.getSelectionModel().setAnchorSelectionIndex(-1); checkButtons(); } private void handle_pbCustRemove_actionPerformed(ActionEvent evt){ removeSelectedItems(listAddCustomer); } private void handle_pbRepRemove_actionPerformed(ActionEvent evt){ removeSelectedItems(listAddSalesRep); } private void handle_pbTermRemove_actionPerformed(ActionEvent evt){ removeSelectedItems(listAddTermCode); } private void displayReprintMessage() { //Was there a printer problem the last time you attempted to print statements? 1523 //Are you reprinting statements because of a paper jam? boolean response = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageYesNo(this,"934"); if (response == true) { Hashtable params = new Hashtable(); params.put("INCLUDE_ZERO", new Boolean(rbIncludeZeroBalanceYes.isSelected())); try { // show reprint dialog here Hashtable returnParams = (Hashtable)FM.m_SessionMgr.getNavigationMgr(). showFormDialog(this, TsoConstant.FRM_CM_STATEMENTS_REPRINT, params); logger.debug(" returnParams = "+returnParams); if (returnParams != null) { String actionStr = (String)returnParams.get("ACTION"); if (actionStr.equals("REPRINT")) { m_isReprintInEffect = true; m_rePrintCustomers = (java.util.List)returnParams.get("STATEMENTS"); if (selectPrinter()) { // asynch to allow handler to return, this avoids double focus issue when // launching multiple dialogs (printer selection and progress) Integer processId = com.gpc.backofficecommon.util.TamsMisc.getNextTableId("PROGRESS_INDICATOR", FM.m_loc); ServerTaskRunner.performTask(getFrame(), agGeneral, FM.m_loc, processId, //fGetFormName(), new PrintStatementsTask(processId), ApplicationContext.getInstance().getResourceBundleReader(). getLocalizedText(ResourceBundleReader.UI, getName()+".PROCESS_MESSAGE_TEXT", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()), // progress message 250, false, // not blocking 0, false); } } } else { FM.setComponentFocus(fldMessageOnStatement); } }catch(IOException e) { logger.error("IOException in displayReprintMessage "+e.toString(),e); }catch(AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in displayReprintMessage "+e.toString(),e); }catch(AgoSecurityException e) { logger.error("AgoSecurityException in displayReprintMessage "+e.toString(),e); } } else { FM.setComponentFocus(fldMessageOnStatement); } } private void refresh() { logger.info("refresh() "); ARStatementMonitorVO arStmtVO = getARStatementMonitor(); getARProfile(); if (arStmtVO != null && arStmtVO.getStatementClosingDate() != null) { setClosingStatementInfo(arStmtVO); setFinalizeButton(arStmtVO); rbPrinted.setSelected(true); retrievePrintedStatements(); //enable rbPrinted and rbNotPrinted rbPrinted.setEnabled(true); rbNotPrinted.setEnabled(true); // disable statement date and accounting day fields if (m_TblMgr.getRowCount() > 0) { fldStatementClosingDate.setEnabled(false); lblStatementClosingDate.setEnabled(false); cbAccountingDay.setEnabled(false); lblAccountingDay.setEnabled(false); } pbAbort.setEnabled(!arStmtVO.isCustomerARUpdateDone()); pbPrintTrialBalance.setEnabled(true); } else { pbPrintStatements.setEnabled(false); pbAbort.setEnabled(false); pbPrintTrialBalance.setEnabled(false); pbFinalize.setEnabled(false); rbCustomerNameOnly.setSelected(true); lblStmtPrinted.setVisible(false); } } private void buildTable() { int[] displayableCol = {0,1,2,3,4,5}; try{ String[] primaryKeys = {Sch_Customer.CUST_NUMBER}; m_TblMgr = new TsoJTableMgr(this, tblPrintedStatements, agcPrintedStatements, displayableCol, null, null, primaryKeys); m_TblMgr.setSelectionMode(TsoJTableMgr.SINGLE_SELECTION); m_TblMgr.setColumnWidth(0, 125); m_TblMgr.setColumnWidth(1, 275); m_TblMgr.setColumnWidth(2, 160); m_TblMgr.setColumnWidth(3, 100); m_TblMgr.setColumnWidth(4, 153); m_TblMgr.setColumnWidth(5, 150); m_TblMgr.setCustomCell(0, new FwoWholeNumberCell(FwiConstant.INTEGER, false)); m_TblMgr.setCanAutoSave(false); m_TblMgr.setAllowEdit(false); m_TblMgr.setMultipleDeleteAllowed(false); m_TblMgr.setMultipleNewMode(false); m_TblMgr.setTransactionLoggingEnabled(false); tblPrintedStatements.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); }catch(AgoUnrecoverableSystemException e){ logger.error("AgoUnrecoverableSystemException in buildTable(): "+e.toString(),e); }catch(AgoSecurityException e){ logger.error("AgoSecurityException in buildTable(): "+e.toString(),e); }catch(AgoTransientSystemException e){ logger.error("AgoTransientSystemException in buildTable(): "+e.toString(),e); } } /* We don't need to initialize agcAllPrinted datasource property names because it's not bound to tableMgr. The reason this method is still needed in this form is due to tablemanager. The actual query to used for the DSO in build table to populate the table on the form cannot be executed until after the form is loaded and the user enters some information. If the agcData that the table is based on does not have the properties defined prior to initializing the tablemanager, tablemanager will throw a "Developer Exception" and the application will stop executing. By executing the setPropertyName for the columns that will be retrieved in the agcData prior to initializing the tablemanager, this error is bypassed. */ private void initPrintedStatementsDSOPropertyNames() { agcPrintedStatements.setPropertyName(0, Sch_Customer.CUST_NUMBER); agcPrintedStatements.setPropertyName(1, Sch_Customer.NAME); agcPrintedStatements.setPropertyName(2, Sch_CustomerStatementIncludedCustomer.TOTAL_DUE); agcPrintedStatements.setPropertyName(3, Sch_CustomerStatement.POSTAL_CODE); agcPrintedStatements.setPropertyName(4, Sch_CustomerAR.STORE_RESPONSIBILITY); agcPrintedStatements.setPropertyName(5, "STATEMENT_FORMAT"); agcPrintedStatements.setPropertyName(6, Sch_CustomerStatement.CUSTOMER_ID); agcPrintedStatements.setPropertyName(7, Sch_CustomerStatement.REF_STATEMENT_FORMAT_ID); } private boolean haveAllStatementsPrinted() { boolean returnValue = false; Hashtable params = new Hashtable(); TsoGenericBandDescriptor bandDescriptor = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER_AR,Sch_Tables.CUSTOMER_AR); bandDescriptor.addColumn("TOTAL_COUNT", DatatypeCodes.TYPE_INT, true); StringBuffer sbQuery = new StringBuffer(getCustomerQuery("TOTAL_COUNT")); if(!cbxAllCustomers.isSelected() && rbIncludeZeroBalanceNo.isSelected()){ StringBuffer customerList = new StringBuffer(); int itemCount = listAddCustomer.getItemCount(); for (int x=0; x < itemCount; x ++) { Object existingCustomerNumber= (Object)listAddCustomer.getItemValue(x); customerList.append(existingCustomerNumber); if(x+1 < itemCount){ customerList.append(","); } } sbQuery .append(" AND customer.id in (select id from customer where customer_num " + " in (" + customerList.toString() + "))"); } params.put(com.gpc.tams.dso.dsoGeneric.SQL, sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bandDescriptor); try { SilverStreamExceptionHelper.invokeQuery(agcAllPrinted, params); if(agcAllPrinted.gotoFirst()) { Integer countValue = (Integer)agcAllPrinted.getProperty("TOTAL_COUNT"); if (countValue.intValue() == 0) { if(!cbxAllCustomers.isSelected() && rbIncludeZeroBalanceNo.isSelected()){ returnValue = areAllOthersZeroBalance(null, false); } else { returnValue = true; } } else if (!cbxAllCustomers.isSelected() && rbIncludeZeroBalanceYes.isSelected()) { int location = ClientApplicationContext .getClientApplicationContext().getLocation(); List customerList = StatementHelper.getInstance() .getCustomerListWithActivity(location); returnValue = areAllOthersZeroBalance(customerList, true); } } else { returnValue = true; } }catch (ApplicationException e) { logger.error("ApplicationException in haveAllStatementsPrinted(): "+e.toString(),e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in haveAllStatementsPrinted(): "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in haveAllStatementsPrinted(): "+e.toString(),e); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in haveAllStatementsPrinted(): "+e.toString(),e); }finally { return returnValue; } } private boolean onlineStatementsExist() { boolean returnValue = false; ARProfileVO arProfileVO = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()).getARProfile(); Hashtable params = new Hashtable(); StringBuffer sbQuery = new StringBuffer(); java.util.Date arStatementClosingDate = getARStatementMonitor().getStatementClosingDate(); TsoGenericBandDescriptor bandDescriptor = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER_STATEMENT, Sch_Tables.CUSTOMER_STATEMENT); bandDescriptor.addColumn("TOTAL_COUNT", DatatypeCodes.TYPE_INT, true); sbQuery.append(" SELECT COUNT (*) AS ").append("TOTAL_COUNT"); sbQuery.append(" FROM "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT); sbQuery.append(" WHERE "); sbQuery.append(" STATEMENT_TYPE = 'C' "); if (arProfileVO.getOnlineStatementFtpUrl() == null || arProfileVO.getOnlineStatementFtpUrl().trim().length() == 0 || arProfileVO.getOnlineStatementFtpUserName() == null || arProfileVO.getOnlineStatementFtpUserName().trim().length() == 0 || arProfileVO.getOnlineStatementFtpPassword() == null || arProfileVO.getOnlineStatementFtpPassword().trim().length() == 0) { sbQuery.append("AND REF_STATEMENT_FORMAT_ID = ").append(RefStatementFormat.ONLINE); } sbQuery.append(" AND LOC = ").append(FM.getLocation()).append(" AND "); sbQuery.append(" REF_ONLINE_STATEMENT_STATUS_ID = ").append(RefOnlineStatementStatus.NOT_TRANSMITTED); sbQuery.append(" AND STATEMENT_DATE = ").append("'").append(arStatementClosingDate.toString()).append("'"); logger.debug("onlineStatementExist Query used = \n" + sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.SQL, sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bandDescriptor); try { SilverStreamExceptionHelper.invokeQuery(agcDsoGen, params); if(agcDsoGen.gotoFirst()) { Integer countValue = (Integer)agcDsoGen.getProperty("TOTAL_COUNT"); if (countValue.intValue() > 0) { returnValue = true; } } }catch (Exception e) { logger.error("Exception in onlineStatementsExist(): "+e.toString(),e); } return returnValue; } private ARStatementMonitorVO getARStatementMonitor() { logger.info("getARStatementMonitor() !"); ARStatementMonitorVO arStmtMonitorVO = ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO() .getARStatementMonitor(new Integer(ClientApplicationContext .getClientApplicationContext().getLocation())); if (arStmtMonitorVO != null) logger.debug(" arStmtMonitorVO.toString() = \n"+arStmtMonitorVO.toString()); else logger.debug(" arStmtMonitorVO = null !"); return arStmtMonitorVO; } private ARStatementMonitorVO createARStatementMonitor(Date closingStmtDate, Byte accountingDay, String sortOrder, Date salesYearMonth) { logger.info("createARStatementMonitor() :\n closingStmtDate = "+closingStmtDate +"\n accountingDay = "+accountingDay +"\n sortOrder = "+sortOrder +"\n salesYearMonth = "+salesYearMonth); ARStatementMonitorVO arStmtMonitorVO = ClientApplicationContext .getClientApplicationContext() .getARStatementMonitorDAO() .createARStatementMonitor( new Integer(ClientApplicationContext.getClientApplicationContext() .getLocation()), closingStmtDate.toString(), accountingDay, sortOrder, salesYearMonth.toString()); // logger.debug(" arStmtMonitorVO.toString() = \n"+arStmtMonitorVO.toString()); if (arStmtMonitorVO != null) logger.debug(" arStmtMonitorVO.toString() = \n"+arStmtMonitorVO.toString()); else logger.debug(" arStmtMonitorVO = null !"); return arStmtMonitorVO; } private void setClosingStatementInfo(ARStatementMonitorVO arStmtMonitorVO){ java.util.Date statementClosingDate = arStmtMonitorVO.getStatementClosingDate(); if (statementClosingDate == null){ return; } FwoDatePattern datePattern = (FwoDatePattern) FwoPattern.getDatePatternInstance(ClientApplicationContext.getClientApplicationContext().getCurrentLocale(), new Integer(ClientApplicationContext.getClientApplicationContext().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation() ).getStoreProfile().getRefDateFormatId().intValue())); try { fldStatementClosingDate.setText(datePattern.format(statementClosingDate, ClientApplicationContext.getClientApplicationContext().getLocale())); cbAccountingDay.insertItemAt((arStmtMonitorVO.getAccountingDay() + ""), 0); cbAccountingDay.setSelectedIndex(0); } catch (DatePatternFormatException e) { logger.error(e.toString(), e); } fldMessageOnStatement.setText(arStmtMonitorVO.getMessage()); fldStatementClosingDate.setEnabled(false); cbAccountingDay.setEnabled(false); String sortOrderStr = arStmtMonitorVO.getSortOrder(); if (sortOrderStr.equals(CustomerStatementConstants.PRINT_BY_NAME)) rbCustomerNameOnly.setSelected(true); else if (sortOrderStr.equals(CustomerStatementConstants.PRINT_BY_CUSTNUMBER)) rbCustomerNumberOnly.setSelected(true); else if (sortOrderStr.equals(CustomerStatementConstants.PRINT_BY_BAL_ZIP)) rbBalancePriorityZipCode.setSelected(true); else if (sortOrderStr.equals(CustomerStatementConstants.PRINT_BY_BAL_CUSTNUMBER)) rbBalancePriorityCustomerNumber.setSelected(true); else if (sortOrderStr.equals(CustomerStatementConstants.PRINT_BY_RES_BAL_CUSTNUMBER)) rbStoreResponsibilityBalancePriorityCustomerNumber.setSelected(true); Integer beginningCustomerNumber = arStmtMonitorVO.getBeginningCustomerNumber(); Integer endingCustomerNumber = arStmtMonitorVO.getEndingCustomerNumber(); if ((beginningCustomerNumber == null) && (endingCustomerNumber == null)){ cbxAllCustomers.setSelected(true); } } private void setFinalizeButton(ARStatementMonitorVO arStmtMonitorVO) { boolean allStatementsPrinted = arStmtMonitorVO.isAllStatementsPrinted(); if (!allStatementsPrinted) { // execute SQL to count if all statemets for this date have been printed. allStatementsPrinted = haveAllStatementsPrinted(); if (allStatementsPrinted) { //UPDATE AR_STATEMENT_MONITOR.ALL_STATEMENTS_PRINTED arStmtMonitorVO.setAllStatementsPrinted(true); ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO() .updateARStatementMonitor(arStmtMonitorVO); pbFinalize.setEnabled(true); lblStmtPrinted.setVisible(true); } else { pbFinalize.setEnabled(false); lblStmtPrinted.setVisible(false); } } else { pbFinalize.setEnabled(true); lblStmtPrinted.setVisible(true); } } private boolean hasStoreTransactionDateRecords(java.util.Date statementClosingDate) { StringBuffer where = new StringBuffer(); StringBuffer orderBy = new StringBuffer(); boolean rtnVal = false; StoreProfileVO spvo = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()).getStoreProfile(); try { where.append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.LOC).append(" = "); where.append(ClientApplicationContext.getClientApplicationContext().getLocation()); //don't allow user to close on or further than Store_Profile.Curr_Acct_Day with current Store_Profile.Current_Sales_Year_Month // meaning : (STORE_TRANSACTION_DATE.SALES_YEAR_MONTH = Store_Profile.Current_Sales_Year_Month AND STORE_TRANSACTION_DATE.ACCOUNTING_DAY >= Store_Profile.Curr_Acct_Day) IS FALSE where.append(" AND ((").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); where.append(" <> '").append(new java.sql.Date(spvo.getCurrentSalesYearMonth().getTime())); where.append("' AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.ACCOUNTING_DAY); where.append(" < ").append(spvo.getCurrAcctDay()); where.append(") OR (").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); where.append(" = '").append(new java.sql.Date(spvo.getCurrentSalesYearMonth().getTime())); where.append("' AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.ACCOUNTING_DAY); where.append(" < ").append(spvo.getCurrAcctDay()); where.append(") OR (").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); where.append(" <> '").append(new java.sql.Date(spvo.getCurrentSalesYearMonth().getTime())); where.append("' AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.ACCOUNTING_DAY); where.append(" >= ").append(spvo.getCurrAcctDay()).append("))"); // don't allow user to close further than current Store_Profile.Current_Sales_Year_Month where.append(" AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); where.append(" <= '").append(new java.sql.Date(spvo.getCurrentSalesYearMonth().getTime())).append("'");; if (statementClosingDate != null) { where.append(" AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append("."); where.append(Sch_StoreTransactionDate.CALENDAR_DATE).append(" = '").append(statementClosingDate.toString()).append("'"); } orderBy.append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.ACCOUNTING_DAY).append(" DESC"); logger.debug("hasStoreTransactionDateRecords: where = \n" + where.toString()); agcStoreTransactionDate.query(where.toString(),orderBy.toString()); rtnVal = agcStoreTransactionDate.gotoFirst(); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in hasStoreTransactionDateRecords(): "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in hasStoreTransactionDateRecords(): "+e.toString(),e); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in hasStoreTransactionDateRecords(): "+e.toString(),e); } finally { return rtnVal; } } private void queryStoreTransactionDate(java.util.Date statementClosingDate) { try { if (hasStoreTransactionDateRecords(null)) { Date calendarDate = (Date)agcStoreTransactionDate.getProperty(Sch_StoreTransactionDate.CALENDAR_DATE); if (statementClosingDate.before(calendarDate)) { //The statements have already been run for the entered date. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"1058"); cbAccountingDay.removeAllItems(); fldStatementClosingDate.setText(""); fldStatementClosingDate.requestFocus(); } else { Hashtable hsh = new Hashtable(); StringBuffer sbWhere = new StringBuffer(); agcDsoGen.setDataSource(TsoConstant.DSO_GENERIC); TsoGenericBandDescriptor bd = new TsoGenericBandDescriptor(Sch_Tables.STORE_TRANSACTION_DATE, Sch_Tables.STORE_TRANSACTION_DATE); bd.addColumn("CALENDARDATE", DatatypeCodes.TYPE_DATE, true); sbWhere.append("SELECT MAX(CALENDAR_DATE) AS 'CALENDARDATE' "); sbWhere.append("FROM ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(", ").append(Sch_Tables.STORE_PROFILE); sbWhere.append(" WHERE ").append(Sch_StoreTransactionDate.CALENDAR_DATE).append(" <= '").append(statementClosingDate); sbWhere.append("' AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.LOC); sbWhere.append('=').append(ClientApplicationContext.getClientApplicationContext().getLocation()); sbWhere.append(" AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); sbWhere.append(" <= ").append(Sch_Tables.STORE_PROFILE).append(".").append(Sch_StoreProfile.CURRENT_SALES_YEAR_MONTH); sbWhere.append(" AND (").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.SALES_YEAR_MONTH); sbWhere.append(" = ").append(Sch_Tables.STORE_PROFILE).append(".").append(Sch_StoreProfile.CURRENT_SALES_YEAR_MONTH); sbWhere.append(" AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.ACCOUNTING_DAY); sbWhere.append(" >= ").append(Sch_Tables.STORE_PROFILE).append(".").append(Sch_StoreProfile.CURR_ACCT_DAY); sbWhere.append(") IS FALSE"); sbWhere.append(" AND ").append(Sch_Tables.STORE_TRANSACTION_DATE).append(".").append(Sch_StoreTransactionDate.LOC); sbWhere.append(" = ").append(Sch_Tables.STORE_PROFILE).append(".").append(Sch_StoreProfile.LOC); logger.debug("sbWhere = \n"+sbWhere); hsh.put(com.gpc.tams.dso.dsoGeneric.SQL, sbWhere.toString()); hsh.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bd); SilverStreamExceptionHelper.invokeQuery(agcDsoGen,hsh); if (agcDsoGen.gotoFirst() && agcDsoGen.getProperty("CALENDARDATE") != null) { java.sql.Date calendarDate2 = (java.sql.Date)agcDsoGen.getProperty("CALENDARDATE"); logger.debug("CALENDAR DATE = " + calendarDate2); if (!isDateAfterLastStmtRun(calendarDate2)) { return; } FwoDatePattern datePattern = (FwoDatePattern) FwoPattern.getDatePatternInstance(ClientApplicationContext.getClientApplicationContext().getCurrentLocale(), new Integer(ClientApplicationContext.getClientApplicationContext().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation() ).getStoreProfile().getRefDateFormatId().intValue() ) ); //The entered date is not valid. Do you wish to use $1? String [] params ={datePattern.format(calendarDate2)}; boolean result = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageYesNo(this,"1098",params); if (result) { fldStatementClosingDate.setText(datePattern.format(calendarDate2)); if (hasStoreTransactionDateRecords(calendarDate2)) { populateCBAccountingDay(); } } else { cbAccountingDay.removeAllItems(); fldStatementClosingDate.setText(""); fldStatementClosingDate.requestFocus(); } } } } }catch (DatePatternFormatException e) { logger.error("DatePatternFormatException in queryStoreTransactionDate(): "+e.toString(),e); }catch (ApplicationException e) { logger.error("ApplicationException in queryStoreTransactionDate(): "+e.toString(),e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in queryStoreTransactionDate(): "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in queryStoreTransactionDate(): "+e.toString(),e); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in queryStoreTransactionDate(): "+e.toString(),e); } } private int queryCustomerRefStatementFrequencyID(int customerId) throws ApplicationException { Hashtable params = new Hashtable(); StringBuffer sbQuery = new StringBuffer(); TsoGenericBandDescriptor bandDescriptor = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER_AR,Sch_Tables.CUSTOMER_AR); bandDescriptor.addColumn("REF_STATEMENT_FREQUENCY_ID", DatatypeCodes.TYPE_INT, true); sbQuery.append("SELECT IF (").append(Sch_Tables.CUSTOMER_AR).append(".AR_TERMS_ID IS NOT NULL)"); sbQuery.append(" THEN (SELECT REF_STATEMENT_FREQUENCY_ID FROM ").append(Sch_Tables.AR_TERMS); sbQuery.append(" WHERE ").append(Sch_Tables.AR_TERMS).append(".ID = ").append(Sch_Tables.CUSTOMER_AR).append(".AR_TERMS_ID"); sbQuery.append(" AND ").append(Sch_Tables.AR_TERMS).append(".LOC=").append(FM.m_loc.toString()); sbQuery.append(" ) ELSE (SELECT REF_STATEMENT_FREQUENCY_ID FROM ").append(Sch_Tables.AR_TERMS).append(", ").append(Sch_Tables.AR_PROFILE); sbQuery.append(" WHERE ").append(Sch_Tables.AR_TERMS).append(".ID=").append(Sch_Tables.AR_PROFILE).append(".DEFAULT_AR_TERMS_ID"); sbQuery.append(" AND ").append(Sch_Tables.AR_TERMS).append(".LOC = ").append(Sch_Tables.AR_PROFILE).append(".LOC"); sbQuery.append(" AND ").append(Sch_Tables.AR_TERMS).append(".LOC=").append(FM.m_loc.toString()).append(") ENDIF AS REF_STATEMENT_FREQUENCY_ID"); sbQuery.append(" FROM ").append(Sch_Tables.CUSTOMER_AR); sbQuery.append(" WHERE ").append(Sch_Tables.CUSTOMER_AR).append(".CUSTOMER_ID=").append(customerId); sbQuery.append(" AND ").append(Sch_Tables.CUSTOMER_AR).append(".LOC=").append(FM.m_loc.toString()); logger.debug("queryCustomerRefStatementFrequencyID Query used = \n" + sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.SQL, sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bandDescriptor); SilverStreamExceptionHelper.invokeQuery(agcDsoGen, params); try { if(agcDsoGen.gotoFirst()) { Integer frequencyId = (Integer)agcDsoGen.getProperty("REF_STATEMENT_FREQUENCY_ID"); return frequencyId.intValue(); } } catch (Exception ex) { throw new ApplicationException(ex, "Unable to retrieve statement frequency for customer"); } return 0; } private void getARProfile() { ARProfileVO arvo = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()).getARProfile(); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); m_refArStatementFormId = arvo.getRefARStatementFormID(); java.util.Date lastStmtRunDate = arvo.getLastStmtRunDate(); try { ClientApplicationContext context = ClientApplicationContext .getClientApplicationContext(); FwoDatePattern datePattern = (FwoDatePattern) FwoDatePattern.getDatePatternInstance( context.getCurrentLocale(), new Integer(context.getProfile( Profile.BACKOFFICE_CLIENT, (int) context.getLocation()) .getStoreProfile().getRefDateFormatId().intValue())); lblPreviousClosingDateData.setText(datePattern.format(lastStmtRunDate)); } catch (DatePatternFormatException e) { logger.error("DatePatternFormatException in getARProfile(): ", e); } lblPreviousAccountingDayData.setText(""+arvo.getLastStmtAcctDay().intValue()); } private boolean queryCustomer(String queryStr, AgcData bluebarrel) { boolean returnValue = false; logger.debug("Query for Customers is:\n" + queryStr); try { bluebarrel.query(queryStr); returnValue = bluebarrel.gotoFirst(); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in queryCustomer(): "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in queryCustomer(): "+e.toString(),e); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in queryCustomer(): "+e.toString(),e); }finally { return returnValue; } } private boolean printStatements(Integer processId) { logger.debug(" in printStatements(): m_isReprintInEffect : " + m_isReprintInEffect); if (m_isReprintInEffect){ return reprintStatements(processId); } ArrayList selectedCusts = getSelectedCustomerList(); ArrayList salesReps = getSelectedSalesRepsList(); ArrayList arTerms = getSelectedARTermsList(); if ((selectedCusts != null && selectedCusts.size() == 0) || (salesReps != null && salesReps.size() == 0) || (arTerms != null && arTerms.size() == 0)) return false; // call method to update the AR StatementMonitor Table ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); csrVO = new ClosingStatementRequestVO(); if (arStmtMonitorVO == null) { Date statementClosingDate = (java.util.Date)fldStatementClosingDate.getValue(); Byte acctDay = ((Byte)cbAccountingDay.getValue()); //Added the code to retrieve the "sales year month" value from the HashMap for //the selected accounting day instead of from the AgcData "agcStoreTransactionDate". java.util.Date salesYearMth = (java.util.Date) acctDayMap.get(acctDay.toString()); // The logger statements introduced below is as part of bug #36542 to track the root cause of the bug #33422. logger.error(" Debug for Bug #36542 >> java.util.Date salesYearMth "+salesYearMth); logger.error(" Debug for Bug #36542 >> new java.sql.Date(statementClosingDate.getTime()) "+ new java.sql.Date(statementClosingDate.getTime())); logger.error(" Debug for Bug #36542 >> acctDay "+ acctDay); logger.error(" Debug for Bug #36542 >> getSortOrder() "+ getSortOrder()); arStmtMonitorVO = createARStatementMonitor(statementClosingDate, acctDay, getSortOrder(), salesYearMth); } csrVO.setReprint(m_isReprintInEffect); // set the statement closing date csrVO.setStatementDate(arStmtMonitorVO.getStatementClosingDate()); // set acct day csrVO.setAccountingDay(arStmtMonitorVO.getAccountingDay()); // set loc csrVO.setLoc(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); // set StatementType csrVO.setStatementType(CustomerStatementConstants.CLOSING); // set customer list csrVO.setCustomerList(selectedCusts); // set sales rep csrVO.setSalesRepresentativeList(salesReps); // set ar terms csrVO.setARTermsList(arTerms); // set include Paid Invoice csrVO.setIncludePaidInvoices(rbIncludeInvoicesYes.isSelected() ? true : false); // set include Zero Balance Statements csrVO.setIncludeZeroBalanceStatements(rbIncludeZeroBalanceYes.isSelected() ? true : false); // set message csrVO.setMessage(fldMessageOnStatement.getText() != null ? fldMessageOnStatement.getText() : ""); // set sort order csrVO.setSortOrder(getSortOrder()); arStmtMonitorVO.setSortOrder(csrVO.getSortOrder()); arStmtMonitorVO.setMessage(csrVO.getMessage()); if (selectedCusts != null && selectedCusts.size() > 0) { arStmtMonitorVO.setBeginningCustomerNumber((Integer)selectedCusts.get(0)); arStmtMonitorVO.setEndingCustomerNumber((Integer)selectedCusts.get(selectedCusts.size() - 1)); } else { arStmtMonitorVO.setBeginningCustomerNumber(null); arStmtMonitorVO.setEndingCustomerNumber(null); } arStmtMonitorVO.setBatchNumber((byte)(arStmtMonitorVO.getBatchNumber() + 1)); if (!m_bContinuePrintingTask || !ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO().updateARStatementMonitor(arStmtMonitorVO).booleanValue()) { return false; } try { StatementHelper.getInstance().executeStatementBatch(csrVO, m_prtSettings, processId); } catch (ApplicationException ae) { logger.error("ApplicationException on executeStatementBatch : "+ ae.toString(), ae); //Application error. Unable to perform selected operation. Please contact TAMS Support. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"151"); return false; } // refresh the screen refresh(); m_isReprintInEffect = false; logger.debug("Continue printStatements with recap? " + m_bContinuePrintingTask); if(m_bContinuePrintingTask) { //handle Recap report return printRecap(); } else { return false; } } private boolean printRecap() { boolean rtnVal = true; StoreProfileVO spvo = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()).getStoreProfile(); Locale locale = new Locale(spvo.getRefLanguageCd(), spvo.getRefCountryCd()); ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); if(haveAllStatementsPrinted() && !arStmtMonitorVO.isRecapPrinted()){ GenericReportRequest rptRqt = new GenericReportRequest(); if (m_refArStatementFormId != null && m_refArStatementFormId.intValue() == RefARStatementForm.NEW_FORM) { rptRqt.setReportObjectClass(TsoConstant.PINFEED_FORM_STATEMENT_RECAP); } else { rptRqt.setReportObjectClass(TsoConstant.LASER_FORM_STATEMENT_RECAP); } rptRqt.setLOC(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); rptRqt.setLocale(locale); rptRqt.setDoBuild(true); rptRqt.setDoDelete(false); rptRqt.setSalesYearMonth(spvo.getCurrentSalesYearMonth()); rptRqt.setAccountingDay(new Integer(arStmtMonitorVO.getAccountingDay())); Hashtable ht = new Hashtable(); ht.put("STATEMENT_DATE", arStmtMonitorVO.getStatementClosingDate()); ht.put("STATEMENT_TYPE", CustomerStatementConstants.CLOSING); rptRqt.setInputParameters(ht); logger.debug(" run StatementRecap report"); FwoReportResponse response = TsoReportHelper.runGenericReport((FwoReportRequest)rptRqt); logger.debug("--------- response.getServerPfFileParent() = "+response.getServerPfFileParent()); logger.debug("--------- response.getServerPfFileName() = "+response.getServerPfFileName()); TsoReportHelper.print(response.getServerPfFileParent(), response.getServerPfFileName(), m_prtSettings); arStmtMonitorVO.setRecapPrinted(true); if (!ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO().updateARStatementMonitor(arStmtMonitorVO).booleanValue()) { logger.error("update AR_Statement_Monitor.RECAP_PRINTED error!"); rtnVal = false; } } return rtnVal; } private boolean reprintStatements(Integer processId){ logger.debug(" in reprintStatements(): "); try { StatementHelper.getInstance().reprintCurrentStatements(m_rePrintCustomers, m_prtSettings, processId); } catch (ApplicationException ae) { logger.error("ApplicationException on executeStatementBatch : "+ ae.toString(), ae); //Application error. Unable to perform selected operation. Please contact TAMS Support. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"151"); return false; } // refresh the screen refresh(); m_isReprintInEffect = false; return printRecap(); } /* * This method is to find all combined customers for a given customer. */ private ArrayList getCombinedCustomers(Object custNum) { ArrayList combinedCusts = new ArrayList(); Hashtable hsh = new Hashtable(); agcDsoGen.setDataSource(TsoConstant.DSO_GENERIC); TsoGenericBandDescriptor bd = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER, Sch_Tables.CUSTOMER); bd.addColumn(Sch_Customer.CUSTOMER_NUM, DatatypeCodes.TYPE_INT, true); bd.addColumn(Sch_Customer.ID, DatatypeCodes.TYPE_INT, true); StringBuffer sql = new StringBuffer(); sql.append("SELECT c2.CUSTOMER_NUM, c2.ID FROM CUSTOMER c1, CUSTOMER c2, CUSTOMER_AR ca1, CUSTOMER_AR ca2 "); sql.append(" WHERE c1.CUSTOMER_NUM = ").append(custNum.toString()); sql.append(" AND c1.ID=ca1.CUSTOMER_ID AND c1.LOC=ca1.LOC AND c1.LOC="); sql.append(ClientApplicationContext.getClientApplicationContext().getLocation()); sql.append(" AND c2.ID=ca2.CUSTOMER_ID AND c2.LOC=ca2.LOC AND c2.LOC="); sql.append(ClientApplicationContext.getClientApplicationContext().getLocation()); sql.append(" AND ca2.STATEMENT_CUSTOMER_ID = c1.ID AND ca2.COMBINED_STATEMENT = 'Y'"); logger.debug("sql = "+sql.toString()); hsh.put(com.gpc.tams.dso.dsoGeneric.SQL, sql.toString()); hsh.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bd); try { SilverStreamExceptionHelper.invokeQuery(agcDsoGen,hsh); if (agcDsoGen.gotoFirst()) { do { combinedCusts.add(agcDsoGen.getProperty(Sch_Customer.CUSTOMER_NUM)); } while (agcDsoGen.gotoNext()); } } catch (ApplicationException e) { logger.error("ApplicationException in getCombinedCustomers(): "+e.toString(),e); } catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in getCombinedCustomers(): "+e.toString(),e); } catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in getCombinedCustomers(): "+e.toString(),e); } catch (AgoSecurityException e) { logger.error("AgoSecurityException in getCombinedCustomers(): "+e.toString(),e); } finally { return combinedCusts; } } private ArrayList getSelectedCustomerList() { // use the customer values or all selected by the user ONLY if argCustomers == null ArrayList customers = null; if (!cbxAllCustomers.isSelected()) { customers = new ArrayList(); for (int i=0; i < listAddCustomer.getItemCount(); i++) { customers.add(listAddCustomer.getItemValue(i)); //add a selected customer's combined customers to SELECTED CUSTOMER LIST customers.addAll(getCombinedCustomers(listAddCustomer.getItemValue(i))); } if (customers.isEmpty()) { String param[] = new String[1]; param[0] = ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI, fGetFormName() + ".CUSTOMERS", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); showAMessage("163",param); } } return customers; } private ArrayList getSelectedSalesRepsList() { ArrayList salesReps = null; if (!cbxAllSalesRepresenatives.isSelected()) { salesReps = new ArrayList(); for (int i=0; i < listAddSalesRep.getItemCount(); i++) { salesReps.add(listAddSalesRep.getItemValue(i)); } if (salesReps.isEmpty()) { String param[] = new String[1]; param[0] = ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI, fGetFormName() + ".SALES_REPRESENATIVE_NUMBER_RANGE", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); showAMessage("163",param); } } return salesReps; } private ArrayList getSelectedARTermsList() { ArrayList arTerms = null; // set the terms id if (!ckbAddTermsCode.isSelected()) { arTerms = new ArrayList(); for (int i=0; i < listAddTermCode.getItemCount(); i++) { arTerms.add(listAddTermCode.getItemValue(i)); } if (arTerms.isEmpty()) { String param[] = new String[1]; param[0] = ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI, fGetFormName() + ".REQUIRED_TERMS_CODES_RANGE", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); showAMessage("163",param); } } return arTerms; } private void showAMessage(final String message,final String param[]){ Runnable runnable = new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(FrmAR_CustomerStatements_Closing.this,message,param); } }; javax.swing.SwingUtilities.invokeLater(runnable); } private String getSortOrder() { String printSequence = ""; if (rbCustomerNameOnly.isSelected()) { printSequence = CustomerStatementConstants.PRINT_BY_NAME; } else if (rbCustomerNumberOnly.isSelected()) { printSequence = CustomerStatementConstants.PRINT_BY_CUSTNUMBER; } else if (rbBalancePriorityZipCode.isSelected()) { printSequence = CustomerStatementConstants.PRINT_BY_BAL_ZIP; } else if (rbBalancePriorityCustomerNumber.isSelected()) { printSequence = CustomerStatementConstants.PRINT_BY_BAL_CUSTNUMBER; } else if (rbStoreResponsibilityBalancePriorityCustomerNumber.isSelected()) { printSequence = CustomerStatementConstants.PRINT_BY_RES_BAL_CUSTNUMBER; } return printSequence; } public void fLocalize(){ ClientApplicationContext.getClientApplicationContext().getLocalizationMgr().localize(this, this.fGetFormName()); refresh(); } public void fRetrieve(java.util.Hashtable hashtable1){ } public void fStylize(){ } public boolean fStopLogout(){ return false; } public void fSetToolBar(java.awt.Component component1){ } public com.gpc.client.backoffice.FwoFormMaster fGetFormMaster(){ return FM; } private boolean verifyStatementsCriteria() { //is closing date specified? if (fldStatementClosingDate.getValue() == null ) { //must specify closing date ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"302", lblStatementClosingDate.getText()); return false; } if (cbAccountingDay.getValue() == null) { //must specify closing date ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"302", lblAccountingDay.getText()); return false; } // is print sequence specified? if (!rbCustomerNameOnly.isSelected() && !rbCustomerNumberOnly.isSelected() && !rbBalancePriorityZipCode.isSelected() && !rbBalancePriorityCustomerNumber.isSelected() && !rbStoreResponsibilityBalancePriorityCustomerNumber.isSelected()) { String str = rbCustomerNameOnly.getText() + ", " + rbCustomerNumberOnly.getText() +", "+ rbBalancePriorityZipCode.getText() +", "+rbBalancePriorityCustomerNumber.getText()+", "+rbStoreResponsibilityBalancePriorityCustomerNumber.getText(); ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"163", str); return false; } return true; } private void handle_pbPrintStatements_actionPerformed(ActionEvent evt){ if(!verifyStatementsCriteria()) { return; } if (!selectPrinter()) { return; } // asynch to allow handler to return, this avoids double focus issue when // launching multiple dialogs (printer selection and progress) Integer processId = com.gpc.backofficecommon.util.TamsMisc.getNextTableId("PROGRESS_INDICATOR", FM.m_loc); ServerTaskRunner.performTask(getFrame(), agGeneral, FM.m_loc, processId, //fGetFormName(), new PrintStatementsTask(processId), ApplicationContext.getInstance().getResourceBundleReader(). getLocalizedText(ResourceBundleReader.UI, getName()+".PROCESS_MESSAGE_TEXT", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()), // progress message 250, false, // not blocking flag 0, true); // can cancel } // user interaction first, stop contention with progress dlg private void handle_pbFinalize_actionPerformed(ActionEvent evt){ // shift focus to label to avoid double focus // FM.setComponentFocus(lblTitle); // warn user if(ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"3202") == false) { return; } ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); // make sure user selects printer if report needs printing if(m_prtSettings == null && (arStmtMonitorVO.isAgingPrinted() == false || arStmtMonitorVO.isTrialBalancePrinted() == false)) { if(!selectPrinter()) { FM.setComponentFocus(pbFinalize); return; } } // asynch to allow handler to return, this avoids double focus issue when // launching multiple dialogs (printer selection and progress) Integer processId = com.gpc.backofficecommon.util.TamsMisc.getNextTableId("PROGRESS_INDICATOR", FM.m_loc); ServerTaskRunner.performTask(getFrame(), agGeneral, FM.m_loc, processId, // TsoConstant.FRM_CM_STATEMENTS_CLOSING + "_FINALIZE_STATEMENTS", new FinalizeTask(processId), ApplicationContext.getInstance().getResourceBundleReader(). getLocalizedText(ResourceBundleReader.UI, getName()+".PROCESS_MESSAGE_TEXT", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()), // progress message 1000, false, // not blocking 0, false); // cannot cancel } private void finalizeCustomerStatements(Integer processId) { ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); ClosingStatementRequestVO csrVO = new ClosingStatementRequestVO(); csrVO.setStatementDate(arStmtMonitorVO.getStatementClosingDate()); csrVO.setAccountingDay(arStmtMonitorVO.getAccountingDay()); csrVO.setLoc(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); if (arStmtMonitorVO.isTrialBalancePrinted() == false) { printTrialBalance(false); // archive only } StatementHelper.getInstance().finalizeStatementSession(csrVO, processId, ClientApplicationContext. getClientApplicationContext().getCurrentUser().getEmployeeId()); boolean jobberAccountInUse = clientApplicationContext.getProfile( Profile.BACKOFFICE_CLIENT, clientApplicationContext.getLocation()).getStoreProfile() .getJobberAcctInUse().booleanValue(); // refresh after finalizing statement session arStmtMonitorVO = getARStatementMonitor(); // if a/r report 116 has not been printed, do so and clean-up monitor table if ((jobberAccountInUse && arStmtMonitorVO.isTransmissionCreated()) || !jobberAccountInUse) { arStmtMonitorVO.setAgingPrinted(printAging()); ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO().updateARStatementMonitor(arStmtMonitorVO); } // refresh after printing aging report arStmtMonitorVO = getARStatementMonitor(); // Successfully completed all steps? // All steps are order dependent, this is just a safety check if (arStmtMonitorVO.isARTransactionUpdateDone() && arStmtMonitorVO.isCustomerARUpdateDone() && arStmtMonitorVO.isARProfileUpdateDone() && arStmtMonitorVO.isAllStatementsPrinted() && arStmtMonitorVO.isTrialBalancePrinted() && arStmtMonitorVO.isStatementsArchived() && arStmtMonitorVO.isARTransactionHistoricalFlagSet() && arStmtMonitorVO.isARPaymentHistoricalFlagSet() && arStmtMonitorVO.isPaymentStmtAppearancesUpdated() && arStmtMonitorVO.isTransactionStmtAppearancesUpdated() && arStmtMonitorVO.isAgingPrinted() && arStmtMonitorVO.isTransmissionCreated()) { finalizeSuccessful = true; } else { pbAbort.setEnabled(false); logger.error("finalizeCustomerStatements not completed.\n" + arStmtMonitorVO.toString()); final AgfForm f = this; final String s = getLocalizedText(arStmtMonitorVO); javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(f, "3203", s); FM.setComponentFocus(pbFinalize); } }); } } private void processOnlineStatements() { try { Integer processId = com.gpc.backofficecommon.util.TamsMisc.getNextTableId("PROGRESS_INDICATOR", FM.m_loc); ServerTaskRunner.performTask(getFrame(), agGeneral, FM.m_loc, processId, // TsoConstant.FRM_CM_STATEMENTS_CLOSING + "_FINALIZE_STATEMENTS", new TransmitStatementsTask(), ApplicationContext.getInstance().getResourceBundleReader(). getLocalizedText(ResourceBundleReader.UI, getName()+".ONLINE_STATEMENT_TRANSMIT_TEXT", ClientApplicationContext.getClientApplicationContext().getCurrentLocale()), // progress message 1000, true, // blocking 0, false); // cannot cancel if (numStatementsTransmitted > 0) { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage( FrmAR_CustomerStatements_Closing.this, "9454", new String[] {Integer.toString(numStatementsTransmitted)}); } } finally { // Monitor record should always be removed, even if transmission fails deleteMonitorRecord(); closeForm(); } } private void transmitOnlineStatements() { ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); TransmitOnlineStatementsRequestVO request = new TransmitOnlineStatementsRequestVO(); request.setLoc(ClientApplicationContext.getClientApplicationContext().getLocation()); request.setStatementClosingDate(arStmtMonitorVO.getStatementClosingDate()); try { numStatementsTransmitted = StatementHelper.getInstance().transmitOnlineStatements(request); } catch (ApplicationException ae) { logger.error("ApplicationException on transmitOnlineStatements : " + ae.toString(), ae); numStatementsTransmitted = 0; final AgfForm f = this; javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(f, "9453"); } }); } } private void closeForm() { FM.getToolBar().requestFocus(); FwoSessionMgr.getInstance().getNavigationMgr().getMainForm().fRemoveCurrentForm(); } private String getLocalizedText(ARStatementMonitorVO arStmtMonitorVO) { String text = null; if (!arStmtMonitorVO.isTrialBalancePrinted()) { text = CustomerStatementConstants.PRINTING_TRIAL_BALANCE; } else if (!arStmtMonitorVO.isCustomerARUpdateDone()) { text = CustomerStatementConstants.UPDATING_CUSTOMER_AR; } else if (!arStmtMonitorVO.isPaymentStmtAppearancesUpdated()) { text = CustomerStatementConstants.UPDATING_AR_PAYMENT; } else if (!arStmtMonitorVO.isTransactionStmtAppearancesUpdated()) { text = CustomerStatementConstants.UPDATING_AR_TRANSACTION; } else if (!arStmtMonitorVO.isARTransactionUpdateDone()) { text = CustomerStatementConstants.UPDATING_AR_TRANSACTION_FOR_SVC_CHG; } else if (!arStmtMonitorVO.isStatementsArchived()) { text = CustomerStatementConstants.ARCHIVING_STATEMENTS; } else if (!arStmtMonitorVO.isARProfileUpdateDone()) { text = CustomerStatementConstants.UPDATING_AR_PROFILE; } else if (!arStmtMonitorVO.isTransmissionCreated()) { text = CustomerStatementConstants.CREATING_TRANSMISSION; } else if (!arStmtMonitorVO.isAgingPrinted()) { text = CustomerStatementConstants.PRINTING_AGING_REPORT; } else { text = CustomerStatementConstants.STARTING_FINALIZE; } return ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI, fGetFormName() + text, ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); } public void finalize()throws Throwable{ logger.debug("Memory being released: " + this); super.finalize(); } private void handle_pbAbort_actionPerformed(ActionEvent evt){ abortStatements(); } private void handle_pbViewStatement_actionPerformed(ActionEvent evt) { int selectedRow = tblPrintedStatements.getSelectedRow(); if (selectedRow >= 0) { int selectedCustomerId = ((Integer) m_TblMgr.getColumnProperty(Sch_CustomerStatement.CUSTOMER_ID)).intValue(); int selectedCustomerNum = ((Integer) m_TblMgr.getColumnProperty(Sch_Customer.CUSTOMER_NUM)).intValue(); int selectedRefStatementFormatId = ((Integer) m_TblMgr.getColumnProperty(Sch_CustomerStatement.REF_STATEMENT_FORMAT_ID)).intValue(); try { int statementFrequency = queryCustomerRefStatementFrequencyID(selectedCustomerId); GenerateCustomerStatementFileRequestVO request = new GenerateCustomerStatementFileRequestVO(); request.setCustomerId(selectedCustomerId); request.setCustomerNum(selectedCustomerNum); request.setLoc(ClientApplicationContext.getClientApplicationContext().getLocation()); request.setStatementFrequency(statementFrequency); request.setMessage(fldMessageOnStatement.getText() != null ? fldMessageOnStatement.getText() : ""); request.setRefStatementFormatId(selectedRefStatementFormatId); ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); request.setStatementDate(arStmtMonitorVO.getStatementClosingDate()); String statementFilePath = StatementHelper.getInstance().generateCustomerStatementFile(request); Browser.openBrowser(mapStatementPathToFileURL(statementFilePath)); } catch (Exception e) { logger.error("Exception on generateCustomerStatementFile : "+ e.toString(), e); //Application error. Unable to perform selected operation. Please contact TAMS Support. ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this,"151"); } } } private void abortStatements() { ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); if (!arStmtMonitorVO.isAllStatementsPrinted() || (arStmtMonitorVO.isAllStatementsPrinted() && !arStmtMonitorVO.isCustomerARUpdateDone())) { //All statements have not been printed. You have selected to abort statement processing. The work files created by printing the statements will be deleted. //This means that you will have to start all over when you resume statement printing. All statements just printed will have to be re-printed. if(ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"3200")) { ClosingStatementRequestVO csrVO = new ClosingStatementRequestVO(); csrVO.setStatementDate(arStmtMonitorVO.getStatementClosingDate()); csrVO.setStatementType(CustomerStatementConstants.CLOSING); csrVO.setLoc(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); StatementHelper.getInstance().abortStatements(csrVO); logger.debug(" Abort successful, close the form. "); closeForm(); } } } private boolean printAging() { Integer reportID = Integer.valueOf("74"); Integer timeFrameID = Integer.valueOf("1"); FwoRefReport refReport = TsoReportHelper.findRefReport(reportID,FM.m_loc,timeFrameID); FwoRefReportRequest reportRequest = new FwoRefReportRequest(); reportRequest.setReportID(reportID); reportRequest.setRefTimeFrameID(timeFrameID); reportRequest.setReportObjectClass("com.gpc.server.report.TsoReportSA_RPT116"); reportRequest.setAccountingDay(new Integer(getARStatementMonitor().getAccountingDay())); reportRequest.setDoArchive(true); reportRequest.setCreateArchive(true); //Bug no. 31582 //reportRequest.setDoPrint(true); //m_prtSettings.setCopies(new Integer(1)); //reportRequest.setPrintSettings(m_prtSettings); //Bug no. 31582 end reportRequest.setLOC(FM.m_loc); reportRequest.setLocale(ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); reportRequest.setDoDelete(false); reportRequest.setDoBuild(true); reportRequest.setEmployeeID(ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId()); reportRequest.setRefReport(refReport); FwoRefReportCriteria rptCriteria = new FwoRefReportCriteria(); rptCriteria.setLOC(FM.m_loc); //Report Type FwoQuestionAnswer questionAnswerRptType = new FwoQuestionAnswer(); questionAnswerRptType.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_REPORTTYPE)); questionAnswerRptType.setAnswerValues("STATEMENT_CLOSING"); questionAnswerRptType.setDataType(FwoQuestionAnswer.DATA_TYPE_ALPHANUM); questionAnswerRptType.setAnswerType(FwoQuestionAnswer.ANSWER_TYPE_SINGLE); //Customer Number FwoQuestionAnswer questionAnswerCust = new FwoQuestionAnswer(); questionAnswerCust.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)); questionAnswerCust.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)).getAnswerDelimitedList()); questionAnswerCust.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerCust.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)).getAnswerType()); //Sales Representative FwoQuestionAnswer questionAnswerSalesRep = new FwoQuestionAnswer(); questionAnswerSalesRep.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_SALESREP)); questionAnswerSalesRep.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SALESREP)).getAnswerDelimitedList()); questionAnswerSalesRep.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerSalesRep.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SALESREP)).getAnswerType()); //Aging Category FwoQuestionAnswer questionAnswerAging = new FwoQuestionAnswer(); questionAnswerAging.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_AGINGCATEGORY)); questionAnswerAging.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_AGINGCATEGORY)).getAnswerDelimitedList()); questionAnswerAging.setDataType(FwoQuestionAnswer.DATA_TYPE_ALPHANUM); questionAnswerAging.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_AGINGCATEGORY)).getAnswerType()); //Store Responsibility FwoQuestionAnswer questionAnswerStoreResp = new FwoQuestionAnswer(); questionAnswerStoreResp.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)); questionAnswerStoreResp.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)).getAnswerDelimitedList()); questionAnswerStoreResp.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerStoreResp.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)).getAnswerType()); //A/R Terms Code FwoQuestionAnswer questionAnswerArTerms = new FwoQuestionAnswer(); questionAnswerArTerms.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_TERMS)); questionAnswerArTerms.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_TERMS)).getAnswerDelimitedList()); questionAnswerArTerms.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerArTerms.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_TERMS)).getAnswerType()); //Sort By FwoQuestionAnswer questionAnswerSort = new FwoQuestionAnswer(); questionAnswerSort.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_SORT)); questionAnswerSort.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SORT)).getAnswerDelimitedList()); questionAnswerSort.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerSort.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SORT)).getAnswerType()); FwoQuestionAnswerMap qaMap = new FwoQuestionAnswerMap(); qaMap.addQuestionAnswer(questionAnswerRptType); qaMap.addQuestionAnswer(questionAnswerCust); qaMap.addQuestionAnswer(questionAnswerSalesRep); qaMap.addQuestionAnswer(questionAnswerAging); qaMap.addQuestionAnswer(questionAnswerStoreResp); qaMap.addQuestionAnswer(questionAnswerArTerms); qaMap.addQuestionAnswer(questionAnswerSort); rptCriteria.setQuestionAnswerMap(qaMap); reportRequest.setReportCriteria(rptCriteria); Object result = TsoReportHelper.preview(reportRequest, this); logger.debug("printAging, preview"); logger.error(result); if (result != null && result instanceof FwoReportResponse) { FwoReportResponse rresp = (FwoReportResponse)result; String directory = rresp.getServerPfFileParent(); String filename = rresp.getServerPfFileName(); Boolean bPrinted = TsoReportHelper.print(directory, filename,this); logger.debug("printAging, printed? " + bPrinted); return bPrinted.booleanValue(); } FwoReportResponse response = TsoReportHelper.runReport(reportRequest); //Bug no. 31582 if(response != null && response.buildCompleted()) { return true; } //Bug no. 31582 end return false; } private void deleteMonitorRecord() { StringBuffer sb = new StringBuffer(); sb.append("DELETE FROM ").append(Sch_Tables.AR_STATEMENT_MONITOR); sb.append(" WHERE ").append(Sch_Tables.AR_STATEMENT_MONITOR).append('.').append(Sch_ARStatementMonitor.LOC); sb.append('=').append(FM.m_loc); ExecuteSQLVO vo = new ExecuteSQLVO(); vo.setSqlQuery(sb.toString()); ResultsVO result = InvokerBridge.invoke(vo); if (!result.isSuccessful() && result.getError() != null) { Exception e = result.getError(); logger.error(e.getMessage(), e); } } private void printTrialBalance(boolean bPrintTrialBalance) { ARStatementMonitorVO arStmtMonitorVO = getARStatementMonitor(); // archive only the first time printing is requested boolean bDoArchiving = !arStmtMonitorVO.isTrialBalancePrinted(); Integer reportID = Integer.valueOf("65"); Integer timeFrameID = Integer.valueOf("1"); FwoRefReport refReport = TsoReportHelper.findRefReport(reportID,FM.m_loc,timeFrameID); FwoRefReportRequest reportRequest = new FwoRefReportRequest(); reportRequest.setReportID(reportID); reportRequest.setRefTimeFrameID(timeFrameID); reportRequest.setReportObjectClass("com.gpc.server.report.TsoReportAR_RPT069"); reportRequest.setLOC(FM.m_loc); reportRequest.setLocale(ClientApplicationContext.getClientApplicationContext().getCurrentLocale()); reportRequest.setDoDelete(false); reportRequest.setDoBuild(true); reportRequest.setEmployeeID(ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId()); reportRequest.setRefReport(refReport); reportRequest.setDoArchive(bDoArchiving); reportRequest.setCreateArchive(bDoArchiving); FwoRefReportCriteria rptCriteria = new FwoRefReportCriteria(); rptCriteria.setLOC(FM.m_loc); if (fldStatementClosingDate.getValue() == null || cbAccountingDay.getValue() == null) { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(this, "405"); return; } //Bug 31316 //Report Type FwoQuestionAnswer questionAnswerRptType = new FwoQuestionAnswer(); questionAnswerRptType.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_REPORTTYPE)); questionAnswerRptType.setAnswerValues("STATEMENT_CLOSING"); questionAnswerRptType.setDataType(FwoQuestionAnswer.DATA_TYPE_ALPHANUM); questionAnswerRptType.setAnswerType(FwoQuestionAnswer.ANSWER_TYPE_SINGLE); //Bug 31316 end //Closing Date FwoQuestionAnswer questionAnswerClosingDate = new FwoQuestionAnswer(); questionAnswerClosingDate.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_CLOSINGDATE)); questionAnswerClosingDate.setAnswerValues((fldStatementClosingDate.getValue()).toString()); questionAnswerClosingDate.setDataType(FwoQuestionAnswer.DATA_TYPE_DATE); questionAnswerClosingDate.setAnswerType(FwoQuestionAnswer.ANSWER_TYPE_SINGLE); //Accounting Day String acctDay = "" + arStmtMonitorVO.getAccountingDay(); FwoQuestionAnswer questionAnswerAcctDay = new FwoQuestionAnswer(); questionAnswerAcctDay.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_ACCOUNTINGDAY)); questionAnswerAcctDay.setAnswerValues(acctDay); questionAnswerAcctDay.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerAcctDay.setAnswerType(FwoQuestionAnswer.ANSWER_TYPE_SINGLE); //Sort FwoQuestionAnswer questionAnswerSort = new FwoQuestionAnswer(); questionAnswerSort.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_SORT)); questionAnswerSort.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SORT)).getAnswerDelimitedList()); questionAnswerSort.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerSort.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_SORT)).getAnswerType()); //Customer Number FwoQuestionAnswer questionAnswerCust = new FwoQuestionAnswer(); questionAnswerCust.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)); questionAnswerCust.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)).getAnswerDelimitedList()); questionAnswerCust.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerCust.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_CUSTOMER)).getAnswerType()); //Store Responsibility FwoQuestionAnswer questionAnswerStoreResp = new FwoQuestionAnswer(); questionAnswerStoreResp.setQuestionKey(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)); questionAnswerStoreResp.setAnswerValues(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)).getAnswerDelimitedList()); questionAnswerStoreResp.setDataType(FwoQuestionAnswer.DATA_TYPE_NUM); questionAnswerStoreResp.setAnswerType(refReport.getDefaultQuestionAnswerMap().getQuestionAnswer(new Integer(TsiQuestionConstants.QUESTION_STORERESPONSIBILITY)).getAnswerType()); FwoQuestionAnswerMap qaMap = new FwoQuestionAnswerMap(); qaMap.addQuestionAnswer(questionAnswerClosingDate); qaMap.addQuestionAnswer(questionAnswerAcctDay); qaMap.addQuestionAnswer(questionAnswerCust); qaMap.addQuestionAnswer(questionAnswerStoreResp); qaMap.addQuestionAnswer(questionAnswerSort); //bug no. 31316 qaMap.addQuestionAnswer(questionAnswerRptType); //Bug no. 31316 end rptCriteria.setQuestionAnswerMap(qaMap); // rptCriteria.setQuestionAnswerMap(refReport.getDefaultQuestionAnswerMap()); // use defaults reportRequest.setReportCriteria(rptCriteria); logger.debug("printTrialBalance, request"); logger.debug(reportRequest); if(bPrintTrialBalance) { Object result = TsoReportHelper.preview(reportRequest, this); logger.debug("printTrialBalance, preview"); logger.debug(result); // if archiving was done, update flag if(bDoArchiving) { arStmtMonitorVO.setTrialBalancePrinted(true); ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO().updateARStatementMonitor(arStmtMonitorVO); } if (result != null && result instanceof FwoReportResponse) { FwoReportResponse rresp = (FwoReportResponse)result; String directory = rresp.getServerPfFileParent(); String filename = rresp.getServerPfFileName(); Boolean bPrinted = TsoReportHelper.print(directory, filename,this); logger.debug("printTrialBalance, printed? " + bPrinted); } } else { // if this is true, bDoArchiving is almost definitely true.... if(TsoReportHelper.runReport(reportRequest) != null) { // if archiving was done, update flag if(bDoArchiving) { arStmtMonitorVO.setTrialBalancePrinted(true); ClientApplicationContext.getClientApplicationContext().getARStatementMonitorDAO().updateARStatementMonitor(arStmtMonitorVO); } } } } private void handle_pbPrintTrialBalance_actionPerformed(ActionEvent evt){ setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR)); printTrialBalance(true); setCursor(Cursor.getDefaultCursor()); } private void handle_cbxAllCustomers_actionPerformed(ActionEvent evt){ if (cbxAllCustomers.isSelected()) { fldFromCustomerNumber.setText(""); fldToCustomerNumber.setText(""); fldAddCustomer.setText(""); listAddCustomer.removeAllItems(); } checkButtons(); } private void handle_cbxAllSalesRepresenatives_actionPerformed(ActionEvent evt){ if (cbxAllSalesRepresenatives.isSelected()) { fldSalesRepFrom.setText(""); fldSalesRepTo.setText(""); fldAddSalesRep.setText(""); listAddSalesRep.removeAllItems(); } checkButtons(); } private void handle_ckbAddTermsCode_actionPerformed(ActionEvent evt){ if (ckbAddTermsCode.isSelected()) { fldTermsCodesFrom.setText(""); fldTermsCodesTo.setText(""); fldAddTermsCode.setText(""); listAddTermCode.removeAllItems(); } checkButtons(); } public JComponent getDefaultFocusableComponent(JComponent currentComponent, boolean transferFocusForward) { return null; } public JComponent getFocusableComponentAfterVerification(JComponent currentComponent, boolean transferFocusForward) { /*if (currentComponent == fldStatementClosingDate && "".equals(fldStatementClosingDate.getText())) { return fldStatementClosingDate; }*/ // Bug 31165 changed validation for fldStatementClosingDate if (currentComponent == fldStatementClosingDate) { if(cbAccountingDay.getValue() != null) { if(checkValidationForClosingDate) { closingDate = fldStatementClosingDate.getValue(); return fldStatementClosingDate; } else { return cbAccountingDay; } } return fldStatementClosingDate; } // Bug 31165 end if (currentComponent == fldAddCustomer && fldAddCustomer.getText() != null && !"".equals(fldAddCustomer.getText())) { fldAddCustomer.setText(""); return fldAddCustomer; } if (currentComponent == fldAddSalesRep && fldAddSalesRep.getText() != null && !"".equals(fldAddSalesRep.getText())) { fldAddSalesRep.setText(""); return fldAddSalesRep; } if (currentComponent == fldAddTermsCode && fldAddTermsCode.getText() != null && !"".equals(fldAddTermsCode.getText())) { fldAddTermsCode.setText(""); return fldAddTermsCode; } else { return null; } } public boolean verifyOnEnter(JComponent currentComponent) { return true; } public boolean traverseFocusOnEnter(JComponent currentComponent) { return true; } private boolean selectPrinter() { logger.debug("Entering selectPrinter m_refArStatementFormId = " + m_refArStatementFormId); FwoPrintSettings prtSettings = new FwoPrintSettings(); FwoPrinterSelectionSettings prtSelSettings = new FwoPrinterSelectionSettings(); prtSelSettings.setPrinterUse("Statements"); prtSettings.setOrientation("P"); //Is this right? prtSelSettings.setNoSpooling(new Boolean(true)); if (m_refArStatementFormId != null && m_refArStatementFormId.intValue() == RefARStatementForm.NEW_FORM) {//print Continuous Feed paper prtSelSettings.setPrinterType("P"); } else { //print Laser check prtSettings.setDuplex(new Boolean(false)); prtSelSettings.setPrinterType("L"); } prtSelSettings.setPrintSettings(prtSettings); if(prtSelSettings.getPrinterType() != null && prtSelSettings.getPrinterType().equals("P")){ do { prtSelSettings = TsoReportHelper.selectPrinterSettings(this, prtSelSettings); if(prtSelSettings == null || prtSelSettings.getPrintSettings().getPrinterID() == null) { return false; // cancelled printer select dlg } do { Boolean bYNC = ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageYesNoCancel(this, "2510"); if(bYNC == null) { m_prtSettings = null; break; // cancelled YNC } else { m_prtSettings = prtSelSettings.getPrintSettings(); if(bYNC.booleanValue()) { printAllignmentForm(); continue; } break; } }while(true); } while(m_prtSettings == null); } else { prtSelSettings = TsoReportHelper.selectPrinterSettings(this, prtSelSettings); } //System execute the Select Printer functionality(Ref: GPC-RMS-UC-016), passing //, , , , , and logger.debug(" prtSelSettings = " + prtSelSettings); if (prtSelSettings == null || prtSelSettings.getPrintSettings().getPrinterID() == null) { return false; } m_prtSettings = prtSelSettings.getPrintSettings(); if (m_prtSettings == null) return false; return true; } public void selectMultipleCriteria(AgcJList criteriaList, int selectionType, AgcJTextField criteriaField, AgcJCheckBox criteriaCheck){ Hashtable htParams = new Hashtable(); htParams.put(TsoConstant.KEY_SELECTION_TYPE, new Integer(selectionType)); Vector vCurrentItems = new Vector(); for (int i=0; i < criteriaList.getItemCount(); i++) { vCurrentItems.addElement(criteriaList.getItemAt(i)); } htParams.put(TsoConstant.KEY_SELECTED_CRITERIA, vCurrentItems); String sCaption = ""; StringBuffer sb = new StringBuffer(); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); //TAMS sb.append(ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI,TsoConstant.FRM_IM_REVIEW_SELECT_DIALOG + ".lblTAMS",locale)); sb.append(" - "); //Select sb.append(ApplicationContext.getInstance().getResourceBundleReader().getLocalizedText( ResourceBundleReader.UI,TsoConstant.FRM_IM_REVIEW_SELECT_DIALOG + ".lblSelect",locale)); sb.append(" - "); if(selectionType == TsoConstant.SELECT_REGULAR_CUSTOMER) { //Customer Number sb.append(rectCustomer.getText()); sCaption = sb.toString(); } else if(selectionType == TsoConstant.SELECT_SALES_REP) { //Sales Rep sb.append(rectSalesRepresenative.getText()); sCaption = sb.toString(); } else if(selectionType == TsoConstant.SELECT_TERMS_CODES) { //Terms Codes sb.append(rectTerms.getText()); sCaption = sb.toString(); } htParams.put(TsoConstant.KEY_LOC, FM.m_loc); try { Hashtable ht = (Hashtable)FwoSessionMgr.getInstance().getNavigationMgr().showFormDialog(this, TsoConstant.FRM_IM_REVIEW_SELECT_DIALOG, sCaption, htParams); if(ht == null) return; Vector vNewItems = (Vector)ht.get(TsoConstant.KEY_SELECTED_VALUES); if (vNewItems != null) { criteriaList.removeAllItems(); for (int i=0; i < vNewItems.size(); i++) { int tmp = 0; if (vNewItems.elementAt(i) instanceof Integer) { tmp = ((Integer) vNewItems.elementAt(i)).intValue(); } else if (vNewItems.elementAt(i) instanceof String) { int dashIndex = ((String) vNewItems.elementAt(i)).indexOf("-"); tmp = Integer.parseInt(((String) vNewItems.elementAt(i)).substring(0, dashIndex-1)); } else if (vNewItems.elementAt(i) instanceof Short) { tmp = ((Short) vNewItems.elementAt(i)).intValue(); } if(selectionType == TsoConstant.SELECT_REGULAR_CUSTOMER){ String customerQuery = Sch_Tables.CUSTOMER + "." + Sch_Customer.CUST_NUMBER + " = " + tmp + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.REF_CUSTOMER_TYPE_CD + " = '" + RefCustomerType.REGULAR_ACCOUNT + "'" + " AND " + Sch_Tables.CUSTOMER + "." + Sch_Customer.LOC + " = " + FM.m_loc; queryCustomer(customerQuery,agcCustomers); addToListBox(agcCustomers, Sch_Customer.CUST_NUMBER, Sch_Customer.NAME, listAddCustomer); }else if (selectionType == TsoConstant.SELECT_SALES_REP){ String salesRepQuery = Sch_Tables.EMPLOYEE + '.' + Sch_Employee.EMPLOYEE_NUM + " = " + tmp + " AND " + Sch_Tables.EMPLOYEE + '.' + Sch_Employee.LOC + '=' + FM.m_loc; queryCustomer(salesRepQuery, agcEmployee); addToListBox(agcEmployee, Sch_Employee.EMPLOYEE_NUM, Sch_Employee.LAST_NAME, Sch_Employee.FIRST_NAME, listAddSalesRep); }else if (selectionType == TsoConstant.SELECT_TERMS_CODES){ String termsCodeQuery = Sch_Tables.AR_TERMS + '.' + Sch_ARTerms.ID + " = " + tmp + " AND " + Sch_Tables.AR_TERMS + '.' + Sch_ARTerms.LOC + '=' + FM.m_loc; queryCustomer(termsCodeQuery, agcTerms); addToListBox(agcTerms, Sch_ARTerms.ID, Sch_ARTerms.DESCRIPTION, listAddTermCode); } } if (criteriaCheck != null) { criteriaCheck.setSelected(vNewItems.size() <= 0); } } criteriaField.requestFocus(); } catch (IOException e) { logger.error(e.toString(), e); } catch (AgoSecurityException e) { logger.error(e.toString(), e); } catch (AgoUnrecoverableSystemException e) { logger.error(e.toString(), e); } } public void checkButtons(){ int items = listAddCustomer.getItemCount(); if(items >0){ pbCustRemove.setEnabled(true); }else{ pbCustRemove.setEnabled(false); } items = listAddSalesRep.getItemCount(); if(items >0){ pbRepRemove.setEnabled(true); }else{ pbRepRemove.setEnabled(false); } items = listAddTermCode.getItemCount(); if(items >0){ pbTermRemove.setEnabled(true); }else{ pbTermRemove.setEnabled(false); } } private void sortedInsert(AgcJList listBox, String item, Object value) { int pos = 0; int count = listBox.getItemCount(); int itemVal = -1; boolean isShort = value instanceof Short; int insertingValue = isShort ? ((Short)value).intValue() : ((Integer)value).intValue(); while (pos < count) { itemVal = isShort ? ((Short)listBox.getItemValue(pos)).intValue() : ((Integer)listBox.getItemValue(pos)).intValue(); if(itemVal == insertingValue) { // already in list, ignore return; } else if(itemVal > insertingValue) { // found position break; } pos++; } listBox.insertItemAt(item,value, pos); checkButtons(); } private void addToListBox(AgcData bluebarrel, String propertyNum, String propertyName, AgcJList listBox) { try { do { Object oName = bluebarrel.getProperty(propertyName); Object oNumber = bluebarrel.getProperty(propertyNum); if (oName != null && oNumber != null) { String sName = (String) oName; String sNumber = oNumber.toString(); String customer = sNumber + " - " + sName; sortedInsert(listBox, customer, oNumber); } } while (bluebarrel.gotoNext()); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in addToListBox(): "+e.toString(), e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in addToListBox(): "+e.toString(), e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in addToListBox(): "+e.toString(), e); } } private void addToListBox(AgcData bluebarrel, String propertyNum, String propertyLName, String propertyFName, AgcJList listBox) { try { do { String lastName = (String)bluebarrel.getProperty(propertyLName); String firstName = (String)bluebarrel.getProperty(propertyFName); Object oNumber = bluebarrel.getProperty(propertyNum); String sNumber = oNumber.toString(); String customer = sNumber + " - " + lastName + ", " + firstName; sortedInsert(listBox, customer, oNumber); } while (bluebarrel.gotoNext()); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in addToListBox(): "+e.toString(), e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in addToListBox(): "+e.toString(), e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in addToListBox(): "+e.toString(), e); } } private void handle_pbSelectCust_actionPerformed(ActionEvent evt){ selectMultipleCriteria(listAddCustomer, TsoConstant.SELECT_REGULAR_CUSTOMER, fldAddCustomer, cbxAllCustomers); if (listAddCustomer.getItemCount() > 0 ){ pbCustRemove.setEnabled(true); }else{ pbCustRemove.setEnabled(false); } } private void handle_pbSelectSalesRep_actionPerformed(ActionEvent evt){ selectMultipleCriteria(listAddSalesRep, TsoConstant.SELECT_SALES_REP, fldAddSalesRep, cbxAllSalesRepresenatives); if (listAddSalesRep.getItemCount() > 0 ){ pbRepRemove.setEnabled(true); }else{ pbRepRemove.setEnabled(false); } } private void handle_pbSelectTermsCodes_actionPerformed(ActionEvent evt){ selectMultipleCriteria(listAddTermCode, TsoConstant.SELECT_TERMS_CODES, fldAddTermsCode, ckbAddTermsCode); if (listAddTermCode.getItemCount() > 0 ){ pbTermRemove.setEnabled(true); }else{ pbTermRemove.setEnabled(false); } } private String buildNotPrintedStatementsQuery() { StringBuffer sbQuery = new StringBuffer(); java.util.Date statementClosingDate = (java.util.Date)fldStatementClosingDate.getValue(); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); sbQuery.append(" SELECT CUSTOMER.CUSTOMER_NUM, CUSTOMER.NAME, '0.00' AS TOTAL_DUE, CUSTOMER.POSTAL_CODE, CUSTOMER_AR.STORE_RESPONSIBILITY, "); sbQuery.append(" IF CUSTOMER_AR.COMBINED_STATEMENT='Y' AND CUSTOMER_AR.STATEMENT_CUSTOMER_ID IS NOT NULL "); sbQuery.append(" AND CUSTOMER_AR.STATEMENT_CUSTOMER_ID <> CUSTOMER.ID THEN "); sbQuery.append(" (SELECT TEXT FROM TRANSLATION, CUSTOMER_AR CAR WHERE CAR.CUSTOMER_ID = CUSTOMER_AR.STATEMENT_CUSTOMER_ID "); sbQuery.append(" AND CAR.LOC = CUSTOMER_AR.LOC "); sbQuery.append(" AND TRANSLATION.REF_ID = CAR.REF_STATEMENT_FORMAT_ID "); sbQuery.append(" AND TRANSLATION.TABLE_NAME='REF_STATEMENT_FORMAT' "); sbQuery.append(" AND TRANSLATION.COLUMN_NAME='DESCRIPTION' "); sbQuery.append(" AND TRANSLATION.REF_LANGUAGE_CD='").append(locale.getLanguage()).append("') ELSE"); sbQuery.append(" (SELECT TEXT FROM TRANSLATION WHERE "); sbQuery.append(" TRANSLATION.REF_ID = CUSTOMER_AR.REF_STATEMENT_FORMAT_ID "); sbQuery.append(" AND TRANSLATION.TABLE_NAME='REF_STATEMENT_FORMAT' "); sbQuery.append(" AND TRANSLATION.COLUMN_NAME='DESCRIPTION' "); sbQuery.append(" AND TRANSLATION.REF_LANGUAGE_CD='").append(locale.getLanguage()).append("') ENDIF AS STATEMENT_FORMAT, "); sbQuery.append(" CUSTOMER.ID AS CUSTOMER_ID, 0 AS REF_STATEMENT_FORMAT_ID "); sbQuery.append(" FROM CUSTOMER, CUSTOMER_AR "); sbQuery.append(" WHERE CUSTOMER.ID = CUSTOMER_AR.CUSTOMER_ID "); sbQuery.append(" AND CUSTOMER.LOC = CUSTOMER_AR.LOC "); sbQuery.append(" AND CUSTOMER.LOC = ").append(FM.m_loc); sbQuery.append(" AND CUSTOMER.REF_CUSTOMER_TYPE_CD = 'A'"); sbQuery.append(" AND NOT EXISTS(SELECT CSIC.ID "); sbQuery.append(" FROM CUSTOMER_STATEMENT_INCLUDED_CUSTOMER CSIC, CUSTOMER_STATEMENT CS "); sbQuery.append(" WHERE CSIC.CUSTOMER_ID = CUSTOMER.ID "); sbQuery.append(" AND CSIC.LOC = CUSTOMER.LOC "); sbQuery.append(" AND CSIC.CUSTOMER_STATEMENT_ID = CS.ID "); sbQuery.append(" AND CSIC.LOC = CS.LOC "); sbQuery.append(" AND CS.FINALIZED = 'N' "); sbQuery.append(" AND CS.STATEMENT_DATE = '").append(statementClosingDate).append("') "); sbQuery.append(" UNION ALL "); sbQuery.append(" SELECT CSIC.CUSTOMER_NUMBER, CSIC.CUSTOMER_NAME, '0.00' AS TOTAL_DUE, CS.POSTAL_CODE, CUSTOMER_AR.STORE_RESPONSIBILITY, "); sbQuery.append(" TSF2.TEXT AS STATEMENT_FORMAT, CS.CUSTOMER_ID, 0 AS REF_STATEMENT_FORMAT_ID "); sbQuery.append(" FROM CUSTOMER_AR, CUSTOMER_STATEMENT_INCLUDED_CUSTOMER CSIC, CUSTOMER_STATEMENT CS "); sbQuery.append(" JOIN TRANSLATION TSF2 ON TSF2.REF_ID = CS.REF_STATEMENT_FORMAT_ID "); sbQuery.append(" WHERE CSIC.CUSTOMER_ID = CUSTOMER_AR.CUSTOMER_ID "); sbQuery.append(" AND CUSTOMER_AR.LOC = ").append(FM.m_loc); sbQuery.append(" AND CSIC.LOC = CUSTOMER_AR.LOC "); sbQuery.append(" AND CSIC.CUSTOMER_STATEMENT_ID = CS.ID "); sbQuery.append(" AND CSIC.LOC = CS.LOC "); sbQuery.append(" AND CS.FINALIZED = 'N' "); sbQuery.append(" AND CS.STATEMENT_DATE = '").append(statementClosingDate).append("' "); sbQuery.append(" AND (CS.PRINTED IS NULL OR CS.PRINTED = 'N') "); sbQuery.append(" AND TSF2.TABLE_NAME='REF_STATEMENT_FORMAT' "); sbQuery.append(" AND TSF2.COLUMN_NAME='DESCRIPTION' "); sbQuery.append(" AND TSF2.REF_LANGUAGE_CD='").append(locale.getLanguage()).append("' "); sbQuery.append(" ORDER BY 1 "); logger.debug(" buildNotPrintedStatementsQuery = \n" + sbQuery.toString()); return sbQuery.toString(); } private TsoGenericBandDescriptor buildJTableBandScriptor () { TsoGenericBandDescriptor bandDescriptor = new TsoGenericBandDescriptor(Sch_Tables.CUSTOMER, Sch_Tables.CUSTOMER); bandDescriptor.addColumn(Sch_Customer.CUST_NUMBER, DatatypeCodes.TYPE_INT, true); bandDescriptor.addColumn(Sch_Customer.NAME, DatatypeCodes.TYPE_STRING, true); // may be blank string bandDescriptor.addColumn(Sch_CustomerStatementIncludedCustomer.TOTAL_DUE, DatatypeCodes.TYPE_BIGDECIMAL, true); bandDescriptor.addColumn(Sch_Customer.POSTAL_CODE, DatatypeCodes.TYPE_STRING, true); bandDescriptor.addColumn(Sch_CustomerAR.STORE_RESPONSIBILITY, DatatypeCodes.TYPE_INT, true); bandDescriptor.addColumn("STATEMENT_FORMAT", DatatypeCodes.TYPE_STRING, true); bandDescriptor.addColumn(Sch_CustomerStatement.CUSTOMER_ID, DatatypeCodes.TYPE_INT, true); bandDescriptor.addColumn(Sch_CustomerStatement.REF_STATEMENT_FORMAT_ID, DatatypeCodes.TYPE_INT, true); return bandDescriptor; } private boolean retrieveNotPrintedStatements() { boolean returnValue = false; Hashtable params = new Hashtable(); params.put(com.gpc.tams.dso.dsoGeneric.SQL, buildNotPrintedStatementsQuery()); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, buildJTableBandScriptor()); try { SilverStreamExceptionHelper.invokeQuery(agcPrintedStatements,params); returnValue = agcPrintedStatements.gotoFirst(); m_TblMgr.forceLoad(); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in retrieveNotPrintedStatements(): "+e.toString(), e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in retrieveNotPrintedStatements(): "+e.toString(), e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in retrieveNotPrintedStatements(): "+e.toString(), e); }catch (ApplicationException e) { logger.error("ApplicationException in retrieveNotPrintedStatements(): "+e.toString(), e); }finally { return returnValue; } } private boolean retrievePrintedStatements() { boolean returnValue = false; Hashtable params = new Hashtable(); StringBuffer sbQuery = new StringBuffer(); java.sql.Date statementClosingDate = new java.sql.Date(((java.util.Date)fldStatementClosingDate.getValue()).getTime()); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); sbQuery.append(" SELECT CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.CUSTOMER_NUMBER, CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.CUSTOMER_NAME, "); // do this in sql, table column may hold blanks so it is formatted as a string sbQuery.append(" CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.TOTAL_DUE, CUSTOMER_STATEMENT.POSTAL_CODE, "); sbQuery.append(" CUSTOMER_AR.STORE_RESPONSIBILITY, "); sbQuery.append(" TSF.TEXT AS STATEMENT_FORMAT, CUSTOMER_STATEMENT.CUSTOMER_ID, CUSTOMER_STATEMENT.REF_STATEMENT_FORMAT_ID "); sbQuery.append(" FROM CUSTOMER_STATEMENT_INCLUDED_CUSTOMER "); sbQuery.append(" INNER JOIN CUSTOMER_STATEMENT ON "); sbQuery.append(" CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.CUSTOMER_STATEMENT_ID = CUSTOMER_STATEMENT.ID "); sbQuery.append(" AND CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.LOC = CUSTOMER_STATEMENT.LOC "); sbQuery.append(" INNER JOIN CUSTOMER_AR ON "); sbQuery.append(" CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.CUSTOMER_ID = CUSTOMER_AR.CUSTOMER_ID "); sbQuery.append(" AND CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.LOC = CUSTOMER_AR.LOC "); sbQuery.append(" JOIN TRANSLATION TSF ON TSF.REF_ID = CUSTOMER_STATEMENT.REF_STATEMENT_FORMAT_ID "); sbQuery.append(" WHERE "); sbQuery.append(" CUSTOMER_STATEMENT.PRINTED = 'Y' AND "); sbQuery.append(" CUSTOMER_STATEMENT.FINALIZED = 'N' AND "); sbQuery.append(" CUSTOMER_STATEMENT.STATEMENT_DATE = '").append(statementClosingDate.toString()).append("' AND"); sbQuery.append(" CUSTOMER_STATEMENT_INCLUDED_CUSTOMER.LOC = ").append(FM.getLocation()).append(" AND"); sbQuery.append(" TSF.TABLE_NAME='REF_STATEMENT_FORMAT' AND"); sbQuery.append(" TSF.COLUMN_NAME='DESCRIPTION' AND"); sbQuery.append(" TSF.REF_LANGUAGE_CD='").append(locale.getLanguage()).append("'"); logger.debug("Printed Statments Query used = \n" + sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.SQL, sbQuery.toString()); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, buildJTableBandScriptor()); try { SilverStreamExceptionHelper.invokeQuery(agcPrintedStatements, params); returnValue = agcPrintedStatements.gotoFirst(); m_TblMgr.forceLoad(); } catch (ApplicationException e) { logger.error("ApplicationException in retrievePrintedStatements(): "+e.toString(),e); }catch (AgoUnrecoverableSystemException e) { logger.error("AgoUnrecoverableSystemException in retrievePrintedStatements(): "+e.toString(),e); }catch (AgoTransientSystemException e) { logger.error("AgoTransientSystemException in retrievePrintedStatements(): "+e.toString(),e); }catch (AgoSecurityException e) { logger.error("AgoSecurityException in retrievePrintedStatements(): "+e.toString(),e); }finally { return returnValue; } } private void handle_rbNotPrinted_actionPerformed(ActionEvent evt){ retrieveNotPrintedStatements(); pbViewStatement.setEnabled(false); } private void handle_rbPrinted_actionPerformed(ActionEvent evt){ retrievePrintedStatements(); pbViewStatement.setEnabled(false); } public boolean fDelete(){ return false; } public boolean fEdit(){ return false; } public boolean fFindExec(){ return false; } public boolean fFindMode(){ return false; } public boolean fFirst(){ return false; } public boolean fLast(){ return false; } public boolean fNew(){ return false; } public boolean fNext(){ return false; } public boolean fPrevious(){ return false; } public boolean fSave(){ return false; } public void fSort(){ } public boolean fValidate(){ return true; } public void fCancel(){ } public boolean fValidateJTableCell(com.gpc.client.common.table.FwoJTableMgr fwoJTableMgr1, int int2, int int3){ return true; } public boolean fValidateJTableRow(com.gpc.client.common.table.FwoJTableMgr fwoJTableMgr1, int int2){ return true; } public boolean fNeedsUpdate(){ return false; } public void fPostNew(){ } public void fPostSave(){ } public void fPostEdit(){ } public void fPostCancel(){ } public void fPostDelete(){ } public java.util.Locale fGetCurrentRecordLocale(javax.swing.JComponent jComponent1){ return (java.util.Locale)null; } public Integer fGetFunctionId(){ return TsoConstant.CM_CUSTOMER_STATEMENTS; } public void fCheckAccess(){ } public void fCheckLogin(){ } public String fCreateTitle(){ return (String)null; } public String fGetFormName(){ return TsoConstant.FRM_CM_STATEMENTS_CLOSING; } public void actionPerformed(ActionEvent evt) { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === Object src = evt.getSource(); if (src == rbPrinted) { handle_rbPrinted_actionPerformed(evt); return; } if (src == ckbAddTermsCode) { handle_ckbAddTermsCode_actionPerformed(evt); return; } if (src == pbSelectSalesRep) { handle_pbSelectSalesRep_actionPerformed(evt); return; } if (src == pbSelectTermsCodes) { handle_pbSelectTermsCodes_actionPerformed(evt); return; } if (src == pbCustRemove) { handle_pbCustRemove_actionPerformed(evt); return; } if (src == pbRepRemove) { handle_pbRepRemove_actionPerformed(evt); return; } if (src == pbPrintTrialBalance) { handle_pbPrintTrialBalance_actionPerformed(evt); return; } if (src == pbSelectCust) { handle_pbSelectCust_actionPerformed(evt); return; } if (src == pbFinalize) { handle_pbFinalize_actionPerformed(evt); return; } if (src == cbxAllSalesRepresenatives) { handle_cbxAllSalesRepresenatives_actionPerformed(evt); return; } if (src == rbNotPrinted) { handle_rbNotPrinted_actionPerformed(evt); return; } if (src == pbTermRemove) { handle_pbTermRemove_actionPerformed(evt); return; } if (src == pbPrintStatements) { handle_pbPrintStatements_actionPerformed(evt); return; } if (src == pbAbort) { handle_pbAbort_actionPerformed(evt); return; } if (src == cbxAllCustomers) { handle_cbxAllCustomers_actionPerformed(evt); return; } if (src == pbViewStatement) { handle_pbViewStatement_actionPerformed(evt); return; } super.actionPerformed(evt); } public void valueChanged(ListSelectionEvent evt) { Object src = evt.getSource(); if (src == tblPrintedStatements.getSelectionModel()) { if (!evt.getValueIsAdjusting()) { if (rbPrinted.isSelected() && (evt.getFirstIndex() >= 0)) { pbViewStatement.setEnabled(true); } else { pbViewStatement.setEnabled(false); } } } } public Object ag_getValue(DataCursor cursor, int valueID, Object param1, Object param2) { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === try { switch (valueID) { case 0: /* ID () AR_TERMS.ID*/ return ((Short) cursor.getProperty(0)); case 1: /* LOC () AR_TERMS.LOC*/ return ((Integer) cursor.getProperty(1)); case 2: /* DESCRIPTION () AR_TERMS.DESCRIPTION*/ return ((String) cursor.getProperty(2)); case 3: /* ID () EMPLOYEE.ID*/ return ((Integer) cursor.getProperty(0)); case 4: /* LOC () EMPLOYEE.LOC*/ return ((Integer) cursor.getProperty(1)); case 5: /* EMPLOYEE_NUM () EMPLOYEE.EMPLOYEE_NUM*/ return ((Integer) cursor.getProperty(2)); case 6: /* LAST_NAME () EMPLOYEE.LAST_NAME*/ return ((String) cursor.getProperty(3)); case 7: /* FIRST_NAME () EMPLOYEE.FIRST_NAME*/ return ((String) cursor.getProperty(4)); case 8: /* ID () STORE_TRANSACTION_DATE.ID*/ return ((Integer) cursor.getProperty(0)); case 9: /* LOC () STORE_TRANSACTION_DATE.LOC*/ return ((Integer) cursor.getProperty(1)); case 10: /* ACCOUNTING_DAY () STORE_TRANSACTION_DATE.ACCOUNTING_DAY*/ return ((Byte) cursor.getProperty(2)); case 11: /* CALENDAR_DATE () STORE_TRANSACTION_DATE.CALENDAR_DATE*/ return ((java.sql.Date) cursor.getProperty(3)); case 12: /* SALES_YEAR_MONTH () STORE_TRANSACTION_DATE.SALES_YEAR_MONTH*/ return ((java.sql.Date) cursor.getProperty(4)); case 13: /* ID () CUSTOMER.ID*/ return ((Integer) cursor.getProperty(0)); case 14: /* CUSTOMER_NUM () CUSTOMER.CUSTOMER_NUM*/ return ((Integer) cursor.getProperty(1)); case 15: /* NAME () CUSTOMER.NAME*/ return ((String) cursor.getProperty(2)); case 16: /* LOC () CUSTOMER.LOC*/ return ((Integer) cursor.getProperty(3)); case 17: /* AR_CUSTOMER_ID () CUSTOMER.FK_CUSTOMER_AR_CUSTOMER.CUSTOMER_ID*/ return ((Integer) cursor.getProperty(4)); case 18: /* AR_CUSTOMER_LOC () CUSTOMER.FK_CUSTOMER_AR_CUSTOMER.LOC*/ return ((Integer) cursor.getProperty(5)); default: return null; } } catch (Throwable e) { return null; } } private void printAllignmentForm() { GenericReportRequest rptRqt = new GenericReportRequest(); StoreProfileVO spvo = ApplicationContext.getInstance().getProfile(Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()).getStoreProfile(); Locale locale = new Locale(spvo.getRefLanguageCd(), spvo.getRefCountryCd()); rptRqt.setReportObjectClass("com.gpc.server.report.customerstatement.PinFeedPrePrintedStatementForm"); rptRqt.setLOC(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); rptRqt.setDoBuild(true); rptRqt.setLocale(locale); rptRqt.setSalesYearMonth(spvo.getCurrentSalesYearMonth()); rptRqt.setDoPrint(true); Hashtable ht = new Hashtable(); ht.put("PRINT_ALLIGNMENT", Boolean.TRUE); rptRqt.setInputParameters(ht); logger.debug(" printAllignmentForm()"); FwoReportResponse response = TsoReportHelper.runGenericReport((FwoReportRequest)rptRqt); TsoReportHelper.print(response.getServerPfFileParent(), response.getServerPfFileName(), m_prtSettings); } /** * This method is used for change the format the date to acceptable MM/dd/yyyy date format. * * @param dateToBeFormatted is the date that needs to be formatted. * @param storeDateFormat is the current store date format. * @return string containing the formatted version of date. */ private String getFormattedDate(String dateToBeFormatted, int storeDateFormat) { SimpleDateFormat sdfRequiredFormat = new SimpleDateFormat("MM/dd/yyyy"); SimpleDateFormat sdfInputFormat; String formattedDate; switch (storeDateFormat) { case 1: sdfInputFormat = new SimpleDateFormat("MM/dd/yyyy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 2: sdfInputFormat = new SimpleDateFormat("MM/dd/yy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 3: sdfInputFormat = new SimpleDateFormat("dd/MM/yyyy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 4: sdfInputFormat = new SimpleDateFormat("dd/MM/yy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 5: sdfInputFormat = new SimpleDateFormat("yyyy/MM/dd"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 6: sdfInputFormat = new SimpleDateFormat("yy/MM/dd"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 8: sdfInputFormat = new SimpleDateFormat("ddMMyyyy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 9: sdfInputFormat = new SimpleDateFormat("MMddyyyy"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 10: sdfInputFormat = new SimpleDateFormat("yyyyMMdd"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); case 11: sdfInputFormat = new SimpleDateFormat("yyyy-MM-dd"); return parseAndFormatDate(sdfInputFormat, sdfRequiredFormat, dateToBeFormatted); default: return null; } } /** * This method is used for parsing and formatting the date. * * @param sdfInputFormat is the SimpleDataFormat object for input date. * @param sdfRequiredFormat is the SimpleDataFormat object for required date format. * @return string containing the formatted version of date. */ private String parseAndFormatDate(SimpleDateFormat sdfInputFormat, SimpleDateFormat sdfRequiredFormat, String dateToBeFormatted) { Date date = null; try { date = sdfInputFormat.parse(dateToBeFormatted); } catch (ParseException e) { logger.error("ParseException in parseAndFormatDate: ", e); } return sdfRequiredFormat.format(date); } /** * This method is invoked to check the existence of image file for the AR Statement form. * * @return true if the image file exists, otherwise false. */ private boolean isARStatementImageExist() { return ClientApplicationContext.getClientApplicationContext().getSystemDAO() .isARStatementImageExist().booleanValue(); } /** * This will close the current form. */ private void doClose() { if (FM.getToolBar() != null) { FM.getToolBar().requestFocus(); } FwoSessionMgr.getInstance().getNavigationMgr().getMainForm().fRemoveCurrentForm(); } private String mapStatementPathToFileURL(String statementFilePath) { StringBuffer fileURL = new StringBuffer("file:///"); String clientHome = System.getProperty("tams.client.drive"); if (clientHome == null || clientHome.equals("")) { logger.warn("Unable to find property: 'tams.client.drive'. Using 'java.home' instead."); clientHome = System.getProperty("java.home"); } String driveLetter = clientHome.substring(0, clientHome.indexOf(File.separator) + 1); //logger.error("#DEBUG: mapStatementPathToFileURL: Drive letter is: "+driveLetter); fileURL.append(driveLetter); fileURL.append(statementFilePath); //logger.error("#DEBUG: mapStatementPathToFileURL: full fileURL is: "+fileURL.toString()); return fileURL.toString(); } private String getCustomerQuery(String queryFor) { java.util.Date arStatementClosingDate = getARStatementMonitor() .getStatementClosingDate(); StringBuffer sbQuery = new StringBuffer(); if(queryFor.equalsIgnoreCase("CUSTOMER_ID")){ sbQuery.append(" SELECT CUSTOMER_ID AS ").append("CUSTOMER_ID"); } else { sbQuery.append(" SELECT COUNT (*) AS TOTAL_COUNT"); } sbQuery.append(" FROM "); sbQuery.append(Sch_Tables.CUSTOMER_AR).append(FwiConstant.COMMA) .append(Sch_Tables.CUSTOMER); sbQuery.append(" WHERE "); sbQuery.append(" REF_CUSTOMER_TYPE_CD = 'A' AND CUSTOMER.ID = CUSTOMER_AR.CUSTOMER_ID"); sbQuery.append( " AND CUSTOMER.LOC = CUSTOMER_AR.LOC AND CUSTOMER.LOC = ") .append(FM.getLocation()).append(" AND "); sbQuery.append(Sch_Tables.CUSTOMER_AR).append(".") .append(Sch_CustomerAR.CUSTOMER_ID).append(" NOT IN ("); sbQuery.append("SELECT "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT_INCLUDED_CUSTOMER) .append(".") .append(Sch_CustomerStatementIncludedCustomer.CUSTOMER_ID); sbQuery.append(" FROM "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT_INCLUDED_CUSTOMER).append( ", "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT); sbQuery.append(" WHERE "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT_INCLUDED_CUSTOMER) .append(".") .append(Sch_CustomerStatementIncludedCustomer.CUSTOMER_STATEMENT_ID) .append(" = ").append(Sch_Tables.CUSTOMER_STATEMENT) .append(".").append(Sch_CustomerStatement.ID).append(" AND "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT_INCLUDED_CUSTOMER) .append(".").append(Sch_CustomerStatementIncludedCustomer.LOC) .append(" = ").append(FM.m_loc.toString()).append(" AND "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT_INCLUDED_CUSTOMER) .append(".").append(Sch_CustomerStatementIncludedCustomer.LOC) .append(" = ").append(Sch_Tables.CUSTOMER_STATEMENT) .append(".").append(Sch_CustomerStatement.LOC).append(" AND "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT).append(".") .append(Sch_CustomerStatement.STATEMENT_DATE).append(" = ") .append("'").append(arStatementClosingDate.toString()) .append("' AND "); sbQuery.append(Sch_Tables.CUSTOMER_STATEMENT).append(".") .append(Sch_CustomerStatement.FINALIZED).append(" = 'N')"); return sbQuery.toString(); } private boolean areAllOthersZeroBalance(List customerList, boolean isIncludeZeroBalance) { boolean returnValue = false; Hashtable params = new Hashtable(); TsoGenericBandDescriptor bandDescriptor = new TsoGenericBandDescriptor( Sch_Tables.CUSTOMER_AR, Sch_Tables.CUSTOMER_AR); bandDescriptor.addColumn("CUSTOMER_ID", DatatypeCodes.TYPE_INT, true); params.put(com.gpc.tams.dso.dsoGeneric.SQL, getCustomerQuery("CUSTOMER_ID")); params.put(com.gpc.tams.dso.dsoGeneric.BAND_DESCRIPTOR, bandDescriptor); try { SilverStreamExceptionHelper.invokeQuery(agcAllPrinted, params); if (agcAllPrinted.gotoFirst()) { do { Integer customerID = (Integer) agcAllPrinted .getProperty("CUSTOMER_ID"); returnValue = StatementHelper.getInstance() .getCurrentBalance(csrVO, customerID) == 0; if (!returnValue) { break; } if (isIncludeZeroBalance) { if (returnValue && customerList !=null && customerList.contains(customerID)) { returnValue = false; break; } } } while (agcAllPrinted.gotoNext()); } else { returnValue = true; } } catch (ApplicationException e) { logger.error("ApplicationException in areAllOthersZeroBalance(): " + e.toString(), e); } catch (AgoUnrecoverableSystemException e) { logger.error( "AgoUnrecoverableSystemException in areAllOthersZeroBalance(): " + e.toString(), e); } catch (AgoTransientSystemException e) { logger.error( "AgoTransientSystemException in areAllOthersZeroBalance(): " + e.toString(), e); } catch (AgoSecurityException e) { logger.error("AgoSecurityException in areAllOthersZeroBalance(): " + e.toString(), e); } finally { return returnValue; } } }