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

Public Member Functions

void newReceipt ()
 
void importReceipt ()
 
void afterCompose ()
 
Component getEditBox (final Row row, final ReceiptItem dr)
 
void deleteReceipt (ReceiptItem dro)
 
void refresh ()
 
- 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 48 of file purchase/ReceiptsGrid.java.

Member Function Documentation

◆ afterCompose()

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

Definition at line 101 of file purchase/ReceiptsGrid.java.

101  {
102  addColumns();
103  setRowRenderer(new ReceiptItemRowRenderer(this));
104  setModel(new ReceiptItemModel(new ArrayList<ReceiptItem>(), this));
105 // setModel(new ReceiptItemModel(new ErpPU().getResultList(
106 // "select dco from DraftReceipt as dco " +
107 // "where (dco.documentLineId is null or dco.documentLineId = 0)"), this));
108  }

◆ deleteReceipt()

void org.turro.erp.purchase.ReceiptsGrid.deleteReceipt ( ReceiptItem  dro)

Definition at line 172 of file purchase/ReceiptsGrid.java.

172  {
173  new ErpPU().deleteObject(dro);
174  ((ReceiptItemModel) ReceiptsGrid.this.getGroupsModel()).removeItem(dro);
175  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEditBox()

Component org.turro.erp.purchase.ReceiptsGrid.getEditBox ( final Row  row,
final ReceiptItem  dr 
)

Definition at line 142 of file purchase/ReceiptsGrid.java.

142  {
143  Vlayout vbox = new Vlayout();
144  Button edit = new Button(Application.getString("lEdit"), Images.getImage(dr.getOrderItem().getType()));
145  edit.addEventListener(Events.ON_CLICK, new EventListener() {
146  @Override
147  public void onEvent(Event event) throws Exception {
148  doEdit(dr, new Command() {
149  @Override
150  public Object execute(Context context) {
151  if(dr.isEmpty()) {
152  new ErpPU().deleteObject(dr);
153  row.detach();
154  } else {
155  row.getChildren().clear();
156  ((ReceiptItemModel) ReceiptsGrid.this.getGroupsModel()).replaceItem(new ErpPU().saveObject(dr));
157  lastDate = dr.getDocumentDate();
158  }
159  return null;
160  }
161  });
162  }
163  });
164  vbox.appendChild(edit);
165  LabelExtended le = new LabelExtended();
166  le.setResourceValue(dr.getStatus().toString());
167  le.setSclass("softLabel");
168  vbox.appendChild(le);
169  return vbox;
170  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importReceipt()

void org.turro.erp.purchase.ReceiptsGrid.importReceipt ( )

Definition at line 72 of file purchase/ReceiptsGrid.java.

72  {
73  final List<OrderItem> l = new ArrayList<>();
74  HashMap<String, Object> map = new HashMap<>();
75  map.put("orderList", l);
76  ElephantMenu.showModalZulFile("lSelect", "/WEB-INF/_zul/erp/purchase/orderSelector.zul", map, new Command() {
77  @Override
78  public Object execute(Context context) {
79  for(OrderItem oi : l) {
80  ReceiptItem ri = oi.startReceipt(lastDate);
81  if(!ri.isEmpty()) {
82  Row row = new Row();
83  getRows().appendChild(row);
84  ((ReceiptItemModel) ReceiptsGrid.this.getGroupsModel()).addItem(new ErpPU().saveObject(ri));
85  ri = ri.getRelated();
86  if(ri != null) {
87  if(!ri.isEmpty()) {
88  row = new Row();
89  getRows().appendChild(row);
90  ((ReceiptItemModel) ReceiptsGrid.this.getGroupsModel()).addItem(new ErpPU().saveObject(ri));
91  }
92  }
93  }
94  }
95  return null;
96  }
97  });
98  }
Rows getRows(boolean create)
Here is the call graph for this function:

◆ newReceipt()

void org.turro.erp.purchase.ReceiptsGrid.newReceipt ( )

Definition at line 52 of file purchase/ReceiptsGrid.java.

52  {
53  final ReceiptItem dr = new ReceiptItem();
54  if(lastDate == null) {
55  lastDate = new CheckDate().setHour(8).setMinute(0).setSecond(0).getDate();
56  }
57  dr.setStartWorking(lastDate);
58  dr.setDedication(1.0);
59  doEdit(dr, new Command() {
60  @Override
61  public Object execute(Context context) {
62  if(!dr.isEmpty()) {
63  Row row = new Row();
64  getRows().appendChild(row);
65  ((ReceiptItemModel) ReceiptsGrid.this.getGroupsModel()).addItem(new ErpPU().saveObject(dr));
66  }
67  return null;
68  }
69  });
70  }
Here is the call graph for this function:

◆ refresh()

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

Definition at line 177 of file purchase/ReceiptsGrid.java.

177  {
178  setModel(ReceiptsGrid.this.getGroupsModel());
179  }

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