简体   繁体   English

查找贷项凭单支付哪些发票

[英]Finding which invoice(s) are paid by a credit memo

So I have an invoice and a credit memo, and the two are linked via a payment as per these instructions . 因此,我有一张发票和一张贷项凭证,并且按照这些说明通过付款将两者链接在一起。 All is good, the invoice is showing as paid and the customer's balance is correct. 一切都很好,发票显示为已付款,客户的余额是正确的。

If I open up the credit memo (Adjustment Note) in the GUI I am able to see at a glance the related payment at the right side of the screen: 如果我在GUI中打开贷项通知单(调整注释),则可以在屏幕右侧一眼看到相关的付款:

相关付款

Now, I am trying to read back this information from the QBO IPP API (v3). 现在,我正在尝试从QBO IPP API(v3)读取此信息。 Querying for the adjustment note I get the following response. 查询调整通知单,我得到以下响应。 As you can see, there is nothing there to tell me about this linked payment: 如您所见,关于此关联付款,没有什么可告诉我的:

  <CreditMemo domain="QBO" sparse="false">
    <Id>1239</Id>
    <SyncToken>1</SyncToken>
    <MetaData>
      <CreateTime>2015-01-15T09:17:07-08:00</CreateTime>
      <LastUpdatedTime>2015-01-15T09:17:09-08:00</LastUpdatedTime>
    </MetaData>
    <DocNumber>4109</DocNumber>
    <TxnDate>2014-12-02</TxnDate>
    <CurrencyRef name="Australian Dollar">AUD</CurrencyRef>
    <PrivateNote>Cancelled</PrivateNote>
    <Line>
      <Id>1</Id>
      <LineNum>1</LineNum>
      <Amount>318.18</Amount>
      <DetailType>SalesItemLineDetail</DetailType>
      <SalesItemLineDetail>
        <ItemRef name="IPP">10</ItemRef>
        <TaxCodeRef>10</TaxCodeRef>
      </SalesItemLineDetail>
    </Line>
    <Line>
      <Amount>318.18</Amount>
      <DetailType>SubTotalLineDetail</DetailType>
      <SubTotalLineDetail />
    </Line>
    <TxnTaxDetail>
      <TotalTax>31.82</TotalTax>
      <TaxLine>
        <Amount>31.82</Amount>
        <DetailType>TaxLineDetail</DetailType>
        <TaxLineDetail>
          <TaxRateRef>20</TaxRateRef>
          <PercentBased>true</PercentBased>
          <TaxPercent>10</TaxPercent>
          <NetAmountTaxable>318.18</NetAmountTaxable>
        </TaxLineDetail>
      </TaxLine>
    </TxnTaxDetail>
    <CustomerRef name="xxxxxx">99</CustomerRef>
    <GlobalTaxCalculation>TaxInclusive</GlobalTaxCalculation>
    <TotalAmt>350.00</TotalAmt>
    <PrintStatus>NeedToPrint</PrintStatus>
    <EmailStatus>NotSet</EmailStatus>
    <Balance>0</Balance>
    <RemainingCredit>0</RemainingCredit>
  </CreditMemo>

If I read the payment I can learn about this adjustment note and the invoice from Line.LinkedTxn : 如果我阅读了付款,则可以从Line.LinkedTxn了解有关此调整说明和发票的Line.LinkedTxn

<Line>
  <Amount>350.00</Amount>
  <LinkedTxn>
    <TxnId>1190</TxnId>
    <TxnType>Invoice</TxnType>
  </LinkedTxn>
  <LineEx>
    <NameValue>
      <Name>txnId</Name>
      <Value>1190</Value>
    </NameValue>
    <NameValue>
      <Name>txnOpenBalance</Name>
      <Value>350.00</Value>
    </NameValue>
    <NameValue>
      <Name>txnReferenceNumber</Name>
      <Value>4069</Value>
    </NameValue>
  </LineEx>
</Line>
<Line>
  <Amount>350.00</Amount>
  <LinkedTxn>
    <TxnId>1239</TxnId>
    <TxnType>CreditMemo</TxnType>
  </LinkedTxn>
  <LineEx>
    <NameValue>
      <Name>txnId</Name>
      <Value>1239</Value>
    </NameValue>
    <NameValue>
      <Name>txnOpenBalance</Name>
      <Value>350.00</Value>
    </NameValue>
    <NameValue>
      <Name>txnReferenceNumber</Name>
      <Value>4109</Value>
    </NameValue>
  </LineEx>
</Line>

If I read the invoice I can learn about the payment from LinkedTxn : 如果我阅读了发票,可以从LinkedTxn了解付款LinkedTxn

<LinkedTxn>
  <TxnId>1240</TxnId>
  <TxnType>Payment</TxnType>
</LinkedTxn>

But I need to find the payment given the adjustment note. 但是我需要根据调整单找到付款。 As far as I can tell from the documentation, there is no way to query payments for their lines' contents. 据我从文档中可以看出,无法查询其行内容的付款。 So, how do I find this payment given the credit memo, so I can learn what it is paying? 因此,在给定贷项凭证的情况下,如何找到这笔付款,以便我可以了解付款情况?

Credit Memo, Invoice and Payment all apply to same CustomerRef. 贷项通知单,发票和付款都适用于同一CustomerRef。 Credit memo does not support the linked txn details yet, so as a workaround, you can try this- Get the Payment/s which have same customerref as creditmemo's customeref. 贷项通知单尚不支持链接的txn详细信息,因此,作为一种解决方法,您可以尝试以下操作-获得与creditmemo的customeref具有相同的customerref的付款。 Then loop through the payment/s to read the linked txn ids and match it against the credit memo id you have. 然后遍历付款,读取链接的txn ID,并将其与您的贷项凭证ID匹配。

Not a great solution but since your use is not supported by the V3 api right now, you can try the above. 这不是一个很好的解决方案,但是由于V3 API目前不支持您的使用,因此您可以尝试上述方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM