[freeside-commits] branch FREESIDE_3_BRANCH updated. 64913975f8f1344e76ee97af2893dd8a1296fcd5
Christopher Burger
burgerc at freeside.biz
Tue Apr 3 11:54:11 PDT 2018
The branch, FREESIDE_3_BRANCH has been updated
via 64913975f8f1344e76ee97af2893dd8a1296fcd5 (commit)
from a140ffb44cd6ce9f5346e337eac68a4f874b7675 (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 64913975f8f1344e76ee97af2893dd8a1296fcd5
Author: Christopher Burger <burgerc at freeside.biz>
Date: Tue Apr 3 12:04:43 2018 -0400
RT 37817 - created new billing event condition, invoice has not been sent.
diff --git a/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm b/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm
new file mode 100644
index 000000000..882762dfe
--- /dev/null
+++ b/FS/FS/part_event/Condition/invoice_has_not_been_sent.pm
@@ -0,0 +1,41 @@
+package FS::part_event::Condition::invoice_has_not_been_sent;
+
+use strict;
+use FS::Record qw( qsearchs );
+use FS::cust_bill;
+use Time::Local 'timelocal';
+
+use base qw( FS::part_event::Condition );
+
+sub description {
+ 'Invoice has not been sent previously';
+}
+
+sub eventtable_hashref {
+ { 'cust_main' => 0,
+ 'cust_bill' => 1,
+ 'cust_pkg' => 0,
+ };
+}
+
+sub condition {
+ my($self, $cust_bill, %opt) = @_;
+
+ my $event = qsearchs( {
+ 'table' => 'cust_event',
+ 'addl_from' => 'LEFT JOIN part_event USING ( eventpart )',
+ 'hashref' => {
+ 'tablenum' => $cust_bill->{Hash}->{invnum},
+ 'eventtable' => 'cust_bill',
+ 'status' => 'done',
+ },
+ 'order_by' => " LIMIT 1",
+ } );
+
+ return 0 if $event;
+
+ 1;
+
+}
+
+1;
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
.../Condition/invoice_has_not_been_sent.pm | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 FS/FS/part_event/Condition/invoice_has_not_been_sent.pm
More information about the freeside-commits
mailing list