Re: [Ledger-smb-devel] Bug/Patch: email form not populated with emails from account

2011-06-26 Thread Erik Huelsmann
Hi John,

 I've isolated the error checking and typo correction into separate
 commits (r3321 and r3320 respectively).

 While I do agree that your change is desirable (a lot), I also think
 it's incomplete: For physical addresses, we distinguish billing and
 sales addresses. I think we should do the same for e-mail addresses.
 Then, if there's no billing e-mail, we use the normal e-mail. CC and
 BCC are only added if there are explicit CC and BCCs for billing.

Just now, I committed r3348 which improves on your patch: you can add
Billing Email, Billing CC and Billing BCC to an account. When
those are set (on a customer invoice!), those fields will be used.
Actually, it's a bit more complicated. It's like this: Billing CC and
Billing BCC are additive, unless Billing Email is provided, in which
case all 3 will override the normal values.

If it helps your business, could you verify it works for you?


Regards,


Erik.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


Re: [Ledger-smb-devel] Bug/Patch: email form not populated with emails from account

2011-06-24 Thread Erik Huelsmann
Hi John,

I've isolated the error checking and typo correction into separate
commits (r3321 and r3320 respectively).

While I do agree that your change is desirable (a lot), I also think
it's incomplete: For physical addresses, we distinguish billing and
sales addresses. I think we should do the same for e-mail addresses.
Then, if there's no billing e-mail, we use the normal e-mail. CC and
BCC are only added if there are explicit CC and BCCs for billing.

Agreed?

Regards,

Erik.


On Sun, Jun 19, 2011 at 5:16 PM, John Locke m...@freelock.com wrote:
 When using the Email button to send an invoice to a customer, the
 email form does not populate the email/cc/bcc fields from the customer
 account.

 Here's at least a partial patch to accomplish this (partial because I'm
 not sure if I have all of the areas I patched to make this happen -- it
 does work correctly on my system.). This patch is against svn #3281, let
 me know if I need to re-roll against an updated trunk.

 Cheers,
 John Locke
 http://freelock.com

 --
 EditLive Enterprise is the world's most technically advanced content
 authoring tool. Experience the power of Track Changes, Inline Image
 Editing and ensure content is compliant with Accessibility Checking.
 http://p.sf.net/sfu/ephox-dev2dev
 ___
 Ledger-smb-devel mailing list
 Ledger-smb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel



--
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


Re: [Ledger-smb-devel] Bug/Patch: email form not populated with emails from account

2011-06-24 Thread Luke
Can I just put in a plug for that company wide automatic BCC again?:)  I 
haven't checked to see if that's in 1.3, but if not, which I think is the 
case, that's one feature that should make it in before RC.


  On Fri, 24 Jun 
2011, Erik Huelsmann wrote:

 Hi John,

 I've isolated the error checking and typo correction into separate
 commits (r3321 and r3320 respectively).

 While I do agree that your change is desirable (a lot), I also think
 it's incomplete: For physical addresses, we distinguish billing and
 sales addresses. I think we should do the same for e-mail addresses.
 Then, if there's no billing e-mail, we use the normal e-mail. CC and
 BCC are only added if there are explicit CC and BCCs for billing.

 Agreed?

 Regards,

 Erik.


 On Sun, Jun 19, 2011 at 5:16 PM, John Locke m...@freelock.com wrote:
 When using the Email button to send an invoice to a customer, the
 email form does not populate the email/cc/bcc fields from the customer
 account.

 Here's at least a partial patch to accomplish this (partial because I'm
 not sure if I have all of the areas I patched to make this happen -- it
 does work correctly on my system.). This patch is against svn #3281, let
 me know if I need to re-roll against an updated trunk.

 Cheers,
 John Locke
 http://freelock.com

 --
 EditLive Enterprise is the world's most technically advanced content
 authoring tool. Experience the power of Track Changes, Inline Image
 Editing and ensure content is compliant with Accessibility Checking.
 http://p.sf.net/sfu/ephox-dev2dev
 ___
 Ledger-smb-devel mailing list
 Ledger-smb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel



 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense..
 http://p.sf.net/sfu/splunk-d2d-c1
 ___
 Ledger-smb-devel mailing list
 Ledger-smb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


--
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel


[Ledger-smb-devel] Bug/Patch: email form not populated with emails from account

2011-06-19 Thread John Locke
When using the Email button to send an invoice to a customer, the
email form does not populate the email/cc/bcc fields from the customer
account.

Here's at least a partial patch to accomplish this (partial because I'm
not sure if I have all of the areas I patched to make this happen -- it
does work correctly on my system.). This patch is against svn #3281, let
me know if I need to re-roll against an updated trunk.

Cheers,
John Locke
http://freelock.com
diff --git LedgerSMB/Form.pm LedgerSMB/Form.pm
index 21a6cac..fec0301 100644
--- LedgerSMB/Form.pm
+++ LedgerSMB/Form.pm
@@ -2432,6 +2431,18 @@ sub create_links {
 $self-{queued} .= $ref-{formname}  . $ref-{spoolfile} 
   if $ref-{spoolfile};
 }
+
+# get email accounts
+$query = qq|
+SELECT * FROM eca__list_contacts(?)|;
+$sth = $dbh-prepare($query);
+$sth-execute( $self-{entity_id} ) || $self-dberror($query);
+
+my $ctype;
+while ( $ref = $sth-fetchrow_hashref('NAME_lc') ) {
+$ctype = lc $ref-{class};
+$self-{$ctype} .= $ref-{contact} ;
+}
 
 $sth-finish;
 for (qw(printed emailed queued)) { $self-{$_} =~ s/ +$//g }
@@ -2802,7 +2813,7 @@ sub update_status {
 
 $sth = $dbh-prepare($query);
 $sth-execute( $self-{id}, $printed, $emailed, $spoolfile,
-$self-{formname} );
+$self-{formname} ) || $self-dberror($query);
 $sth-finish;
 
 }
@@ -2829,7 +2840,7 @@ sub save_status {
 	WHERE trans_id = ?|;
 
 my $sth = $dbh-prepare($query);
-$sth-execute( $self-{id} );
+$sth-execute( $self-{id} ) || $self-dberror($query);
 $sth-finish;
 
 my %queued;
diff --git LedgerSMB/Mailer.pm LedgerSMB/Mailer.pm
index 29c8bd4..f294575 100644
--- LedgerSMB/Mailer.pm
+++ LedgerSMB/Mailer.pm
@@ -160,11 +160,11 @@ sub attach {
 	my %args = @_;
 
 	carp Message not prepared unless ref $self-{_message};
-	if (defined $args{filename}) {
-		if (!$args{filename}){
+	if (defined $args{file}) {
+		if (!$args{file}){
 			carp Invalid filename provided;
-		} elsif (!defined $args{data} and !(-f $args{filename} and -r $args{filename})){
-			carp Cannot access file: $args{filename};
+		} elsif (!defined $args{data} and !(-f $args{file} and -r $args{file})){
+			carp Cannot access file: $args{file};
 		}
 	} else {
 		carp No attachement supplied unless defined $args{data};
diff --git LedgerSMB/Template.pm LedgerSMB/Template.pm
index d368356..03e2182 100755
--- LedgerSMB/Template.pm
+++ LedgerSMB/Template.pm
@@ -270,7 +270,7 @@ sub render {
 	my $post = $format-can('postprocess')-($self);
 	if (!$self-{'noauto'}) {
 		# Clean up
-		$self-output;
+		$self-output(%$vars);
 		if ($self-{rendered}) {
 			unlink($self-{rendered}) or
 throw Error::Simple 'Unable to delete output file';
@@ -361,7 +361,7 @@ sub _email_output {
 	my @mailmime;
 	if (!$self-{rendered} and !$args-{attach}) {
 		$args-{message} .= $self-{output};
-		@mailmime = ('contenttype', $self-{mimeytype});
+		@mailmime = ('contenttype', $self-{mimetype});
 	}
 
 # User default for email from
--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev___
Ledger-smb-devel mailing list
Ledger-smb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel