mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update qbo_purchase.rb
Simplified line item detail logic... untested
This commit is contained in:
@@ -28,10 +28,8 @@ class QboPurchase < ActiveRecord::Base
|
|||||||
|
|
||||||
purchase.line_items.all? { |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.account_based_expense_line_detail ? line_item.account_based_expense_line_detail : line_item.item_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"
|
if detail.billable_status = "Billable"
|
||||||
qbo_purchase = find_or_create_by(id: purchase.id)
|
qbo_purchase = find_or_create_by(id: purchase.id)
|
||||||
qbo_purchase.line_id = line_item.id
|
qbo_purchase.line_id = line_item.id
|
||||||
@@ -43,7 +41,6 @@ class QboPurchase < ActiveRecord::Base
|
|||||||
|
|
||||||
qbo_purchase.save!
|
qbo_purchase.save!
|
||||||
end
|
end
|
||||||
end
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user