Ejemplo n.º 1
0
            /// <summary>
            /// 根据银行账号Id获取结算公司名称和结算公司Id
            /// </summary>
            /// <param name="bankaccountId">银行账号Id</param>
            /// <returns></returns>
            /// zal 2015-11-11
            public static string GetFilialeNameAndFilialeId(Guid bankaccountId)
            {
                string filialeName = "-", filialeId = Guid.Empty.ToString();

                if (!bankaccountId.Equals(Guid.Empty))
                {
                    //主账号一定会绑定公司(即存在绑定表中),一个公司有多个主账号
                    var bankAccountBindList = BankAccountManager.ReadInstance.GetList(bankaccountId);
                    var filialeInfoList     = GetHeadList();
                    var joinQuery           = (from bankAccountBind in bankAccountBindList
                                               join filialeInfo in filialeInfoList
                                               on bankAccountBind.TargetId equals filialeInfo.ID
                                               select new
                    {
                        filialeName = filialeInfo.Name,
                        filialeId = filialeInfo.ID
                    }).ToList();

                    if (joinQuery.Any())
                    {
                        var firstOrDefault = joinQuery.First();
                        filialeName = firstOrDefault.filialeName;
                        filialeId   = firstOrDefault.filialeId.ToString();
                    }
                    else
                    {
                        filialeName = "ERP公司";
                        filialeId   = ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID");
                    }
                }
                return(filialeName + "," + filialeId);
            }
Ejemplo n.º 2
0
 public BankAccountManager(IBankAccounts bankAccounts, IBankAccountDao bankAccountDao, IWasteBook wasteBook, Guid elseFilialeId)
 {
     _bankAccountDao         = bankAccountDao;
     _bankAccounts           = bankAccounts;
     _wasteBookDao           = wasteBook;
     _reckoningElseFilialeid = elseFilialeId == Guid.Empty ? new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")) : elseFilialeId;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取收款单:资金流(转账)。百秀兰溪》上海百秀旗舰店转账。
        /// 功能点:ERP资金流=》转账
        /// 业务点:上海百秀旗舰店天猫帮忙卖 百秀兰溪商品(财务手工做一次转账-ERP资金流转账)
        /// 数据库:lmShop_WasteBook
        /// </summary>
        /// <returns></returns>
        public IList <WasteBookDTO> GetGathering_WasteBook(DateTime StartTime, DateTime EndTime)
        {
            string LogisticsCompany = ConfigManage.GetConfigValue("BaiXiu_Lanxi_ID");    //物流公司
            string SalesCompany     = ConfigManage.GetConfigValue("BaiXiu_Shanghai_ID"); //销售公司

            return(_gatheringDAL.GetGathering_WasteBook(StartTime, EndTime, LogisticsCompany, SalesCompany));
        }
Ejemplo n.º 4
0
 public BankAccountManager(Environment.GlobalConfig.DB.FromType fromType)
 {
     _bankAccountDao         = InventoryInstance.GetBankAccountDao(fromType);
     _bankAccounts           = InventoryInstance.GetBankAccountsDao(fromType);
     _wasteBookDao           = InventoryInstance.GetWasteBookDao(fromType);
     _reckoningElseFilialeid = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID"));
 }
Ejemplo n.º 5
0
        private void LoadData()
        {
            var list = CacheCollection.Filiale.GetHeadList();

            list.Add(new FilialeInfo {
                ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司"
            });
            RCB_Filliale.DataSource     = list;
            RCB_Filliale.DataValueField = "ID";
            RCB_Filliale.DataTextField  = "Name";
            RCB_Filliale.DataBind();
            RCB_Filliale.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString()));


            RCB_Branch.DataSource     = CacheCollection.Branch.GetSystemBranchList().Where(act => act.ParentID == Guid.Empty).ToList();
            RCB_Branch.DataValueField = "ID";
            RCB_Branch.DataTextField  = "Name";
            RCB_Branch.DataBind();
            RCB_Branch.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString()));

            RCB_CompanyClass.DataValueField = "CompanyClassId";
            RCB_CompanyClass.DataTextField  = "CompanyClassName";
            RCB_CompanyClass.DataSource     = _costDao.GetCompanyClassList().ToList();
            RCB_CompanyClass.DataBind();
            RCB_CompanyClass.Items.Insert(0, new RadComboBoxItem(string.Empty, Guid.Empty.ToString()));

            RDP_StartTime.SelectedDate = DateTime.Now.Date.AddDays(-30);
            RDP_EndTime.SelectedDate   = DateTime.Now;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 获取付款单:资金流(转账)。上海百秀旗舰店》百秀兰溪转账。
        /// 功能点:ERP资金流=》转账
        /// 业务点:上海百秀旗舰店天猫向百秀兰溪转账
        /// 数据库:lmShop_WasteBook
        /// </summary>
        /// <returns></returns>
        public IList <WasteBookDTO> GetPayment_WasteBook(DateTime StartTime, DateTime EndTime)
        {
            //转出公司(物流公司):上海百秀 444e0c93-1146-4386-bae2-cb352da70499
            //转入公司(销售公司):百秀兰溪 75621b55-2fa3-4fcf-b68a-039c28f560b6

            string LogisticsCompany = ConfigManage.GetConfigValue("BaiXiu_Shanghai_ID"); //物流公司
            string SalesCompany     = ConfigManage.GetConfigValue("BaiXiu_Lanxi_ID");    //销售公司

            return(_paymentDAL.GetPayment_WasteBook(StartTime, EndTime, LogisticsCompany, SalesCompany));
        }
        //结算公司
        protected void LoadAssumeFilialeData()
        {
            var list = CacheCollection.Filiale.GetHeadList();

            list.Add(new FilialeInfo {
                ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司"
            });
            ddl_AssumeFiliale.DataSource     = list;
            ddl_AssumeFiliale.DataTextField  = "Name";
            ddl_AssumeFiliale.DataValueField = "ID";
            ddl_AssumeFiliale.DataBind();
            ddl_AssumeFiliale.Items.Insert(0, new ListItem("全部", ""));
        }
        /// <summary>
        /// 根据公司id获取公司名称
        /// </summary>
        /// <param name="filialeId"></param>
        /// <returns></returns>
        protected string GetFilialeName(string filialeId)
        {
            FilialeInfoList.Add(new FilialeInfo {
                ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司"
            });
            var firstOrDefault = FilialeInfoList.FirstOrDefault(p => p.ID.Equals(new Guid(filialeId)));

            if (firstOrDefault != null)
            {
                return(firstOrDefault.RealName);
            }
            return("-");
        }
Ejemplo n.º 9
0
        //Grid数据源
        protected void GridDataBind()
        {
            var erpFilialeId = ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID");
            //未付款:待审核,已审核,未通过,已执行; 已付款:完成打款;
            //已审核过的单据(排除ERP公司的单据)
            var list = _companyFundReceipt.GetAllCompanyFundReceiptList().Where(p => (new int?[] { (int)CompanyFundReceiptState.NoAuditing, (int)CompanyFundReceiptState.Audited, (int)CompanyFundReceiptState.Executed, (int)CompanyFundReceiptState.Finish }).Contains(p.ReceiptStatus) && p.ReceiptType.Equals(1) && !p.FilialeId.ToString().Contains(erpFilialeId.ToLower())).OrderBy(p => p.ApplyDateTime).AsQueryable();

            #region 查询条件
            if (!string.IsNullOrEmpty(ddl_SaleFiliale.SelectedValue))
            {
                list = list.Where(p => p.FilialeId.Equals(new Guid(ddl_SaleFiliale.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(rcb_CompanyList.SelectedValue))
            {
                list = list.Where(p => p.CompanyID.Equals(new Guid(rcb_CompanyList.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(txt_ApplyDateTimeStart.Text))
            {
                var startTime = DateTime.Parse(txt_ApplyDateTimeStart.Text);
                list = list.Where(p => p.ApplyDateTime >= startTime);
            }
            if (!string.IsNullOrEmpty(txt_ApplyDateTimeEnd.Text))
            {
                var endtime = DateTime.Parse(txt_ApplyDateTimeEnd.Text);
                list = list.Where(p => p.ApplyDateTime < endtime.AddDays(1));
            }
            if (!string.IsNullOrEmpty(txt_ReceipNo.Text))
            {
                list = list.Where(p => p.ReceiptNo.Equals(txt_ReceipNo.Text));
            }
            if (!string.IsNullOrEmpty(ddl_ReceiptStatus.SelectedValue))
            {
                list = list.Where(p => p.ReceiptStatus.Equals(int.Parse(ddl_ReceiptStatus.SelectedValue)));
            }
            if (!string.IsNullOrEmpty(dll_InvoiceType.SelectedValue))
            {
                list = list.Where(p => p.InvoiceType.Equals(int.Parse(dll_InvoiceType.SelectedValue)));
                if (!String.IsNullOrWhiteSpace(txtBillingUnit.Text))
                {
                    var invoiceId = _companyFundReceiptInvoice.GetAlllmshop_CompanyFundReceiptInvoice()
                                    .Where(ent => ent.BillingUnit.Contains(txtBillingUnit.Text)).Select(ent => ent.ReceiptID);
                    list = list.Where(ent => invoiceId.Contains(ent.ReceiptID));
                }
            }
            #endregion

            RG_ReceiptInvoice.DataSource = list.OrderByDescending(p => p.ApplyDateTime);
        }
Ejemplo n.º 10
0
        //遍历往来单位
        private double RepetitionCompanyCussent(Guid companyClassId, IList <CompanyBalanceInfo> allCompanyBalanceList, IList <CompanyBalanceDetailInfo> allCompanyBalanceDetailList, RadTreeNode node)
        {
            double accountCount = 0;
            IList <CompanyCussentInfo> companyCussentList = AllCompanyList.Where(w => w.CompanyClassId == companyClassId).ToList();

            foreach (CompanyCussentInfo companyCussentInfo in companyCussentList)
            {
                double leCount;
                if (FilialeId != Guid.Empty)
                {
                    var companyBalanceDetailInfo = allCompanyBalanceDetailList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId && w.FilialeId == FilialeId);
                    leCount = companyBalanceDetailInfo == null ? 0 : Convert.ToDouble(companyBalanceDetailInfo.NonceBalance);
                }
                else
                {
                    var companyBalanceInfo = allCompanyBalanceList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId);
                    leCount = companyBalanceInfo == null ? 0 : Convert.ToDouble(companyBalanceInfo.NonceBalance);
                }
                accountCount += leCount;
                RadTreeNode childNode = CreateNode(companyCussentInfo.CompanyName, false, companyCussentInfo.CompanyId.ToString());
                childNode.ToolTip = "Company";
                childNode.Text   += "[" + leCount.ToString("N") + "]";
                node.Nodes.Add(childNode);

                IList <FilialeInfo> list = FilialeList.Where(ent => ent.FilialeTypes.Contains((int)FilialeType.LogisticsCompany) || ent.FilialeTypes.Contains((int)FilialeType.SaleCompany)).ToList();
                if (companyCussentInfo.RelevanceFilialeId != Guid.Empty)
                {
                    list = list.Where(f => f.ID != companyCussentInfo.RelevanceFilialeId).ToList();
                }
                list.Add(new FilialeInfo {
                    ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP"
                });
                foreach (var filialeInfo in list)
                {
                    var    companyBalanceDetailInfo = allCompanyBalanceDetailList.FirstOrDefault(w => w.CompanyId == companyCussentInfo.CompanyId && w.FilialeId == filialeInfo.ID);
                    double sum   = companyBalanceDetailInfo == null ? 0 : Convert.ToDouble(companyBalanceDetailInfo.NonceBalance);
                    var    fnode = new RadTreeNode(filialeInfo.Name + "[" + sum.ToString("N") + "]", filialeInfo.ID.ToString())
                    {
                        ToolTip = "Filiale"
                    };
                    childNode.Nodes.Add(fnode);
                }
            }
            return(accountCount);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 根据公司id获取公司名称
        /// </summary>
        /// <param name="filialeId"></param>
        /// <returns></returns>
        protected string GetFilialeName(string filialeId)
        {
            var list = CacheCollection.Filiale.GetHeadList();

            list.Add(new FilialeInfo {
                ID = new Guid(ConfigManage.GetConfigValue("RECKONING_ELSE_FILIALEID")), Name = "ERP公司"
            });
            var firstOrDefault = list.FirstOrDefault(p => p.ID.Equals(new Guid(filialeId)));

            if (firstOrDefault != null)
            {
                return(firstOrDefault.Name);
            }
            else
            {
                return("-");
            }
        }