/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.model.view.report;

import com.arrebol.taxiservicios.model.admin.Taxi;
import com.arrebol.taxiservicios.model.catalog.BankCard;
import com.arrebol.taxiservicios.model.catalog.Location;
import com.arrebol.taxiservicios.model.core.User;
import com.arrebol.taxiservicios.model.enums.ActionStatus;
import com.arrebol.taxiservicios.model.enums.BasicType;
import com.arrebol.taxiservicios.model.enums.ExpenseStatusType;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * View PAYMENT_CLIENT
 *
 * @author Oscar
 */
public class PaymentClient implements Serializable {

    private static final long serialVersionUID = -952115915026599651L;

    private String id;
    private Taxi taxi;
    private BasicType activeStatus;
    private ActionStatus actionStatus;
    private Double amountToPay;
    private Double discount;
    private String commentsDiscount;
    private Double increase;
    private String commentsIncrease;
    private Double totalPayment;
    private Date initDate;
    private Date endDate;
    private Date nextPaymentDate;
    private String comments;
    private User createdBy;
    private Date createdOn;
    private User lastUpdatedBy;
    private Date lastUpdatedOn;
    private int diasSeguroVentas;
    private float pagoSeguroVentas;
    private float totalContrato;
    private float incrementoContrato;
    private float descuentoContrato;
    private double abonoAdeudo;
    private Location locationSend;
    private BasicType paid;
    private float amountToCharge;
    private Location location;
    private float descuentoPago;
    private float incrementoPago;
    private String descuentoPagoComentario;
    private String incrementoPagoComentario;
    private BankCard bankCard;
    private ExpenseStatusType depositStatus;

    public PaymentClient(String id, Taxi taxi, BasicType activeStatus, ActionStatus actionStatus, Double amountToPay, Double discount, String commentsDiscount, Double increase, String commentsIncrease, Double totalPayment, Date initDate, Date endDate, Date nextPaymentDate, String comments, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn) {
        this.id = id;
        this.taxi = taxi;
        this.activeStatus = activeStatus;
        this.actionStatus = actionStatus;
        this.amountToPay = amountToPay;
        this.discount = discount;
        this.commentsDiscount = commentsDiscount;
        this.increase = increase;
        this.commentsIncrease = commentsIncrease;
        this.totalPayment = totalPayment;
        this.initDate = initDate;
        this.endDate = endDate;
        this.nextPaymentDate = nextPaymentDate;
        this.comments = comments;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public PaymentClient(String id, Taxi taxi, BasicType activeStatus, ActionStatus actionStatus, Double amountToPay, Double discount, String commentsDiscount, Double increase, String commentsIncrease, Double totalPayment, Date initDate, Date endDate, Date nextPaymentDate, String comments, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn, int diasSeguroVentas, float pagoSeguroVentas, float totalContrato, float incrementoContrato, float descuentoContrato, double abonoAdeudo, Location locationSend, BasicType paid, float amountToCharge) {
        this.id = id;
        this.taxi = taxi;
        this.activeStatus = activeStatus;
        this.actionStatus = actionStatus;
        this.amountToPay = amountToPay;
        this.discount = discount;
        this.commentsDiscount = commentsDiscount;
        this.increase = increase;
        this.commentsIncrease = commentsIncrease;
        this.totalPayment = totalPayment;
        this.initDate = initDate;
        this.endDate = endDate;
        this.nextPaymentDate = nextPaymentDate;
        this.comments = comments;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.diasSeguroVentas = diasSeguroVentas;
        this.pagoSeguroVentas = pagoSeguroVentas;
        this.totalContrato = totalContrato;
        this.incrementoContrato = incrementoContrato;
        this.descuentoContrato = descuentoContrato;
        this.abonoAdeudo = abonoAdeudo;
        this.locationSend = locationSend;
        this.paid = paid;
        this.amountToCharge = amountToCharge;
    }

    public PaymentClient(String id, Taxi taxi, BasicType activeStatus, ActionStatus actionStatus, Double amountToPay, Double discount, String commentsDiscount, Double increase, String commentsIncrease, Double totalPayment, Date initDate, Date endDate, Date nextPaymentDate, String comments, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn, int diasSeguroVentas, float pagoSeguroVentas, float totalContrato, float incrementoContrato, float descuentoContrato, double abonoAdeudo, Location locationSend, BasicType paid, float amountToCharge, Location location) {
        this.id = id;
        this.taxi = taxi;
        this.activeStatus = activeStatus;
        this.actionStatus = actionStatus;
        this.amountToPay = amountToPay;
        this.discount = discount;
        this.commentsDiscount = commentsDiscount;
        this.increase = increase;
        this.commentsIncrease = commentsIncrease;
        this.totalPayment = totalPayment;
        this.initDate = initDate;
        this.endDate = endDate;
        this.nextPaymentDate = nextPaymentDate;
        this.comments = comments;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.diasSeguroVentas = diasSeguroVentas;
        this.pagoSeguroVentas = pagoSeguroVentas;
        this.totalContrato = totalContrato;
        this.incrementoContrato = incrementoContrato;
        this.descuentoContrato = descuentoContrato;
        this.abonoAdeudo = abonoAdeudo;
        this.locationSend = locationSend;
        this.paid = paid;
        this.amountToCharge = amountToCharge;
        this.location = location;
    }

    public PaymentClient(String id, Taxi taxi, BasicType activeStatus, ActionStatus actionStatus, Double amountToPay, Double discount, String commentsDiscount, Double increase, String commentsIncrease, Double totalPayment, Date initDate, Date endDate, Date nextPaymentDate, String comments, User createdBy, Date createdOn, User lastUpdatedBy, Date lastUpdatedOn, int diasSeguroVentas, float pagoSeguroVentas, float totalContrato, float incrementoContrato, float descuentoContrato, double abonoAdeudo, Location locationSend, BasicType paid, float amountToCharge, Location location, float descuentoPago, float incrementoPago, String descuentoPagoComentario, String incrementoPagoComentario) {
        this.id = id;
        this.taxi = taxi;
        this.activeStatus = activeStatus;
        this.actionStatus = actionStatus;
        this.amountToPay = amountToPay;
        this.discount = discount;
        this.commentsDiscount = commentsDiscount;
        this.increase = increase;
        this.commentsIncrease = commentsIncrease;
        this.totalPayment = totalPayment;
        this.initDate = initDate;
        this.endDate = endDate;
        this.nextPaymentDate = nextPaymentDate;
        this.comments = comments;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
        this.lastUpdatedBy = lastUpdatedBy;
        this.lastUpdatedOn = lastUpdatedOn;
        this.diasSeguroVentas = diasSeguroVentas;
        this.pagoSeguroVentas = pagoSeguroVentas;
        this.totalContrato = totalContrato;
        this.incrementoContrato = incrementoContrato;
        this.descuentoContrato = descuentoContrato;
        this.abonoAdeudo = abonoAdeudo;
        this.locationSend = locationSend;
        this.paid = paid;
        this.amountToCharge = amountToCharge;
        this.location = location;
        this.descuentoPago = descuentoPago;
        this.incrementoPago = incrementoPago;
        this.descuentoPagoComentario = descuentoPagoComentario;
        this.incrementoPagoComentario = incrementoPagoComentario;
    }
    
    
    public PaymentClient() {
    }

    public double getAbonoAdeudo() {
        return abonoAdeudo;
    }

    public void setAbonoAdeudo(double abonoAdeudo) {
        this.abonoAdeudo = abonoAdeudo;
    }

    public float getTotalContrato() {
        return totalContrato;
    }

    public void setTotalContrato(float totalContrato) {
        this.totalContrato = totalContrato;
    }

    public float getIncrementoContrato() {
        return incrementoContrato;
    }

    public void setIncrementoContrato(float incrementoContrato) {
        this.incrementoContrato = incrementoContrato;
    }

    public float getDescuentoContrato() {
        return descuentoContrato;
    }

    public void setDescuentoContrato(float descuentoContrato) {
        this.descuentoContrato = descuentoContrato;
    }

    public int getDiasSeguroVentas() {
        return diasSeguroVentas;
    }

    public void setDiasSeguroVentas(int diasSeguroVentas) {
        this.diasSeguroVentas = diasSeguroVentas;
    }

    public float getPagoSeguroVentas() {
        return pagoSeguroVentas;
    }

    public void setPagoSeguroVentas(float pagoSeguroVentas) {
        this.pagoSeguroVentas = pagoSeguroVentas;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Taxi getTaxi() {
        return taxi;
    }

    public void setTaxi(Taxi taxi) {
        this.taxi = taxi;
    }

    public BasicType getActiveStatus() {
        return activeStatus;
    }

    public void setActiveStatus(BasicType activeStatus) {
        this.activeStatus = activeStatus;
    }

    public ActionStatus getActionStatus() {
        return actionStatus;
    }

    public void setActionStatus(ActionStatus actionStatus) {
        this.actionStatus = actionStatus;
    }

    public Double getAmountToPay() {
        return amountToPay;
    }

    public void setAmountToPay(Double amountToPay) {
        this.amountToPay = amountToPay;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public String getCommentsDiscount() {
        return commentsDiscount;
    }

    public void setCommentsDiscount(String commentsDiscount) {
        this.commentsDiscount = commentsDiscount;
    }

    public Double getIncrease() {
        return increase;
    }

    public void setIncrease(Double increase) {
        this.increase = increase;
    }

    public String getCommentsIncrease() {
        return commentsIncrease;
    }

    public void setCommentsIncrease(String commentsIncrease) {
        this.commentsIncrease = commentsIncrease;
    }

    public Double getTotalPayment() {
        return totalPayment;
    }

    public void setTotalPayment(Double totalPayment) {
        this.totalPayment = totalPayment;
    }

    public Date getInitDate() {
        return initDate;
    }

    public void setInitDate(Date initDate) {
        this.initDate = initDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getNextPaymentDate() {
        return nextPaymentDate;
    }

    public void setNextPaymentDate(Date nextPaymentDate) {
        this.nextPaymentDate = nextPaymentDate;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public User getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(User createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public User getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(User lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Date getLastUpdatedOn() {
        return lastUpdatedOn;
    }

    public void setLastUpdatedOn(Date lastUpdatedOn) {
        this.lastUpdatedOn = lastUpdatedOn;
    }

    public Location getLocationSend() {
        return locationSend;
    }

    public void setLocationSend(Location locationSend) {
        this.locationSend = locationSend;
    }

    public BasicType getPaid() {
        return paid;
    }

    public void setPaid(BasicType paid) {
        this.paid = paid;
    }

    public float getAmountToCharge() {
        return amountToCharge;
    }

    public void setAmountToCharge(float amountToCharge) {
        this.amountToCharge = amountToCharge;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public float getDescuentoPago() {
        return descuentoPago;
    }

    public void setDescuentoPago(float descuentoPago) {
        this.descuentoPago = descuentoPago;
    }

    public float getIncrementoPago() {
        return incrementoPago;
    }

    public void setIncrementoPago(float incrementoPago) {
        this.incrementoPago = incrementoPago;
    }

    public String getDescuentoPagoComentario() {
        return descuentoPagoComentario;
    }

    public void setDescuentoPagoComentario(String descuentoPagoComentario) {
        this.descuentoPagoComentario = descuentoPagoComentario;
    }

    public String getIncrementoPagoComentario() {
        return incrementoPagoComentario;
    }

    public void setIncrementoPagoComentario(String incrementoPagoComentario) {
        this.incrementoPagoComentario = incrementoPagoComentario;
    }

    public BankCard getBankCard() {
        return bankCard;
    }

    public void setBankCard(BankCard bankCard) {
        this.bankCard = bankCard;
    }

    public ExpenseStatusType getDepositStatus() {
        return depositStatus;
    }

    public void setDepositStatus(ExpenseStatusType depositStatus) {
        this.depositStatus = depositStatus;
    }

    
    public boolean getAction(Date lastStableSmallBox) {
        Date date = createdOn;
        boolean action = true;
        try {
            SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");

            String dateStr = dt1.format(date);
            date = dt1.parse(dateStr);

            action = date.after(lastStableSmallBox);

        } catch (ParseException ex) {
            Logger.getLogger(PaymentClient.class.getName()).log(Level.SEVERE, null, ex);
        }
        return action;
    }
}
