Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #3445 from gratipay/constrain-masspay
Browse files Browse the repository at this point in the history
constrain payouts via MassPay
  • Loading branch information
rohitpaulk committed May 16, 2015
2 parents 80613e0 + b48db58 commit fdfc35b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bin/masspay.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ def compute_input_csv():
JOIN participants p ON p.id = r.participant
WHERE r.network = 'paypal'
AND p.balance > 0
---- Only include team owners
---- TODO: Include members on payroll once process_payroll is implemented
AND ( SELECT count(*)
FROM teams t
WHERE t.owner = p.username
AND t.is_approved IS TRUE
AND t.is_closed IS NOT TRUE
) > 0
ORDER BY p.balance DESC
""")
Expand Down Expand Up @@ -215,7 +226,7 @@ def post_back_to_gratipay():

nposts = 0
for username, email, gross, fee, net, additional_note in csv.reader(open(GRATIPAY_CSV)):
url = '{}/{}/history/record-an-exchange'.format(gratipay_base_url, username)
url = '{}/~{}/history/record-an-exchange'.format(gratipay_base_url, username)
note = 'PayPal MassPay to {}.'.format(email)
if additional_note:
note += " " + additional_note
Expand Down

0 comments on commit fdfc35b

Please sign in to comment.