diff options
author | khoff <khoff> | 2005-03-21 22:13:39 +0000 |
---|---|---|
committer | khoff <khoff> | 2005-03-21 22:13:39 +0000 |
commit | 18c025613fa052cf4ba8d484f1296cc2a1719a24 (patch) | |
tree | 334919583d3ecdd78413ad7405b6092e62f614ad /httemplate | |
parent | 30189fa2e5987bafeb4714a83b7f130c568b221c (diff) |
Added support for FAX invoice destinations using a HylaFAX server.
Faxing plain text invoices is not supported.
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/docs/install.html | 1 | ||||
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 7 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 1 | ||||
-rwxr-xr-x | httemplate/misc/fax-invoice.cgi | 25 | ||||
-rwxr-xr-x | httemplate/view/cust_bill.cgi | 6 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 8 | ||||
-rw-r--r-- | httemplate/view/cust_main/tickets.html | 2 |
7 files changed, 45 insertions, 5 deletions
diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index eaebcde2b..10c51e77d 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -68,6 +68,7 @@ Before installing, you need: <li><a href="http://search.cpan.org/dist/Frontier-RPC">Frontier::RPC (Frontier::RPC2)</a> <li><a href="http://search.cpan.org/search?mode=module&query=MIME::Entity">MIME::Entity (MIME-tools)</a> <!-- <li><a href="http://search.cpan.org/dist/Crypt-YAPassGen">Crypt::YAPassGen</a> --> + <li><a href="http://search.cpan.org/search?mode=module&query=MIME::Entity">Fax::Hylafax::Client</a> <i>(Required if using FAX invoice destinations</i> <li><a href="http://search.cpan.org/dist/ApacheDBI">Apache::DBI</a> <i>(optional but recommended for better webinterface performance)</i> </ul> </ul> diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 3910b4b84..61468f382 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -302,8 +302,11 @@ if ( $payby_default eq 'HIDE' ) { print qq! CHECKED! if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') ) || grep { $_ eq 'POST' } @invoicing_list; - print qq!>Postal mail invoice</TD></TR>!; - my $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list ); + print qq!>Postal mail invoice</TD></TR><TR><TD>!; + print qq!<INPUT TYPE="checkbox" NAME="invoicing_list_FAX" VALUE="FAX"!; + print qq! CHECKED! if (grep { $_ eq 'FAX' } @invoicing_list); + print qq!>FAX invoice</TD></TR>!; + my $invoicing_list = join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ); print qq!<TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="$invoicing_list"></TD></TR>!; print "<TR><TD>Billing type</TD></TR>", diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index a1d36986d..d2773a60e 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -25,6 +25,7 @@ if ( $payby ) { my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); +push @invoicing_list, 'FAX' if $cgi->param('invoicing_list_FAX'); $cgi->param('invoicing_list', join(',', @invoicing_list) ); diff --git a/httemplate/misc/fax-invoice.cgi b/httemplate/misc/fax-invoice.cgi new file mode 100755 index 000000000..46b2a1721 --- /dev/null +++ b/httemplate/misc/fax-invoice.cgi @@ -0,0 +1,25 @@ +<% + +my $conf = new FS::Conf; +my $lpr = $conf->config('lpr'); + +#untaint invnum +my($query) = $cgi->keywords; +$query =~ /^(\d*)$/; +my $invnum = $1; +my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); +die "Can't find invoice!\n" unless $cust_bill; + + +my $error = &FS::Misc::send_fax( + dialstring => $cust_bill->cust_main->getfield('fax'), + docdata => [ $cust_bill->print_ps ], +); + +die $error if $error; + +my $custnum = $cust_bill->getfield('custnum'); + +print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); + +%> diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index ca0612d09..c217cc389 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -7,6 +7,8 @@ $query =~ /^((.+)-)?(\d+)$/; my $templatename = $2; my $invnum = $3; +my $conf = new FS::Conf; + my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Invoice #$invnum not found!" unless $cust_bill; my $custnum = $cust_bill->getfield('custnum'); @@ -27,9 +29,11 @@ if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { qq!Re-email this invoice</A>!; } +print qq! | <A HREF="${p}misc/fax-invoice.cgi?$invnum">Refax this invoice</A>! + if ($conf->exists('hylafax')); + print '<BR><BR>'; -my $conf = new FS::Conf; if ( $conf->exists('invoice_latex') ) { my $link = "${p}view/cust_bill-pdf.cgi?"; $link .= "$templatename-" if $templatename; diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 18a203bd6..561fff992 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -17,9 +17,15 @@ Billing information </TD> </TR> <TR> + <TD ALIGN="right">FAX invoices</TD> + <TD BGCOLOR="#ffffff"> + <%= ( grep { $_ eq 'FAX' } @invoicing_list ) ? 'yes' : 'no' %> + </TD> +</TR> +<TR> <TD ALIGN="right">Email invoices</TD> <TD BGCOLOR="#ffffff"> - <%= join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no' %> + <%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %> </TD> </TR> <TR> diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index d6ddfa64c..ea70d701d 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -30,7 +30,7 @@ Highest priority tickets (<A HREF="<%= FS::TicketSystem->href_customer_tickets($cust_main->custnum) %>">View all tickets for this customer</A>) -(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main->custnum, join(', ', grep { $_ ne 'POST' } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) +(<A HREF="<%= FS::TicketSystem->href_new_ticket($cust_main->custnum, join(', ', grep { $_ !~ /^(POST|FAX)$/ } $cust_main->invoicing_list ) ) %>">New ticket for this customer</A>) <%= table() %> <TR> <TH>#</TH> |