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 %#XXX link to order...
14 XXX resending quotations
16 % if ( $curuser->access_right('Resend invoices') ) {
18 <A HREF="<% $p %>misc/send-invoice.cgi?method=print;<% $link %>"><% mt('Re-print this invoice') |h %></A>
20 % if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
21 | <A HREF="<% $p %>misc/send-invoice.cgi?method=email;<% $link %>"><% mt('Re-email this invoice') |h %></A>
24 % if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
25 | <A HREF="<% $p %>misc/send-invoice.cgi?method=fax;<% $link %>"><% mt('Re-fax this invoice') |h %></A>
34 % if ( $curuser->access_right('Order customer package') ) {
35 <& /elements/order_pkg_link.html,
36 'label' => emt('Add package'),
37 'actionlabel' => emt('Add package'),
38 map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
42 % if ( $conf->exists('quotation_latex') ) {
43 | <A HREF="<% $p %>view/quotation-pdf.cgi?<% $link %>"><% mt('View typeset quotation PDF') |h %></A>
46 % if ( $curuser->access_right('New customer') && $quotation->quotation_pkg ) {
47 | <A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Place order</A>
52 % if ( $conf->exists('quotation_html') ) {
53 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
55 % die "quotation_html config missing";
57 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
59 <& /elements/footer.html &>
62 my $curuser = $FS::CurrentUser::CurrentUser;
65 # unless $curuser->access_right('View quotations');
68 my($query) = $cgi->keywords;
69 if ( $query =~ /^(\d+)$/ ) {
72 $quotationnum = $cgi->param('quotationnum');
75 my $conf = new FS::Conf;
77 my $quotation = qsearchs({
78 'select' => 'quotation.*',
79 'table' => 'quotation',
80 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
81 'hashref' => { 'quotationnum' => $quotationnum },
82 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
84 die "Quotation #$quotationnum not found!" unless $quotation;
87 if ( my $custnum = $quotation->custnum ) {
88 my $display_custnum = $quotation->cust_main->display_custnum;
90 emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
92 } elsif ( my $prospectnum = $quotation->prospectnum ) {
94 emt("View this prospect (#[_1])",$prospectnum) => "${p}view/prospect_main.html?$prospectnum",
98 my $link = "quotationnum=$quotationnum";
99 #$link .= ';template='. uri_escape($template) if $template;
100 #$link .= ';notice_name='. $notice_name if $notice_name;
102 my $preref_callback = sub {
103 areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum,
104 emt('Are you sure you want to remove this package from the quotation?'),
105 emt('Remove this package'), #tooltip
106 qq(<img src="${p}images/cross.png">), #link
110 sub areyousure_link {
111 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
112 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';