Example #1
0
        /// <summary>
        ///     Sends the details about what
        /// </summary>
        /// <param name="client"></param>
        /// <param name="agentID"></param>
        /// <param name="groupID"></param>
        /// <param name="transactionID"></param>
        /// <param name="sessionID"></param>
        /// <param name="currentInterval"></param>
        /// <param name="intervalDays"></param>
        private void client_OnGroupAccountDetailsRequest(IClientAPI client, UUID agentID, UUID groupID,
                                                         UUID transactionID, UUID sessionID, int currentInterval,
                                                         int intervalDays)
        {
            IGroupsModule groupsModule = client.Scene.RequestModuleInterface <IGroupsModule>();

            if (groupsModule != null && groupsModule.GroupPermissionCheck(agentID, groupID, GroupPowers.Accountable))
            {
                IMoneyModule moneyModule = client.Scene.RequestModuleInterface <IMoneyModule>();
                if (moneyModule != null)
                {
                    int amt = moneyModule.Balance(groupID);
                    List <GroupAccountHistory> history = moneyModule.GetTransactions(groupID, agentID, currentInterval,
                                                                                     intervalDays);
                    history = (from h in history where h.Stipend select h).ToList();
                    //We don't want payments, we only want stipends which we sent to users
                    GroupBalance balance = moneyModule.GetGroupBalance(groupID);
                    client.SendGroupAccountingDetails(client, groupID, transactionID, sessionID, amt, currentInterval,
                                                      intervalDays,
                                                      Util.BuildYMDDateString(
                                                          balance.StartingDate.AddDays(-currentInterval * intervalDays)),
                                                      history.ToArray());
                }
                else
                {
                    client.SendGroupAccountingDetails(client, groupID, transactionID, sessionID, 0, currentInterval,
                                                      intervalDays,
                                                      "Never", new GroupAccountHistory[0]);
                }
            }
        }
Example #2
0
        private void client_OnGroupAccountSummaryRequest(IClientAPI client, UUID agentID, UUID groupID, UUID requestID,
                                                         int currentInterval, int intervalDays)
        {
            IGroupsModule groupsModule = client.Scene.RequestModuleInterface <IGroupsModule>();

            if (groupsModule != null && groupsModule.GroupPermissionCheck(agentID, groupID, GroupPowers.Accountable))
            {
                IMoneyModule moneyModule = client.Scene.RequestModuleInterface <IMoneyModule>();
                if (moneyModule != null)
                {
                    int          amt     = moneyModule.Balance(groupID);
                    GroupBalance balance = moneyModule.GetGroupBalance(groupID);
                    client.SendGroupAccountingSummary(client, groupID, requestID, amt, balance.TotalTierDebit,
                                                      balance.TotalTierCredits,
                                                      Util.BuildYMDDateString(
                                                          balance.StartingDate.AddDays(-currentInterval * intervalDays)),
                                                      currentInterval, intervalDays,
                                                      Util.BuildYMDDateString(balance.StartingDate.AddDays(intervalDays)),
                                                      Util.BuildYMDDateString(
                                                          balance.StartingDate.AddDays(-(currentInterval + 1) *
                                                                                       intervalDays)),
                                                      balance.ParcelDirectoryFee, balance.LandFee, balance.GroupFee,
                                                      balance.ObjectFee);
                }
                else
                {
                    client.SendGroupAccountingSummary(client, groupID, requestID, 0, 0, 0, "Never",
                                                      currentInterval, intervalDays, "Never",
                                                      "Never", 0, 0, 0, 0);
                }
            }
        }