From: Harishankar Date: Thu, 2 Apr 2020 16:36:07 +0000 (+0530) Subject: Reporting Functionality - added some report X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=703ad2090595c7cf19f92a58b95ce197c60bf5ea;p=habeas.git Reporting Functionality - added some report Added another report to the report functionality --- diff --git a/src/habeas/MainFrame.form b/src/habeas/MainFrame.form index 1531f25..a933727 100644 --- a/src/habeas/MainFrame.form +++ b/src/habeas/MainFrame.form @@ -88,6 +88,15 @@ + + + + + + + + + diff --git a/src/habeas/MainFrame.java b/src/habeas/MainFrame.java index 070a7f7..3e75ef8 100644 --- a/src/habeas/MainFrame.java +++ b/src/habeas/MainFrame.java @@ -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(); + menuNoticeDraftsApprovedToBeSent = new javax.swing.JMenuItem(); 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); + 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() { @@ -296,13 +306,29 @@ public class MainFrame extends javax.swing.JFrame { 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 */ @@ -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 menuNoticeDraftsApprovedToBeSent; private javax.swing.JMenuItem menuNoticesClarificationPending; private javax.swing.JMenu menuNoticesReports; private javax.swing.JMenuItem menuNoticesSentNotYetDelivered; diff --git a/src/habeas/Utility.java b/src/habeas/Utility.java index 9df1ab5..8602583 100644 --- a/src/habeas/Utility.java +++ b/src/habeas/Utility.java @@ -42,7 +42,11 @@ public class Utility { "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" @@ -64,7 +68,11 @@ public class Utility { "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, diff --git a/src/resources/noticebill.template.fodt b/src/resources/noticebill.template.fodt index 255a001..7d10c34 100644 --- a/src/resources/noticebill.template.fodt +++ b/src/resources/noticebill.template.fodt @@ -1,7 +1,7 @@ - Harishankar2020-04-01T12:35:54.6084487192020-04-01T15:03:02.307392512HarishankarPT9M49S9LibreOffice/6.4.2.2$Linux_X86_64 LibreOffice_project/40$Build-2 + 4071