Vous voici sur le Git Rural du CRAW

Commit c7c217ee authored by Patrick Houben's avatar Patrick Houben

add FRM_FAC in csstag show_client_supplier_href

parent dc4e56a4
......@@ -99,21 +99,19 @@ def show_client_supplier_href(context, inst):
# Init vars
solde = 0
if inst._meta.object_name == "Client":
qs = inst.revenue_set
qs = inst.revenue_set.filter(payflag=False, revcat__id='FRM_FAC')
url_list = "revenue_list"
display_txt = "Aucune vente"
if inst._meta.object_name == "Supplier":
qs = inst.expense_set
qs = inst.expense_set.filter(payflag=False)
url_list = "expense_list"
display_txt = "Aucun achat"
# Recover ajd
ajd = context["ajd"]
# Inst present in Expense or Revenue?
rev = qs.filter(pk__gt=0)
if rev:
amt = qs.filter(payflag=False, payduedate__lt=date.today()).aggregate(amountvat=Sum("amountvat"), payamount=Sum("payamount"))
if qs:
amt = qs.filter(payduedate__lt=date.today()).aggregate(amountvat=Sum("amountvat"), payamount=Sum("payamount"))
amountvat = amt["amountvat"]
payamount = amt["payamount"]
......
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