Beispiel #1
0
        public Report_bscc(Customs.Entity.Store_out_headInfo CurOutHead, List <Customs.Entity.Store_out_listInfo> list, int PageIndex, int PageSize, bool LastPage, int FirstPage, string Title)
        {
            InitializeComponent();
            //初始化表头
            try
            {
                #region 表头部分
                //初始化表头部分
                if (Title == "监管")
                {
                    labTitle.Text = "出 口 监 管 仓 货 物";
                }
                if (Title == "保税" || Title == "MCC")
                {
                    labTitle.Text = "进 口 保 税 仓 货 物";
                }
                labPage.Text = "第 " + (PageIndex + 1).ToString() + " 续页";

                labCustom.Text = CurOutHead.Ie_port;
                if (CurOutHead.Ie_date.ToString("yyyy-MM-dd") != "1900-01-01")
                {
                    labDate.Text = CurOutHead.Ie_date.ToString("yyyy-MM-dd");
                }
                lbcust_bill_id.Text = CurOutHead.Cust_bill_id;
                lbBill_id.Text      = CurOutHead.Bill_id;
                #endregion

                #region 明细项
                if (!LastPage)
                {
                    for (int i = 1; i <= PageSize; i++)
                    {
                        int j = i + PageIndex * PageSize + FirstPage - 1;
                        init(list, i, j);
                    }
                }
                else
                {
                    for (int i = 1; i <= list.Count - FirstPage - PageIndex * PageSize; i++)
                    {
                        int j = i + PageIndex * PageSize + FirstPage - 1;
                        init(list, i, j);
                    }
                }
                #endregion
            }
            catch (Exception)
            {
                throw;
            }
        }
        public Rpt_Customs_OutWarehouseBill(Customs.Entity.Store_out_headInfo Store_Out_head, DataTable Store_Outs_lists,

            DataTable dtbSPBCODES, DataTable dtbEnterprise001, DataTable dtbInType001,DataTable dtbOutType500, DataTable c_complexys)
        {
            InitializeComponent();

            this._Store_Out_head = Store_Out_head;
            this._Store_Outs_lists = Store_Outs_lists;
            this._dtbSPBCODES = dtbSPBCODES;
            this._dtbEnterprise001 = dtbEnterprise001;
            this._dtbInType001 = dtbInType001;
            this._dtbOutType500 = dtbOutType500;

            DetailReport.DataSource = _Store_Outs_lists;

            _c_complexys = c_complexys;
        }
Beispiel #3
0
        public Rpt_Customs_OutWarehouseBill(Customs.Entity.Store_out_headInfo Store_Out_head, DataTable Store_Outs_lists,

                                            DataTable dtbSPBCODES, DataTable dtbEnterprise001, DataTable dtbInType001, DataTable dtbOutType500, DataTable c_complexys)
        {
            InitializeComponent();

            this._Store_Out_head   = Store_Out_head;
            this._Store_Outs_lists = Store_Outs_lists;
            this._dtbSPBCODES      = dtbSPBCODES;
            this._dtbEnterprise001 = dtbEnterprise001;
            this._dtbInType001     = dtbInType001;
            this._dtbOutType500    = dtbOutType500;

            DetailReport.DataSource = _Store_Outs_lists;

            _c_complexys = c_complexys;
        }
Beispiel #4
0
        public Report_ckjgcc(Customs.Entity.Store_out_headInfo CurOutHead, List <Customs.Entity.Store_out_listInfo> CurOutList, string Type)
        {
            InitializeComponent();
            //Type = "保税";
            try
            {
                #region 表头项
                if (Type == "监管")
                {
                    tbWareName.Text    = "华南物流监管仓";
                    tbVar.Text         = "集装箱号";
                    tbTitle.Text       = "出 口 监 管 仓 货 物";
                    labCustomCode.Text = CurOutHead.Bill_id;
                    //labWareNO.Text = CurOutHead.Store_code;
                    //tbSum.Visible = false;
                }
                if (Type == "保税" || Type == "MCC")
                {
                    xrPictureBox1.Visible = false;
                    labCustomCode.Visible = false;
                    xrLabel3.Visible      = false;
                    tbTitle.Text          = "进 口 保 税 仓 货 物";
                    tbWareName.Text       = "华南物流保税仓";
                    tbVar.Text            = "载货清单号";
                    xrLabel2.Text         = "出仓单编号:";
                    //labWareNO.Text = CurOutHead.Bill_id;
                }
                //总的件数合计
                BarCode.Text = CurOutHead.Bill_id;

                lbJZXH.Text    = CurOutHead.Cntnr_spec;
                labWareNO.Text = CurOutHead.Cust_bill_id;
                lbCnsNo.Text   = CurOutHead.Cns_no;

                tbTotalPkgs.Text   = CurOutHead.Pkgs_num.ToString();
                tbreferdoc.Text    = CurOutHead.Refer_doc;
                tbLoadCarCode.Text = CurOutHead.Shipping_no;
                tbdeliverUnit.Text = htCustom[CurOutHead.Lease_holder] != null?htCustom[CurOutHead.Lease_holder].ToString():"";
                tbOut.Text         = CurOutHead.Ie_port;
                tbFZCode.Text      = CurOutHead.Seal_no;
                //司机本海关编号
                tbcarCcode.Text   = CurOutHead.Driver_no;
                tbOutCountry.Text = CommonReport.GetCode("102", CurOutHead.Trade_coun, false);
                tbCarNO.Text      = CurOutHead.Car_no;
                tbOutType.Text    = CurOutHead.Out_type;
                lbRemark.Text     = CurOutHead.Remark;
                if (CurOutHead.Ie_date.ToString("yyyy-MM-dd") != "1900-01-01")
                {
                    labDate.Text = CurOutHead.Ie_date.ToString("yyyy-MM-dd");
                }
                //labCustom.Text = CurOutHead.Ie_port;
                tbTotal.Text  = CurOutHead.All_value.ToString();
                tbTotalW.Text = "毛重:" + CurOutHead.Gross_wt.ToString() + "\n" + "净重:" + CurOutHead.Net_wt.ToString();
                #endregion

                #region 明细项
                if (CurOutList.Count <= 5)
                {
                    for (int i = 1; i <= CurOutList.Count; i++)
                    {
                        init(i, CurOutList);
                    }
                }
                if (CurOutList.Count > 5)
                {
                    for (int i = 1; i <= 5; i++)
                    {
                        init(i, CurOutList);
                    }
                }
                #endregion
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #5
0
        /// <summary>
        /// 复核表打印
        /// </summary>
        /// <param name="id">订单号</param>
        /// <param name="lading_type">货物类型</param>
        public void ReviewPrint(string id, string lading_type)
        {
            try
            {
                //权限验证
                this.HasActionPower();

                if (string.IsNullOrWhiteSpace(id) || string.IsNullOrWhiteSpace(lading_type))
                {
                    var       msgT = Server.UrlEncode("参数传输错误!");
                    var       msgD = Server.UrlEncode(string.Empty);
                    UrlHelper url  = new UrlHelper(this.Request.RequestContext);
                    this.Response.Redirect(url.Action("Index", "Error", new { msgTitle = msgT, msgDetail = msgD }));
                }

                var dateFormat = DateTime.Now.ToString("yyyyMMdd");
                var rootPath   = Server.MapPath("~/FileTemp");
                var dirPath    = rootPath + "/" + dateFormat + "/";

                if (!Directory.Exists(dirPath))
                {
                    Directory.CreateDirectory(dirPath);
                }

                var fileName = id + "_" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".pdf";
                var filePath = dirPath + fileName;

                #region 生成pdf

                //取出当前点中的行的核扣单号
                //取出当前点中的行的核增单号
                string sCurrentRowBillCode = id;
                string LadingType          = lading_type;

                DataTable dtbEnterprise001 = new DataTable();     //监管仓仓租企业
                DataTable dtbEnterprise500 = new DataTable();     //保税仓仓租企业
                DataTable dtbOutType001    = new DataTable();     //监管仓核扣方式
                DataTable dtbOutType500    = new DataTable();     //保税仓核扣方式
                DataTable _allSPBCODES     = new DataTable();

                dtbEnterprise001 = BasicData.BLL.BLLFactory <BasicData.BLL.B_custom_info> .Instance.GetEnterpriseFromDepot("1", true);

                dtbEnterprise500 = BasicData.BLL.BLLFactory <BasicData.BLL.B_custom_info> .Instance.GetEnterpriseFromDepot("2", true);

                dtbOutType001 = BasicData.BLL.BLLFactory <BasicData.BLL.B_datacategory> .Instance.GetOutType("001", true);

                dtbOutType500 = BasicData.BLL.BLLFactory <BasicData.BLL.B_datacategory> .Instance.GetOutType("500", true);

                _allSPBCODES = BasicData.BLL.BLLFactory <BasicData.BLL.C_codes> .Instance.GetAllToDataTable();

                Customs.Entity.Store_out_headInfo Store_Out_head = Customs.BLL.BLLFactory <Customs.BLL.Store_out_head> .Instance.FindSingle(" Bill_id='" + sCurrentRowBillCode + "'");



                DataTable dstOutHead = Customs.BLL.BLLFactory <Customs.BLL.Store_out_head> .Instance.SelectSimpleStoreOutHead(sCurrentRowBillCode);

                DataTable dstOutList = Customs.BLL.BLLFactory <Customs.BLL.Store_out_list> .Instance.SelectSimpleStoreOutList(sCurrentRowBillCode);

                dstOutHead.Rows[0]["dec_type"] = CommonReport.GetDecCodeName(dstOutHead.Rows[0]["dec_type"].ToString());
                if (dstOutList != null)
                {
                    dstOutList.Columns.Add("ColNo", typeof(string));
                    //增加汇总行
                    decimal TotalNet   = 0;
                    decimal TotalGross = 0;
                    decimal TotalPrice = 0;
                    decimal TotalPkgs  = 0;

                    if (dstOutList != null && dstOutList.Rows.Count > 0)
                    {
                        DataRow dr = null;
                        int     m  = 0;
                        for (int i = 0; i < dstOutList.Rows.Count; i++)
                        {
                            if (dstOutList.Rows[i]["BILL_ID"] != null && dstOutList.Rows[i]["BILL_ID"].ToString().Trim() != "")
                            {
                                TotalNet   += string.IsNullOrEmpty(dstOutList.Rows[i]["NET"].ToString().Trim()) ? 0 : decimal.Parse(dstOutList.Rows[i]["NET"].ToString().Trim());
                                TotalGross += string.IsNullOrEmpty(dstOutList.Rows[i]["GROSS"].ToString().Trim()) ? 0 : decimal.Parse(dstOutList.Rows[i]["GROSS"].ToString().Trim());
                                TotalPrice += string.IsNullOrEmpty(dstOutList.Rows[i]["USD_TRADE_TTL"].ToString().Trim()) ? 0 : decimal.Parse(dstOutList.Rows[i]["USD_TRADE_TTL"].ToString().Trim());
                                TotalPkgs  += string.IsNullOrEmpty(dstOutList.Rows[i]["PKGS"].ToString().Trim()) ? 0 : decimal.Parse(dstOutList.Rows[i]["PKGS"].ToString().Trim());
                                m++;

                                if (m % 20 == 0 && m != 0)
                                {
                                    dr                  = dstOutList.NewRow();
                                    dr["NET"]           = TotalNet;
                                    dr["GROSS"]         = TotalGross;
                                    dr["USD_TRADE_TTL"] = TotalPrice;
                                    dr["PKGS"]          = TotalPkgs;
                                    dr["ColNo"]         = i + 1;
                                    dr["QTY_2"]         = 0;
                                    dr["ORIGN_COUN"]    = "";
                                    dr["Curr_code"]     = "";


                                    dstOutList.Rows.InsertAt(dr, i + 1);
                                    TotalNet   = 0;
                                    TotalGross = 0;
                                    TotalPrice = 0;
                                    TotalPkgs  = 0;
                                }
                                else
                                {
                                    dstOutList.Rows[i]["ColNo"] = i + 1;
                                }
                            }
                        }

                        if (TotalNet != 0)//如果非21倍数
                        {
                            dr                  = dstOutList.NewRow();
                            dr["NET"]           = TotalNet;
                            dr["GROSS"]         = TotalGross;
                            dr["USD_TRADE_TTL"] = TotalPrice;
                            dr["PKGS"]          = TotalPkgs;
                            dr["ColNo"]         = "小计";
                            dr["QTY_2"]         = 0;
                            dr["ORIGN_COUN"]    = "";
                            dr["Curr_code"]     = "";
                            dstOutList.Rows.InsertAt(dr, dstOutList.Rows.Count);
                        }
                    }
                }
                //获得列表中商品内容
                string CODE_TS = "";

                foreach (DataRow drw in dstOutList.Rows)
                {
                    CODE_TS += drw["CODE_T"].ToString().Trim() + "|";
                }


                DataTable dstComplexys = new DataTable();
                if (!string.IsNullOrEmpty(CODE_TS))
                {
                    dstComplexys = BasicData.BLL.BLLFactory <BasicData.BLL.C_complex> .Instance.GetListByCodes(CODE_TS);
                }


                DataSet dstReport = new DataSet();
                dtbEnterprise001 = BasicData.BLL.BLLFactory <BasicData.BLL.B_custom_info> .Instance.GetEnterpriseFromDepot(string.Empty);

                XtraReport reportClass = new Rpt_Customs_OutWarehouseBill(Store_Out_head, dstOutList, _allSPBCODES, dtbEnterprise001, dtbOutType001, dtbOutType500, dstComplexys);
                reportClass.DataSource = dstReport;
                reportClass.DataMember = "STORE_OUT_HEAD";
                reportClass.ExportToPdf(filePath);
                #endregion

                //写出文件
                if (!string.IsNullOrWhiteSpace(filePath))
                {
                    RespWrite(filePath);
                }
            }
            catch (Exception ex)
            {
                var       msgT = Server.UrlEncode("系统出现错误,请联系客服或管理员处理!");
                var       msgD = Server.UrlEncode(ex.Message);
                UrlHelper url  = new UrlHelper(this.Request.RequestContext);
                this.Response.Redirect(url.Action("Index", "Error", new { msgTitle = msgT, msgDetail = msgD }));
            }
        }