Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

QuickBooks error message: The transaction is empty.

#17

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>

Reported by Steven Price · July 21st, 2009 @ 12:49 PM

State: resolved
Assigned to: Daniel Parker Daniel Parker

Activity

  1. Steven Price
    Steven Price
    <?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>
    

    July 21st, 2009 @ 12:51 PM

  2. Daniel Parker
    Daniel Parker
    • 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.

    August 1st, 2009 @ 09:24 PM

  3. Steven Price
    Steven Price

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

    August 1st, 2009 @ 09:53 PM

  4. Daniel Parker
    Daniel Parker
    • 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.

    August 1st, 2009 @ 10:55 PM

  5. Daniel Parker
    Daniel Parker
    • State changed from hold to open

    August 1st, 2009 @ 10:55 PM

  6. Daniel Parker
    Daniel Parker
    • 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".

    August 5th, 2009 @ 01:55 PM

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.