Kostra agendy "Cestovní příkazy" - vyúčtování služebních cest.
refs #112
This commit is contained in:
@@ -13,6 +13,7 @@ import info.bukova.isspst.services.reqsubjects.MaterialService;
|
||||
import info.bukova.isspst.services.reqsubjects.ServiceItemService;
|
||||
import info.bukova.isspst.services.requirement.RequirementBaseService;
|
||||
import info.bukova.isspst.services.requirement.RequirementTypeService;
|
||||
import info.bukova.isspst.services.tripbill.TripBillService;
|
||||
import info.bukova.isspst.services.users.RoleService;
|
||||
import info.bukova.isspst.services.users.UserService;
|
||||
import info.bukova.isspst.services.workgroups.WorkgroupService;
|
||||
@@ -63,6 +64,7 @@ public class Constants {
|
||||
public final static String MOD_WORKGROUPS = "WORKGROUPS";
|
||||
public final static String MOD_REQUIREMENTS = "REQUIREMENTS";
|
||||
public final static String MOD_WORKFLOW = "WORKFLOW";
|
||||
public final static String MOD_TRIPBILL = "TRIPBILL";
|
||||
public final static Module MODULES[] = {
|
||||
new Module(MOD_USERS, "Uživatelé", UserService.class),
|
||||
new Module(MOD_PERMISSIONS, "Práva", RoleService.class),
|
||||
@@ -73,7 +75,8 @@ public class Constants {
|
||||
new Module(MOD_SERVICES, "Služby", ServiceItemService.class),
|
||||
new Module(MOD_WORKGROUPS, "Pracovní skupiny", WorkgroupService.class),
|
||||
new Module(MOD_REQUIREMENTS, "Požadavky", RequirementBaseService.class),
|
||||
new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class)
|
||||
new Module(MOD_WORKFLOW, "Procesy schválení", RequirementTypeService.class),
|
||||
new Module(MOD_TRIPBILL, "Cestovní příkazy", TripBillService.class)
|
||||
};
|
||||
|
||||
public final static String PERM_APPROVE = "PERM_APPROVE";
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user