summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_ApplicationCommon.pm
diff options
context:
space:
mode:
authorjeff <jeff>2010-01-04 04:13:11 +0000
committerjeff <jeff>2010-01-04 04:13:11 +0000
commita5cda9b76146da5c3a2c4f5c706c0b7a093a17ca (patch)
tree1b719767ab887c71f0990c9b6dcb0e49adb7a7d5 /FS/FS/cust_bill_ApplicationCommon.pm
parent551eccdc359883b2a78edf8672b4766000876650 (diff)
untested triggering of export on payments, requires config enable (RT5825)
Diffstat (limited to 'FS/FS/cust_bill_ApplicationCommon.pm')
-rw-r--r--FS/FS/cust_bill_ApplicationCommon.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm
index 6a75fe6..6004b6c 100644
--- a/FS/FS/cust_bill_ApplicationCommon.pm
+++ b/FS/FS/cust_bill_ApplicationCommon.pm
@@ -5,6 +5,11 @@ use vars qw( @ISA $DEBUG $me $skip_apply_to_lineitems_hack );
use List::Util qw(min);
use FS::Schema qw( dbdef );
use FS::Record qw( qsearch qsearchs dbh );
+use FS::cust_pkg;
+use FS::cust_svc;
+use FS::cust_bill_pkg;
+use FS::part_svc;
+use FS::part_export;
@ISA = qw( FS::Record );
@@ -402,6 +407,30 @@ sub apply_to_lineitems {
$dbh->rollback if $oldAutoCommit;
return $error;
}
+
+ # trigger export_insert_on_payment
+ if ( $conf->exists('trigger_export_insert_on_payment')
+ && $cust_bill_pkg->pkgnum > 0 )
+ {
+ if ( my $cust_pkg = $cust_bill_pkg->cust_pkg ) {
+
+ foreach my $cust_svc ( $cust_pkg->cust_svc ) {
+ my $svc_x = $cust_svc->svc_x;
+ my @part_export = grep { $_->can('export_insert_on_payment') }
+ $cust_svc->part_svc->part_export;
+
+ foreach my $part_export ( $cust_svc->part_svc->part_export ) {
+ $error = $part_export->export_insert_on_payment($svc_x);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+ }
+ }
+ # done trigger export_insert_on_payment
+
}
#everything should always be applied to line items in full now... sanity check