Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
e6e4929e
Commit
e6e4929e
authored
Dec 21, 2016
by
Skia
🤘
Browse files
Rename bilan to statement
parent
bdcc0bf6
Changes
5
Hide whitespace changes
Inline
Side-by-side
accounting/templates/accounting/journal_
bilan
_accounting.jinja
→
accounting/templates/accounting/journal_
statement
_accounting.jinja
View file @
e6e4929e
...
...
@@ -6,7 +6,7 @@
{%
block
content
%}
<h3>
{%
trans
%}
Accounting
bilan
:
{%
endtrans
%}
{{
object.name
}}
</h3>
<h3>
{%
trans
%}
Accounting
statement
:
{%
endtrans
%}
{{
object.name
}}
</h3>
<table>
<thead>
...
...
@@ -16,7 +16,7 @@
</tr>
</thead>
<tbody>
{%
for
k
,
v
in
bilan
.items
()
%}
{%
for
k
,
v
in
statement
.items
()
%}
<tr>
<td>
{{
k
}}
</td>
<td>
{{
v
}}
</td>
...
...
accounting/templates/accounting/journal_
bilan
_nature.jinja
→
accounting/templates/accounting/journal_
statement
_nature.jinja
View file @
e6e4929e
...
...
@@ -5,7 +5,7 @@
{%
endblock
%}
{%
macro
display_tables
(
dict
)
%}
<h
4
>
{%
trans
%}
Credit
{%
endtrans
%}
</h
4
>
<h
5
>
{%
trans
%}
Credit
{%
endtrans
%}
</h
5
>
<table>
<thead>
<tr>
...
...
@@ -24,7 +24,7 @@
</table>
{%
trans
%}
Total:
{%
endtrans
%}{{
dict
[
'CREDIT_sum'
]
}}
<h
4
>
{%
trans
%}
Debit
{%
endtrans
%}
</h
4
>
<h
5
>
{%
trans
%}
Debit
{%
endtrans
%}
</h
5
>
<table>
<thead>
<tr>
...
...
@@ -45,10 +45,10 @@
{%
endmacro
%}
{%
block
content
%}
<h
2
>
{%
trans
%}
Statement by nature:
{%
endtrans
%}
{{
object.name
}}
</h
2
>
<h
3
>
{%
trans
%}
Statement by nature:
{%
endtrans
%}
{{
object.name
}}
</h
3
>
{%
for
k
,
v
in
statement.items
()
%}
<h
3
>
{{
k
}}
</h
3
>
<h
4
>
{{
k
}}
</h
4
>
{{
display_tables
(
v
)
}}
<hr>
{%
endfor
%}
...
...
accounting/templates/accounting/journal_
bilan
_person.jinja
→
accounting/templates/accounting/journal_
statement
_person.jinja
View file @
e6e4929e
...
...
@@ -6,9 +6,9 @@
{%
block
content
%}
<h
2
>
{%
trans
%}
Person bila
n:
{%
endtrans
%}
{{
object.name
}}
</h
2
>
<h
3
>
{%
trans
%}
Statement by perso
n:
{%
endtrans
%}
{{
object.name
}}
</h
3
>
<h
3
>
{%
trans
%}
Credit
{%
endtrans
%}
</h
3
>
<h
4
>
{%
trans
%}
Credit
{%
endtrans
%}
</h
4
>
<table>
<thead>
...
...
@@ -18,14 +18,14 @@
</tr>
</thead>
<tbody>
{%
for
key
in
bilan_credi
t.keys
()
%}
{%
for
key
in
credit_statemen
t.keys
()
%}
<tr>
{%
if
key.target_type
==
"OTHER"
%}
<td>
{{
o.target_label
}}
</td>
{%
else
%}
<td><a
href=
"
{{
key.get_absolute_url
()
}}
"
>
{{
key.get_display_name
()
}}
</a></td>
{%
endif
%}
<td>
{{
bilan_credi
t
[
key
]
}}
</td>
<td>
{{
credit_statemen
t
[
key
]
}}
</td>
</tr>
{%
endfor
%}
</tbody>
...
...
@@ -34,8 +34,8 @@
<p>
Total :
{{
total_credit
}}
</p>
<h
3
>
{%
trans
%}
Debit
{%
endtrans
%}
</h
3
>
<h
4
>
{%
trans
%}
Debit
{%
endtrans
%}
</h
4
>
<table>
<thead>
<tr>
...
...
@@ -44,14 +44,14 @@
</tr>
</thead>
<tbody>
{%
for
key
in
bilan_debi
t.keys
()
%}
{%
for
key
in
debit_statemen
t.keys
()
%}
<tr>
{%
if
key.target_type
==
"OTHER"
%}
<td>
{{
o.target_label
}}
</td>
{%
else
%}
<td><a
href=
"
{{
key.get_absolute_url
()
}}
"
>
{{
key.get_display_name
()
}}
</a></td>
{%
endif
%}
<td>
{{
bilan_debi
t
[
key
]
}}
</td>
<td>
{{
debit_statemen
t
[
key
]
}}
</td>
</tr>
{%
endfor
%}
</tbody>
...
...
@@ -60,4 +60,4 @@
<p>
Total :
{{
total_debit
}}
</p>
{%
endblock
%}
\ No newline at end of file
{%
endblock
%}
accounting/urls.py
View file @
e6e4929e
...
...
@@ -26,9 +26,9 @@ urlpatterns = [
url
(
r
'^journal/create$'
,
JournalCreateView
.
as_view
(),
name
=
'journal_new'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)$'
,
JournalDetailView
.
as_view
(),
name
=
'journal_details'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/edit$'
,
JournalEditView
.
as_view
(),
name
=
'journal_edit'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
bilan
/nature$'
,
Journal
Bilan
NatureView
.
as_view
(),
name
=
'journal_
bilan_
nature'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
bilan
/person$'
,
Journal
Bilan
PersonView
.
as_view
(),
name
=
'journal_
bilan_
person'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
bilan
/accounting$'
,
Journal
Bilan
AccountingView
.
as_view
(),
name
=
'journal_
bilan_
accounting'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
statement
/nature$'
,
JournalNature
Statement
View
.
as_view
(),
name
=
'journal_nature
_statement
'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
statement
/person$'
,
JournalPerson
Statement
View
.
as_view
(),
name
=
'journal_person
_statement
'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/
statement
/accounting$'
,
JournalAccounting
Statement
View
.
as_view
(),
name
=
'journal_accounting
_statement
'
),
# Operations
url
(
r
'^operation/create/(?P<j_id>[0-9]+)$'
,
OperationCreateView
.
as_view
(),
name
=
'op_new'
),
...
...
accounting/views.py
View file @
e6e4929e
...
...
@@ -179,19 +179,19 @@ class JournalTabsMixin(TabedViewMixin):
'name'
:
_
(
"Journal"
),
})
tab_list
.
append
({
'url'
:
reverse
(
'accounting:journal_
bilan_
nature'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'
bilan_
nature'
,
'name'
:
_
(
"
Bilan
nature"
),
'url'
:
reverse
(
'accounting:journal_nature
_statement
'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'nature
_statement
'
,
'name'
:
_
(
"
Statement by
nature"
),
})
tab_list
.
append
({
'url'
:
reverse
(
'accounting:journal_
bilan_
person'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'
bilan_
person'
,
'name'
:
_
(
"
Bilan
person"
),
'url'
:
reverse
(
'accounting:journal_person
_statement
'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'person
_statement
'
,
'name'
:
_
(
"
Statement by
person"
),
})
tab_list
.
append
({
'url'
:
reverse
(
'accounting:journal_
bilan_
accounting'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'
bilan_
accounting'
,
'name'
:
_
(
"
Bilan a
ccounting"
),
'url'
:
reverse
(
'accounting:journal_accounting
_statement
'
,
kwargs
=
{
'j_id'
:
self
.
object
.
id
}),
'slug'
:
'accounting
_statement
'
,
'name'
:
_
(
"
A
ccounting
statement
"
),
})
return
tab_list
...
...
@@ -470,14 +470,14 @@ class OperationPDFView(CanViewMixin, DetailView):
p
.
save
()
return
response
class
Journal
Bilan
NatureView
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
class
JournalNature
Statement
View
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
"""
Display a statement sorted by labels
"""
model
=
GeneralJournal
pk_url_kwarg
=
"j_id"
template_name
=
'accounting/journal_
bilan
_nature.jinja'
current_tab
=
'
bilan_
nature'
template_name
=
'accounting/journal_
statement
_nature.jinja'
current_tab
=
'nature
_statement
'
def
statement
(
self
,
queryset
,
movement_type
):
ret
=
collections
.
OrderedDict
()
...
...
@@ -514,18 +514,18 @@ class JournalBilanNatureView(JournalTabsMixin, CanViewMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
""" Add infos to the context """
kwargs
=
super
(
Journal
Bilan
NatureView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
=
super
(
JournalNature
Statement
View
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'statement'
]
=
self
.
big_statement
()
return
kwargs
class
Journal
Bilan
PersonView
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
class
JournalPerson
Statement
View
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
"""
Calculate a dictionary with operation target and sum of operations
"""
model
=
GeneralJournal
pk_url_kwarg
=
"j_id"
template_name
=
'accounting/journal_
bilan
_person.jinja'
current_tab
=
'
bilan_
person'
template_name
=
'accounting/journal_
statement
_person.jinja'
current_tab
=
'person
_statement
'
def
sum_by_target
(
self
,
target_id
):
from
decimal
import
Decimal
...
...
@@ -553,21 +553,21 @@ class JournalBilanPersonView(JournalTabsMixin, CanViewMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
""" Add journal to the context """
kwargs
=
super
(
Journal
Bilan
PersonView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
=
super
(
JournalPerson
Statement
View
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'credit_statement'
]
=
self
.
credit_statement
()
kwargs
[
'debit_statement'
]
=
self
.
debit_statement
()
kwargs
[
'total_credit'
]
=
self
.
total_credit
()
kwargs
[
'total_debit'
]
=
self
.
total_debit
()
return
kwargs
class
Journal
Bilan
AccountingView
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
class
JournalAccounting
Statement
View
(
JournalTabsMixin
,
CanViewMixin
,
DetailView
):
"""
Calculate a dictionary with operation type and sum of operations
"""
model
=
GeneralJournal
pk_url_kwarg
=
"j_id"
template_name
=
'accounting/journal_
bilan
_accounting.jinja'
current_tab
=
"
bilan_
accounting"
template_name
=
'accounting/journal_
statement
_accounting.jinja'
current_tab
=
"accounting
_statement
"
def
statement
(
self
):
statement
=
collections
.
OrderedDict
()
...
...
@@ -580,7 +580,7 @@ class JournalBilanAccountingView(JournalTabsMixin, CanViewMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
""" Add journal to the context """
kwargs
=
super
(
Journal
Bilan
AccountingView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
=
super
(
JournalAccounting
Statement
View
,
self
).
get_context_data
(
**
kwargs
)
kwargs
[
'statement'
]
=
self
.
statement
()
return
kwargs
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment