1 % if ( $quotation->custnum ) {
2 <h2>Quotation #<% $quotationnum %>
3 % if ($quotation->quotation_description) {
4 (<% $quotation->quotation_description %>)
7 % } else { #eventually, header-prospect_main.html
8 <& /elements/header.html, mt('Quotation View'), $menubar &>
9 <& /elements/init_overlib.html &>
11 <SCRIPT TYPE="text/javascript">
12 function areyousure(href, message) {
13 if (confirm(message) == true)
14 window.location.href = href;
20 % unless ( $quotation->disabled eq 'Y' ) {
23 % if ( $curuser->access_right('Order customer package') ) {
24 <& /elements/order_pkg_link.html,
25 'label' => emt('Add package'),
26 'actionlabel' => emt('Add package'),
27 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
32 % if ( $curuser->access_right('One-time charge') ) {
33 <% $inrow ? ' | ' : '' %>
34 <& /elements/one_time_charge_link.html,
35 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
40 % if ( $can_generate_quotation ) {
41 <% $inrow ? ' | ' : '' %>
42 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
46 <% $inrow ? '<BR><BR>' : '' %>
48 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
50 <& /elements/popup_link.html,
51 'action' => "${p}misc/email-quotation.html".
52 "?quotationnum=$quotationnum",
53 'label' => emt('Email this quotation'),
54 'actionlabel' => emt('Select recipients'),
59 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
61 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
62 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
67 % if ( $conf->exists('quotation_latex') ) {
68 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
73 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
74 % # if we end up with more than one option, combine these links and add an interstitial screen
75 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
76 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
82 % if ( $curuser->access_right('Disable quotation') ) {
83 % if ( $quotation->disabled eq 'Y' ) {
84 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
87 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
88 emt('Are you sure you want to disable this quotation?'),
89 emt('Disable this quotation'), #tooltip
90 emt('Disable this quotation'), #link
97 % my $close_date = $quotation->close_date;
98 % my $confidence = $quotation->confidence;
99 % if ($close_date or length($confidence)) {
103 <TH STYLE="text-align: right;">Close Date:</TH>
104 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
107 % if (length($confidence)) {
108 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
113 % if ( $conf->exists('quotation_html') ) {
114 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
116 % die "quotation_html config missing";
118 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
120 <& /elements/footer.html &>
123 my $curuser = $FS::CurrentUser::CurrentUser;
125 #die "access denied";
126 # unless $curuser->access_right('View quotations');
128 my $can_generate_quotation = $curuser->access_right('Generate quotation');
131 my($query) = $cgi->keywords;
132 if ( $query =~ /^(\d+)$/ ) {
135 $quotationnum = $cgi->param('quotationnum');
138 my $conf = new FS::Conf;
140 my $quotation = qsearchs({
141 'select' => 'quotation.*',
142 'table' => 'quotation',
143 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
144 'hashref' => { 'quotationnum' => $quotationnum },
145 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
147 die "Quotation #$quotationnum not found!" unless $quotation;
149 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
151 my $link = "quotationnum=$quotationnum";
152 #$link .= ';template='. uri_escape($template) if $template;
153 #$link .= ';notice_name='. $notice_name if $notice_name;
155 my $preref_callback = sub {
156 my $quotation_pkg = shift;
157 $can_generate_quotation ?
158 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
159 emt('Are you sure you want to remove this package from the quotation?'),
160 emt('Remove this package'), #tooltip
161 qq(<img src="${p}images/cross.png">), #link
163 include('/elements/popup_link.html',
164 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
165 $quotation_pkg->quotationpkgnum,
166 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
167 title => emt('Edit quotation details'),
168 actionlabel => emt('Edit quotation details'),
175 sub areyousure_link {
176 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
177 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';