mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Make billed estimates read-only
An estimate that's Converted or Closed in QuickBooks, or linked to an invoice, opens read-only and is refused on save (this includes redmine_qbo_lineitems' estimates once invoiced). Its page lists the invoices it's on. Estimates cache their status so lists show View instead of Edit for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
This commit is contained in:
10 files changed
+45
-23
No files matched your search
@@ -20,6 +20,12 @@ class Estimate < QboBaseModel
|
||||
to_s
|
||||
end
|
||||
|
||||
# True once QuickBooks has turned it into an invoice (status cached by the sync). The estimate page also
|
||||
# checks for a linked invoice; either way a billed estimate can't be changed in Redmine.
|
||||
def billed?
|
||||
RedmineQboBilling::EstimateWriter::BILLED_STATUSES.include?(self[:txn_status].to_s)
|
||||
end
|
||||
|
||||
# returns a human readable string
|
||||
def to_s
|
||||
return self[:doc_number]
|
||||
|
||||
Reference in new issue
Block a user