#17 ✓resolved
Steven Price

QuickBooks error message: The transaction is empty.

Reported by Steven Price | July 21st, 2009 @ 12:49 PM | in 2.0 - "Ambidextrous Octopus"

My example:

c = QB::Check.new
c[{
  :IsToBePrinted => false,
  # :RefNumber => "10",
  :AccountRef => {:FullName => "Case Checking TechRockstars"},
  # :Total => "2000.00",
  :Address => { :Addr1 => "Rigo Gutierrez",
                :Addr2 => "1703 E. Charlinda St.",
                :City => "West Covina",
                :State => "CA",
                :PostalCode => "91791"},
  :TxnDate => Time.now.to_date.to_s,            
  :PayeeEntityRef => {:FullName => "Rigo Gutierrez"},  
  :Memo => "Blah",
  :ExpenseLine => [{
    :Amount => "2000",
    :AccountRef => { :FullName => "Advertising and Promotion"},
    :CustomerRef => { :FullName => "Rigo Gutierrez"}}]
  
  # :AppliedToTxn => { :PaymentAmount => "2000"}
}]

Copyied from console:

>> c = QB::Check.new
=> <Check:#18937120
  >
>> c[{
?>   :IsToBePrinted => false,
?>   # :RefNumber => "10",
?>   :AccountRef => {:FullName => "Case Checking TechRockstars"},
?>   # :Total => "2000.00",
?>   :Address => { :Addr1 => "Rigo Gutierrez",
?>                 :Addr2 => "1703 E. Charlinda St.",
?>                 :City => "West Covina",
?>                 :State => "CA",
?>                 :PostalCode => "91791"},
?>   :TxnDate => Time.now.to_date.to_s,            
?>   :PayeeEntityRef => {:FullName => "Rigo Gutierrez"},  
?>   :Memo => "Blah",
?>   :ExpenseLine => [{
?>     :Amount => "2000",
?>     :AccountRef => { :FullName => "Advertising and Promotion"},
?>     :CustomerRef => { :FullName => "Rigo Gutierrez"}}]
>>   
?>   # :AppliedToTxn => { :PaymentAmount => "2000"}
?> }]
=> {
     :Address=>{
       :City=>"West Covina",
       :PostalCode=>"91791",
       :State=>"CA",
       :Addr1=>"Rigo Gutierrez",
       :Addr2=>"1703 E. Charlinda St."},
     :AccountRef=>{:FullName=>"Case Checking TechRockstars"},
     :Memo=>"Blah",
     :ExpenseLine=>[
       {:Amount=>"2000",
         :AccountRef=>{:FullName=>"Advertising and Promotion"},
         :CustomerRef=>{:FullName=>"Rigo Gutierrez"}}
     ],
     :PayeeEntityRef=>{:FullName=>"Rigo Gutierrez"},
     :IsToBePrinted=>false,
     :TxnDate=>"2009-07-21"
   }
>> c.save
Quickbooks::QuickbooksAPIError: #3180: There was an error when saving a Check.  QuickBooks error message: The transaction is empty.
    from /Library/Ruby/Gems/1.8/gems/quickbooks-0.9.9/lib/quickbooks.rb:134:in `execute'
    from /Library/Ruby/Gems/1.8/gems/quickbooks-0.9.9/lib/quickbooks/model.rb:404:in `save'
    from /Library/Ruby/Gems/1.8/gems/quickbooks-0.9.9/lib/quickbooks/model.rb:403:in `catch'
    from /Library/Ruby/Gems/1.8/gems/quickbooks-0.9.9/lib/quickbooks/model.rb:403:in `save'
    from (irb):486
>> q.debug
=> "6.0"
>> c.save
=> "<?xml version=\"1.0\" ?>
<?qbxml version=\"6.0\" ?>
<QBXML>
  <QBXMLMsgsRq onError=\"stopOnError\">
    <CheckAddRq>
      <CheckAdd>
        <AccountRef>
          <FullName>Case Checking TechRockstars</FullName>
        </AccountRef>
        <PayeeEntityRef>
          <FullName>Rigo Gutierrez</FullName>
        </PayeeEntityRef>
        <TxnDate>2009-07-21</TxnDate>
        <Memo>Blah</Memo>
        <Address>
          <Addr1>Rigo Gutierrez</Addr1>
          <Addr2>1703 E. Charlinda St.</Addr2>
          <City>West Covina</City>
          <State>CA</State>
          <PostalCode>91791</PostalCode>
        </Address>
        <IsToBePrinted>false</IsToBePrinted>
      </CheckAdd>
    </CheckAddRq>
  </QBXMLMsgsRq>
</QBXML>"
>>

Example from SDK:

<?xml version="1.0" ?> 
<?qbxml version="2.0"?> 
<QBXML> 
  <QBXMLMsgsRq onError="stopOnError"> 
    <CheckAddRq> 
      <CheckAdd> 
        <AccountRef> 
          <FullName>Checking</FullName> 
        </AccountRef> 
        <PayeeEntityRef> 
          <FullName>Barley, Renee</FullName> 
        </PayeeEntityRef> 
        <TxnDate>2007-12-15</TxnDate> 
        <Memo>Refund for overpayment</Memo> 
        <IsToBePrinted>1</IsToBePrinted> 
        <ExpenseLineAdd> 
          <AccountRef> 
            <FullName>Accounts Receivable</FullName> 
          </AccountRef> 
          <Amount>100.00</Amount> 
          <CustomerRef> 
            <FullName>Barley, Renee</FullName> 
          </CustomerRef> 
        </ExpenseLineAdd> 
      </CheckAdd> 
    </CheckAddRq> 
  </QBXMLMsgsRq> 
</QBXML>

Comments and changes to this ticket

  • Steven Price

    Steven Price July 21st, 2009 @ 12:51 PM

    <?xml version="1.0" ?> 
    <?qbxml version="2.0"?> 
    <QBXML> 
      <QBXMLMsgsRq onError="stopOnError"> 
        <CheckAddRq> 
          <CheckAdd> 
            <AccountRef> 
              <FullName>Checking</FullName> 
            </AccountRef> 
            <PayeeEntityRef> 
              <FullName>Barley, Renee</FullName> 
            </PayeeEntityRef> 
            <TxnDate>2007-12-15</TxnDate> 
            <Memo>Refund for overpayment</Memo> 
            <IsToBePrinted>1</IsToBePrinted> 
            <ExpenseLineAdd> 
              <AccountRef> 
                <FullName>Accounts Receivable</FullName> 
              </AccountRef> 
              <Amount>100.00</Amount> 
              <CustomerRef> 
                <FullName>Barley, Renee</FullName> 
              </CustomerRef> 
            </ExpenseLineAdd> 
          </CheckAdd> 
        </CheckAddRq> 
      </QBXMLMsgsRq>
    </QBXML>
    
  • Daniel Parker

    Daniel Parker August 1st, 2009 @ 09:24 PM

    • State changed from “new” to “open”

    Side product: Fixed bug not allowing a regular Time object to be passed in to a Date field.

    :TxnDate => Time.now.to_date.to_s
    
    • is now no longer necessary, just use Time.now or Time.today.
  • Steven Price

    Steven Price August 1st, 2009 @ 09:53 PM

    Quickbooks::QuickbooksAPIError: #3040: There was an error when converting the amount "2000" in the field "Amount".

  • Daniel Parker

    Daniel Parker August 1st, 2009 @ 10:55 PM

    • State changed from “open” to “hold”

    That's because QuickBooks wants the Amount field to have two decimal places in it. Even though the regexp in the specs say it's optional.

    I'll plan to have Amounts automatically formatted correctly by next release.

  • Daniel Parker

    Daniel Parker August 1st, 2009 @ 10:55 PM

    • State changed from “hold” to “open”
  • Daniel Parker

    Daniel Parker August 5th, 2009 @ 01:55 PM

    • State changed from “open” to “resolved”

    Amount is now automatically formatted properly, you can give it just about anything that makes sense, even a string like "-$250".

  • erneststephens

    erneststephens July 4th, 2020 @ 08:55 PM

    Positive webpage, where did u think of the data on this posting?I have perused a couple of the articles on your site now, and I truly like your style. Much appreciated and please keep up the compelling work. subway surfers resmi sitesi

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Tags

Pages