Index: openacs-4/packages/invoices/www/invoice-send.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-send.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/invoices/www/invoice-send.tcl 14 Oct 2005 06:25:03 -0000 1.7
+++ openacs-4/packages/invoices/www/invoice-send.tcl 14 Dec 2005 16:24:22 -0000 1.8
@@ -24,16 +24,19 @@
# set invoice_text "{[_ invoices.iv_invoice_email]}"
set subject [lang::util::localize "#invoices.iv_invoice_email_subject#" $locale]
set template "InvoiceTemplate"
+ set file_title "Invoice_${invoice_nr}.pdf"
} elseif {[empty_string_p $parent_invoice_id]} {
# send credit
# set invoice_text "{[_ invoices.iv_invoice_credit_email]}"
set subject [lang::util::localize "#invoices.iv_invoice_credit_email_subject#" $locale]
set template "CreditTemplate"
+ set file_title "Credit_${invoice_nr}.pdf"
} else {
# send cancellation
# set invoice_text "{[_ invoices.iv_invoice_cancel_email]}"
set subject [lang::util::localize "#invoices.iv_invoice_cancel_email_subject#" $locale]
set template "CancelTemplate"
+ set file_title "Cancellation_${invoice_nr}.pdf"
}
set invoice_text [iv::invoice::parse_data -invoice_id $invoice_id -recipient_id $recipient_id -template $template -locale $locale]
@@ -51,7 +54,7 @@
set pdf_file [text_templates::create_pdf_from_html -html_content "$invoice_text"]
if {![empty_string_p $pdf_file]} {
set file_size [file size $pdf_file]
- set file_ids [cr_import_content -title "Invoice_${invoice_id}.pdf" -description "PDF version of this offer" $invoice_id $pdf_file $file_size application/pdf "[clock seconds]-[expr round([ns_rand]*100000)]"]
+ set file_ids [cr_import_content -title $file_title -description "PDF version of this invoice" $invoice_id $pdf_file $file_size application/pdf "[clock seconds]-[expr round([ns_rand]*100000)]"]
set return_url [export_vars -base invoice-pdf {invoice_id {file_id $file_ids}}]
}
} else {
Index: openacs-4/packages/invoices/www/invoice-send.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-send.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/invoices/www/invoice-send.xql 11 Oct 2005 15:23:29 -0000 1.2
+++ openacs-4/packages/invoices/www/invoice-send.xql 14 Dec 2005 16:24:22 -0000 1.3
@@ -4,7 +4,7 @@
- select i.invoice_nr, i.organization_id, i.parent_invoice_id,
+ select i.invoice_nr, i.organization_id, i.parent_invoice_id, i.invoice_nr,
i.total_amount, i.recipient_id, i.organization_id
from iv_invoices i, cr_items ii
where ii.latest_revision = i.invoice_id