我正在通过SOAP API发布Acumatica付款,详见I210合同基础Web服务指南here的第117页。我已经实现了代码手动规范但是当我发布一个支付我得到这个错误: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线出现的错误。
您将“状态”设置为“打开”而不是将其设置为“平衡” –
您正在尝试使用此代码的Acumatica版本是什么? – samol518
@SamvelPetrosov,无论我在创建预付款时设置的状态如何,当我将payement对象作为“paymentToBeFound”取回时,它会以“平衡”形式返回。为了释放它应该是什么状态? –