Re: [Ledger-smb-devel] Issue 3309519: Email fields not populated when sending AR invoice

2011-05-31 Thread Chris Travers
committed

On Mon, May 30, 2011 at 10:17 PM, John Locke m...@freelock.com wrote:
 Not sure I picked up all the changes that were required to make this
 work, but the attached patch populates email/cc/bcc fields from the
 customer's record when sending an AR invoice.

 I think there was also a problem actually getting the invoice attached
 with a relevant filename, which is also included in this patch. We've
 been using this for months.

 Cheers,
 John Locke
 http://freelock.com

 --
 Simplify data backup and recovery for your virtual environment with vRanger.
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Ledger-smb-devel mailing list
 Ledger-smb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel



--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


[Ledger-smb-devel] Issue 3309519: Email fields not populated when sending AR invoice

2011-05-30 Thread John Locke
Not sure I picked up all the changes that were required to make this
work, but the attached patch populates email/cc/bcc fields from the
customer's record when sending an AR invoice.

I think there was also a problem actually getting the invoice attached
with a relevant filename, which is also included in this patch. We've
been using this for months.

Cheers,
John Locke
http://freelock.com
diff --git UI/io-email.html UI/io-email.html
index decb298..3435891 100644
--- UI/io-email.html
+++ UI/io-email.html
@@ -21,12 +21,8 @@
 tr
   th align=right?lsmb text('Subject') ?/th
   td?lsmb PROCESS input element_data={name = 'subject', size = 30, value = form.subject} ?/td
-?lsmb IF user.role == 'admin' OR user.role == 'manager' ?
   th align=right?lsmb text('Bcc') ?/th
   td?lsmb PROCESS input element_data={name = 'bcc', size = 30, value = form.bcc} ?/td
-?lsmb ELSE ?
-  td colspan=2 /td
-?lsmb END ?
 /tr
   /table
 /td
diff --git bin/io.pl bin/io.pl
index 77d1698..3e35572 100644
--- bin/io.pl
+++ bin/io.pl
@@ -1181,7 +1181,7 @@ sub e_mail {
 
 my %hiddens;
 if ( $myconfig{role} !~ /(admin|manager)/ ) {
-$hiddens{bcc} = $form-{bcc};
+  #  $hiddens{bcc} = $form-{bcc};
 }
 
 if ( $form-{formname} =~ /(pick|packing|bin)_list/ ) {
@@ -1195,7 +1195,7 @@ sub e_mail {
 my $print_options = print_options(\%hiddens);
 
 for (
-qw(email cc bcc subject message sendmode format language_code action nextsub)
+qw(subject message sendmode format language_code action nextsub)
   )
 {
 delete $form-{$_};
@@ -1266,6 +1266,12 @@ sub print_options {
 };
 
 # SC: Option values extracted from other bin/ scripts
+if ($form-{type} eq 'invoice') {
+	push @{$options{formname}{options}}, {
+	text = $locale-text('Invoice'),
+	value = 'invoice',
+	};
+}
 if ($form-{type} eq 'sales_quotation') {
 push @{$options{formname}{options}}, {
 text = $locale-text('Quotation'),
@@ -1720,6 +1726,9 @@ sub print_form {
 	##SC: XXX the from address needs fixing
 $output_options{from} = $myconfig{email};
 $output_options{notify} = 1 if $form-{read_receipt};
+	$output_options{message} = $form-{message};
+	$output_options{filename} = $form-{formname} . '_'. $form-{${inv}number};
+	$output_options{filename} .= '.'. $form-{format}; # assuming pdf or html
 
 if ( %$old_form ) {
 $old_form-{intnotes} = qq|$old_form-{intnotes}\n\n|
@@ -1802,6 +1811,7 @@ sub print_form {
 user = \%myconfig, 
 template = $form-{'formname'},
 format = uc $form-{format},
+no_escape = true,
 method = $form-{media},
 output_options = \%output_options,
 );
--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel