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 % my $query = 'quotationnum=' . $quotation->get('quotationnum');
27 % if ($quotation->custnum) {
28 % $query .= ';custnum=' . $quotation->custnum;
30 % $query .= ';prospectnum=' . $quotation->prospectnum;
32 <A HREF="<% $fsurl . 'edit/quick-charge.html?' . $query %>"><% emt('One-time charge') %></A>
36 % if ( $can_generate_quotation ) {
37 <% $inrow ? ' | ' : '' %>
38 <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
42 <% $inrow ? '<BR><BR>' : '' %>
44 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
46 <& /elements/popup_link.html,
47 'action' => "${p}misc/email-quotation.html".
48 "?quotationnum=$quotationnum",
49 'label' => emt('Email this quotation'),
50 'actionlabel' => emt('Select recipients'),
55 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
57 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
58 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
63 % if ( $conf->exists('quotation_latex') ) {
64 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
69 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
70 % # if we end up with more than one option, combine these links and add an interstitial screen
71 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
72 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>&onhold=1">Order on hold</A>
78 % if ( $curuser->access_right('Disable quotation') ) {
79 % if ( $quotation->disabled eq 'Y' ) {
80 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
83 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
84 emt('Are you sure you want to disable this quotation?'),
85 emt('Disable this quotation'), #tooltip
86 emt('Disable this quotation'), #link
93 <DIV CLASS="error"><% emt('Error calculating quotation: [_1]', $error) %></DIV>
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;
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 $error = $quotation->estimate;
150 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
152 my $link = "quotationnum=$quotationnum";
153 #$link .= ';template='. uri_escape($template) if $template;
154 #$link .= ';notice_name='. $notice_name if $notice_name;
156 my $preref_callback = sub {
157 my $quotation_pkg = shift;
158 $can_generate_quotation ?
159 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
160 emt('Are you sure you want to remove this package from the quotation?'),
161 emt('Remove this package'), #tooltip
162 qq(<img src="${p}images/cross.png">), #link
164 include('/elements/popup_link.html',
165 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
166 $quotation_pkg->quotationpkgnum,
167 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
168 title => emt('Edit quotation details'),
169 actionlabel => emt('Edit quotation details'),
176 sub areyousure_link {
177 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
178 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';