summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-09-16 23:41:40 -0700
committerIvan Kohler <ivan@freeside.biz>2014-09-16 23:41:40 -0700
commitee17093f5b41c1544d00a2670d26794aee33077a (patch)
tree6d11ca503666b991dd4b8987e301826c3fe9291f /httemplate/elements
parentf58e37b603c27dd0b2d2232e8cb0392088409437 (diff)
customer quotations are work orders? RT#25561
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/quotations.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/httemplate/elements/quotations.html b/httemplate/elements/quotations.html
new file mode 100644
index 000000000..0cf150022
--- /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';
+}
+
+@quotations = grep ! $_->disabled, @quotations;
+
+</%init>