quickbooks发票中如何设置发票日期?

问题描述 投票:0回答:1

我使用的是 速记本 我想把发票日期设置为我想要的任何日期。我正在使用这段代码。

如果我把它设置为 TxnDate 字段,它会向我抛出错误。那么我如何设置 invStartDate 呢?

const createInvoiceObj = {
    DocNumber: docNumber,
    Line: [
      {
        Id: "1",
        LineNum: 1,
        Description: `The description`,
        Amount: 1232,
        DetailType: "SalesItemLineDetail",
        SalesItemLineDetail: {
          ItemRef: {
            value: "19",
            name: "Service"
          },
          UnitPrice: 1232,
          Qty: "1"
        }
      }
    ],
    CustomerRef: {
      value: "1"
    },
    CustomerMemo: {
      value: "Thank you for your business and have a great day!"
    },
    TotalAmt: totalAmount,
    TxnDate: moment(order.createdAt).format("YYYY-MM-DD")  // TxnDate: '2020-05-22'
  };

enter image description here

当使用TxnDate时,我得到的错误是

{
  "Fault": {
    "Error": [
      {
        "Message": "Transaction date is prior to start date for inventory item",
        "Detail": "Transactions with inventory (QOH) products cant be dated earlier than the Inventory Start Date for the product",
        "code": "6270",
        "element": ""
      }
    ],
    "type": "ValidationFault"
  },
  "time": "2020-05-27T05:26:58.217-07:00"
}
javascript quickbooks quickbooks-online
1个回答
1
投票

正确的设置发票日期的字段是 TxnDate.

例子。

{
  "Invoice": {
    "TxnDate": "2014-09-19", 
...

这里有很好的记录。

如果你收到这个错误信息

"Error": [
      {
        "Message": "Transaction date is prior to start date for inventory item",
        "Detail": "Transactions with inventory (QOH) products cant be dated earlier than the Inventory Start Date for the product",
        "code": "6270",
        "element": ""
      }
    ],

这意味着你发送了一个毫无意义的日期 It means you're sending a date that makes no sense. 在现实世界的场景中,你要做的是这样的。

You have 0 widgets in inventory 
You try to sell 5 items (you can't, you have zero items in inventory)
You start carrying and stocking widgets in inventory 

发票日期必须是 之后 您创建的日期开始携带该项目产品。

更改发票的日期,使发票的日期为 之后 你说的携带物品产品。

© www.soinside.com 2019 - 2024. All rights reserved.