Skip to content

Commit

Permalink
display total for each invoice. close #2034
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 29, 2023
1 parent 52b9595 commit e4034f3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<Component id="lblDueDate" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblInvoiceNumber" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblTotal" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblStatus" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
Expand All @@ -59,6 +61,7 @@
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="lblInvoiceNumber" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblStatus" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblTotal" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="lblDueDate" min="-2" max="-2" attributes="0"/>
</Group>
Expand Down Expand Up @@ -186,5 +189,15 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmdCopyActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblTotal">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
<FontInfo relative="true">
<Font bold="true" component="lblTotal" property="font" relativeSize="true" size="0"/>
</FontInfo>
</Property>
<Property name="text" type="java.lang.String" value="0,75"/>
</Properties>
</Component>
</SubComponents>
</Form>
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ You should also get your employer (if you work as a programmer) or school,
import com.jdimension.jlawyer.services.JLawyerServiceLocator;
import java.awt.Color;
import java.awt.Container;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
Expand All @@ -688,6 +689,7 @@ public class InvoiceEntryPanel extends javax.swing.JPanel {

private static final Logger log=Logger.getLogger(InvoiceEntryPanel.class.getName());
private final SimpleDateFormat df=new SimpleDateFormat("dd.MM.yyyy");
private final DecimalFormat totalFormat=new DecimalFormat("#0.00");

private ArchiveFileBean caseDto=null;
private ArchiveFilePanel caseView=null;
Expand Down Expand Up @@ -741,6 +743,10 @@ public void setEntry(ArchiveFileBean caseDto, Invoice invoice, List<AddressBean>
this.lblRecipient.setText(invoice.getContact().toDisplayName());
else
this.lblRecipient.setText("");

this.lblTotal.setText(totalFormat.format(invoice.getTotal()) + " " + invoice.getCurrency());


}

/**
Expand All @@ -762,6 +768,7 @@ private void initComponents() {
cmdDelete = new javax.swing.JButton();
cmdDuplicate = new javax.swing.JButton();
cmdCopy = new javax.swing.JButton();
lblTotal = new javax.swing.JLabel();

lblInvoiceNumber.setFont(lblInvoiceNumber.getFont().deriveFont(lblInvoiceNumber.getFont().getStyle() | java.awt.Font.BOLD));
lblInvoiceNumber.setText("RG123");
Expand Down Expand Up @@ -815,6 +822,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

lblTotal.setFont(lblTotal.getFont().deriveFont(lblTotal.getFont().getStyle() | java.awt.Font.BOLD));
lblTotal.setText("0,75");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
Expand All @@ -835,7 +845,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(lblDueDate)
.addGap(18, 18, 18)
.addComponent(lblInvoiceNumber)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(18, 18, 18)
.addComponent(lblTotal)
.addGap(18, 18, 18)
.addComponent(lblStatus)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
Expand All @@ -856,7 +868,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblInvoiceNumber)
.addComponent(lblStatus))
.addComponent(lblStatus)
.addComponent(lblTotal))
.addComponent(lblDueDate))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
Expand Down Expand Up @@ -915,5 +928,6 @@ private void cmdCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST
private javax.swing.JLabel lblName;
private javax.swing.JLabel lblRecipient;
private javax.swing.JLabel lblStatus;
private javax.swing.JLabel lblTotal;
// End of variables declaration//GEN-END:variables
}

0 comments on commit e4034f3

Please sign in to comment.