Esempio n. 1
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);
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 插入数据到SAP表:
 /// </summary>
 /// <param name="currencyAmount"></param>
 protected void InsertDataAccountTax(ACCOUNTTAX currencyAmount)
 {
     IRfcTable rfcTableCurrencyAmount = mCurrentRfcFunction.GetTable("ACCOUNTTAX");
     rfcTableCurrencyAmount.Insert();
     rfcTableCurrencyAmount.CurrentRow.SetValue("ITEMNO_ACC", currencyAmount.ITEMNO_ACC);
     rfcTableCurrencyAmount.CurrentRow.SetValue("TAX_CODE", "J1");
 }