Exemple #1
0
 public BillingService(
     IProcessRepository process,
     IApportionmentRepository apportionment,
     ISubsidyRepository accountSubsidy,
     IReportRepository report,
     IToolBillingRepository tool,
     IRoomBillingRepository room,
     IStoreBillingRepository store,
     IMiscBillingRepository misc,
     IBillingTypeRepository billingType,
     IRoomDataRepository readRoomData,
     IToolDataRepository readToolData,
     IStoreDataRepository readStoreData,
     IMiscDataRepository readMiscData,
     IOrgRechargeRepository orgRecharge,
     IExternalInvoiceRepository externalInvoice)
 {
     Process         = process;
     Apportionment   = apportionment;
     AccountSubsidy  = accountSubsidy;
     Report          = report;
     Tool            = tool;
     Room            = room;
     Store           = store;
     Misc            = misc;
     BillingType     = billingType;
     RoomData        = readRoomData;
     ToolData        = readToolData;
     StoreData       = readStoreData;
     MiscData        = readMiscData;
     OrgRecharge     = orgRecharge;
     ExternalInvoice = externalInvoice;
 }
Exemple #2
0
 public ReportRepository(ISessionManager mgr, IToolBillingRepository toolBilling, IBillingTypeRepository billingType, IApportionmentRepository apportionment, IFeedRepository feed) : base(mgr)
 {
     ToolBilling   = toolBilling;
     BillingType   = billingType;
     Apportionment = apportionment;
     Feed          = feed;
 }
        /// <summary>
        /// Generates invoices for a single account.
        /// </summary>
        public ExternalInvoiceManager(int accountId, DateTime sd, DateTime ed, bool showRemote, IBillingTypeRepository billingTypeRepository, ISession session)
        {
            AccountID  = accountId;
            StartDate  = sd;
            EndDate    = ed;
            ShowRemote = showRemote;
            IncludeAccountsWithNoUsage = false;
            BillingTypeRepository      = billingTypeRepository;
            Session = session;

            _data = GetAllUsage();
        }
Exemple #4
0
        private MiscBillingByAccount CreateMiscBillingByAccount(IGrouping <MiscBillingGroupByKeySelector, IMiscBillingCharge> grp, IEnumerable <IHoliday> holidays, IBillingTypeRepository mgr)
        {
            var period    = grp.Key.Period;
            var clientId  = grp.Key.ClientID;
            var accountId = grp.Key.AccountID;

            IClient  client = ServiceProvider.Current.Data.Client.GetClient(clientId);
            IAccount acct   = ServiceProvider.Current.Data.Account.GetAccount(accountId);

            IBillingType    bt           = mgr.GetBillingType(period, clientId, acct.OrgID, holidays);
            BillingCategory bc           = (BillingCategory)Enum.Parse(typeof(BillingCategory), grp.Key.SubType, true);
            decimal         totalMisc    = grp.Sum(g => Convert.ToDecimal(g.Quantity) * g.UnitCost);
            decimal         totalSubsidy = grp.Sum(g => g.SubsidyDiscount);

            return(new MiscBillingByAccount(period, client, acct, bt, bc, totalMisc, totalSubsidy));
        }
Exemple #5
0
 public IEnumerable <MiscBillingByAccount> Create(IEnumerable <IMiscBillingCharge> source, IEnumerable <IHoliday> holidays, IBillingTypeRepository mgr)
 {
     return(source.GroupBy(x => new MiscBillingGroupByKeySelector(x))
            .Select(x => CreateMiscBillingByAccount(x, holidays, mgr))
            .OrderBy(x => x.Period)
            .ThenBy(x => x.Client.ClientID)
            .ThenBy(x => x.Account.AccountID)
            .ThenBy(x => x.BillingCategory)
            .ToArray());
 }
 public ToolDataRepository(ISessionManager mgr, IBillingTypeRepository billingType) : base(mgr)
 {
     _billingType = billingType;
 }
 public ExternalInvoiceRepository(ISessionManager mgr, IBillingTypeRepository billingType) : base(mgr)
 {
     BillingType = billingType;
 }
 /// <summary>
 /// Generates invoices for all accounts.
 /// </summary>
 public ExternalInvoiceManager(DateTime sd, DateTime ed, bool showRemote, IBillingTypeRepository billingTypeRepository, ISession session)
     : this(0, sd, ed, showRemote, billingTypeRepository, session)
 {
 }