/*
 * MosP - Mind Open Source Project         http://www.mosp.jp/
 * Copyright (C) 1987-2009 MIND Co., Ltd.  http://www.e-mind.co.jp/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package jp.mosp.payroll.bonus.dto;

import java.util.Date;

import jp.mosp.common.common.BaseDto;

public class PdPaymentDto extends BaseDto {

	private static final long serialVersionUID = 1812427511435550686L;
	
	// フィールド
	protected String kCode              = "";	// 社員コード
	protected Date   calcDate               ;	// 計算年月
	protected Date   payday                 ;	// 給与支給日
	protected String calcStatus         = "";	// 計算ステータス
	protected String kName              = "";	// 社員氏名
	protected String stationCode        = "";	// 所属コード
	protected String positionCode       = "";	// 職位コード
	protected String employmentType     = "";	// 雇用区分
	protected int    presence           = 0 ;	// 出勤日数
	protected int    workOnHoliday      = 0 ;	// 休日出勤日数
	protected int    particularHoliday  = 0 ;	// 特別休暇日数
	protected int    paidHoliday        = 0 ;	// 有給休暇日数
	protected int    absence            = 0 ;	// 欠勤日数
	protected int    paidHolidayRest    = 0 ;	// 有給残
	protected float  paymentHours       = 0 ;	// 時給時間
	protected int    arriveLate         = 0 ;	// 遅刻回数
	protected float  effortTime         = 0 ;	// 成果、残業時間
	protected int    effortAllowance    = 0 ;	// 成果、残業手当
	protected float  lateNight          = 0 ;	// 深夜時間
	protected int    lateNightAllowance = 0 ;	// 深夜手当
	protected float  overLate           = 0 ;	// 深夜残業時間
	protected int    overLateAllowance  = 0 ;	// 深夜残業手当
	protected float  holidayTime        = 0 ;	// 休日時間
	protected int    holidayAllowance   = 0 ;	// 休日手当
	protected float  attendance_13      = 0 ;	// 勤怠項目13
	protected float  attendance_14      = 0 ;	// 勤怠項目14
	protected int    institutionalAbs   = 0 ;	// 制度欠勤日数
	protected int    otherAttendance    = 0 ;	// その他勤怠日数
	protected int    basicSalary        = 0 ;	// 基本給
	protected int    ability1Allowance  = 0 ;	// 職能手当1
	protected int    ability2Allowance  = 0 ;	// 職能手当2
	protected int    familyAllowance    = 0 ;	// 扶養手当
	protected int    allowance_05       = 0 ;	// 支給項目05
	protected int    allowance_06       = 0 ;	// 支給項目06
	protected int    cutForMissing      = 0 ;	// 皆勤減額
	protected int    cutForShort        = 0 ;	// 役職減額経験
	protected int    allowance_09       = 0 ;	// 支給項目09
	protected int    allowance_10       = 0 ;	// 支給項目10
	protected int    allowance_11       = 0 ;	// 支給項目11
	protected int    allowance_12       = 0 ;	// 支給項目12
	protected int    allowance_13       = 0 ;	// 支給項目13
	protected int    dateAllowance      = 0 ;	// 日付手当
	protected int    allowance_15       = 0 ;	// 支給項目15
	protected int    allowance_16       = 0 ;	// 支給項目16
	protected int    allowance_17       = 0 ;	// 支給項目17
	protected int    commutation        = 0 ;	// 通勤費
	protected int    commutationTax     = 0 ;	// 課税通勤費
	protected int    overtimeAllowance  = 0 ;	// 成・深・休
	protected int    cutFromBasic       = 0 ;	// 減額金
	protected int    healthInsurance    = 0 ;	// 健康保険料
	protected int    pensionInsurance   = 0 ;	// 厚生年金保険
	protected int    pensionFund        = 0 ;	// 厚生年金基金
	protected int    employeeInsurance  = 0 ;	// 雇用保険料
	protected int    incomeTax          = 0 ;	// 所得税
	protected int    residenceTax       = 0 ;	// 住民税
	protected int    nursingInsurance   = 0 ;	// 介護保険料
	protected int    deduction_08       = 0 ;	// 控除項目08
	protected int    deduction_09       = 0 ;	// 控除項目09
	protected int    deduction_10       = 0 ;	// 控除項目10
	protected int    deduction_11       = 0 ;	// 控除項目11
	protected int    deduction_12       = 0 ;	// 控除項目12
	protected int    deduction_13       = 0 ;	// 控除項目13
	protected int    deduction_14       = 0 ;	// 控除項目14
	protected int    deduction_15       = 0 ;	// 控除項目15
	protected int    deduction_16       = 0 ;	// 控除項目16
	protected int    deduction_17       = 0 ;	// 控除項目17
	protected int    deduction_18       = 0 ;	// 控除項目18
	protected int    deduction_19       = 0 ;	// 控除項目19
	protected int    deduction_20       = 0 ;	// 控除項目20
	protected int    allowanceTotal     = 0 ;	// 総支給金額
	protected int    deductionTotal     = 0 ;	// 総控除金額
	protected int    paymentTotal       = 0 ;	// 差引支給額
	protected int    bank1PayAmount     = 0 ;	// 銀行1振込額
	protected int    bank2PayAmount     = 0 ;	// 銀行2振込額
	protected int    cashPayAmount      = 0 ;	// 現金支給額
	protected int    dependentCount     = 0 ;	// 扶養等の数
	protected int    amountToTaxation   = 0 ;	// 課税対象額
	protected int    amountToSocIns     = 0 ;	// 社会保険対象額
	
	/**
	 * コンストラクタ
	 */
	public PdPaymentDto(){
		super();
	}
	
	/**
	 * 総支給額取得
	 */
	public int calcAllowanceTotal() {
		return basicSalary       +
				ability1Allowance +
				ability2Allowance +
				familyAllowance   +
				allowance_05      +
				allowance_06      +
				cutForMissing     +
				cutForShort       +
				allowance_09      +
				allowance_10      +
				allowance_11      +
				allowance_12      +
				allowance_13      +
				dateAllowance     +
				allowance_15      +
				allowance_16      +
				allowance_17      +
				commutation       +
				overtimeAllowance +
				cutFromBasic      ;
	}
	
	/**
	 * 総控除額取得
	 */
	public int calcDeductionTotal() {
		return calcSocialInsurance() +
				incomeTax             +
				residenceTax          +
				calcGenaralDeduction(); 
	}
	
	/**
	 * 諸控除額取得
	 */
	public int calcGenaralDeduction() {
		return deduction_08 +
				deduction_09 +
				deduction_10 +
				deduction_11 +
				deduction_12 +
				deduction_13 +
				deduction_14 +
				deduction_15 +
				deduction_16 +
				deduction_17 +
				deduction_18 +
				deduction_19 +
				deduction_20 ;
	}
	
	/**
	 * 社会保険料取得
	 * @return 社会保険料(合計)
	 */
	public int calcSocialInsurance() {
		return 	healthInsurance   +
				pensionInsurance  +
				pensionFund       +
				employeeInsurance +
				nursingInsurance  ;
	}
	
	/**
	 * 非課税通勤費取得
	 * @return 社会保険料(合計)
	 */
	public int getCommutationFree() {
		int commutationFree = commutation - commutationTax;
		return 	commutationFree < 0 ? 0 : commutationFree;
	}
	
	/**
	 * 非課税額取得
	 * @return 非課税額
	 */
	public int getTaxExempt() {
		int taxExempt = allowanceTotal- calcSocialInsurance() - amountToTaxation ;
		// 総支給額-社会保険合計-課税対象額
		if (taxExempt < 0) {
			taxExempt = 0;
		}
		return taxExempt;
	}
	
	/**
	 * 課税対象額(税計算前)
	 * @return 非課税額
	 */
	public int getTaxation() {
		int taxation = allowanceTotal - getTaxExempt();
		if (taxation < 0) {
			taxation = 0;
		}
		return taxation;
	}

	
	// アクセサメソッド
	public String getKCode             () { return kCode                 ; }	// 社員コード
	public Date   getCalcDate          () { return getDateField(calcDate); }	// 計算年月
	public Date   getPayday            () { return getDateField(payday  ); }	// 給与支給日
	public String getCalcStatus        () { return calcStatus            ; }	// 計算ステータス
	public String getKName             () { return kName                 ; }	// 社員氏名
	public String getStationCode       () { return stationCode           ; }	// 所属コード
	public String getPositionCode      () { return positionCode          ; }	// 職位コード
	public String getEmploymentType    () { return employmentType        ; }	// 雇用区分
	public int    getPresence          () { return presence              ; }	// 出勤日数
	public int    getWorkOnHoliday     () { return workOnHoliday         ; }	// 休日出勤日数
	public int    getParticularHoliday () { return particularHoliday     ; }	// 特別休暇日数
	public int    getPaidHoliday       () { return paidHoliday           ; }	// 有給休暇日数
	public int    getAbsence           () { return absence               ; }	// 欠勤日数
	public int    getPaidHolidayRest   () { return paidHolidayRest       ; }	// 有給残
	public float  getPaymentHours      () { return paymentHours          ; }	// 時給時間
	public int    getArriveLate        () { return arriveLate            ; }	// 遅刻回数
	public float  getEffortTime        () { return effortTime            ; }	// 成果、残業時間
	public int    getEffortAllowance   () { return effortAllowance       ; }	// 成果、残業手当
	public float  getLateNight         () { return lateNight             ; }	// 深夜時間
	public int    getLateNightAllowance() { return lateNightAllowance    ; }	// 深夜手当
	public float  getOverLate          () { return overLate              ; }	// 深夜残業時間
	public int    getOverLateAllowance () { return overLateAllowance     ; }	// 深夜残業手当
	public float  getHolidayTime       () { return holidayTime           ; }	// 休日時間
	public int    getHolidayAllowance  () { return holidayAllowance      ; }	// 休日手当
	public float  getAttendance_13     () { return attendance_13         ; }	// 勤怠項目13
	public float  getAttendance_14     () { return attendance_14         ; }	// 勤怠項目14
	public int    getInstitutionalAbs  () { return institutionalAbs      ; }	// 制度欠勤日数
	public int    getOtherAttendance   () { return otherAttendance       ; }	// その他勤怠日数
	public int    getBasicSalary       () { return basicSalary           ; }	// 基本給
	public int    getAbility1Allowance () { return ability1Allowance     ; }	// 職能手当1
	public int    getAbility2Allowance () { return ability2Allowance     ; }	// 職能手当2
	public int    getFamilyAllowance   () { return familyAllowance       ; }	// 扶養手当
	public int    getAllowance_05      () { return allowance_05          ; }	// 支給項目05
	public int    getAllowance_06      () { return allowance_06          ; }	// 支給項目06
	public int    getCutForMissing     () { return cutForMissing         ; }	// 皆勤減額
	public int    getCutForShort       () { return cutForShort           ; }	// 役職減額経験
	public int    getAllowance_09      () { return allowance_09          ; }	// 支給項目09
	public int    getAllowance_10      () { return allowance_10          ; }	// 支給項目10
	public int    getAllowance_11      () { return allowance_11          ; }	// 支給項目11
	public int    getAllowance_12      () { return allowance_12          ; }	// 支給項目12
	public int    getAllowance_13      () { return allowance_13          ; }	// 支給項目13
	public int    getDateAllowance     () { return dateAllowance         ; }	// 日付手当
	public int    getAllowance_15      () { return allowance_15          ; }	// 支給項目15
	public int    getAllowance_16      () { return allowance_16          ; }	// 支給項目16
	public int    getAllowance_17      () { return allowance_17          ; }	// 支給項目17
	public int    getCommutation       () { return commutation           ; }	// 通勤費
	public int    getCommutationTax    () { return commutationTax        ; }	// 課税通勤費
	public int    getOvertimeAllowance () { return overtimeAllowance     ; }	// 成・深・休
	public int    getCutFromBasic      () { return cutFromBasic          ; }	// 減額金
	public int    getHealthInsurance   () { return healthInsurance       ; }	// 健康保険料
	public int    getPensionInsurance  () { return pensionInsurance      ; }	// 厚生年金保険
	public int    getPensionFund       () { return pensionFund           ; }	// 厚生年金基金
	public int    getEmployeeInsurance () { return employeeInsurance     ; }	// 雇用保険料
	public int    getIncomeTax         () { return incomeTax             ; }	// 所得税
	public int    getResidenceTax      () { return residenceTax          ; }	// 住民税
	public int    getNursingInsurance  () { return nursingInsurance      ; }	// 介護保険料
	public int    getDeduction_08      () { return deduction_08          ; }	// 控除項目08
	public int    getDeduction_09      () { return deduction_09          ; }	// 控除項目09
	public int    getDeduction_10      () { return deduction_10          ; }	// 控除項目10
	public int    getDeduction_11      () { return deduction_11          ; }	// 控除項目11
	public int    getDeduction_12      () { return deduction_12          ; }	// 控除項目12
	public int    getDeduction_13      () { return deduction_13          ; }	// 控除項目13
	public int    getDeduction_14      () { return deduction_14          ; }	// 控除項目14
	public int    getDeduction_15      () { return deduction_15          ; }	// 控除項目15
	public int    getDeduction_16      () { return deduction_16          ; }	// 控除項目16
	public int    getDeduction_17      () { return deduction_17          ; }	// 控除項目17
	public int    getDeduction_18      () { return deduction_18          ; }	// 控除項目18
	public int    getDeduction_19      () { return deduction_19          ; }	// 控除項目19
	public int    getDeduction_20      () { return deduction_20          ; }	// 控除項目20
	public int    getAllowanceTotal    () { return allowanceTotal        ; }	// 総支給金額
	public int    getDeductionTotal    () { return deductionTotal        ; }	// 総控除金額
	public int    getPaymentTotal      () { return paymentTotal          ; }	// 差引支給額
	public int    getBank1PayAmount    () { return bank1PayAmount        ; }	// 銀行1振込額
	public int    getBank2PayAmount    () { return bank2PayAmount        ; }	// 銀行2振込額
	public int    getCashPayAmount     () { return cashPayAmount         ; }	// 現金支給額
	public int    getDependentCount    () { return dependentCount        ; }	// 扶養等の数
	public int    getAmountToTaxation  () { return amountToTaxation      ; }	// 課税対象額
	public int    getAmountToSocIns    () { return amountToSocIns        ; }	// 社会保険対象額

	public void setKCode             (String kCode             ) { this.kCode              = kCode                 ; }	// 社員コード
	public void setCalcDate          (Date   calcDate          ) { this.calcDate           = getDateField(calcDate); }	// 計算年月
	public void setPayday            (Date   payday            ) { this.payday             = getDateField(payday)  ; }	// 給与支給日
	public void setCalcStatus        (String calcStatus        ) { this.calcStatus         = calcStatus            ; }	// 計算ステータス
	public void setKName             (String kName             ) { this.kName              = kName                 ; }	// 社員氏名
	public void setStationCode       (String stationCode       ) { this.stationCode        = stationCode           ; }	// 所属コード
	public void setPositionCode      (String positionCode      ) { this.positionCode       = positionCode          ; }	// 職位コード
	public void setEmploymentType    (String employmentType    ) { this.employmentType     = employmentType        ; }	// 雇用区分
	public void setPresence          (int    presence          ) { this.presence           = presence              ; }	// 出勤日数
	public void setWorkOnHoliday     (int    workOnHoliday     ) { this.workOnHoliday      = workOnHoliday         ; }	// 休日出勤日数
	public void setParticularHoliday (int    particularHoliday ) { this.particularHoliday  = particularHoliday     ; }	// 特別休暇日数
	public void setPaidHoliday       (int    paidHoliday       ) { this.paidHoliday        = paidHoliday           ; }	// 有給休暇日数
	public void setAbsence           (int    absence           ) { this.absence            = absence               ; }	// 欠勤日数
	public void setPaidHolidayRest   (int    paidHolidayRest   ) { this.paidHolidayRest    = paidHolidayRest       ; }	// 有給残
	public void setPaymentHours      (float  paymentHours      ) { this.paymentHours       = paymentHours          ; }	// 時給時間
	public void setArriveLate        (int    arriveLate        ) { this.arriveLate         = arriveLate            ; }	// 遅刻回数
	public void setEffortTime        (float  effortTime        ) { this.effortTime         = effortTime            ; }	// 成果、残業時間
	public void setEffortAllowance   (int    effortAllowance   ) { this.effortAllowance    = effortAllowance       ; }	// 成果、残業手当
	public void setLateNight         (float  lateNight         ) { this.lateNight          = lateNight             ; }	// 深夜時間
	public void setLateNightAllowance(int    lateNightAllowance) { this.lateNightAllowance = lateNightAllowance    ; }	// 深夜手当
	public void setOverLate          (float  overLate          ) { this.overLate           = overLate              ; }	// 深夜残業時間
	public void setOverLateAllowance (int    overLateAllowance ) { this.overLateAllowance  = overLateAllowance     ; }	// 深夜残業手当
	public void setHolidayTime       (float  holidayTime       ) { this.holidayTime        = holidayTime           ; }	// 休日時間
	public void setHolidayAllowance  (int    holidayAllowance  ) { this.holidayAllowance   = holidayAllowance      ; }	// 休日手当
	public void setAttendance_13     (float  attendance_13     ) { this.attendance_13      = attendance_13         ; }	// 勤怠項目13
	public void setAttendance_14     (float  attendance_14     ) { this.attendance_14      = attendance_14         ; }	// 勤怠項目14
	public void setInstitutionalAbs  (int    institutionalAbs  ) { this.institutionalAbs   = institutionalAbs      ; }	// 制度欠勤日数
	public void setOtherAttendance   (int    otherAttendance   ) { this.otherAttendance    = otherAttendance       ; }	// その他勤怠日数
	public void setBasicSalary       (int    basicSalary       ) { this.basicSalary        = basicSalary           ; }	// 基本給
	public void setAbility1Allowance (int    ability1Allowance ) { this.ability1Allowance  = ability1Allowance     ; }	// 職能手当1
	public void setAbility2Allowance (int    ability2Allowance ) { this.ability2Allowance  = ability2Allowance     ; }	// 職能手当2
	public void setFamilyAllowance   (int    familyAllowance   ) { this.familyAllowance    = familyAllowance       ; }	// 扶養手当
	public void setAllowance_05      (int    allowance_05      ) { this.allowance_05       = allowance_05          ; }	// 支給項目05
	public void setAllowance_06      (int    allowance_06      ) { this.allowance_06       = allowance_06          ; }	// 支給項目06
	public void setCutForMissing     (int    cutForMissing     ) { this.cutForMissing      = cutForMissing         ; }	// 皆勤減額
	public void setCutForShort       (int    cutForShort       ) { this.cutForShort        = cutForShort           ; }	// 役職減額経験
	public void setAllowance_09      (int    allowance_09      ) { this.allowance_09       = allowance_09          ; }	// 支給項目09
	public void setAllowance_10      (int    allowance_10      ) { this.allowance_10       = allowance_10          ; }	// 支給項目10
	public void setAllowance_11      (int    allowance_11      ) { this.allowance_11       = allowance_11          ; }	// 支給項目11
	public void setAllowance_12      (int    allowance_12      ) { this.allowance_12       = allowance_12          ; }	// 支給項目12
	public void setAllowance_13      (int    allowance_13      ) { this.allowance_13       = allowance_13          ; }	// 支給項目13
	public void setDateAllowance     (int    dateAllowance     ) { this.dateAllowance      = dateAllowance         ; }	// 日付手当
	public void setAllowance_15      (int    allowance_15      ) { this.allowance_15       = allowance_15          ; }	// 支給項目15
	public void setAllowance_16      (int    allowance_16      ) { this.allowance_16       = allowance_16          ; }	// 支給項目16
	public void setAllowance_17      (int    allowance_17      ) { this.allowance_17       = allowance_17          ; }	// 支給項目17
	public void setCommutation       (int    commutation       ) { this.commutation        = commutation           ; }	// 通勤費
	public void setCommutationTax    (int    commutationTax    ) { this.commutationTax     = commutationTax        ; }	// 課税通勤費
	public void setOvertimeAllowance (int    overtimeAllowance ) { this.overtimeAllowance  = overtimeAllowance     ; }	// 成・深・休
	public void setCutFromBasic      (int    cutFromBasic      ) { this.cutFromBasic       = cutFromBasic          ; }	// 減額金
	public void setHealthInsurance   (int    healthInsurance   ) { this.healthInsurance    = healthInsurance       ; }	// 健康保険料
	public void setPensionInsurance  (int    pensionInsurance  ) { this.pensionInsurance   = pensionInsurance      ; }	// 厚生年金保険
	public void setPensionFund       (int    pensionFund       ) { this.pensionFund        = pensionFund           ; }	// 厚生年金基金
	public void setEmployeeInsurance (int    employeeInsurance ) { this.employeeInsurance  = employeeInsurance     ; }	// 雇用保険料
	public void setIncomeTax         (int    incomeTax         ) { this.incomeTax          = incomeTax             ; }	// 所得税
	public void setResidenceTax      (int    residenceTax      ) { this.residenceTax       = residenceTax          ; }	// 住民税
	public void setNursingInsurance  (int    nursingInsurance  ) { this.nursingInsurance   = nursingInsurance      ; }	// 介護保険料
	public void setDeduction_08      (int    deduction_08      ) { this.deduction_08       = deduction_08          ; }	// 控除項目08
	public void setDeduction_09      (int    deduction_09      ) { this.deduction_09       = deduction_09          ; }	// 控除項目09
	public void setDeduction_10      (int    deduction_10      ) { this.deduction_10       = deduction_10          ; }	// 控除項目10
	public void setDeduction_11      (int    deduction_11      ) { this.deduction_11       = deduction_11          ; }	// 控除項目11
	public void setDeduction_12      (int    deduction_12      ) { this.deduction_12       = deduction_12          ; }	// 控除項目12
	public void setDeduction_13      (int    deduction_13      ) { this.deduction_13       = deduction_13          ; }	// 控除項目13
	public void setDeduction_14      (int    deduction_14      ) { this.deduction_14       = deduction_14          ; }	// 控除項目14
	public void setDeduction_15      (int    deduction_15      ) { this.deduction_15       = deduction_15          ; }	// 控除項目15
	public void setDeduction_16      (int    deduction_16      ) { this.deduction_16       = deduction_16          ; }	// 控除項目16
	public void setDeduction_17      (int    deduction_17      ) { this.deduction_17       = deduction_17          ; }	// 控除項目17
	public void setDeduction_18      (int    deduction_18      ) { this.deduction_18       = deduction_18          ; }	// 控除項目18
	public void setDeduction_19      (int    deduction_19      ) { this.deduction_19       = deduction_19          ; }	// 控除項目19
	public void setDeduction_20      (int    deduction_20      ) { this.deduction_20       = deduction_20          ; }	// 控除項目20
	public void setAllowanceTotal    (int    allowanceTotal    ) { this.allowanceTotal     = allowanceTotal        ; }	// 総支給金額
	public void setDeductionTotal    (int    deductionTotal    ) { this.deductionTotal     = deductionTotal        ; }	// 総控除金額
	public void setPaymentTotal      (int    paymentTotal      ) { this.paymentTotal       = paymentTotal          ; }	// 差引支給額
	public void setBank1PayAmount    (int    bank1PayAmount    ) { this.bank1PayAmount     = bank1PayAmount        ; }	// 銀行1振込額
	public void setBank2PayAmount    (int    bank2PayAmount    ) { this.bank2PayAmount     = bank2PayAmount        ; }	// 銀行2振込額
	public void setCashPayAmount     (int    cashPayAmount     ) { this.cashPayAmount      = cashPayAmount         ; }	// 現金支給額
	public void setDependentCount    (int    dependentCount    ) { this.dependentCount     = dependentCount        ; }	// 扶養等の数
	public void setAmountToTaxation  (int    amountToTaxation  ) { this.amountToTaxation   = amountToTaxation      ; }	// 課税対象額
	public void setAmountToSocIns    (int    amountToSocIns    ) { this.amountToSocIns     = amountToSocIns        ; }	// 社会保険対象額
	
}
