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,
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]"
AMNISTIE_DATE= "2021-11-24"
# display or not column "Autres" in reception process
DISPLAY_COL_AUTRES = False
......
......@@ -83,6 +83,10 @@ table.dataTable.display tbody tr.row_partner_late {
table.dataTable.display tbody tr.row_partner_absent {
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_late td,
table.dataTable.display tbody tr.row_partner_absent td {
......
......@@ -68,6 +68,7 @@ function prepare_server_data(data) {
} else if (history_item.state === 'cancel') {
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;
......@@ -113,6 +114,8 @@ function init_history() {
$(row).addClass('row_partner_late');
} else if (cell.text() === "Absent") {
$(row).addClass('row_partner_absent');
} else if (cell.text() === "Amnistie") {
$(row).addClass('row_partner_amnistie');
}
}
}
......@@ -155,8 +158,14 @@ function init_my_shifts() {
.then((data) => {
partner_history = data;
for (d of data) {
d.create_date = Date.parse(d.create_date);
}
// 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();
});
......
......@@ -222,4 +222,14 @@ def get_shifts_history(request):
date_from = getattr(settings, 'START_DATE_FOR_SHIFTS_HISTORY', '2018-01-01')
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)
\ No newline at end of file
......@@ -311,6 +311,9 @@
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_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