Generate raised bills functionality completed
authorHarishankar <v.harishankar@gmail.com>
Wed, 1 Apr 2020 09:45:34 +0000 (15:15 +0530)
committerHarishankar <v.harishankar@gmail.com>
Wed, 1 Apr 2020 09:45:34 +0000 (15:15 +0530)
Completed the basic functionality for generating bill in flat ODT
format based on the template.

src/habeas/GenerateRaisedBillsDialog.form [new file with mode: 0644]
src/habeas/GenerateRaisedBillsDialog.java [new file with mode: 0644]
src/habeas/Habeas.java
src/habeas/MainFrame.form
src/habeas/MainFrame.java
src/habeas/Utility.java
src/resources/noticebill.template.fodt
src/resources/tablerow.template.xml

diff --git a/src/habeas/GenerateRaisedBillsDialog.form b/src/habeas/GenerateRaisedBillsDialog.form
new file mode 100644 (file)
index 0000000..3fc7e02
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+  <Properties>
+    <Property name="defaultCloseOperation" type="int" value="2"/>
+    <Property name="title" type="java.lang.String" value="Generate Raised Bills"/>
+    <Property name="locationByPlatform" type="boolean" value="true"/>
+  </Properties>
+  <SyntheticProperties>
+    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+    <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
+  </SyntheticProperties>
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel1" min="-2" pref="113" max="-2" attributes="0"/>
+              <EmptySpace type="separate" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="comboClients" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="buttonGenerate" min="-2" pref="121" max="-2" attributes="0"/>
+                      <EmptySpace pref="28" max="32767" attributes="0"/>
+                      <Component id="buttonClose" min="-2" pref="120" max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="comboClients" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace pref="45" max="32767" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="buttonGenerate" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="buttonClose" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JLabel" name="jLabel1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="For client"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="comboClients">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+          <StringArray count="0"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;DBItem&gt;"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JButton" name="buttonGenerate">
+      <Properties>
+        <Property name="mnemonic" type="int" value="103"/>
+        <Property name="text" type="java.lang.String" value="Generate"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonGenerateActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="buttonClose">
+      <Properties>
+        <Property name="mnemonic" type="int" value="67"/>
+        <Property name="text" type="java.lang.String" value="Close"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCloseActionPerformed"/>
+      </Events>
+    </Component>
+  </SubComponents>
+</Form>
diff --git a/src/habeas/GenerateRaisedBillsDialog.java b/src/habeas/GenerateRaisedBillsDialog.java
new file mode 100644 (file)
index 0000000..2273353
--- /dev/null
@@ -0,0 +1,205 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package habeas;
+
+import java.util.ArrayList;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+/**
+ *
+ * @author hari
+ */
+public class GenerateRaisedBillsDialog extends javax.swing.JDialog {
+
+    /**
+     * Creates new form GenerateRaisedBillsDialog
+     */
+    public GenerateRaisedBillsDialog(java.awt.Frame parent, boolean modal) {
+        super(parent, modal);
+        initComponents();
+        populateFields ();
+    }
+
+    /**
+     * This method is called from within the constructor to initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is always
+     * regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents() {
+
+        jLabel1 = new javax.swing.JLabel();
+        comboClients = new javax.swing.JComboBox<>();
+        buttonGenerate = new javax.swing.JButton();
+        buttonClose = new javax.swing.JButton();
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+        setTitle("Generate Raised Bills");
+        setLocationByPlatform(true);
+
+        jLabel1.setText("For client");
+
+        buttonGenerate.setMnemonic('g');
+        buttonGenerate.setText("Generate");
+        buttonGenerate.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                buttonGenerateActionPerformed(evt);
+            }
+        });
+
+        buttonClose.setMnemonic('C');
+        buttonClose.setText("Close");
+        buttonClose.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                buttonCloseActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(18, 18, 18)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(comboClients, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(buttonGenerate, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
+                        .addComponent(buttonClose, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
+                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(13, 13, 13)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel1)
+                    .addComponent(comboClients, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(buttonGenerate)
+                    .addComponent(buttonClose))
+                .addContainerGap())
+        );
+
+        pack();
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void buttonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCloseActionPerformed
+        // TODO add your handling code here:
+        dispose ();
+    }//GEN-LAST:event_buttonCloseActionPerformed
+
+    private void buttonGenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGenerateActionPerformed
+        // TODO add your handling code here:
+        DBItem selitem = (DBItem)comboClients.getSelectedItem();
+        if (selitem == null) return;
+        ArrayList<Object> client = Utility.getClientDetails(selitem.getKey());
+        if (client == null) {
+            JOptionPane.showMessageDialog(this, ERROR_CLIENT_DETAILS);
+            return;
+        } else if (client.isEmpty()) {
+            JOptionPane.showMessageDialog(this, ERROR_CLIENT_DETAILS);
+            return;            
+        }
+        ArrayList<Object> bills = Utility.getRaisedBills(selitem.getKey());
+        if (bills == null) {
+            JOptionPane.showMessageDialog(this, ERROR_RAISED_BILLS);
+            return;
+        } else if (bills.isEmpty()) {
+            JOptionPane.showMessageDialog(this, ERROR_RAISED_BILLS);
+            return;            
+        }
+        
+        JFileChooser chooser = new JFileChooser ();
+        FileFilter filter = new FileNameExtensionFilter("Flat OpenDocument text", "fodt");
+        chooser.setFileFilter(filter);
+        int r = chooser.showSaveDialog(this);
+        if (r == JFileChooser.APPROVE_OPTION) {
+            String filename = chooser.getSelectedFile().getAbsolutePath();
+            if (!filename.endsWith(".fodt"))
+                filename = filename.concat(".fodt");
+        
+            boolean rt = Utility.generateRaisedNoticesBill(filename, (String)client.get(0), 
+                (String)client.get(1), (String)client.get(2), bills);
+            if (rt == false) 
+                JOptionPane.showMessageDialog(this, ERROR_WRITING_FILE);
+            else
+                JOptionPane.showMessageDialog(this, SUCCESSFULLY_GENERATED_BILL);
+        }
+    }//GEN-LAST:event_buttonGenerateActionPerformed
+    private static final String ERROR_WRITING_FILE = "Error writing file";
+    private static final String SUCCESSFULLY_GENERATED_BILL = "Successfully generated bill";
+    private static final String ERROR_RAISED_BILLS = "Error getting raised "
+            + "bills or no raised bills found for this client";
+    private static final String ERROR_CLIENT_DETAILS = "Error getting client details";
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[]) {
+        /* Set the Nimbus look and feel */
+        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
+        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
+         */
+        try {
+            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+                if ("Nimbus".equals(info.getName())) {
+                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
+                    break;
+                }
+            }
+        } catch (ClassNotFoundException ex) {
+            java.util.logging.Logger.getLogger(GenerateRaisedBillsDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (InstantiationException ex) {
+            java.util.logging.Logger.getLogger(GenerateRaisedBillsDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (IllegalAccessException ex) {
+            java.util.logging.Logger.getLogger(GenerateRaisedBillsDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+            java.util.logging.Logger.getLogger(GenerateRaisedBillsDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        //</editor-fold>
+
+        /* Create and display the dialog */
+        java.awt.EventQueue.invokeLater(new Runnable() {
+            public void run() {
+                GenerateRaisedBillsDialog dialog = new GenerateRaisedBillsDialog(new javax.swing.JFrame(), true);
+                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
+                    @Override
+                    public void windowClosing(java.awt.event.WindowEvent e) {
+                        System.exit(0);
+                    }
+                });
+                dialog.setVisible(true);
+            }
+        });
+    }
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton buttonClose;
+    private javax.swing.JButton buttonGenerate;
+    private javax.swing.JComboBox<DBItem> comboClients;
+    private javax.swing.JLabel jLabel1;
+    // End of variables declaration//GEN-END:variables
+
+    private void populateFields() {
+        comboClients.removeAllItems();;
+        ArrayList<Object> clients = Utility.getClientsNameAndId();
+        if (clients == null) return;
+        for (int i = 0; i < clients.size(); i +=2) {
+            comboClients.addItem(new DBItem ((int)clients.get(i), (String)clients.get(i+1)));
+        }
+        
+    }
+}
index 6c24189..2bfb038 100644 (file)
@@ -25,7 +25,7 @@ public class Habeas {
         Utility.retrieveStationerySettings();
         
         try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
         } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
             Logger.getLogger(Habeas.class.getName()).log(Level.SEVERE, null, ex);
         }
index 0847aae..4545146 100644 (file)
                 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuManageNoticesActionPerformed"/>
               </Events>
             </MenuItem>
+            <MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
+            </MenuItem>
+            <MenuItem class="javax.swing.JMenuItem" name="menuGenerateRaisedBills">
+              <Properties>
+                <Property name="mnemonic" type="int" value="71"/>
+                <Property name="text" type="java.lang.String" value="Generate Raised Bills..."/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuGenerateRaisedBillsActionPerformed"/>
+              </Events>
+            </MenuItem>
           </SubComponents>
         </Menu>
         <Menu class="javax.swing.JMenu" name="menuSettings">
index 865a403..f20df55 100644 (file)
@@ -5,11 +5,11 @@
  */
 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.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileNameExtensionFilter;
 
 /**
  *
@@ -39,6 +39,8 @@ 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();
         menuSettings = new javax.swing.JMenu();
         menuDatabaseSettings = new javax.swing.JMenuItem();
         menuStationery = new javax.swing.JMenuItem();
@@ -81,6 +83,16 @@ 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);
 
         jMenuBar1.add(menuLawyerNotices);
 
@@ -153,6 +165,18 @@ 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 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";
+
     /**
      * @param args the command line arguments
      */
@@ -190,9 +214,11 @@ 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 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;
index 0dc4235..bc99932 100644 (file)
@@ -5,11 +5,20 @@
  */
 package habeas;
 
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.prefs.Preferences;
 import java.sql.*;
+import java.text.DateFormat;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import jdk.dynalink.linker.support.Guards;
 
 /**
  *
@@ -22,20 +31,23 @@ public class Utility {
         leftLetterHeader = left_header;
         rightLetterHeader = right_header;
         signatoryName = signatory;
-        Preferences.userRoot().put ("LeftHeader", left_header);
-        Preferences.userRoot().put ("RightHeader", right_header);
-        Preferences.userRoot().put ("Signatory", signatory);
+        Preferences myPrefs = Preferences.userRoot().node("org/harishankar/Habeas");
+        myPrefs.put ("LeftHeader", left_header);
+        myPrefs.put ("RightHeader", right_header);
+        myPrefs.put ("Signatory", signatory);
     }
     
     static void retrieveStationerySettings () {
-        leftLetterHeader = Preferences.userRoot().get("LeftHeader", "Left Header");
-        rightLetterHeader = Preferences.userRoot().get ("RightHeader", "Right Header");
-        signatoryName = Preferences.userRoot().get ("Signatory", "Signatory Name");
+        Preferences myPrefs = Preferences.userRoot().node ("org/harishankar/Habeas");
+        leftLetterHeader = myPrefs.get("LeftHeader", "Left Header");
+        rightLetterHeader = myPrefs.get ("RightHeader", "Right Header");
+        signatoryName = myPrefs.get ("Signatory", "Signatory Name");
     }
 
     static void saveConnectionURL(String text) {
         connectionURL = text;
-        Preferences.userRoot().put("ConnectionURL", text);
+        Preferences myPrefs = Preferences.userRoot().node ("org/harishankar/Habeas");
+        myPrefs.put("ConnectionURL", text);
     }
 
     static ArrayList<Object> getClientDetails(int r) {
@@ -391,6 +403,85 @@ public class Utility {
         }
         
     }
+    
+    static ArrayList<Object> getRaisedBills (int client_id) {
+        try {
+            Connection conn = DriverManager.getConnection(JDBC + connectionURL);
+            PreparedStatement st = conn.prepareStatement("SELECT ReferenceNumber, "
+                     + "Description, BillDate, BillAmount"
+                     + " FROM legalnotices WHERE BillStatus='RAISED' AND ClientId=?;");
+            st.setInt (1, client_id);
+            
+             ResultSet rs = st.executeQuery ();
+             ArrayList<Object> bills = new ArrayList<>();
+             while (rs.next()) {
+                 bills.add (rs.getString("ReferenceNumber"));
+                 bills.add (rs.getString("Description"));
+                 bills.add (getValidDate(rs, "BillDate"));
+                 bills.add (rs.getInt("BillAmount"));
+             }
+             conn.close();
+             return bills;
+             
+        } catch (SQLException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return null;
+        }
+            
+    }
+
+    static boolean generateRaisedNoticesBill(String fileName, String clientName,
+            String clientAddress, String contactPerson, ArrayList<Object> bills) {
+        if (bills == null)
+                return false;
+        try {
+            InputStream templ = Utility.class.getClassLoader().getResourceAsStream("resources/noticebill.template.fodt");
+            if (templ == null)
+                return false;
+            DateFormat fmt = new SimpleDateFormat("dd MMM yyyy");
+            String templateMain = new String (templ.readAllBytes());
+            // this is for openoffice ODT - replace normal line breaks with the XML equivalent
+            String left = leftLetterHeader.replaceAll("\n", "<text:line-break/>");
+            String right = rightLetterHeader.replaceAll("\n", "<text:line-break/>");
+            String client_address = clientAddress.replaceAll ("\n", "<text:line-break/>");
+            String rows = generateBillRows (bills);
+            System.out.println (rows);
+            
+            String strMain = MessageFormat.format(templateMain, 
+                    left, right, 
+                    fmt.format(new Date(System.currentTimeMillis())),
+                    clientName, client_address, contactPerson, signatoryName, rows);
+            
+            FileOutputStream f = new FileOutputStream (fileName);
+            f.write (strMain.getBytes());
+            f.close();
+            return true; 
+        } catch (IOException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return false;
+        }
+    }
+
+    private static String generateBillRows(ArrayList<Object> bills) {
+        try {
+            InputStream tmpl = Utility.class.getClassLoader().getResourceAsStream("resources/tablerow.template.xml");
+            String rowtpl = new String(tmpl.readAllBytes());
+         
+            DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
+
+          StringBuilder bldr = new StringBuilder ();
+          for (int i = 0; i < bills.size(); i += 4) {
+              String row = MessageFormat.format (rowtpl, (String)bills.get(i), 
+                      (String)bills.get(i+1), fmt.format((java.util.Date)bills.get(i+2)),
+                              (int)bills.get(i+3));
+              bldr.append(row);
+          }
+          return (bldr.toString());
+        } catch (IOException ex) {
+            Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
+            return null;
+        }
+    }
     public Utility () {
         
     }
@@ -423,7 +514,8 @@ public class Utility {
     }
     
     public static void retrieveConnectionURL () {
-        connectionURL = Preferences.userRoot().get("ConnectionURL", "legaldb");
+        Preferences myPrefs = Preferences.userRoot().node("org/harishankar/Habeas");
+        connectionURL = myPrefs.get("ConnectionURL", "legaldb");
     }
     
 }
index 7ee76ac..255a001 100644 (file)
@@ -1,28 +1,28 @@
 <?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-03-31T18:10:42.145558520</meta:creation-date><meta:generator>LibreOffice/6.4.2.2$Linux_X86_64 LibreOffice_project/40$Build-2</meta:generator><dc:date>2020-03-31T20:20:34.290574090</dc:date><dc:creator>Harishankar</dc:creator><meta:editing-duration>PT26M56S</meta:editing-duration><meta:editing-cycles>4</meta:editing-cycles><meta:document-statistic meta:table-count="2" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="16" meta:word-count="65" meta:character-count="414" meta:non-whitespace-character-count="365"/></office:meta>
+ <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">2727</config:config-item>
+   <config:config-item config:name="ViewAreaTop" config:type="long">4071</config:config-item>
    <config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
-   <config:config-item config:name="ViewAreaWidth" config:type="long">24211</config:config-item>
-   <config:config-item config:name="ViewAreaHeight" config:type="long">8922</config:config-item>
+   <config:config-item config:name="ViewAreaWidth" config:type="long">26074</config:config-item>
+   <config:config-item config:name="ViewAreaHeight" config:type="long">10402</config:config-item>
    <config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
    <config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
    <config:config-item-map-indexed config:name="Views">
     <config:config-item-map-entry>
      <config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
-     <config:config-item config:name="ViewLeft" config:type="long">3655</config:config-item>
-     <config:config-item config:name="ViewTop" config:type="long">10012</config:config-item>
+     <config:config-item config:name="ViewLeft" config:type="long">18230</config:config-item>
+     <config:config-item config:name="ViewTop" config:type="long">9294</config:config-item>
      <config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
-     <config:config-item config:name="VisibleTop" config:type="long">2727</config:config-item>
-     <config:config-item config:name="VisibleRight" config:type="long">24209</config:config-item>
-     <config:config-item config:name="VisibleBottom" config:type="long">11647</config:config-item>
+     <config:config-item config:name="VisibleTop" config:type="long">4071</config:config-item>
+     <config:config-item config:name="VisibleRight" config:type="long">26072</config:config-item>
+     <config:config-item config:name="VisibleBottom" config:type="long">14471</config:config-item>
      <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
      <config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item>
      <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
-     <config:config-item config:name="ZoomFactor" config:type="short">140</config:config-item>
+     <config:config-item config:name="ZoomFactor" config:type="short">130</config:config-item>
      <config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item>
      <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
     </config:config-item-map-entry>
@@ -79,7 +79,7 @@
    <config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
    <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
    <config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
-   <config:config-item config:name="Rsid" config:type="int">1334322</config:config-item>
+   <config:config-item config:name="Rsid" config:type="int">2162407</config:config-item>
    <config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
    <config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
    <config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
    <config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
    <config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
    <config:config-item config:name="TableRowKeep" config:type="boolean">false</config:config-item>
-   <config:config-item config:name="RsidRoot" config:type="int">1229947</config:config-item>
+   <config:config-item config:name="RsidRoot" config:type="int">1737415</config:config-item>
    <config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
    <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
    <config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item>
  <office:font-face-decls>
   <style:font-face style:name="Cantarell" svg:font-family="Cantarell"/>
   <style:font-face style:name="Lohit Devanagari1" svg:font-family="&apos;Lohit Devanagari&apos;"/>
-  <style:font-face style:name="Cantarell1" svg:font-family="Cantarell" style:font-pitch="variable"/>
   <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+  <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
   <style:font-face style:name="DejaVu Sans" svg:font-family="&apos;DejaVu Sans&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
   <style:font-face style:name="Lohit Devanagari" svg:font-family="&apos;Lohit Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
  </office:font-face-decls>
  <office:styles>
   <style:default-style style:family="graphic">
    <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
-   <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false">
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
     <style:tab-stops/>
    </style:paragraph-properties>
    <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-name-asian="DejaVu Sans" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
    </style:paragraph-properties>
   </style:style>
   <style:style style:name="Header" style:family="paragraph" style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
-   <style:paragraph-properties fo:padding="0.049cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.31pt solid #5c8526" text:number-lines="false" text:line-number="0">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0">
     <style:tab-stops>
      <style:tab-stop style:position="8.5cm" style:type="center"/>
      <style:tab-stop style:position="17cm" style:type="right"/>
     </style:tab-stops>
    </style:paragraph-properties>
   </style:style>
-  <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra" style:master-page-name="">
-   <style:paragraph-properties style:page-number="auto" text:number-lines="false" text:line-number="0">
-    <style:tab-stops/>
-   </style:paragraph-properties>
-  </style:style>
-  <style:style style:name="Table_20_Heading" style:display-name="Table Heading" style:family="paragraph" style:parent-style-name="Table_20_Contents" style:class="extra">
-   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/>
-   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+  <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
   </style:style>
   <text:outline-style style:name="Outline">
    <text:outline-level-style text:level="1" style:num-format="">
   <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
   <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
   <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+  <style:style style:name="Default_20_Style.1" style:display-name="Default Style.1" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-top="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.2" style:display-name="Default Style.2" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.3" style:display-name="Default Style.3" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.4" style:display-name="Default Style.4" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-right="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.5" style:display-name="Default Style.5" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.6" style:display-name="Default Style.6" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.7" style:display-name="Default Style.7" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.8" style:display-name="Default Style.8" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.9" style:display-name="Default Style.9" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.10" style:display-name="Default Style.10" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-right="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.11" style:display-name="Default Style.11" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-top="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.12" style:display-name="Default Style.12" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-right="0.51pt solid #000000" fo:border-top="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.13" style:display-name="Default Style.13" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.14" style:display-name="Default Style.14" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-right="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.15" style:display-name="Default Style.15" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-top="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <style:style style:name="Default_20_Style.16" style:display-name="Default Style.16" style:family="table-cell">
+   <style:table-cell-properties fo:border-left="0.51pt solid #000000" fo:border-bottom="0.51pt solid #000000"/>
+  </style:style>
+  <table:table-template table:name="Default Style" table:first-row-end-column="row" table:first-row-start-column="row" table:last-row-end-column="row" table:last-row-start-column="row">
+   <table:first-row table:style-name="Default_20_Style.1"/>
+   <table:last-row table:style-name="Default_20_Style.2"/>
+   <table:first-column table:style-name="Default_20_Style.3"/>
+   <table:last-column table:style-name="Default_20_Style.4"/>
+   <table:body table:style-name="Default_20_Style.9"/>
+   <table:even-rows table:style-name="Default_20_Style.5"/>
+   <table:odd-rows table:style-name="Default_20_Style.6"/>
+   <table:even-columns table:style-name="Default_20_Style.7"/>
+   <table:odd-columns table:style-name="Default_20_Style.8"/>
+   <table:background table:style-name="Default_20_Style.10"/>
+   <loext:first-row-even-column table:style-name="Default_20_Style.15"/>
+   <loext:last-row-even-column table:style-name="Default_20_Style.16"/>
+   <loext:first-row-end-column table:style-name="Default_20_Style.12"/>
+   <loext:first-row-start-column table:style-name="Default_20_Style.11"/>
+   <loext:last-row-end-column table:style-name="Default_20_Style.14"/>
+   <loext:last-row-start-column table:style-name="Default_20_Style.13"/>
+  </table:table-template>
  </office:styles>
  <office:automatic-styles>
   <style:style style:name="Table1" style:family="table">
   <style:style style:name="Table1.A" style:family="table-column">
    <style:table-column-properties style:column-width="8.5cm" style:rel-column-width="32767*"/>
   </style:style>
+  <style:style style:name="Table1.B" style:family="table-column">
+   <style:table-column-properties style:column-width="8.5cm" style:rel-column-width="32768*"/>
+  </style:style>
   <style:style style:name="Table1.A1" style:family="table-cell">
    <style:table-cell-properties style:writing-mode="page"/>
   </style:style>
   <style:style style:name="Table1.A" style:family="table-column">
    <style:table-column-properties style:column-width="8.5cm" style:rel-column-width="32767*"/>
   </style:style>
+  <style:style style:name="Table1.B" style:family="table-column">
+   <style:table-column-properties style:column-width="8.5cm" style:rel-column-width="32768*"/>
+  </style:style>
   <style:style style:name="Table1.A1" style:family="table-cell">
    <style:table-cell-properties style:writing-mode="page"/>
   </style:style>
-  <style:style style:name="Table2" style:family="table">
-   <style:table-properties style:width="17.009cm" fo:margin-left="0cm" table:align="left"/>
+  <style:style style:name="Table2" style:family="table" style:master-page-name="">
+   <style:table-properties style:width="16.995cm" style:page-number="auto" table:align="left" style:shadow="none" style:may-break-between-rows="true" table:border-model="collapsing"/>
   </style:style>
   <style:style style:name="Table2.A" style:family="table-column">
-   <style:table-column-properties style:column-width="3.669cm"/>
+   <style:table-column-properties style:column-width="2.992cm"/>
   </style:style>
   <style:style style:name="Table2.B" style:family="table-column">
-   <style:table-column-properties style:column-width="7.728cm"/>
+   <style:table-column-properties style:column-width="7.408cm"/>
   </style:style>
   <style:style style:name="Table2.C" style:family="table-column">
-   <style:table-column-properties style:column-width="2.702cm"/>
+   <style:table-column-properties style:column-width="3.196cm"/>
   </style:style>
   <style:style style:name="Table2.D" style:family="table-column">
-   <style:table-column-properties style:column-width="2.91cm"/>
+   <style:table-column-properties style:column-width="3.399cm"/>
+  </style:style>
+  <style:style style:name="Table2.1" style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
   </style:style>
   <style:style style:name="Table2.A1" style:family="table-cell">
-   <style:table-cell-properties fo:padding="0.049cm" fo:border-left="0.05pt solid #000000" fo:border-right="none" fo:border-top="0.05pt solid #000000" fo:border-bottom="0.05pt solid #000000" style:writing-mode="page"/>
+   <style:table-cell-properties fo:background-color="transparent" fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000" style:writing-mode="page">
+    <style:background-image/>
+   </style:table-cell-properties>
   </style:style>
   <style:style style:name="Table2.D1" style:family="table-cell">
-   <style:table-cell-properties fo:padding="0.049cm" fo:border="0.05pt solid #000000" style:writing-mode="page"/>
+   <style:table-cell-properties fo:background-color="transparent" fo:padding="0.097cm" fo:border="0.5pt solid #000000" style:writing-mode="page">
+    <style:background-image/>
+   </style:table-cell-properties>
   </style:style>
   <style:style style:name="Table2.A2" style:family="table-cell">
-   <style:table-cell-properties fo:padding="0.049cm" fo:border-left="0.05pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.05pt solid #000000" style:writing-mode="page"/>
+   <style:table-cell-properties fo:background-color="transparent" fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000" style:writing-mode="page">
+    <style:background-image/>
+   </style:table-cell-properties>
   </style:style>
   <style:style style:name="Table2.D2" style:family="table-cell">
-   <style:table-cell-properties fo:padding="0.049cm" fo:border-left="0.05pt solid #000000" fo:border-right="0.05pt solid #000000" fo:border-top="none" fo:border-bottom="0.05pt solid #000000" style:writing-mode="page"/>
+   <style:table-cell-properties fo:background-color="transparent" fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000" style:writing-mode="page">
+    <style:background-image/>
+   </style:table-cell-properties>
   </style:style>
   <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header">
-   <style:text-properties officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32"/>
+   <style:paragraph-properties style:border-line-width-bottom="0.018cm 0.004cm 0.018cm" fo:padding="0.049cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="1.11pt double-thin #5c8526"/>
   </style:style>
   <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Header">
-   <style:text-properties officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32"/>
+   <style:paragraph-properties style:border-line-width-bottom="0.018cm 0.004cm 0.018cm" fo:padding="0.049cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="1.11pt double-thin #5c8526"/>
   </style:style>
   <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Table_20_Contents">
-   <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/>
-   <style:text-properties fo:font-weight="bold" officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+   <style:text-properties fo:color="#5c8526" style:font-name="Liberation Sans" fo:font-size="10pt" fo:font-weight="bold" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="10pt" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold"/>
   </style:style>
   <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Table_20_Contents">
-   <style:text-properties fo:color="#5c8526" style:font-name="Cantarell1" fo:font-size="9pt" fo:font-weight="bold" officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32" style:font-size-asian="9pt" style:font-weight-asian="bold" style:font-size-complex="9pt" style:font-weight-complex="bold"/>
+   <style:text-properties fo:color="#5c8526" style:font-name="Liberation Sans" fo:font-size="10pt" fo:font-weight="bold" officeooo:rsid="001c88c9" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="10pt" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold"/>
   </style:style>
-  <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Text_20_body">
-   <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
+  <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Liberation Serif" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="bold" style:text-overline-style="none" style:text-overline-color="font-color"/>
   </style:style>
-  <style:style style:name="P6" style:family="paragraph" style:parent-style-name="Text_20_body">
-   <style:text-properties officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32"/>
+  <style:style style:name="P6" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Liberation Serif" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
   </style:style>
   <style:style style:name="P7" style:family="paragraph" style:parent-style-name="Text_20_body">
-   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
-   <style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold" officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+   <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
   </style:style>
   <style:style style:name="P8" style:family="paragraph" style:parent-style-name="Text_20_body">
+   <style:text-properties officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7"/>
+  </style:style>
+  <style:style style:name="P9" style:family="paragraph" style:parent-style-name="Text_20_body">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+   <style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="P10" style:family="paragraph" style:parent-style-name="Text_20_body">
+   <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/>
+   <style:text-properties style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-weight-asian="normal" style:font-weight-complex="normal"/>
+  </style:style>
+  <style:style style:name="P11" style:family="paragraph" style:parent-style-name="Text_20_body">
    <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false"/>
-   <style:text-properties style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="00145c32" officeooo:paragraph-rsid="00145c32" style:font-weight-asian="normal" style:font-weight-complex="normal"/>
+   <style:text-properties style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="001c88c9" officeooo:paragraph-rsid="001a82c7" style:font-weight-asian="normal" style:font-weight-complex="normal"/>
+  </style:style>
+  <style:style style:name="P12" style:family="paragraph" style:parent-style-name="Text_20_body">
+   <style:text-properties officeooo:rsid="001c88c9"/>
+  </style:style>
+  <style:style style:name="P13" style:family="paragraph" style:parent-style-name="Text_20_body">
+   <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
+   <style:text-properties officeooo:rsid="001c88c9"/>
+  </style:style>
+  <style:style style:name="P14" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Liberation Serif" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="bold" style:text-overline-style="none" style:text-overline-color="font-color"/>
+  </style:style>
+  <style:style style:name="P15" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Liberation Serif" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="001a82c7" officeooo:paragraph-rsid="001a82c7" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
+  </style:style>
+  <style:style style:name="T1" style:family="text">
+   <style:text-properties officeooo:rsid="001ae4e1"/>
+  </style:style>
+  <style:style style:name="T2" style:family="text">
+   <style:text-properties officeooo:rsid="001c88c9"/>
   </style:style>
   <style:page-layout style:name="pm1">
    <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
     <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
    </style:page-layout-properties>
    <style:header-style>
-    <style:header-footer-properties fo:min-height="0cm" fo:margin-bottom="0.499cm"/>
+    <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm"/>
    </style:header-style>
    <style:footer-style/>
   </style:page-layout>
   <style:master-page style:name="Standard" style:page-layout-name="pm1">
    <style:header>
     <table:table table:name="Table1" table:style-name="Table1">
-     <table:table-column table:style-name="Table1.A" table:number-columns-repeated="2"/>
+     <table:table-column table:style-name="Table1.A"/>
+     <table:table-column table:style-name="Table1.B"/>
      <table:table-row>
       <table:table-cell table:style-name="Table1.A1" office:value-type="string">
-       <text:p text:style-name="P4">{Left Header}</text:p>
+       <text:p text:style-name="P4">{0}</text:p>
       </table:table-cell>
       <table:table-cell table:style-name="Table1.A1" office:value-type="string">
-       <text:p text:style-name="P4">{Right Header}</text:p>
+       <text:p text:style-name="P4">{1}</text:p>
       </table:table-cell>
      </table:table-row>
     </table:table>
     <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
     <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
    </text:sequence-decls>
-   <text:p text:style-name="P5">{Date}</text:p>
+   <text:p text:style-name="P13">{2}</text:p>
    <text:p text:style-name="Text_20_body">To:</text:p>
-   <text:p text:style-name="Text_20_body">{Client Name}<text:line-break/>{Client Address}</text:p>
-   <text:p text:style-name="P6">Sir/Madam,</text:p>
-   <text:p text:style-name="P7">SUB: PENDING BILLS FOR LEGAL NOTICES</text:p>
-   <text:p text:style-name="P8">With reference to the above, please find below the details of the pending bills:</text:p>
-   <table:table table:name="Table2" table:style-name="Table2">
+   <text:p text:style-name="P12">{5}<text:line-break/>{3}<text:line-break/>{4}</text:p>
+   <text:p text:style-name="P8">Sir/Madam,</text:p>
+   <text:p text:style-name="P9">SUB: BILLS FOR LEGAL NOTICES</text:p>
+   <table:table table:name="Table2" table:style-name="Table2" table:template-name="Default Style">
     <table:table-column table:style-name="Table2.A"/>
     <table:table-column table:style-name="Table2.B"/>
     <table:table-column table:style-name="Table2.C"/>
     <table:table-column table:style-name="Table2.D"/>
-    <table:table-row>
+    <table:table-row table:style-name="Table2.1">
      <table:table-cell table:style-name="Table2.A1" office:value-type="string">
-      <text:p text:style-name="P3">Reference Number</text:p>
+      <text:p text:style-name="P5">Reference No</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.A1" office:value-type="string">
-      <text:p text:style-name="P3">Description</text:p>
+      <text:p text:style-name="P5">Description</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.A1" office:value-type="string">
-      <text:p text:style-name="P3">Bill Date</text:p>
+      <text:p text:style-name="P5">Bill Date</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.D1" office:value-type="string">
-      <text:p text:style-name="P3">Amount</text:p>
+      <text:p text:style-name="P5">Bill Amount</text:p>
      </table:table-cell>
     </table:table-row>
-    {Bill Table Row}
+    {7}
    </table:table>
-   <text:p text:style-name="P8"/>
-   <text:p text:style-name="P8">Attaching the copies of the notices along with postal acknowledgement. I request you to kindly clear the same at your earliest convenience.</text:p>
-   <text:p text:style-name="P8">Thanking you,</text:p>
-   <text:p text:style-name="P8">Yours Truly,</text:p>
-   <text:p text:style-name="P8"/>
-   <text:p text:style-name="P8">{Signatory Name}</text:p>
+   <text:p text:style-name="P10"/>
+   <text:p text:style-name="P10">I request you to kindly clear the same at your earliest convenience. Copy of the referred notices with the postal acknowledgement/POD are attached for your kind reference.</text:p>
+   <text:p text:style-name="P10">Thanking you,</text:p>
+   <text:p text:style-name="P10">Yours Truly,</text:p>
+   <text:p text:style-name="P10"/>
+   <text:p text:style-name="P11">{6}</text:p>
   </office:text>
  </office:body>
 </office:document>
\ No newline at end of file
index 62f9ec8..55364ce 100644 (file)
@@ -1,14 +1,14 @@
-    <table:table-row>
+    <table:table-row table:style-name="Table2.1">
      <table:table-cell table:style-name="Table2.A2" office:value-type="string">
-      <text:p text:style-name="P3"/>{Reference Number}
+         <text:p text:style-name="P6">{0}</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.A2" office:value-type="string">
-      <text:p text:style-name="P3"/>{Description}
+         <text:p text:style-name="P6">{1}</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.A2" office:value-type="string">
-      <text:p text:style-name="P3"/>{Bill Date}
+         <text:p text:style-name="P6">{2}</text:p>
      </table:table-cell>
      <table:table-cell table:style-name="Table2.D2" office:value-type="string">
-      <text:p text:style-name="P3"/>{Bill Amount}
+         <text:p text:style-name="P6">{3}</text:p>
      </table:table-cell>
-    </table:table-row>
+    </table:table-row>
\ No newline at end of file