Find only entries that gave a year later.
This commit is contained in:
parent
d72431cdce
commit
93d048a3fd
1 changed files with 5 additions and 1 deletions
|
@ -35,7 +35,11 @@ foreach my $id (@supporterIds) {
|
|||
my $amount = $sp->donorTotalGaveInPeriod(donorId => $id);
|
||||
my $lastGaveDate = $sp->donorLastGave($id);
|
||||
my $firstGaveDate = $sp->donorFirstGave($id);
|
||||
if ($amount > 180.00 and $lastGaveDate ne $firstGaveDate and $firstGaveDate le $ONE_YEAR_AGO) { # Ok, so they gave more than the minimum a year later
|
||||
my $oneYearSinceFirstGave = UnixDate(DateCalc(ParseDate($firstGaveDate), "+ 1 year"), '%Y-%m-%d');
|
||||
if ($amount > 180.00 and
|
||||
$lastGaveDate ne $firstGaveDate and
|
||||
$firstGaveDate le $ONE_YEAR_AGO and
|
||||
$lastGaveDate ge $oneYearSinceFirstGave ) {
|
||||
my $ledgerEntityId = $sp->getLedgerEntityId($id);
|
||||
my $type = $sp->{ledgerData}{$ledgerEntityId}{__TYPE__};
|
||||
my $shirt1 = $sp->getRequest({ donorId => $id, requestType => 't-shirt-1' });
|
||||
|
|
Loading…
Reference in a new issue