diff options
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/Conf.pm | 2 | ||||
| -rw-r--r-- | FS/FS/Schema.pm | 15 | ||||
| -rw-r--r-- | FS/FS/cust_main.pm | 4 | ||||
| -rw-r--r-- | FS/FS/cust_main_note.pm | 1 | ||||
| -rw-r--r-- | FS/FS/cust_pay.pm | 9 |
5 files changed, 17 insertions, 14 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 279a4dfe8..239e304dd 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -773,7 +773,7 @@ sub reason_type_options { { 'key' => 'log_sent_mail', 'section' => 'notification', - 'description' => 'Enable logging of template-generated email.', + 'description' => 'Enable logging of all sent email.', 'type' => 'checkbox', }, diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index ca6d169e5..b7611c154 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -2013,13 +2013,14 @@ sub tables_hashref { 'cust_main_note' => { 'columns' => [ - 'notenum', 'serial', '', '', '', '', - 'custnum', 'int', '', '', '', '', - 'classnum', 'int', 'NULL', '', '', '', - '_date', @date_type, '', '', - 'otaker', 'varchar', 'NULL', 32, '', '', - 'usernum', 'int', 'NULL', '', '', '', - 'comments', 'text', 'NULL', '', '', '', + 'notenum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + 'classnum', 'int', 'NULL', '', '', '', + '_date', @date_type, '', '', + 'otaker', 'varchar', 'NULL', 32, '', '', + 'usernum', 'int', 'NULL', '', '', '', + 'comments', 'text', 'NULL', '', '', '', + 'sticky', 'int', '', '', 0, '', ], 'primary_key' => 'notenum', 'unique' => [], diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e4766f52b..1ed1d4ace 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2139,8 +2139,8 @@ Returns all notes (see L<FS::cust_main_note>) for this customer. sub notes { my($self,$orderby_classnum) = (shift,shift); - my $orderby = "_DATE DESC"; - $orderby = "CLASSNUM ASC, $orderby" if $orderby_classnum; + my $orderby = "sticky DESC, _date DESC"; + $orderby = "classnum ASC, $orderby" if $orderby_classnum; qsearch( 'cust_main_note', { 'custnum' => $self->custnum }, '', diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm index 712580764..ee63883d2 100644 --- a/FS/FS/cust_main_note.pm +++ b/FS/FS/cust_main_note.pm @@ -112,6 +112,7 @@ sub check { || $self->ut_numbern('_date') || $self->ut_textn('otaker') || $self->ut_anything('comments') + || $self->ut_numbern('sticky') ; return $error if $error; diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 0020a824d..e44278d92 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -945,10 +945,11 @@ sub _upgrade_data { #class method #not the most efficient, but hey, it only has to run once - my $where = "WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) ". - " AND usernum IS NULL ". - " AND 0 < ( SELECT COUNT(*) FROM cust_main ". - " WHERE cust_main.custnum = cust_pay.custnum ) "; + my $where = " WHERE ( otaker IS NULL OR otaker = '' OR otaker = 'ivan' ) + AND usernum IS NULL + AND EXISTS ( SELECT 1 FROM cust_main + WHERE cust_main.custnum = cust_pay.custnum ) + "; my $count_sql = "SELECT COUNT(*) FROM cust_pay $where"; |
