X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FMainFrame.java;h=3e75ef8a2558b95f75b062d83088bfb5fe745e1b;hp=ec3ce33d6dda4a12ac0636a815c8cb383daa6ab7;hb=703ad2090595c7cf19f92a58b95ce197c60bf5ea;hpb=06a2c4c692e08fdc860e489c86f34b2fe64696d1 diff --git a/src/habeas/MainFrame.java b/src/habeas/MainFrame.java index ec3ce33..3e75ef8 100644 --- a/src/habeas/MainFrame.java +++ b/src/habeas/MainFrame.java @@ -6,10 +6,7 @@ package habeas; import java.util.ArrayList; -import javax.swing.JFileChooser; import javax.swing.JOptionPane; -import javax.swing.filechooser.FileFilter; -import javax.swing.filechooser.FileNameExtensionFilter; /** * @@ -42,6 +39,11 @@ public class MainFrame extends javax.swing.JFrame { jSeparator1 = new javax.swing.JPopupMenu.Separator(); menuGenerateRaisedBills = new javax.swing.JMenuItem(); menuNoticesReports = new javax.swing.JMenu(); + menuNoticesToBeDrafted = new javax.swing.JMenuItem(); + menuNoticesClarificationPending = new javax.swing.JMenuItem(); + menuNoticeDraftAwaitingApproval = new javax.swing.JMenuItem(); + menuNoticeDraftsApprovedToBeSent = new javax.swing.JMenuItem(); + menuNoticesSentNotYetDelivered = new javax.swing.JMenuItem(); menuAwaitingPayment = new javax.swing.JMenuItem(); menuSettings = new javax.swing.JMenu(); menuDatabaseSettings = new javax.swing.JMenuItem(); @@ -99,6 +101,50 @@ public class MainFrame extends javax.swing.JFrame { menuNoticesReports.setMnemonic('r'); menuNoticesReports.setText("Reports"); + menuNoticesToBeDrafted.setText("To Be Drafted..."); + menuNoticesToBeDrafted.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesToBeDraftedActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesToBeDrafted); + + menuNoticesClarificationPending.setMnemonic('c'); + menuNoticesClarificationPending.setText("Clarifications pending..."); + menuNoticesClarificationPending.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesClarificationPendingActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesClarificationPending); + + menuNoticeDraftAwaitingApproval.setMnemonic('d'); + menuNoticeDraftAwaitingApproval.setText("Drafts to be approved..."); + menuNoticeDraftAwaitingApproval.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticeDraftAwaitingApprovalActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticeDraftAwaitingApproval); + + menuNoticeDraftsApprovedToBeSent.setMnemonic('a'); + menuNoticeDraftsApprovedToBeSent.setText("Drafts Approved not yet sent..."); + menuNoticeDraftsApprovedToBeSent.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticeDraftsApprovedToBeSentActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticeDraftsApprovedToBeSent); + + menuNoticesSentNotYetDelivered.setMnemonic('s'); + menuNoticesSentNotYetDelivered.setText("Notices sent not yet delivered..."); + menuNoticesSentNotYetDelivered.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuNoticesSentNotYetDeliveredActionPerformed(evt); + } + }); + menuNoticesReports.add(menuNoticesSentNotYetDelivered); + menuAwaitingPayment.setMnemonic('a'); menuAwaitingPayment.setText("Bills awaiting payment..."); menuAwaitingPayment.addActionListener(new java.awt.event.ActionListener() { @@ -192,17 +238,97 @@ public class MainFrame extends javax.swing.JFrame { // TODO add your handling code here: NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); String [] cols = {"Reference Number", "Description", "Bill Date", "Bill Amount", "Client"}; - ArrayList data = Utility.getPendingPaymentBills (-1); + int rep = 0; + ArrayList data = Utility.getReportData(rep, -1); if (data == null) { JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); return; } - frm.setupReportTable(REPORT_TITLE_BILLS_AWAITING_PAYMENT, cols, data); + frm.setupReportTable(rep, REPORT_TITLE_BILLS_AWAITING_PAYMENT, cols, data); frm.setVisible(true); }//GEN-LAST:event_menuAwaitingPaymentActionPerformed - private static final String ERROR_DISPLAYING_REPORT = "Error displaying report"; - private static final String REPORT_TITLE_BILLS_AWAITING_PAYMENT = "Bills Awaiting Payment"; + private void menuNoticesSentNotYetDeliveredActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesSentNotYetDeliveredActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String[] cols = {"Reference Number", "Description", "Sent Date", "RPAD Reference", "Client"}; + int rep = 1; + ArrayList data = Utility.getReportData (rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED, cols, data); + frm.setVisible (true); + }//GEN-LAST:event_menuNoticesSentNotYetDeliveredActionPerformed + + private void menuNoticeDraftAwaitingApprovalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticeDraftAwaitingApprovalActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", "Client"}; + int rep = 2; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_DRAFTS_AWAITING_APPROVAL, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuNoticeDraftAwaitingApprovalActionPerformed + + private void menuNoticesClarificationPendingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesClarificationPendingActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", + "Clarification Remarks", "Client" }; + int rep = 3; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_CLARIFICATIONS_PENDING, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuNoticesClarificationPendingActionPerformed + + private void menuNoticesToBeDraftedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticesToBeDraftedActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", + "Clarification Remarks", "Client" }; + int rep = 4; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this , ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_TO_BE_DRAFTED, cols, data); + frm.setVisible(true); + + }//GEN-LAST:event_menuNoticesToBeDraftedActionPerformed + + private void menuNoticeDraftsApprovedToBeSentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuNoticeDraftsApprovedToBeSentActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String cols[] = {"Reference Number", "Description", "Entrustment Date", + "Client" }; + int rep = 5; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this , ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_APPROVED_NOT_YET_SENT, cols, data); + frm.setVisible(true); + + }//GEN-LAST:event_menuNoticeDraftsApprovedToBeSentActionPerformed + private static final String REPORT_TITLE_TO_BE_DRAFTED = "To Be Drafted"; + private static final String REPORT_TITLE_CLARIFICATIONS_PENDING = "Clarifications Pending"; + private static final String REPORT_TITLE_DRAFTS_AWAITING_APPROVAL = "Drafts To Be Approved"; + public static final String REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED = "Notices Sent Not Yet Delivered"; + public static final String ERROR_DISPLAYING_REPORT = "Error displaying report"; + public static final String REPORT_TITLE_BILLS_AWAITING_PAYMENT = "Bills Awaiting Payment"; + public static final String REPORT_TITLE_APPROVED_NOT_YET_SENT = "Drafts Approved Not Yet Sent"; /** * @param args the command line arguments */ @@ -249,7 +375,12 @@ public class MainFrame extends javax.swing.JFrame { private javax.swing.JMenu menuLawyerNotices; private javax.swing.JMenuItem menuManageNotices; private javax.swing.JMenu menuMaster; + private javax.swing.JMenuItem menuNoticeDraftAwaitingApproval; + private javax.swing.JMenuItem menuNoticeDraftsApprovedToBeSent; + private javax.swing.JMenuItem menuNoticesClarificationPending; private javax.swing.JMenu menuNoticesReports; + private javax.swing.JMenuItem menuNoticesSentNotYetDelivered; + private javax.swing.JMenuItem menuNoticesToBeDrafted; private javax.swing.JMenu menuSettings; private javax.swing.JMenuItem menuStationery; // End of variables declaration//GEN-END:variables