@@ -0,0 +1,41 @@
|
||||
package info.bukova.isspst;
|
||||
|
||||
import info.bukova.isspst.data.Address;
|
||||
import info.bukova.isspst.data.AddressEmb;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AddressUtils
|
||||
{
|
||||
public static AddressEmb convertAddressToAddressEmb(Address input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
AddressEmb output = new AddressEmb(input);
|
||||
return output;
|
||||
}
|
||||
|
||||
public static List<AddressEmb> convertListAddressToListAddressEmb(List<Address> inputList)
|
||||
{
|
||||
if (inputList == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AddressEmb> outputList = new ArrayList<AddressEmb>();
|
||||
|
||||
for (int i = 0; i < inputList.size(); i++)
|
||||
{
|
||||
Address inputItem = inputList.get(i);
|
||||
AddressEmb outputItem = new AddressEmb(inputItem);
|
||||
outputList.add(outputItem);
|
||||
}
|
||||
|
||||
return outputList;
|
||||
}
|
||||
}
|
||||
@@ -199,21 +199,39 @@ public class Address extends BaseData
|
||||
String str, street;
|
||||
|
||||
List<String> listStreet = new ArrayList<String>();
|
||||
|
||||
if (this.street != null)
|
||||
{
|
||||
listStreet.add(this.street);
|
||||
}
|
||||
|
||||
if (this.houseNumber != null)
|
||||
{
|
||||
listStreet.add(this.houseNumber);
|
||||
}
|
||||
|
||||
street = StringUtils.join(listStreet, " ");
|
||||
|
||||
List<String> list = new ArrayList<String>();
|
||||
|
||||
if (this.company != null)
|
||||
{
|
||||
list.add(this.company);
|
||||
}
|
||||
|
||||
if (street != null)
|
||||
{
|
||||
list.add(street);
|
||||
}
|
||||
|
||||
if (this.city != null)
|
||||
{
|
||||
list.add(this.city);
|
||||
}
|
||||
|
||||
list.add(Long.toString(this.ic));
|
||||
str = StringUtils.join(list, ", ");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import info.bukova.isspst.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Embeddable
|
||||
public class AddressEmb {
|
||||
|
||||
public class AddressEmb
|
||||
{
|
||||
|
||||
private int id;
|
||||
private String company;
|
||||
private String department;
|
||||
@@ -20,11 +26,12 @@ public class AddressEmb {
|
||||
private String email;
|
||||
private String web;
|
||||
private String description;
|
||||
|
||||
public AddressEmb() {
|
||||
|
||||
public AddressEmb()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public AddressEmb(Address address)
|
||||
{
|
||||
if (address == null)
|
||||
@@ -33,10 +40,10 @@ public class AddressEmb {
|
||||
}
|
||||
|
||||
this.id = address.getId();
|
||||
this.company = address.getCompany();
|
||||
this.company = address.getCompany();
|
||||
this.department = address.getDepartment();
|
||||
this.contactName = address.getContactName();
|
||||
this.street = address.getStreet();
|
||||
this.street = address.getStreet();
|
||||
this.houseNumber = address.getHouseNumber();
|
||||
this.zipCode = address.getZipCode();
|
||||
this.city = address.getCity();
|
||||
@@ -82,116 +89,200 @@ public class AddressEmb {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
public String getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
public void setCompany(String company)
|
||||
{
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
public String getDepartment()
|
||||
{
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
public void setDepartment(String department)
|
||||
{
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getContactName() {
|
||||
public String getContactName()
|
||||
{
|
||||
return contactName;
|
||||
}
|
||||
|
||||
public void setContactName(String contactName) {
|
||||
public void setContactName(String contactName)
|
||||
{
|
||||
this.contactName = contactName;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
public String getStreet()
|
||||
{
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(String street) {
|
||||
public void setStreet(String street)
|
||||
{
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getHouseNumber() {
|
||||
public String getHouseNumber()
|
||||
{
|
||||
return houseNumber;
|
||||
}
|
||||
|
||||
public void setHouseNumber(String houseNumber) {
|
||||
public void setHouseNumber(String houseNumber)
|
||||
{
|
||||
this.houseNumber = houseNumber;
|
||||
}
|
||||
|
||||
public String getZipCode() {
|
||||
public String getZipCode()
|
||||
{
|
||||
return zipCode;
|
||||
}
|
||||
|
||||
public void setZipCode(String zipCode) {
|
||||
public void setZipCode(String zipCode)
|
||||
{
|
||||
this.zipCode = zipCode;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
public String getCity()
|
||||
{
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
public void setCity(String city)
|
||||
{
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
public String getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
public void setState(String state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public long getIc() {
|
||||
public long getIc()
|
||||
{
|
||||
return ic;
|
||||
}
|
||||
|
||||
public void setIc(long ic) {
|
||||
public void setIc(long ic)
|
||||
{
|
||||
this.ic = ic;
|
||||
}
|
||||
|
||||
public String getDic() {
|
||||
public String getDic()
|
||||
{
|
||||
return dic;
|
||||
}
|
||||
|
||||
public void setDic(String dic) {
|
||||
public void setDic(String dic)
|
||||
{
|
||||
this.dic = dic;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getWeb() {
|
||||
public String getWeb()
|
||||
{
|
||||
return web;
|
||||
}
|
||||
|
||||
public void setWeb(String web) {
|
||||
public void setWeb(String web)
|
||||
{
|
||||
this.web = web;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
String str, street;
|
||||
|
||||
List<String> listStreet = new ArrayList<String>();
|
||||
|
||||
if (this.street != null)
|
||||
{
|
||||
listStreet.add(this.street);
|
||||
}
|
||||
|
||||
if (this.houseNumber != null)
|
||||
{
|
||||
listStreet.add(this.houseNumber);
|
||||
}
|
||||
|
||||
street = StringUtils.join(listStreet, " ");
|
||||
|
||||
List<String> list = new ArrayList<String>();
|
||||
|
||||
if (this.company != null)
|
||||
{
|
||||
list.add(this.company);
|
||||
}
|
||||
|
||||
if (street != null)
|
||||
{
|
||||
list.add(street);
|
||||
}
|
||||
|
||||
if (this.city != null)
|
||||
{
|
||||
list.add(this.city);
|
||||
}
|
||||
|
||||
list.add(Long.toString(this.ic));
|
||||
str = StringUtils.join(list, ", ");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static boolean isEqualByAddressEmbForFilter(AddressEmb value, AddressEmb search)
|
||||
{
|
||||
if ((search == null) || search.toString().isEmpty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (value != null)
|
||||
{
|
||||
String valueS = value.toString();
|
||||
String searchS = search.toString();
|
||||
return StringUtils.isEqualForFilter(valueS, searchS);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package info.bukova.isspst.filters;
|
||||
|
||||
import info.bukova.isspst.BigDecimalUtils;
|
||||
import info.bukova.isspst.DateTimeUtils;
|
||||
import info.bukova.isspst.StringUtils;
|
||||
import info.bukova.isspst.data.AddressEmb;
|
||||
import info.bukova.isspst.data.Order;
|
||||
import info.bukova.isspst.data.User;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
|
||||
public class OrderFilter implements Filter<Order>
|
||||
{
|
||||
private Order condition;
|
||||
|
||||
public OrderFilter(Order cond)
|
||||
{
|
||||
this.condition = cond;
|
||||
// this.condition.setSuplier(new AddressEmb());
|
||||
// this.condition.setDeliveryAddress(new AddressEmb());
|
||||
// this.condition.setAddress(new AddressEmb());
|
||||
// this.condition.setOwnedBy(new User());
|
||||
}
|
||||
|
||||
private static class OrderMatcher extends TypeSafeMatcher<Order>
|
||||
{
|
||||
private Order condition;
|
||||
|
||||
public OrderMatcher(Order cond)
|
||||
{
|
||||
this.condition = cond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void describeTo(Description desc)
|
||||
{
|
||||
desc.appendText("Order matches");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSafely(Order item)
|
||||
{
|
||||
boolean foundNumSer = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser());
|
||||
boolean foundOrderDate = DateTimeUtils.isEqualByDateForFilter(item.getOrderDate(), condition.getOrderDate());
|
||||
boolean foundTotal = BigDecimalUtils.isEqualByDecimalForFilter(item.getTotal(), condition.getTotal());
|
||||
boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate());
|
||||
boolean foundDeliveredDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveredDate(), condition.getDeliveredDate());
|
||||
boolean foundInvoiceNumber = StringUtils.isEqualForFilter(item.getInvoiceNumber(), condition.getInvoiceNumber());
|
||||
boolean foundSupplierAddr = AddressEmb.isEqualByAddressEmbForFilter(item.getSuplier(), condition.getSuplier());
|
||||
boolean foundDeliveryAddr = AddressEmb.isEqualByAddressEmbForFilter(item.getDeliveryAddress(), condition.getDeliveryAddress());
|
||||
boolean foundInvoiceAddr = AddressEmb.isEqualByAddressEmbForFilter(item.getAddress(), condition.getAddress());
|
||||
boolean foundOwnedBy = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy());
|
||||
boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription());
|
||||
return (foundNumSer
|
||||
&& foundOrderDate
|
||||
&& foundTotal
|
||||
&& foundDeliveryDate
|
||||
&& foundDeliveredDate
|
||||
&& foundInvoiceNumber
|
||||
&& foundSupplierAddr
|
||||
&& foundDeliveryAddr
|
||||
&& foundInvoiceAddr
|
||||
&& foundOwnedBy && foundDescription);
|
||||
}
|
||||
|
||||
@Factory
|
||||
public static Matcher<Order> matchBuilding(Order item)
|
||||
{
|
||||
return new OrderMatcher(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderMatcher matcher()
|
||||
{
|
||||
return new OrderMatcher(condition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,23 @@
|
||||
package info.bukova.isspst.services.approved;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import info.bukova.isspst.data.AddressEmb;
|
||||
import info.bukova.isspst.data.JoinedItem;
|
||||
import info.bukova.isspst.data.Order;
|
||||
import info.bukova.isspst.data.OrderItem;
|
||||
import info.bukova.isspst.services.AbstractOwnedService;
|
||||
import info.bukova.isspst.services.LazyLoader;
|
||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.Query;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
||||
OrderService {
|
||||
|
||||
@@ -50,4 +53,41 @@ public class OrderServiceImpl extends AbstractOwnedService<Order> implements
|
||||
super.add(order);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@Transactional
|
||||
@PreAuthorize("hasPermission(this, 'PERM_READ')")
|
||||
public List<Order> getAll()
|
||||
{
|
||||
Query q = dao.getQuery("select o from Order o join fetch o.ownedBy");
|
||||
return q.list();
|
||||
}
|
||||
|
||||
@LazyLoader("form")
|
||||
@Transactional
|
||||
public void lazyLoadOwnedBy(Order order)
|
||||
{
|
||||
if (order == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Order o = dao.getById(order.getId());
|
||||
Hibernate.initialize(o.getOwnedBy());
|
||||
order.setOwnedBy(o.getOwnedBy());
|
||||
}
|
||||
|
||||
@LazyLoader({ "form", "grid" })
|
||||
@Transactional
|
||||
public void lazyLoadItems(Order order)
|
||||
{
|
||||
if (order == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Order o = dao.getById(order.getId());
|
||||
Hibernate.initialize(o.getItems());
|
||||
order.setItems(o.getItems());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,4 +49,32 @@ public class DocumentViewModel
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Command
|
||||
public void handleComboKey(@BindingParam("ctrl") Combobox cb, @BindingParam("keyEvent") KeyEvent keyEvent)
|
||||
{
|
||||
if (cb == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
boolean isShiftKey = keyEvent.isShiftKey();
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
case 46: // del
|
||||
|
||||
if (isShiftKey)
|
||||
{
|
||||
// Zrušit jakoukoli vybranou položku
|
||||
cb.setSelectedIndex(-1);
|
||||
// Zavřít listbox
|
||||
cb.close();
|
||||
// Vyvolat událost změny
|
||||
Events.postEvent("onChange", cb, null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.zkoss.bind.BindUtils;
|
||||
import org.zkoss.bind.annotation.BindingParam;
|
||||
import org.zkoss.bind.annotation.Command;
|
||||
import org.zkoss.bind.annotation.GlobalCommand;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.bind.annotation.NotifyChange;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
@@ -48,6 +49,12 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
|
||||
protected String formZul;
|
||||
protected Filter<T> dataFilter;
|
||||
|
||||
@Init
|
||||
public void initListViewModel()
|
||||
{
|
||||
super.initDocumentViewModel();
|
||||
}
|
||||
|
||||
public List<T> getDataList() {
|
||||
if (dataList == null) {
|
||||
dataList = new ArrayList<T>();
|
||||
|
||||
@@ -37,22 +37,31 @@ public class OrderForm extends FormViewModel<Order>
|
||||
|
||||
protected Address selectedDeliveryAddrItem;
|
||||
|
||||
protected String suppCompany;
|
||||
|
||||
protected String deliveryCompany;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initOrderForm()
|
||||
{
|
||||
this.orderFormValidator = new OrderFormValidator();
|
||||
this.selectedDeliveryAddrItem = this.getDataBean().getDeliveryAddress().getAddress();
|
||||
|
||||
if (this.getDataBean().getSuplier() == null)
|
||||
{
|
||||
this.getDataBean().setSuplier(new AddressEmb());
|
||||
}
|
||||
|
||||
this.selectedSuppAddrItem = this.getDataBean().getSuplier().getAddress();
|
||||
this.suppCompany = this.selectedSuppAddrItem.getCompany();
|
||||
|
||||
if (this.getDataBean().getDeliveryAddress() == null)
|
||||
{
|
||||
this.getDataBean().setDeliveryAddress(new AddressEmb());
|
||||
}
|
||||
|
||||
this.selectedDeliveryAddrItem = this.getDataBean().getDeliveryAddress().getAddress();
|
||||
this.deliveryCompany = this.selectedDeliveryAddrItem.getCompany();
|
||||
|
||||
if (this.getDataBean().getAddress() == null)
|
||||
{
|
||||
this.getDataBean().setAddress(new AddressEmb());
|
||||
@@ -114,31 +123,65 @@ public class OrderForm extends FormViewModel<Order>
|
||||
this.selectedDeliveryAddrItem = selectedDeliveryAddrItem;
|
||||
}
|
||||
|
||||
public String getSuppCompany()
|
||||
{
|
||||
return suppCompany;
|
||||
}
|
||||
|
||||
public void setSuppCompany(String suppCompany)
|
||||
{
|
||||
this.suppCompany = suppCompany;
|
||||
}
|
||||
|
||||
public String getDeliveryCompany()
|
||||
{
|
||||
return deliveryCompany;
|
||||
}
|
||||
|
||||
public void setDeliveryCompany(String deliveryCompany)
|
||||
{
|
||||
this.deliveryCompany = deliveryCompany;
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange("dataBean")
|
||||
public void doFillSuppAddress()
|
||||
{
|
||||
AddressEmb addr;
|
||||
|
||||
if (this.selectedSuppAddrItem == null)
|
||||
{
|
||||
return;
|
||||
addr = this.getDataBean().getSuplier();
|
||||
addr.setId(0);
|
||||
addr.setCompany(this.suppCompany);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Naplnit pole podle vybrané adresy z comba
|
||||
addr = new AddressEmb(this.selectedSuppAddrItem);
|
||||
}
|
||||
|
||||
// Naplnit pole podle vybrané adresy z comba
|
||||
AddressEmb supplier = new AddressEmb(this.selectedSuppAddrItem);
|
||||
this.getDataBean().setSuplier(supplier);
|
||||
this.getDataBean().setSuplier(addr);
|
||||
}
|
||||
|
||||
@Command
|
||||
@NotifyChange("dataBean")
|
||||
public void doFillDeliveryAddress()
|
||||
{
|
||||
AddressEmb addr;
|
||||
|
||||
if (this.selectedDeliveryAddrItem == null)
|
||||
{
|
||||
return;
|
||||
addr = this.getDataBean().getDeliveryAddress();
|
||||
addr.setId(0);
|
||||
addr.setCompany(this.deliveryCompany);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Naplnit pole podle vybrané adresy z comba
|
||||
addr = new AddressEmb(this.selectedDeliveryAddrItem);
|
||||
}
|
||||
|
||||
// Naplnit pole podle vybrané adresy z comba
|
||||
AddressEmb delivery = new AddressEmb(this.selectedDeliveryAddrItem);
|
||||
this.getDataBean().setDeliveryAddress(delivery);
|
||||
this.getDataBean().setDeliveryAddress(addr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package info.bukova.isspst.ui.main.orders.created;
|
||||
|
||||
import info.bukova.isspst.AddressUtils;
|
||||
import info.bukova.isspst.data.Address;
|
||||
import info.bukova.isspst.data.AddressEmb;
|
||||
import info.bukova.isspst.data.Order;
|
||||
import info.bukova.isspst.data.SettingsData;
|
||||
import info.bukova.isspst.data.User;
|
||||
import info.bukova.isspst.filters.OrderFilter;
|
||||
import info.bukova.isspst.services.addressbook.AdbService;
|
||||
import info.bukova.isspst.services.approved.OrderService;
|
||||
import info.bukova.isspst.services.settings.GlobalSettingsService;
|
||||
import info.bukova.isspst.services.users.UserService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
public class OrderList extends ListViewModel<Order>
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
private final static Logger log = LoggerFactory.getLogger(OrderList.class.getName());
|
||||
|
||||
@WireVariable
|
||||
protected OrderService orderService;
|
||||
|
||||
@WireVariable
|
||||
protected AdbService adbService;
|
||||
|
||||
@WireVariable
|
||||
protected GlobalSettingsService settingsService;
|
||||
|
||||
@WireVariable
|
||||
protected UserService userService;
|
||||
|
||||
@Init(superclass = true)
|
||||
public void initOrderList()
|
||||
{
|
||||
service = orderService;
|
||||
dataClass = Order.class;
|
||||
formZul = "orderForm.zul";
|
||||
dataFilter = new OrderFilter(getFilterTemplate());
|
||||
}
|
||||
|
||||
public List<AddressEmb> getSuppAddresses()
|
||||
{
|
||||
List<Address> list = adbService.getAll();
|
||||
List<AddressEmb> listEmb = AddressUtils.convertListAddressToListAddressEmb(list);
|
||||
return listEmb;
|
||||
}
|
||||
|
||||
public List<AddressEmb> getDeliveryAddresses()
|
||||
{
|
||||
SettingsData data = settingsService.getSettings();
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Address> list = data.getAllShippingAddrs();
|
||||
List<AddressEmb> listEmb = AddressUtils.convertListAddressToListAddressEmb(list);
|
||||
return listEmb;
|
||||
}
|
||||
|
||||
public AddressEmb getInvoiceAddress()
|
||||
{
|
||||
SettingsData data = settingsService.getSettings();
|
||||
|
||||
if (data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Address addr = data.getMainAddress();
|
||||
AddressEmb addrEmb = AddressUtils.convertAddressToAddressEmb(addr);
|
||||
return addrEmb;
|
||||
}
|
||||
|
||||
public List<User> getUsers()
|
||||
{
|
||||
return userService.getAll();
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ ServiceRequirements=Požadavky na servis
|
||||
ApprovedRequirementItems=Schválené položky požadavků
|
||||
|
||||
CurrentRequirements=Aktuální požadavky
|
||||
ApprovedOrders=Schválené objednávky
|
||||
CreatedOrders=Vytvořené objednávky
|
||||
BussinessTrips=Služební cesty
|
||||
Lists=Seznamy
|
||||
Settings=Nastavení
|
||||
@@ -317,6 +317,7 @@ OrderFormDeliveredDate=Dodáno dne
|
||||
OrderFormInvoiceNumber=Číslo faktury
|
||||
|
||||
HandleComboKeyFilter=#del
|
||||
HandleComboKey=$#del
|
||||
|
||||
WorkgroupFormUserIsCenterMember=Uživatel je členem střediska, jehož je komise členem!
|
||||
WorkgroupFormMemberIsCenterMember=Některý ze členů přidávané komise je členem tohoto střediska!
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
image="/img/hammer-016.png"
|
||||
label="${labels.ApprovedRequirementItems}"
|
||||
href="/main/orders/approved/" />
|
||||
<menuseparator />
|
||||
<menuitem
|
||||
label="${labels.ApprovedOrders}"
|
||||
href="" />
|
||||
image="/img/autotruck-016.png"
|
||||
label="${labels.CreatedOrders}"
|
||||
href="/main/orders/created/" />
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu label="${labels.BussinessTrips}">
|
||||
|
||||
@@ -63,3 +63,7 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.combo {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
<?page title="${labels.CreatedOrders}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<window
|
||||
vflex="1"
|
||||
border="normal"
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.orders.created.OrderList')">
|
||||
<caption
|
||||
image="/img/autotruck-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.CreatedOrders}" />
|
||||
<include src="/app/toolbar.zul" />
|
||||
<listbox
|
||||
vflex="1"
|
||||
selectedItem="@bind(vm.dataBean)"
|
||||
model="@load(vm.dataList)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="czech(numser)"
|
||||
label="${labels.OrderFormNumber}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="auto(orderDate)"
|
||||
label="${labels.OrderFormOrderDate}" />
|
||||
<listheader
|
||||
hflex="7"
|
||||
align="right"
|
||||
sort="auto(total)"
|
||||
label="${labels.OrderFormTotal}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="auto(deliveryDate)"
|
||||
label="${labels.RequirementsFormDeliveryDate}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="auto(deliveredDate))"
|
||||
label="${labels.OrderFormDeliveredDate}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="auto(invoiceNumber)"
|
||||
label="${labels.OrderFormInvoiceNumber}" />
|
||||
<listheader
|
||||
hflex="15"
|
||||
sort="auto(suplier.company)"
|
||||
label="${labels.SuppliersFormTitle}" />
|
||||
<listheader
|
||||
hflex="15"
|
||||
sort="auto(deliveryAddress.company)"
|
||||
label="${labels.DeliveryAddress}" />
|
||||
<listheader
|
||||
hflex="15"
|
||||
sort="auto(address.company)"
|
||||
visible="false"
|
||||
label="${labels.BillingAddress}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="auto(ownedBy.fullName)"
|
||||
label="${labels.Owner}" />
|
||||
<listheader
|
||||
hflex="10"
|
||||
sort="czech(description)"
|
||||
label="${labels.OrderFormDescription}" />
|
||||
</listhead>
|
||||
<auxhead visible="@load(vm.filter)">
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.numser)"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<datebox
|
||||
value="@bind(vm.filterTemplate.orderDate)"
|
||||
format="${labels.DateFormat}"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox"
|
||||
width="100%" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader></auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<datebox
|
||||
value="@bind(vm.filterTemplate.deliveryDate)"
|
||||
format="${labels.DateFormat}"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox"
|
||||
width="100%" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<datebox
|
||||
value="@bind(vm.filterTemplate.deliveredDate)"
|
||||
format="${labels.DateFormat}"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox"
|
||||
width="100%" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.invoiceNumber)"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div zclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<combobox
|
||||
ctrlKeys="${labels.HandleComboKeyFilter}"
|
||||
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
|
||||
onChange="@command('doFilter')"
|
||||
width="100%"
|
||||
selectedItem="@bind(vm.filterTemplate.suplier)"
|
||||
model="@load(vm.suppAddresses)">
|
||||
<template name="model">
|
||||
<comboitem label="@load(each)" />
|
||||
</template>
|
||||
</combobox>
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div zclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<combobox
|
||||
ctrlKeys="${labels.HandleComboKeyFilter}"
|
||||
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
|
||||
onChange="@command('doFilter')"
|
||||
width="100%"
|
||||
selectedItem="@bind(vm.filterTemplate.deliveryAddress)"
|
||||
model="@load(vm.deliveryAddresses)"
|
||||
readonly="true">
|
||||
<template name="model">
|
||||
<comboitem label="@load(each)" />
|
||||
</template>
|
||||
</combobox>
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.address)"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div zclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<combobox
|
||||
ctrlKeys="${labels.HandleComboKeyFilter}"
|
||||
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
|
||||
onChange="@command('doFilter')"
|
||||
width="100%"
|
||||
selectedItem="@bind(vm.filterTemplate.ownedBy)"
|
||||
model="@load(vm.users)"
|
||||
readonly="true">
|
||||
<template name="model">
|
||||
<comboitem label="@load(each.fullName)" />
|
||||
</template>
|
||||
</combobox>
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox
|
||||
value="@bind(vm.filterTemplate.description)"
|
||||
instant="true"
|
||||
onChange="@command('doFilter')"
|
||||
sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
</auxhead>
|
||||
<template name="model">
|
||||
<listitem>
|
||||
<listcell label="@load(each.numser)" />
|
||||
<listcell label="@load(each.orderDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||
<listcell label="@load(each.total) @converter(vm.standardBigDecimalConverter)" />
|
||||
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||
<listcell label="@load(each.deliveredDate) @converter('formatedDate', format=labels.DateFormat)" />
|
||||
<listcell label="@load(each.invoiceNumber)" />
|
||||
<listcell label="@load(each.suplier)" />
|
||||
<listcell label="@load(each.deliveryAddress)" />
|
||||
<listcell label="@load(each.address)" />
|
||||
<listcell label="@load(each.ownedBy.fullName)" />
|
||||
<listcell label="@load(each.description)" />
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</window>
|
||||
</zk>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?page title="${labels.CreatedOrders}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
|
||||
<zscript>
|
||||
String gridZul = "grid.zul";
|
||||
</zscript>
|
||||
|
||||
<include src="/app/template.zhtml"/>
|
||||
|
||||
</zk>
|
||||
@@ -146,9 +146,12 @@
|
||||
<cell sclass="row-title">${labels.SuppliersFormCompany} :</cell>
|
||||
<cell colspan="3">
|
||||
<combobox
|
||||
ctrlKeys="${labels.HandleComboKey}"
|
||||
onCtrlKey="@command('handleComboKey', ctrl=self, keyEvent=event)"
|
||||
onChange="@command('doFillSuppAddress')"
|
||||
width="100%"
|
||||
selectedItem="@bind(vm.selectedSuppAddrItem)"
|
||||
value="@bind(vm.suppCompany)"
|
||||
model="@load(vm.suppAddresses)"
|
||||
readonly="false">
|
||||
<template name="model">
|
||||
@@ -263,9 +266,12 @@
|
||||
<cell sclass="row-title">${labels.SuppliersFormCompany} :</cell>
|
||||
<cell colspan="3">
|
||||
<combobox
|
||||
ctrlKeys="${labels.HandleComboKey}"
|
||||
onCtrlKey="@command('handleComboKey', ctrl=self, keyEvent=event)"
|
||||
onChange="@command('doFillDeliveryAddress')"
|
||||
width="100%"
|
||||
selectedItem="@bind(vm.selectedDeliveryAddrItem)"
|
||||
value="@bind(vm.deliveryCompany)"
|
||||
model="@load(vm.deliveryAddresses)"
|
||||
readonly="false">
|
||||
<template name="model">
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell sclass="row-title">${labels.Description} :</cell>
|
||||
<cell sclass="row-title">${labels.RequirementsFormDescription} :</cell>
|
||||
<cell>
|
||||
<textbox
|
||||
id="description"
|
||||
|
||||
Reference in New Issue
Block a user