Commit dcee510a by François C.

Merge branch 'ticket_1738' into 'evolution_bdm'

Ticket 1738

See merge request !79
parents 6b6c53bc dfc58992
Pipeline #1536 passed with stage
in 1 minute 27 seconds
...@@ -125,6 +125,7 @@ RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, ...@@ -125,6 +125,7 @@ RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception,
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre. \ Merci d'indiquer un maximum d'informations, le nom du produit et son code barre. \
Dans le cas de produits déteriorés, merci d'envoyer une photo avec votre téléphone à [Adresse_email]" Dans le cas de produits déteriorés, merci d'envoyer une photo avec votre téléphone à [Adresse_email]"
AMNISTIE_DATE= "2021-11-24"
# display or not column "Autres" in reception process # display or not column "Autres" in reception process
DISPLAY_COL_AUTRES = False DISPLAY_COL_AUTRES = False
......
...@@ -83,6 +83,10 @@ table.dataTable.display tbody tr.row_partner_late { ...@@ -83,6 +83,10 @@ table.dataTable.display tbody tr.row_partner_late {
table.dataTable.display tbody tr.row_partner_absent { table.dataTable.display tbody tr.row_partner_absent {
background-color: #ff847b; background-color: #ff847b;
} }
table.dataTable.display tbody tr.row_partner_amnistie {
background-color: black;
color: white;
}
table.dataTable.display tbody tr.row_partner_ok td, table.dataTable.display tbody tr.row_partner_ok td,
table.dataTable.display tbody tr.row_partner_late td, table.dataTable.display tbody tr.row_partner_late td,
table.dataTable.display tbody tr.row_partner_absent td { table.dataTable.display tbody tr.row_partner_absent td {
......
...@@ -68,6 +68,7 @@ function prepare_server_data(data) { ...@@ -68,6 +68,7 @@ function prepare_server_data(data) {
} else if (history_item.state === 'cancel') { } else if (history_item.state === 'cancel') {
history_item.details = "Annulé"; history_item.details = "Annulé";
} }
if (history_item.is_amnesty == undefined) history_item.shift_name = (history_item.shift_id === false) ? '' : history_item.shift_id[1];
} }
return data; return data;
...@@ -113,6 +114,8 @@ function init_history() { ...@@ -113,6 +114,8 @@ function init_history() {
$(row).addClass('row_partner_late'); $(row).addClass('row_partner_late');
} else if (cell.text() === "Absent") { } else if (cell.text() === "Absent") {
$(row).addClass('row_partner_absent'); $(row).addClass('row_partner_absent');
} else if (cell.text() === "Amnistie") {
$(row).addClass('row_partner_amnistie');
} }
} }
} }
...@@ -155,8 +158,14 @@ function init_my_shifts() { ...@@ -155,8 +158,14 @@ function init_my_shifts() {
.then((data) => { .then((data) => {
partner_history = data; partner_history = data;
for (d of data) {
d.create_date = Date.parse(d.create_date);
}
// Sort by date desc // Sort by date desc
partner_history.sort((a, b) => a.create_date - b.create_date); partner_history.sort((a, b) => b.create_date - a.create_date);
if (partner_history.length>0 && partner_history[partner_history.length-1].is_amnesty != undefined) {
partner_history.pop();
}
init_history(); init_history();
}); });
......
...@@ -221,5 +221,15 @@ def get_shifts_history(request): ...@@ -221,5 +221,15 @@ def get_shifts_history(request):
offset = int(request.GET.get('offset')) offset = int(request.GET.get('offset'))
date_from = getattr(settings, 'START_DATE_FOR_SHIFTS_HISTORY', '2018-01-01') date_from = getattr(settings, 'START_DATE_FOR_SHIFTS_HISTORY', '2018-01-01')
res["data"] = m.get_shifts_history(partner_id, limit, offset, date_from) res["data"] = m.get_shifts_history(partner_id, limit, offset, date_from)
is_amnesty = getattr(settings, 'AMNISTIE_DATE', 'false')
company_code = getattr(settings, 'COMPANY_CODE', '')
if is_amnesty and company_code == "lacagette":
amnesty={}
amnesty['is_amnesty'] = True
amnesty['create_date'] = is_amnesty
amnesty['shift_name'] = 'Amnistie'
amnesty['state'] = ''
res["data"].append(amnesty)
return JsonResponse(res) return JsonResponse(res)
\ No newline at end of file
...@@ -311,6 +311,9 @@ ...@@ -311,6 +311,9 @@
Message shown to people when they connect to the Member Space Message shown to people when they connect to the Member Space
- AMNISTIE_DATE = "2021-11-24"
In members_space history display a special activity about amnistie
### Reception ### Reception
- RECEPTION_ADD_ADMIN_MODE = True - RECEPTION_ADD_ADMIN_MODE = True
......
Markdown is supported
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