示例#1
0
 /// <summary>
 /// 插入数据到SAP表:AccountGL
 /// </summary>
 /// <param name="accountGL"></param>
 protected void InsertDataIVItemData(ACCOUNTGL accountGL)
 {
     IRfcTable rfcTableAccountGL = mCurrentRfcFunction.GetTable("ITEMDATA");
     rfcTableAccountGL.Insert();
     rfcTableAccountGL.CurrentRow.SetValue("INVOICE_DOC_ITEM", "1");
     rfcTableAccountGL.CurrentRow.SetValue("PO_NUMBER", "6500001604");
     rfcTableAccountGL.CurrentRow.SetValue("PO_ITEM", "10");
     rfcTableAccountGL.CurrentRow.SetValue("TAX_CODE", "J1");
     rfcTableAccountGL.CurrentRow.SetValue("ITEM_AMOUNT", "10");
     rfcTableAccountGL.CurrentRow.SetValue("QUANTITY", "1");
     rfcTableAccountGL.CurrentRow.SetValue("PO_UNIT", "PCS");
 }
示例#2
0
        /// <summary>
        /// 插入数据到第一个表:AccountGL
        /// </summary>
        protected void SetAccountGL()
        {
            List<ExpenceDetail> expList = GetExpenceDetails();
            if (expList != null)
            {
                decimal totalAmount = 0;
                decimal taxTotalAmount = 0;
                bool isHaveTaxValue = false;

                foreach (var expen in expList)
                {
                    mGlobalCount++;

                    //当CostCenter为0000000000时,标示为税额
                   if (expen.CostCenter == "0000000000")
                    {
                        isHaveTaxValue = true;
                        taxTotalAmount = expen.Amount;
                    }
                   else
                    {
                        ACCOUNTGL account = new ACCOUNTGL()
                        {
                            BUS_AREA = (string.IsNullOrEmpty(expen.CostCenter) ? expen.BusArea : ""),
                            ITEMNO_ACC = mGlobalCount,
                            GL_ACCOUNT = expen.AccountGL,
                            ITEM_TEXT = expen.ItemText,
                            COSTCENTER = expen.CostCenter
                        };
                        decimal amount = expen.Amount * (expen.ExchRate == 0 ? 1 : expen.ExchRate);
                        //存储object数组值
                        object[] obj = { mGlobalCount, amount, 0 };
                        mFristTable.Add(obj);
                        totalAmount += amount;
                        //插入数据到SAP
                        InsertDataAccountGL(account);
                    }
                }

                //当存在税额时,需要单独插入税额数据
                if (isHaveTaxValue == true)
                {
                    ACCOUNTTAX account = new ACCOUNTTAX()
                    {
                        ITEMNO_ACC = mGlobalCount
                    };
                    //插入数据到SAP
                    InsertDataAccountTax(account);
                    //存储object数组值
                    object[] obj = { mGlobalCount, taxTotalAmount, totalAmount };
                    mFristTable.Add(obj);
                }
            }
        }
示例#3
0
 /// <summary>
 /// 插入数据到SAP表:AccountGL
 /// </summary>
 /// <param name="accountGL"></param>
 protected void InsertDataAccountGL(ACCOUNTGL accountGL)
 {
     IRfcTable rfcTableAccountGL = mCurrentRfcFunction.GetTable("ACCOUNTGL");
     rfcTableAccountGL.Insert();
     rfcTableAccountGL.CurrentRow.SetValue("ITEMNO_ACC", accountGL.ITEMNO_ACC);
     rfcTableAccountGL.CurrentRow.SetValue("GL_ACCOUNT", accountGL.GL_ACCOUNT);
     rfcTableAccountGL.CurrentRow.SetValue("ITEM_TEXT", accountGL.ITEM_TEXT);
     rfcTableAccountGL.CurrentRow.SetValue("STAT_CON", accountGL.STAT_CON);
     rfcTableAccountGL.CurrentRow.SetValue("LOG_PROC", accountGL.LOG_PROC);
     rfcTableAccountGL.CurrentRow.SetValue("AC_DOC_NO", accountGL.AC_DOC_NO);
     rfcTableAccountGL.CurrentRow.SetValue("REF_KEY_1", accountGL.REF_KEY_1);
     rfcTableAccountGL.CurrentRow.SetValue("REF_KEY_2", accountGL.REF_KEY_2);
     rfcTableAccountGL.CurrentRow.SetValue("REF_KEY_3", accountGL.REF_KEY_3);
     rfcTableAccountGL.CurrentRow.SetValue("ACCT_KEY", accountGL.ACCT_KEY);
     rfcTableAccountGL.CurrentRow.SetValue("ACCT_TYPE", accountGL.ACCT_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("DOC_TYPE", accountGL.DOC_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("COMP_CODE", accountGL.COMP_CODE);
     rfcTableAccountGL.CurrentRow.SetValue("BUS_AREA", accountGL.BUS_AREA);
     rfcTableAccountGL.CurrentRow.SetValue("FUNC_AREA", accountGL.FUNC_AREA);
     rfcTableAccountGL.CurrentRow.SetValue("PLANT", accountGL.PLANT);
     rfcTableAccountGL.CurrentRow.SetValue("FIS_PERIOD", accountGL.FIS_PERIOD);
     rfcTableAccountGL.CurrentRow.SetValue("FISC_YEAR", accountGL.FISC_YEAR);
     rfcTableAccountGL.CurrentRow.SetValue("PSTNG_DATE", accountGL.PSTNG_DATE);
     rfcTableAccountGL.CurrentRow.SetValue("VALUE_DATE", accountGL.VALUE_DATE);
     rfcTableAccountGL.CurrentRow.SetValue("FM_AREA", accountGL.FM_AREA);
     rfcTableAccountGL.CurrentRow.SetValue("CUSTOMER", accountGL.CUSTOMER);
     rfcTableAccountGL.CurrentRow.SetValue("CSHDIS_IND", accountGL.CSHDIS_IND);
     rfcTableAccountGL.CurrentRow.SetValue("VENDOR_NO", accountGL.VENDOR_NO);
     rfcTableAccountGL.CurrentRow.SetValue("ALLOC_NMBR", accountGL.ALLOC_NMBR);
     rfcTableAccountGL.CurrentRow.SetValue("TAX_CODE", accountGL.TAX_CODE);
     rfcTableAccountGL.CurrentRow.SetValue("TAXJURCODE", accountGL.TAXJURCODE);
     rfcTableAccountGL.CurrentRow.SetValue("EXT_OBJECT_ID", accountGL.EXT_OBJECT_ID);
     rfcTableAccountGL.CurrentRow.SetValue("BUS_SCENARIO", accountGL.BUS_SCENARIO);
     rfcTableAccountGL.CurrentRow.SetValue("COSTOBJECT", accountGL.COSTOBJECT);
     rfcTableAccountGL.CurrentRow.SetValue("COSTCENTER", accountGL.COSTCENTER);
     rfcTableAccountGL.CurrentRow.SetValue("ACTTYPE", accountGL.ACTTYPE);
     rfcTableAccountGL.CurrentRow.SetValue("PROFIT_CTR", accountGL.PROFIT_CTR);
     rfcTableAccountGL.CurrentRow.SetValue("PART_PRCTR", accountGL.PART_PRCTR);
     rfcTableAccountGL.CurrentRow.SetValue("NETWORK", accountGL.NETWORK);
     rfcTableAccountGL.CurrentRow.SetValue("WBS_ELEMENT", accountGL.WBS_ELEMENT);
     rfcTableAccountGL.CurrentRow.SetValue("ORDERID", accountGL.ORDERID);
     rfcTableAccountGL.CurrentRow.SetValue("ORDER_ITNO", accountGL.ORDER_ITNO);
     rfcTableAccountGL.CurrentRow.SetValue("ROUTING_NO", accountGL.ROUTING_NO);
     rfcTableAccountGL.CurrentRow.SetValue("ACTIVITY", accountGL.ACTIVITY);
     rfcTableAccountGL.CurrentRow.SetValue("COND_TYPE", accountGL.COND_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("COND_COUNT", accountGL.COND_COUNT);
     rfcTableAccountGL.CurrentRow.SetValue("COND_ST_NO", accountGL.COND_ST_NO);
     rfcTableAccountGL.CurrentRow.SetValue("FUND", accountGL.FUND);
     rfcTableAccountGL.CurrentRow.SetValue("FUNDS_CTR", accountGL.FUNDS_CTR);
     rfcTableAccountGL.CurrentRow.SetValue("CMMT_ITEM", accountGL.CMMT_ITEM);
     rfcTableAccountGL.CurrentRow.SetValue("CO_BUSPROC", accountGL.CO_BUSPROC);
     rfcTableAccountGL.CurrentRow.SetValue("ASSET_NO", accountGL.ASSET_NO);
     rfcTableAccountGL.CurrentRow.SetValue("SUB_NUMBER", accountGL.SUB_NUMBER);
     rfcTableAccountGL.CurrentRow.SetValue("BILL_TYPE", accountGL.BILL_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("SALES_ORD", accountGL.SALES_ORD);
     rfcTableAccountGL.CurrentRow.SetValue("S_ORD_ITEM", accountGL.S_ORD_ITEM);
     rfcTableAccountGL.CurrentRow.SetValue("DISTR_CHAN", accountGL.DISTR_CHAN);
     rfcTableAccountGL.CurrentRow.SetValue("DIVISION", accountGL.DIVISION);
     rfcTableAccountGL.CurrentRow.SetValue("SALESORG", accountGL.SALESORG);
     rfcTableAccountGL.CurrentRow.SetValue("SALES_GRP", accountGL.SALES_GRP);
     rfcTableAccountGL.CurrentRow.SetValue("SALES_OFF", accountGL.SALES_OFF);
     rfcTableAccountGL.CurrentRow.SetValue("SOLD_TO", accountGL.SOLD_TO);
     rfcTableAccountGL.CurrentRow.SetValue("DE_CRE_IND", accountGL.DE_CRE_IND);
     rfcTableAccountGL.CurrentRow.SetValue("P_EL_PRCTR", accountGL.P_EL_PRCTR);
     rfcTableAccountGL.CurrentRow.SetValue("XMFRW", accountGL.XMFRW);
     rfcTableAccountGL.CurrentRow.SetValue("QUANTITY", accountGL.QUANTITY);
     rfcTableAccountGL.CurrentRow.SetValue("BASE_UOM", accountGL.BASE_UOM);
     rfcTableAccountGL.CurrentRow.SetValue("BASE_UOM_ISO", accountGL.BASE_UOM_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("INV_QTY", accountGL.INV_QTY);
     rfcTableAccountGL.CurrentRow.SetValue("INV_QTY_SU", accountGL.INV_QTY_SU);
     rfcTableAccountGL.CurrentRow.SetValue("SALES_UNIT", accountGL.SALES_UNIT);
     rfcTableAccountGL.CurrentRow.SetValue("SALES_UNIT_ISO", accountGL.SALES_UNIT_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("PO_PR_QNT", accountGL.PO_PR_QNT);
     rfcTableAccountGL.CurrentRow.SetValue("PO_PR_UOM", accountGL.PO_PR_UOM);
     rfcTableAccountGL.CurrentRow.SetValue("PO_PR_UOM_ISO", accountGL.PO_PR_UOM_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("ENTRY_QNT", accountGL.ENTRY_QNT);
     rfcTableAccountGL.CurrentRow.SetValue("ENTRY_UOM", accountGL.ENTRY_UOM);
     rfcTableAccountGL.CurrentRow.SetValue("ENTRY_UOM_ISO", accountGL.ENTRY_UOM_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("VOLUME", accountGL.VOLUME);
     rfcTableAccountGL.CurrentRow.SetValue("VOLUMEUNIT", accountGL.VOLUMEUNIT);
     rfcTableAccountGL.CurrentRow.SetValue("VOLUMEUNIT_ISO", accountGL.VOLUMEUNIT_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("GROSS_WT", accountGL.GROSS_WT);
     rfcTableAccountGL.CurrentRow.SetValue("NET_WEIGHT", accountGL.NET_WEIGHT);
     rfcTableAccountGL.CurrentRow.SetValue("UNIT_OF_WT", accountGL.UNIT_OF_WT);
     rfcTableAccountGL.CurrentRow.SetValue("UNIT_OF_WT_ISO", accountGL.UNIT_OF_WT_ISO);
     rfcTableAccountGL.CurrentRow.SetValue("ITEM_CAT", accountGL.ITEM_CAT);
     rfcTableAccountGL.CurrentRow.SetValue("MATERIAL", accountGL.MATERIAL);
     rfcTableAccountGL.CurrentRow.SetValue("MATL_TYPE", accountGL.MATL_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("MVT_IND", accountGL.MVT_IND);
     rfcTableAccountGL.CurrentRow.SetValue("REVAL_IND", accountGL.REVAL_IND);
     rfcTableAccountGL.CurrentRow.SetValue("ORIG_GROUP", accountGL.ORIG_GROUP);
     rfcTableAccountGL.CurrentRow.SetValue("ORIG_MAT", accountGL.ORIG_MAT);
     rfcTableAccountGL.CurrentRow.SetValue("SERIAL_NO", accountGL.SERIAL_NO);
     rfcTableAccountGL.CurrentRow.SetValue("PART_ACCT", accountGL.PART_ACCT);
     rfcTableAccountGL.CurrentRow.SetValue("TR_PART_BA", accountGL.TR_PART_BA);
     rfcTableAccountGL.CurrentRow.SetValue("TRADE_ID", accountGL.TRADE_ID);
     rfcTableAccountGL.CurrentRow.SetValue("VAL_AREA", accountGL.VAL_AREA);
     rfcTableAccountGL.CurrentRow.SetValue("VAL_TYPE", accountGL.VAL_TYPE);
     rfcTableAccountGL.CurrentRow.SetValue("ASVAL_DATE", accountGL.ASVAL_DATE);
     rfcTableAccountGL.CurrentRow.SetValue("PO_NUMBER", accountGL.PO_NUMBER);
     rfcTableAccountGL.CurrentRow.SetValue("PO_ITEM", accountGL.PO_ITEM);
     rfcTableAccountGL.CurrentRow.SetValue("ITM_NUMBER", accountGL.ITM_NUMBER);
     rfcTableAccountGL.CurrentRow.SetValue("COND_CATEGORY", accountGL.COND_CATEGORY);
     rfcTableAccountGL.CurrentRow.SetValue("FUNC_AREA_LONG", accountGL.FUNC_AREA_LONG);
     rfcTableAccountGL.CurrentRow.SetValue("CMMT_ITEM_LONG", accountGL.CMMT_ITEM_LONG);
     rfcTableAccountGL.CurrentRow.SetValue("GRANT_NBR", accountGL.GRANT_NBR);
     rfcTableAccountGL.CurrentRow.SetValue("CS_TRANS_T", accountGL.CS_TRANS_T);
     rfcTableAccountGL.CurrentRow.SetValue("MEASURE", accountGL.MEASURE);
     rfcTableAccountGL.CurrentRow.SetValue("SEGMENT", accountGL.SEGMENT);
     rfcTableAccountGL.CurrentRow.SetValue("PARTNER_SEGMENT", accountGL.PARTNER_SEGMENT);
     rfcTableAccountGL.CurrentRow.SetValue("RES_DOC", accountGL.RES_DOC);
     rfcTableAccountGL.CurrentRow.SetValue("RES_ITEM", accountGL.RES_ITEM);
 }