Added Reporting Functionality
[habeas.git] / src / habeas / MainFrame.java
index f20df55..4c7d97b 100644 (file)
@@ -41,6 +41,8 @@ public class MainFrame extends javax.swing.JFrame {
         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();
         menuSettings = new javax.swing.JMenu();
         menuDatabaseSettings = new javax.swing.JMenuItem();
         menuStationery = new javax.swing.JMenuItem();
@@ -94,6 +96,20 @@ public class MainFrame extends javax.swing.JFrame {
         });
         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);
+
+        menuLawyerNotices.add(menuNoticesReports);
+
         jMenuBar1.add(menuLawyerNotices);
 
         menuSettings.setMnemonic('S');
@@ -171,11 +187,21 @@ public class MainFrame extends javax.swing.JFrame {
         frm.setVisible(true);
 
     }//GEN-LAST:event_menuGenerateRaisedBillsActionPerformed
-    private static final String ERROR_RETRIEVING_RAISED_BILLS = "Error retrieving bills"
-            + " or no bills are raised at this time.";
-    private static final String FODT_EXT = "fodt";
-    private static final String FLAT_OPENDOCUMENT_TEXT = "Flat OpenDocument text";
-    private static final String ERROR_GENERATING = "Error generating";
+
+    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"};
+        ArrayList<Object> data = Utility.getPendingPaymentBills ();
+        if (data == null) {
+            JOptionPane.showMessageDialog(this, ERROR_DISPLAYING_REPORT);
+            return;
+        }
+        frm.setupReportTable(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";
 
     /**
      * @param args the command line arguments
@@ -215,6 +241,7 @@ 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;
@@ -222,6 +249,7 @@ 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.JMenu menuNoticesReports;
     private javax.swing.JMenu menuSettings;
     private javax.swing.JMenuItem menuStationery;
     // End of variables declaration//GEN-END:variables