1 % if ( $quotation->custnum ) {
2 <& /elements/header-cust_main.html, view=>'quotations', custnum=>$quotation->custnum &>
3 <h2>Quotation #<% $quotationnum %>
4 % if ($quotation->quotation_description) {
5 (<% $quotation->quotation_description %>)
8 % } else { #eventually, header-prospect_main.html
9 >>>>>>> 512a0bd... RT# 74666, Added quotation description to customer quotation list and quotation view
10 <& /elements/header.html, mt('Quotation View'), $menubar &>
12 <& /elements/init_overlib.html &>
14 <SCRIPT TYPE="text/javascript">
15 function areyousure(href, message) {
16 if (confirm(message) == true)
17 window.location.href = href;
21 % unless ( $quotation->disabled eq 'Y' ) {
24 % if ( $curuser->access_right('Order customer package') ) {
25 <& /elements/order_pkg_link.html,
26 'label' => emt('Add package'),
27 'actionlabel' => emt('Add package'),
28 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
33 % if ( $curuser->access_right('One-time charge') ) {
34 <% $inrow ? ' | ' : '' %>
35 <& /elements/one_time_charge_link.html,
36 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
41 % if ( $can_generate_quotation ) {
42 <% $inrow ? ' | ' : '' %>
43 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
47 <% $inrow ? '<BR><BR>' : '' %>
49 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
51 <& /elements/popup_link.html,
52 'action' => "${p}misc/email-quotation.html".
53 "?quotationnum=$quotationnum",
54 'label' => emt('Email this quotation'),
55 'actionlabel' => emt('Select recipients'),
60 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
62 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
63 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
68 % if ( $conf->exists('quotation_latex') ) {
69 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
74 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
75 % # if we end up with more than one option, combine these links and add an interstitial screen
76 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
77 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
83 % if ( $curuser->access_right('Disable quotation') ) {
84 % if ( $quotation->disabled eq 'Y' ) {
85 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
88 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
89 emt('Are you sure you want to disable this quotation?'),
90 emt('Disable this quotation'), #tooltip
91 emt('Disable this quotation'), #link
98 % my $close_date = $quotation->close_date;
99 % my $confidence = $quotation->confidence;
100 % if ($close_date or length($confidence)) {
104 <TH STYLE="text-align: right;">Close Date:</TH>
105 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
108 % if (length($confidence)) {
109 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
114 % if ( $conf->exists('quotation_html') ) {
115 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
117 % die "quotation_html config missing";
119 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
121 <& /elements/footer.html &>
124 my $curuser = $FS::CurrentUser::CurrentUser;
127 # unless $curuser->access_right('View quotations');
129 my $can_generate_quotation = $curuser->access_right('Generate quotation');
132 my($query) = $cgi->keywords;
133 if ( $query =~ /^(\d+)$/ ) {
136 $quotationnum = $cgi->param('quotationnum');
139 my $conf = new FS::Conf;
141 my $quotation = qsearchs({
142 'select' => 'quotation.*',
143 'table' => 'quotation',
144 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
145 'hashref' => { 'quotationnum' => $quotationnum },
146 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
148 die "Quotation #$quotationnum not found!" unless $quotation;
150 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
152 my $link = "quotationnum=$quotationnum";
153 #$link .= ';template='. uri_escape($template) if $template;
154 #$link .= ';notice_name='. $notice_name if $notice_name;
156 my $preref_callback = sub {
157 my $quotation_pkg = shift;
158 $can_generate_quotation ?
159 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
160 emt('Are you sure you want to remove this package from the quotation?'),
161 emt('Remove this package'), #tooltip
162 qq(<img src="${p}images/cross.png">), #link
164 include('/elements/popup_link.html',
165 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
166 $quotation_pkg->quotationpkgnum,
167 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
168 title => emt('Edit quotation details'),
169 actionlabel => emt('Edit quotation details'),
176 sub areyousure_link {
177 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
178 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';