Skip to content

Commit

Permalink
sonarqube fixes. issue #2424
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed May 2, 2024
1 parent 4b8eed9 commit 908cebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -766,7 +766,6 @@ public void setInvoices(List<Invoice> invoices) {

public void selectDate(Date d) {
if(d!=null) {
SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy");
this.txtDate.setText(df.format(d));
}
}
Expand Down
Expand Up @@ -1013,25 +1013,25 @@ private void cmdMarkAsPayedActionPerformed(java.awt.event.ActionEvent evt) {//GE
this.invoice.setStatus(Invoice.STATUS_PAID);

ClientSettings settings = ClientSettings.getInstance();
float paid = 0f;
float currentPaid = 0f;
try {
JLawyerServiceLocator locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties());
locator.lookupArchiveFileServiceRemote().updateInvoice(this.caseDto.getId(), this.invoice);

List<CaseAccountEntry> payments = locator.lookupArchiveFileServiceRemote().getAccountEntriesForInvoice(invoice.getId());

for (CaseAccountEntry ce : payments) {
paid = paid + ce.getEarnings() - ce.getSpendings();
currentPaid = currentPaid + ce.getEarnings() - ce.getSpendings();
}

this.setEntry(caseDto, this.invoice, addresses);

if(this.invoice.getTotalGross() - paid > 0) {
if(this.invoice.getTotalGross() - currentPaid > 0) {
CaseAccountEntry entry = new CaseAccountEntry();
entry.setArchiveFileKey(caseDto);
entry.setContact(this.invoice.getContact());
entry.setDescription("");
entry.setEarnings(invoice.getTotalGross() - paid);
entry.setEarnings(invoice.getTotalGross() - currentPaid);
entry.setEntryDate(new Date());
entry.setEscrowIn(0f);
entry.setEscrowOut(0f);
Expand Down

0 comments on commit 908cebd

Please sign in to comment.