通过网络 API 添加销售订单付款时出现 "Cannot generate the next number for the AR Last Reference Number sequence" 错误

I'm getting "Cannot generate the next number for the AR Last Reference Number sequence" error when adding payment for sales order through web API

当我尝试通过 Web 服务 API 向销售订单添加付款时,我得到了 "PX.Data.PXSetPropertyException: Error: An error occurred while processing the field Payment Ref. : CS Error #30: Cannot generate the next number for the AR Last Reference Number sequence.."。代码如下:

  AR302000Content AR302000 = context.AR302000GetSchema();
  context.AR302000Clear();

  List<Command> cmds = new List<Command>();


  //add header info
  cmds.Add(new Value { Value = " <NEW>", LinkedCommand = AR302000.PaymentSummary.ReferenceNbr });
  cmds.Add(new Value { Value = "Payment", LinkedCommand = AR302000.PaymentSummary.Type, Commit = true });
  cmds.Add(new Value { Value = "A123456", LinkedCommand = AR302000.PaymentSummary.Customer });
  cmds.Add(new Value { Value = "MAIN", LinkedCommand = AR302000.PaymentSummary.Location });
  cmds.Add(new Value { Value = "CreditCard", LinkedCommand = AR302000.PaymentSummary.PaymentMethod });
  cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.PaymentSummary.PaymentAmount});
  cmds.Add(new Value { Value = "T123456", LinkedCommand = AR302000.PaymentSummary.PaymentRef, Commit = true });
  cmds.Add(new Value { Value = "99000001", LinkedCommand = AR302000.PaymentSummary.CashAccount });

  cmds.Add(AR302000.OrdersToApply.ServiceCommands.NewRow);
  cmds.Add(new Value { Value = "00001234", LinkedCommand = AR302000.OrdersToApply.OrderNbr });
  cmds.Add(new Value { Value = "SO", LinkedCommand = AR302000.OrdersToApply.OrderType });
  cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.OrdersToApply.OrderTotal });
  cmds.Add(new Value { Value = "300.00", LinkedCommand = AR302000.OrdersToApply.AppliedToOrder });

  cmds.Add(AR302000.Actions.Save);

  AR302000Content[] AR302000content = context.AR302000Submit(cmds.ToArray());

我检查了我的 "numbering sequences" 配置,看起来唯一与支付相关的编号序列是 "ARPAYMENT",这是正确的,而且我相信这个 "ARPAYMENT" 是用于 "ReferenceNbr" 反正。

"PaymentRef" 似乎没有编号顺序,这似乎是错误消息所抱怨的。根据 "help" 文档,这个 "Payment Ref" 应该能够接受给定的字符串,我做了但似乎不起作用...

有人知道哪里出了问题吗?

我刚刚发现问题 - 当我创建付款时,作为强制要求的一部分,我分配了一个现金账户,该账户与 "Payment method" - 信用卡之一相关联,但是,出于某种原因,在那个现金账户页面中,"Credit Card" 付款方式被指定为 "AR - Suggest Next Number",老实说,我不知道这是什么意思。在我取消选中该复选框后,一切都变得正常了。我猜复选框意味着 "Payment and Application" 屏幕上的 "Payment Ref" 字段需要自动生成,但它确实令人困惑,因为没有地方提到 "Payment Ref."。

总之,问题已经解决,感谢大家的回复!