18 package org.turro.financials.treasury.m111;
20 import java.text.NumberFormat;
21 import java.util.Date;
22 import org.turro.elephant.util.DecimalFormats;
23 import org.turro.financials.model.business.CompanyWrapper;
24 import org.turro.i18n.I_;
25 import org.turro.zkoss.grid.GroupExtended;
26 import org.turro.zkoss.layout.GridLayout;
27 import org.zkoss.zul.Groupfoot;
28 import org.zkoss.zul.Label;
29 import org.zkoss.zul.Space;
38 private Date fromDate, toDate;
41 this.fromDate = fromDate;
49 modelSet =
new ModelSet(fromDate, toDate);
50 getChildren().clear();
51 setColumns(
"1,right-300px,right-100px,right-300px");
61 private void compose() {
66 double taxable = 0.0, retention = 0.0;
67 long contractCount = 0;
69 if(currentType ==
null || me.getType().getOrder() != currentType.
getOrder()) {
70 if(currentType !=
null) {
71 Groupfoot gf =
new Groupfoot();
72 gf.appendChild(
new Label(contractCount +
" " +
I_.
get(
"Contracts")));
73 gf.appendChild(
new Label(currencyFormatter.format(taxable)));
74 gf.appendChild(
new Space());
75 gf.appendChild(
new Label(currencyFormatter.format(retention)));
81 GroupExtended ge =
new GroupExtended(I_.byKey(me.getType().toString()));
84 currentType = me.getType();
86 for(EntryContract ec : me.getContracts().values()) {
88 addCaption(ec.getContractName() +
" (" + ec.getDocuments().size() +
" " + I_.get(
"Documents") +
")");
89 addComponent(
new Label(currencyFormatter.format(ec.getTaxable())));
90 addComponent(
new Label(DecimalFormats.format(me.getPerCent())));
91 addComponent(
new Label(currencyFormatter.format(ec.getRetention())));
93 taxable += me.getTaxable();
94 retention += me.getRetention();
95 contractCount += me.getContracts().size();
98 if(previous !=
null) {
99 Groupfoot gf =
new Groupfoot();
100 gf.appendChild(
new Label(contractCount +
" " + I_.get(
"Contracts")));
101 gf.appendChild(
new Label(currencyFormatter.format(taxable)));
102 gf.appendChild(
new Space());
103 gf.appendChild(
new Label(currencyFormatter.format(retention)));
static NumberFormat getCurrencyFormatter()
void setFromDate(Date fromDate)
void setToDate(Date toDate)
static String get(String msg)
void setColCaptions(String captions)
void setColumns(int columns)
GridLayout addComponent(HtmlBasedComponent comp)
Rows getRows(boolean create)
GridLayout addCaption(String label)