Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t使用quickbooks ruby gem在quickbooks中创建类对象_Ruby_Quickbooks - Fatal编程技术网

Can';t使用quickbooks ruby gem在quickbooks中创建类对象

Can';t使用quickbooks ruby gem在quickbooks中创建类对象,ruby,quickbooks,Ruby,Quickbooks,我想为Quickbooks创建帐户对象。但是,当我尝试时: service.create(account_object) 它返回错误: Quickbooks::InvalidModelException: Classification is not included in the list 我尝试输入一个默认值(),但它返回相同的错误。帐户中的分类将类似于负债、收入、费用或资产等 转到此URL 查看AccountType部分=>子属性 它有所有分类和帐户类型的列表,我们可以在创建帐户时使用这

我想为Quickbooks创建帐户对象。但是,当我尝试时:

service.create(account_object)
它返回错误:

Quickbooks::InvalidModelException: Classification is not included in the list

我尝试输入一个默认值(),但它返回相同的错误。

帐户中的分类将类似于负债、收入、费用或资产等

转到此URL

查看AccountType部分=>子属性

它有所有分类和帐户类型的列表,我们可以在创建帐户时使用这些列表

您可以使用下面的示例代码创建帐户

begin
    oauth_client = OAuth::AccessToken.new($qb_oauth_consumer, token, secret)
    service = Quickbooks::Service::Account.new(:access_token => oauth_client, :company_id => realm_id)
    new_account = Quickbooks::Model::Account.new(:name => 'Undeposited money', :account_type => 'Other Current Asset', :classification => 'Asset' )
    create_acccount = service.create(new_account)
rescue Exception => e
    # e.message will show response of quickbooks for you request 
    puts e.message
    # e.message.inspect will show logs
    puts e.backtrace.inspect  
end