Closed map7 closed 5 months ago
I'm trying to update a journal and when I do instead of updating it creates a new entry
Here are my methods to get and update a journal which call the qbo_api methods
def journal_edit(id) @qbo_api.get(:journal_entry, id) end def journal_update(journal,params) @qbo_api.update(:journalentry, id: params[:tran_no].to_i, payload: journal) end
Here is how I re-enact the problem
Create a "test" transaction through the development web interface
Create report object passing in realm_id
require_relative "lib/report" require 'sqlite3' realm_id = "<my realm_id>" # Sandbox_ACME_US realm_id db = SQLite3::Database.new("#{File.dirname(__FILE__)}/report_craft.db") company = db.execute('select * from companies where realm_id = ?', realm_id).first access_token = company[2] @report=Report.new(access_token,realm_id)
Get journal
journal = @report.journal_edit(352)
Call update
params = {tran_no: 352} @report.journal_update(journal,params)
5. Check in journal report = fail, still get two results
It's happened again, I forgot the underscore.
@qbo_api.update(:journal_entry, id: params[:tran_no].to_i, payload: journal)
OK, thanks for reporting. These issues are great documentation as well.
I'm trying to update a journal and when I do instead of updating it creates a new entry
Here are my methods to get and update a journal which call the qbo_api methods
Here is how I re-enact the problem
Create a "test" transaction through the development web interface
Create report object passing in realm_id
Get journal
Call update