-
- Ime predloge
-
-
-
- Vir
-
- CSV
- XML
- XLS
- XLSX
- JSON
-
-
-
- Privzeti tip zapisa
-
-
-
-
Naročnik (opcijsko)
-
-
- Ni mogoče spremeniti naročnika, ker ta predloga že vsebuje preslikave.
-
-
-
-
Privzeti ločilni znak (CSV)
-
- (Auto-detect)
- Comma ,
- Semicolon ;
- Tab \t
- Pipe |
- Space ␠
-
-
- Pusti prazno za samodejno zaznavo. Uporabi, ko zaznavanje ne deluje
- pravilno.
-
-
-
- Privzeti Segment
-
- (brez)
-
- {{ s.name }}
-
-
-
-
- Privzeto Dejanja (post-contract activity)
-
- (brez)
-
- {{ a.name }}
-
-
-
-
-
Privzeta Odločitev (post-contract)
-
- (brez)
-
- {{ d.name }}
-
-
-
- Najprej izberi dejanje, nato odločitev.
-
-
+
+
-
-
-
Aktivna
-
-
-
Reaktivacija
+
+
+
+
+
+
+
+
+ Bulk dodajanje preslikav
+
+
+
+
+ Source columns (ločeno z vejicami, podpičji ali po vrsticah)
-
-
- Shrani
-
-
-
-
-
-
-
-
-
Contract match key
-
-
- Reference (use only contract.reference to locate records)
-
-
-
- Map your CSV column to contract.reference to resolve contracts for this
- client.
-
-
-
-
-
-
-
-
Vzorčni glavi stolpcev
-
- Dodaj stolpec
-
-
-
-
-
-
-
-
- Bulk dodajanje preslikav
-
-
-
- Source columns (ločeno z vejicami, podpičji ali po vrsticah)
-
-
-
- Entity (opcijsko)
-
- (brez – pusti target prazno)
-
- {{ opt.label }}
-
-
-
-
- Field (opcijsko, za vse)
-
- (auto from source)
-
- {{ f }}
-
-
-
-
- Transform (za vse)
-
- None
- trim
- upper
- lower
-
-
-
- Apply (za vse)
-
- both
- insert
- update
-
-
-
- Group (za vse)
-
-
-
- {
- if (!bulkGlobal.sources || !bulkGlobal.sources.trim()) return;
- useForm({
- sources: bulkGlobal.sources,
- entity: bulkGlobal.entity || null,
- default_field: bulkGlobal.default_field || null,
- transform: bulkGlobal.transform || null,
- apply_mode: bulkGlobal.apply_mode || 'both',
- group: bulkGlobal.group || '',
- }).post(
- route('importTemplates.mappings.bulk', {
- template: props.template.uuid,
- }),
- {
- preserveScroll: true,
- onSuccess: () => {
- bulkGlobal.entity = '';
- bulkGlobal.sources = '';
- bulkGlobal.default_field = '';
- bulkGlobal.transform = '';
- bulkGlobal.apply_mode = 'both';
- bulkGlobal.group = '';
- },
- }
- );
- })()
- "
- class="px-3 py-2 bg-indigo-600 text-white rounded"
- >
- Dodaj več
-
-
-
-
-
-
-
- Nedodeljene preslikave ({{ unassigned.length }})
-
-
-
-
-
-
Source
-
{{ m.source_column }}
-
- Predlog:
- {
- const s = suggestions[m.source_column];
- if (!s) return;
- (unassignedState[m.id] ||= {}).entity = s.entity;
- (unassignedState[m.id] ||= {}).field = s.field;
- saveUnassigned(m);
- })()
- "
- >
- {{ suggestions[m.source_column].entity }}.{{
- suggestions[m.source_column].field
- }}
-
-
-
-
- Entity
-
- (izberi)
-
- {{ opt.label }}
-
-
-
-
- Field
-
- (izberi)
-
- {{ f }}
-
-
-
-
- Group
-
-
-
-
Meta key
-
-
Meta type
-
- (auto/string)
- string
- number
- date
- boolean
-
-
- Če ne določiš, lahko uporabiš tudi zapis cilja kot
- contract.meta[key].
-
-
-
- Transform
-
- None
- trim
- upper
- lower
-
-
-
- Apply
-
- both
- insert
- update
- keyref (use as lookup key)
-
-
-
-
- Shrani
-
-
- Izbriši
-
-
+
+
+ Entity (opcijsko)
+
+
+
+
+
+
+ {{ e.label }}
+
+
+
+
+
+ Field (opcijsko, za vse)
+
+
+
+ Transform (za vse)
+
+
+
+
+
+ trim
+ upper
+ lower
+
+
+
+
+ Apply (za vse)
+
+
+
+
+
+ both
+ insert
+ update
+ keyref
+
+
-
-
-
-
-
-
Entities are locked:
-
- Contracts
- Accounts
- Payments
-
-
-
-
-
-
-
- {{
- entityOptions.find((e) => e.key === entity)?.label || entity
- }}
- Klikni za razširitev
-
-
-
-
- Activity action *
-
- (Select action)
- {{ a.name }}
-
-
-
-
Activity decision *
-
- (Select decision)
- {{ d.name }}
-
-
Choose an action first.
-
-
-
Activity created at (override)
-
-
Optional: set a fixed timestamp for inserted activities (history imports).
-
-
-
-
-
-
-
-
- Shrani
-
-
- Izbriši
-
-
-
-
-
- Ni definiranih preslikav za to entiteto.
-
-
-
-
-
-
-
Source column (lahko uporabiš večkrat)
-
-
- {{ s }}
-
-
- Več stolpcev lahko povežeš na isto polje (npr. activity.note).
-
-
-
- Field
-
-
- {{ f }}
-
-
-
-
- Transform
-
- None
- trim
- upper
- lower
-
-
-
- Apply
-
- both
- insert
- update
- keyref (use as lookup key)
-
-
-
- Group
-
-
-
- Meta key
-
- Meta type
-
- (auto/string)
- string
- number
- date
- boolean
-
-
-
-
- Dodaj preslikavo
-
-
-
-
-
-
-
-
- Dodaj več stolpcev naenkrat (ločeno z vejicami ali novimi vrsticami).
- Če polje ne izbereš, bo target nastavljen na entity + ime stolpca.
-
-
-
- Source columns (CSV ali po vrsticah)
-
-
-
- Field (opcijsko, za vse)
-
- (auto from source)
-
- {{ f }}
-
-
-
-
- Transform (za vse)
-
- None
- trim
- upper
- lower
-
-
-
- Apply (za vse)
-
- both
- insert
- update
- keyref (use as lookup key)
-
-
-
- Group (za vse)
-
-
-
-
- {
- const b = (bulkRows[entity] ||= {});
- if (!b.sources || !b.sources.trim()) return;
- const eKey = entity;
- useForm({
- sources: b.sources,
- entity: eKey,
- default_field: b.default_field || null,
- transform: b.transform || null,
- apply_mode: b.apply_mode || 'both',
- group: b.group || '',
- }).post(
- route('importTemplates.mappings.bulk', {
- template: props.template.uuid,
- }),
- {
- preserveScroll: true,
- onSuccess: () => {
- bulkRows[entity] = {};
- },
- }
- );
- })()
- "
- class="px-3 py-2 bg-indigo-600 text-white rounded"
- >
- Dodaj več
-
- {
- const b = (bulkRows[entity] ||= {});
- if (!b.sources || !b.sources.trim()) return;
- const list = b.sources
- .split(/[\n,]+/)
- .map((s) => s.trim())
- .filter(Boolean);
- try {
- const { data } = await axios.post(
- '/api/import-entities/suggest',
- {
- columns: list,
- }
- );
- const sugg = data?.suggestions || {};
- for (const src of list) {
- const s = sugg[src];
- if (!s) continue;
- const aliases = ENTITY_ALIASES.value[entity] || [entity];
- if (!aliases.includes(s.entity)) continue; // only apply for this entity
- const payload = {
- source_column: src,
- target_field: `${s.entity}.${s.field}`,
- transform: b.transform || null,
- apply_mode: b.apply_mode || 'both',
- options: b.group ? { group: b.group } : null,
- position: (props.template.mappings?.length || 0) + 1,
- };
- useForm(payload).post(
- route('importTemplates.mappings.add', {
- template: props.template.uuid,
- }),
- { preserveScroll: true }
- );
- }
- } catch (e) {
- console.error('Failed to auto-add suggestions', e);
- }
- bulkRows[entity] = {};
- })()
- "
- >
- Auto iz predlog
-
-
-
+
+ Group (za vse)
+
-
-
-
+
+ Dodaj več
+
+
+
+
+
+
+
-
-
-
-
-
Izbrišem predlogo?
-
- Tega dejanja ni mogoče razveljaviti. Vse preslikave te predloge bodo izbrisane.
-
-
-
+
+
+
+
+
+ Izbrišem predlogo?
+
+ Tega dejanja ni mogoče razveljaviti. Vse preslikave te predloge bodo
+ izbrisane.
+
+
+
+
Prekliči
-
-
+
Brisanje…
Izbriši
-
-
-
-
+
+
+
+
@@ -1349,5 +474,3 @@ watch(
opacity: 0;
}
-
-
diff --git a/resources/js/Pages/Imports/Templates/Index.vue b/resources/js/Pages/Imports/Templates/Index.vue
index 79428c7..d2c739e 100644
--- a/resources/js/Pages/Imports/Templates/Index.vue
+++ b/resources/js/Pages/Imports/Templates/Index.vue
@@ -1,7 +1,32 @@
+
+
+
+
+ Osnovne informacije
+
+
+
+
+ Ime predloge
+
+
+
+
+ Vir
+
+
+
+
+
+ CSV
+ XML
+ XLS
+ XLSX
+ JSON
+
+
+
+
+
+ Privzeti tip zapisa
+
+
+
+
+
Naročnik (izbirno)
+
+
+
+
+
+ Globalno (brez naročnika)
+
+ {{ c.name }}
+
+
+
+
+ Ni mogoče spremeniti naročnika, ker ta predloga že vsebuje preslikave.
+
+
+
+
+
Privzeti ločilni znak (CSV)
+
+
+
+
+
+
+ Vejica ,
+ Podpičje ;
+ Tab \t
+ Pipe |
+ Presledek ␠
+
+
+
+ Pusti prazno za samodejno zaznavo. Uporabi, ko zaznavanje ne deluje pravilno.
+
+
+
+
+ Privzeti segment
+
+
+
+
+
+ (brez)
+
+ {{ s.name }}
+
+
+
+
+
+
+ Privzeto dejanje (post-contract activity)
+
+
+
+
+
+ (brez)
+
+ {{ a.name }}
+
+
+
+
+
+
+
Privzeta odločitev (post-contract)
+
+
+
+
+
+ (brez)
+
+ {{ d.name }}
+
+
+
+
+ Najprej izberi dejanje, nato odločitev.
+
+
+
+
+
+
+
+ Aktivna
+
+
+
+ Reaktivacija
+
+
Shrani
+
+
+
+
diff --git a/resources/js/Pages/Imports/Templates/Partials/EntityMappings.vue b/resources/js/Pages/Imports/Templates/Partials/EntityMappings.vue
new file mode 100644
index 0000000..696c0b5
--- /dev/null
+++ b/resources/js/Pages/Imports/Templates/Partials/EntityMappings.vue
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+ {{ entityOptions.find((e) => e.key === entity)?.label || entity }}
+
+
+
+
+
+
+
+
+ Izvor
+
+
+
+ Cilj
+
+
+
+ Transform
+
+
+
+
+
+ trim
+ upper
+ lower
+
+
+
+
+ Način
+
+
+
+
+
+ both
+ insert
+ update
+ keyref
+
+
+
+
+
+
+ Shrani
+
+ Izbriši
+
+
+
+
+
+
+
+ Ni definiranih preslikav za to entiteto.
+
+
+
+
+
+
Dodaj novo preslikavo
+
+
+ Izvorno polje
+
+
+
+
+
+
+ Polje
+
+
+
+
+
+
+ {{ f }}
+
+
+
+
+
+ Transform
+
+
+
+
+
+ trim
+ upper
+ lower
+
+
+
+
+ Način
+
+
+
+
+
+ both
+ insert
+ update
+ keyref
+
+
+
+
+
Dodaj preslikavo
+
+
+
+
+
+
+
+
diff --git a/resources/js/Pages/Imports/Templates/Partials/ImportModeSettings.vue b/resources/js/Pages/Imports/Templates/Partials/ImportModeSettings.vue
new file mode 100644
index 0000000..ca576ce
--- /dev/null
+++ b/resources/js/Pages/Imports/Templates/Partials/ImportModeSettings.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+ Nastavitve načina uvoza
+
+ Konfiguriraj način uvoza za zgodovino ali plačila
+
+
+
+
+
+
+ Uvoz zgodovine
+
+
+
+ Uvoz plačil
+
+
+
+
+ Zgodovina dovoljuje oseba/naslov/telefon/pogodbe/aktivnosti/primeri strank; računi so
+ samodejno dodani s pogodbami. Plačila zaklene entitete na Pogodbe → Računi → Plačila.
+
+
+
+
Ključ ujemanja pogodb
+
+
+
+
+
+
+ Referenca (uporabi samo contract.reference za iskanje zapisov)
+
+
+
+
+ Preslika stolpec CSV na contract.reference za reševanje pogodb za tega naročnika.
+
+
+
+
+
+
Entitete so zaklenjene:
+
+ Pogodbe
+ Računi
+ Plačila
+
+
+
+
+
diff --git a/resources/js/Pages/Imports/Templates/Partials/UnassignedMappings.vue b/resources/js/Pages/Imports/Templates/Partials/UnassignedMappings.vue
new file mode 100644
index 0000000..4f476de
--- /dev/null
+++ b/resources/js/Pages/Imports/Templates/Partials/UnassignedMappings.vue
@@ -0,0 +1,253 @@
+
+
+
+
+
+
+ Nedodeljene preslikave ({{ unassigned.length }})
+
+
+ Te preslikave nimajo dodeljene ciljne entitete in polja
+
+
+
+
+
+
+
+
+
Izvorno polje
+
{{ m.source_column }}
+
+
+ Predlog: {{ suggestions[m.source_column].entity }}.{{
+ suggestions[m.source_column].field
+ }}
+
+
+
+
+
+
+
+
+ Entiteta
+
+
+
+
+
+
+ {{ opt.label }}
+
+
+
+
+
+
+ Polje
+
+
+
+
+
+
+ {{ f }}
+
+
+
+
+
+
+
+
+
+ Transform
+
+
+
+
+
+ trim
+ upper
+ lower
+
+
+
+
+
+ Način
+
+
+
+
+
+ both
+ insert
+ update
+ keyref
+
+
+
+
+
+ Skupina
+
+
+
+
+
+
+
+ Meta ključ
+
+
+
+ Meta tip
+
+
+
+
+
+ string
+ number
+ date
+ boolean
+
+
+
+
+
+
+
+ Shrani
+ Izbriši
+
+
+
+
+
+
diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php
index 835ce84..b7f3c09 100644
--- a/routes/breadcrumbs.php
+++ b/routes/breadcrumbs.php
@@ -6,6 +6,7 @@
// this import. This is nice for IDE syntax and refactoring.
use App\Models\Client;
use App\Models\ClientCase;
+use App\Models\ImportTemplate;
use App\Models\Segment;
use Diglactic\Breadcrumbs\Breadcrumbs;
// This import is also not required, and you could replace `BreadcrumbTrail $trail`
@@ -107,3 +108,33 @@
$trail->parent('dashboard');
$trail->push('Terenska dela', route('fieldjobs.index'));
});
+
+// Dashboard > Imports
+
+Breadcrumbs::for('imports.index', function (BreadcrumbTrail $trail) {
+ $trail->parent('dashboard');
+ $trail->push('Uvozi', route('imports.index'));
+});
+
+// Dashboard > Imports > Templates
+
+Breadcrumbs::for('importTemplates.index', function (BreadcrumbTrail $trail) {
+ $trail->parent('imports.index');
+ $trail->push('Uvozne predloge', route('importTemplates.index'));
+});
+
+
+// Dashboard > Imports > Templates > Create
+
+Breadcrumbs::for('importTemplates.create', function (BreadcrumbTrail $trail) {
+ $trail->parent('importTemplates.index');
+ $trail->push('Ustvari', route('importTemplates.create'));
+});
+
+
+// Dashboard > Imports > Templates > Edit > [Template]
+
+Breadcrumbs::for('importTemplates.edit', function (BreadcrumbTrail $trail, ImportTemplate $template) {
+ $trail->parent('importTemplates.index');
+ $trail->push($template->name, route('importTemplates.edit', $template));
+});