feat(114): accounting configs refactor + invoice configs CRUD

Phase 114 complete (v3.7 Invoices):
- /settings/accounting jako hub-rozdroze (Paragony / Faktury)
- /settings/accounting/receipts + /invoices osobne podstrony list i edycji
- InvoiceConfigRepository + Controller (CRUD z walidacja delegacji)
- Seed Domyslny VAT (NOT EXISTS idempotent)
- invoice-config-form.js (toggle is_delegated -> integration_id)
- confirm-delete.js (globalny modul OrderProAlerts.confirm)
- Legacy aliasy starych endpointow /settings/accounting/save|toggle|delete

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 22:32:29 +02:00
parent 2382018739
commit 6129042ff6
22 changed files with 1663 additions and 192 deletions

View File

@@ -0,0 +1,35 @@
(function () {
'use strict';
function sync(checkbox, wrapper) {
if (!checkbox || !wrapper) return;
var select = wrapper.querySelector('select[name="integration_id"]');
if (checkbox.checked) {
wrapper.style.display = '';
if (select) select.required = true;
} else {
wrapper.style.display = 'none';
if (select) {
select.required = false;
select.value = '';
}
}
}
function init() {
var checkbox = document.querySelector('[data-invoice-delegated]');
var wrapper = document.querySelector('[data-invoice-delegation]');
if (!checkbox || !wrapper) return;
sync(checkbox, wrapper);
checkbox.addEventListener('change', function () {
sync(checkbox, wrapper);
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();