using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

using BS.Shared.Core;

namespace BS.Shared.DataContracts
{
    [DataContract]
    public class Settlement2DC : IDataContract
    {
        [DataMember]
        public DateTime? AccountingPeriodEnd { get; set; }

        [DataMember]
        public DateTime? AccountingPeriodStart { get; set; }

        [DataMember]
        public decimal? AmountAdvancedPayments { get; set; }

        [DataMember]
        public decimal? AmountBillableTotal { get; set; }

        [DataMember]
        public decimal AmountTotalAdvancedPaidWithHourlyRate3 { get; set; }

        [DataMember]
        public decimal? AmountTotalAdvancedPaidWithNewHourlyRate { get; set; }

        [DataMember]
        public decimal? AmountTotalAdvancedPaidWithOldHourlyRate { get; set; }

        [DataMember]
        public decimal AmountTotalWithHourlyRate3 { get; set; }

        [DataMember]
        public decimal AmountWithRateFactor { get; set; }

        [DataMember]
        public DateTime? ApprovalNoticeDate { get; set; }

        [DataMember]
        public decimal? ApprovedFLS { get; set; }

        [DataMember]
        public decimal? ApprovedFLSWeekly { get; set; }

        [DataMember]
        public decimal ApprovedFLSWithActualHourlyRate { get; set; }

        [DataMember]
        public decimal ApprovedFLSWithHourlyRate3 { get; set; }

        [DataMember]
        public decimal ApprovedFLSWithOldHourlyRate { get; set; }

        [DataMember]
        public decimal? Claim { get; set; }

        [DataMember]
        public long? CostBearer2SupportConceptOid { get; set; }

        [DataMember]
        public string CreatorFirstName { get; set; }

        [DataMember]
        public string CreatorLastName { get; set; }

        [DataMember]
        public string CustomerReferenceNumber { get; set; }

        [DataMember]
        public int DifferentHourlyRateCount { get; set; }

        [DataMember]
        public int? DunningLetterCount { get; set; }

        [DataMember]
        public decimal? EquityContribution { get; set; }

        [DataMember]
        public decimal HourlyRate3 { get; set; }

        [DataMember]
        public DateTime? HourlyRateEndDate3 { get; set; }

        [DataMember]
        public decimal? HourlyRateNew { get; set; }

        [DataMember]
        public DateTime? HourlyRateNewStartDate { get; set; }

        [DataMember]
        public decimal? HourlyRateOld { get; set; }

        [DataMember]
        public DateTime? HourlyRateOldEndDate { get; set; }

        [DataMember]
        public DateTime? HourlyRateOldStartDate { get; set; }

        [DataMember]
        public long? InvoiceBaseOid { get; set; }

        [DataMember]
        public long? InvoiceBaseVersion { get; set; }

        [DataMember]
        public DateTime? InvoiceDate { get; set; }

        [DataMember]
        public string InvoiceNumber { get; set; }

        [DataMember]
        public bool IsPaid { get; set; }

        [DataMember]
        public string Notice { get; set; }

		[DataMember]
		public string ErrorNotice { get; set; }

        [DataMember]
        public decimal? RateFactor { get; set; }

        [DataMember]
        public long? RecipientAddressOid { get; set; }

        [DataMember]
        public long? RecipientAddressVersion { get; set; }

        [DataMember]
        public string RecipientContactPerson { get; set; }

        [DataMember]
        public string RecipientDivision { get; set; }

        [DataMember]
        public string RecipientOrganisation { get; set; }

        [DataMember]
        public string RecipientPostBox { get; set; }

        [DataMember]
        public string RecipientPostCode { get; set; }

        [DataMember]
        public string RecipientStreet { get; set; }

        [DataMember]
        public string RecipientTown { get; set; }

        [DataMember]
        public decimal? RecordedBillableFLSBrutto { get; set; }

        [DataMember]
        public decimal RecordedBillableFLSNetto { get; set; }

        [DataMember]
        public decimal RecordedBillableFLSNotBillableCustomerAbsent { get; set; }

        [DataMember]
        public decimal RecordedBillableFLSNotBillableOutOfApprovedSpan { get; set; }

        [DataMember]
        public string SenderContactPersonDivision { get; set; }

        [DataMember]
        public string SenderContactPersonFax { get; set; }

        [DataMember]
        public string SenderContactPersonFirstName { get; set; }

        [DataMember]
        public string SenderContactPersonLastName { get; set; }

        [DataMember]
        public string SenderContactPersonMail { get; set; }

        [DataMember]
        public string SenderContactPersonPhone { get; set; }

        [DataMember]
        public long? SettlementInvoiceVersion { get; set; }

        [DataMember]
        public long? SettlementIvoiceOid { get; set; }

        [DataMember]
        public long? SupportConceptOid { get; set; }

        [DataMember]
        public decimal WeeksWithHourlyRate3 { get; set; }

        [DataMember]
        public decimal WeeksWithNewHourlyRate { get; set; }

        [DataMember]
        public decimal WeeksWithOldHourlyRate { get; set; }

        [DataMember]
        public CostRatePeriodDC ServiceUnit { get; set; }

        [DataMember]
        public decimal MaxAmountAllowed { get; set; }

        [DataMember]
        public decimal TotalAmount { get; set; }

        [DataMember]
        public List<InvoiceItemDC> InvoiceItems { get; set; }

        public bool ContainsRecipientAddressData()
        {
            return !Utils.AreAllNullOrEmpty(this.RecipientStreet, this.RecipientPostCode, this.RecipientTown);
        }


	}
}