mirror of
https://github.com/ae-utbm/sith.git
synced 2025-11-22 12:46:58 +00:00
remove Refilling.bank
This commit is contained in:
@@ -186,7 +186,9 @@ class TestFilterInactive(TestCase):
|
|||||||
time_active = now() - settings.SITH_ACCOUNT_INACTIVITY_DELTA + timedelta(days=1)
|
time_active = now() - settings.SITH_ACCOUNT_INACTIVITY_DELTA + timedelta(days=1)
|
||||||
time_inactive = time_active - timedelta(days=3)
|
time_inactive = time_active - timedelta(days=3)
|
||||||
counter, seller = baker.make(Counter), baker.make(User)
|
counter, seller = baker.make(Counter), baker.make(User)
|
||||||
sale_recipe = Recipe(Selling, counter=counter, club=counter.club, seller=seller)
|
sale_recipe = Recipe(
|
||||||
|
Selling, counter=counter, club=counter.club, seller=seller, unit_price=0
|
||||||
|
)
|
||||||
|
|
||||||
cls.users = [
|
cls.users = [
|
||||||
baker.make(User),
|
baker.make(User),
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class RefillForm(forms.ModelForm):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Refilling
|
model = Refilling
|
||||||
fields = ["amount", "payment_method", "bank"]
|
fields = ["amount", "payment_method"]
|
||||||
widgets = {"payment_method": forms.RadioSelect}
|
widgets = {"payment_method": forms.RadioSelect}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -160,9 +160,6 @@ class RefillForm(forms.ModelForm):
|
|||||||
if self.fields["payment_method"].initial not in self.allowed_refilling_methods:
|
if self.fields["payment_method"].initial not in self.allowed_refilling_methods:
|
||||||
self.fields["payment_method"].initial = self.allowed_refilling_methods[0]
|
self.fields["payment_method"].initial = self.allowed_refilling_methods[0]
|
||||||
|
|
||||||
if "CHECK" not in self.allowed_refilling_methods:
|
|
||||||
del self.fields["bank"]
|
|
||||||
|
|
||||||
|
|
||||||
class CounterEditForm(forms.ModelForm):
|
class CounterEditForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.RemoveField(model_name="selling", name="is_validated"),
|
migrations.RemoveField(model_name="selling", name="is_validated"),
|
||||||
migrations.RemoveField(model_name="refilling", name="is_validated"),
|
migrations.RemoveField(model_name="refilling", name="is_validated"),
|
||||||
|
migrations.RemoveField(model_name="refilling", name="bank"),
|
||||||
migrations.RenameField(
|
migrations.RenameField(
|
||||||
model_name="selling",
|
model_name="selling",
|
||||||
old_name="payment_method",
|
old_name="payment_method",
|
||||||
|
|||||||
@@ -747,13 +747,7 @@ class Refilling(models.Model):
|
|||||||
)
|
)
|
||||||
date = models.DateTimeField(_("date"))
|
date = models.DateTimeField(_("date"))
|
||||||
payment_method = models.CharField(
|
payment_method = models.CharField(
|
||||||
_("payment method"),
|
_("payment method"), max_length=255, choices=PAYMENT_METHOD, default="CARD"
|
||||||
max_length=255,
|
|
||||||
choices=PAYMENT_METHOD,
|
|
||||||
default="CARD",
|
|
||||||
)
|
|
||||||
bank = models.CharField(
|
|
||||||
_("bank"), max_length=255, choices=settings.SITH_COUNTER_BANK, default="OTHER"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = RefillingQuerySet.as_manager()
|
objects = RefillingQuerySet.as_manager()
|
||||||
|
|||||||
@@ -119,11 +119,7 @@ class TestRefilling(TestFullClickBase):
|
|||||||
"counter:refilling_create",
|
"counter:refilling_create",
|
||||||
kwargs={"customer_id": user.pk},
|
kwargs={"customer_id": user.pk},
|
||||||
),
|
),
|
||||||
{
|
{"amount": str(amount), "payment_method": "CASH"},
|
||||||
"amount": str(amount),
|
|
||||||
"payment_method": "CASH",
|
|
||||||
"bank": "OTHER",
|
|
||||||
},
|
|
||||||
HTTP_REFERER=reverse(
|
HTTP_REFERER=reverse(
|
||||||
"counter:click",
|
"counter:click",
|
||||||
kwargs={"counter_id": counter.id, "user_id": user.pk},
|
kwargs={"counter_id": counter.id, "user_id": user.pk},
|
||||||
@@ -149,11 +145,7 @@ class TestRefilling(TestFullClickBase):
|
|||||||
"counter:refilling_create",
|
"counter:refilling_create",
|
||||||
kwargs={"customer_id": self.customer.pk},
|
kwargs={"customer_id": self.customer.pk},
|
||||||
),
|
),
|
||||||
{
|
{"amount": "10", "payment_method": "CASH"},
|
||||||
"amount": "10",
|
|
||||||
"payment_method": "CASH",
|
|
||||||
"bank": "OTHER",
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.client.force_login(self.club_admin)
|
self.client.force_login(self.club_admin)
|
||||||
|
|||||||
@@ -254,7 +254,6 @@ class Invoice(models.Model):
|
|||||||
operator=self.user,
|
operator=self.user,
|
||||||
amount=i.product_unit_price * i.quantity,
|
amount=i.product_unit_price * i.quantity,
|
||||||
payment_method="CARD",
|
payment_method="CARD",
|
||||||
bank="OTHER",
|
|
||||||
date=self.date,
|
date=self.date,
|
||||||
)
|
)
|
||||||
new.save()
|
new.save()
|
||||||
|
|||||||
@@ -440,19 +440,6 @@ SITH_SUBSCRIPTION_LOCATIONS = [
|
|||||||
|
|
||||||
SITH_COUNTER_BARS = [(1, "MDE"), (2, "Foyer"), (35, "La Gommette")]
|
SITH_COUNTER_BARS = [(1, "MDE"), (2, "Foyer"), (35, "La Gommette")]
|
||||||
|
|
||||||
SITH_COUNTER_BANK = [
|
|
||||||
("OTHER", "Autre"),
|
|
||||||
("SOCIETE-GENERALE", "Société générale"),
|
|
||||||
("BANQUE-POPULAIRE", "Banque populaire"),
|
|
||||||
("BNP", "BNP"),
|
|
||||||
("CAISSE-EPARGNE", "Caisse d'épargne"),
|
|
||||||
("CIC", "CIC"),
|
|
||||||
("CREDIT-AGRICOLE", "Crédit Agricole"),
|
|
||||||
("CREDIT-MUTUEL", "Credit Mutuel"),
|
|
||||||
("CREDIT-LYONNAIS", "Credit Lyonnais"),
|
|
||||||
("LA-POSTE", "La Poste"),
|
|
||||||
]
|
|
||||||
|
|
||||||
SITH_PEDAGOGY_UV_TYPE = [
|
SITH_PEDAGOGY_UV_TYPE = [
|
||||||
("FREE", _("Free")),
|
("FREE", _("Free")),
|
||||||
("CS", _("CS")),
|
("CS", _("CS")),
|
||||||
|
|||||||
Reference in New Issue
Block a user