summaryrefslogtreecommitdiff
path: root/bin/payment_received-event
blob: 9e809a519339f2e06851a3d833e941818e7cbbc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

use strict;
use FS::UID qw( adminsuidsetup );
use FS::Record qw( qsearchs );
use FS::cust_pay;
use FS::part_event;

my $eventpart = 3; #dev server

adminsuidsetup shift or die &usage;

my $cust_pay = qsearchs('cust_pay', { 'paynum' => shift } )
  or die "Unknown paynum\n";

my $part_event = qsearchs('part_event', { 'eventpart' => $eventpart } )
  or die "unknown eventnum $eventpart\n";

my $cust_event = $part_event->new_cust_event($cust_pay);

my $error = $cust_event->do_event();
if ( $error ) {
  warn "$error\n";
} else {
  warn $part_event->event. " event run\n";
}

sub usage {
  "Usage:\n\npayment_received-event employee_username paynum\n";
}

1;