19 package org.turro.financials.model.document;
21 import java.util.Currency;
22 import org.turro.financials.entity.BookDefinition;
23 import org.turro.financials.entity.Document;
24 import org.turro.financials.entity.DocumentLine;
25 import org.turro.zkoss.locale.Currencies;
39 this.document = document;
40 this.bookDefinition = bookDefinition;
55 amount += at.getAmount();
63 amount += at.getDiscount();
71 if(at.isPerCent(0.0)) {
72 amount += at.getTaxable();
74 amount += at.getTotal();
78 amount -= ar.getRetained();
88 private void createAmounts() {
92 int fractionDigits =
getCurrency().getDefaultFractionDigits();
96 if(correspondsToBook(dl)) {
97 dl.setLineOrder(count++);
98 double tax = dl.getFullTax();
102 taxables.
add(tax, dl.getTax(), dl.getEquivalenceSurcharge(),
103 dl.getTaxValue(), dl.getRealTaxValue(), dl.getEquivalenceSurchargeValue(),
104 dl.getSubtotal(), dl.getTaxable(), fractionDigits);
105 if(dl.getRetention() != 0.0) {
106 retentions.
add(dl.getRetention(), dl.getTaxable(), fractionDigits);
116 private Currency currency;
119 if(currency ==
null && document.
getContract() !=
null) {
OperatingModifier getOperatingModifier()
boolean isEquivalenceSurcharge()
Set< DocumentLine > getDocumentLines()
ContractPreference getContractPreference()
boolean add(Double perCent, Double taxable, int fractionDigits)
boolean add(Double perCent, Double tax, Double req, Double taxValue, Double taxRealValue, Double reqValue, Double subtotal, Double taxable, int fractionDigits)
AmountTaxableSet getTaxables()
AmountRetainedSet getRetentions()
DocumentAmountsByBook(Document document, BookDefinition bookDefinition)
static Currency getDefault()
boolean isSumTax(DocumentLine line)