Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
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;
        }