Exemplo n.º 1
0
        /// <summary>
        /// 插入数据到第三个表:CurrencyAmount
        /// </summary>
        /// <param name="ITEMNOACC"></param>
        /// <param name="AMTDOCCUR"></param>
        protected void SetCurrencyAmount(int ITEMNOACC, decimal AMTDOCCUR, decimal TAXVALUE)
        {
            CURRENCYAMOUNT currAmount = new CURRENCYAMOUNT()
            {
                ITEMNO_ACC = ITEMNOACC,
                AMT_DOCCUR = AMTDOCCUR,
                CURRENCY = CurrentSapParameter.Currency,
                EXCH_RATE = CurrentSapParameter.ExchRate
            };

            InsertDataCurrencyAmount(currAmount, TAXVALUE);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 插入数据到 CurrencyAmount 表
        /// </summary>
        protected void SetCurrencyAmount()
        {
            for (int i = 0, count = CurrentSapParameter.ExpenceDetails.Count; i <= count; )
            {
                decimal AMTDOCCUR = 0;
                if (i == count){
                    AMTDOCCUR = -(CurrentSapParameter.ExpenceDetails.Select(p => p.Amount)).Sum();
                }
                else{
                    AMTDOCCUR = CurrentSapParameter.ExpenceDetails[i].Amount;
                }

                CURRENCYAMOUNT currAmount = new CURRENCYAMOUNT()
                {
                    ITEMNO_ACC = ++i,
                    AMT_DOCCUR = AMTDOCCUR,
                    CURRENCY = CurrentSapParameter.Currency,
                    EXCH_RATE = CurrentSapParameter.ExchRate
                };

                InsertDataCurrencyAmount(currAmount, 0);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 插入数据到 CurrencyAmount 表
        /// </summary>
        protected void SetCurrencyAmount()
        {
            //Cash Advance 只需插入固定的两行记录到SAP中的两个表
            for (int i = 1; i < 3; i++)
            {
                //当 i==1 时,AMTDOCCUR为负数,当i==2 时,AMTDOCCUR 值为整数
                decimal AMTDOCCUR = (decimal)(CurrentSapParameter.CashAmount * (i == 1 ? -1 : 1));
                CURRENCYAMOUNT currAmount = new CURRENCYAMOUNT()
                {
                    ITEMNO_ACC = i,
                    AMT_DOCCUR = AMTDOCCUR,
                    CURRENCY = CurrentSapParameter.Currency,
                    EXCH_RATE = CurrentSapParameter.ExchRate
                };

                InsertDataCurrencyAmount(currAmount, 0);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 插入数据到SAP表:CurrencyAmount
 /// </summary>
 /// <param name="currencyAmount"></param>
 protected void InsertDataCurrencyAmount(CURRENCYAMOUNT currencyAmount, decimal taxValue)
 {
     IRfcTable rfcTableCurrencyAmount = mCurrentRfcFunction.GetTable("CURRENCYAMOUNT");
     rfcTableCurrencyAmount.Insert();
     rfcTableCurrencyAmount.CurrentRow.SetValue("ITEMNO_ACC", currencyAmount.ITEMNO_ACC);
     rfcTableCurrencyAmount.CurrentRow.SetValue("CURR_TYPE", currencyAmount.CURR_TYPE);
     rfcTableCurrencyAmount.CurrentRow.SetValue("CURRENCY", currencyAmount.CURRENCY);
     rfcTableCurrencyAmount.CurrentRow.SetValue("CURRENCY_ISO", currencyAmount.CURRENCY_ISO);
     rfcTableCurrencyAmount.CurrentRow.SetValue("AMT_DOCCUR", currencyAmount.AMT_DOCCUR);
     rfcTableCurrencyAmount.CurrentRow.SetValue("EXCH_RATE", currencyAmount.EXCH_RATE);
     rfcTableCurrencyAmount.CurrentRow.SetValue("EXCH_RATE_V", currencyAmount.EXCH_RATE_V);
     rfcTableCurrencyAmount.CurrentRow.SetValue("AMT_BASE", currencyAmount.AMT_BASE);
     rfcTableCurrencyAmount.CurrentRow.SetValue("DISC_BASE", currencyAmount.DISC_BASE);
     rfcTableCurrencyAmount.CurrentRow.SetValue("DISC_AMT", currencyAmount.DISC_AMT);
     //当taxValue为0时,表示是税额,需要插入如下两个字段,taxValue为所有Items总额
     if (taxValue != 0){
         rfcTableCurrencyAmount.CurrentRow.SetValue("TAX_AMT", currencyAmount.TAX_AMT);
         rfcTableCurrencyAmount.CurrentRow.SetValue("AMT_BASE", taxValue);
     }
 }