[freeside-commits] branch master updated. 03728b5a1f7e30faebc170389c4d91481ade685e

Ivan ivan at 420.am
Tue Sep 16 23:41:51 PDT 2014


The branch, master has been updated
       via  03728b5a1f7e30faebc170389c4d91481ade685e (commit)
       via  ee17093f5b41c1544d00a2670d26794aee33077a (commit)
       via  f58e37b603c27dd0b2d2232e8cb0392088409437 (commit)
      from  7a486dea647f735a9a1d0381443218ad6affe6e1 (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 03728b5a1f7e30faebc170389c4d91481ade685e
Merge: ee17093 7a486de
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 16 23:41:47 2014 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit ee17093f5b41c1544d00a2670d26794aee33077a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 16 23:41:40 2014 -0700

    customer quotations are work orders?  RT#25561

diff --git a/httemplate/edit/process/quotation_convert.html b/httemplate/edit/process/quotation_convert.html
index b387d06..dc00a88 100644
--- a/httemplate/edit/process/quotation_convert.html
+++ b/httemplate/edit/process/quotation_convert.html
@@ -10,8 +10,19 @@ my $quotation = qsearchs( 'quotation' => {
   quotationnum => scalar( $cgi->param('quotationnum') ),
 } ) or die 'unknown quotationnum';
 
-my $cust_main = $quotation->convert_cust_main;
-errorpage($cust_main) unless ref($cust_main);# eq 'FS::cust_main';
+my $cust_main = $quotation->cust_main;
+if ( $cust_main ) {
+  my $error = $quotation->order;
+  errorpage($error) if $error;
+
+  #i should be part of the order transaction
+  $quotation->disabled('Y');
+  $quotation->replace;
+
+} else {
+  $cust_main = $quotation->convert_cust_main;
+  errorpage($cust_main) unless ref($cust_main);# eq 'FS::cust_main';
+}
 
 </%init>
 
diff --git a/httemplate/edit/quotation.html b/httemplate/edit/quotation.html
index 8b60623..cc95d87 100644
--- a/httemplate/edit/quotation.html
+++ b/httemplate/edit/quotation.html
@@ -1,19 +1,20 @@
 <% include( 'elements/edit.html',
-                 'name'   => 'Quotation',
-                 'table'  => 'quotation',
-                 'labels' => { 
-                               'quotationnum' => 'Quotation number',
-                               'prospectnum'  => 'Prospect',
-                               'custnum'      => 'Customer',
-                               '_date'        => 'Date',
-                               'disabled'     => 'Disabled',
-                             },
-                 'fields' => [
+                 'name'    => 'Quotation',
+                 'table'   => 'quotation',
+                 'menubar' => [],
+                 'labels'  => { 
+                                'quotationnum' => 'Quotation number',
+                                'prospectnum'  => 'Prospect',
+                                'custnum'      => 'Customer',
+                                '_date'        => 'Date',
+                                'disabled'     => 'Disabled',
+                              },
+                 'fields'  => [
                    { field=>'prospectnum', type=>'fixed-prospect_main' },
                    { field=>'custnum',     type=>'fixed-cust_main' },
                    { field=>'_date',       type=>'fixed-date' },
                    { field=>'disabled',    type=>'checkbox', value=>'Y'},
-                             ],
+                              ],
                  #XXX some way to disable the "view all"
                  'new_callback' => sub { my( $cgi, $quotation) = @_;
                                          $quotation->$_( $cgi->param($_) )
diff --git a/httemplate/elements/quotations.html b/httemplate/elements/quotations.html
new file mode 100644
index 0000000..0cf1500
--- /dev/null
+++ b/httemplate/elements/quotations.html
@@ -0,0 +1,66 @@
+% if ( $curuser->access_right('Generate quotation') ) { 
+
+  <FONT CLASS="fsinnerbox-title"><% mt( 'Quotations' ) |h %></FONT>
+  <A HREF="<%$p%>edit/quotation.html?<% $new_query %>">New quotation</A>
+
+% if ( @quotations ) {
+    <& /elements/table-grid.html &>
+%     my $bgcolor1 = '#eeeeee';
+%     my $bgcolor2 = '#ffffff';
+%     my $bgcolor = '';
+      <TR>
+        <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
+        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
+        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Setup') |h %></TH>
+        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Recurring') |h %></TH>
+        <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
+      </TR>
+%     foreach my $quotation (@quotations) {
+%       if ( $bgcolor eq $bgcolor1 ) {
+%         $bgcolor = $bgcolor2;
+%       } else {
+%         $bgcolor = $bgcolor1;
+%       }
+%       my $a = qq(<A HREF="$p/view/quotation.html?quotationnum=). #"
+%               $quotation->quotationnum. '">';
+        <TR>
+          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotationnum %></A></TD>
+          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% time2str($date_format, $quotation->_date) |h %></A></TD>
+          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_setup |h %></A></TD>
+          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_recur |h %></A></TD>
+          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>"><% $opt{convert_label} || 'Convert to customer' %></A></TD>
+        </TR>
+%     }
+    </TABLE>
+% }
+    <BR><BR>
+
+% }
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+#die "access denied"
+#  unless $curuser->access_right('Generate quotation');
+
+my $conf = new FS::Conf;
+
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+my %opt = @_;
+
+my $new_query;
+my @quotations;
+if ( $opt{cust_main} ) {
+  $new_query = 'custnum='. $opt{cust_main}->custnum;
+  @quotations = $opt{cust_main}->quotation;
+} elsif ( $opt{prospect_main} ) {
+  $new_query = 'quotationnum='. $opt{prospect_main}->quotationnum;
+  @quotations = $opt{prospect_main}->quotation;
+} else {
+  die 'guru meditation #&&: neither cust_main nor prospect_main specified';
+}
+
+ at quotations = grep ! $_->disabled, @quotations;
+
+</%init>
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 782556b..4880ac3 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -40,6 +40,11 @@ function areyousure(href, message) {
 }
 </SCRIPT>
 
+
+% ###
+% # Basics
+% ###
+
 % if ( $view eq 'basics' || $view eq 'jumbo' ) {
 
 % if ( $curuser->access_right('Edit customer') ) { 
@@ -183,6 +188,11 @@ function areyousure(href, message) {
 
 % }
 
+
+% ###
+% # Notes
+% ###
+
 % if ( $view eq 'notes' || $view eq 'jumbo' ) {
 
 <& cust_main/notes.html, 'cust_main' => $cust_main &>
@@ -195,6 +205,11 @@ function areyousure(href, message) {
 
 <BR>
 
+
+% ###
+% # Tickets
+% ###
+
 % if ( $view eq 'tickets' || $view eq 'jumbo' ) {
 
 % if ( $conf->config('ticket_system') ) { 
@@ -204,6 +219,10 @@ function areyousure(href, message) {
 
 % }
 
+% ###
+% # Appointments
+% ###
+
 % if ( $view eq 'appointments' || $view eq 'jumbo' ) {
 
 % if ( $conf->config('ticket_system')
@@ -214,6 +233,28 @@ function areyousure(href, message) {
 
 % }
 
+
+% ###
+% # Quotations
+% ###
+
+% if ( $view eq 'jumbo' && $curuser->access_right('Generate quotation') ) { 
+  <A NAME="quotation"><FONT SIZE="+2"><% mt('Quotations') |h %></FONT></A><BR>
+% }
+
+% if ( $view eq 'quotations' || $view eq 'jumbo' ) {
+
+%   if ( $curuser->access_right('Generate quotation') ) { 
+      <& cust_main/quotations.html, $cust_main &>
+%   }
+
+% }
+
+
+% ###
+% # Packages
+% ###
+
 % if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') { 
 
   <A NAME="cust_pkg"><FONT SIZE="+2"><% mt('Packages') |h %></FONT></A><BR>
@@ -227,6 +268,11 @@ function areyousure(href, message) {
 
 % }
 
+
+% ###
+% # Payment History
+% ###
+
 % if ( $view eq 'jumbo' ) {
     <BR><BR>
     <A NAME="history"><FONT SIZE="+2"><% mt('Payment History') |h %></FONT></A>
@@ -241,6 +287,11 @@ function areyousure(href, message) {
 
 % }
 
+
+% ###
+% # Change History
+% ###
+
 % if ( $view eq 'change_history' ) { #  || $view eq 'jumbo' 	 
 <& cust_main/change_history.html, $cust_main &> 	 
 % }
@@ -299,6 +350,7 @@ if ( $conf->config('ticket_system') ) {
   $views{emt('Appointments')}  =  'appointments'
     if $curuser->access_right('View appointments');
 }
+$views{emt('Quotations')}      =  'quotations';
 $views{emt('Packages')}        =  'packages';
 $views{emt('Payment History')} =  'payment_history'
                                unless $conf->config('payby-default' eq 'HIDE');
diff --git a/httemplate/view/cust_main/quotations.html b/httemplate/view/cust_main/quotations.html
new file mode 100644
index 0000000..4e3a207
--- /dev/null
+++ b/httemplate/view/cust_main/quotations.html
@@ -0,0 +1,10 @@
+<& /elements/quotations.html,
+     cust_main     => $cust_main,
+     convert_label => 'Place order',
+&>
+
+<%init>
+
+my $cust_main = shift;
+
+</%init>
diff --git a/httemplate/view/prospect_main.html b/httemplate/view/prospect_main.html
index 689b422..66abffc 100644
--- a/httemplate/view/prospect_main.html
+++ b/httemplate/view/prospect_main.html
@@ -1,7 +1,4 @@
-<% include('/elements/header.html',
-             'Prospect View: '. $prospect_main->company
-          )
-%>
+<& /elements/header.html, 'Prospect View: '. $prospect_main->company &>
 
 % if ( $curuser->access_right('Edit prospect') ) { 
   <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
@@ -76,43 +73,7 @@
 
 <BR>
 
-% if ( $curuser->access_right('Generate quotation') ) { 
-  <FONT CLASS="fsinnerbox-title"><% mt( 'Quotations' ) |h %></FONT>
-  <A HREF="<%$p%>edit/quotation.html?prospectnum=<% $prospectnum %>">New quotation</A>
-% my @quotations = $prospect_main->quotation;
-% if ( @quotations ) {
-    <& /elements/table-grid.html &>
-%     my $bgcolor1 = '#eeeeee';
-%     my $bgcolor2 = '#ffffff';
-%     my $bgcolor = '';
-      <TR>
-        <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
-        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
-        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Setup') |h %></TH>
-        <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Recurring') |h %></TH>
-        <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
-      </TR>
-%     foreach my $quotation (@quotations) {
-%       if ( $bgcolor eq $bgcolor1 ) {
-%         $bgcolor = $bgcolor2;
-%       } else {
-%         $bgcolor = $bgcolor1;
-%       }
-%       my $a = qq(<A HREF="$p/view/quotation.html?quotationnum=). #"
-%               $quotation->quotationnum. '">';
-        <TR>
-          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotationnum %></A></TD>
-          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% time2str($date_format, $quotation->_date) |h %></A></TD>
-          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_setup |h %></A></TD>
-          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_recur |h %></A></TD>
-          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Convert to customer</A></TD>
-        </TR>
-%     }
-    </TABLE>
-% }
-    <BR><BR>
-% }
-
+<& /elements/quotations.html, prospect_main=>$prospect_main &>
 
 % if ( $curuser->access_right('Qualify service') ) { 
 <% include( '/elements/popup_link-prospect_main.html',
@@ -147,10 +108,6 @@ my $curuser = $FS::CurrentUser::CurrentUser;
 die "access denied"
   unless $curuser->access_right('View prospect');
 
-my $conf = new FS::Conf;
-
-my $date_format = $conf->config('date_format') || '%m/%d/%Y';
-
 my $prospectnum;
 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
   $prospectnum = $1;

commit f58e37b603c27dd0b2d2232e8cb0392088409437
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 16 23:39:43 2014 -0700

    customer quotations are work orders?  RT#25561

diff --git a/httemplate/elements/freeside.css b/httemplate/elements/freeside.css
index 4ba0f3f..d038f6f 100644
--- a/httemplate/elements/freeside.css
+++ b/httemplate/elements/freeside.css
@@ -117,9 +117,9 @@ a.fstab {
          /*font-weight:bold;*/
          /*padding-left:12px;
          padding-right:12px;*/
-         padding-left:4px;
-         padding-right:4px;
-         font-size:18px;
+         padding-left:3px;
+         padding-right:3px;
+         font-size:17px;
          font-weight:bold;
          text-decoration:none;
          overflow:visible;
@@ -150,9 +150,9 @@ a.fstabselected {
          /*font-weight:bold;*/
          /*padding-left:12px;
          padding-right:12px;*/
-         padding-left:4px;
-         padding-right:4px;
-         font-size:18px;
+         padding-left:3px;
+         padding-right:3px;
+         font-size:17px;
          font-weight:bold;
          text-decoration:none;
          overflow:visible;

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

Summary of changes:
 httemplate/edit/process/quotation_convert.html |   15 +++++-
 httemplate/edit/quotation.html                 |   23 +++++----
 httemplate/elements/freeside.css               |   12 ++---
 httemplate/elements/quotations.html            |   66 ++++++++++++++++++++++++
 httemplate/view/cust_main.cgi                  |   52 +++++++++++++++++++
 httemplate/view/cust_main/quotations.html      |   10 ++++
 httemplate/view/prospect_main.html             |   47 +----------------
 7 files changed, 161 insertions(+), 64 deletions(-)
 create mode 100644 httemplate/elements/quotations.html
 create mode 100644 httemplate/view/cust_main/quotations.html




More information about the freeside-commits mailing list