public DataTable GetSaleOrder(DateTime dStartDate, DateTime dEndDate, string strOrderPrefix = "")
        {
            var strGetDetail = string.Format(
                "select fnumber as cOrderNumber from T_IM_SaleIssueBill " +
                //"where trunc(fcreatetime)>=trunc(:dStartDate) and trunc(fcreatetime)<=trunc(:dEndDate) {0} and ftransactiontypeid='DawAAAAPoAywCNyn' "
                "where to_char(trunc(fcreatetime),'yyyy-mm-dd') >= :dStartDate AND to_char(trunc(fcreatetime),'yyyy-mm-dd') < :dEndDate {0} " +
                " and ftransactiontypeid='DawAAAAPoAywCNyn' "
                , string.IsNullOrEmpty(strOrderPrefix) ? "" : "and fnumber like '" + strOrderPrefix + "%'");

            InterfaceOracleFunction.VLogDebug(string.Format("执行[销售出库GetSaleOrder],参数生产日期 开始[{0}],生产日期 结束[{1}],订单前缀[{2}]"
                                                            , dStartDate.ToString("yyyy-MM-dd"), dEndDate.ToString("yyyy-MM-dd"), strOrderPrefix)
                                              , strGetDetail.ToString());
            using (var con = new OracleConnection(Properties.Settings.Default.EasCon))
            {
                using (var cmd = new OracleCommand(strGetDetail, con))
                {
                    cmd.Parameters.Add(":dStartDate", dStartDate.ToString("yyyy-MM-dd"));
                    cmd.Parameters.Add(":dEndDate", dEndDate.ToString("yyyy-MM-dd"));
                    //cmd.Parameters.Add(":FNumber", strOrderPrefix);
                    using (var da = new OracleDataAdapter(cmd))
                    {
                        var dt = new DataTable("EasSaleIssue");
                        da.Fill(dt);
                        return(dt);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 填充主表数据
        /// </summary>
        /// <returns></returns>
        private void FillBill(string cOrderNumber, string cNewEasOrder, string cUserName)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            mibill.FID = iof.GetFID("71D272F1");

            _storageUnit             = iof.GetReceiptStorageByOrderNumber(cOrderNumber, "T_IM_StockTransferBill");
            mibill.FSTORAGEORGUNITID = _storageUnit;
            //mibill.FAUDITTIME = DateTime.Now;
            mibill.FBASESTATUS = 1;
            mibill.FBIZTYPEID  = "d8e80652-011b-1000-e000-04c5c0a812202407435C";
            mibill.FNUMBER     = cNewEasOrder;

            var dDate = iof.ReturnBizDate();

            mibill.FBIZDATE = dDate;


            //制单人
            var cUserId = iof.GetUserIDbyUserName(cUserName);

            mibill.FCREATORID = string.IsNullOrEmpty(cUserId) ? "K7Li625bRC6r8uAH5mlIDRO33n8=" : cUserId;

            mibill.FCREATETIME = DateTime.Now;
            //修改
            mibill.FRECEIPTSTORAGEORGUNITID = _storageUnit;
            mibill.FISSUECOMPANYORGUNITID   = _storageUnit;
            mibill.FRECEIPTCOMPANYORGUNITID = _storageUnit;
            mibill.FISSYSBILL         = 0;
            mibill.FADMINORGUNITID    = iof.GetOutDepartmetByOrderNumber(cOrderNumber, "T_IM_StockTransferBill");
            mibill.FSTOCKERID         = "";
            mibill.FVOUCHERID         = "";
            mibill.FTOTALQTY          = 0;
            mibill.FTOTALAMOUNT       = 0;
            mibill.FFIVOUCHERED       = 0;
            mibill.FTOTALSTANDARDCOST = 0;
            mibill.FTOTALACTUALCOST   = 0;
            mibill.FISREVERSED        = 0;
            mibill.FTRANSACTIONTYPEID = "DawAAAAPoAqwCNyn";
            mibill.FISINITBILL        = 0;
            mibill.FMONTH             = int.Parse(dDate.ToString("yyyyMM"));
            mibill.FDAY = int.Parse(dDate.ToString("yyyyMMdd"));
            mibill.FCOSTCENTERORGUNITID = "";
            mibill.FSOURCEBILLTYPEID    = "50957179-0105-1000-e003-3152c0a812fd463ED552";
            mibill.FBILLTYPEID          = "50957179-0105-1000-e000-016ec0a812fd463ED552";
            mibill.FYEAR   = dDate.Year;
            mibill.FPERIOD = dDate.Month;
            //修改人不填写
            //mibill.FMODIFIERID = "knIF/5HGT7qEgaIYhcYA9xO33n8=";
            //mibill.FMODIFICATIONTIME = "2014-6-6 16:2";
            mibill.FHANDLERID   = "";
            mibill.FDESCRIPTION = "";
            mibill.FHASEFFECTED = 0;
            mibill.FAUDITORID   = "";
            //mibill.FSOURCEBILLID = "0";
            //mibill.FSOURCEFUNCTION = "0";
            //mibill.FLASTUPDATEUSERID = "knIF/5HGT7qEgaIYhcYA9xO33n8=";
            //mibill.FLASTUPDATETIME = "2014-6-6 16:2";
            mibill.FCONTROLUNITID = _storageUnit;
        }
        public DataTable GetSaleIssue(DateTime dDate, DateTime dEDate, string strOrderPrefix = "")
        {
            var strGetDetail = string.Format(
                "select a.fnumber as cOrderNumber,c.fnumber cInvCode,c.fname_l2 cInvName,sum(b.fqty) iSumQuantity,max(d.fname_l2) cUnit " +
                "from T_IM_SaleIssueBill a inner join " +
                "T_IM_SaleIssueEntry b on a.FID=b.FparentID " +
                "inner join T_BD_Material c on b.fmaterialid=c.fid " +
                "left join T_BD_MeasureUnit d on b.FUNITID=d.fid " +
                //"where trunc(a.fcreatetime)>=trunc(:dDate) and trunc(a.fcreatetime)<=trunc(:dEDate) {0} and a.ftransactiontypeid='DawAAAAPoAywCNyn' " +
                "where to_char(trunc(a.fcreatetime),'yyyy-mm-dd') >= :dDate AND to_char(trunc(a.fcreatetime),'yyyy-mm-dd') < :dEDate {0} " +
                " and a.ftransactiontypeid='DawAAAAPoAywCNyn' " +
                //and b.fsalegroupid is not null " +
                "group by a.fnumber,c.fnumber,c.fname_l2"
                , string.IsNullOrEmpty(strOrderPrefix) ? "" : "and a.fnumber like '" + strOrderPrefix + "%'");

            InterfaceOracleFunction.VLogDebug(string.Format("执行[销售出库GetSaleIssue],参数生产日期 开始[{0}],生产日期 结束[{1}],订单前缀[{2}]"
                                                            , dDate.ToString("yyyy-MM-dd"), dEDate.ToString("yyyy-MM-dd"), strOrderPrefix)
                                              , strGetDetail.ToString());
            using (var con = new OracleConnection(Properties.Settings.Default.EasCon))
            {
                using (var cmd = new OracleCommand(strGetDetail, con))
                {
                    cmd.Parameters.Add(":dDate", dDate.ToString("yyyy-MM-dd"));
                    cmd.Parameters.Add(":dEDate", dEDate.ToString("yyyy-MM-dd"));
                    //cmd.Parameters.Add(":FNumber", strOrderPrefix);
                    using (var da = new OracleDataAdapter(cmd))
                    {
                        var dt = new DataTable("EasSaleIssue");
                        da.Fill(dt);
                        return(dt);
                    }
                }
            }
        }
        /// <summary>
        /// 填充主表数据
        /// </summary>
        /// <returns></returns>
        private void FillBill(string cOrderNumber, string cNewEasOrder)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            mrbill.FID = iof.GetFID("500AB75E");
            //制单人取生产订单审核人
            var cUserId = iof.GetUserIDByOrderNumber(cOrderNumber, "T_MM_ProductionOrder");

            mrbill.FCREATORID = string.IsNullOrEmpty(cUserId) ? "K7Li625bRC6r8uAH5mlIDRO33n8=" : cUserId;

            mrbill.FCREATETIME = DateTime.Now;
            //mrbill.FLASTUPDATEUSERID = "OWRO3YImRBq4cK8lmqmQ/RO33n8=";
            //mrbill.FLASTUPDATETIME =  ;

            _storageUnit          = iof.GetStorageUnitByOrderNumber(cOrderNumber, "T_MM_ProductionOrder");
            mrbill.FCONTROLUNITID = _storageUnit;
            mrbill.FNUMBER        = cNewEasOrder;
            var dDate = iof.ReturnBizDate();

            mrbill.FBIZDATE = dDate;
            //审核信息不传
            //mrbill.FAUDITORID = "OWRO3YImRBq4cK8lmqmQ/RO33n8=";
            //mrbill.FAUDITTIME = "03-7月 -14 04.31.20.079000000 下午";
            //获取生产什么东西
            cProProduct = iof.GetProProduct(cOrderNumber, "T_MM_ProductionOrder");

            mrbill.FBASESTATUS        = 1;
            mrbill.FBIZTYPEID         = "0rSFjAEeEADgAAyMwKgSQiQHQ1w=";
            mrbill.FSOURCEBILLTYPEID  = "ejIZHXXTQliYCQJg9t4Re0Y+1VI=";
            mrbill.FBILLTYPEID        = "50957179-0105-1000-e000-0163c0a812fd463ED552";
            mrbill.FYEAR              = dDate.Year;
            mrbill.FPERIOD            = dDate.Month;
            mrbill.FSTORAGEORGUNITID  = _storageUnit;
            mrbill.FADMINORGUNITID    = iof.GetWorkShopIDByOrderNumber(cOrderNumber, "T_MM_ProductionOrder");
            mrbill.FSTOCKERID         = "";
            mrbill.FTOTALQTY          = 0;
            mrbill.FTOTALAMOUNT       = 0;
            mrbill.FFIVOUCHERED       = 0;
            mrbill.FTOTALSTANDARDCOST = 0;
            mrbill.FTOTALACTUALCOST   = 0;
            mrbill.FISREVERSED        = 0;
            mrbill.FTRANSACTIONTYPEID = "DawAAAAPoCuwCNyn";
            mrbill.FISINITBILL        = 0;
            //mrbill.FMODIFIERID = "OWRO3YImRBq4cK8lmqmQ/RO33n8=";
            //mrbill.FMODIFICATIONTIME = ;
            mrbill.FCOSTCENTERORGUNITID = iof.GetWorkShopIDByProductOrderNumber(cOrderNumber);
            mrbill.FPURCHASETYPE        = "0";
            mrbill.FISBACKFLUSH         = 0;
            mrbill.FMONTH = int.Parse(dDate.ToString("yyyyMM"));
            mrbill.FDAY   = int.Parse(dDate.ToString("yyyyMMdd"));
            mrbill.FSUPPLYSTOREORGUNITID   = _storageUnit;
            mrbill.FSUPPLYCOMPANYORGUNITID = _storageUnit;
            mrbill.FDEMANDCOMPANYORGUNITID = _storageUnit;
        }
Beispiel #5
0
        /// <summary>
        /// 填充主表数据
        /// </summary>
        /// <returns></returns>
        private void FillBill(string cOrderNumber, string cNewEasOrder)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            mrbill.FID = iof.GetFID("FA1292B4");

            //制单人取生产订单审核人
            var cProductId = iof.GetProductOrderID(cOrderNumber);
            var cUserId    = iof.GetUserIDByOrderNumber(cProductId, "T_MM_ProductionOrder");

            mrbill.FCREATORID = string.IsNullOrEmpty(cUserId) ? "K7Li625bRC6r8uAH5mlIDRO33n8=" : cUserId;

            mrbill.FCREATETIME = DateTime.Now;
            //mrbill.FLASTUPDATEUSERID = "OWRO3YImRBq4cK8lmqmQ/RO33n8=";
            //mrbill.FLASTUPDATETIME = ;
            _storageUnit          = iof.GetStorageUnitByOrderNumber(cOrderNumber, "T_MM_FinishedRpt");
            mrbill.FCONTROLUNITID = _storageUnit;
            mrbill.FNUMBER        = cNewEasOrder;

            var dDate = iof.ReturnBizDate();

            mrbill.FBIZDATE      = dDate;
            mrbill.FAUDITORID    = "";
            mrbill.FSOURCEBILLID = iof.GetSourIDByOrderNumber(cOrderNumber, "T_MM_FinishedRpt");
            //mrbill.FSOURCEFUNCTION = "";
            //mrbill.FAUDITTIME = "";
            //单据状态为保存状态
            mrbill.FBASESTATUS        = "1";
            mrbill.FBIZTYPEID         = "Nz878AEgEADgAABFwKg/GiQHQ1w=";
            mrbill.FSOURCEBILLTYPEID  = "e3soUQaBR8un8D2R7UpNwkY+1VI=";
            mrbill.FBILLTYPEID        = "50957179-0105-1000-e000-0167c0a812fd463ED552";
            mrbill.FYEAR              = int.Parse(dDate.ToString("yyyy"));
            mrbill.FPERIOD            = int.Parse(dDate.ToString("MM"));
            mrbill.FSTORAGEORGUNITID  = _storageUnit;
            mrbill.FADMINORGUNITID    = iof.GetWorkShopIDByOrderNumber(cOrderNumber, "T_MM_FinishedRpt");
            mrbill.FSTOCKERID         = "";
            mrbill.FTOTALQTY          = 0;
            mrbill.FTOTALAMOUNT       = 0;
            mrbill.FFIVOUCHERED       = 0;
            mrbill.FTOTALSTANDARDCOST = 0;
            mrbill.FTOTALACTUALCOST   = 0;
            mrbill.FISREVERSED        = 0;
            mrbill.FTRANSACTIONTYPEID = "DawAAAAPoCqwCNyn";
            mrbill.FISINITBILL        = 0;
            //mrbill.FMODIFIERID = "OWRO3YImRBq4cK8lmqmQ/RO33n8=";
            //mrbill.FMODIFICATIONTIME = "03-7月 -14 04.25.49.939000000 下午";
            mrbill.FCOSTCENTERORGUNITID = mrbill.FADMINORGUNITID;
            mrbill.FISBACKFLUSHSUCCEED  = "5";
            mrbill.FMONTH            = int.Parse(dDate.ToString("yyyyMM"));
            mrbill.FDAY              = int.Parse(dDate.ToString("yyyyMMdd"));
            mrbill.FPROCESSORGUNITID = _storageUnit;
        }
Beispiel #6
0
        /// <summary>
        /// 给写入子表的SQL参数传值
        /// </summary>
        /// <returns></returns>
        private void GenRelationPara(OracleCommand ocmd)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            ocmd.Parameters.Add(":FID", iof.GetFID("59302EC6"));
            ocmd.Parameters.Add(":FSRCENTITYID", "2239F30A");
            ocmd.Parameters.Add(":FDESTENTITYID", "71D272F1");
            ocmd.Parameters.Add(":FSRCOBJECTID", mibillEntry.FSOURCEBILLID);
            ocmd.Parameters.Add(":FDESTOBJECTID", mibill.FID);
            ocmd.Parameters.Add(":FDATE", DateTime.Now);
            ocmd.Parameters.Add(":FOPERATORID", "yofoto");
            ocmd.Parameters.Add(":FISEFFECTED", "1");
            ocmd.Parameters.Add(":FBOTMAPPINGID", "709becee-0108-1000-e000-2b10c0a812fd045122C4");
            ocmd.Parameters.Add(":FTYPE", 1);
        }
Beispiel #7
0
        /// <summary>
        /// 给写入子表的SQL参数传值
        /// </summary>
        /// <returns></returns>
        private void GenRelationPara(OracleCommand ocmd)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            ocmd.Parameters.Add(":FID", iof.GetFID("59302EC6"));
            ocmd.Parameters.Add(":FSRCENTITYID", "F2901DDD");
            ocmd.Parameters.Add(":FDESTENTITYID", "FA1292B4");
            ocmd.Parameters.Add(":FSRCOBJECTID", mrbillEntry.FSOURCEBILLID);
            ocmd.Parameters.Add(":FDESTOBJECTID", mrbill.FID);
            ocmd.Parameters.Add(":FDATE", DateTime.Now);
            ocmd.Parameters.Add(":FOPERATORID", "yofoto");
            ocmd.Parameters.Add(":FISEFFECTED", "1");
            ocmd.Parameters.Add(":FBOTMAPPINGID", "+3X6yHlmQkeD/jXY/So0RARRIsQ=");
            ocmd.Parameters.Add(":FTYPE", "1");
        }
        /// <summary>
        /// 给写入子表的SQL参数传值
        /// </summary>
        /// <returns></returns>
        private void GenRelationPara(OracleCommand ocmd)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            ocmd.Parameters.Add(":FID", iof.GetFID("59302EC6"));
            ocmd.Parameters.Add(":FSRCENTITYID", "1F66774E");
            ocmd.Parameters.Add(":FDESTENTITYID", "500AB75E");
            ocmd.Parameters.Add(":FSRCOBJECTID", mrbillEntry.FSOURCEBILLID);
            ocmd.Parameters.Add(":FDESTOBJECTID", mrbill.FID);
            ocmd.Parameters.Add(":FDATE", DateTime.Now);
            ocmd.Parameters.Add(":FOPERATORID", "yofoto");
            ocmd.Parameters.Add(":FISEFFECTED", "1");
            ocmd.Parameters.Add(":FBOTMAPPINGID", "NO7rbo51RK2KZrWhTMuM2ARRIsQ=");
            ocmd.Parameters.Add(":FTYPE", 1);
        }
Beispiel #9
0
        /// <summary>
        /// 填充子表数据
        /// </summary>
        /// <returns></returns>
        private void FillBillEntry(string cOrderNumber, string cInvCode, string iQuantity, string cInvName, string cLotNo, int iRowIndex)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            mibillEntry.FPARENTID    = mibill.FID;
            mibillEntry.FSTORETYPEID = "181875d5-0105-1000-e000-0111c0a812fd97D461A6";

            var dDate = iof.ReturnBizDate();

            mibillEntry.FBIZDATE          = dDate.Date;
            mibillEntry.FSTORAGEORGUNITID = _storageUnit;
            mibillEntry.FCOMPANYORGUNITID = _storageUnit;



            mibillEntry.FMATERIALID = iof.GetInvCode(cInvCode);
            //数量
            var     cQty = iQuantity;
            decimal iQty;

            if (!decimal.TryParse(cQty, out iQty))
            {
                iQty = 0;
            }
            mibillEntry.FQTY        = iQty;
            mibillEntry.FBASEQTY    = iQty;
            mibillEntry.FUNITID     = iof.GetInvUnit(mibillEntry.FMATERIALID);
            mibillEntry.FBASEUNITID = mibillEntry.FUNITID;
            mibillEntry.FSEQ        = iRowIndex;
            mibillEntry.FID         = iof.GetFID("0924D401");

            mibillEntry.FSTOCKTRANSFERBILLID = iof.GetSourIDByOrderNumber(cOrderNumber, "T_IM_StockTransferBill");
            //获取调拨单分录ID
            if (string.IsNullOrEmpty(cLotNo))
            {
                mibillEntry.FSTOCKTRANSBILLENTRYID = iof.GetEntrySourIDByOrderNumber(mibillEntry.FSTOCKTRANSFERBILLID, mibillEntry.FMATERIALID, "T_IM_StockTransferBillEntry");
            }
            else
            {
                mibillEntry.FSTOCKTRANSBILLENTRYID = iof.GetEntrySourIDByOrderNumberAndLotNo(mibillEntry.FSTOCKTRANSFERBILLID, mibillEntry.FMATERIALID, "T_IM_StockTransferBillEntry", cLotNo);
            }

            if (string.IsNullOrEmpty(mibillEntry.FSTOCKTRANSBILLENTRYID))
            {
                mibillEntry.FSTOCKTRANSBILLENTRYID = iof.GetEntrySourIDByOrderNumber(mibillEntry.FSTOCKTRANSFERBILLID, mibillEntry.FMATERIALID, "T_IM_StockTransferBillEntry");
            }

            mibillEntry.FWAREHOUSEID          = iof.GetFIssueWarehouseIDByFID(mibillEntry.FSTOCKTRANSBILLENTRYID, "T_IM_StockTransferBillEntry");
            mibillEntry.FSTOCKTRANSFERBILLNUM = cOrderNumber;
            var cSeq = iof.GetEntrySeqByEntryFid(mibillEntry.FSTOCKTRANSBILLENTRYID, "T_IM_StockTransferBillEntry");
            int iSeq;

            if (!int.TryParse(cSeq, out iSeq))
            {
                iSeq = 1;
            }

            mibillEntry.FSTOCKTRANSFERBILLENTRYSEQ = iSeq;
            mibillEntry.FTOTALINWAREHSQTY          = 0;
            mibillEntry.FCANINWAREHSBASEQTY        = 0;
            mibillEntry.FBASEUNITACTUALCOST        = 0;
            mibillEntry.FCUSTOMERID = "";
            mibillEntry.FSUPPLIERID = "";
            mibillEntry.FPRICE      = 0;
            mibillEntry.FAMOUNT     = 0;
            //mibillEntry.FLOCATIONID = "0";
            //mibillEntry.FSTOCKERID = "0";
            //是否批次管理
            //var bLot = iof.GetBLotById(mibillEntry.FMATERIALID);
            var bLot = iof.GetBLotById(mibillEntry.FMATERIALID, mibillEntry.FSTORAGEORGUNITID);

            if (bLot.Equals("1"))
            {
                mibillEntry.FLOT = cLotNo;
            }
            else
            {
                mibillEntry.FLOT = "";
            }
            mibillEntry.FASSISTQTY        = 0;
            mibillEntry.FREVERSEQTY       = 0;
            mibillEntry.FRETURNSQTY       = 0;
            mibillEntry.FUNITSTANDARDCOST = 0;
            mibillEntry.FSTANDARDCOST     = 0;
            mibillEntry.FUNITACTUALCOST   = 0;
            mibillEntry.FACTUALCOST       = 0;
            mibillEntry.FISPRESENT        = 0;
            //mibillEntry.FMFG = "";
            //mibillEntry.FEXP = "";
            mibillEntry.FREVERSEBASEQTY = 0;
            mibillEntry.FRETURNBASEQTY  = 0;
            //mibillEntry.FPROJECTID = "0";
            //mibillEntry.FTRACKNUMBERID = "0";
            //mibillEntry.FASSISTPROPERTYID = "0";
            mibillEntry.FSOURCEBILLID = mibillEntry.FSTOCKTRANSFERBILLID;

            mibillEntry.FSOURCEBILLNUMBER   = cOrderNumber;
            mibillEntry.FSOURCEBILLENTRYID  = mibillEntry.FSTOCKTRANSBILLENTRYID;
            mibillEntry.FSOURCEBILLENTRYSEQ = iSeq;
            mibillEntry.FASSCOEFFICIENT     = 0;
            mibillEntry.FBASESTATUS         = 2;
            mibillEntry.FASSOCIATEQTY       = iQty;
            mibillEntry.FSOURCEBILLTYPEID   = "50957179-0105-1000-e003-3152c0a812fd463ED552";
        }
Beispiel #10
0
        /// <summary>
        /// 填充子表数据
        /// </summary>
        /// <returns></returns>
        private void FillBillEntry(string cOrderNumber, string cInvCode, string iQuantity, string cInvName, string cLotNo, int iRowIndex)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            mrbillEntry.FID               = iof.GetFID("DBE1161E");
            mrbillEntry.FSEQ              = iRowIndex;
            mrbillEntry.FSOURCEBILLID     = iof.GetSourIDByOrderNumber(cOrderNumber, "T_MM_FinishedRpt");
            mrbillEntry.FSOURCEBILLNUMBER = cOrderNumber;
            //物料ID
            mrbillEntry.FMATERIALID = iof.GetInvCode(cInvCode);

            mrbillEntry.FSOURCEBILLENTRYID = iof.GetEntrySourIDByOrderNumber(mrbillEntry.FSOURCEBILLID, mrbillEntry.FMATERIALID, "T_MM_FinishedRptEntry");
            var cSeq = iof.GetEntrySeqByEntryFid(mrbillEntry.FSOURCEBILLENTRYID, "T_MM_FinishedRptEntry");
            int iSeq;

            if (!int.TryParse(cSeq, out iSeq))
            {
                iSeq = 1;
            }

            mrbillEntry.FSOURCEBILLENTRYSEQ = iSeq;
            mrbillEntry.FASSCOEFFICIENT     = 0;
            mrbillEntry.FBASESTATUS         = 2;

            //数量
            var     cQty = iQuantity;
            decimal iQty;

            if (!decimal.TryParse(cQty, out iQty))
            {
                iQty = 0;
            }
            mrbillEntry.FASSOCIATEQTY     = iQty;
            mrbillEntry.FSOURCEBILLTYPEID = "e3soUQaBR8un8D2R7UpNwkY+1VI=";

            mrbillEntry.FUNITID           = iof.GetInvUnit(mrbillEntry.FMATERIALID);
            mrbillEntry.FBASEUNITID       = mrbillEntry.FUNITID;
            mrbillEntry.FSTORAGEORGUNITID = _storageUnit;
            mrbillEntry.FCOMPANYORGUNITID = _storageUnit;
            mrbillEntry.FWAREHOUSEID      = iof.GetWarehouseIDByfID(mrbillEntry.FSOURCEBILLENTRYID, "T_MM_FinishedRptEntry");
            //是否批次管理
            //var bLot = iof.GetBLotById(mrbillEntry.FMATERIALID);
            var bLot = iof.GetBLotById(mrbillEntry.FMATERIALID, mrbillEntry.FSTORAGEORGUNITID);

            if (bLot.Equals("1"))
            {
                mrbillEntry.FLOT = cLotNo;
            }
            else
            {
                mrbillEntry.FLOT = "";
            }

            mrbillEntry.FQTY               = iQty;
            mrbillEntry.FASSISTQTY         = 0;
            mrbillEntry.FBASEQTY           = iQty;
            mrbillEntry.FREVERSEQTY        = 0;
            mrbillEntry.FRETURNSQTY        = 0;
            mrbillEntry.FPRICE             = 0;
            mrbillEntry.FAMOUNT            = 0;
            mrbillEntry.FUNITSTANDARDCOST  = 0;
            mrbillEntry.FSTANDARDCOST      = 0;
            mrbillEntry.FUNITACTUALCOST    = 0;
            mrbillEntry.FACTUALCOST        = 0;
            mrbillEntry.FISPRESENT         = 0;
            mrbillEntry.FPARENTID          = mrbill.FID;
            mrbillEntry.FMANUBILLID        = iof.GetFProductionOrderID(mrbill.FSOURCEBILLID);
            mrbillEntry.FREVERSEBASEQTY    = 0;
            mrbillEntry.FRETURNBASEQTY     = 0;
            mrbillEntry.FCOSTOBJECTID      = iof.GetCostByID(mrbillEntry.FMATERIALID, _storageUnit);//iof.GetCostByID(mrbillEntry.FMATERIALID)
            mrbillEntry.FRECQTY            = 0;
            mrbillEntry.FBASERECQTY        = 0;
            mrbillEntry.FMANUBILLNUMBER    = iof.GetWorkOrder(mrbillEntry.FMANUBILLID);
            mrbillEntry.FRECEIVEQTY        = iQty;
            mrbillEntry.FMANUBILLENTRYSEQ  = 0;
            mrbillEntry.FSALEORDERENTRYSEQ = 0;

            var dDate = iof.ReturnBizDate();

            mrbillEntry.FBIZDATE             = dDate;
            mrbillEntry.FCOSTCENTERORGUNITID = iof.GetWorkShopIDByOrderNumber(cOrderNumber);;
            mrbillEntry.FADMINORGUNITID      = mrbillEntry.FCOSTCENTERORGUNITID;
        }
Beispiel #11
0
        /// <summary>
        /// 填充子表数据
        /// </summary>
        /// <returns></returns>
        private void FillBillEntry(string cOrderNumber, string cInvCode, string iQuantity, string cInvName, string cLotNo, int iRowIndex)
        {
            var iof = new InterfaceOracleFunction(Properties.Settings.Default.EasCon);

            var dDate = iof.ReturnBizDate();

            mrbillEntry.FID         = iof.GetFID("11774BB4");
            mrbillEntry.FSEQ        = iRowIndex;
            mrbillEntry.FMATERIALID = iof.GetInvCode(cInvCode);

            mrbillEntry.FSOURCEBILLID       = iof.GetSourIDByOrderNumber(cOrderNumber, "T_MM_ProductionOrder");
            mrbillEntry.FSOURCEBILLNUMBER   = cOrderNumber;
            mrbillEntry.FSOURCEBILLENTRYID  = iof.GetEntrySourIDByOrderNumber(mrbillEntry.FSOURCEBILLID, mrbillEntry.FMATERIALID, "T_MM_ProductionOrderSEntry");
            mrbillEntry.FSOURCEBILLENTRYSEQ = 0;
            mrbillEntry.FASSCOEFFICIENT     = 0;
            mrbillEntry.FBASESTATUS         = 2;

            //数量
            var     cQty = iQuantity;
            decimal iQty;

            if (!decimal.TryParse(cQty, out iQty))
            {
                iQty = 0;
            }
            mrbillEntry.FASSOCIATEQTY     = iQty;
            mrbillEntry.FSOURCEBILLTYPEID = "ejIZHXXTQliYCQJg9t4Re0Y+1VI=";

            mrbillEntry.FUNITID           = iof.GetInvUnit(mrbillEntry.FMATERIALID);
            mrbillEntry.FBASEUNITID       = mrbillEntry.FUNITID;
            mrbillEntry.FSTORAGEORGUNITID = _storageUnit;
            mrbillEntry.FCOMPANYORGUNITID = _storageUnit;
            mrbillEntry.FWAREHOUSEID      = iof.GetDefaultWarehouseIDByfID(mrbillEntry.FSOURCEBILLENTRYID, "T_MM_ProductionOrderSEntry");
            mrbillEntry.FLOCATIONID       = "";
            //是否批次管理
            //var bLot = iof.GetBLotById(mrbillEntry.FMATERIALID);
            var bLot = iof.GetBLotById(mrbillEntry.FMATERIALID, mrbillEntry.FSTORAGEORGUNITID);

            if (bLot.Equals("1"))
            {
                mrbillEntry.FLOT = cLotNo;
            }
            else
            {
                mrbillEntry.FLOT = "";
            }
            mrbillEntry.FQTY              = iQty;
            mrbillEntry.FASSISTQTY        = 0;
            mrbillEntry.FBASEQTY          = iQty;
            mrbillEntry.FREVERSEQTY       = 0;
            mrbillEntry.FRETURNSQTY       = 0;
            mrbillEntry.FPRICE            = 0;
            mrbillEntry.FAMOUNT           = 0;
            mrbillEntry.FUNITSTANDARDCOST = 0;
            mrbillEntry.FSTANDARDCOST     = 0;
            mrbillEntry.FUNITACTUALCOST   = 0;
            mrbillEntry.FACTUALCOST       = 0;
            mrbillEntry.FISPRESENT        = 0;
            mrbillEntry.FPARENTID         = mrbill.FID;
            mrbillEntry.FPRODUCTIDID      = "";
            mrbillEntry.FORDERNUMBER      = cOrderNumber;
            mrbillEntry.FPOBILLENTRYID    = "";
            //生产日期、失效日期
            //mrbillEntry.FEXP = "25-12月-16 12.00.00.000000000 上午";
            //mrbillEntry.FMFG = "10-1月 -14 12.00.00.000000000 上午";
            mrbillEntry.FREVERSEBASEQTY     = 0;
            mrbillEntry.FRETURNBASEQTY      = 0;
            mrbillEntry.FBASEUNITACTUALCOST = 0;
            mrbillEntry.FCOSTOBJECTID       = iof.GetCostByOrderNumber(cOrderNumber, _storageUnit);
            mrbillEntry.FUNRETURNEDBASEQTY  = iQty;
            mrbillEntry.FORDERBILLID        = mrbillEntry.FSOURCEBILLID;
            //生产线
            //mrbillEntry.FPRODUCTLINEID = "riQAAAAALs1tMiVM";
            mrbillEntry.FISSUEQTY             = 0;
            mrbillEntry.FBASEISSUEQTY         = 0;
            mrbillEntry.FPRODUCTLINEWPID      = "";
            mrbillEntry.FFACARDQTY            = 0;
            mrbillEntry.FSUBWRITTENOFFQTY     = 0;
            mrbillEntry.FSUBWRITTENOFFBASEQTY = 0;
            mrbillEntry.FSUBUNWRITEOFFQTY     = iQty;
            mrbillEntry.FSUBUNWRITEOFFBASEQTY = iQty;
            mrbillEntry.FCOREBILLTYPEID       = "ejIZHXXTQliYCQJg9t4Re0Y+1VI=";
            mrbillEntry.FCOREORDERENTRYSEQ    = 0;
            mrbillEntry.FCOREBILLNUMBER       = cOrderNumber;
            mrbillEntry.FCOREBILLID           = mrbillEntry.FSOURCEBILLID;
            mrbillEntry.FCOREBILLENTRYID      = mrbillEntry.FSOURCEBILLENTRYID;
            mrbillEntry.FCOREBILLENTRYSE      = 0;
            mrbillEntry.FOPERATIONNO          = 0;
            mrbillEntry.FISADMEASURE          = 0;
            //根据流程生产订单,判断是否返工
            if (mrbillEntry.FMATERIALID.Equals(cProProduct))
            {
                var cProductType = iof.GetProductType(cOrderNumber, "T_MM_ProductionOrder");
                mrbillEntry.FISREWORK = cProductType.Equals("20") ? 1 : 0;
            }
            else
            {
                mrbillEntry.FISREWORK = 0;
            }


            mrbillEntry.FSCWRITTENOFFAMOUNT   = 0;
            mrbillEntry.FSCUNWRITTENOFFAMOUNT = 0;
            mrbillEntry.FSUPPLYWAREHOUSEID    = "";
            mrbillEntry.FSETTLEPRICE          = 0;
            mrbillEntry.FBIZDATE = dDate;

            mrbillEntry.FCOSTCENTERORGUNITID = mrbill.FCOSTCENTERORGUNITID;
            mrbillEntry.FADMINORGUNITID      = mrbill.FCOSTCENTERORGUNITID;
        }