fix(import): resolve correct id_articol for duplicate CODMATs + gestiune setting
Unified id_articol selection logic in Python (resolve_codmat_ids) and PL/SQL (resolve_id_articol): filters sters=0 AND inactiv=0, prefers article with stock in configured gestiune, falls back to MAX(id_articol). Eliminates mismatch where Python and PL/SQL could pick different id_articol for the same CODMAT, causing ORA-20000 price-not-found errors. - Add resolve_codmat_ids helper in validation_service.py (single batch query) - Refactor validate_skus/validate_prices/ensure_prices to use it - Add resolve_id_articol function in PL/SQL package body - Add p_id_gestiune parameter to importa_comanda (spec + body) - Add /api/settings/gestiuni endpoint and id_gestiune setting - Add gestiune dropdown in settings UI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,12 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-header py-2 px-3 fw-semibold">Import ROA</div>
|
||||
<div class="card-body py-2 px-3">
|
||||
<div class="mb-2">
|
||||
<label class="form-label mb-0 small">Gestiune (ID_GESTIUNE)</label>
|
||||
<select class="form-select form-select-sm" id="settIdGestiune">
|
||||
<option value="">— orice gestiune —</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="form-label mb-0 small">Secție (ID_SECTIE)</label>
|
||||
<select class="form-select form-select-sm" id="settIdSectie">
|
||||
@@ -146,5 +152,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{{ request.scope.get('root_path', '') }}/static/js/settings.js?v=3"></script>
|
||||
<script src="{{ request.scope.get('root_path', '') }}/static/js/settings.js?v=4"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user