Přidána agenda pro zadávání fakturace k požadavkům. Chybí filtrování.

refs #164
Verze_1.0
Josef Rokos 10 years ago
parent f1ca2d11c8
commit b2d141e52b

@ -7,10 +7,11 @@ import info.bukova.isspst.data.Role;
import info.bukova.isspst.reporting.Report;
import info.bukova.isspst.reporting.ReportMapping;
import info.bukova.isspst.services.addressbook.AdbService;
import info.bukova.isspst.services.approved.ApprovedService;
import info.bukova.isspst.services.approved.OrderService;
import info.bukova.isspst.services.buildings.BuildingService;
import info.bukova.isspst.services.invoicing.InvoicingService;
import info.bukova.isspst.services.munits.MUnitService;
import info.bukova.isspst.services.orders.ApprovedService;
import info.bukova.isspst.services.orders.OrderService;
import info.bukova.isspst.services.reqsubjects.MaterialService;
import info.bukova.isspst.services.reqsubjects.ServiceItemService;
import info.bukova.isspst.services.requirement.RequirementService;
@ -71,6 +72,7 @@ public class Constants {
public final static String MOD_TRIPBILL = "TRIPBILL";
public final static String MOD_APPROVED = "APPROVED";
public final static String MOD_ORDER = "ORDER";
public final static String MOD_INVOICING = "INVOICING";
public final static Module MODULES[] = {
new Module(MOD_USERS, "Uživatelé", UserService.class),
new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
@ -85,7 +87,8 @@ public class Constants {
new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class),
new Module(MOD_TRIPBILL, "Cestovní příkazy", TripBillService.class),
new Module(MOD_APPROVED, "Schválené položky požadavků", ApprovedService.class),
new Module(MOD_ORDER, "Objednávky", OrderService.class) };
new Module(MOD_ORDER, "Objednávky", OrderService.class),
new Module(MOD_INVOICING, "Fakturace požadavků", InvoicingService.class) };
public final static String PERM_APPROVE = "PERM_APPROVE";
public final static String PERM_SHOW_WORKGROUP_REQ = "PERM_SHOW_WORKGROUP_REQ";

@ -0,0 +1,7 @@
package info.bukova.isspst.dao;
import info.bukova.isspst.data.Invoicing;
public interface InvoicingDao extends BaseDao<Invoicing> {
}

@ -0,0 +1,9 @@
package info.bukova.isspst.dao.jpa;
import info.bukova.isspst.dao.InvoicingDao;
import info.bukova.isspst.data.Invoicing;
public class InvoicingDaoJPA extends BaseDaoJPA<Invoicing> implements InvoicingDao {
}

@ -0,0 +1,58 @@
package info.bukova.isspst.data;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
@Entity
@Table(name = "INVOICING")
public class Invoicing extends BaseData {
@OneToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "REQUIREMENT_ID")
private Requirement requirement;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@LazyCollection(LazyCollectionOption.TRUE)
@JoinColumn(name = "INVOICING_ID")
private List<InvoicingItem> items;
@Column(name = "TOTAL_INVOICED", precision = 15, scale = 4)
private BigDecimal totalInvoiced;
public Requirement getRequirement() {
return requirement;
}
public void setRequirement(Requirement requirement) {
this.requirement = requirement;
}
public List<InvoicingItem> getItems() {
return items;
}
public void setItems(List<InvoicingItem> items) {
this.items = items;
}
public BigDecimal getTotalInvoiced() {
return totalInvoiced;
}
public void setTotalInvoiced(BigDecimal totalInvoiced) {
this.totalInvoiced = totalInvoiced;
}
}

@ -0,0 +1,87 @@
package info.bukova.isspst.data;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "INVOICING_ITEM")
public class InvoicingItem {
@Id
@Column(name = "ID")
@GeneratedValue
private int id;
@Column(name = "INVOICE_DATE")
private Date invoiceDate;
@Column(name = "INVOICE_NUMBER")
private String invoiceNumber;
@Column(name = "AMOUNT", precision = 15, scale = 4)
private BigDecimal amount;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public String getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(String invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
@Override
public boolean equals(Object obj)
{
if (obj != null)
{
if (obj instanceof InvoicingItem)
{
InvoicingItem item = (InvoicingItem)obj;
int thisId = this.getId();
int itemId = item.getId();
boolean equalsId = (thisId == itemId);
if (equalsId && (thisId == 0))
{
return super.equals(obj);
}
return equalsId;
}
}
return false;
}
}

@ -0,0 +1,19 @@
package info.bukova.isspst.services.invoicing;
import java.math.BigDecimal;
import info.bukova.isspst.data.Invoicing;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.Service;
public interface InvoicingService extends Service<Invoicing> {
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup);
public void loadReqItems(Invoicing invoicing);
public void loadItems(Invoicing invoicing);
public void calculate(Invoicing invoicing);
}

@ -0,0 +1,52 @@
package info.bukova.isspst.services.invoicing;
import info.bukova.isspst.data.Invoicing;
import info.bukova.isspst.data.InvoicingItem;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.AbstractOwnedService;
import info.bukova.isspst.services.LazyLoader;
import java.math.BigDecimal;
import org.hibernate.Hibernate;
import org.springframework.transaction.annotation.Transactional;
public class InvoicingServiceImpl extends AbstractOwnedService<Invoicing> implements
InvoicingService {
@Override
public BigDecimal totalInvoicedForWorkgroup(Workgroup workgroup) {
// TODO Auto-generated method stub
return null;
}
@Override
@Transactional
@LazyLoader("form")
public void loadReqItems(Invoicing invoicing) {
Invoicing inv = getById(invoicing.getId());
Hibernate.initialize(inv.getRequirement().getItems());
invoicing.getRequirement().setItems(inv.getRequirement().getItems());
}
@Override
@Transactional
@LazyLoader({"form", "grid"})
public void loadItems(Invoicing invoicing) {
Invoicing inv = getById(invoicing.getId());
Hibernate.initialize(inv.getItems());
invoicing.setItems(inv.getItems());
}
@Override
public void calculate(Invoicing invoicing) {
BigDecimal total = BigDecimal.ZERO;
for (InvoicingItem item : invoicing.getItems()) {
total = total.add(item.getAmount());
}
invoicing.setTotalInvoiced(total);
}
}

@ -1,4 +1,4 @@
package info.bukova.isspst.services.approved;
package info.bukova.isspst.services.orders;
import info.bukova.isspst.data.JoinedItem;
import info.bukova.isspst.services.Service;

@ -1,4 +1,4 @@
package info.bukova.isspst.services.approved;
package info.bukova.isspst.services.orders;
import info.bukova.isspst.data.JoinedItem;
import info.bukova.isspst.data.RequirementItem;

@ -1,4 +1,4 @@
package info.bukova.isspst.services.approved;
package info.bukova.isspst.services.orders;
import info.bukova.isspst.data.JoinedItem;
import info.bukova.isspst.data.Order;

@ -1,4 +1,4 @@
package info.bukova.isspst.services.approved;
package info.bukova.isspst.services.orders;
import info.bukova.isspst.dao.RequirementItemDao;
import info.bukova.isspst.data.AddressEmb;

@ -6,6 +6,14 @@ import info.bukova.isspst.services.Service;
import java.util.List;
/**
* @author Pepa Rokos
* @author Franta Přibyl
*
* Základní rozhraní všech požadavků.
*
* @param <T> Třída požadavku.
*/
public interface RequirementBaseService<T extends RequirementBase> extends Service<T>
{

@ -30,6 +30,14 @@ import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
/**
* @author Pepa Rokos
* @author Franta Přibyl
*
* Abstraktní bázová třída všech požadavků
*
* @param <T> Třída požadavku
*/
public abstract class RequirementBaseServiceImpl<T extends RequirementBase> extends
AbstractOwnedService<T> implements RequirementBaseService<T> {
@ -249,6 +257,8 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
}
}
}
postApprove(e);
}
@Override
@ -258,10 +268,25 @@ public abstract class RequirementBaseServiceImpl<T extends RequirementBase> exte
approve(entity, getLoggedInUser());
}
/**
* Volá se z metody approve pro automatické schválení dalším schvalovatelem v pořadí. Metoda z báze nedělá nic.
*
* @param entity Požadavek
* @return true pokud se provedlo automatické schválení.
*/
protected boolean autoApprove(T entity) {
return false;
}
/**
* Činnost prováděná po schválení požadavku (i dílčím schválení).
*
* @param entity Požadavek
*/
protected void postApprove(T entity) {
}
@Override
@Transactional
public boolean canApprove(T entity) {

@ -6,6 +6,13 @@ import info.bukova.isspst.data.RequirementItem;
import java.math.BigDecimal;
import java.util.List;
/**
* @author Pepa Rokos
* @author Franta Přibyl
*
* Základní rozhraní požadavků na služby a materiál.
*
*/
public interface RequirementService extends RequirementBaseService<Requirement>
{
public void loadGroups(Requirement req);

@ -1,6 +1,7 @@
package info.bukova.isspst.services.requirement;
import info.bukova.isspst.Constants;
import info.bukova.isspst.data.Invoicing;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementState;
@ -8,7 +9,7 @@ import info.bukova.isspst.data.RequirementSubject;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workflow;
import info.bukova.isspst.services.LazyLoader;
import info.bukova.isspst.services.approved.OrderService;
import info.bukova.isspst.services.invoicing.InvoicingService;
import java.math.BigDecimal;
import java.util.Date;
@ -18,13 +19,20 @@ import org.hibernate.Hibernate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
/**
* @author Pepa Rokos
* @author Franta Přibyl
*
* Bázová třída požadavků na materiál a služby.
*
*/
public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requirement> implements RequirementService, RequirementBaseService<Requirement>
{
@Autowired
private RequirementTypeService reqTypeService;
@Autowired
private OrderService orderService;
private InvoicingService invoicingService;
@Override
protected Requirement createEntity()
@ -64,7 +72,7 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
if (entity.getWorkgroup() != null && entity.getWorkgroup().getLimit() != null && entity.getWorkgroup().getLimit().compareTo(BigDecimal.ZERO) != 0)
{
BigDecimal total = orderService.totalOrderedForWorkgroup(entity.getWorkgroup());
BigDecimal total = null;//orderService.totalOrderedForWorkgroup(entity.getWorkgroup());
if (total == null)
{
@ -222,4 +230,13 @@ public class RequirementServiceImpl extends RequirementBaseServiceImpl<Requireme
return sumTotal;
}
@Override
protected void postApprove(Requirement entity) {
if (entity.getState() == RequirementState.APPROVED) {
Invoicing inv = new Invoicing();
inv.setRequirement(entity);
invoicingService.add(inv);
}
}
}

@ -13,7 +13,6 @@ import java.util.Date;
import org.hibernate.LazyInitializationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripRequirement>
@ -54,11 +53,7 @@ public class TripRequirementServiceImpl extends RequirementBaseServiceImpl<TripR
}
@Override
@Transactional
@PreAuthorize("this.canApprove(#entity)")
public void approve(TripRequirement entity) {
super.approve(entity);
protected void postApprove(TripRequirement entity) {
if (entity.getState() == RequirementState.APPROVED) {
TripBill bill = tripBillService.createTripBill(entity);
tripBillService.add(bill);

@ -380,4 +380,9 @@ public class ListViewModel<T extends DataModel> extends DocumentViewModel
{
return this.isRecordSelected();
}
public boolean isAbleToAdd()
{
return true;
}
}

@ -3,7 +3,7 @@ package info.bukova.isspst.ui.dashboard;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.approved.OrderService;
import info.bukova.isspst.services.orders.OrderService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.DocumentViewModel;

@ -5,8 +5,8 @@ import info.bukova.isspst.data.Order;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.JoinedItemFilter;
import info.bukova.isspst.services.approved.ApprovedService;
import info.bukova.isspst.services.approved.OrderService;
import info.bukova.isspst.services.orders.ApprovedService;
import info.bukova.isspst.services.orders.OrderService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.BigDecimalConverter;

@ -0,0 +1,79 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import info.bukova.isspst.data.InvoicingItem;
import info.bukova.isspst.services.invoicing.InvoicingService;
import info.bukova.isspst.ui.FormViewModel;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class InvoicingForm extends FormViewModel<Invoicing> {
private InvoicingItem selectedItem;
private int selectedIndex;
@WireVariable
private InvoicingService invoicingService;
@Init(superclass = true)
public void init() {
}
private void selectItem(InvoicingItem item) {
if (item != null) {
selectedItem = item;
selectedIndex = getDataBean().getItems().indexOf(item);
} else {
selectedItem = null;
selectedIndex = -1;
}
}
@Command
@NotifyChange({"dataBean", "selectedItem", "selectedIndex"})
public void addItem() {
InvoicingItem item = new InvoicingItem();
getDataBean().getItems().add(item);
selectItem(item);
}
@Command
@NotifyChange({"dataBean", "selectedItem", "selectedIndex"})
public void removeItem(@BindingParam("item") InvoicingItem item) {
getDataBean().getItems().remove(item);
selectItem(null);
}
@Command
@NotifyChange({"selectedItem", "selectedIndex"})
public void onFocus(@BindingParam("item") InvoicingItem item) {
selectItem(item);
}
@Command
@NotifyChange("dataBean")
public void calculate() {
invoicingService.calculate(getDataBean());
}
public InvoicingItem getSelectedItem() {
return selectedItem;
}
public void setSelectedItem(InvoicingItem selectedItem) {
this.selectedItem = selectedItem;
}
public int getSelectedIndex() {
return selectedIndex;
}
public void setSelectedIndex(int selectedIndex) {
this.selectedIndex = selectedIndex;
}
}

@ -0,0 +1,33 @@
package info.bukova.isspst.ui.main.invoicing;
import info.bukova.isspst.data.Invoicing;
import info.bukova.isspst.services.invoicing.InvoicingService;
import info.bukova.isspst.ui.ListViewModel;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class InvoicingList extends ListViewModel<Invoicing> {
@WireVariable
private InvoicingService invoicingService;
@Init(superclass = true)
public void initInvoicing() {
service = invoicingService;
dataClass = Invoicing.class;
formZul = "invoicingForm.zul";
//dataFilter = new BuildingFilter(getFilterTemplate());
}
@Override
public boolean isAbleToAdd() {
return false;
}
@Override
public boolean isAbleToDelete() {
return false;
}
}

@ -5,7 +5,7 @@ import info.bukova.isspst.data.AddressEmb;
import info.bukova.isspst.data.Order;
import info.bukova.isspst.data.OrderItem;
import info.bukova.isspst.services.addressbook.AdbService;
import info.bukova.isspst.services.approved.OrderService;
import info.bukova.isspst.services.orders.OrderService;
import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.ui.FormViewModel;
import info.bukova.isspst.validators.OrderFormValidator;

@ -9,7 +9,7 @@ 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.orders.OrderService;
import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.ListViewModel;

@ -30,5 +30,7 @@
<mapping class="info.bukova.isspst.data.TripBillItem"></mapping>
<mapping class="info.bukova.isspst.data.Order"></mapping>
<mapping class="info.bukova.isspst.data.OrderItem"></mapping>
<mapping class="info.bukova.isspst.data.Invoicing"></mapping>
<mapping class="info.bukova.isspst.data.InvoicingItem"></mapping>
</session-factory>
</hibernate-configuration>

@ -330,6 +330,17 @@ OrderFormInvoiceNumber=Číslo faktury
OrderFormInvoiceTotal=Částka faktury
OrderPrintPrices=Tisknout ceny
Invoicing=Fakturace požadavků
InvoicingRequirementNumber=Číslo požadavku
InvoicingRequirementPrice=Cena požadavku
InvoicingInvoicedPrice=Vyfakturovaná cena
InvoicingFormTitle=Zadání fakturace
InvoicingAdd=Přidat fakturaci
InvoicingDate=Datum
InvoicingInvoiceNumber=Číslo faktury
InvoicingAmount=Částka
InvoicingDescription=Popis
HandleComboKeyFilter=#del
HandleComboKey=$#del

@ -251,6 +251,10 @@
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="invoicingDao" class="info.bukova.isspst.dao.jpa.InvoicingDaoJPA">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- Business logic -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
@ -317,7 +321,7 @@
<property name="xmlContext" ref="xmlCtxAres" />
</bean>
<bean id="approvedService" class="info.bukova.isspst.services.approved.ApprovedServiceImpl"/>
<bean id="approvedService" class="info.bukova.isspst.services.orders.ApprovedServiceImpl"/>
<bean id="permissionService" class="info.bukova.isspst.services.users.PermissionServiceImpl">
<property name="dao" ref="permissionDao"/>
@ -408,10 +412,15 @@
<property name="validator" ref="validator"/>
</bean>
<bean id="orderService" class="info.bukova.isspst.services.approved.OrderServiceImpl">
<bean id="orderService" class="info.bukova.isspst.services.orders.OrderServiceImpl">
<property name="dao" ref="orderDao"/>
<property name="validator" ref="validator"/>
<property name="numberSeriesService" ref="numericSeriesService"/>
</bean>
<bean id="invoicingService" class="info.bukova.isspst.services.invoicing.InvoicingServiceImpl">
<property name="dao" ref="invoicingDao"/>
<property name="validator" ref="validator"/>
</bean>
</beans>

@ -9,7 +9,7 @@
autodrop="true">
<menuitem
label="${labels.Information}"
href="/" />
href="/app/" />
<menuseparator />
<menu label="${labels.Orders}">
<menupopup>
@ -34,6 +34,12 @@
label="${labels.CreatedOrders}"
href="/main/orders/created/"
disabled="${not sec:isAllGranted('PERM_READ_ORDER')}" />
<menuseparator/>
<menuitem
image="/img/invoicing-016.png"
label="${labels.Invoicing}"
href="/main/invoicing/"
disabled="${not sec:isAllGranted('PERM_READ_INVOICING')}" />
</menupopup>
</menu>
<menu label="${labels.BussinessTrips}">

@ -1,7 +1,7 @@
<?page title="toolbar" contentType="text/html;charset=UTF-8"?>
<zk>
<toolbar>
<toolbarbutton image="/img/add.png" tooltiptext="${labels.ToolbarRecNew}" id="btnNew" onClick="@command('addNew')" disabled="@load(vm.filter)" />
<toolbarbutton image="/img/add.png" tooltiptext="${labels.ToolbarRecNew}" id="btnNew" onClick="@command('addNew')" disabled="@load(vm.filter or not vm.ableToAdd)" />
<toolbarbutton image="/img/edit.png" tooltiptext="${labels.ToolbarRecEdit}" id="btnEdit" onClick="@command('edit')" disabled="@load(empty vm.dataBean ? 'true' : 'false')"/>
<toolbarbutton image="/img/delete.png" tooltiptext="${labels.ToolbarRecDelete}" id="btnDelete" onClick="@command('delete')" disabled="@load(not vm.ableToDelete)" />
<toolbarbutton image="/img/funnel.png" tooltiptext="${labels.ToolbarRecFilter}" id="btnFilter" onClick="@command('filter')" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,10 @@
<?page title="${labels.Invoicing}" contentType="text/html;charset=UTF-8"?>
<zk>
<zscript>
String gridZul = "invoicingGrid.zul";
</zscript>
<include src="/app/template.zhtml"/>
</zk>

@ -0,0 +1,191 @@
<?page title="${labels.Invoicing}" contentType="text/html;charset=UTF-8"?>
<zk>
<window
id="editWin"
closable="true"
width="95%"
height="95%"
border="normal"
position="center"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.main.invoicing.InvoicingForm')">
<caption
src="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.InvoicingFormTitle}" />
<vlayout vflex="1">
<hbox>
<vbox height="300px">
<button
image="/img/item-add.png"
label="${labels.InvoicingAdd}"
sclass="nicebutton"
onClick="@command('addItem')"/>
<listbox
model="@load(vm.dataBean.items)"
vflex="1"
selectedItem="@bind(vm.selectedItem)"
selectedIndex="@bind(vm.selectedIndex)">
<listhead>
<listheader
label="${labels.InvoicingDate}"
width="150px"/>
<listheader label="${labels.InvoicingInvoiceNumber}" />
<listheader
label="${labels.InvoicingAmount}"
align="right"
width="90px"/>
<listheader/>
</listhead>
<template name="model">
<listitem>
<listcell>
<datebox
value="@bind(each.invoiceDate)"
inplace="true"
onFocus="@command('onFocus', item=each)"/>
</listcell>
<listcell>
<textbox
value="@bind(each.invoiceNumber)"
sclass="grid-textbox-max"
inplace="true"
onFocus="@command('onFocus', item=each)"/>
</listcell>
<listcell>
<textbox
value="@bind(each.amount) @converter(vm.standardBigDecimalConverter)"
sclass="grid-textbox-max"
inplace="true"
onFocus="@command('onFocus', item=each)"
onChange="@command('calculate')"/>
</listcell>
<listcell>
<button label="${labels.RemoveItem}" sclass="nicebutton" onClick="@command('removeItem', item=each)"/>
</listcell>
</listitem>
</template>
</listbox>
</vbox>
<grid hflex="min">
<columns>
<column
align="right"
hflex="min" />
<column />
</columns>
<rows>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementNumber} :</cell>
<cell>
<textbox
width="200px"
value="@bind(vm.dataBean.requirement.numser)"
style="font-weight: bold;"
readonly="true"/>
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingDescription} :</cell>
<cell>
<textbox
width="350px"
rows="5"
value="@bind(vm.dataBean.requirement.description)"
readonly="true" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingRequirementPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.requirement.sumTotal) @converter(vm.standardBigDecimalConverter)"
readonly="true"/>
</cell>
</row>
<row>
<cell sclass="row-title">${labels.InvoicingInvoicedPrice} :</cell>
<cell>
<textbox
width="150px"
value="@bind(vm.dataBean.totalInvoiced) @converter(vm.standardBigDecimalConverter)"
readonly="true"/>
</cell>
</row>
</rows>
</grid>
</hbox>
<listbox
vflex="1"
model="@load(vm.dataBean.requirement.items)">
<listhead>
<listheader
hflex="10"
label="${labels.RequirementItemCode}" />
<listheader
hflex="15"
label="${labels.RequirementItemName}" />
<listheader
hflex="30"
label="${labels.RequirementItemText}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemQuantity}" />
<listheader
hflex="10"
label="${labels.RequirementItemMUnit}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemUnitPrice}" />
<listheader
hflex="10"
align="right"
label="${labels.RequirementItemTotal}" />
<listheader
hflex="15"
label="${labels.RequirementItemDescription}" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="@load(each.code)"/>
</listcell>
<listcell>
<label value="@load(each.name)" />
</listcell>
<listcell>
<label value="@load(each.textItem)" />
</listcell>
<listcell>
<label value="@bind(each.quantity) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<label value="@bind(each.munit.name)" />
</listcell>
<listcell>
<label value="@bind(each.unitPrice) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<label value="@bind(each.total) @converter(vm.standardBigDecimalConverter)" />
</listcell>
<listcell>
<label value="@bind(each.description)" />
</listcell>
</listitem>
</template>
</listbox>
<include src="/app/formButtons.zul" />
</vlayout>
</window>
</zk>

@ -0,0 +1,76 @@
<?page title="${labels.Invoicing}" 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.invoicing.InvoicingList')">
<caption
src="/img/invoicing-032.png"
zclass="form-caption"
label="${labels.Invoicing}" />
<include src="/app/toolbar.zul" />
<listbox
vflex="1"
model="@load(vm.dataList)"
selectedItem="@bind(vm.dataBean)">
<listhead menupopup="auto">
<listheader
label="${labels.InvoicingRequirementNumber}"
width="130px" />
<listheader
label="Popis"
width=""/>
<listheader
label="${labels.InvoicingRequirementPrice}"
align="right"
width="130px" />
<listheader
label="${labels.InvoicingInvoicedPrice}"
align="right"
width="130px" />
</listhead>
<!-- auxhead
sclass="category-center"
visible="@load(vm.filter)">
<auxheader>
<div sclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<textbox
value="@bind(vm.filterTemplate.name)"
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">
<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.requirement.numser)" />
<listcell label="@load(each.requirement.description)" />
<listcell label="@load(each.requirement.sumTotal) @converter(vm.standardBigDecimalConverter)" />
<listcell label="@load(each.totalInvoiced) @converter(vm.standardBigDecimalConverter)" />
</listitem>
</template>
</listbox>
</window>
</zk>
Loading…
Cancel
Save