Sage erp 将订单标记为";“全额付款”;关于Sage 200

Sage erp 将订单标记为";“全额付款”;关于Sage 200,sage-erp,Sage Erp,我通过一个应用程序在Sage 200上插入订单,该应用程序使用客户端、C和API 我想勾选“订单付款”选项卡上的“全额付款”复选框 目前,我正在设置PaymentType属性,该属性不起作用 order.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull; order是Sage.Accounting.SOP.SOPOrder的一个实例 您知道如何检查该属性吗?以下方法应提供

我通过一个应用程序在Sage 200上插入订单,该应用程序使用客户端、
C
API

我想勾选“订单付款”选项卡上的“全额付款”复选框

目前,我正在设置PaymentType属性,该属性不起作用

order.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;
order是Sage.Accounting.SOP.SOPOrder的一个实例


您知道如何检查该属性吗?

以下方法应提供所需的结果

    private static void SetPaymentWithOrder(Sage.Accounting.SOP.SOPOrder sopOrder)
    {
        // Indicate that order has payment
        sopOrder.PaymentWithOrder = true;

        // This is full payment order
        sopOrder.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;

        // Fetch the the Payment Methods. SOPPaymentMethods contructor accepts the boolean flag whether to fetch payment methods including card processing method or not.
        Sage.Accounting.SOP.SOPPaymentMethods paymentMethodsCollection = new Sage.Accounting.SOP.SOPPaymentMethods(false);

        // Set the first payment method of the collection to the order
        sopOrder.PaymentMethod = paymentMethodsCollection.First;
    }

我不知道你是否能找到这个答案

不确定您是否知道这一点,但您不能在查看表单上修改销售订单,或者至少不应该尝试这样做

使用任何一种“输入/修改销售订单”表单都可以这样做。 可能发生的情况是,控件绑定到的属性在代码运行后没有更新UI

您可以使用以下命令强制执行此操作

获取基础绑定对象

public Sage.Accounting.SOP.SOPOrderReturn SOPOrderReturn
{
    get
    {
        //Loop over the boundobjects collection
        //check if the bound object is of the type we want - e.g. SOPOrderReturn
        //if correct type, return this object
        Sage.Common.Collections.BoundObjectCollection boundObjects = this.form.BoundObjects;

        if (boundObjects != null)
        {
            foreach (object boundObject in boundObjects)
            {
                if (boundObject is Sage.Accounting.SOP.SOPOrderReturn)
                {
                    this._sopOrderReturn = boundObject as Sage.Accounting.SOP.SOPOrderReturn;
                    break;
                }
            }
        }
        return this._sopOrderReturn;
    }
}
获取可修改表单的正确基础表单类型,挂起数据绑定, 执行您的更改, 恢复数据绑定

Sage.MMS.SOP.MaintainOrderForm maintainOrderForm = this.form.UnderlyingControl as Sage.MMS.SOP.MaintainOrderForm;

maintainOrderForm.BindingContext[this.SOPOrderReturn].SuspendBinding();
this.SOPOrderReturn.PaymentWithOrder = true;
this.SOPOrderReturn.PaymentType = Sage.Accounting.SOP.SOPOrderPaymentTypeEnum.EnumSOPOrderPaymentTypeFull;
maintainOrderForm.BindingContext[this.SOPOrderReturn].ResumeBinding();

应该这样做。

为了澄清,我假设您的订单总额为32英镑?