Actualiser assets/js/app.js
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled

This commit is contained in:
2026-06-17 21:41:10 +00:00
parent 3a08929353
commit ad101cc58f
+1 -16
View File
@@ -6679,9 +6679,6 @@ function renderInventoryItem(item) {
const subBadge = (item.subcategory && SUBCATEGORY_LABELS[item.subcategory])
? `<span class="inv-badge badge-subcategory">${SUBCATEGORY_LABELS[item.subcategory]}</span>`
: '';
const subBadge = (catKey === 'bevande' && item.subcategory && SUBCATEGORY_LABELS[item.subcategory])
? `<span class="inv-badge badge-subcategory">${SUBCATEGORY_LABELS[item.subcategory]}</span>`
: '';
const locInfo = LOCATIONS[item.location] || { icon: '📦', label: item.location };
const days = daysUntilExpiry(item.expiry_date);
const isExpired = days < 0;
@@ -8509,12 +8506,6 @@ function autoDetectCategory() {
function onCategoryChange(fromAutoDetect = false) {
const cat = document.getElementById('pf-category').value;
const subGroup = document.getElementById('pf-subcategory-group');
if (subGroup) subGroup.style.display = (cat === 'bevande') ? 'block' : 'none';
if (cat !== 'bevande') {
const subSel = document.getElementById('pf-subcategory');
if (subSel) subSel.value = '';
}
const unitSelect = document.getElementById('pf-unit');
const qtyInput = document.getElementById('pf-defqty');
@@ -8689,7 +8680,7 @@ async function submitProduct(e) {
name: document.getElementById('pf-name').value,
brand: document.getElementById('pf-brand').value,
category: pfCategory,
subcategory: pfCategory === 'bevande' ? pfSubcategory : null,
subcategory: pfSubcategory || null,
unit: pfUnit,
default_quantity: pfUnit === 'conf' ? (parseFloat(document.getElementById('pf-conf-size')?.value) || 1) : (parseFloat(document.getElementById('pf-defqty').value) || 1),
package_unit: pfUnit === 'conf' ? (document.getElementById('pf-conf-unit')?.value || '') : '',
@@ -9078,12 +9069,6 @@ function editProductFromAction() {
}
document.getElementById('pf-category').disabled = false;
document.getElementById('pf-subcategory').value = currentProduct.subcategory || '';
// Set subcategory (boisson uniquement)
const editSubGroup = document.getElementById('pf-subcategory-group');
if (editSubGroup) editSubGroup.style.display = (cat === 'bevande') ? 'block' : 'none';
const editSubSel = document.getElementById('pf-subcategory');
if (editSubSel) editSubSel.value = (cat === 'bevande') ? (currentProduct.subcategory || '') : '';
document.getElementById('pf-defqty').dataset.manuallySet = 'true';
// Image preview - not shown in edit mode