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 % my $close_date = $quotation->close_date;
88 % my $confidence = $quotation->confidence;
89 % if ($close_date or length($confidence)) {
93 <TH STYLE="text-align: right;">Close Date:</TH>
94 <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
97 % if (length($confidence)) {
98 <TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %>%</TD></TR>
103 % if ( $conf->exists('quotation_html') ) {
104 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
106 % die "quotation_html config missing";
108 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
110 <& /elements/footer.html &>
113 my $curuser = $FS::CurrentUser::CurrentUser;
116 # unless $curuser->access_right('View quotations');
118 my $can_generate_quotation = $curuser->access_right('Generate quotation');
121 my($query) = $cgi->keywords;
122 if ( $query =~ /^(\d+)$/ ) {
125 $quotationnum = $cgi->param('quotationnum');
128 my $conf = new FS::Conf;
130 my $quotation = qsearchs({
131 'select' => 'quotation.*',
132 'table' => 'quotation',
133 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
134 'hashref' => { 'quotationnum' => $quotationnum },
135 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
137 die "Quotation #$quotationnum not found!" unless $quotation;
139 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
141 my $link = "quotationnum=$quotationnum";
142 #$link .= ';template='. uri_escape($template) if $template;
143 #$link .= ';notice_name='. $notice_name if $notice_name;
145 my $preref_callback = sub {
146 my $quotation_pkg = shift;
147 $can_generate_quotation ?
148 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
149 emt('Are you sure you want to remove this package from the quotation?'),
150 emt('Remove this package'), #tooltip
151 qq(<img src="${p}images/cross.png">), #link
153 include('/elements/popup_link.html',
154 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
155 $quotation_pkg->quotationpkgnum,
156 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
157 title => emt('Edit quotation details'),
158 actionlabel => emt('Edit quotation details'),
165 sub areyousure_link {
166 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
167 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';