Commit c0e7c9fc by Damien Moulard

WIP. REC: prepare for update qty in prices step, clickable qty cell, adaptative qty column header

parent 4159459d
Pipeline #2275 passed with stage
in 1 minute 23 seconds
......@@ -56,6 +56,7 @@ EM_URL = ''
RECEPTION_MERGE_ORDERS_PSWD = 'jpsrcp'
RECEPTION_ADD_PRODUCTS_PSWD = 'jpsrcp'
RECEPTION_UPDATE_QTY_PSWD = 'jpsrcp'
RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, les produits non commandés, cassés ou pourris. \
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre."
DISPLAY_COL_AUTRES = False
......
......@@ -357,6 +357,10 @@
Password to enter to add products to an order during reception
Same principle as previous pswd
- RECEPTION_UPDATE_QTY_PSWD = 'pass2makeApause'
Password to update a product qty during prices step.
- RECEPTION_PDT_LABELS_BTN_TEXT = 'Lancer l\'impression'
- RECEPTION_PDT_LABELS_FN = 'print_product_labels()'
......
......@@ -275,6 +275,32 @@ tr.odd td.row_product_no_qty {
background-color: #acb3c2;
}
#error_report {
width: 100%;
height: 200px;
border: 2px solid #555;
border-radius: 10px;
white-space: pre-wrap;
}
#main_content {width: 100%;}
.select_product_action {
max-width: 5px;
}
.toProcess_line_edit, .toProcess_line_valid {
min-width: 11px;
}
.product_qty_cell {
cursor: pointer;
}
.product_qty_cell:hover {
background-color: #e7e9ed;
}
/* Accordion style */
/* Style the buttons that are used to open and close the accordion panel */
......@@ -322,21 +348,3 @@ hr {
.panel.active:after {
margin-bottom: 30px;
}
#error_report {
width: 100%;
height: 200px;
border: 2px solid #555;
border-radius: 10px;
white-space: pre-wrap;
}
#main_content {width: 100%;}
.select_product_action {
max-width: 5px;
}
.toProcess_line_edit, .toProcess_line_valid {
min-width: 11px;
}
\ No newline at end of file
......@@ -490,6 +490,13 @@ function initLists() {
});
}
// Titles for Qty column
const base_qty_title = "Qté";
const qty_title_tooltip = `<div class="tooltip tt_twolines">
Qté
<span class="tooltiptext">Qté comptée / Qté commandée</span>
</div>`;
columns_to_process = columns_to_process.concat([
{data:"product_id.0", title: "id", visible: false},
{data:"shelf_sortorder", title: "Rayon", className: "dt-body-center"},
......@@ -524,8 +531,8 @@ function initLists() {
},
{
data:"product_qty",
title: "Qté",
className:"dt-body-center",
title: (reception_status == "qty_valid") ? qty_title_tooltip : base_qty_title,
className: (reception_status == "qty_valid") ? "dt-body-center product_qty_cell" : "dt-body-center",
render: function (data, type, full) {
if (reception_status == "False") {
return data;
......@@ -594,7 +601,7 @@ function initLists() {
{data:"product_uom.1", title: "Unité vente", className:"dt-body-center", orderable: false},
{
data:"product_qty",
title:"Qté",
title: qty_title_tooltip,
className:"dt-head-center dt-body-center",
// visible: (reception_status == "False"),
render: function (data, type, full) {
......@@ -882,6 +889,18 @@ function initLists() {
clearLineEdition();
}
});
$('#table_to_process tbody').on('click', '.product_qty_cell', function () {
let pswd = prompt('Mot de passe requis pour éditer la quantité de ce produit');
if (pswd == update_qty_pswd) {
console.log('clicked'); //
} else if (pswd == null) {
return;
} else {
alert('Mauvais mot de passe !');
}
});
}
// Add a line to to_process
......
......@@ -93,6 +93,7 @@ def produits(request, id):
"ADD_ALL_LEFT_IS_GOOD_QTIES": False,
"ADD_ALL_LEFT_IS_GOOD_PRICES": False,
'add_products_pswd': getattr(settings, 'RECEPTION_ADD_PRODUCTS_PSWD', 'makeastop'),
'update_qty_pswd': getattr(settings, 'RECEPTION_UPDATE_QTY_PSWD', 'makeastop')
}
fixed_barcode_prefix = '0490'
......
......@@ -234,6 +234,7 @@
var add_all_left_is_good_qties = "{{ADD_ALL_LEFT_IS_GOOD_QTIES}}"
var add_all_left_is_good_prices = "{{ADD_ALL_LEFT_IS_GOOD_PRICES}}"
var add_products_pswd = "{{add_products_pswd}}"
var update_qty_pswd = "{{update_qty_pswd}}"
</script>
<script src="{% static "js/all_common.js" %}?v=1651853225"></script>
<script src='{% static "js/barcodes.js" %}?v=1651853225'></script>
......
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