57 if(row instanceof Group) {
58 ReceiptItem dro = (ReceiptItem) data;
59 PhraseBuilder pb =
new PhraseBuilder();
60 Contract provider = dro.getProvider();
61 if(provider !=
null) {
62 pb.addWord(provider.getName());
64 if(dro.getDocumentDate() !=
null) {
65 pb.addWord(Application.getString(
"lDate"));
66 pb.addWord(DateFormats.format(dro.getDocumentDate(),
true));
68 if(!Strings.isBlank(dro.getDocumentNumber())) {
69 pb.addWord(Application.getString(
"lNumber"));
70 pb.addWord(dro.getDocumentNumber());
72 row.appendChild(
new Label(pb.toString()));
73 }
else if(row instanceof Groupfoot) {
74 final ReceiptItemModel.ReceiptItemSummary dros = (ReceiptItemModel.ReceiptItemSummary) data;
75 row.appendChild(
new Space());
76 row.appendChild(
new Label(
"" + dros.items));
77 A docProps =
new A(Application.getString(
"lDocumentProperties"),
"/_zul/images/properties.png");
78 docProps.addEventListener(Events.ON_CLICK,
new EventListener() {
80 public void onEvent(Event event)
throws Exception {
84 row.appendChild(docProps);
85 row.appendChild(
new Space());
86 row.appendChild(
new Space());
87 row.appendChild(
new Label(DecimalFormats.format(dros.quatity)));
88 row.appendChild(
new Label(DecimalFormats.format(dros.cost)));
89 row.appendChild(
new Space());
91 final ReceiptItem dr = (ReceiptItem) data;
93 row.appendChild(
new Label(dr.getName()));
94 Vlayout vbox =
new Vlayout();
95 row.appendChild(vbox);
96 Task task = dr.getOrderItem().getRequiredUsage().getTask();
97 WorkOrder wo = task.getOrderReference().getWorkOrder();
99 vbox.appendChild(
new Label(wo.getFullDescription()));
100 vbox.appendChild(
new LabelAdapter(
new Label(wo.getContract().getName())).setSclass(
"softLabel"));
103 vbox.appendChild(
new LabelAdapter(
new Label(task.getFullDescription())).setSclass(
"softLabel"));
105 row.appendChild(
new Label(dr.getDescription()));
106 vbox =
new Vlayout();
107 row.appendChild(vbox);
108 if(dr.getStartWorking() !=
null) {
109 vbox.appendChild(
new Label(DateFormats.format(dr.getStartWorking(), dr.getOrderItem().getRequiredUsage() ==
null)));
111 if(task !=
null && task.getDelivery() !=
null) {
112 Label l =
new Label(DateFormats.format(task.getDelivery(),
true));
113 if(task.getDelivery().after(
new Date())) {
114 l.setStyle(
"color:green;font-size:11px;");
116 l.setStyle(
"color:red;font-size:11px;");
120 vbox =
new Vlayout();
121 row.appendChild(vbox);
122 vbox.appendChild(
new Label(DecimalFormats.format(dr.getUnits())));
123 if(dr.getOrderItem().getRequiredUsage().isHumanResourceType()) {
124 vbox.appendChild(
new LabelAdapter(
new PercentLabel(dr.getDedication())).setSclass(
"softLabel"));
126 vbox =
new Vlayout();
127 row.appendChild(vbox);
128 vbox.appendChild(
new Label(DecimalFormats.format(dr.getCost())));
129 vbox.appendChild(
new LabelAdapter(
new Label(DecimalFormats.format(dr.getAmount()))).setSclass(
"softLabel"));
131 Toolbarbutton del =
new Toolbarbutton(
null,
"/_zul/images/edit-delete.png");
132 del.addEventListener(Events.ON_CLICK,
new EventListener() {
134 public void onEvent(Event event)
throws Exception {
135 ZkossUtils.confirmDeletion(
null,
new Command() {
137 public Object execute(Context context) {
144 row.appendChild(del);
void deleteReceipt(ReceiptItem dro)
Component getEditBox(final Row row, final ReceiptItem dr)