Commit 08c18e70 authored by plb's avatar plb
Browse files

ajout d'un type custom pour les entrées de la banque.

parent b18ce509
......@@ -109,30 +109,43 @@ class BankEntry(Entry):
elif self.cells['b_label'] == "Règlement client":
entry_type = "client"
elif self.cells['b_label'] == "Solde initial":
entry_type = ""
elif self.cells['b_label'] == "Souscription part sociale":
entry_type = "client"
entry_type = "custom"
#elif self.cells['b_label'] == "Souscription part sociale":
# entry_type = "custom"
elif self.cells['b_label'] == "(SocialContributionPayment)":
entry_type = "social"
else:
print "Impossible de déterminer sur l'écriture est sur un compte fournisseur ou client"
print self.cells
entry_type = "custom"
third_code = ""
if entry_type == "client":
third_code = self.cells['s_code_compta']
if third_code == "":
third_code = self.pc_default_client
print "WARNING: Utilisation du tiers par défaut"
print self.cells
elif entry_type == "supplier":
third_code = self.cells['s_code_compta_fournisseur']
if third_code == "":
third_code = self.pc_default_supplier
elif entry_type == "social":
third_code = SocialEntry.get_third_code(self.cells['ccs_code'])
elif entry_type == "custom":
third_code = self.get_custom_code()
if third_code == "":
print "WARNING: Utilisation du tiers par défaut"
print self.cells
third_code = self.pc_default_tiers
else:
third_code = self.pc_default_tiers
print "ERROR: entry_type must be defined"
return third_code
def get_custom_code(self):
fn = settings.get('PC_REFS')['fn_custom_code']
return fn(self.cells)
def get_ledger(self):
s = ""
......@@ -393,7 +406,10 @@ class Supplier(Entry):
}
if self.cells['f_total_tva'] != 0:
tva_account = settings.get('PC_REFS')['tva_deductible']
if s_code.startswith("2"):
tva_account = settings.get('PC_REFS')['tva_deductible']
else:
tva_account = settings.get('PC_REFS')['tva_deductible_immo']
s += " %(compte_tva)s %(amount_tva)s\n" % {
'compte_tva': settings.get_ledger_account(tva_account),
'amount_tva': -self.cells['f_total_tva'],
......
Supports Markdown
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