internal void method_35(AccountReport accountReport_0)
 {
     if (this.strategy__0 != null && this.strategy__0.Status == StrategyStatus.Running)
     {
         this.idArray_1[accountReport_0.int_4].vmethod_37(accountReport_0);
     }
 }
Exemple #2
0
        private void accountReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;
            AccountReport form = new AccountReport();

            form.MdiParent = this;
            form.Show();
        }
Exemple #3
0
        public void Execute(AccountOpenedEvent theEvent)
        {
            var account        = new AccountReport(theEvent.AccountId, theEvent.ClientId, theEvent.AccountName, theEvent.AccountNumber);
            var accountDetails = new AccountDetailsReport(theEvent.AccountId, theEvent.ClientId, theEvent.AccountName, 0.0M, theEvent.AccountNumber);

            _reportingRepository.Save(account);
            _reportingRepository.Save(accountDetails);
        }
        private AccountReport GetReportObject(string itemId, BusinessDbContext bDb)
        {
            var detail = bDb.AccountHeads.First(x => x.Id == itemId);
            var report = new AccountReport {
                AccountHeadId = detail.Id, AccountHeadName = detail.Name
            };

            return(report);
        }
Exemple #5
0
 private new void EmitAccountReport(AccountReport report, bool queued = true)
 {
     if (queued && _accountQueue != null)
     {
         _accountQueue.Enqueue(report);
         return;
     }
     framework.EventManager.OnEvent(report);
 }
Exemple #6
0
        protected override void SetupDependencies()
        {
            OnDependency <IReportingRepository>()
            .Setup(x => x.Save(It.IsAny <AccountReport>()))
            .Callback <AccountReport>(a => SaveAccountReportObject = a);

            OnDependency <IReportingRepository>()
            .Setup(x => x.Save(It.IsAny <AccountDetailsReport>()))
            .Callback <AccountDetailsReport>(a => SaveAccountDetailsReportObject = a);
        }
Exemple #7
0
        protected override void SetupDependencies()
        {
            OnDependency <IPopupPresenter>()
            .Setup(x => x.CatchPossibleException(It.IsAny <Action>()))
            .Callback <Action>(x => x());

            _accountReport = new AccountReport(Guid.NewGuid(), Guid.NewGuid(), "Account name", "1234567890");

            OnDependency <IClientDetailsView>()
            .Setup(x => x.GetSelectedAccount())
            .Returns(_accountReport);
        }
Exemple #8
0
        public void Will_be_able_to_save_and_retrieve_an_account_dto()
        {
            var accountDto = new AccountReport(Guid.NewGuid(), Guid.NewGuid(), "Account Name", "1234567890");

            _repository.Save(accountDto);
            var sut = _repository.GetByExample <AccountReport>(new { AccountName = "Account Name" }).FirstOrDefault();

            Assert.That(sut.Id, Is.EqualTo(accountDto.Id));
            Assert.That(sut.ClientDetailsReportId, Is.EqualTo(accountDto.ClientDetailsReportId));
            Assert.That(sut.AccountName, Is.EqualTo(accountDto.AccountName));
            Assert.That(sut.AccountNumber, Is.EqualTo(accountDto.AccountNumber));
        }
Exemple #9
0
        protected override void SetupDependencies()
        {
            _accountDetailsReport = new AccountDetailsReport(Guid.NewGuid(), Guid.NewGuid(), "Account name", 10.5M, "1234567890");
            var accountDetailsReports = new List <AccountDetailsReport> {
                _accountDetailsReport
            };

            OnDependency <IReportingRepository>()
            .Setup(x => x.GetByExample <AccountDetailsReport>(It.IsAny <object>()))
            .Returns(accountDetailsReports);

            var accountReport1 = new AccountReport(Guid.NewGuid(), Guid.NewGuid(), "Account name 1", "1234567890");
            var accountReport2 = new AccountReport(Guid.NewGuid(), Guid.NewGuid(), "Account name 2", "1234567890");

            _accountReports = new List <AccountReport> {
                accountReport1, accountReport2
            };

            OnDependency <IReportingRepository>()
            .Setup(x => x.GetByExample <AccountReport>(It.IsAny <object>()))
            .Returns(_accountReports);
        }
Exemple #10
0
        protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");

                AccountReport model = e.Row.DataItem as AccountReport;
                LinkButton    lb1   = e.Row.FindControl("LinkButton1") as LinkButton;
                lb1.OnClientClick = string.Format("javascript:window.open('../JXC/Sell_OrderPFList.aspx?InvoiceNo={0}','_blank'); return false;", model.All_InvoiceNo);

                LinkButton lb2 = e.Row.FindControl("LinkButton2") as LinkButton;
                lb2.OnClientClick = string.Format("javascript:window.open('../JXC/Sell_OrderPFList.aspx?InvoiceNo={0}','_blank'); return false;", model.OA_InvoiceNo);


                LinkButton lb3 = e.Row.FindControl("LinkButton3") as LinkButton;
                lb3.OnClientClick = string.Format("javascript:window.open('WFInvoiceList.aspx?InvoiceNo={0}','_blank'); return false;", model.Kingdee_InvoiceNo);

                var accountReport = e.Row.DataItem as AccountReport;
                if (accountReport != null)
                {
                    if (!string.IsNullOrEmpty(accountReport.All_InvoiceNo))
                    {
                        string pono      = "";
                        string guestName = "";

                        Label     lblAll_PONO = e.Row.FindControl("lblAll_PONO") as Label;
                        Hashtable hs          = new Hashtable();
                        var       l           = list.FindAll(t => t.key == model.All_InvoiceNo);
                        string    ae          = "";
                        foreach (var m in l)
                        {
                            pono += m.value + ",";
                            if (!hs.ContainsKey(m.value1))
                            {
                                guestName += m.value1 + ",";
                                ae        += m.AE + ",";
                                hs.Add(m.value1, null);
                            }
                        }
                        lblAll_PONO.Text = pono.Trim(',');
                        Label lblAll_OAGuestName = e.Row.FindControl("lblAll_OAGuestName") as Label;
                        lblAll_OAGuestName.Text = guestName.Trim(',');

                        Label lblAll_OAAE = e.Row.FindControl("lblAll_OAAE") as Label;
                        lblAll_OAAE.Text = ae.Trim(',');
                    }

                    if (!string.IsNullOrEmpty(accountReport.OA_InvoiceNo) && cbInvoTotalToge.Checked)
                    {
                        string    pono      = "";
                        string    guestName = "";
                        var       l         = list.FindAll(t => t.key == model.OA_InvoiceNo);
                        Hashtable hs        = new Hashtable();
                        foreach (var m in l)
                        {
                            pono += m.value + ",";
                            if (!hs.ContainsKey(m.value1))
                            {
                                guestName += m.value1 + ",";
                                hs.Add(m.value1, null);
                            }
                        }
                        Label lblOA_PONO = e.Row.FindControl("lblOA_PONO") as Label;
                        lblOA_PONO.Text = pono.Trim(',');

                        Label lblOA_GuestName = e.Row.FindControl("lblOA_GuestName") as Label;
                        lblOA_GuestName.Text = guestName.Trim(',');
                    }
                    if (accountReport.All_OATotal != accountReport.All_AccountTotal)
                    {
                        e.Row.BackColor = System.Drawing.Color.Khaki;
                    }
                    if (accountReport.All_InvoiceTotal != null && string.IsNullOrEmpty(lblQuanXian.Text))
                    {
                        LinkButton lblRecord = e.Row.FindControl("lblRecord") as LinkButton;

                        lblRecord.Enabled = false;

                        accountReport.All_OATotal      = accountReport.All_OATotal ?? 0;
                        accountReport.All_AccountTotal = accountReport.All_AccountTotal ?? 0;
                        if (accountReport.All_OATotal < accountReport.All_InvoiceTotal && accountReport.All_AccountTotal == accountReport.All_InvoiceTotal)
                        {
                            e.Row.BackColor   = System.Drawing.Color.YellowGreen;
                            lblRecord.Enabled = true;
                            string pono              = "";
                            string linkPono          = "";
                            string sql               = string.Format(" FPNo='{0}'", model.All_InvoiceNo);;
                            List <Sell_OrderFP> cars = this.POSer.GetFPtoInvoiceView_AccountCom(sql);
                            foreach (var m in cars)
                            {
                                pono += m.PONo + ",";
                                if ((int)DBHelp.ExeScalar(string.Format("select count(*) from TB_ToInvoice  WHERE State='执行中' and PoNo='{0}'", m.PONo)) > 0)
                                {
                                    lblRecord.Enabled = false;
                                }
                                else
                                {
                                    linkPono += string.Format("window.open('../EFrom/WFToInvoice.aspx?ProId=27&NewPONO={0}&weiDao={1}&GuestName={2}&POName={3}&FPNo={4}&FPId={5}','_blank');", m.PONo,
                                                              m.chaTotals, HttpUtility.UrlEncode(m.GuestName), HttpUtility.UrlEncode(m.POName), m.FPNo, m.Id);
                                }
                            }
                            pono = pono.Trim(',');

                            accountReport.Record = pono;
                            if (string.IsNullOrEmpty(lblLianJie.Text))
                            {
                                lblRecord.OnClientClick = string.Format("javascript:" + linkPono + " return false;");
                            }
                            var doing = POSer.GetFPtoInvoiceView_Doing(" and " + sql);
                            if (doing.Count > 0)
                            {
                                Label  lblRecordString = e.Row.FindControl("lblRecordString") as Label;
                                string ponoDing        = "";
                                foreach (var m in doing)
                                {
                                    ponoDing += m + ",";
                                }
                                lblRecordString.Text = ponoDing.Trim(',');
                            }
                        }
                        else if (accountReport.All_OATotal == accountReport.All_InvoiceTotal && accountReport.All_AccountTotal == accountReport.All_InvoiceTotal)
                        {
                            accountReport.Record = "勿";
                            lblRecord.BackColor  = System.Drawing.Color.Blue;
                            lblRecord.ForeColor  = System.Drawing.Color.White;
                        }
                        else if (accountReport.All_OATotal == accountReport.All_InvoiceTotal && accountReport.All_AccountTotal < accountReport.All_InvoiceTotal)
                        {
                            accountReport.Record = "勿,OA到帐需要警示和核对";
                            lblRecord.BackColor  = System.Drawing.Color.Red;
                        }
                        else if (accountReport.All_OATotal < accountReport.All_InvoiceTotal && accountReport.All_AccountTotal < accountReport.All_InvoiceTotal)
                        {
                            e.Row.BackColor = System.Drawing.Color.YellowGreen;
                            //.  OA 到款金额<金蝶到帐金额  ,在记录一栏 ,你就显示 这张发票对应的项目编号,做一个超链接 到 到款单界面(见第二界面)
                            //,传递申请人,项目编号,项目名称,客户名称,发票编号,当天日期时间,和该发票到款金额= (金蝶到帐金额-OA到帐金额)
                            if (accountReport.All_OATotal < accountReport.All_AccountTotal)
                            {
                                lblRecord.Enabled = true;
                                string pono              = "";
                                string linkPono          = "";
                                string linkPonoFalse     = "";
                                string sql               = string.Format(" FPNo='{0}'", model.All_InvoiceNo);;
                                List <Sell_OrderFP> cars = this.POSer.GetFPtoInvoiceView_AccountCom(sql);
                                foreach (var m in cars)
                                {
                                    pono += m.PONo + ",";
                                    if ((int)DBHelp.ExeScalar(string.Format("select count(*) from TB_ToInvoice  WHERE State='执行中' and PoNo='{0}'", m.PONo)) > 0)
                                    {
                                        lblRecord.Enabled = false;
                                    }
                                    else
                                    {
                                        linkPono += string.Format("window.open('../EFrom/WFToInvoice.aspx?ProId=27&NewPONO={0}&weiDao={1}&GuestName={2}&POName={3}&FPNo={4}&FPId={5}','_blank');", m.PONo,
                                                                  (accountReport.All_AccountTotal - accountReport.All_OATotal), HttpUtility.UrlEncode(m.GuestName), HttpUtility.UrlEncode(m.POName), m.FPNo, m.Id);
                                    }
                                }
                                pono = pono.Trim(',');

                                accountReport.Record = pono;
                                if (string.IsNullOrEmpty(lblLianJie.Text))
                                {
                                    if (!string.IsNullOrEmpty(linkPono))
                                    {
                                        lblRecord.OnClientClick = string.Format("javascript:" + linkPono + " return false;");
                                    }
                                }
                                var   doing           = POSer.GetFPtoInvoiceView_Doing(" and " + sql);
                                Label lblRecordString = e.Row.FindControl("lblRecordString") as Label;
                                if (doing.Count > 0)
                                {
                                    string ponoDing = "";
                                    foreach (var m in doing)
                                    {
                                        ponoDing += m + ",";
                                    }
                                    lblRecordString.Text = ponoDing.Trim(',');
                                }
                            }
                            else
                            {
                                accountReport.Record = "勿,OA到帐需要核对";
                                lblRecord.BackColor  = System.Drawing.Color.Blue;
                                lblRecord.ForeColor  = System.Drawing.Color.White;
                            }
                        }
                        else
                        {
                            accountReport.Record = "勿,OA到款需要警示";
                            lblRecord.BackColor  = System.Drawing.Color.Blue;
                            lblRecord.ForeColor  = System.Drawing.Color.White;
                        }
                        lblRecord.Text = accountReport.Record;
                    }
                }
            }
        }
Exemple #11
0
        protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#EAF1FD',this.style.fontWeight='';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");

                AccountReport model = e.Row.DataItem as AccountReport;
                LinkButton    lb1   = e.Row.FindControl("LinkButton1") as LinkButton;
                lb1.OnClientClick = string.Format("javascript:window.open('../JXC/Sell_OrderPFList.aspx?InvoiceNo={0}','_blank'); return false;", model.All_InvoiceNo);


                var accountReport = e.Row.DataItem as AccountReport;
                if (accountReport != null)
                {
                    if (!string.IsNullOrEmpty(accountReport.All_InvoiceNo))
                    {
                        string pono      = "";
                        string guestName = "";

                        Label     lblAll_PONO = e.Row.FindControl("lblAll_PONO") as Label;
                        Hashtable hs          = new Hashtable();
                        var       l           = list.FindAll(t => t.key == model.All_InvoiceNo);
                        foreach (var m in l)
                        {
                            pono += m.value + ",";
                            if (!hs.ContainsKey(m.value1))
                            {
                                guestName += m.value1 + ",";
                                hs.Add(m.value1, null);
                            }
                        }
                        lblAll_PONO.Text = pono.Trim(',');
                        Label lblAll_OAGuestName = e.Row.FindControl("lblAll_OAGuestName") as Label;
                        lblAll_OAGuestName.Text = guestName.Trim(',');
                    }

                    if (!string.IsNullOrEmpty(accountReport.OA_InvoiceNo) && cbInvoTotalToge.Checked)
                    {
                        string    pono      = "";
                        string    guestName = "";
                        var       l         = list.FindAll(t => t.key == model.OA_InvoiceNo);
                        Hashtable hs        = new Hashtable();
                        foreach (var m in l)
                        {
                            pono += m.value + ",";
                            if (!hs.ContainsKey(m.value1))
                            {
                                guestName += m.value1 + ",";
                                hs.Add(m.value1, null);
                            }
                        }
                        Label lblOA_PONO = e.Row.FindControl("lblOA_PONO") as Label;
                        lblOA_PONO.Text = pono.Trim(',');

                        Label lblOA_GuestName = e.Row.FindControl("lblOA_GuestName") as Label;
                        lblOA_GuestName.Text = guestName.Trim(',');
                    }

                    if (accountReport.All_InvoiceTotal != null && string.IsNullOrEmpty(lblQuanXian.Text))
                    {
                        LinkButton lblRecord = e.Row.FindControl("lblRecord") as LinkButton;

                        lblRecord.Enabled = false;

                        accountReport.All_OATotal      = accountReport.All_OATotal ?? 0;
                        accountReport.All_AccountTotal = accountReport.All_AccountTotal ?? 0;
                        if (accountReport.All_OATotal < accountReport.All_InvoiceTotal && accountReport.All_AccountTotal == accountReport.All_InvoiceTotal)
                        {
                            lblRecord.Enabled = true;
                            string pono              = "";
                            string linkPono          = "";
                            string sql               = string.Format(" FPNo='{0}'", model.All_InvoiceNo);;
                            List <Sell_OrderFP> cars = this.POSer.GetFPtoInvoiceView(sql);
                            foreach (var m in cars)
                            {
                                pono     += m.PONo + ",";
                                linkPono += string.Format("window.open('../EFrom/WFToInvoice.aspx?ProId=27&NewPONO={0}&weiDao={1}&GuestName={2}&POName={3}&FPNo={4}&FPId={5}','_blank');", m.PONo,
                                                          m.chaTotals, m.GuestName, m.POName, m.FPNo, m.Id);
                            }
                            pono = pono.Trim(',');

                            accountReport.Record = pono;

                            lblRecord.OnClientClick = string.Format("javascript:" + linkPono + " return false;");
                        }
                        else if (accountReport.All_OATotal == accountReport.All_InvoiceTotal && accountReport.All_AccountTotal == accountReport.All_InvoiceTotal)
                        {
                            accountReport.Record = "勿";
                            lblRecord.BackColor  = System.Drawing.Color.Blue;
                            lblRecord.ForeColor  = System.Drawing.Color.White;
                        }
                        else if (accountReport.All_OATotal == accountReport.All_InvoiceTotal && accountReport.All_AccountTotal < accountReport.All_InvoiceTotal)
                        {
                            accountReport.Record = "勿,OA到帐需要警示和核对";
                            lblRecord.BackColor  = System.Drawing.Color.Red;
                        }
                        else if (accountReport.All_OATotal < accountReport.All_InvoiceTotal && accountReport.All_AccountTotal < accountReport.All_InvoiceTotal)
                        {
                            accountReport.Record = "勿,OA到帐需要核对";
                            lblRecord.BackColor  = System.Drawing.Color.Blue;
                            lblRecord.ForeColor  = System.Drawing.Color.White;
                        }
                        else
                        {
                            accountReport.Record = "勿,OA到款需要警示";
                            lblRecord.BackColor  = System.Drawing.Color.Blue;
                            lblRecord.ForeColor  = System.Drawing.Color.White;
                        }
                        lblRecord.Text = accountReport.Record;
                    }
                }
            }
        }
Exemple #12
0
 public void EmitAccountReport(AccountReport report, bool queued = true)
 {
     _provider.EmitAccountReport(report, queued);
 }
Exemple #13
0
 public void EmitAccountReport(AccountReport report, bool queued = true)
 {
     _accountQueue.Enqueue(report);
 }
Exemple #14
0
 internal void method_35(AccountReport accountReport_0)
 {
     if (this.strategy__0 != null && this.strategy__0.Status == StrategyStatus.Running)
     {
         this.idArray_1[accountReport_0.int_4].vmethod_37(accountReport_0);
     }
 }
 internal void OnAccountReport(AccountReport report) => OnEvent(report);
Exemple #16
0
 public void SetAccount(AccountReport accountReport)
 {
     _accountReport = accountReport;
 }
Exemple #17
0
        private void GenerateReport(object sender, RoutedEventArgs e)
        {
            var accountReport = new AccountReport(this.transactions.ToList <Transactions>(), this.creditBalance, this.debitBalance);

            accountReport.Show();
        }
Exemple #18
0
 internal void OnAccountReport(AccountReport report) => OnEvent(report);
        public string QuickUpdate(string shopId, string itemId, DateTime date)
        {
            date = date.Date;
            ReportDbContext   rDb = new ReportDbContext();
            BusinessDbContext bDb = new BusinessDbContext();

            AccountReport report = rDb.AccountReports.FirstOrDefault(
                x => x.ShopId == shopId && x.AccountHeadId == itemId && DbFunctions.TruncateTime(x.Date) == date);

            if (report == null)
            {
                report = this.GetReportObject(itemId, bDb);
                this.SetDefaults(report, shopId, date);
                rDb.AccountReports.Add(report);
                rDb.SaveChanges();
                report = rDb.AccountReports.First(x => x.Id == report.Id);
            }

            var incomeDetails = bDb.Transactions
                                .Where(x => x.ShopId == shopId && DbFunctions.TruncateTime(x.Created) == date).Where(
                x => x.AccountHeadId == itemId && x.TransactionFlowType == TransactionFlowType.Income)
                                .AsQueryable();

            var expenseDetails = bDb.Transactions
                                 .Where(x => x.ShopId == shopId && DbFunctions.TruncateTime(x.Created) == date).Where(
                x => x.AccountHeadId == itemId && x.TransactionFlowType == TransactionFlowType.Expense)
                                 .AsQueryable();

            var incomesToday  = incomeDetails.ToList();
            var expensesToday = expenseDetails.ToList();

            report.AmountTotalIn     = incomesToday.Sum(x => x.Amount);
            report.AmountTotalOut    = expensesToday.Sum(x => x.Amount);
            report.AmountTotalEnding = report.AmountTotalStarting + report.AmountTotalIn - report.AmountTotalOut;
            report.CountTotalTrx     = incomesToday.Count + expensesToday.Count;

            // cash
            var cashIns = incomesToday.Where(x => x.TransactionMedium == TransactionMedium.Cash).ToList();

            report.AmountCashIn = cashIns.Sum(x => x.Amount);

            var cashOuts = expensesToday.Where(x => x.TransactionMedium == TransactionMedium.Cash).ToList();

            report.AmountCashOut = cashOuts.Sum(x => x.Amount);

            report.AmountCashEnding = report.AmountCashStarting + report.AmountCashIn - report.AmountCashOut;
            report.CountCashTrx     = cashIns.Count + cashOuts.Count;

            // bank
            var bankIns = incomesToday.Where(
                x => x.TransactionMedium == TransactionMedium.Bank || x.TransactionMedium == TransactionMedium.Card ||
                x.TransactionMedium
                == TransactionMedium.Cheque)
                          .ToList();

            report.AmountBankIn = bankIns.Sum(x => x.Amount);

            var bankOuts = expensesToday.Where(
                x => x.TransactionMedium == TransactionMedium.Bank || x.TransactionMedium == TransactionMedium.Card ||
                x.TransactionMedium
                == TransactionMedium.Cheque)
                           .ToList();

            report.AmountBankOut = bankOuts.Sum(x => x.Amount);

            report.AmountBankEnding = report.AmountBankStarting + report.AmountBankIn - report.AmountBankOut;
            report.CountBankTrx     = bankIns.Count + bankOuts.Count;

            // mobile
            var mobileIns = incomesToday.Where(x => x.TransactionMedium == TransactionMedium.Mobile).ToList();

            report.AmountMobileIn = mobileIns.Sum(x => x.Amount);

            var mobileOuts = expensesToday.Where(x => x.TransactionMedium == TransactionMedium.Mobile).ToList();

            report.AmountMobileOut = mobileOuts.Sum(x => x.Amount);

            report.AmountMobileEnding = report.AmountMobileStarting + report.AmountMobileIn - report.AmountMobileOut;
            report.CountMobileTrx     = mobileIns.Count + mobileOuts.Count;

            // other
            var otherIns = incomesToday.Where(x => x.TransactionMedium == TransactionMedium.Other).ToList();

            report.AmountOtherIn = otherIns.Sum(x => x.Amount);

            var otherOuts = expensesToday.Where(x => x.TransactionMedium == TransactionMedium.Other).ToList();

            report.AmountOtherOut = otherOuts.Sum(x => x.Amount);

            report.AmountOtherEnding = report.AmountOtherStarting + report.AmountOtherIn - report.AmountOtherOut;
            report.CountOtherTrx     = otherIns.Count + otherOuts.Count;

            report.Modified = DateTime.Now;
            int i = rDb.SaveChanges();

            return(report.Id);
        }