Fix migration DB, detail recap, TVA BIC vente, docker-compose sans traefik
This commit is contained in:
@@ -35,14 +35,20 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-semibold d-flex justify-content-between">
|
||||
Marge brute <span id="marginDisplay" class="text-muted">
|
||||
Marge brute <span id="marginDisplay" class="fw-bold" style="color:#ff6b35">
|
||||
{{ profile.gross_margin_pct if profile else 27.5 }} %
|
||||
</span>
|
||||
</label>
|
||||
<div class="d-flex gap-2 mb-2" id="marginButtons">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="setMargin(20)">20%</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="setMargin(25)">25%</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="setMargin(30)">30%</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="setMargin(35)">35%</button>
|
||||
</div>
|
||||
<input type="range" name="gross_margin_pct" id="gross_margin_pct" class="form-range"
|
||||
min="20" max="35" step="0.5"
|
||||
min="0" max="100" step="0.5"
|
||||
value="{{ profile.gross_margin_pct if profile else 27.5 }}">
|
||||
<div class="d-flex justify-content-between" style="font-size:.75rem;color:#6b7280"><span>20%</span><span>35%</span></div>
|
||||
<div class="d-flex justify-content-between" style="font-size:.75rem;color:#6b7280"><span>0%</span><span>100%</span></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-semibold">Notes</label>
|
||||
@@ -66,8 +72,26 @@
|
||||
function setDM(val) {
|
||||
document.getElementById('design_multiplier').value = val;
|
||||
}
|
||||
document.getElementById('gross_margin_pct').addEventListener('input', function() {
|
||||
document.getElementById('marginDisplay').textContent = this.value + ' %';
|
||||
});
|
||||
|
||||
function setMargin(val) {
|
||||
document.getElementById('gross_margin_pct').value = val;
|
||||
updateMarginDisplay(val);
|
||||
}
|
||||
|
||||
function updateMarginDisplay(val) {
|
||||
val = parseFloat(val);
|
||||
document.getElementById('marginDisplay').textContent = val.toFixed(1) + ' %';
|
||||
[20, 25, 30, 35].forEach(function(v) {
|
||||
const btn = document.querySelector('#marginButtons button[onclick="setMargin(' + v + ')"]');
|
||||
if (btn) btn.className = 'btn btn-sm ' + (Math.abs(val - v) < 0.01 ? 'btn-secondary' : 'btn-outline-secondary');
|
||||
});
|
||||
}
|
||||
|
||||
const slider = document.getElementById('gross_margin_pct');
|
||||
slider.addEventListener('input', function() { updateMarginDisplay(this.value); });
|
||||
slider.addEventListener('change', function() { updateMarginDisplay(this.value); });
|
||||
|
||||
// Init
|
||||
updateMarginDisplay(slider.value);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user