Merge branch 'Tresorerie' into 'master'

Separate counter for account refounding

See merge request !28
This commit is contained in:
Skia 2016-12-19 16:50:44 +01:00
commit 68517a5d33
4 changed files with 27 additions and 12 deletions

View File

@ -19,7 +19,7 @@ from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultip
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin, CanCreateMixin
from core.views.forms import SelectFile, SelectDate from core.views.forms import SelectFile, SelectDate
from accounting.models import BankAccount, ClubAccount, GeneralJournal, Operation, AccountingType, Company, SimplifiedAccountingType, Label 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 # Main accounting view
@ -536,11 +536,11 @@ class RefoundAccountView(FormView):
def create_selling(self): def create_selling(self):
with transaction.atomic(): with transaction.atomic():
uprice = self.customer.customer.amount uprice = self.customer.customer.amount
main_club_counter = Counter.objects.filter(club__unix_name=settings.SITH_MAIN_CLUB['unix_name'], refound_club_counter = Counter.objects.get(id=settings.SITH_COUNTER_REFOUND_ID)
type='OFFICE').first() refound_club = refound_club_counter.club
main_club = main_club_counter.club
s = Selling(label=_('Refound account'), unit_price=uprice, s = Selling(label=_('Refound account'), unit_price=uprice,
quantity=1, seller=self.operator, quantity=1, seller=self.operator,
customer=self.customer.customer, customer=self.customer.customer,
club=main_club, counter=main_club_counter) club=refound_club, counter=refound_club_counter,
product=Product.objects.get(id=settings.SITH_PRODUCT_REFOUND_ID))
s.save() s.save()

View File

@ -253,6 +253,9 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
troll = Club(name="Troll Penché", unix_name="troll", troll = Club(name="Troll Penché", unix_name="troll",
address="Terre Du Milieu", parent=main_club) address="Terre Du Milieu", parent=main_club)
troll.save() troll.save()
refound = Club(name="Carte AE", unix_name="carte_ae",
address="Jamais imprimée", parent=main_club)
refound.save()
# Counters # Counters
Customer(user=skia, account_id="6568j", amount=0).save() Customer(user=skia, account_id="6568j", amount=0).save()
@ -274,6 +277,12 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
mde.products.add(cble) mde.products.add(cble)
mde.save() mde.save()
refound_counter = Counter(name="Carte AE", club=refound, type='OFFICE')
refound_counter.save()
refound_product = Product(name="remboursement", code="REMBOURS", purchase_price="0", selling_price="0",
special_selling_price="0", club=refound)
refound_product.save()
# Accounting test values: # Accounting test values:
BankAccount(name="AE TG", club=main_club).save() BankAccount(name="AE TG", club=main_club).save()
BankAccount(name="Carte AE", club=main_club).save() BankAccount(name="Carte AE", club=main_club).save()
@ -295,4 +304,3 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
target_id=bar_club.id).save() target_id=bar_club.id).save()
woenzco = Company(name="Woenzel & co") woenzco = Company(name="Woenzel & co")
woenzco.save() woenzco.save()

View File

@ -29,6 +29,8 @@
<li><a href="{{ url('counter:product_list') }}">{% trans %}Products management{% endtrans %}</a></li> <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: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: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 %} {% endif %}
{% for b in settings.SITH_COUNTER_BARS %} {% for b in settings.SITH_COUNTER_BARS %}
{% if user.is_in_group(b[1]+" admin") %} {% if user.is_in_group(b[1]+" admin") %}

View File

@ -257,6 +257,11 @@ SITH_GROUP_BANNED_COUNTER_ID = 7
SITH_GROUP_BANNED_SUBSCRIPTION_ID = 8 SITH_GROUP_BANNED_SUBSCRIPTION_ID = 8
SITH_GROUP_SAS_ADMIN_ID = 9 SITH_GROUP_SAS_ADMIN_ID = 9
SITH_CLUB_REFOUND_ID = 89
SITH_COUNTER_REFOUND_ID = 38
SITH_PRODUCT_REFOUND_ID = 5
# SAS variables # SAS variables
SITH_SAS_ROOT_DIR_ID = 4 SITH_SAS_ROOT_DIR_ID = 4