2017-07-25 6 views
0

I210 Contract Based Web Servicesガイドhereの117ページに記載されているように、SOAP API経由でAcumatica支払いをリリースする予定です。Acumatica SOAP APIの支払いステータスのエラー

TX Error #3: Document Status is invalid for processing. at PX.Objects.AR.ARPaymentEntry.Release

私は、新しく作成された支払いの状況を見て、それは私がすべきと考えているバランスの状態を持っている:私はこのエラーを取得しています支払いを離したときに、私は、しかし、マニュアル仕様にコードを実装しています解放することができる。リリースのために支払いが必要な別のステータスがありますか?

マイコード:

//creates the order to attach the payment to 
SalesOrder newOrder = (SalesOrder)await client.PutAsync(orderToBeCreated); 

var wooPaymentRef = "Test"; 
//Create a payment for the order 
Payment paymentToBeCreated = new Payment() 
{ 
    Type = new StringValue { Value = "Prepayment" }, 
    Status = new StringValue { Value = "Open" }, 
    PaymentMethod = new StringValue { Value = store.AcumaticaPaymentMethod }, 
    PaymentAmount = new DecimalValue { Value = Convert.ToDecimal(wooOrder.order.total) }, 
    CustomerID = newOrder.CustomerID, 
    OrdersToApply = new PaymentOrder[] { 
    new PaymentOrder() 
    { 
     OrderType = new StringValue { Value = "SO"}, 
     OrderNbr = newOrder.OrderNbr, 
     AppliedToOrder = newOrder.OrderTotal 
    } 
    }, 
    CashAccount = new StringValue { Value = store.AcumaticaPaymentMethod }, 
    PaymentRef = new StringValue { Value = wooPaymentRef }, 
    Hold = new BooleanValue { Value = false} 
}; 

Payment newPayment = (Payment)await client.PutAsync(paymentToBeCreated); 

//Extra step to get the newly created payment just to make sure it's the most recent 
Payment paymentToBeFound = new Payment 
{ 
    Type = new StringSearch { Value = newPayment.Type.Value }, 
    ReferenceNbr = new StringSearch { Value = newPayment.ReferenceNbr.Value } 
}; 

Payment currentPayment = (Payment)await client.GetAsync(paymentToBeFound); 

//Release the payment 
InvokeResult invokeResult = await client.InvokeAsync(currentPayment, new ReleasePayment()); 
//Monitor the process 
ProcessResult processResult = await LongProcessRunner.GetProcessResult(client, invokeResult); 

エラーがInvokeResultラインで発生します。

+0

'Status'を' Balanced'に設定するのではなく 'Open'に設定しています –

+0

このコードを使っているAcumaticaのバージョンは何ですか? – samol518

+0

@SamvelPetrosov、私は前払いを作成するときにステータスを設定しているかどうかにかかわらず、 "paymentToBeFound"としてペイメントオブジェクトを取得すると "Balanced"となります。それを解放するためにはどのような状態にすべきですか? –

答えて

1

あなたが書いたコードに何も問題はありません。

新しいバージョンでは私が問題を再現できなかったので、あなたが何を求めていたのかをコメントで尋ねました。 あなたのバージョンは2017年2月上旬からのものです。この問題が修正されたという問題報告がありました。 これは、5.30.3715または6.10.0680よりも優れたバージョンですが、2017年6月上旬ごろです。

これらのバージョン以降でコードを試してみるとうまくいくはずです。

+0

ありがとうございます。私たちがバージョン6へのアップグレードを完了したらもう一度試してみます。バージョン6でREST APIを使ってこれを行う方法は? –

+0

これに遭遇した人のために、これは後のバージョンで動作することを@ samol518が確認しました。 –

関連する問題