X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FMainFrame.java;h=3ff041854100ec5be12129cbb2fe4337114ab950;hp=865a403e818985c9a6553f72ab3e6f37d1d4512f;hb=020bf95644b2f26d9c81d66d2a752e55bcd3ad5b;hpb=9ec7870cd70d09a7d67efb17dae44baa51f77957 diff --git a/src/habeas/MainFrame.java b/src/habeas/MainFrame.java index 865a403..3ff0418 100644 --- a/src/habeas/MainFrame.java +++ b/src/habeas/MainFrame.java @@ -5,11 +5,8 @@ */ package habeas; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.ArrayList; +import javax.swing.JOptionPane; /** * @@ -39,6 +36,11 @@ public class MainFrame extends javax.swing.JFrame { menuLawyerNotices = new javax.swing.JMenu(); menuCreateNotice = new javax.swing.JMenuItem(); menuManageNotices = new javax.swing.JMenuItem(); + jSeparator1 = new javax.swing.JPopupMenu.Separator(); + menuGenerateRaisedBills = new javax.swing.JMenuItem(); + menuNoticesReports = new javax.swing.JMenu(); + menuAwaitingPayment = new javax.swing.JMenuItem(); + menuNoticesSentNotYetDelivered = new javax.swing.JMenuItem(); menuSettings = new javax.swing.JMenu(); menuDatabaseSettings = new javax.swing.JMenuItem(); menuStationery = new javax.swing.JMenuItem(); @@ -81,6 +83,39 @@ public class MainFrame extends javax.swing.JFrame { } }); menuLawyerNotices.add(menuManageNotices); + menuLawyerNotices.add(jSeparator1); + + menuGenerateRaisedBills.setMnemonic('G'); + menuGenerateRaisedBills.setText("Generate Raised Bills..."); + menuGenerateRaisedBills.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuGenerateRaisedBillsActionPerformed(evt); + } + }); + menuLawyerNotices.add(menuGenerateRaisedBills); + + menuNoticesReports.setMnemonic('r'); + menuNoticesReports.setText("Reports"); + + menuAwaitingPayment.setMnemonic('a'); + menuAwaitingPayment.setText("Bills awaiting payment..."); + menuAwaitingPayment.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuAwaitingPaymentActionPerformed(evt); + } + }); + menuNoticesReports.add(menuAwaitingPayment); + + 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); + + menuLawyerNotices.add(menuNoticesReports); jMenuBar1.add(menuLawyerNotices); @@ -153,6 +188,44 @@ public class MainFrame extends javax.swing.JFrame { frm.setVisible(true); }//GEN-LAST:event_menuStationeryActionPerformed + private void menuGenerateRaisedBillsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuGenerateRaisedBillsActionPerformed + // TODO add your handling code here: + GenerateRaisedBillsDialog frm = new GenerateRaisedBillsDialog(this, true); + frm.setVisible(true); + + }//GEN-LAST:event_menuGenerateRaisedBillsActionPerformed + + private void menuAwaitingPaymentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAwaitingPaymentActionPerformed + // TODO add your handling code here: + NoticesReportViewDialog frm = new NoticesReportViewDialog(this, false); + String [] cols = {"Reference Number", "Description", "Bill Date", "Bill Amount", "Client"}; + int rep = 0; + ArrayList data = Utility.getReportData(rep, -1); + if (data == null) { + JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT); + return; + } + frm.setupReportTable(rep, REPORT_TITLE_BILLS_AWAITING_PAYMENT, cols, data); + frm.setVisible(true); + }//GEN-LAST:event_menuAwaitingPaymentActionPerformed + + 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 + 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"; + /** * @param args the command line arguments */ @@ -190,12 +263,17 @@ public class MainFrame extends javax.swing.JFrame { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JPopupMenu.Separator jSeparator1; + private javax.swing.JMenuItem menuAwaitingPayment; private javax.swing.JMenuItem menuClientMaster; private javax.swing.JMenuItem menuCreateNotice; private javax.swing.JMenuItem menuDatabaseSettings; + private javax.swing.JMenuItem menuGenerateRaisedBills; private javax.swing.JMenu menuLawyerNotices; private javax.swing.JMenuItem menuManageNotices; private javax.swing.JMenu menuMaster; + private javax.swing.JMenu menuNoticesReports; + private javax.swing.JMenuItem menuNoticesSentNotYetDelivered; private javax.swing.JMenu menuSettings; private javax.swing.JMenuItem menuStationery; // End of variables declaration//GEN-END:variables