mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-02 07:01:59 -04:00
Make qbo item inactive if deleted
This commit is contained in:
@@ -18,6 +18,7 @@ class Item < QboBaseModel
|
|||||||
self.inheritance_column = :_type_disabled
|
self.inheritance_column = :_type_disabled
|
||||||
qbo_sync push: true
|
qbo_sync push: true
|
||||||
after_initialize :set_defaults, if: :new_record?
|
after_initialize :set_defaults, if: :new_record?
|
||||||
|
before_destroy :make_inactive
|
||||||
|
|
||||||
# Updates Both local & remote DB account ref
|
# Updates Both local & remote DB account ref
|
||||||
def account_id=(id)
|
def account_id=(id)
|
||||||
@@ -37,6 +38,11 @@ class Item < QboBaseModel
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def make_inactive
|
||||||
|
details.active = false
|
||||||
|
push_to_qbo
|
||||||
|
end
|
||||||
|
|
||||||
def ref
|
def ref
|
||||||
Quickbooks::Model::BaseReference.new
|
Quickbooks::Model::BaseReference.new
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user