Beispiel #1
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;
        }