1 <& /elements/header.html, mt('Quotation View'), $menubar &>
2 <& /elements/init_overlib.html &>
4 <SCRIPT TYPE="text/javascript">
5 function areyousure(href, message) {
6 if (confirm(message) == true)
7 window.location.href = href;
11 % if ( $quotation->custnum ) {
12 <h2>Quotation #<% $quotationnum %>
13 % if ($quotation->quotation_description) {
14 (<% $quotation->quotation_description |h %>)
19 % unless ( $quotation->disabled eq 'Y' ) {
22 % if ( $curuser->access_right('Order customer package') ) {
23 <& /elements/order_pkg_link.html,
24 'label' => emt('Add package'),
25 'actionlabel' => emt('Add package'),
26 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
31 % if ( $curuser->access_right('One-time charge') ) {
32 <% $inrow ? ' | ' : '' %>
33 <& /elements/one_time_charge_link.html,
34 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
39 % if ( $can_generate_quotation ) {
40 <% $inrow ? ' | ' : '' %>
41 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
45 <% $inrow ? '<BR><BR>' : '' %>
47 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
49 <& /elements/popup_link.html,
50 'action' => "${p}misc/email-quotation.html".
51 "?quotationnum=$quotationnum",
52 'label' => emt('Email this quotation'),
53 'actionlabel' => emt('Select recipients'),
58 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
60 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
61 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
66 % if ( $conf->exists('quotation_latex') ) {
67 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
72 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
73 % # if we end up with more than one option, combine these links and add an interstitial screen
74 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
75 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
81 % if ( $curuser->access_right('Disable quotation') ) {
82 % if ( $quotation->disabled eq 'Y' ) {
83 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
86 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
87 emt('Are you sure you want to disable this quotation?'),
88 emt('Disable this quotation'), #tooltip
89 emt('Disable this quotation'), #link
96 % my $close_date = $quotation->close_date;
97 % my $confidence = $quotation->confidence;
98 % if ($close_date or length($confidence)) {
102 <TH STYLE="text-align: right;">Close Date:</TH>
103 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
106 % if (length($confidence)) {
107 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
112 % if ( $conf->exists('quotation_html') ) {
113 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
115 % die "quotation_html config missing";
117 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
119 <& /elements/footer.html &>
122 my $curuser = $FS::CurrentUser::CurrentUser;
124 #die "access denied";
125 # unless $curuser->access_right('View quotations');
127 my $can_generate_quotation = $curuser->access_right('Generate quotation');
130 my($query) = $cgi->keywords;
131 if ( $query =~ /^(\d+)$/ ) {
134 $quotationnum = $cgi->param('quotationnum');
137 my $conf = new FS::Conf;
139 my $quotation = qsearchs({
140 'select' => 'quotation.*',
141 'table' => 'quotation',
142 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
143 'hashref' => { 'quotationnum' => $quotationnum },
144 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
146 die "Quotation #$quotationnum not found!" unless $quotation;
148 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
150 my $link = "quotationnum=$quotationnum";
151 #$link .= ';template='. uri_escape($template) if $template;
152 #$link .= ';notice_name='. $notice_name if $notice_name;
154 my $preref_callback = sub {
155 my $quotation_pkg = shift;
156 $can_generate_quotation ?
157 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
158 emt('Are you sure you want to remove this package from the quotation?'),
159 emt('Remove this package'), #tooltip
160 qq(<img src="${p}images/cross.png">), #link
162 include('/elements/popup_link.html',
163 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
164 $quotation_pkg->quotationpkgnum,
165 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
166 title => emt('Edit quotation details'),
167 actionlabel => emt('Edit quotation details'),
174 sub areyousure_link {
175 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
176 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';