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 |h %>)
8 % } else { #eventually, header-prospect_main.html
9 <& /elements/header.html, mt('Quotation View'), $menubar &>
10 <& /elements/init_overlib.html &>
12 <SCRIPT TYPE="text/javascript">
13 function areyousure(href, message) {
14 if (confirm(message) == true)
15 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 % my $query = 'quotationnum=' . $quotation->get('quotationnum');
36 % if ($quotation->custnum) {
37 % $query .= ';custnum=' . $quotation->custnum;
39 % $query .= ';prospectnum=' . $quotation->prospectnum;
41 <A HREF="<% $fsurl . 'edit/quick-charge.html?' . $query %>"><% emt('One-time charge') %></A>
45 % if ( $can_generate_quotation ) {
46 <% $inrow ? ' | ' : '' %>
47 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
51 <% $inrow ? '<BR><BR>' : '' %>
53 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
55 <& /elements/popup_link.html,
56 'action' => "${p}misc/email-quotation.html".
57 "?quotationnum=$quotationnum",
58 'label' => emt('Email this quotation'),
59 'actionlabel' => emt('Select recipients'),
64 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
66 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
67 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
72 % if ( $conf->exists('quotation_latex') ) {
73 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
78 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
79 % # if we end up with more than one option, combine these links and add an interstitial screen
80 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
81 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
87 % if ( $curuser->access_right('Disable quotation') ) {
88 % if ( $quotation->disabled eq 'Y' ) {
89 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
92 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
93 emt('Are you sure you want to disable this quotation?'),
94 emt('Disable this quotation'), #tooltip
95 emt('Disable this quotation'), #link
102 <DIV CLASS="error"><% emt('Error calculating quotation: [_1]', $error) %></DIV>
105 % my $close_date = $quotation->close_date;
106 % my $confidence = $quotation->confidence;
107 % if ($close_date or length($confidence)) {
111 <TH STYLE="text-align: right;">Close Date:</TH>
112 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
115 % if (length($confidence)) {
116 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
121 % if ( $conf->exists('quotation_html') ) {
122 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
124 % die "quotation_html config missing";
126 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
128 % if ( $quotation->custnum ) {
129 <& /elements/footer-cust_main.html &>
131 <& /elements/footer.html &>
135 my $curuser = $FS::CurrentUser::CurrentUser;
138 # unless $curuser->access_right('View quotations');
140 my $can_generate_quotation = $curuser->access_right('Generate quotation');
143 my($query) = $cgi->keywords;
144 if ( $query =~ /^(\d+)$/ ) {
147 $quotationnum = $cgi->param('quotationnum');
150 my $conf = new FS::Conf;
152 my $quotation = qsearchs({
153 'select' => 'quotation.*',
154 'table' => 'quotation',
155 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
156 'hashref' => { 'quotationnum' => $quotationnum },
157 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
159 die "Quotation #$quotationnum not found!" unless $quotation;
161 my $error = $quotation->estimate;
163 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
165 my $link = "quotationnum=$quotationnum";
166 #$link .= ';template='. uri_escape($template) if $template;
167 #$link .= ';notice_name='. $notice_name if $notice_name;
169 my $preref_callback = sub {
170 my $quotation_pkg = shift;
171 $can_generate_quotation ?
172 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
173 emt('Are you sure you want to remove this package from the quotation?'),
174 emt('Remove this package'), #tooltip
175 qq(<img src="${p}images/cross.png">), #link
177 include('/elements/popup_link.html',
178 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
179 $quotation_pkg->quotationpkgnum,
180 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
181 title => emt('Edit quotation details'),
182 actionlabel => emt('Edit quotation details'),
189 sub areyousure_link {
190 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
191 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';