Esempio n. 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);

            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";
        }