[freeside-commits] branch FREESIDE_4_BRANCH updated. 31d0df02bc7a1a21b9a9489488c8e19a5d485c65

Christopher Burger burgerc at 420.am
Thu Aug 3 12:54:39 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  31d0df02bc7a1a21b9a9489488c8e19a5d485c65 (commit)
       via  55a8560e2ef2c42d11460d882d2751f0bcad3d6f (commit)
      from  47d5b84429c2872b2f2fafb261c75f2f40500e86 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 31d0df02bc7a1a21b9a9489488c8e19a5d485c65
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Aug 3 15:18:35 2017 -0400

    RT# 75595 - made it only available for cust_pkg

diff --git a/FS/FS/part_event/Condition/pkg_contract_date.pm b/FS/FS/part_event/Condition/pkg_contract_date.pm
index 2bf791a..9cb75f6 100644
--- a/FS/FS/part_event/Condition/pkg_contract_date.pm
+++ b/FS/FS/part_event/Condition/pkg_contract_date.pm
@@ -8,12 +8,8 @@ sub description {
 }
 
 sub eventtable_hashref {
-    { 'cust_main'      => 1,
-      'cust_bill'      => 1,
+    {
       'cust_pkg'       => 1,
-      'cust_pay'       => 1,
-      'cust_pay_batch' => 1,
-      'cust_statement' => 1,
     };
 }
 

commit 55a8560e2ef2c42d11460d882d2751f0bcad3d6f
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Aug 1 10:33:45 2017 -0400

    RT# 75595 - Add billing event condition that will trigger when the contract end date is coming up

diff --git a/FS/FS/part_event/Condition/pkg_contract_date.pm b/FS/FS/part_event/Condition/pkg_contract_date.pm
new file mode 100644
index 0000000..2bf791a
--- /dev/null
+++ b/FS/FS/part_event/Condition/pkg_contract_date.pm
@@ -0,0 +1,38 @@
+package FS::part_event::Condition::pkg_contract_date;
+use base qw( FS::part_event::Condition );
+
+use strict;
+
+sub description {
+  'Package contract date nearing';
+}
+
+sub eventtable_hashref {
+    { 'cust_main'      => 1,
+      'cust_bill'      => 1,
+      'cust_pkg'       => 1,
+      'cust_pay'       => 1,
+      'cust_pay_batch' => 1,
+      'cust_statement' => 1,
+    };
+}
+
+sub option_fields {
+  my $class = shift;
+  (
+    'within'  =>  { 'label'   => 'Package contract date with in',
+                    'type'    => 'freq',
+                  },
+  );
+}
+
+sub condition {
+  my( $self, $cust_pkg, %opt ) = @_;
+  
+  my $contract_end_date = $cust_pkg->contract_end ? $cust_pkg->contract_end : 0;
+  my $contract_within_time = $self->option_age_from('within', $contract_end_date );
+
+  $opt{'time'} >= $contract_within_time and $contract_within_time > 0;
+}
+
+1;
\ No newline at end of file

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_event/Condition/pkg_contract_date.pm |   34 +++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 FS/FS/part_event/Condition/pkg_contract_date.pm




More information about the freeside-commits mailing list