1 <& /elements/header.html, mt('Quotation View'), $menubar &>
3 <SCRIPT TYPE="text/javascript">
4 function areyousure(href, message) {
5 if (confirm(message) == true)
6 window.location.href = href;
10 % unless ( $quotation->disabled eq 'Y' ) {
12 % if ( $curuser->access_right('Order customer package') ) {
13 <& /elements/order_pkg_link.html,
14 'label' => emt('Add package'),
15 'actionlabel' => emt('Add package'),
16 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
21 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
23 % #if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
24 %# <A HREF="<% $p %>misc/email-quotation.html?<% $link %>"><% mt('Email this quotation') |h %></A>
27 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
29 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
30 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
35 % if ( $conf->exists('quotation_latex') ) {
36 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
41 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
42 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
48 % if ( $curuser->access_right('Disable quotation') ) {
49 % if ( $quotation->disabled eq 'Y' ) {
50 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
53 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
54 emt('Are you sure you want to disable this quotation?'),
55 emt('Disable this quotation'), #tooltip
56 emt('Disable this quotation'), #link
63 % if ( $conf->exists('quotation_html') ) {
64 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
66 % die "quotation_html config missing";
68 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
70 <& /elements/footer.html &>
73 my $curuser = $FS::CurrentUser::CurrentUser;
76 # unless $curuser->access_right('View quotations');
79 my($query) = $cgi->keywords;
80 if ( $query =~ /^(\d+)$/ ) {
83 $quotationnum = $cgi->param('quotationnum');
86 my $conf = new FS::Conf;
88 my $quotation = qsearchs({
89 'select' => 'quotation.*',
90 'table' => 'quotation',
91 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
92 'hashref' => { 'quotationnum' => $quotationnum },
93 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
95 die "Quotation #$quotationnum not found!" unless $quotation;
97 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
99 my $link = "quotationnum=$quotationnum";
100 #$link .= ';template='. uri_escape($template) if $template;
101 #$link .= ';notice_name='. $notice_name if $notice_name;
103 my $preref_callback = sub {
104 areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum,
105 emt('Are you sure you want to remove this package from the quotation?'),
106 emt('Remove this package'), #tooltip
107 qq(<img src="${p}images/cross.png">), #link
111 sub areyousure_link {
112 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
113 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';