Skip to content

Commit

Permalink
handle situation where user cancelled uploading invoice document
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 24, 2024
1 parent 100576e commit 8a3aed3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4743,7 +4743,7 @@ private void cmdUploadDocumentActionPerformed(java.awt.event.ActionEvent evt) {/
this.uploadDocument(null);
}//GEN-LAST:event_cmdUploadDocumentActionPerformed

public void uploadDocument(Invoice invoice) {
public boolean uploadDocument(Invoice invoice) {
JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(invoice == null);

Expand Down Expand Up @@ -4800,6 +4800,9 @@ public void uploadDocument(Invoice invoice) {
log.error("Error uploading document", ioe);
JOptionPane.showMessageDialog(this, "Fehler beim Laden der Datei: " + ioe.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);
}
return true;
} else {
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="cmbCurrency" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="46" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,10 @@ private void cmdUploadInvoiceDocumentActionPerformed(java.awt.event.ActionEvent
if (this.currentEntry != null) {
this.save();
}
this.caseView.uploadDocument(currentEntry);
boolean uploaded=this.caseView.uploadDocument(currentEntry);
if(!uploaded)
return;

if (this.currentEntry != null) {
this.save();
try {
Expand Down

0 comments on commit 8a3aed3

Please sign in to comment.