Commit 27501684 authored by Charles-Henri Decultot's avatar Charles-Henri Decultot
Browse files

Merge branch 'staging'

parents 656486c6 12881806
......@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '1.4.4'
__version__ = '1.4.5'
def get_default_company(user=None):
'''Get default company for user'''
......
......@@ -77,9 +77,18 @@ class SepaDirectDebit(Document):
customer = payment_entry.against_account
if not frappe.db.exists("Sepa Mandate", dict(customer=customer, registered_on_gocardless=0, status="Active")):
frappe.throw(_("Please create or activate a SEPA Mandate for customer {0}".format(customer)))
else:
mandate = frappe.get_doc("Sepa Mandate", dict(customer=customer))
customer_iban, customer_bic = frappe.db.get_value("Bank Account", mandate.bank_account, ["iban", "swift_number"])
mandate = frappe.get_doc("Sepa Mandate", dict(customer=customer, registered_on_gocardless=0, status="Active"))
if not mandate.bank_account:
frappe.throw(_("Please add a bank account in mandate {0} for customer {1}".format(mandate.name, customer)))
customer_iban, customer_bic = frappe.db.get_value("Bank Account", mandate.bank_account, ["iban", "swift_number"])
if not customer_iban:
frappe.throw(_("Please add an IBAN in bank account {0} for customer {1}".format(mandate.bank_account, customer)))
if not customer_bic:
frappe.throw(_("Please add a Swift Number in bank account {0} for customer {1}".format(mandate.bank_account, customer)))
pe = frappe.get_doc("Payment Entry", payment_entry.payment_entry)
sales_invoices = ""
......
......@@ -12408,6 +12408,9 @@
},
"apps/erpnext/erpnext/accounts/doctype/sepa_direct_debit/sepa_direct_debit.py": {
"From Date and To Date are Mandatory": "La date de début et la date de fin sont obligatoires",
"Please add a Swift Number in bank account {0} for customer {1}": "Veuillez ajouter un BIC dans le compte bancaire {0} pour le client {1}",
"Please add a bank account in mandate {0} for customer {1}": "Veuillez ajouter un compte bancaire dans le mandat {0} pour le client {1}",
"Please add an IBAN in bank account {0} for customer {1}": "Veuillez ajouter un IBAN dans le compte bancaire {0} pour le client {1}",
"Please create or activate a SEPA Mandate for customer {0}": "Veuillez créer ou activer un mandat Sepa pour le client {0}"
},
"apps/erpnext/erpnext/accounts/doctype/sepa_direct_debit_settings/sepa_direct_debit_settings.py": {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment