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' ) {
14 % if ( $curuser->access_right('Order customer package') ) {
15 <& /elements/order_pkg_link.html,
16 'label' => emt('Add package'),
17 'actionlabel' => emt('Add package'),
18 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
23 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
25 <& /elements/popup_link.html,
26 'action' => "${p}misc/email-quotation.html".
27 "?quotationnum=$quotationnum",
28 'label' => emt('Email this quotation'),
29 'actionlabel' => emt('Select recipients'),
34 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
36 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
37 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
42 % if ( $conf->exists('quotation_latex') ) {
43 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
48 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
49 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
55 % if ( $curuser->access_right('Disable quotation') ) {
56 % if ( $quotation->disabled eq 'Y' ) {
57 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
60 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
61 emt('Are you sure you want to disable this quotation?'),
62 emt('Disable this quotation'), #tooltip
63 emt('Disable this quotation'), #link
70 % if ( $conf->exists('quotation_html') ) {
71 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
73 % die "quotation_html config missing";
75 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
77 <& /elements/footer.html &>
80 my $curuser = $FS::CurrentUser::CurrentUser;
83 # unless $curuser->access_right('View quotations');
86 my($query) = $cgi->keywords;
87 if ( $query =~ /^(\d+)$/ ) {
90 $quotationnum = $cgi->param('quotationnum');
93 my $conf = new FS::Conf;
95 my $quotation = qsearchs({
96 'select' => 'quotation.*',
97 'table' => 'quotation',
98 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
99 'hashref' => { 'quotationnum' => $quotationnum },
100 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
102 die "Quotation #$quotationnum not found!" unless $quotation;
104 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
106 my $link = "quotationnum=$quotationnum";
107 #$link .= ';template='. uri_escape($template) if $template;
108 #$link .= ';notice_name='. $notice_name if $notice_name;
110 my $preref_callback = sub {
111 areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum,
112 emt('Are you sure you want to remove this package from the quotation?'),
113 emt('Remove this package'), #tooltip
114 qq(<img src="${p}images/cross.png">), #link
118 sub areyousure_link {
119 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
120 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';