-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
library/src/main/java/org/mustangproject/CalculatedInvoice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2023 Jochen Stärk, see LICENSE file | ||
package org.mustangproject; | ||
|
||
|
||
import org.mustangproject.ZUGFeRD.TransactionCalculator; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.Serializable; | ||
import java.math.BigDecimal; | ||
|
||
public class CalculatedInvoice extends Invoice implements Serializable { | ||
|
||
protected BigDecimal grandTotal=null; | ||
|
||
public void calculate() { | ||
TransactionCalculator tc=new TransactionCalculator(this); | ||
grandTotal=tc.getGrandTotal(); | ||
} | ||
public BigDecimal getGrandTotal() { | ||
if (grandTotal==null) { | ||
calculate(); | ||
} | ||
return grandTotal; | ||
} | ||
public CalculatedInvoice setGrandTotal(BigDecimal grand) { | ||
grandTotal=grand; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters