1

我正在尝试在附加扩展上撤消 A/R RESERVEI NVOICE b1 中的自动总金额回合。

错误发生在:

txtDocTotalAfterDiscountFreightCharge.Active = true;
txtDocTotalAfterDiscountFreightCharge.String = total.ToString();

出现此错误:仅当我撤消 A/R RESERVEI NVOICE 上的回合时。

A/R invoice - document total, field cannot be updated (odbc -1029)

对于 A/R INVOICE,它运行良好。

[BasicSapForm(Consts.FORM_RESERVE_INVOICE)]
[BasicSapForm(Consts.FORM_INVOICE)]
 class OinvListener : SapDocumentsForm
    {
        public OinvListener(string uniqueId, object extraInfo)
            : base(uniqueId, extraInfo)
        {
        }


        public override void Init()
        {
        }


        [BasicSapEvent(SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE, "", true)]
        [BasicSapEvent(SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD, "", true)]
        private bool BeforeFormAdd(SAPbouiCOM.BusinessObjectInfo pVal)
        {
            if (MO_ModuleManager.Common.B1Starter.userModules.ContainsKey(ModuleInfo.Code))
            {
                if (MO_ModuleManager.Common.B1Starter.userModules.ContainsKey(ModuleInfo.SubCode2))
                {
                    di.BusinessPartners diBp = SapUtils.GetDiObjectByFormTypeAndKey                            (Consts.FORM_BP, txtCardCode.String) as di.BusinessPartners;
                    if (diBp.UserFields.Fields.Item("U_RoundAum").Value.ToString() == "N")
                    {
                        double total = TypeUtils.ExtractDouble
(txtDocTotalAfterDiscountFreightCharge.String);
                        ui.EditText txtDisc = mForm.Items.Item("42").Specific as ui.EditText;
                        if (false == string.IsNullOrEmpty(txtDisc.String))
                            total += TypeUtils.ExtractDouble(txtDisc.String);
                        try
                        {
                            txtDocTotalAfterDiscountFreightCharge.Active = true;
                            txtDocTotalAfterDiscountFreightCharge.String = total.ToString();
                        }
                       catch {  }
                    }
                }
            }
            return true;
        }
    }
4

0 回答 0