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>
47 % if ( $conf->exists('quotation_html') ) {
48 <% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
50 % die "quotation_html config missing";
52 % #plaintext quotations? <PRE><% join('', $quotation->print_text() ) %></PRE>
54 <& /elements/footer.html &>
57 my $curuser = $FS::CurrentUser::CurrentUser;
60 # unless $curuser->access_right('View quotations');
63 my($query) = $cgi->keywords;
64 if ( $query =~ /^(\d+)$/ ) {
67 $quotationnum = $cgi->param('quotationnum');
70 my $conf = new FS::Conf;
72 my $quotation = qsearchs({
73 'select' => 'quotation.*',
74 'table' => 'quotation',
75 #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
76 'hashref' => { 'quotationnum' => $quotationnum },
77 #'extra_sql' => ' AND '. $curuser->agentnums_sql,
79 die "Quotation #$quotationnum not found!" unless $quotation;
82 if ( my $custnum = $quotation->custnum ) {
83 my $display_custnum = $quotation->cust_main->display_custnum;
85 emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
87 } elsif ( my $prospectnum = $quotation->prospectnum ) {
89 emt("View this prospect (#[_1])",$prospectnum) => "${p}view/prospect_main.html?$prospectnum",
93 my $link = "quotationnum=$quotationnum";
94 #$link .= ';template='. uri_escape($template) if $template;
95 #$link .= ';notice_name='. $notice_name if $notice_name;
97 my $preref_callback = sub {
98 areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum,
99 emt('Are you sure you want to remove this package from the quotation?'),
100 emt('Remove this package'), #tooltip
101 qq(<img src="${p}images/cross.png">), #link
105 sub areyousure_link {
106 my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
107 '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';