diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index 2b27db4b..a7332c47 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -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"; diff --git a/src/main/java/info/bukova/isspst/dao/TripBillDao.java b/src/main/java/info/bukova/isspst/dao/TripBillDao.java new file mode 100644 index 00000000..42749c0f --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/TripBillDao.java @@ -0,0 +1,7 @@ +package info.bukova.isspst.dao; + +import info.bukova.isspst.data.TripBill; + +public interface TripBillDao extends BaseDao { + +} diff --git a/src/main/java/info/bukova/isspst/dao/jpa/TripBillDaoJPA.java b/src/main/java/info/bukova/isspst/dao/jpa/TripBillDaoJPA.java new file mode 100644 index 00000000..38e75dae --- /dev/null +++ b/src/main/java/info/bukova/isspst/dao/jpa/TripBillDaoJPA.java @@ -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 implements TripBillDao { + +} diff --git a/src/main/java/info/bukova/isspst/data/TripBill.java b/src/main/java/info/bukova/isspst/data/TripBill.java new file mode 100644 index 00000000..a8bdee81 --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/TripBill.java @@ -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 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 getBillItems() { + return billItems; + } + + public void setBillItems(List 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; + } + +} diff --git a/src/main/java/info/bukova/isspst/data/TripBillItem.java b/src/main/java/info/bukova/isspst/data/TripBillItem.java new file mode 100644 index 00000000..4f1ff517 --- /dev/null +++ b/src/main/java/info/bukova/isspst/data/TripBillItem.java @@ -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; + } + +} diff --git a/src/main/java/info/bukova/isspst/services/tripbill/TripBillService.java b/src/main/java/info/bukova/isspst/services/tripbill/TripBillService.java new file mode 100644 index 00000000..47deb58d --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/tripbill/TripBillService.java @@ -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 { + +} diff --git a/src/main/java/info/bukova/isspst/services/tripbill/TripBillServiceImpl.java b/src/main/java/info/bukova/isspst/services/tripbill/TripBillServiceImpl.java new file mode 100644 index 00000000..d5d0192f --- /dev/null +++ b/src/main/java/info/bukova/isspst/services/tripbill/TripBillServiceImpl.java @@ -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 implements + TripBillService { + +} diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillForm.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillForm.java new file mode 100644 index 00000000..4f31634e --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillForm.java @@ -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 { + + @Init(superclass = true) + public void init() { + + } +} diff --git a/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java new file mode 100644 index 00000000..c7c3c477 --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/tripbill/TripBillList.java @@ -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 { + + @WireVariable + private TripBillService tripBillService; + + @Init + public void init() { + service = tripBillService; + dataClass = TripBill.class; + formZul = "tripBillForm.zul"; + //dataFilter = new MUnitFilter(getFilterTemplate()); + } +} diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml index 32f448a8..6a0fbfc8 100644 --- a/src/main/resources/hibernate.cfg.xml +++ b/src/main/resources/hibernate.cfg.xml @@ -26,5 +26,7 @@ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 1718161c..f2d83d55 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -161,6 +161,13 @@ GlobalSettingsRefunds=Náhrady GlobalSettingsFreeMealsCount=Počet jídel zdarma GlobalSettingsHours=Hodin +TravelOrdersFormTitle=Vyúčtování služební cesty +TravelOrdersGridNumser=Číslo +TravelOrdersGridReqDate=Datum požadavku +TravelOrdersGridFrom=Z +TravelOrdersGridTo=Do +TravelOrdersGridTotal=Celkem + CentresForRequirements=Střediska, pro která lze vkládat požadavky WorkgroupMembership=Členství v komisích LogedInUser=Přihlášený uživatel: diff --git a/src/main/webapp/WEB-INF/spring/root-context.xml b/src/main/webapp/WEB-INF/spring/root-context.xml index 651df02b..62af5814 100644 --- a/src/main/webapp/WEB-INF/spring/root-context.xml +++ b/src/main/webapp/WEB-INF/spring/root-context.xml @@ -176,6 +176,10 @@ + + + + @@ -296,4 +300,9 @@ + + + + + diff --git a/src/main/webapp/app/mainMenu.zul b/src/main/webapp/app/mainMenu.zul index f131a68c..11893cf6 100644 --- a/src/main/webapp/app/mainMenu.zul +++ b/src/main/webapp/app/mainMenu.zul @@ -31,7 +31,7 @@ + href="/trips/bill" /> diff --git a/src/main/webapp/trips/bill/index.zul b/src/main/webapp/trips/bill/index.zul new file mode 100644 index 00000000..7f9da3db --- /dev/null +++ b/src/main/webapp/trips/bill/index.zul @@ -0,0 +1,10 @@ + + + + + String gridZul = "tripBillGrid.zul"; + + + + + \ No newline at end of file diff --git a/src/main/webapp/trips/bill/tripBillForm.zul b/src/main/webapp/trips/bill/tripBillForm.zul new file mode 100644 index 00000000..86b7cf16 --- /dev/null +++ b/src/main/webapp/trips/bill/tripBillForm.zul @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/trips/bill/tripBillGrid.zul b/src/main/webapp/trips/bill/tripBillGrid.zul new file mode 100644 index 00000000..a4b23a3c --- /dev/null +++ b/src/main/webapp/trips/bill/tripBillGrid.zul @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file