/// <summary> /// Calculate Charge For Service Item for RA Billing /// </summary> public RaServiceItem CalculateCharge(DateTime raCreatedDate, DateTime startDtTime, DateTime endDtTime, long serviceItemId, int quantity, Int64 operationId, List <TariffType> oTariffTypeList) { Helpers.PricingStrategy objPs = PricingStrategyFactory.GetPricingStrategy(raCreatedDate, startDtTime, endDtTime, operationId, oTariffTypeList); if (objPs == null) { throw new CaresException(Resources.RentalAgreement.RentalAgreement.TariffTypeNotDefinedForServiceItem, null); } List <ServiceRt> serviceRts = serviceRtRepository.GetForRaBilling(objPs.TariffType.TariffTypeCode, serviceItemId, raCreatedDate).ToList(); if (serviceRts.Count == 0) { throw new CaresException(Resources.RentalAgreement.RentalAgreement.ServiceRateNotDefinedForServiceItem); } ServiceRt oServiceRate = serviceRts[0]; return(objPs.CalculateRAServiceItemCharge(startDtTime, endDtTime, quantity, oServiceRate)); }
/// <summary> /// Calculate Insurance Charge for Ra Billing /// </summary> public RaHireGroupInsurance CalculateCharge(DateTime raRecCreatedDate, DateTime stDate, DateTime eDate, long operationId, long hireGroupDetailId, short insuranceTypeId, List <TariffType> oTariffTypeList) { Helpers.PricingStrategy objPs = PricingStrategyFactory.GetPricingStrategy(raRecCreatedDate, stDate, eDate, operationId, oTariffTypeList); if (objPs == null) { throw new CaresException(Resources.RentalAgreement.RentalAgreement.TariffTypeNotDefinedForHireGroupInsurance, null); } List <InsuranceRt> insuranceRts = insuranceRtRepository. GetForRaBilling(objPs.TariffType.TariffTypeCode, hireGroupDetailId, insuranceTypeId, raRecCreatedDate).ToList(); if (insuranceRts.Count == 0) { throw new CaresException(Resources.RentalAgreement.RentalAgreement.InsuranceRateNotDefinedForHireGroupInsurance); } InsuranceRt oInsRate = insuranceRts[0]; return(objPs.CalculateInsuranceCharge(stDate, eDate, oInsRate)); }