Skip to content
Snippets Groups Projects
Commit 0e077ccc authored by Carlos Vega's avatar Carlos Vega
Browse files

added option 'removed' for vouchers #298

parent 083ee3ea
No related branches found
No related tags found
1 merge request!211Improvements/more options
...@@ -9,7 +9,7 @@ from django.utils import timezone ...@@ -9,7 +9,7 @@ from django.utils import timezone
from web.algorithm import VerhoeffAlgorithm from web.algorithm import VerhoeffAlgorithm
from web.forms.forms import DATEPICKER_DATE_ATTRS from web.forms.forms import DATEPICKER_DATE_ATTRS
from web.models import VoucherType, VoucherTypePrice, Voucher, Worker from web.models import VoucherType, VoucherTypePrice, Voucher, Worker
from web.models.constants import VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED from web.models.constants import VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED, VOUCHER_STATUS_REMOVED
from web.models.worker_study_role import WORKER_VOUCHER_PARTNER from web.models.worker_study_role import WORKER_VOUCHER_PARTNER
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -61,7 +61,7 @@ class VoucherForm(ModelForm): ...@@ -61,7 +61,7 @@ class VoucherForm(ModelForm):
self.fields['activity_type'].widget.attrs['readonly'] = True self.fields['activity_type'].widget.attrs['readonly'] = True
self.fields['usage_partner'].widget.attrs['readonly'] = True self.fields['usage_partner'].widget.attrs['readonly'] = True
if instance.status in [VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED]: if instance.status in [VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED, VOUCHER_STATUS_REMOVED]:
self.fields['status'].widget.attrs['readonly'] = True self.fields['status'].widget.attrs['readonly'] = True
self.fields['feedback'].widget.attrs['readonly'] = True self.fields['feedback'].widget.attrs['readonly'] = True
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2019-03-21 11:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0137_auto_20190321_1024'),
]
operations = [
migrations.AlterField(
model_name='voucher',
name='status',
field=models.CharField(choices=[(b'NEW', b'New'), (b'IN_USE', b'In use'), (b'USED', b'Used'), (b'EXPIRED', b'Expired'), (b'REMOVED', b'Removed')], default=b'NEW', max_length=20, verbose_name=b'Status'),
),
]
...@@ -103,11 +103,13 @@ VOUCHER_STATUS_NEW = "NEW" ...@@ -103,11 +103,13 @@ VOUCHER_STATUS_NEW = "NEW"
VOUCHER_STATUS_IN_USE = "IN_USE" VOUCHER_STATUS_IN_USE = "IN_USE"
VOUCHER_STATUS_USED = "USED" VOUCHER_STATUS_USED = "USED"
VOUCHER_STATUS_EXPIRED = "EXPIRED" VOUCHER_STATUS_EXPIRED = "EXPIRED"
VOUCHER_STATUS_REMOVED = "REMOVED"
VOUCHER_STATUS_CHOICES = ( VOUCHER_STATUS_CHOICES = (
(VOUCHER_STATUS_NEW, 'New'), (VOUCHER_STATUS_NEW, 'New'),
(VOUCHER_STATUS_IN_USE, 'In use'), (VOUCHER_STATUS_IN_USE, 'In use'),
(VOUCHER_STATUS_USED, 'Used'), (VOUCHER_STATUS_USED, 'Used'),
(VOUCHER_STATUS_EXPIRED, 'Expired'), (VOUCHER_STATUS_EXPIRED, 'Expired'),
(VOUCHER_STATUS_REMOVED, 'Removed'),
) )
FILE_STORAGE = FileSystemStorage(location='uploads') FILE_STORAGE = FileSystemStorage(location='uploads')
...@@ -301,6 +301,7 @@ function createTable(params) { ...@@ -301,6 +301,7 @@ function createTable(params) {
'<option value="IN_USE">IN USE</option>' + '<option value="IN_USE">IN USE</option>' +
'<option value="USED">USED</option>' + '<option value="USED">USED</option>' +
'<option value="EXPIRED">EXPIRED</option>' + '<option value="EXPIRED">EXPIRED</option>' +
'<option value="REMOVED">REMOVED</option>' +
'</select>'); '</select>');
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment