Commit 68517a5d authored by Skia's avatar Skia 🤘
Browse files

Merge branch 'Tresorerie' into 'master'

Separate counter for account refounding

See merge request !28
parents 4ae4d2b6 7227a5d6
Pipeline #546 passed with stage
in 2 minutes and 27 seconds
......@@ -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
......@@ -536,11 +536,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 = main_club_counter.club
refound_club_counter = Counter.objects.get(id=settings.SITH_COUNTER_REFOUND_ID)
refound_club = refound_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=refound_club, counter=refound_club_counter,
product=Product.objects.get(id=settings.SITH_PRODUCT_REFOUND_ID))
s.save()
......@@ -253,6 +253,9 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
troll = Club(name="Troll Penché", unix_name="troll",
address="Terre Du Milieu", parent=main_club)
troll.save()
refound = Club(name="Carte AE", unix_name="carte_ae",
address="Jamais imprimée", parent=main_club)
refound.save()
# Counters
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.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:
BankAccount(name="AE TG", 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()
woenzco = Company(name="Woenzel & co")
woenzco.save()
......@@ -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") %}
......
......@@ -257,6 +257,11 @@ SITH_GROUP_BANNED_COUNTER_ID = 7
SITH_GROUP_BANNED_SUBSCRIPTION_ID = 8
SITH_GROUP_SAS_ADMIN_ID = 9
SITH_CLUB_REFOUND_ID = 89
SITH_COUNTER_REFOUND_ID = 38
SITH_PRODUCT_REFOUND_ID = 5
# SAS variables
SITH_SAS_ROOT_DIR_ID = 4
......
Supports Markdown
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