projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
705efcf
)
option to keep an email address but not email it invoices, RT#17676
author
Ivan Kohler
<ivan@freeside.biz>
Mon, 14 May 2012 22:13:21 +0000
(15:13 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Mon, 14 May 2012 22:13:21 +0000
(15:13 -0700)
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cust_bill.pm
patch
|
blob
|
history
FS/FS/cust_main.pm
patch
|
blob
|
history
FS/FS/part_event/Action/cust_bill_email.pm
patch
|
blob
|
history
httemplate/edit/cust_main/billing.html
patch
|
blob
|
history
httemplate/edit/process/cust_main.cgi
patch
|
blob
|
history
httemplate/view/cust_main/billing.html
patch
|
blob
|
history
httemplate/view/cust_main/contacts.html
patch
|
blob
|
history
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
7e1444f
..
c35388b
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-916,6
+916,7
@@
sub tables_hashref {
'edit_subject', 'char', 'NULL', 1, '', '',
'locale', 'varchar', 'NULL', 16, '', '',
'calling_list_exempt', 'char', 'NULL', 1, '', '',
'edit_subject', 'char', 'NULL', 1, '', '',
'locale', 'varchar', 'NULL', 16, '', '',
'calling_list_exempt', 'char', 'NULL', 1, '', '',
+ 'invoice_noemail', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'custnum',
'unique' => [ [ 'agentnum', 'agent_custid' ] ],
],
'primary_key' => 'custnum',
'unique' => [ [ 'agentnum', 'agent_custid' ] ],
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
a76170a
..
1f4943a
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-1314,14
+1314,16
@@
sub send {
$balance_over = shift if scalar(@_) && $_[0] !~ /^\s*$/;
}
$balance_over = shift if scalar(@_) && $_[0] !~ /^\s*$/;
}
+ my $cust_main = $self->cust_main;
+
return 'N/A' unless ! $agentnums
return 'N/A' unless ! $agentnums
- or grep { $_ == $
self->
cust_main->agentnum } @$agentnums;
+ or grep { $_ == $cust_main->agentnum } @$agentnums;
return ''
return ''
- unless $
self->
cust_main->total_owed_date($self->_date) > $balance_over;
+ unless $cust_main->total_owed_date($self->_date) > $balance_over;
$invoice_from ||= $self->_agent_invoice_from || #XXX should go away
$invoice_from ||= $self->_agent_invoice_from || #XXX should go away
- $conf->config('invoice_from', $
self->
cust_main->agentnum );
+ $conf->config('invoice_from', $cust_main->agentnum );
my %opt = (
'template' => $template,
my %opt = (
'template' => $template,
@@
-1329,11
+1331,12
@@
sub send {
'notice_name' => ( $notice_name || 'Invoice' ),
);
'notice_name' => ( $notice_name || 'Invoice' ),
);
- my @invoicing_list = $
self->
cust_main->invoicing_list;
+ my @invoicing_list = $cust_main->invoicing_list;
#$self->email_invoice(\%opt)
$self->email(\%opt)
#$self->email_invoice(\%opt)
$self->email(\%opt)
- if grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list or !@invoicing_list;
+ if ( grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list or !@invoicing_list )
+ && ! $self->invoice_noemail;
#$self->print_invoice(\%opt)
$self->print(\%opt)
#$self->print_invoice(\%opt)
$self->print(\%opt)
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
b8c9774
..
a277282
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-1799,6
+1799,7
@@
sub check {
|| $self->ut_numbern('billday')
|| $self->ut_enum('edit_subject', [ '', 'Y' ] )
|| $self->ut_enum('calling_list_exempt', [ '', 'Y' ] )
|| $self->ut_numbern('billday')
|| $self->ut_enum('edit_subject', [ '', 'Y' ] )
|| $self->ut_enum('calling_list_exempt', [ '', 'Y' ] )
+ || $self->ut_enum('invoice_noemail', [ '', 'Y' ] )
|| $self->ut_enum('locale', [ '', FS::Locales->locales ])
;
|| $self->ut_enum('locale', [ '', FS::Locales->locales ])
;
diff --git
a/FS/FS/part_event/Action/cust_bill_email.pm
b/FS/FS/part_event/Action/cust_bill_email.pm
index
a5cd861
..
1a3bca4
100644
(file)
--- a/
FS/FS/part_event/Action/cust_bill_email.pm
+++ b/
FS/FS/part_event/Action/cust_bill_email.pm
@@
-17,7
+17,7
@@
sub do_action {
#my $cust_main = $self->cust_main($cust_bill);
my $cust_main = $cust_bill->cust_main;
#my $cust_main = $self->cust_main($cust_bill);
my $cust_main = $cust_bill->cust_main;
- $cust_bill->email;
+ $cust_bill->email
unless $cust_main->invoice_noemail
;
}
1;
}
1;
diff --git
a/httemplate/edit/cust_main/billing.html
b/httemplate/edit/cust_main/billing.html
index
f280e3a
..
258530e
100644
(file)
--- a/
httemplate/edit/cust_main/billing.html
+++ b/
httemplate/edit/cust_main/billing.html
@@
-478,7
+478,7
@@
? 'CHECKED'
: ''
? 'CHECKED'
: ''
- %>> <% mt('Postal mail invoice') |h %>
+ %>> <% mt('Postal mail invoice
s
') |h %>
</TD>
</TR>
</TD>
</TR>
@@
-490,15
+490,27
@@
? 'CHECKED'
: ''
? 'CHECKED'
: ''
- %>> <% mt('Fax invoice') |h %>
+ %>> <% mt('Fax invoice
s
') |h %>
</TD>
</TR>
% }
</TD>
</TR>
% }
-% unless ( $conf->exists('cust-email-high-visibility')) {
<TR>
<TR>
+ <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoice_email" VALUE="Y" <%
+
+ ( $cust_main->invoice_noemail eq 'Y' )
+ ? ''
+ : 'CHECKED'
+
+ %>> <% mt('Email invoices') |h %>
+
+ </TD>
+ </TR>
+
+% unless ( $conf->exists('cust-email-high-visibility')) {
+ <TR>
<TD ALIGN="right" WIDTH="200">
<% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
? $r : '' %>Email address(es)
<TD ALIGN="right" WIDTH="200">
<% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
? $r : '' %>Email address(es)
diff --git
a/httemplate/edit/process/cust_main.cgi
b/httemplate/edit/process/cust_main.cgi
index
295e991
..
15dd461
100755
(executable)
--- a/
httemplate/edit/process/cust_main.cgi
+++ b/
httemplate/edit/process/cust_main.cgi
@@
-66,6
+66,8
@@
my $new = new FS::cust_main ( {
} fields('cust_main')
} );
} fields('cust_main')
} );
+$new->invoice_noemail( ($cgi->param('invoice_email') eq 'Y') ? '' : 'Y' );
+
$cgi->param('duplicate_of_custnum') =~ /^(\d+)$/;
my $duplicate_of = $1;
if ( $duplicate_of ) {
$cgi->param('duplicate_of_custnum') =~ /^(\d+)$/;
my $duplicate_of = $1;
if ( $duplicate_of ) {
diff --git
a/httemplate/view/cust_main/billing.html
b/httemplate/view/cust_main/billing.html
index
510847f
..
83a8f4d
100644
(file)
--- a/
httemplate/view/cust_main/billing.html
+++ b/
httemplate/view/cust_main/billing.html
@@
-213,21
+213,27
@@
</TR>
% }
<TR>
</TR>
% }
<TR>
- <TD ALIGN="right"><% mt('Postal invoices') |h %></TD>
+ <TD ALIGN="right"><% mt('Postal
mail
invoices') |h %></TD>
<TD BGCOLOR="#ffffff">
<% ( grep { $_ eq 'POST' } @invoicing_list ) ? $yes : $no %>
</TD>
</TR>
<TR>
<TD BGCOLOR="#ffffff">
<% ( grep { $_ eq 'POST' } @invoicing_list ) ? $yes : $no %>
</TD>
</TR>
<TR>
- <TD ALIGN="right"><% mt('F
AX
invoices') |h %></TD>
+ <TD ALIGN="right"><% mt('F
ax
invoices') |h %></TD>
<TD BGCOLOR="#ffffff">
<% ( grep { $_ eq 'FAX' } @invoicing_list ) ? $yes : $no %>
</TD>
</TR>
<TD BGCOLOR="#ffffff">
<% ( grep { $_ eq 'FAX' } @invoicing_list ) ? $yes : $no %>
</TD>
</TR>
-% unless ( $conf->exists('cust-email-high-visibility')) {
<TR>
<TD ALIGN="right"><% mt('Email invoices') |h %></TD>
<TD BGCOLOR="#ffffff">
<TR>
<TD ALIGN="right"><% mt('Email invoices') |h %></TD>
<TD BGCOLOR="#ffffff">
+ <% $cust_main->invoice_noemail ? $no : $yes %>
+ </TD>
+</TR>
+% unless ( $conf->exists('cust-email-high-visibility')) {
+<TR>
+ <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
+ <TD BGCOLOR="#ffffff">
<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
</TD>
</TR>
<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
</TD>
</TR>
diff --git
a/httemplate/view/cust_main/contacts.html
b/httemplate/view/cust_main/contacts.html
index
68e3b17
..
2b10b9d
100644
(file)
--- a/
httemplate/view/cust_main/contacts.html
+++ b/
httemplate/view/cust_main/contacts.html
@@
-17,14
+17,16
@@
<TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || ' ' %></TD>
% }
</TR>
<TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || ' ' %></TD>
% }
</TR>
+
% if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
% if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
-<TR>
-
<TD ALIGN="right"><% mt('Email invoices
') |h %></TD>
- <TD BGCOLOR="#ffff00">
- <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
- </TD>
-</TR>
+
<TR>
+
<TD ALIGN="right"><% mt('Email address(es)
') |h %></TD>
+
<TD BGCOLOR="#ffff00">
+
<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
+
</TD>
+
</TR>
% }
% }
+
<TR>
<TD ALIGN="right"><% mt('Company') |h %></TD>
<TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
<TR>
<TD ALIGN="right"><% mt('Company') |h %></TD>
<TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>