<& /elements/header.html, mt('Quotation View'), $menubar &>
+<SCRIPT TYPE="text/javascript">
+function areyousure(href, message) {
+ if (confirm(message) == true)
+ window.location.href = href;
+}
+</SCRIPT>
+
%#XXX link to order...
<%doc>
% }
-XXX view typset quotation
+</%doc>
-% if ( $conf->exists('invoice_latex') ) {
+% if ( $curuser->access_right('Order customer package') ) {
+ <& /elements/order_pkg_link.html,
+ 'label' => emt('Add package'),
+ 'actionlabel' => emt('Add package'),
+ map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
+ &>
+% }
- <A HREF="<% $p %>view/cust_bill-pdf.cgi?<% $link %>"><% mt('View typeset invoice PDF') |h %></A>
- <BR><BR>
-% }
+% if ( $conf->exists('quotation_latex') ) {
+ | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
+% }
-XXX actually show the quotation
+% if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
+ | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
+% }
-% if ( $conf->exists('invoice_html') ) {
- <% join('', $cust_bill->print_html(\%opt) ) %>
-% } else {
- <PRE><% join('', $cust_bill->print_text(\%opt) ) %></PRE>
-% }
+<BR><BR>
-</%doc>
+% if ( $conf->exists('quotation_html') ) {
+ <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
+% } else {
+% die "quotation_html config missing";
+% }
+% #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
<& /elements/footer.html &>
<%init>
$quotationnum = $cgi->param('quotationnum');
}
-#my $conf = new FS::Conf;
+my $conf = new FS::Conf;
my $quotation = qsearchs({
'select' => 'quotation.*',
});
die "Quotation #$quotationnum not found!" unless $quotation;
+my $menubar;
if ( my $custnum = $quotation->custnum ) {
my $display_custnum = $quotation->cust_main->display_custnum;
$menubar = menubar(
);
}
+my $link = "quotationnum=$quotationnum";
+#$link .= ';template='. uri_escape($template) if $template;
+#$link .= ';notice_name='. $notice_name if $notice_name;
+
+my $preref_callback = sub {
+ areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum,
+ emt('Are you sure you want to remove this package from the quotation?'),
+ emt('Remove this package'), #tooltip
+ qq(<img src="${p}images/cross.png">), #link
+ );
+};
+
+sub areyousure_link {
+ my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
+ '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';
+}
+
</%init>