Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
c19e2d1c
Commit
c19e2d1c
authored
Feb 05, 2017
by
Krophil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several modifications in accounting
parent
346e07f0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
4 deletions
+28
-4
accounting/models.py
accounting/models.py
+1
-1
accounting/templates/accounting/bank_account_details.jinja
accounting/templates/accounting/bank_account_details.jinja
+2
-1
accounting/templates/accounting/club_account_details.jinja
accounting/templates/accounting/club_account_details.jinja
+7
-1
accounting/templates/accounting/journal_details.jinja
accounting/templates/accounting/journal_details.jinja
+2
-0
accounting/templates/accounting/label_list.jinja
accounting/templates/accounting/label_list.jinja
+6
-1
accounting/urls.py
accounting/urls.py
+1
-0
accounting/views.py
accounting/views.py
+9
-0
No files found.
accounting/models.py
View file @
c19e2d1c
...
...
@@ -218,7 +218,7 @@ class Operation(models.Model):
journal
=
models
.
ForeignKey
(
GeneralJournal
,
related_name
=
"operations"
,
null
=
False
,
verbose_name
=
_
(
"journal"
))
amount
=
CurrencyField
(
_
(
'amount'
))
date
=
models
.
DateField
(
_
(
'date'
))
remark
=
models
.
CharField
(
_
(
'comment'
),
max_length
=
128
)
remark
=
models
.
CharField
(
_
(
'comment'
),
max_length
=
128
,
default
=
""
,
null
=
True
,
blank
=
True
)
mode
=
models
.
CharField
(
_
(
'payment method'
),
max_length
=
255
,
choices
=
settings
.
SITH_ACCOUNTING_PAYMENT_METHOD
)
cheque_number
=
models
.
CharField
(
_
(
'cheque number'
),
max_length
=
32
,
default
=
""
,
null
=
True
,
blank
=
True
)
invoice
=
models
.
ForeignKey
(
SithFile
,
related_name
=
'operations'
,
verbose_name
=
_
(
"invoice"
),
null
=
True
,
blank
=
True
)
...
...
accounting/templates/accounting/bank_account_details.jinja
View file @
c19e2d1c
...
...
@@ -11,7 +11,7 @@
</p>
<hr>
<h2>
{%
trans
%}
Bank account:
{%
endtrans
%}{{
object.name
}}
</h2>
{%
if
user.is_
root
and
not
object.club_accounts.exists
()
%}
{%
if
user.is_
in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
and
not
object.club_accounts.exists
()
%}
<a
href=
"
{{
url
(
'accounting:bank_delete'
,
b_account_id
=
object.id
)
}}
"
>
{%
trans
%}
Delete
{%
endtrans
%}
</a>
{%
endif
%}
<h4>
{%
trans
%}
Infos
{%
endtrans
%}
</h4>
...
...
@@ -24,6 +24,7 @@
{%
for
c
in
object.club_accounts.all
()
%}
<li><a
href=
"
{{
url
(
'accounting:club_details'
,
c_account_id
=
c.id
)
}}
"
>
{{
c
}}
</a>
-
<a
href=
"
{{
url
(
'accounting:club_edit'
,
c_account_id
=
c.id
)
}}
"
>
{%
trans
%}
Edit
{%
endtrans
%}
</a>
-
<a
href=
"
{{
url
(
'accounting:club_delete'
,
c_account_id
=
c.id
)
}}
"
>
{%
trans
%}
Delete
{%
endtrans
%}
</a>
</li>
{%
endfor
%}
</ul>
...
...
accounting/templates/accounting/club_account_details.jinja
View file @
c19e2d1c
...
...
@@ -15,7 +15,9 @@
{%
if
user.is_root
and
not
object.journals.exists
()
%}
<a
href=
"
{{
url
(
'accounting:club_delete'
,
c_account_id
=
object.id
)
}}
"
>
{%
trans
%}
Delete
{%
endtrans
%}
</a>
{%
endif
%}
{%
if
user.is_in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
%}
<p><a
href=
"
{{
url
(
'accounting:label_new'
)
}}
?parent=
{{
object.id
}}
"
>
{%
trans
%}
New label
{%
endtrans
%}
</a></p>
{%
endif
%}
<p><a
href=
"
{{
url
(
'accounting:label_list'
,
clubaccount_id
=
object.id
)
}}
"
>
{%
trans
%}
Label list
{%
endtrans
%}
</a></p>
{%
if
not
object.has_open_journal
()
%}
<p><a
href=
"
{{
url
(
'accounting:journal_new'
)
}}
?parent=
{{
object.id
}}
"
>
{%
trans
%}
New journal
{%
endtrans
%}
</a></p>
...
...
@@ -52,7 +54,11 @@
<td>
{%
trans
%}
No
{%
endtrans
%}
</td>
{%
endif
%}
<td>
<a
href=
"
{{
url
(
'accounting:journal_details'
,
j_id
=
j.id
)
}}
"
>
{%
trans
%}
View
{%
endtrans
%}
</a>
<a
href=
"
{{
url
(
'accounting:journal_edit'
,
j_id
=
j.id
)
}}
"
>
{%
trans
%}
Edit
{%
endtrans
%}
</a>
</td>
<a
href=
"
{{
url
(
'accounting:journal_edit'
,
j_id
=
j.id
)
}}
"
>
{%
trans
%}
Edit
{%
endtrans
%}
</a>
{%
if
user.is_in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
%}
<a
href=
"
{{
url
(
'accounting:journal_delete'
,
j_id
=
j.id
)
}}
"
>
{%
trans
%}
Delete
{%
endtrans
%}
</a>
{%
endif
%}
</td>
</tr>
{%
endfor
%}
</tbody>
...
...
accounting/templates/accounting/journal_details.jinja
View file @
c19e2d1c
...
...
@@ -78,9 +78,11 @@
<td>
-
</td>
{%
endif
%}
<td>
{%
if
o.journal.club_account.bank_account.name
!=
"AE TI"
and
journal.club_account.bank_account.name
!=
"TI"
or
user.is_in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
%}
{%
if
not
o.journal.closed
%}
<a
href=
"
{{
url
(
'accounting:op_edit'
,
op_id
=
o.id
)
}}
"
>
{%
trans
%}
Edit
{%
endtrans
%}
</a>
{%
endif
%}
{%
endif
%}
</td>
<td><a
href=
"
{{
url
(
'accounting:op_pdf'
,
op_id
=
o.id
)
}}
"
>
{%
trans
%}
Generate
{%
endtrans
%}
</a></td>
</tr>
...
...
accounting/templates/accounting/label_list.jinja
View file @
c19e2d1c
...
...
@@ -12,13 +12,18 @@
</p>
<hr>
<p><a
href=
"
{{
url
(
'accounting:club_details'
,
c_account_id
=
object.id
)
}}
"
>
{%
trans
%}
Back to club account
{%
endtrans
%}
</a></p>
{%
if
user.is_in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
%}
<p><a
href=
"
{{
url
(
'accounting:label_new'
)
}}
?parent=
{{
object.id
}}
"
>
{%
trans
%}
New label
{%
endtrans
%}
</a></p>
{%
endif
%}
{%
if
object.labels.all
()
%}
<h3>
{%
trans
%}
Label list
{%
endtrans
%}
</h3>
<ul>
{%
for
l
in
object.labels.all
()
%}
<li><a
href=
"
{{
url
(
'accounting:label_edit'
,
label_id
=
l.id
)
}}
"
>
{{
l
}}
</a>
-
<li><a
href=
"
{{
url
(
'accounting:label_edit'
,
label_id
=
l.id
)
}}
"
>
{{
l
}}
</a>
{%
if
user.is_in_group
(
settings.SITH_GROUP_ACCOUNTING_ADMIN_ID
)
%}
-
<a
href=
"
{{
url
(
'accounting:label_delete'
,
label_id
=
l.id
)
}}
"
>
{%
trans
%}
Delete
{%
endtrans
%}
</a>
{%
endif
%}
</li>
{%
endfor
%}
</ul>
...
...
accounting/urls.py
View file @
c19e2d1c
...
...
@@ -26,6 +26,7 @@ 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]+)/delete$'
,
JournalDeleteView
.
as_view
(),
name
=
'journal_delete'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/statement/nature$'
,
JournalNatureStatementView
.
as_view
(),
name
=
'journal_nature_statement'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/statement/person$'
,
JournalPersonStatementView
.
as_view
(),
name
=
'journal_person_statement'
),
url
(
r
'^journal/(?P<j_id>[0-9]+)/statement/accounting$'
,
JournalAccountingStatementView
.
as_view
(),
name
=
'journal_accounting_statement'
),
...
...
accounting/views.py
View file @
c19e2d1c
...
...
@@ -230,6 +230,15 @@ class JournalEditView(CanEditMixin, UpdateView):
fields
=
[
'name'
,
'start_date'
,
'end_date'
,
'club_account'
,
'closed'
]
template_name
=
'core/edit.jinja'
class
JournalDeleteView
(
CanEditPropMixin
,
DeleteView
):
"""
Delete a club account (for the admins)
"""
model
=
GeneralJournal
pk_url_kwarg
=
"j_id"
template_name
=
'core/delete_confirm.jinja'
success_url
=
reverse_lazy
(
'accounting:club_details'
)
# Operation views
...
...
Write
Preview
Markdown
is supported
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