mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update payment.rb
This commit is contained in:
@@ -18,18 +18,18 @@ class Payment
|
|||||||
validates :total_amount, numericality: true
|
validates :total_amount, numericality: true
|
||||||
|
|
||||||
def save
|
def save
|
||||||
payment = Quickbooks::Model::Payment.new
|
@payment = Quickbooks::Model::Payment.new
|
||||||
|
|
||||||
payment.customer_ref = Qbo.get_base(:customer).service.fetch_by_id(@customer_id)
|
@payment.customer_ref = Qbo.get_base(:customer).service.fetch_by_id(@customer_id)
|
||||||
|
|
||||||
payment.deposit_to_account_ref = Qbo.get_base(:account).service.fetch_by_id(@account_id)
|
@payment.deposit_to_account_ref = Qbo.get_base(:account).service.fetch_by_id(@account_id)
|
||||||
|
|
||||||
payment.payment_method_ref = Qbo.get_base(:payment_method).service.fetch_by_id(@payment_method_id)
|
@payment.payment_method_ref = Qbo.get_base(:payment_method).service.fetch_by_id(@payment_method_id)
|
||||||
|
|
||||||
payment.total = @total_amount
|
@payment.total = @total_amount
|
||||||
|
|
||||||
#begin
|
#begin
|
||||||
Qbo.get_base(:payment).service.update(payment)
|
Qbo.get_base(:payment).service.create(@payment)
|
||||||
#rescue Exception => e
|
#rescue Exception => e
|
||||||
# @errors.add(e.message)
|
# @errors.add(e.message)
|
||||||
#end
|
#end
|
||||||
|
|||||||
Reference in New Issue
Block a user