From d5005d2e29391ef9f5498626ccec4281f6a850c3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 6 Feb 2004 01:00:45 +0000 Subject: add "Net 0" invoice_default_terms --- FS/FS/Conf.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index ec1bf5574..99eee18ea 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -502,7 +502,7 @@ httemplate/docs/config.html 'section' => 'billing', 'description' => 'Optional default invoice term, used to calculate a due date printed on invoices.', 'type' => 'select', - 'select_enum' => [ '', 'Payable upon receipt', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ], + 'select_enum' => [ '', 'Payable upon receipt', 'Net 0', 'Net 10', 'Net 15', 'Net 30', 'Net 45', 'Net 60' ], }, { -- cgit v1.2.1 From aecf44ec9118946eebe551fc7144a1d0dcff8de5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 7 Feb 2004 08:24:03 +0000 Subject: add ignore_accounting flag to sqlradius and sqlradius_withdomain exports --- FS/FS/cust_svc.pm | 4 ++++ FS/FS/part_export.pm | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index ce2b969f9..b74cfd685 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -367,6 +367,8 @@ sub seconds_since_sqlradacct { my $seconds = 0; foreach my $part_export ( @part_export ) { + next if $part_export->option('ignore_accounting'); + my $dbh = DBI->connect( map { $part_export->option($_) } qw(datasrc username password) ) or die "can't connect to sqlradius database: ". $DBI::errstr; @@ -483,6 +485,8 @@ sub attribute_since_sqlradacct { foreach my $part_export ( @part_export ) { + next if $part_export->option('ignore_accounting'); + my $dbh = DBI->connect( map { $part_export->option($_) } qw(datasrc username password) ) or die "can't connect to sqlradius database: ". $DBI::errstr; diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index a27213773..16f91eb6e 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -698,12 +698,20 @@ tie my %sqlradius_options, 'Tie::IxHash', 'datasrc' => { label=>'DBI data source ' }, 'username' => { label=>'Database username' }, 'password' => { label=>'Database password' }, + 'ignore_accounting' => { + type => 'checkbox', + label=>'Ignore accounting records from this database' + }, ; tie my %sqlradius_withdomain_options, 'Tie::IxHash', 'datasrc' => { label=>'DBI data source ' }, 'username' => { label=>'Database username' }, 'password' => { label=>'Database password' }, + 'ignore_accounting' => { + type => 'checkbox', + label=>'Ignore accounting records from this database' + }, ; tie my %cyrus_options, 'Tie::IxHash', -- cgit v1.2.1 From 69b7034bf2f9605c394c4ee22aaed4d7873c1a84 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 7 Feb 2004 22:13:19 +0000 Subject: add link to FreeBSD patch for pw(1) problem --- FS/FS/part_export.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 16f91eb6e..033840aeb 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -935,7 +935,7 @@ tie my %forward_shellcommands_options, 'Tie::IxHash', 'desc' => 'Real-time export via remote SSH (i.e. useradd, userdel, etc.)', 'options' => \%shellcommands_options, 'nodomain' => 'Y', - 'notes' => 'Run remote commands via SSH. Usernames are considered unique (also see shellcommands_withdomain). You probably want this if the commands you are running will not accept a domain as a parameter. You will need to setup SSH for unattended operation.

Use these buttons for some useful presets:
  • Note: On FreeBSD, due to deficient locking in pw(1), you must disable the chpass(1), chsh(1), chfn(1), passwd(1), and vipw(1) commands, or replace them with wrappers that prepend "lockf /etc/passwd.lock".
The following variables are available for interpolation (prefixed with new_ or old_ for replace operations):
  • $username
  • $_password
  • $quoted_password - unencrypted password quoted for the shell
  • $crypt_password - encrypted password
  • $uid
  • $gid
  • $finger - GECOS, already quoted for the shell (do not add additional quotes)
  • $dir - home directory
  • $shell
  • $quota
  • All other fields in svc_acct are also available.
', + 'notes' => 'Run remote commands via SSH. Usernames are considered unique (also see shellcommands_withdomain). You probably want this if the commands you are running will not accept a domain as a parameter. You will need to setup SSH for unattended operation.

Use these buttons for some useful presets:
  • Note: On FreeBSD, due to deficient locking in pw(1), you must disable the chpass(1), chsh(1), chfn(1), passwd(1), and vipw(1) commands, or replace them with wrappers that prepend "lockf /etc/passwd.lock". Alternatively, apply the patch in FreeBSD PR#23501 and remove the "lockf /etc/passwd.lock" from these default commands.
The following variables are available for interpolation (prefixed with new_ or old_ for replace operations):
  • $username
  • $_password
  • $quoted_password - unencrypted password quoted for the shell
  • $crypt_password - encrypted password
  • $uid
  • $gid
  • $finger - GECOS, already quoted for the shell (do not add additional quotes)
  • $dir - home directory
  • $shell
  • $quota
  • All other fields in svc_acct are also available.
', }, 'shellcommands_withdomain' => { -- cgit v1.2.1 From f4ffa3596c3b8bfc9e862c2a7e8efc68f86207ab Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 12 Feb 2004 06:31:37 +0000 Subject: re-email invoice, closes: bug#526 and have print and email invoice links redirect back to top of customer view page instead of #history tag --- htetc/global.asa | 1 + htetc/handler.pl | 1 + httemplate/misc/email-invoice.cgi | 23 +++++++++++++++++++++++ httemplate/misc/print-invoice.cgi | 2 +- httemplate/view/cust_bill.cgi | 8 +++++++- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100755 httemplate/misc/email-invoice.cgi diff --git a/htetc/global.asa b/htetc/global.asa index e05701d56..e4661c3cb 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -22,6 +22,7 @@ use FS::Conf; use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot small_custview myexit http_header); use FS::Msgcat qw(gettext geterror); +use FS::Misc qw( send_email ); use FS::agent; use FS::agent_type; diff --git a/htetc/handler.pl b/htetc/handler.pl index 584d930b1..618c5856f 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -80,6 +80,7 @@ sub handler use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot small_custview myexit http_header); use FS::Msgcat qw(gettext geterror); + use FS::Misc qw( send_email ); use FS::agent; use FS::agent_type; diff --git a/httemplate/misc/email-invoice.cgi b/httemplate/misc/email-invoice.cgi new file mode 100755 index 000000000..7ab1613ee --- /dev/null +++ b/httemplate/misc/email-invoice.cgi @@ -0,0 +1,23 @@ +<% + +my $conf = new FS::Conf; + +#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 = send_email( + 'from' => $conf->config('invoice_from'), + 'to' => [ grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ], + 'subject' => 'Invoice', + 'body' => [ $cust_bill->print_text ], +); +eidiot($error) if $error; + +my $custnum = $cust_bill->getfield('custnum'); +print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); + +%> diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi index 0dda68a4e..144f6156a 100755 --- a/httemplate/misc/print-invoice.cgi +++ b/httemplate/misc/print-invoice.cgi @@ -24,6 +24,6 @@ die "Can't find invoice!\n" unless $cust_bill; my $custnum = $cust_bill->getfield('custnum'); -print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history"); +print $cgi->redirect("${p}view/cust_main.cgi?$custnum"); %> diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 4d98f3ebc..50ee8b36c 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -20,7 +20,13 @@ print header('Invoice View', menubar( print qq!Enter payments (check/cash) against this invoice | ! if $cust_bill->owed > 0; -print qq!Reprint this invoice!. '

'; +print qq!Reprint this invoice!; +if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { + print qq! | !. + qq!Re-email this invoice!; +} + +print '

'; my $conf = new FS::Conf; if ( $conf->exists('invoice_latex') ) { -- cgit v1.2.1