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

+1 -1
View File
@@ -28,7 +28,7 @@ Returns, canceled orders and refunded deposits are deducted from the month's sal
Once the month is over, **Approve for payroll** reads QuickBooks one last time. It records the sales, deductions, threshold, rates and payouts, so the month no longer changes with QuickBooks or the settings. **Payroll CSV** downloads each rep's payout. **Reopen** puts an approved month back to being worked out from QuickBooks; the unticked items, adjustments and notes are kept.
Approvers see each transaction linked to QuickBooks, and the list of months with the month picker.
Approvers see each invoice linked to its page in Redmine (or its PDF without the Write invoices permission), the sales receipts, refund receipts and credit memos linked to QuickBooks, and the list of months with the month picker.
## Requirements
+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"
@@ -57,6 +57,10 @@ class SalesCommissionsTest < Redmine::IntegrationTest
assert_select 'input[name=?][value=?][checked]', 'included[]', 'refund_receipt:3'
assert_select 'input[name=?][value="2"][checked]', 'eligible[]'
assert_select 'input[name=approve]'
# Invoices open in Redmine, the refund receipt (no Redmine page) in QuickBooks
assert_select '#sales-commission-sales a[href=?]', '/qbo_invoices/1/edit'
assert_select '#sales-commission-sales a[href*="qbo.intuit.com"]', count: 0
assert_select '#sales-commission-deductions a[href*="qbo.intuit.com/app/refundreceipt?txnId=3"]'
end
def test_view_only