Esempio n. 1
0
 protected void BeforeLoan(CostReportInfo model)
 {
     if (model.IsSystem)
     {
         model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
     }
     else
     {
         //查询没有付款的票据
         var isPayList = CostReportBillInfoList.Where(p => !p.IsPay);
         if (isPayList.Any())                               //有没有付款的票据
         {
             model.State = (int)CostReportState.NoAuditing; //状态:票据待受理
         }
         else
         {
             if (model.IsLastTime)
             {
                 if (CostReportTravelInfoList.Any() || CostReportTerminiInfoList.Any() || !string.IsNullOrEmpty(model.GoodsCode) || !model.InvoiceId.Equals(Guid.Empty))
                 {
                     model.State = (int)CostReportState.NoAuditing;//状态:票据待受理
                 }
                 else
                 {
                     model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
                 }
             }
             else
             {
                 model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
             }
         }
     }
     model.Memo = WebControl.RetrunUserAndTime("[【审核】:审核通过;审核说明:" + (string.IsNullOrEmpty(txt_AuditingMemo.Text) ? "暂无说明" : txt_AuditingMemo.Text) + ";]");
 }
Esempio n. 2
0
 //票据数据源
 protected void RepeaterBillDataBind()
 {
     Repeater_Bill.DataSource = CostReportBillInfoList.OrderByDescending(p => p.OperatingTime).ThenByDescending(p => p.IsPay);
     Repeater_Bill.DataBind();
     lit_SumNoTaxAmount.Text = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.NoTaxAmount)) + "元";
     lit_SumTax.Text         = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.Tax)) + "元";
     lit_SumTaxAmount.Text   = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.TaxAmount)) + "元";
 }
 protected void BeforeLoan(CostReportInfo model)
 {
     if (model.IsSystem)
     {
         model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
     }
     else
     {
         //获取票据
         CostReportBillInfoList = _costReportBill.Getlmshop_CostReportBillByReportId(model.ReportId);
         //查询没有付款的票据
         var isPayList = CostReportBillInfoList.Where(p => !p.IsPay);
         if (isPayList.Any())                               //有没有付款的票据
         {
             model.State = (int)CostReportState.NoAuditing; //状态:票据待受理
         }
         else
         {
             if (model.IsLastTime)
             {
                 //获取差旅费
                 CostReportTravelInfoList = _costReportTravel.GetlmShop_CostReportTravelByReportId(model.ReportId);
                 //获取起讫
                 CostReportTerminiInfoList = _costReportTermini.GetmShop_CostReportTerminiByReportId(model.ReportId);
                 if (CostReportTravelInfoList.Any() || CostReportTerminiInfoList.Any() || !string.IsNullOrEmpty(model.GoodsCode) || !model.InvoiceId.Equals(Guid.Empty))
                 {
                     model.State = (int)CostReportState.NoAuditing;//状态:票据待受理
                 }
                 else
                 {
                     model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
                 }
             }
             else
             {
                 model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
             }
         }
     }
     model.Memo = ERP.UI.Web.Common.WebControl.RetrunUserAndTime("[【审核】:审核通过;]");
 }
Esempio n. 4
0
        //初始化页面数据
        protected void LoadReportData(CostReportInfo model)
        {
            rbl_ReportKind.SelectedValue   = model.ReportKind.ToString();
            ddl_AssumeBranch.SelectedValue = model.AssumeBranchId.Equals(Guid.Empty) ? string.Empty : model.AssumeBranchId.ToString();
            ddl_AssumeGroup.SelectedValue  = model.AssumeGroupId.Equals(Guid.Empty) ? string.Empty : model.AssumeGroupId.ToString();
            ddl_AssumeShop.SelectedValue   = model.AssumeShopId.Equals(Guid.Empty) ? string.Empty : model.AssumeShopId.ToString();
            txt_GoodsCode.Text             = model.GoodsCode;
            if ((model.ReportKind.Equals((int)CostReportKind.Before) && model.IsLastTime) || model.ReportKind.Equals((int)CostReportKind.Later))
            {
                if (model.CostsVarieties.Equals(0))
                {
                    CompanyClass.Visible = ImgCompanyClass.Visible = true;
                }
                else if (model.CostsVarieties.Equals(1))
                {
                    GoodsCode.Visible = txtGoodsCode.Visible = true;
                }
            }
            txt_CompanyClass.Text           = Cost.ReadInstance.GetCompanyName(model.CompanyClassId, model.CompanyId);
            rbl_UrgentOrDefer.SelectedValue = model.UrgentOrDefer.ToString();
            txt_UrgentReason.Text           = model.UrgentReason;
            txt_ReportName.Text             = model.ReportName + (model.ApplyNumber > 1 ? "  " + WebControl.ConvertToChnName(model.ApplyNumber) + "期" : string.Empty);
            if (model.ReportKind.Equals((int)CostReportKind.Before))
            {
                lit_ReportName.Text = "借款内容";
            }
            txt_StartTime.Text  = model.StartTime.ToString("yyyy年MM月");
            txt_EndTime.Text    = model.EndTime.ToString("yyyy年MM月");
            txt_PayCompany.Text = model.PayCompany;
            //“申报类型”是费用收入时,“收款人”变成“付款人”
            if (model.ReportKind.Equals((int)CostReportKind.FeeIncome))
            {
                lit_PayCompany.Text = "付款";
            }
            else
            {
                #region 预借款、凭证报销、已扣款核销 有“票据类型”
                BillType.Visible              = true;
                txt_InvoiceTitle.ToolTip      = txt_InvoiceTitle.Text = model.InvoiceTitle;
                rbl_InvoiceType.SelectedValue = string.Format("{0}", model.InvoiceType);
                if (model.InvoiceType.Equals((int)CostReportInvoiceType.Invoice) || model.InvoiceType.Equals((int)CostReportInvoiceType.VatInvoice))
                {
                    InvoiceType.InnerText  = "发票";
                    InvoiceTitle.InnerHtml = "发票抬头:";

                    BillNo.InnerText    = "发票号码";
                    BillCode.Visible    = true;
                    TaxAmount.InnerText = "含税金额";

                    if (model.InvoiceType.Equals((int)CostReportInvoiceType.Invoice))
                    {
                        NoTaxAmount.Visible = Tax.Visible = false;
                    }
                    else if (model.InvoiceType.Equals((int)CostReportInvoiceType.VatInvoice))
                    {
                        NoTaxAmount.Visible = Tax.Visible = true;
                    }
                }
                else if (model.InvoiceType.Equals((int)CostReportInvoiceType.Voucher))
                {
                    InvoiceType.InnerText  = "收据";
                    InvoiceTitle.InnerHtml = "收据抬头:";

                    BillNo.InnerText    = "收据号码";
                    BillCode.Visible    = false;
                    TaxAmount.InnerText = "金额";
                    NoTaxAmount.Visible = Tax.Visible = false;
                }
                #endregion
            }
            if (model.ReportKind.Equals((int)CostReportKind.Before))
            {
                lit_ReportCost.Text = "预估申报";
            }
            txt_ReportCost.Text        = WebControl.RemoveDecimalEndZero(Math.Abs(model.ReportCost));
            Lit_CapitalAmount.Text     = Math.Abs(model.ReportCost).ToString(CultureInfo.InvariantCulture);
            rbl_CostType.SelectedValue = model.CostType.ToString();
            if (model.CostType.Equals(2))//转账
            {
                if (!string.IsNullOrEmpty(model.BankAccountName))
                {
                    txt_BankName.Text    = model.BankAccountName.Split(',')[0];
                    txt_SubBankName.Text = model.BankAccountName.Split(',')[1];
                }
                if (model.ReportKind.Equals((int)CostReportKind.Before) || model.ReportKind.Equals((int)CostReportKind.Later))
                {
                    txt_BankAccount.Text = model.BankAccount;
                    BankName.Visible     = txtBankName.Visible = SubBankName.Visible = txtSubBankName.Visible = BankAccount.Visible = txtBankAccount.Visible = true;
                }
                else if (model.ReportKind.Equals((int)CostReportKind.Paying) || model.ReportKind.Equals((int)CostReportKind.FeeIncome))
                {
                    BankName.Visible = txtBankName.Visible = SubBankName.Visible = txtSubBankName.Visible = true;
                }
            }
            if (model.ReportKind.Equals((int)CostReportKind.Before) || model.ReportKind.Equals((int)CostReportKind.Later))
            {
                lit_BankName.Text = lit_SubBankName.Text = "收款";
            }
            else if (model.ReportKind.Equals((int)CostReportKind.Paying) || model.ReportKind.Equals((int)CostReportKind.FeeIncome))
            {
                lit_BankName.Text = lit_SubBankName.Text = "付款";

                PayBankAccountAndAssumeFiliale.Visible = true;
                if (!model.PayBankAccountId.Equals(Guid.Empty))
                {
                    var    bankAccountInfo = _bankAccounts.GetBankAccounts(model.PayBankAccountId);
                    string payBankAccount  = bankAccountInfo.BankName + "【" + bankAccountInfo.AccountsName + "】";
                    txt_PayBankAccount.ToolTip = txt_PayBankAccount.Text = payBankAccount;
                    txt_AssumeFiliale.Text     = CacheCollection.Filiale.GetFilialeNameAndFilialeId(model.PayBankAccountId).Split(',')[0];
                }
            }

            //押金回收生成的“凭证报销”和“费用收入”有押金编号,此处要显示
            if (!string.IsNullOrEmpty(model.DepositNo))
            {
                DepositNo.Visible  = txtDepositNo.Visible = true;
                txt_DepositNo.Text = model.DepositNo;
            }

            txt_ReportMemo.Text = model.ReportMemo;

            #region 广告使用图片(广告费=>推广费用)
            if (!model.InvoiceId.Equals(Guid.Empty))
            {
                var costReportInvoice = _costReportInvoice.GetInvoice(model.InvoiceId);
                if (costReportInvoice != null && !costReportInvoice.InvoiceId.Equals(Guid.Empty))
                {
                    PreA.HRef          = costReportInvoice.ImagePath;
                    PreA.Visible       = true;
                    UploadImgName.Text = costReportInvoice.ImagePath.Substring(costReportInvoice.ImagePath.LastIndexOf('/') + 1);
                }
            }
            #endregion

            #region 差旅费
            if (((model.ReportKind.Equals((int)CostReportKind.Before) && model.IsLastTime) || model.ReportKind == (int)CostReportKind.Later) && !model.CompanyId.Equals(Guid.Empty) && model.CompanyId.Equals(new Guid(CostReport_TravelExpenses)))
            {
                //获取差旅费
                CostReportTravelInfoList = _costReportTravel.GetlmShop_CostReportTravelByReportId(model.ReportId);
                if (CostReportTravelInfoList.Any())
                {
                    LoadTravelData(CostReportTravelInfoList);
                }
                //获取起讫
                CostReportTerminiInfoList = _costReportTermini.GetmShop_CostReportTerminiByReportId(model.ReportId);
                if (CostReportTerminiInfoList.Any())
                {
                    RepeaterTerminiDataBind();
                }
                txt_CompanyClass.Style["color"]       = "red";
                txt_CompanyClass.Style["font-weight"] = "bold";
                MessageBox.AppendScript(this, "$(\"#TraveA\").show();$(\"#TraveDetail\").show();$(\"input[id$='Hid_Travel']\").val(\"0\");");
            }
            #endregion

            if (model.ReportKind.Equals((int)CostReportKind.Before))
            {
                if (!model.PayCost.Equals(0))
                {
                    IsLastTime.Visible          = true;
                    rb_IsLastTime.SelectedValue = model.IsLastTime.ToString();
                    if (bool.Parse(rb_IsLastTime.SelectedValue))
                    {
                        #region 是否终结
                        rbIsEndTitle.Visible   = rbIsEnd.Visible = true;
                        rb_IsEnd.SelectedValue = model.IsEnd.ToString();
                        #endregion
                    }
                }
                #region 申请金额
                //获取申请金额
                CostReportAmountInfoList = _costReportAmount.GetmShop_CostReportAmountByReportId(model.ReportId).Where(p => !p.IsSystem).ToList();
                if (CostReportAmountInfoList.Any())
                {
                    RepeaterAmountDataBind();
                    Amount.Visible = true;
                }
                #endregion
            }

            if (string.IsNullOrEmpty(model.DepositNo) && (model.ReportKind.Equals((int)CostReportKind.FeeIncome) || model.CompanyClassId.Equals(new Guid(CostReport_DepositMargins))))
            {
                Amount.Visible = false;
            }

            #region 票据类型相关
            //获取票据
            CostReportBillInfoList = _costReportBill.Getlmshop_CostReportBillByReportId(model.ReportId);
            if (CostReportBillInfoList.Any())
            {
                RepeaterBillDataBind();
                Bill.Visible = true;
            }
            #endregion

            #region 是否有权限更改“申报部门”
            var isEnabled = GetPowerOperationPoint("SetAssume");
            ddl_AssumeBranch.Enabled = isEnabled;
            ddl_AssumeGroup.Enabled  = isEnabled;
            ddl_AssumeShop.Enabled   = isEnabled;
            #endregion

            Hid_ReportPersonnelId.Value = model.ReportPersonnelId.ToString();
        }