private static bool CalculateCommonRealBasicFee(InvoiceShared realInvoice, InvoiceShared estimatedInvoice, FeeConfig feeConfig) { Contract.Requires(realInvoice != null); Contract.Requires(estimatedInvoice != null); Contract.Requires(feeConfig != null); realInvoice.GetBasicFee().CleanWaterFee += (estimatedInvoice.GetMonths() * feeConfig.GetMonthlyCleanWaterBasicFeeWithoutVAT()).RoundToCents(); realInvoice.GetBasicFee().WasteWaterFee += (estimatedInvoice.GetMonths() * feeConfig.GetMonthlyWasteWaterBasicFeeWithoutVAT()).RoundToCents(); return(true); }
private static bool CalculateCommonEstimatedBasicFee(InvoiceShared estimatedInvoice, FeeConfig feeConfig) { Contract.Requires(estimatedInvoice != null); Contract.Requires(feeConfig != null); if (estimatedInvoice.Balanced == false) { estimatedInvoice.GetBasicFee().CleanWaterFee = (estimatedInvoice.GetMonths() * feeConfig.GetMonthlyCleanWaterBasicFeeWithoutVAT()).RoundToCents(); estimatedInvoice.GetBasicFee().WasteWaterFee = (estimatedInvoice.GetMonths() * feeConfig.GetMonthlyWasteWaterBasicFeeWithoutVAT()).RoundToCents(); return(true); } return(false); }
private static void CalculateUserEstimatedBasicFee(DateRange invoicePeriod, UserInvoice userEstimatedInvoice, int userCount, FeeConfig feeConfig) { Contract.Requires(invoicePeriod != null); Contract.Requires(userEstimatedInvoice != null); Contract.Requires(feeConfig != null); Contract.Requires(userCount > 0); userEstimatedInvoice.GetBasicFee().CleanWaterFee = (invoicePeriod.GetMonths() * feeConfig.GetMonthlyCleanWaterBasicFeeWithoutVAT() / userCount).RoundToCents(); userEstimatedInvoice.GetBasicFee().WasteWaterFee = (invoicePeriod.GetMonths() * feeConfig.GetMonthlyWasteWaterBasicFeeWithoutVAT() / userCount).RoundToCents(); }