コード例 #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);

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