[freeside-commits] branch FREESIDE_3_BRANCH updated. 8e1ae165bfb1fba2e3cca8081acadefc81aac95a

Jonathan Prykop jonathan at 420.am
Mon Mar 14 14:49:27 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  8e1ae165bfb1fba2e3cca8081acadefc81aac95a (commit)
      from  1ff7070534d12c49c9d16f230301a3880e8dd5ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8e1ae165bfb1fba2e3cca8081acadefc81aac95a
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Mar 14 16:36:41 2016 -0500

    RT#38733: Sales forecasting using quotes [percentage sign and check]

diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm
index daacf71..f828a39 100644
--- a/FS/FS/quotation.pm
+++ b/FS/FS/quotation.pm
@@ -133,6 +133,9 @@ sub check {
 
   $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
 
+  return 'confidence must be an integer between 1 and 100'
+    if length($self->confidence) && (($self->confidence < 1) || ($self->confidence > 100));
+
   return 'prospectnum or custnum must be specified'
     if ! $self->prospectnum
     && ! $self->custnum;
diff --git a/httemplate/edit/quotation.html b/httemplate/edit/quotation.html
index 4372840..43e815c 100644
--- a/httemplate/edit/quotation.html
+++ b/httemplate/edit/quotation.html
@@ -16,7 +16,7 @@
                    { field=>'custnum',     type=>'fixed-cust_main' },
                    { field=>'_date',       type=>'fixed-date' },
                    { field=>'close_date',  type=>'input-date-field' },
-                   { field=>'confidence',  type=>'text', size=>6 },
+                   { field=>'confidence',  type=>'text', size=>3, postfix=>'%' },
                    ($can_disable ? { field=>'disabled',    type=>'checkbox', value=>'Y'} : ()),
                               ],
                  #XXX some way to disable the "view all"
diff --git a/httemplate/search/quotation.html b/httemplate/search/quotation.html
index 16affeb..f9b77b9 100755
--- a/httemplate/search/quotation.html
+++ b/httemplate/search/quotation.html
@@ -29,9 +29,11 @@
                    sub { my $cust_main = shift->cust_main;
                          $cust_main ? encode_entities($cust_main->name) : '';
                        },
-                   'confidence',
-                   sub { my $quot = shift;
-                         $quot->close_date ? time2str('%b %d %Y', $quot->close_date) : '';
+                   sub { my $quotation = shift;
+                         length($quotation->confidence) ? $quotation->confidence . '%' : '';
+                       },
+                   sub { my $quotation = shift;
+                         $quotation->close_date ? time2str('%b %d %Y', $quotation->close_date) : '';
                        },
                    #\&FS::UI::Web::cust_fields,
                  ],
diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html
index 644d28f..0570e78 100755
--- a/httemplate/view/quotation.html
+++ b/httemplate/view/quotation.html
@@ -95,7 +95,7 @@ function areyousure(href, message) {
 </TR>
 %   }
 %   if (length($confidence)) {
-<TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %></TD></TR>
+<TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
 %   }
 </TABLE>
 % }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/quotation.pm               |    3 +++
 httemplate/edit/quotation.html   |    2 +-
 httemplate/search/quotation.html |    8 +++++---
 httemplate/view/quotation.html   |    2 +-
 4 files changed, 10 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list