Productive Computing, Inc. Support Forum

Plug-ins => FM Books Connector => Topic started by: pjreagan on January 12, 2012, 06:31:08 PM

Title: QBOE ReceivePaymentAddRq not finding invoice
Post by: pjreagan on January 12, 2012, 06:31:08 PM
Greetings,

When exporting a payment to QuickBooks Online Edition using qbxml, I'm including an invoice TxnId for a previously created invoice but the payment is not applied to that invoice.  What am I doing wrong?

Here's my payment creation xml.  This technique has worked in the off-line QB versions but is not working for QBOE...
<ReceivePaymentAddRq><ReceivePaymentAdd>
<CustomerRef><FullName>Academy Village</FullName></CustomerRef>
<TxnDate>2009-03-16</TxnDate>
<RefNumber></RefNumber>
<TotalAmount>2230.00</TotalAmount>
<PaymentMethodRef><FullName>check</FullName></PaymentMethodRef>
<Memo></Memo>
<DepositToAccountRef><FullName>Undeposited Funds</FullName></DepositToAccountRef>
<AppliedToTxnAdd>
<TxnID>20</TxnID>
<PaymentAmount>2230.00</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd></ReceivePaymentAddRq>

This creates a payment but the AppliedToTxnAdd doesn't seem to have done anything.  Here's what the payment looks like in QBOE...
   <ReceivePaymentQueryRs statusCode="0" statusMessage="Status OK" statusSeverity="Info">
   <ReceivePaymentRet>
      <TxnID>24</TxnID>
      <TimeCreated>2012-01-12T17:07:11</TimeCreated>
      <TimeModified>2012-01-12T17:07:11</TimeModified>
      <EditSequence>0</EditSequence>
      <TxnNumber>24</TxnNumber>
      <CustomerRef>
         <ListID>2</ListID>
         <FullName>Academy Village</FullName>
      </CustomerRef>
      <TxnDate>2009-03-16</TxnDate>
      <TotalAmount>2230.00</TotalAmount>
      <PaymentMethodRef>
         <ListID>2</ListID>
         <FullName>Check</FullName>
      </PaymentMethodRef>
      <DepositToAccountRef>
         <ListID>4</ListID>
         <FullName>Undeposited Funds</FullName>
      </DepositToAccountRef>
      <UnusedPayment>2230.00</UnusedPayment>
      <UnusedCredits>5133.00</UnusedCredits>
   </ReceivePaymentRet>
</ReceivePaymentQueryRs>


This in contrast to a payment applied manually (from within QBOE) to the invoice.  Notice the AppliedToTxnRet information IS correct...
   <ReceivePaymentRet>
      <TxnID>23</TxnID>
      <TimeCreated>2012-01-12T15:37:51</TimeCreated>
      <TimeModified>2012-01-12T15:37:51</TimeModified>
      <EditSequence>0</EditSequence>
      <TxnNumber>23</TxnNumber>
      <CustomerRef>
         <ListID>4</ListID>
         <FullName>Academy Village:fkhjk</FullName>
      </CustomerRef>
      <TxnDate>2012-01-12</TxnDate>
      <TotalAmount>1.11</TotalAmount>
      <PaymentMethodRef>
         <ListID>2</ListID>
         <FullName>Check</FullName>
      </PaymentMethodRef>
      <DepositToAccountRef>
         <ListID>4</ListID>
         <FullName>Undeposited Funds</FullName>
      </DepositToAccountRef>
      <UnusedPayment>0.00</UnusedPayment>
      <AppliedToTxnRet>
         <TxnID>20</TxnID>
         <TxnType>Invoice</TxnType>
         <TxnDate>2007-01-13</TxnDate>
         <RefNumber>1009</RefNumber>
         <BalanceRemaining>2927.89</BalanceRemaining>
         <Amount>1.11</Amount>
         <TxnLineDetail>
            <TxnLineID>1</TxnLineID>
            <Amount>1.11</Amount>
         </TxnLineDetail>
      </AppliedToTxnRet>
   </ReceivePaymentRet>

Does anyone have suggestions as to what else I can try?  The OSR doesn't seem to be helping here. 

Thanks in advance!
Title: Re: QBOE ReceivePaymentAddRq not finding invoice
Post by: Geoffrey Gerhard on January 12, 2012, 08:50:24 PM
You are not specifying a TxnLineDetail [ ListID ; FullName ]  value. The OSR shows that you need to specify at least one of these for each AppliedToTxnAdd element when making this Request to an Online Edition file.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
Title: Re: QBOE ReceivePaymentAddRq not finding invoice
Post by: pjreagan on January 17, 2012, 05:30:37 PM
Thanks for the reply Geoffrey.  Unfortunately this didn't help.  Here's my adjusted xml...

<ReceivePaymentAddRq>
    <ReceivePaymentAdd>
        <CustomerRef><FullName>Academy Village</FullName></CustomerRef>
        <TxnDate>2009-03-16</TxnDate>
        <RefNumber></RefNumber>
        <TotalAmount>2230.00</TotalAmount>
        <PaymentMethodRef><FullName>check</FullName></PaymentMethodRef>
        <Memo></Memo>
        <DepositToAccountRef><FullName>Undeposited Funds</FullName></DepositToAccountRef>
        <AppliedToTxnAdd>
            <TxnID>20</TxnID>
            <PaymentAmount>2230.00</PaymentAmount>
            <TxnLineDetail>
                <TxnLineID>1</TxnLineID>
                <Amount>2230.00</Amount>
            </TxnLineDetail>
        </AppliedToTxnAdd>
    </ReceivePaymentAdd>
</ReceivePaymentAddRq>


With no error thrown, the response still ignores the AppliedToTxnAdd...

<ReceivePaymentAddRs statusCode="0" statusMessage="Status OK" statusSeverity="Info">
   <ReceivePaymentRet>
      <TxnID>28</TxnID>
      <TimeCreated>2012-01-17T16:08:46</TimeCreated>
      <TimeModified>2012-01-17T16:08:46</TimeModified>
      <EditSequence>0</EditSequence>
      <TxnNumber>28</TxnNumber>
      <CustomerRef>
         <ListID>2</ListID>
         <FullName>Academy Village</FullName>
      </CustomerRef>
      <TxnDate>2009-03-16</TxnDate>
      <TotalAmount>2230.00</TotalAmount>
      <PaymentMethodRef>
         <ListID>2</ListID>
         <FullName>Check</FullName>
      </PaymentMethodRef>
      <DepositToAccountRef>
         <ListID>4</ListID>
         <FullName>Undeposited Funds</FullName>
      </DepositToAccountRef>
      <UnusedPayment>2230.00</UnusedPayment>
      <UnusedCredits>7463.00</UnusedCredits>
   </ReceivePaymentRet>
</ReceivePaymentAddRs>

What am I missing?
Also:  my OSR says that the TxnLineDetail is optional ("0 - n").  What are you seeing that indicates that it's required?

Thanks again,
Patrick
Title: Re: QBOE ReceivePaymentAddRq not finding invoice
Post by: Geoffrey Gerhard on January 18, 2012, 05:41:37 PM
I failed to notice that the TxnLineDetail node itself is optional when I saw that TxnLineID and Amount were marked "required." Sorry for the red-herring!

Two other ideas:

Are you certain that the AppliedToTxnAdd:TxnID value is correct? I'd have expected an error, not a statusMessage attribute of "Status OK", but you have to start somewhere.

What's the Transaction Date of the Transaction to which you're trying to apply payment? I notice that the Receive Payment's TxnDate is March 16, 2009. Don't know what would happen if you tried to apply a payment to a transaction that didn't exist on the Receive Payment's TxnDate, and wondering if that's the source of the problem.

Good luck!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
Title: Re: QBOE ReceivePaymentAddRq not finding invoice
Post by: pjreagan on January 19, 2012, 05:22:00 PM
Hi Geoffrey,

No problem about the TxnLineID.  I just wanted to make sure we were reading the same OSR information, in the same way.  And yes, the TxnID is correct.  That date suggestion was a good one.  It started me testing all the data being exported.  The breakthrough came after exporting a simpler invoice then finding that payments to it DID connect.

The problem was happening with invoices that also have project names.  Payments against these have to have the exact same CustomerRef.  In other words, if the invoice was created with...
    <CustomerRef><FullName>Academy Village:test project</FullName></CustomerRef>

A payment that's being made against it must also have...
    <CustomerRef><FullName>Academy Village:test project</FullName></CustomerRef>

NOT just the customer name, like I was using before...
    <CustomerRef><FullName>Academy Village</FullName></CustomerRef>


So now we know.  Thanks for your help!
Patrick