Revision: 2194
http://astpp.svn.sourceforge.net/astpp/?rev=2194&view=rev
Author: darrenkw
Date: 2008-09-02 05:15:21 +0000 (Tue, 02 Sep 2008)
Log Message:
-----------
Split the invoice generation code off of astpp-update-balance.pl.
Modified Paths:
--------------
trunk/astpp-update-balance.pl
Modified: trunk/astpp-update-balance.pl
===================================================================
--- trunk/astpp-update-balance.pl 2008-09-02 05:09:49 UTC (rev 2193)
+++ trunk/astpp-update-balance.pl 2008-09-02 05:15:21 UTC (rev 2194)
@@ -215,74 +215,5 @@
}
}
}
-
-### Deal with external billing. This will create the appropriate invoices in the external apps.
-if ( $config->{externalbill} eq "oscommerce" ) {
- my @cardlist;
- if ( $params->{sweep} ) {
- @cardlist = &update_list_cards( $astpp_db, $config, $params->{sweep} );
- }
- foreach (@cardlist) {
- my $cardno = $_;
- my $carddata = &get_account( $astpp_db, $cardno );
- if ( $carddata->{posttoexternal} == 1 ) {
- foreach my $handle (@output) {
- print $handle "Card: $cardno \n";
- }
- &osc_charges( $astpp_db, $osc_db, $config, $cardno );
- }
- }
-}
-elsif ( $config->{externalbill} eq "agile" ) {
- my @cardlist = &list_cards($astpp_db);
- foreach my $cardno (@cardlist) {
- my $carddata = &get_account( $astpp_db, $cardno );
- if ( $carddata->{posttoexternal} == 1 ) {
- my @recordlist = &get_charges( $astpp_db, $config, $cardno );
- foreach my $record (@recordlist) {
- my $cdrinfo = &get_charge($record);
- my $cost;
- if ( $cdrinfo->{debit} ne "" ) {
- $cost = $cdrinfo->{debit};
- }
- else {
- $cost = $cdrinfo->{credit} * -1;
- }
- &agilesavecdr(
- $agile_db, $astpp_db,
- $config,
- @output, $carddata,
- $cost, $config->{agile_site_id},
- $cdrinfo, $config->{agile_dbprefix}
- );
- }
- }
- }
-}
-elsif ( $config->{externalbill} eq "optigold" ) {
- my @cardlist = &list_cards($astpp_db);
- foreach my $cardno (@cardlist) {
- my $carddata = &get_account( $astpp_db, $cardno );
- if ( $carddata->{posttoexternal} == 1 ) {
- my @recordlist = &get_charges( $astpp_db, $config, $cardno );
- foreach my $record (@recordlist) {
- my $cdrinfo = &get_charge($record);
- my $cost;
- if ( $cdrinfo->{debit} ne "" ) {
- $cost = $cdrinfo->{debit};
- }
- else {
- $cost = $cdrinfo->{credit} * -1;
- }
- &ogsavecdr(
- $carddata->{number}, $cdrinfo->{disposition},
- $cdrinfo->{calldate}, $cdrinfo->{dst},
- $cdrinfo->{billsec}, $cost,
- $cdrinfo->{src}
- );
- }
- }
- }
-}
&shutdown;
exit(0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|