BrightSide Workbench Full Report + Source Code
org.turro.erp.purchase.OrdersGrid Class Reference
Inheritance diagram for org.turro.erp.purchase.OrdersGrid:
Collaboration diagram for org.turro.erp.purchase.OrdersGrid:

Public Member Functions

void afterCompose ()
 
Component getEditBox (final Row row, final OrderItem oi)
 
void deleteOrder (OrderItem oi)
 
void refresh ()
 
void importUsages ()
 
void addOrder (RequiredUsage ru)
 
- Public Member Functions inherited from org.turro.zkoss.grid.PagingGrid
void setColumns (int columns)
 
void setColumns (String hflexs)
 
void refine ()
 
boolean isDefaultBehavior ()
 
void setDefaultBehavior (boolean defaultBehavior)
 
String getRefineValue ()
 
void setRefineValue (String value)
 
int getMaxResults ()
 
void setMaxResults (int maxResults)
 
String getPagingMold ()
 
void setPagingMold (String pagingMold)
 
int getRowCount ()
 
void setRowCount (int rows)
 
void setHeadersVisible (boolean value)
 
boolean isHeadersVisible ()
 
String getVarColumns ()
 
void setVarColumns (String varColumns)
 
Collection< String > getVarColumnsList (String defaultCols)
 
void addDetailColumn ()
 
void addDetailColumn (HtmlBasedComponent caption)
 
void openDetails ()
 
boolean isEmpty ()
 
void clearColumns ()
 
void clearRows ()
 
void clearEmptyGroups ()
 
Columns getColumns (boolean create)
 
Rows getRows (boolean create)
 
Foot getFoot (boolean create)
 
Foot createFoot ()
 
void exportToPdf ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 46 of file OrdersGrid.java.

Member Function Documentation

◆ addOrder()

void org.turro.erp.purchase.OrdersGrid.addOrder ( RequiredUsage  ru)

Definition at line 150 of file OrdersGrid.java.

150  {
151  if(ru instanceof RequiredUsage) {
152  OrderItem oi = ru.startOrder();
153  if(!oi.isEmpty()) {
154  ((OrderItemModel) OrdersGrid.this.getGroupsModel()).addItem(new OrderItemWrapper(oi).save());
155  }
156  if(oi.getRelated() != null && !oi.getRelated().isEmpty()) {
157  ((OrderItemModel) OrdersGrid.this.getGroupsModel()).addItem(oi.getRelated());
158  }
159  }
160  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ afterCompose()

void org.turro.erp.purchase.OrdersGrid.afterCompose ( )

Definition at line 49 of file OrdersGrid.java.

49  {
50  addColumns();
51  setRowRenderer(new OrderItemRowRenderer(this));
52  setModel(new OrderItemModel(new ErpPU().getResultList(
53  "select dco from OrderItem as dco " +
54  "where dco.sent = FALSE " +
55  "and (dco.documentLineId is null or dco.documentLineId = 0)"), this));
56  }

◆ deleteOrder()

void org.turro.erp.purchase.OrdersGrid.deleteOrder ( OrderItem  oi)

Definition at line 108 of file OrdersGrid.java.

108  {
109  if(oi.getUpdatedReceiptItems().isEmpty()) {
110  new ErpPU().executeUpdate(
111  "delete from OrderItem as dro where dro.id=? and dro.receiptItems is empty",
112  new Object[] { oi.getId() });
113  ((OrderItemModel) OrdersGrid.this.getGroupsModel()).removeItem(oi);
114  }
115  if(oi.getRelated() != null) {
116  deleteOrder(oi.getRelated());
117  }
118  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEditBox()

Component org.turro.erp.purchase.OrdersGrid.getEditBox ( final Row  row,
final OrderItem  oi 
)

Definition at line 90 of file OrdersGrid.java.

90  {
91  Vlayout vbox = new Vlayout();
92  Button edit = new Button(Application.getString("lEdit"), Images.getImage(oi.getType()));
93  edit.addEventListener(Events.ON_CLICK, new EventListener() {
94  @Override
95  public void onEvent(Event event) throws Exception {
96  doEdit(oi);
97  }
98  });
99  vbox.appendChild(edit);
100  LabelExtended le = new LabelExtended();
101  le.setResourceValue(oi.getStatus().toString());
102  le.setSclass("softLabel");
103  vbox.appendChild(le);
104  edit.setVisible(oi.getStatus().equals(OrderStatus.ORDER_READY));
105  return vbox;
106  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importUsages()

void org.turro.erp.purchase.OrdersGrid.importUsages ( )

Definition at line 137 of file OrdersGrid.java.

137  {
138  Dao dao = new ErpPU();
139  List l = dao.getResultList(
140  "select u from RequiredUsage u " +
141  "where u.orderItems is empty " +
142  "and (u.task.status = ? or u.task.status = ?)",
143  new Object[] { TaskStatus.TASK_READY, TaskStatus.TASK_ONWORK }
144  );
145  for(Object o : l) {
146  addOrder((RequiredUsage) o);
147  }
148  }
void addOrder(RequiredUsage ru)
Here is the call graph for this function:

◆ refresh()

void org.turro.erp.purchase.OrdersGrid.refresh ( )

Definition at line 120 of file OrdersGrid.java.

120  {
121  setModel(OrdersGrid.this.getGroupsModel());
122  }

The documentation for this class was generated from the following file: