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
e231c612
Commit
e231c612
authored
Dec 06, 2016
by
Sli
Browse files
Separate counter for account refounding
parent
39b73490
Changes
4
Show whitespace changes
Inline
Side-by-side
accounting/views.py
View file @
e231c612
...
...
@@ -19,7 +19,7 @@ from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultip
from
core.views
import
CanViewMixin
,
CanEditMixin
,
CanEditPropMixin
,
CanCreateMixin
from
core.views.forms
import
SelectFile
,
SelectDate
from
accounting.models
import
BankAccount
,
ClubAccount
,
GeneralJournal
,
Operation
,
AccountingType
,
Company
,
SimplifiedAccountingType
,
Label
from
counter.models
import
Counter
,
Selling
from
counter.models
import
Counter
,
Selling
,
Product
# Main accounting view
...
...
@@ -524,11 +524,11 @@ class RefoundAccountView(FormView):
def
create_selling
(
self
):
with
transaction
.
atomic
():
uprice
=
self
.
customer
.
customer
.
amount
main_club_counter
=
Counter
.
objects
.
filter
(
club__unix_name
=
settings
.
SITH_MAIN_CLUB
[
'unix_name'
],
type
=
'OFFICE'
).
first
()
main_club_counter
=
Counter
.
objects
.
get
(
name
=
settings
.
SITH_COUNTER_REFOUND
[
1
])
main_club
=
main_club_counter
.
club
s
=
Selling
(
label
=
_
(
'Refound account'
),
unit_price
=
uprice
,
quantity
=
1
,
seller
=
self
.
operator
,
customer
=
self
.
customer
.
customer
,
club
=
main_club
,
counter
=
main_club_counter
)
club
=
main_club
,
counter
=
main_club_counter
,
product
=
Product
.
objects
.
get
(
code
=
settings
.
SITH_COUNTER_REFOUND_PRODUCT
[
1
]))
s
.
save
()
core/management/commands/populate.py
View file @
e231c612
...
...
@@ -74,6 +74,7 @@ class Command(BaseCommand):
self
.
reset_index
(
"counter"
)
Counter
(
name
=
"Eboutic"
,
club
=
main_club
,
type
=
'EBOUTIC'
).
save
()
Counter
(
name
=
"AE"
,
club
=
main_club
,
type
=
'OFFICE'
).
save
()
Counter
(
name
=
settings
.
SITH_COUNTER_REFOUND
[
1
],
club
=
main_club
,
type
=
'OFFICE'
).
save
()
home_root
.
view_groups
=
[
Group
.
objects
.
filter
(
name
=
settings
.
SITH_MAIN_MEMBERS_GROUP
).
first
()]
club_root
.
view_groups
=
[
Group
.
objects
.
filter
(
name
=
settings
.
SITH_MAIN_MEMBERS_GROUP
).
first
()]
...
...
@@ -273,6 +274,9 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
mde
.
products
.
add
(
barb
)
mde
.
products
.
add
(
cble
)
mde
.
save
()
refound
=
Product
(
name
=
settings
.
SITH_COUNTER_REFOUND_PRODUCT
[
2
],
code
=
settings
.
SITH_COUNTER_REFOUND_PRODUCT
[
1
],
purchase_price
=
"0"
,
selling_price
=
"0"
,
special_selling_price
=
"0"
,
club
=
main_club
)
refound
.
save
()
# Accounting test values:
BankAccount
(
name
=
"AE TG"
,
club
=
main_club
).
save
()
...
...
@@ -295,4 +299,3 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
target_id
=
bar_club
.
id
).
save
()
woenzco
=
Company
(
name
=
"Woenzel & co"
)
woenzco
.
save
()
core/templates/core/user_tools.jinja
View file @
e231c612
...
...
@@ -29,6 +29,8 @@
<li><a
href=
"
{{
url
(
'counter:product_list'
)
}}
"
>
{%
trans
%}
Products management
{%
endtrans
%}
</a></li>
<li><a
href=
"
{{
url
(
'counter:producttype_list'
)
}}
"
>
{%
trans
%}
Product types management
{%
endtrans
%}
</a></li>
<li><a
href=
"
{{
url
(
'counter:cash_summary_list'
)
}}
"
>
{%
trans
%}
Cash register summaries
{%
endtrans
%}
</a></li>
<li><a
href=
"
{{
url
(
'counter:invoices_call'
)
}}
"
>
{%
trans
%}
Invoices call
{%
endtrans
%}
</a></li>
<li><a
href=
"
{{
url
(
'counter:eticket_list'
)
}}
"
>
{%
trans
%}
Etickets
{%
endtrans
%}
</a></li>
{%
endif
%}
{%
for
b
in
settings.SITH_COUNTER_BARS
%}
{%
if
user.is_in_group
(
b
[
1
]
+
" admin"
)
%}
...
...
sith/settings.py
View file @
e231c612
...
...
@@ -313,6 +313,10 @@ SITH_COUNTER_BANK = [
(
'LA-POSTE'
,
'La Poste'
),
]
SITH_COUNTER_REFOUND
=
(
88
,
'Carte AE'
)
SITH_COUNTER_REFOUND_PRODUCT
=
(
1899
,
'REMBOURS'
,
'Remboursement'
)
# Defines which product type is the refilling type, and thus increases the account amount
SITH_COUNTER_PRODUCTTYPE_REFILLING
=
11
...
...
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