Save new estimates and invoices as drafts

A draft is kept in Redmine only, however incomplete, so nothing is in QuickBooks
until it's saved from the editor. QuickBooks can't apply a deposit to an invoice
that's still being written, which made it read-only. Saving to QuickBooks deletes
the draft.

Drafts are listed on the customer's page, on a Drafts page linked from Customers,
and on a new invoice or estimate for a customer who already has one. Anyone with
Write invoices (or Write estimates) can continue or delete invoice (or estimate)
drafts. Adds the qbo_drafts table (migration 052).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-04 10:33:03 -05:00
1 parent a1fb88e77c
commit c8e2d2d92e
17 files changed
+365 -7

No files matched your search

+24
View File
@@ -130,6 +130,30 @@ en:
button_open_in_quickbooks: "Open in QuickBooks"
button_refresh_quickbooks_fields: "Refresh QuickBooks fields"
label_qbo_hidden_custom_fields: "Hide QuickBooks custom fields"
# Estimate and invoice drafts
label_qbo_drafts: "Drafts"
label_qbo_draft_document: "Draft"
label_qbo_draft_lines: "Lines"
label_qbo_draft_saved_by: "Last saved"
label_qbo_estimate_draft: "Estimate draft"
label_qbo_invoice_draft: "Invoice draft"
button_qbo_save_draft: "Save draft"
button_qbo_delete_draft: "Delete draft"
button_qbo_continue_draft: "Continue"
notice_qbo_draft_saved: "Draft saved. It's kept in Redmine only, until you save it to QuickBooks."
notice_qbo_draft_deleted: "Draft deleted."
error_qbo_draft_not_found: "That draft is gone. It may have been finished or deleted."
text_qbo_draft_saved_by: "%{user}, %{age} ago"
text_qbo_editing_draft: "Draft, not in QuickBooks yet. Last saved by %{user}, %{age} ago. Save it to send it to QuickBooks; that deletes the draft."
text_qbo_customer_has_estimate_drafts:
one: "This customer has an estimate draft:"
other: "This customer has %{count} estimate drafts:"
text_qbo_customer_has_invoice_drafts:
one: "This customer has an invoice draft:"
other: "This customer has %{count} invoice drafts:"
text_qbo_draft_link: "%{subtotal}, saved by %{user} %{date}"
text_qbo_drafts_info: "New estimates and invoices saved as drafts. They're kept in Redmine only, so nothing is in QuickBooks (and no deposit is applied to an invoice) until a draft is saved from the editor."
text_qbo_sales_person_field: "filled in with the sales person"
text_qbo_hidden_custom_fields: "Ticked fields are left off estimates and invoices. QuickBooks doesn't tell apps which custom fields are inactive, and a field stays on its old estimates after it's turned off, so tick ones you no longer use (e.g. a renamed \"Sales Rep old\"). The sales person goes in the first field shown whose name has \"sales\" or \"rep\" in it."
button_reload_estimate: "Reload the estimate"
+3
View File
@@ -68,6 +68,9 @@ resources :qbo_invoices, only: [:new, :create, :edit, :update] do
end
end
# Estimate and invoice drafts, kept in Redmine until they're saved to QuickBooks (continued on the editors)
resources :qbo_drafts, only: [:index, :destroy]
# Receive payment pages, and a customer's payments (/qbo_payments?customer_id=)
resources :qbo_payments, only: [:index, :new, :create, :show] do
member do