From: ivan Date: Tue, 25 Sep 2001 18:01:19 +0000 (+0000) Subject: add emailinvoiceonly config file and begin to use it X-Git-Tag: freeside_1_4_0pre11~314 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=7edc02d950670623975f77c3037d4b9bb1af428a;p=freeside.git add emailinvoiceonly config file and begin to use it --- diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index d66d08cb9..2d94bbe59 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1151,6 +1151,13 @@ sub collect { $payname = "$payfirst $paylast"; } + my @invoicing_list = grep { $_ ne 'POST' } $self->invoicing_list; + if ( $conf->config('emailinvoiceonly') ) { + @invoicing_list = $self->default_invoicing_list + unless @invoicing_list; + } + my $email = $invoicing_list[0]; + my( $action1, $action2 ) = split(/\s*\,\s*/, $bop_action ); my $transaction = @@ -1175,6 +1182,7 @@ sub collect { 'card_number' => $self->payinfo, 'expiration' => $exp, 'referer' => 'http://cleanwhisker.420.am/', + 'email' => $email, ); $transaction->submit(); @@ -1529,6 +1537,24 @@ sub check_invoicing_list { ''; } +=item default_invoicing_list + +=cut + +sub default_invoicing_list { + my $self = shift; + my @list = (); + foreach my $cust_pkg ( $self->all_pkgs ) { + my @cust_svc = qsearch('cust_svc', { 'pkgnum' => $cust_pkg->pkgnum } ); + my @svc_acct = + map { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) } + grep { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) } + @cust_svc; + push @list, map { $_->email } @svc_acct; + } + $self->invoicing_list(\@list); +} + =item referral_cust_main [ DEPTH [ EXCLUDE_HASHREF ] ] Returns an array of customers referred by this customer (referral_custnum set @@ -1698,7 +1724,7 @@ sub append_fuzzyfiles { =head1 VERSION -$Id: cust_main.pm,v 1.35 2001-09-25 15:55:48 ivan Exp $ +$Id: cust_main.pm,v 1.36 2001-09-25 18:01:19 ivan Exp $ =head1 BUGS diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html index 0e085b0fe..2254b32ca 100644 --- a/httemplate/docs/config.html +++ b/httemplate/docs/config.html @@ -53,6 +53,7 @@ All further configuration files and directories are located in
  • disable_customer_referrals - The existance of this file will disable new customer-to-customer referrals in the web interface.
  • domain - Your domain name.
  • editreferrals - The existance of this file will allow you to change the referral of existing customers. +
  • emailinvoiceonly
  • erpcdmachines - Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'.
  • hidecancelledpackages - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)
  • hidecancelledcustomers - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)