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

Merge branch 'staging'

parents 5c0e294f a863777d
......@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '1.4.0'
__version__ = '1.4.1'
def get_default_company(user=None):
'''Get default company for user'''
......
......@@ -50,12 +50,16 @@ class Subscription(Document):
frappe.delete_doc("Subscription Event", event.name, force=True)
def update_subscription_period(self, date=None):
def update_subscription_period(self, date=None, commit=False):
start_date = self.current_invoice_start
end_date = self.current_invoice_end
self.set_current_invoice_start(date)
self.set_current_invoice_end()
if commit:
self.save()
frappe.db.commit()
if start_date != self.current_invoice_start or end_date != self.current_invoice_end:
self.add_subscription_event("New period")
......@@ -100,19 +104,16 @@ class Subscription(Document):
self.set_plan_details_status()
if not self.has_invoice_for_period():
self.generate_invoice(payment_entry=payment_entry)
self.update_subscription_period(add_days(self.current_invoice_end, 1))
self.save()
self.update_subscription_period(add_days(self.current_invoice_end, 1), commit=True)
self.generate_sales_order()
else:
self.update_subscription_period(add_days(self.current_invoice_end, 1))
self.save()
self.update_subscription_period(add_days(self.current_invoice_end, 1), commit=True)
self.generate_sales_order()
elif self.generate_invoice_at_period_start:
self.set_plan_details_status()
if self.has_invoice_for_period() and self.period_has_passed(self.current_invoice_end):
self.update_subscription_period(add_days(self.current_invoice_end, 1))
self.save()
self.update_subscription_period(add_days(self.current_invoice_end, 1), commit=True)
self.generate_sales_order()
self.generate_invoice(payment_entry=payment_entry)
......@@ -494,8 +495,7 @@ class Subscription(Document):
self.status = 'Active'
self.cancellation_date = None
self.prorate_invoice = 0
self.update_subscription_period(nowdate())
self.save()
self.update_subscription_period(nowdate(), commit=True)
else:
frappe.throw(_('You cannot restart a Subscription that is not cancelled.'))
......
......@@ -16,7 +16,7 @@ PARTY_FIELD = {
"Journal Entry": "party",
"Sales Invoice": "customer",
"Purchase Invoice": "supplier",
"Expense Claim": "Employee"
"Expense Claim": "employee"
}
PARTY_TYPES = {
......@@ -25,14 +25,6 @@ PARTY_TYPES = {
"Expense Claim": "Employee"
}
DATE_FIELD = {
"Payment Entry": "reference_date",
"Journal Entry": "cheque_date",
"Sales Invoice": "due_date",
"Purchase Invoice": "due_date",
"Expense Claim": "total_claimed_amount"
}
@frappe.whitelist()
def reconcile(bank_transactions, documents):
bank_reconciliation = BankReconciliation(bank_transactions, documents)
......@@ -94,7 +86,7 @@ class BankReconciliation:
setattr(self, fielname, next(iter(value)))
def reconcile(self):
if self.reconciliation_doctype in ["Sales Invoice", "Purchase Invoice"] and not (self.documents[0].get("is_pos") or self.documents[0].get("is_paid")):
if self.reconciliation_doctype in ["Sales Invoice", "Purchase Invoice", "Expense Claim"] and not (self.documents[0].get("is_pos") or self.documents[0].get("is_paid")):
self.check_unique_values()
self.make_payment_entries()
self.reconcile_created_payments()
......@@ -110,7 +102,7 @@ class BankReconciliation:
if abs(self.documents[0]["unreconciled_amount"]) > reconciled_amount:
bank_transaction = frappe.get_doc("Bank Transaction", bank_transaction.get("name"))
allocated_amount = min(max(bank_transaction.unallocated_amount, 0), abs(self.documents[0]["unreconciled_amount"]))
date_value = self.documents[0][DATE_FIELD.get(self.reconciliation_doctype)]
date_value = self.documents[0].get("reference_date")
if isinstance(date_value, str):
date_value = parse_date(date_value)
......@@ -129,7 +121,7 @@ class BankReconciliation:
def reconcile_one_transaction_with_multiple_documents(self):
for document in self.documents:
bank_transaction = frappe.get_doc("Bank Transaction", self.bank_transactions[0]["name"])
date_value = document.get(DATE_FIELD.get(document.get("doctype")))
date_value = document.get("reference_date")
if isinstance(date_value, str):
date_value = parse_date(date_value)
......@@ -147,7 +139,7 @@ class BankReconciliation:
def reconcile_created_payments(self):
for transaction, payment in zip(self.bank_transactions, self.payment_entries):
bank_transaction = frappe.get_doc("Bank Transaction", transaction.get("name"))
date_value = payment.get(DATE_FIELD.get(payment.get("doctype")))
date_value = payment.get("reference_date")
if isinstance(date_value, str):
date_value = parse_date(date_value)
......
......@@ -438,6 +438,7 @@
"Out of Order": "Hors service",
"Partially Depreciated": "Partiellement déprécié",
"Policy number": "Numéro de politique",
"Prorated Straight Line (360 Days)": "Linéaire au prorata (360 jours)",
"Purchase Date": "Date d'Achat",
"Purchase Invoice": "Facture d’Achat",
"Purchase Receipt": "Reçu d’Achat",
......@@ -486,6 +487,7 @@
"Frequency of Depreciation (Months)": "Fréquence des Amortissements (Mois)",
"In Percentage": "En pourcentage",
"Manual": "Manuel",
"Prorated Straight Line (360 Days)": "Linéaire au prorata (360 jours)",
"Rate of Depreciation": "Taux de dépréciation",
"Straight Line": "Linéaire",
"Total Number of Depreciations": "Nombre Total d’Amortissements",
......@@ -2196,6 +2198,7 @@
"Journal Entry": "Écriture de journal",
"Make Depreciation Entry": "Créer une Écriture d'Amortissement",
"Manual": "Manuel",
"Prorated Straight Line (360 Days)": "Linéaire au prorata (360 jours)",
"Schedule Date": "Date du Calendrier",
"Straight Line": "Linéaire",
"Written Down Value": "Valeur comptable nette"
......@@ -6618,6 +6621,7 @@
"Draft": "Brouillon",
"Drop Ship": "Expédition Directe",
"Exchange Rate": "Taux de change",
"Fetch items based on Default Supplier.": "Récupérer les articles sur la base du fournisseur par défaut",
"From Date": "Date de début",
"Get Items from Open Material Requests": "Obtenir des Articles de Demandes Matérielles Ouvertes",
"Grand Total": "Total TTC",
......@@ -11339,6 +11343,7 @@
"Debtors": "Débiteurs",
"Depreciation": "Amortissement",
"Direct Expenses": "Charges Directes",
"Direct Expenses Account": "Compte de charges directes",
"Direct Income": "Revenu Direct",
"Dividends Paid": "Dividendes Payés",
"Duties and Taxes": "Droits de Douane et Taxes",
......@@ -12600,6 +12605,7 @@
"apps/erpnext/erpnext/accounts/page/bank_reconciliation/bank_reconciliation_page/BankReconciliationActions.vue": {
"Bank Transactions": "Transactions bancaires",
"Documents": "Documents",
"In progress...": "En cours...",
"Reconcile": "Réconcilier",
"This action will create a new payment entry. Do you confirm ?": "Cette action va créer un nouvelle écriture de paiement. La confirmez-vous ?",
"You can only reconcile one bank transaction with several documents or several bank transactions with one document.": "Vous pouvez rapprocher une transaction bancaire avec plusieurs document ou plusieurs transactions bancaires avec un document."
......@@ -12984,6 +12990,7 @@
"Clearance Date": "Date de rapprochement",
"Payment Document": "Document de paiement",
"Payment Entry": "Écriture de Paiement",
"Please create at least one mode of payment for this bank account first": "Veuillez créer au moins un mode de paiement pour ce compte bancaire",
"Posting Date": "Date de comptabilisation"
},
"apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html": {
......@@ -14926,12 +14933,59 @@
"Reference Document": "Document de référence",
"Reference Name": "Nom du document de référence"
},
"apps/erpnext/erpnext/demo/setup/manufacture.py": {
"Products": "Produits",
"Stores": "Magasins"
},
"apps/erpnext/erpnext/demo/setup/setup_data.py": {
"Basic": "de Base",
"Calls": "Appels",
"Commercial": "Commercial",
"Cost of Goods Sold": "Coût des marchandises vendues",
"Entertainment Expenses": "Charges de Représentation",
"Food": "Alimentation",
"Income Tax": "Impôt sur le Revenu",
"Main": "Principal",
"Medical": "Médical",
"Miscellaneous Expenses": "Charges Diverses",
"Others": "Autres",
"Travel": "Déplacement"
"Raw Material": "Matières Premières",
"Rest Of The World": "Reste du Monde",
"Salary": "Salaire",
"Sales Expenses": "Frais de Vente",
"Services": "Services",
"Supplier": "Fournisseur",
"Travel": "Déplacement",
"Travel Expenses": "Frais de Déplacement",
"Utility Expenses": "Frais de Services d'Utilité Publique"
},
"apps/erpnext/erpnext/demo/user/fixed_asset.py": {
"Gain/Loss on Asset Disposal": "Gain/Perte sur Cessions des Immobilisations"
},
"apps/erpnext/erpnext/demo/user/hr.py": {
"All Departments": "Tous les départements",
"Miscellaneous Expenses": "Charges Diverses"
},
"apps/erpnext/erpnext/demo/user/manufacturing.py": {
"Main": "Principal",
"Stores": "Magasins",
"Work in Progress": "Travaux en cours"
},
"apps/erpnext/erpnext/demo/user/projects.py": {
"New Product Development": "Développement de nouveaux projets"
},
"apps/erpnext/erpnext/demo/user/purchase.py": {
"Stores": "Magasins",
"Supplier": "Fournisseur"
},
"apps/erpnext/erpnext/demo/user/sales.py": {
"Did not ask": "Non demandé",
"Sales": "Ventes"
},
"apps/erpnext/erpnext/demo/user/stock.py": {
"Cost of Goods Sold": "Coût des marchandises vendues",
"Stores": "Magasins",
"Supplier": "Fournisseur"
},
"apps/erpnext/erpnext/erpnext_integrations/connectors/shopify_connection.py": {
"Actual": "Réel",
......@@ -18767,6 +18821,7 @@
"Row {0}: Bill of Materials not found for the Item {1}": "Ligne {0} : Liste de Matériaux non trouvée pour l’Article {1}",
"The following Work Orders were created:": "Les ordres de travail suivants ont été créés:",
"The total Issue / Transfer quantity {0} in Material Request {1} \\\n\t\t\t\t\t\t\tcannot be greater than requested quantity {2} for Item {3}": "La quantité totale d’Émission / Transfert {0} dans la Demande de matériel {1} \\ ne peut pas être supérieure à la quantité demandée {2} pour l’Article {3}",
"Work Order cannot be created for following reason:": "Les ordres de travail ne peuvent pas être créé pour la raison suivante",
"{0} Request for {1}": "Demande de {0} pour {1}",
"{0} for {1}": "{0} pour {1}",
"{0} is not the default supplier for any items.": "{0} n'est le fournisseur par défaut pour aucun article",
......@@ -19594,6 +19649,7 @@
"Date": "Date"
},
"apps/erpnext/erpnext/templates/emails/confirm_appointment.html": {
"A new appointment has been created for you on {}": "Un nouveau rendez-vous a été créé pour vous sur {}",
"A new appointment has been created for you with {0}": "Un nouveau rendez-vous a été créé pour vous avec {1}",
"Click on the link below to verify your email and confirm the appointment": "Cliquez sur le lien ci-dessous pour vérifier votre email et confirmer votre rendez-vous",
"Dear": "Cher·e",
......@@ -19849,6 +19905,7 @@
},
"apps/erpnext/erpnext/templates/pages/demo.html": {
"Launch Demo": "Démarrer la démo",
"Logging In...": "Connexion...",
"Some functionality is disabled for the demo and the data will be cleared regularly.": "Certaines fonctionnalités sont désactivées pour la démo et les données sont régulièrement réinitialisées",
"Start a free 30-day trial": "Démarrer un essai gratuit de 30 jours",
"dokos Demo": "Démo de dokos"
......@@ -20178,6 +20235,7 @@
"Description": "Description",
"Documents": "Documents",
"Final balance": "Solde final",
"In progress...": "En cours...",
"Initial balance": "Solde initial",
"No data available for this period": "Aucune donnée disponible pour cette période",
"No matching document found for your selection": "Aucune document trouvé pour votre sélection",
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