Invoices on the commission page open in Redmine

Paid sales invoices link to their Redmine invoice page (or PDF without
the Write invoices permission) instead of QuickBooks. Sales receipts,
refund receipts and credit memos, which Redmine has no page for, still
open in QuickBooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-17 07:00:28 -05:00
1 parent 6fcd5f9b64
commit 73e643a6f9
3 files changed
+14 -3

No files matched your search

+9 -2
View File
@@ -17,10 +17,17 @@ module SalesCommissionsHelper
RedmineQboCommission.format_rate(rate)
end
# The transaction's number, linked to it in QuickBooks for those who approve
# The transaction's number, linked for those who approve: an invoice opens in Redmine (its invoice page, or its
# PDF without the Write invoices permission); the others, which Redmine has no page for, open in QuickBooks
def commission_txn_link(txn, can_approve)
label = txn.doc_number.present? ? "##{txn.doc_number}" : txn.kind_name
can_approve ? link_to(label, txn.qbo_url, target: '_blank', rel: 'noopener') : label
return label unless can_approve
if txn.kind == 'invoice'
link_to(label, RedmineQboBilling.invoice_writer? ? edit_qbo_invoice_path(txn.txn_id) : invoice_path(txn.txn_id))
else
link_to(label, txn.qbo_url, target: '_blank', rel: 'noopener')
end
end
# "Approved by Jane Smith on 12/03/2026 09:15 AM"