◆ OrdersListbox()
org.turro.erp.purchase.OrdersListbox.OrdersListbox |
( |
| ) |
|
◆ convertToString()
String org.turro.erp.purchase.OrdersListbox.convertToString |
( |
Order |
v | ) |
|
|
protected |
Definition at line 98 of file OrdersListbox.java.
99 return (v.getDate() ==
null ?
"" : DateFormats.format(v.getDate(),
true)) +
103 DecimalFormats.format(v.getLines()) +
105 DecimalFormats.format(v.getUnits()) +
107 DecimalFormats.format(v.getCost());
◆ getOrders()
List<OrderItem> org.turro.erp.purchase.OrdersListbox.getOrders |
( |
| ) |
|
Definition at line 71 of file OrdersListbox.java.
74 WhereClause wc =
new WhereClause();
75 wc.addClause(
"select d from OrderItem d");
76 wc.addClause(
"where d.providerId = :provider");
77 wc.addClause(
"and d.sent = TRUE");
78 wc.addNamedValue(
"provider", provider.
getId());
79 if(order.getDate() ==
null) {
80 wc.addClause(
"and d.documentDate is null");
82 wc.addClause(
"and d.documentDate = :date");
83 wc.addNamedValue(
"date", order.getDate());
85 if(order.getNumber() ==
null) {
86 wc.addClause(
"and d.documentNumber is null");
88 wc.addClause(
"and d.documentNumber = :number");
89 wc.addNamedValue(
"number", order.getNumber());
91 wc.addClause(
"and not exists (select dr from ReceiptItem dr where dr.orderItem = d)");
92 return new ErpPU().getResultList(wc);
◆ setProvider()
void org.turro.erp.purchase.OrdersListbox.setProvider |
( |
Contract |
provider | ) |
|
Definition at line 48 of file OrdersListbox.java.
49 this.provider = provider;
50 List l =
new ErpPU().getResultList(
51 "select d.documentDate, d.documentNumber, count(d.id), sum(d.units), sum(d.units*d.cost) " +
53 "where providerId = ? " +
54 "and d.sent = TRUE " +
55 "and not exists (select dr from ReceiptItem dr where dr.orderItem = d) " +
56 "group by d.documentDate, d.documentNumber",
57 new Object[] { provider.
getId() });
58 List<Order> orders =
new ArrayList<Order>();
59 for(Object[] o : (List<Object[]>) l) {
60 Order order =
new Order();
61 order.setDate((Date) o[0]);
62 order.setNumber((String) o[1]);
63 order.setLines(
new Converter(o[2]).getDouble());
64 order.setUnits(
new Converter(o[3]).getDouble());
65 order.setCost(
new Converter(o[4]).getDouble());
The documentation for this class was generated from the following file: