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 )
22 % if ( $curuser->access_right('One-time charge') ) {
23 | <& /elements/one_time_charge_link.html,
24 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
29 % if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
31 <& /elements/popup_link.html,
32 'action' => "${p}misc/email-quotation.html".
33 "?quotationnum=$quotationnum",
34 'label' => emt('Email this quotation'),
35 'actionlabel' => emt('Select recipients'),
40 %# <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
42 %#% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
43 %# | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
48 % if ( $conf->exists('quotation_latex') ) {
49 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
54 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
55 <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
61 % if ( $curuser->access_right('Disable quotation') ) {
62 % if ( $quotation->disabled eq 'Y' ) {
63 <A HREF="<%$p%>misc/enable-quotation.html?quotationnum=<% $quotation->quotationnum %>" TITLE="<% emt('Enable this quotation') %>"><% emt('Enable this quotation') %></A>
66 "${p}misc/disable-quotation.html?quotationnum=". $quotation->quotationnum,
67 emt('Are you sure you want to disable this quotation?'),
68 emt('Disable this quotation'), #tooltip
69 emt('Disable this quotation'), #link
76 <DIV CLASS="error"><% emt('Error calculating quotation: [_1]', $error) %></DIV>
79 % if ( $conf->exists('quotation_html') ) {
80 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
82 % die "quotation_html config missing";
84 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
86 <& /elements/footer.html &>
89 my $curuser = $FS::CurrentUser::CurrentUser;
92 # unless $curuser->access_right('View quotations');
94 my $can_generate_quotation = $curuser->access_right('Generate quotation');
97 my($query) = $cgi->keywords;
98 if ( $query =~ /^(\d+)$/ ) {
101 $quotationnum = $cgi->param('quotationnum');
104 my $conf = new FS::Conf;
106 my $quotation = qsearchs({
107 'select' => 'quotation.*',
108 'table' => 'quotation',
109 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
110 'hashref' => { 'quotationnum' => $quotationnum },
111 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
113 die "Quotation #$quotationnum not found!" unless $quotation;
115 my $error = $quotation->estimate;
117 my $menubar = menubar( $quotation->cust_or_prospect_label_link($p) );
119 my $link = "quotationnum=$quotationnum";
120 #$link .= ';template='. uri_escape($template) if $template;
121 #$link .= ';notice_name='. $notice_name if $notice_name;
123 my $preref_callback = sub {
124 my $quotation_pkg = shift;
125 $can_generate_quotation ?
126 areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum,
127 emt('Are you sure you want to remove this package from the quotation?'),
128 emt('Remove this package'), #tooltip
129 qq(<img src="${p}images/cross.png">), #link
131 include('/elements/popup_link.html',
132 action => "${p}edit/quotation_pkg_detail.html?pkgnum=" .
133 $quotation_pkg->quotationpkgnum,
134 html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">),
135 title => emt('Edit quotation details'),
136 actionlabel => emt('Edit quotation details'),
143 sub areyousure_link {
144 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
145 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';