57 if(row instanceof Group) {
58 OrderItem oi = (OrderItem) data;
59 PhraseBuilder pb =
new PhraseBuilder();
60 Contract provider = oi.getProvider();
61 if(provider !=
null) {
62 pb.addWord(provider.getName());
64 if(oi.getDocumentDate() !=
null) {
65 pb.addWord(Application.getString(
"lDate"));
66 pb.addWord(DateFormats.format(oi.getDocumentDate(),
true));
68 if(!Strings.isBlank(oi.getDocumentNumber())) {
69 pb.addWord(Application.getString(
"lNumber"));
70 pb.addWord(oi.getDocumentNumber());
72 row.appendChild(
new Label(pb.toString()));
73 }
else if(row instanceof Groupfoot) {
74 final OrderItemModel.OrderItemSummary dros = (OrderItemModel.OrderItemSummary) 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 OrderItem oi = (OrderItem) data;
93 row.appendChild(
new Label(oi.getName()));
94 Vlayout vbox =
new Vlayout();
95 row.appendChild(vbox);
96 RequiredUsage oru = oi.getOwnerRequiredUsage();
102 WorkOrder wo = task.getOrderReference().getWorkOrder();
104 vbox.appendChild(
new Label(wo.getFullDescription()));
105 vbox.appendChild(
new LabelAdapter(
new Label(wo.getContract().getName())).setSclass(
"softLabel"));
107 vbox.appendChild(
new LabelAdapter(
new Label(task.getFullDescription())).setSclass(
"softLabel"));
109 row.appendChild(
new Label(oi.getDescription()));
110 vbox =
new Vlayout();
111 row.appendChild(vbox);
112 vbox.appendChild(
new Label(DateFormats.formatNull(oi.getDocumentDate(),
true)));
113 if(task !=
null && task.getDelivery() !=
null) {
114 Label l =
new Label(DateFormats.formatNull(task.getDelivery(),
true));
115 if(task.getDelivery().after(
new Date())) {
116 l.setStyle(
"color:green;font-size:11px;");
118 l.setStyle(
"color:red;font-size:11px;");
122 vbox =
new Vlayout();
123 row.appendChild(vbox);
124 vbox.appendChild(
new Label(DecimalFormats.format(oi.getUnits())));
125 if(oi.getRequiredUsage() !=
null) {
126 vbox.appendChild(
new LabelAdapter(
new PercentLabel(oi.getDedication())).setSclass(
"softLabel"));
128 vbox =
new Vlayout();
129 row.appendChild(vbox);
130 vbox.appendChild(
new Label(DecimalFormats.format(oi.getCost())));
131 vbox.appendChild(
new LabelAdapter(
new Label(DecimalFormats.format(oi.getAmount()))).setSclass(
"softLabel"));
133 OrderItem owner = oi.getOwner();
135 Toolbarbutton del =
new Toolbarbutton(
null,
"/_zul/images/edit-delete.png");
136 del.addEventListener(Events.ON_CLICK,
new EventListener() {
138 public void onEvent(Event event)
throws Exception {
139 ZkossUtils.confirmDeletion(
null,
new Command() {
141 public Object execute(Context context) {
148 row.appendChild(del);
150 row.appendChild(
new Space());
Component getEditBox(final Row row, final OrderItem oi)
void deleteOrder(OrderItem oi)