Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }