package info.bukova.isspst.data;

import info.bukova.isspst.Constants;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

@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 toDeparture;
	@Column(name = "ARRIVAL")
	private Date toArrival;
	@Column(name = "BACK_DEPARTURE")
	private Date backDeparture;
	@Column(name = "BACK_ARRIVAL")
	private Date backArrival;
	@Embedded
	private Vehicle toVehicle;
	@Embedded
	@AttributeOverrides({
		@AttributeOverride(name = "code", column = @Column(name = "BACK_VEHICLE_CODE")),
			@AttributeOverride(name = "description", column = @Column(name = "BACK_VEHICLE_DESCRIPTION", length = Constants.LEN_DESCRIPTION))
	})
	private Vehicle backVehicle;
	@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 = "DISTANCE_AMOUNT", precision = 15, scale = 4)
	private BigDecimal distanceAmount;
	@Column(name = "FUEL_AMOUNT", precision = 15, scale = 4)
	private BigDecimal fuelAmount;
	@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 TripBillItem() {

	}

	public TripBillItem(TripBillItem src) {
		date = src.getDate();
		to = src.getTo();
		back = src.getBack();
		toDeparture = src.getToDeparture();
		toArrival = src.getToArrival();
		backDeparture = src.getBackDeparture();
		backArrival = src.getBackArrival();
		toVehicle = src.getToVehicle();
		backVehicle = src.getBackVehicle();
		beginWork = src.getBeginWork();
		endWork = src.getEndWork();
		freeMealsCount = src.getFreeMealsCount();
		distance = src.getDistance();
		fuelConsumption = src.getFuelConsumption();
		distanceAmount = src.getDistanceAmount();
		fuelAmount = src.getFuelAmount();
		carefare = src.getCarefare();
		housing = src.getHousing();
		meals = src.getMeals();
		otherExpenses = src.getOtherExpenses();
		total = src.getTotal();
		adjustedTotal = src.getAdjustedTotal();
	}

	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 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;
	}

	public Date getToDeparture() {
		return toDeparture;
	}

	public void setToDeparture(Date toDeparture) {
		this.toDeparture = toDeparture;
	}

	public Date getToArrival() {
		return toArrival;
	}

	public void setToArrival(Date toArrival) {
		this.toArrival = toArrival;
	}

	public Date getBackDeparture() {
		return backDeparture;
	}

	public void setBackDeparture(Date backDeparture) {
		this.backDeparture = backDeparture;
	}

	public Date getBackArrival() {
		return backArrival;
	}

	public void setBackArrival(Date backArrival) {
		this.backArrival = backArrival;
	}

	public Vehicle getToVehicle() {
		return toVehicle;
	}

	public void setToVehicle(Vehicle toVhicle) {
		this.toVehicle = toVhicle;
	}

	public Vehicle getBackVehicle() {
		return backVehicle;
	}

	public void setBackVehicle(Vehicle backVehicle) {
		this.backVehicle = backVehicle;
	}

	public BigDecimal getDistanceAmount() {
		return distanceAmount;
	}

	public void setDistanceAmount(BigDecimal distanceAmount) {
		this.distanceAmount = distanceAmount;
	}

	public BigDecimal getFuelAmount() {
		return fuelAmount;
	}

	public void setFuelAmount(BigDecimal fuelAmount) {
		this.fuelAmount = fuelAmount;
	}

}
