Skip to content

Commit

Permalink
http://luc.lino-framework.org/blog/2015/1016.html
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaffre committed Oct 16, 2015
1 parent 0a0339a commit 80f7e7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lino_cosi/lib/sepa/models.py
Expand Up @@ -121,7 +121,6 @@ def import_file(self, ar, filename):
currency_code=_statement['currency_code'])
s.save()
for _movement in _statement['transactions']:
assert _movement.remote_account == account.iban
# TODO :check if the movement is already imported.
if Movement.objects.filter(
unique_import_id=_movement['unique_import_id']).exists():
Expand All @@ -133,7 +132,8 @@ def import_file(self, ar, filename):
amount=_movement['amount'],
partner_name=_movement.remote_owner,
ref=_ref,
bank_account=account)
remote_account=_movement.remote_account,
remote_bic=_movement.remote_bank_bic)
m.save()
num += 1

Expand Down Expand Up @@ -275,7 +275,8 @@ class Meta:
amount = dd.PriceField(_('Amount'), null=True)
partner = models.ForeignKey('contacts.Partner', related_name='sepa_movement', null=True)
partner_name = models.CharField(_('Partner name'), max_length=35)
bank_account = dd.ForeignKey('sepa.Account', blank=True, null=True)
remote_account = IBANField(verbose_name=_("IBAN"))
remote_bic = BICField(verbose_name=_("BIC"), blank=True)
ref = models.CharField(_('Ref'), null=False, max_length=35)


Expand Down
2 changes: 1 addition & 1 deletion lino_cosi/lib/sepa/ui.py
Expand Up @@ -103,5 +103,5 @@ class Movements(dd.Table):
class MovementsByStatement(Movements):
required_roles = dd.login_required(SepaUser)
master_key = 'statement'
column_names = 'movement_date amount partner bank_account ref'
column_names = 'movement_date amount partner remote_account ref'
auto_fit_column_widths = True

0 comments on commit 80f7e7b

Please sign in to comment.