청구서 작성 오류

12997 단어 quickeebooks

묘사

안녕하세요,
영수증을 만들 때 오류가 발생합니다
2:Fixnum의 정의되지 않은 메서드 "to xml"
제 창고 추적입니다.
(gem)roxml-3.3.1/lib/roxml/xml/references.rb:301:inblock (2 levels) in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:300:in클릭'
(gem)roxml-3.3.1/lib/roxml/xml/references.rb:300:inblock in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:in클릭'
(gem)roxml-3.3.1/lib/roxml/xml/references.rb:291:inupdate_xml' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:63:in 블록(2층) in to xml'
(gem)quickeebooks-0.1.5/lib/quickeebooks.rb:60:ineach' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:in 블록이 xml에 삽입됨
(gem)quickeebooks-0.1.5/lib/quickeebooks.rb:52:intap' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:into_xml'
(gem)roxml-3.3.1/lib/roxml/xml/references.rb:298:inblock in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:in클릭'
(gem)roxml-3.3.1/lib/roxml/xml/references.rb:291:inupdate_xml' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:63:in 블록(2층) in to xml'
(gem)quickeebooks-0.1.5/lib/quickeebooks.rb:60:ineach' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:in 블록이 xml에 삽입됨
(gem)quickeebooks-0.1.5/lib/quickeebooks.rb:52:intap' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:into_xml'
(gem)quickeebooks-0.1.5/lib/quickeebooks/online/model/intuit_type.rb:32:into_xml_inject_ns' (gem) quickeebooks-0.1.5/lib/quickeebooks/common/online_line_item_model_methods.rb:18:into_xml_ns'
(gem)quickeebooks-0.1.5/lib/quickeebooks/online/service/invoice.rb:14:increate' app/services/quickbooks_sync.rb:82:in블록(2등급) 수출영수증'
(gem)activerecord-3.2.11/lib/active_record/relation/delegation.rb:6:ineach' (gem) activerecord-3.2.11/lib/active_record/relation/delegation.rb:6:in마다'
애플리케이션/서비스/quickbooks\u 동기화.rb:59:inblock in export_invoices' (gem) activerecord-3.2.11/lib/active_record/associations/collection_proxy.rb:89:in마다'
(gem)activerecord-3.2.11/lib/active_record/associations/collection_proxy.rb:89:inmethod_missing' app/services/quickbooks_sync.rb:58:in수출영수증'
어플리케이션/컨트롤러/quickbook 컨트롤러.rb:50:inblock in sync_invoices' (gem) actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:270:in 호출
(gem) actionpack-3.2.11/lib/action controller/metal/mime 응답.rb:270:inretrieve_collector_from_mimes' (gem) actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:194:in회복
어플리케이션/컨트롤러/quickbook 컨트롤러.rb:49:insync_invoices' (gem) actionpack-3.2.11/lib/action_controller/metal/implicit_render.rb:4:in 보내기 동작'
(gem)actionpack-3.2.11/lib/abstract\u controller/base.rb:167:inprocess_action' (gem) actionpack-3.2.11/lib/action_controller/metal/rendering.rb:10:in과정 행동'
(gem)actionpack-3.2.11/lib/abstract_controller/callbacks.rb:18:inblock in process_action' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:447:inu run_uu926487399_uuprocess_uaction_uuu932969398_uucallbacks'
(gem)activesupport-3.2.11/lib/active_support/callbacks.rb:405:in__run_callback' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
(gem)activesupport-3.2.11/lib/active_support/callbacks.rb:81:inrun_callbacks' (gem) actionpack-3.2.11/lib/abstract_controller/callbacks.rb:17:in과정 행동'
(gem)actionpack-3.2.11/lib/action_controller/metal/rescue.rb:29:inprocess_action' (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:30:in 프로세스에서 막힘 동작'
(gem)activesupport-3.2.11/lib/active_support/notifications.rb:123:inblock in instrument' (gem) activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb:20:in기기'
(gem)activesupport-3.2.11/lib/active_support/notifications.rb:123:ininstrument' (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:29:in과정 행동'
(gem)actionpack-3.2.11/lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' (gem) activerecord-3.2.11/lib/active_record/railties/controller_runtime.rb:18:in과정 행동'
(gem)newrelic_rpm-3.5.8.72/lib/newrelic/agent/instrumentation/rails3/action_controller.rb:34:inblock in process_action' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in 블록의 실행 동작
(gem)newrelic_rpm-3.5.8.72/lib/newrelic/agent/method_tracer.rb:240:intrace_execution_scoped' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in"신유적"으로 "행동"수행
(gem)newrelic_rpm-3.5.8.72/lib/newrelic/agent/instrumentation/rails3/action_controller.rb:33:inprocess_action' (gem) actionpack-3.2.11/lib/abstract_controller/base.rb:121:in 프로세스
(gem)actionpack-3.2.11/lib/abstract_controller/rendering.rb:45:inprocess' (gem) actionpack-3.2.11/lib/action_controller/metal.rb:203:in 스케줄링
(gem)actionpack-3.2.11/lib/action_controller/metal/rack_delegation.rb:14:indispatch' (gem) actionpack-3.2.11/lib/action_controller/metal.rb:246:in 블록이 실행 중'
(gem)actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:73:incall' (gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:73:in 스케줄링
(gem)actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:36:incall' (gem) actionpack-3.2.11/lib/action_dispatch/routing/mapper.rb:42:in통화'
(gem) 여정 - 1.0.4/lib/journey/router.rb:68:inblock in call' (gem) journey-1.0.4/lib/journey/router.rb:56:in마다'
(gem) 여정 - 1.0.4/lib/journey/router.rb:56:incall' (gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:601:in통화'
(gem) newrelic rpm-3.5.8.72/lib/newrelic/rack/error 수집기.rb:8:incall' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/agent_hooks.rb:14:in 호출
(gem)newrelic_rpm-3.5.8.72/lib/new_relic/rack/browser_monitoring.rb:12:incall' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/developer_mode.rb:24:in 호출
(gem)better_errors-0.3.2/lib/better_errors/middleware.rb:51:inapp_call' (gem) better_errors-0.3.2/lib/better_errors/middleware.rb:45:in통화'
(gem)bullet-4.3.1/lib/bullet/rack.rb:11:incall' (gem) warden-1.2.1/lib/warden/manager.rb:35:in폐색호출'
(gem)warden-1.2.1/lib/warden/manager.rb:34:incatch' (gem) warden-1.2.1/lib/warden/manager.rb:34:in 호출
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/best_standards_support.rb:17:incall' (gem) rack-1.4.5/lib/rack/etag.rb:23:in호출'
(gem)rack-1.4.5/lib/rack/conditionalget.rb:25:incall' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/head.rb:14:in호출'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/params_parser.rb:21:incall' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/flash.rb:242:in호출'
(gem)rack-1.4.5/lib/rack/session/abstract/id.rb:210:incontext' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:incall'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/cookies.rb:341:incall' (gem) activerecord-3.2.11/lib/active_record/query_cache.rb:64:in호출'
(gem)activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:28:in폐색호출'
(gem)activesupport-3.2.11/lib/active_support/callbacks.rb:405:in_run__660557959__call__829375442__callbacks' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:405:inuu run_ucallback'
(gem)activesupport-3.2.11/lib/active_support/callbacks.rb:385:in_run_call_callbacks' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:81:in 실행 콜백'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:27:incall' (gem) rails-dev-tweaks-0.6.1/lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:in호출'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/remote_ip.rb:31:incall' (gem) airbrake-3.1.8/lib/airbrake/rails/middleware.rb:15:in통화'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/debug_exceptions.rb: 16:incall' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/show_exceptions.rb:56:in 호출
(gem)railties-3.2.11/lib/rails/rack/logger.rb:32:incall_app' (gem) railties-3.2.11/lib/rails/rack/logger.rb:18:in통화'
(gem)actionpack-3.2.11/lib/action_dispatch/middleware/request_id.rb:22:incall' (gem) rack-1.4.5/lib/rack/methodoverride.rb:21:incall'
(gem)rack-1.4.5/lib/rack/runtime.rb:17:incall' (gem) activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:72:in호출'
(gem)rack-1.4.5/lib/rack/lock.rb:15:incall' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/static.rb:62:in 호출
(gem)airbrake-3.1.8/lib/airbrake/user_informer.rb: 16:in_call' (gem) airbrake-3.1.8/lib/airbrake/user_informer.rb:12:in 호출
(gem)railties-3.2.11/lib/rails/engine.rb:479:incall' (gem) railties-3.2.11/lib/rails/application.rb:223:in 호출
(gem)rack-1.4.5/lib/rack/content_length.rb:14:incall' (gem) railties-3.2.11/lib/rails/rack/log_tailer.rb:17:in통화'
(gem)thin-1.5.0/lib/thin/connection.rb:81:inblock in pre_process' (gem) thin-1.5.0/lib/thin/connection.rb:79:incatch'
(gem)thin-1.5.0/lib/thin/connection.rb:79:inpre_process' (gem) thin-1.5.0/lib/thin/connection.rb:54:in 프로세스
(gem)thin-1.5.0/lib/thin/connection.rb:39:inreceive_data' (gem) eventmachine-1.0.1/lib/eventmachine.rb:187:in 시스템 실행
(gem)eventmachine-1.0.1/lib/eventmachine.rb:187:inrun' (gem) thin-1.5.0/lib/thin/backends/base.rb:63:in 시작
(gem)thin-1.5.0/lib/thin/server.rb:159:instart' (gem) rack-1.4.5/lib/rack/handler/thin.rb:13:inrun'
(gem)rack-1.4.5/lib/rack/server.rb:268:instart' (gem) railties-3.2.11/lib/rails/commands/server.rb:70:in시작
(gem)railties-3.2.11/lib/rails/commands.rb:55:inblock in <top (required)>' (gem) railties-3.2.11/lib/rails/commands.rb:50:in클릭'
(gem)railties-3.2.11/lib/rails/commands.rb:50:in<top (required)>' script/rails:6:in 요구 사항
스크립트/rails:6:in`
이것은 나의 물건이다

<Quickeebooks::Online::Model::Invoice:0x11a9c2b4@line_items=[#<Quickeebooks::Online::Model::InvoiceLineItem:0x11e860dc@desc=“Gildan 2000-White”,@amount=#<BigD


ecimal:11e8608c、'0.1E1',9(18)>、@unit#u price=#、@saddable=true、@quantity=20>、#、@unit#u price=#\、@saddable=true、@quantity=82>,
#,@unit#u price=#\,@sadable=true,@quantity=10>,#,@unit#u price=#\,@sadable=true,@quantity=1>,@header=#,@total#u amount=#\,@sub u total#u amount=#
내가 뭘 잘못했어??제 비밀번호예요.
  def export_invoices(account, oauth_client)
    sync = QuickbooksSync.new(account.quickbooks_token, account.quickbooks_secret)
    account.customers.each do |c|
      c.orders.has_line_items.each do |o|
        invoice_service = Quickeebooks::Online::Service::Invoice.new
        invoice_service.access_token = sync.oauth_client
        invoice_service.realm_id = account.quickbooks_realm_id

        invoice = Quickeebooks::Online::Model::Invoice.new
        header = Quickeebooks::Online::Model::InvoiceHeader.new
        header.customer_id=c.quickbooks_id
        header.tax_rate=o.sales_tax
        header.total_amount=o.order_total
        header.sub_total_amount=o.order_subtotal

        invoice.header= header
        o.lineitems.each do |li|
          lineitem = Quickeebooks::Online::Model::InvoiceLineItem.new
          lineitem.desc=li.description2
          lineitem.amount=li.price_per
          lineitem.unit_price=li.unit_cost2
          lineitem.taxable=li.taxable
          lineitem.quantity=li.amount2
          invoice.line_items << lineitem
        end
        puts invoice.inspect
        invoice_service.create(invoice)
      end
    end
  end

토론 #1

내가 좀 더 깊이 파헤쳤는데 실제 오류는 고객 Id=2

토론 #2

를 설정하려고 했을 때인 것 같아. 어쨌든 내 잘못이야.나는 고객 id를Quickeebooks:Online::Model:::id의 형식이 아닌 정수로 설정합니다

좋은 웹페이지 즐겨찾기