mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update qbo_purchase.rb
WIP Fixing Purchase Sync Methods
This commit is contained in:
@@ -26,11 +26,12 @@ class QboPurchase < ActiveRecord::Base
|
||||
def self.update_all
|
||||
QboPurchase.get_base.service.all.each { |purchase|
|
||||
|
||||
purchase.line_items.all.each { |line_item|
|
||||
purchase.line_items.all? { |line_item|
|
||||
|
||||
detail = line_item.account_based_expense_line_detail if line_item.detail_type = :account_based_expense_line_detail
|
||||
detail = line_item.item_based_expense_line_detail if line_item.detail_type = :item_based_expense_line_detail
|
||||
|
||||
if detail
|
||||
if detail.billable_status = "Billable"
|
||||
qbo_purchase = find_or_create_by(id: purchase.id)
|
||||
qbo_purchase.line_id = line_item.id
|
||||
@@ -42,6 +43,7 @@ class QboPurchase < ActiveRecord::Base
|
||||
|
||||
qbo_purchase.save!
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user