private static bool CalculateCommonRealUsageFee(InvoiceShared realInvoice, InvoiceShared estimatedInvoice, FeeConfig feeConfig) { Contract.Requires(realInvoice != null); Contract.Requires(estimatedInvoice != null); Contract.Requires(feeConfig != null); realInvoice.GetUsageFee().CleanWaterFee += (estimatedInvoice.GetConsumption().Real *feeConfig.GetMonthlyCleanWaterUsageFeeWithoutVAT()).RoundToCents(); realInvoice.GetUsageFee().WasteWaterFee += (estimatedInvoice.GetConsumption().Real *feeConfig.GetMonthlyWasteWaterUsageFeeWithoutVAT()).RoundToCents(); return(true); }
private static bool CalculateCommonEstimatedUsageFee(InvoiceShared estimatedInvoice, FeeConfig feeConfig) { Contract.Requires(estimatedInvoice != null); Contract.Requires(feeConfig != null); if (estimatedInvoice.Balanced == false) { estimatedInvoice.GetUsageFee().CleanWaterFee = (estimatedInvoice.GetConsumption().Estimated *feeConfig.GetMonthlyCleanWaterUsageFeeWithoutVAT()).RoundToCents(); estimatedInvoice.GetUsageFee().WasteWaterFee = (estimatedInvoice.GetConsumption().Estimated *feeConfig.GetMonthlyWasteWaterUsageFeeWithoutVAT()).RoundToCents(); return(true); } return(false); }
private static void CalculateUserEstimatedUsageFee(UserInvoice userEstimatedInvoice, FeeConfig feeConfig) { Contract.Requires(userEstimatedInvoice != null); Contract.Requires(feeConfig != null); userEstimatedInvoice.GetUsageFee().CleanWaterFee = (userEstimatedInvoice.GetConsumption().Estimated *feeConfig.GetMonthlyCleanWaterUsageFeeWithoutVAT()).RoundToCents(); userEstimatedInvoice.GetUsageFee().WasteWaterFee = (userEstimatedInvoice.GetConsumption().Estimated *feeConfig.GetMonthlyWasteWaterUsageFeeWithoutVAT()).RoundToCents(); }