parent
02a514ba87
commit
c48fb65949
@ -0,0 +1,7 @@
|
||||
package info.bukova.isspst.dao;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
|
||||
public interface TripBillDao extends BaseDao<TripBill> {
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package info.bukova.isspst.dao.jpa;
|
||||
|
||||
import info.bukova.isspst.dao.TripBillDao;
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
|
||||
public class TripBillDaoJPA extends BaseDaoJPA<TripBill> implements TripBillDao {
|
||||
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
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 = "TRIP_BILL")
|
||||
public class TripBill extends BaseData {
|
||||
|
||||
@OneToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "REQUIREMENT_ID")
|
||||
private TripRequirement requirement;
|
||||
@Column(name = "RESULT_MESSAGE_DATE")
|
||||
private Date resultMessageDate;
|
||||
@Column(name = "SIGN_DATE")
|
||||
private Date signDate;
|
||||
@Column(name = "FREE_MEALS")
|
||||
private boolean freeMeals;
|
||||
@Column(name = "FREE_HOUSING")
|
||||
private boolean freeHousing;
|
||||
@Column(name = "FREE_CAREFARE")
|
||||
private boolean freeCarfare;
|
||||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@LazyCollection(LazyCollectionOption.TRUE)
|
||||
@JoinColumn(name = "TRIP_BILL_ID")
|
||||
private List<TripBillItem> billItems;
|
||||
@Column(name = "ATTACHEMENTS_COUNT")
|
||||
private int attachementsCount;
|
||||
@Column(name = "DOWN_PAYMENT", precision = 15, scale = 4)
|
||||
private BigDecimal downPayment;
|
||||
@Column(name = "TOTAL", precision = 15, scale = 4)
|
||||
private BigDecimal total;
|
||||
|
||||
public TripRequirement getRequirement() {
|
||||
return requirement;
|
||||
}
|
||||
|
||||
public void setRequirement(TripRequirement requirement) {
|
||||
this.requirement = requirement;
|
||||
}
|
||||
|
||||
public Date getResultMessageDate() {
|
||||
return resultMessageDate;
|
||||
}
|
||||
|
||||
public void setResultMessageDate(Date resultMessageDate) {
|
||||
this.resultMessageDate = resultMessageDate;
|
||||
}
|
||||
|
||||
public Date getSignDate() {
|
||||
return signDate;
|
||||
}
|
||||
|
||||
public void setSignDate(Date signDate) {
|
||||
this.signDate = signDate;
|
||||
}
|
||||
|
||||
public boolean isFreeMeals() {
|
||||
return freeMeals;
|
||||
}
|
||||
|
||||
public void setFreeMeals(boolean freeMeals) {
|
||||
this.freeMeals = freeMeals;
|
||||
}
|
||||
|
||||
public boolean isFreeHousing() {
|
||||
return freeHousing;
|
||||
}
|
||||
|
||||
public void setFreeHousing(boolean freeHousing) {
|
||||
this.freeHousing = freeHousing;
|
||||
}
|
||||
|
||||
public boolean isFreeCarfare() {
|
||||
return freeCarfare;
|
||||
}
|
||||
|
||||
public void setFreeCarfare(boolean freeCarfare) {
|
||||
this.freeCarfare = freeCarfare;
|
||||
}
|
||||
|
||||
public List<TripBillItem> getBillItems() {
|
||||
return billItems;
|
||||
}
|
||||
|
||||
public void setBillItems(List<TripBillItem> billItems) {
|
||||
this.billItems = billItems;
|
||||
}
|
||||
|
||||
public BigDecimal getDownPayment() {
|
||||
return downPayment;
|
||||
}
|
||||
|
||||
public void setDownPayment(BigDecimal downPayment) {
|
||||
this.downPayment = downPayment;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(BigDecimal total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
package info.bukova.isspst.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TRIP_BILL_ITEMS")
|
||||
public class TripBillItem extends BaseData {
|
||||
|
||||
@Column(name = "DATE")
|
||||
private Date date;
|
||||
@Column(name = "TARGET")
|
||||
private String to;
|
||||
@Column(name = "BACK")
|
||||
private String back;
|
||||
@Column(name = "DEPARTURE")
|
||||
private Date departure;
|
||||
@Column(name = "ARRIVAL")
|
||||
private Date arrival;
|
||||
@Embedded
|
||||
private Vehicle vehicle;
|
||||
@Column(name = "BEGIN_WORK")
|
||||
private Date beginWork;
|
||||
@Column(name = "END_WORK")
|
||||
private Date endWork;
|
||||
@Column(name = "FREE_MEALS_COUNT")
|
||||
private int freeMealsCount;
|
||||
@Column(name = "DISTANCE", precision = 15, scale = 4)
|
||||
private BigDecimal distance;
|
||||
@Column(name = "FUEL_CONSUMPTION", precision = 15, scale = 4)
|
||||
private BigDecimal fuelConsumption;
|
||||
@Column(name = "CAREFARE", precision = 15, scale = 4)
|
||||
private BigDecimal carefare;
|
||||
@Column(name = "HOUSING", precision = 15, scale = 4)
|
||||
private BigDecimal housing;
|
||||
@Column(name = "MEALS", precision = 15, scale = 4)
|
||||
private BigDecimal meals;
|
||||
@Column(name = "OTHER_EXPENSES", precision = 15, scale = 4)
|
||||
private BigDecimal otherExpenses;
|
||||
@Column(name = "TOTAL", precision = 15, scale = 4)
|
||||
private BigDecimal total;
|
||||
@Column(name = "ADJUSTED_TOTAL", precision = 15, scale = 4)
|
||||
private BigDecimal adjustedTotal;
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public String getBack() {
|
||||
return back;
|
||||
}
|
||||
|
||||
public void setBack(String back) {
|
||||
this.back = back;
|
||||
}
|
||||
|
||||
public Date getDeparture() {
|
||||
return departure;
|
||||
}
|
||||
|
||||
public void setDeparture(Date departure) {
|
||||
this.departure = departure;
|
||||
}
|
||||
|
||||
public Date getArrival() {
|
||||
return arrival;
|
||||
}
|
||||
|
||||
public void setArrival(Date arrival) {
|
||||
this.arrival = arrival;
|
||||
}
|
||||
|
||||
public Vehicle getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(Vehicle vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
public Date getBeginWork() {
|
||||
return beginWork;
|
||||
}
|
||||
|
||||
public void setBeginWork(Date beginWork) {
|
||||
this.beginWork = beginWork;
|
||||
}
|
||||
|
||||
public Date getEndWork() {
|
||||
return endWork;
|
||||
}
|
||||
|
||||
public void setEndWork(Date endWork) {
|
||||
this.endWork = endWork;
|
||||
}
|
||||
|
||||
public int getFreeMealsCount() {
|
||||
return freeMealsCount;
|
||||
}
|
||||
|
||||
public void setFreeMealsCount(int freeMealsCount) {
|
||||
this.freeMealsCount = freeMealsCount;
|
||||
}
|
||||
|
||||
public BigDecimal getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(BigDecimal distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public BigDecimal getFuelConsumption() {
|
||||
return fuelConsumption;
|
||||
}
|
||||
|
||||
public void setFuelConsumption(BigDecimal fuelConsumption) {
|
||||
this.fuelConsumption = fuelConsumption;
|
||||
}
|
||||
|
||||
public BigDecimal getCarefare() {
|
||||
return carefare;
|
||||
}
|
||||
|
||||
public void setCarefare(BigDecimal carefare) {
|
||||
this.carefare = carefare;
|
||||
}
|
||||
|
||||
public BigDecimal getHousing() {
|
||||
return housing;
|
||||
}
|
||||
|
||||
public void setHousing(BigDecimal housing) {
|
||||
this.housing = housing;
|
||||
}
|
||||
|
||||
public BigDecimal getMeals() {
|
||||
return meals;
|
||||
}
|
||||
|
||||
public void setMeals(BigDecimal meals) {
|
||||
this.meals = meals;
|
||||
}
|
||||
|
||||
public BigDecimal getOtherExpenses() {
|
||||
return otherExpenses;
|
||||
}
|
||||
|
||||
public void setOtherExpenses(BigDecimal otherExpenses) {
|
||||
this.otherExpenses = otherExpenses;
|
||||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(BigDecimal total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public BigDecimal getAdjustedTotal() {
|
||||
return adjustedTotal;
|
||||
}
|
||||
|
||||
public void setAdjustedTotal(BigDecimal adjustedTotal) {
|
||||
this.adjustedTotal = adjustedTotal;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package info.bukova.isspst.services.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
public interface TripBillService extends Service<TripBill> {
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package info.bukova.isspst.services.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
import info.bukova.isspst.services.AbstractOwnedService;
|
||||
|
||||
public class TripBillServiceImpl extends AbstractOwnedService<TripBill> implements
|
||||
TripBillService {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
import info.bukova.isspst.ui.FormViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
|
||||
public class TripBillForm extends FormViewModel<TripBill> {
|
||||
|
||||
@Init(superclass = true)
|
||||
public void init() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package info.bukova.isspst.ui.tripbill;
|
||||
|
||||
import info.bukova.isspst.data.TripBill;
|
||||
import info.bukova.isspst.services.tripbill.TripBillService;
|
||||
import info.bukova.isspst.ui.ListViewModel;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
import org.zkoss.zk.ui.select.annotation.WireVariable;
|
||||
|
||||
public class TripBillList extends ListViewModel<TripBill> {
|
||||
|
||||
@WireVariable
|
||||
private TripBillService tripBillService;
|
||||
|
||||
@Init
|
||||
public void init() {
|
||||
service = tripBillService;
|
||||
dataClass = TripBill.class;
|
||||
formZul = "tripBillForm.zul";
|
||||
//dataFilter = new MUnitFilter(getFilterTemplate());
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?page title="${labels.TravelOrders}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
|
||||
<zscript>
|
||||
String gridZul = "tripBillGrid.zul";
|
||||
</zscript>
|
||||
|
||||
<include src="/app/template.zhtml"/>
|
||||
|
||||
</zk>
|
@ -0,0 +1,19 @@
|
||||
<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<window
|
||||
id="editWin"
|
||||
closable="true"
|
||||
border="normal"
|
||||
position="center"
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.tripbill.TripBillForm')">
|
||||
<caption
|
||||
src="/img/pickup-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.TravelOrdersFormTitle}" />
|
||||
<vlayout>
|
||||
|
||||
<include src="/app/formButtons.zul" />
|
||||
</vlayout>
|
||||
</window>
|
||||
</zk>
|
@ -0,0 +1,83 @@
|
||||
<?page title="${labels.TravelOrders}" 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.tripbill.TripBillList')">
|
||||
<caption
|
||||
src="/img/pickup-032.png"
|
||||
zclass="form-caption"
|
||||
label="${labels.TravelOrders}" />
|
||||
<include src="/requirements/toolbar.zul" />
|
||||
<listbox
|
||||
vflex="1"
|
||||
model="@load(vm.dataList)"
|
||||
selectedItem="@bind(vm.dataBean)">
|
||||
<listhead menupopup="auto">
|
||||
<listheader
|
||||
label="${labels.TravelOrdersGridNumser}"
|
||||
sort="czech(name)"
|
||||
width="30%" />
|
||||
<listheader
|
||||
label="${labels.TravelOrdersGridReqDate}"
|
||||
sort="czech(description)"
|
||||
width="70%" />
|
||||
<listheader
|
||||
label="${labels.TravelOrdersGridFrom}"
|
||||
sort="czech(description)"
|
||||
width="70%" />
|
||||
<listheader
|
||||
label="${labels.TravelOrdersGridTo}"
|
||||
sort="czech(description)"
|
||||
width="70%" />
|
||||
<listheader
|
||||
label="${labels.TravelOrdersGridTotal}"
|
||||
sort="czech(description)"
|
||||
width="70%" />
|
||||
</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.reqDate)" />
|
||||
<listcell label="@load(each.requirement.from)" />
|
||||
<listcell label="@load(each.requirement.to)" />
|
||||
<listcell label="@load(each.total)"/>
|
||||
</listitem>
|
||||
</template>
|
||||
</listbox>
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue