Receipts and credit memos open QuickBooks' PDF through Redmine
Sales receipts, refund receipts and credit memos on the commission page link to their QuickBooks PDF, fetched by Redmine (approvers only), so nothing on the page opens QuickBooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9501216525
commit
e76bd12b7f
7 files changed
+57
-15
No files matched your search
@@ -17,8 +17,9 @@ module SalesCommissionsHelper
|
||||
RedmineQboCommission.format_rate(rate)
|
||||
end
|
||||
|
||||
# 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
|
||||
# The transaction's number, linked for those who approve: an invoice opens its page in Redmine (or its PDF
|
||||
# without the Write invoices permission); a sales receipt, refund receipt or credit memo, which Redmine has no
|
||||
# page for, opens QuickBooks' PDF of it
|
||||
def commission_txn_link(txn, can_approve)
|
||||
label = txn.doc_number.present? ? "##{txn.doc_number}" : txn.kind_name
|
||||
return label unless can_approve
|
||||
@@ -26,7 +27,7 @@ module SalesCommissionsHelper
|
||||
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')
|
||||
link_to(label, sales_commission_txn_pdf_path(txn.kind, txn.txn_id), target: '_blank', rel: 'noopener')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user