|
@@ -1,4 +1,22 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
+"""
|
|
|
+Import payments from a CSV file from a bank. The payments will automatically be
|
|
|
+parsed, and there'll be an attempt to automatically match payments with members.
|
|
|
+
|
|
|
+The matching is performed using the label of the payment.
|
|
|
+- First, try to find a string such as 'ID-42' where 42 is the member's ID
|
|
|
+- Second (if no ID found), try to find a member username (with no ambiguity with
|
|
|
+ respect to other usernames)
|
|
|
+- Third (if no username found), try to find a member family name (with no
|
|
|
+ ambiguity with respect to other family name)
|
|
|
+
|
|
|
+This script will check if a payment has already been registered with same
|
|
|
+properies (date, label, price) to avoid creating duplicate payments inside coin.
|
|
|
+
|
|
|
+By default, only a dry-run is perfomed to let you see what will happen ! You
|
|
|
+should run this command with --commit if you agree with the dry-run.
|
|
|
+"""
|
|
|
+
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
# Standard python libs
|
|
@@ -30,26 +48,9 @@ ID_REGEX=r"(?i)(\b|_)ID[\s\-\_\/]*(\d+)(\b|_)"
|
|
|
# matched to a member when importing it.
|
|
|
KEYWORDS_TO_NOTMATCH=[ "DON", "MECENAT", "REM CHQ" ]
|
|
|
|
|
|
-
|
|
|
-
|
|
|
class Command(BaseCommand):
|
|
|
|
|
|
- help = """
|
|
|
-Import payments from a CSV file from a bank. The payments will automatically be
|
|
|
-parsed, and there'll be an attempt to automatically match payments with members.
|
|
|
-
|
|
|
-The matching is performed using the label of the payment.
|
|
|
-- First, try to find a string such as 'ID-42' where 42 is the member's ID
|
|
|
-- Second (if no ID found), try to find a member username (with no ambiguity with
|
|
|
- respect to other usernames)
|
|
|
-- Third (if no username found), try to find a member family name (with no
|
|
|
- ambiguity with respect to other family name)
|
|
|
-
|
|
|
-This script will check if a payment has already been registered with same
|
|
|
-properies (date, label, price) to avoid creating duplicate payments inside coin.
|
|
|
-
|
|
|
-By default, only a dry-run is perfomed to let you see what will happen ! You
|
|
|
-should run this command with --commit if you agree with the dry-run."""
|
|
|
+ help = __doc__
|
|
|
|
|
|
def create_parser(self, *args, **kwargs):
|
|
|
parser = super(Command, self).create_parser(*args, **kwargs)
|