Reporting Functionality - added some report
authorHarishankar <v.harishankar@gmail.com>
Thu, 2 Apr 2020 16:36:07 +0000 (22:06 +0530)
committerHarishankar <v.harishankar@gmail.com>
Thu, 2 Apr 2020 16:36:07 +0000 (22:06 +0530)
Added another report to the report functionality

src/habeas/MainFrame.form
src/habeas/MainFrame.java
src/habeas/Utility.java
src/resources/noticebill.template.fodt

index 1531f25..a933727 100644 (file)
                     <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuNoticeDraftAwaitingApprovalActionPerformed"/>
                   </Events>
                 </MenuItem>
                     <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuNoticeDraftAwaitingApprovalActionPerformed"/>
                   </Events>
                 </MenuItem>
+                <MenuItem class="javax.swing.JMenuItem" name="menuNoticeDraftsApprovedToBeSent">
+                  <Properties>
+                    <Property name="mnemonic" type="int" value="97"/>
+                    <Property name="text" type="java.lang.String" value="Drafts Approved not yet sent..."/>
+                  </Properties>
+                  <Events>
+                    <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuNoticeDraftsApprovedToBeSentActionPerformed"/>
+                  </Events>
+                </MenuItem>
                 <MenuItem class="javax.swing.JMenuItem" name="menuNoticesSentNotYetDelivered">
                   <Properties>
                     <Property name="mnemonic" type="int" value="115"/>
                 <MenuItem class="javax.swing.JMenuItem" name="menuNoticesSentNotYetDelivered">
                   <Properties>
                     <Property name="mnemonic" type="int" value="115"/>
index 070a7f7..3e75ef8 100644 (file)
@@ -42,6 +42,7 @@ public class MainFrame extends javax.swing.JFrame {
         menuNoticesToBeDrafted = new javax.swing.JMenuItem();
         menuNoticesClarificationPending = new javax.swing.JMenuItem();
         menuNoticeDraftAwaitingApproval = new javax.swing.JMenuItem();
         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();
         menuNoticesSentNotYetDelivered = new javax.swing.JMenuItem();
         menuAwaitingPayment = new javax.swing.JMenuItem();
         menuSettings = new javax.swing.JMenu();
@@ -126,6 +127,15 @@ public class MainFrame extends javax.swing.JFrame {
         });
         menuNoticesReports.add(menuNoticeDraftAwaitingApproval);
 
         });
         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() {
         menuNoticesSentNotYetDelivered.setMnemonic('s');
         menuNoticesSentNotYetDelivered.setText("Notices sent not yet delivered...");
         menuNoticesSentNotYetDelivered.addActionListener(new java.awt.event.ActionListener() {
@@ -296,13 +306,29 @@ public class MainFrame extends javax.swing.JFrame {
         frm.setVisible(true);
                 
     }//GEN-LAST:event_menuNoticesToBeDraftedActionPerformed
         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<Object> 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";
     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
      */
     /**
      * @param args the command line arguments
      */
@@ -350,6 +376,7 @@ public class MainFrame extends javax.swing.JFrame {
     private javax.swing.JMenuItem menuManageNotices;
     private javax.swing.JMenu menuMaster;
     private javax.swing.JMenuItem menuNoticeDraftAwaitingApproval;
     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 menuNoticesClarificationPending;
     private javax.swing.JMenu menuNoticesReports;
     private javax.swing.JMenuItem menuNoticesSentNotYetDelivered;
index 9df1ab5..8602583 100644 (file)
@@ -42,7 +42,11 @@ public class Utility {
             
             "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
             + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
             
             "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
             + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
-            + "WHERE DraftCreated=0;"            
+            + "WHERE DraftCreated=0;",
+
+            "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM"
+            + " legalnotices INNER JOIN clients ON ClientId=clients.id WHERE "
+            + " DraftApproved=1 AND NoticeSent=0;"
     } ;
 
     private static final String[] REPORTS_FILTERED = { "SELECT ReferenceNumber, Description"
     } ;
 
     private static final String[] REPORTS_FILTERED = { "SELECT ReferenceNumber, Description"
@@ -64,7 +68,11 @@ public class Utility {
 
             "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
             + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
 
             "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
             + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
-            + "WHERE DraftCreated=0 AND ClientId=?;"            
+            + "WHERE DraftCreated=0 AND ClientId=?;",            
+
+            "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM"
+            + " legalnotices INNER JOIN clients ON ClientId=clients.id WHERE "
+            + " DraftApproved=1 AND NoticeSent=0 AND ClientId=?;"            
     } ;    
     
     static void saveStationerySettings (String left_header, 
     } ;    
     
     static void saveStationerySettings (String left_header, 
index 255a001..7d10c34 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
 <?xml version="1.0" encoding="UTF-8"?>
 
 <office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ooo="http://openoffice.org/2004/office" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
- <office:meta><meta:initial-creator>Harishankar</meta:initial-creator><meta:creation-date>2020-04-01T12:35:54.608448719</meta:creation-date><dc:date>2020-04-01T15:03:02.307392512</dc:date><dc:creator>Harishankar</dc:creator><meta:editing-duration>PT9M49S</meta:editing-duration><meta:editing-cycles>9</meta:editing-cycles><meta:generator>LibreOffice/6.4.2.2$Linux_X86_64 LibreOffice_project/40$Build-2</meta:generator><meta:document-statistic meta:table-count="2" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="15" meta:word-count="52" meta:character-count="303" meta:non-whitespace-character-count="266"/></office:meta>
  <office:settings>
   <config:config-item-set config:name="ooo:view-settings">
    <config:config-item config:name="ViewAreaTop" config:type="long">4071</config:config-item>
  <office:settings>
   <config:config-item-set config:name="ooo:view-settings">
    <config:config-item config:name="ViewAreaTop" config:type="long">4071</config:config-item>