1 <& /elements/header.html, mt('Quotation View'), $menubar &>
3 <& /elements/init_overlib.html &>
5 <SCRIPT TYPE="text/javascript">
6 function areyousure(href, message) {
7 if (confirm(message) == true)
8 window.location.href = href;
12 % unless ( $quotation->disabled eq 'Y' ) {
15 % if ( $curuser->access_right('Order customer package') ) {
16 <& /elements/order_pkg_link.html,
17 'label' => emt('Add package'),
18 'actionlabel' => emt('Add package'),
19 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
24 % if ( $curuser->access_right('One-time charge') ) {
25 <% $inrow ? ' | ' : '' %>
26 <& /elements/one_time_charge_link.html,
27 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
32 % if ( $can_generate_quotation ) {
33 <% $inrow ? ' | ' : '' %>
34 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
38 <% $inrow ? '<BR><BR>' : '' %>
40 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
42 <& /elements/popup_link.html,
43 'action' => "${p}misc/email-quotation.html".
44 "?quotationnum=$quotationnum",
45 'label' => emt('Email this quotation'),
46 'actionlabel' => emt('Select recipients'),
51 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
53 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
54 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
59 % if ( $conf->exists('quotation_latex') ) {
60 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
65 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
66 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
72 % if ( $curuser->access_right('Disable quotation') ) {
73 % if ( $quotation->disabled eq 'Y' ) {
74 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
77 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
78 emt('Are you sure you want to disable this quotation?'),
79 emt('Disable this quotation'), #tooltip
80 emt('Disable this quotation'), #link
87 <DIV CLASS="error"><% emt('Error calculating quotation: [_1]', $error) %></DIV>
90 % my $close_date = $quotation->close_date;
91 % my $confidence = $quotation->confidence;
92 % if ($close_date or length($confidence)) {
96 <TH STYLE="text-align: right;">Close Date:</TH>
97 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
100 % if (length($confidence)) {
101 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
106 % if ( $conf->exists('quotation_html') ) {
107 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
109 % die "quotation_html config missing";
111 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
113 <& /elements/footer.html &>
116 my $curuser = $FS::CurrentUser::CurrentUser;
119 # unless $curuser->access_right('View quotations');
121 my $can_generate_quotation = $curuser->access_right('Generate quotation');
124 my($query) = $cgi->keywords;
125 if ( $query =~ /^(\d+)$/ ) {
128 $quotationnum = $cgi->param('quotationnum');
131 my $conf = new FS::Conf;
133 my $quotation = qsearchs({
134 'select' => 'quotation.*',
135 'table' => 'quotation',
136 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
137 'hashref' => { 'quotationnum' => $quotationnum },
138 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
140 die "Quotation #$quotationnum not found!" unless $quotation;
142 my $error = $quotation->estimate;
144 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
146 my $link = "quotationnum=$quotationnum";
147 #$link .= ';template='. uri_escape($template) if $template;
148 #$link .= ';notice_name='. $notice_name if $notice_name;
150 my $preref_callback = sub {
151 my $quotation_pkg = shift;
152 $can_generate_quotation ?
153 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
154 emt('Are you sure you want to remove this package from the quotation?'),
155 emt('Remove this package'), #tooltip
156 qq(<img src="${p}images/cross.png">), #link
158 include('/elements/popup_link.html',
159 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
160 $quotation_pkg->quotationpkgnum,
161 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
162 title => emt('Edit quotation details'),
163 actionlabel => emt('Edit quotation details'),
170 sub areyousure_link {
171 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
172 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';