using System; namespace PayRollDAL.DTO.SAP { /// /// Flat DTO returned from the SAP join query. /// One row per TDECLARATIONDETAIL record (or one row per TDECLARATION for declarations /// with no detail records — detail columns will be null in that case). /// public class ITDeclarationSapDTO { // ── Header (from TDECLARATION) ──────────────────────────────────────── public int DeclarationId { get; set; } public int EmployeeId { get; set; } /// Employee code used as SAP EmployeeID field. public string EmployeeCode { get; set; } = string.Empty; /// Fiscal year string derived from period start year (e.g. "2025"). public string FiscalYear { get; set; } = string.Empty; public DateTime PeriodFromDate { get; set; } public DateTime PeriodToDate { get; set; } /// 0 = New Regime, 1 = Old Regime (default). public byte CalculationMethod { get; set; } public byte NoOfEducation { get; set; } public byte NoOfHostel { get; set; } public double PreviousSalary { get; set; } /// Previous employer TDS → mapped to SAP PreviousIncomeTax. public double PreviousTDS { get; set; } /// Previous employer Professional Tax → mapped to SAP PreviousPTAX. public double PreviousPT { get; set; } public double PreviousPF { get; set; } public string DeclarationRemarks { get; set; } = string.Empty; // ── Detail (from TDECLARATIONDETAIL — nullable when no detail rows) ── public int? DeclarationDetailId { get; set; } /// /// DeclarationType byte mapping: /// 0 = Loan (home loan) → SAP 584 Housing Loan (Particulars2 block) /// 2 = Rent paid (HRA) → SAP 581 /// 3 = Rental income → SAP 584 Housing Loan (Particulars1 block) /// 4 = Investments 80C → SAP 586 /// 5 = Expenses / 80D → SAP 585 /// 6 = Other income sources → SAP 584 Other Income Sources (second sub-type) /// public byte? DeclarationDetailType { get; set; } public string Particulars { get; set; } = string.Empty; public double DeclaredAmount { get; set; } public double ApprovedAmount { get; set; } public DateTime? FromPeriod { get; set; } public DateTime? ToPeriod { get; set; } public double Interest { get; set; } public double Principle { get; set; } /// 0 = Metro, 1 = Non-Metro. public byte IsMetro { get; set; } public double RentReceived { get; set; } public double LocalTax { get; set; } public double StandardDeduction { get; set; } public double NetIncome { get; set; } public string DetailRemarks { get; set; } = string.Empty; // ── TDS Contact (Landlord for HRA, Lender for home loan) ───────────── public string ContactName { get; set; } = string.Empty; public string ContactPAN { get; set; } = string.Empty; public string ContactTAN { get; set; } = string.Empty; public string ContactAddress1 { get; set; } = string.Empty; public string ContactAddress2 { get; set; } = string.Empty; public string ContactAddress3 { get; set; } = string.Empty; public string ContactAddress4 { get; set; } = string.Empty; public string ContactAddress5 { get; set; } = string.Empty; // ── TDS Section (section name for 585 Deductions / 586 Contributions) ─ /// Section description from MTDSSECTIONDETAIL (e.g. "Medical Health Insurance (Self)"). public string SectionDetail { get; set; } = string.Empty; } }