-
-
-
-
-
-
-
-
-
-
-
{{ clientCase.person.tax_number }}
-
-
{{ clientCase.person.name }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Primeri
+
+
+
+
+
+
+ | Št. |
+ Primer |
+ Stranka |
+ Davčna |
+ Aktivne pogodbe |
+ Skupaj stanje |
+
+
+
+
+ | {{ c.person?.nu || "-" }} |
+
+
+ {{ c.person?.full_name || "-" }}
+
+ |
+ {{ c.client?.person?.full_name || "-" }} |
+
+ {{ c.person?.tax_number || "-" }} |
+
+ {{ c.active_contracts_count ?? 0 }}
+ |
+
+ {{ fmtCurrency(c.active_contracts_balance_sum) }}
+ |
+
+
+ | Ni zadetkov. |
+
+
+
+
+
+
-
-
\ No newline at end of file
+
+
+
+
diff --git a/resources/js/Pages/Cases/Partials/ActivityTable.vue b/resources/js/Pages/Cases/Partials/ActivityTable.vue
index f31f7b9..147ce97 100644
--- a/resources/js/Pages/Cases/Partials/ActivityTable.vue
+++ b/resources/js/Pages/Cases/Partials/ActivityTable.vue
@@ -1,53 +1,163 @@
+
-
-
\ No newline at end of file
+
+
+
+ Pogodba
+ Datum
+ Akcija
+ Odločitev
+ Opomba
+ Datum zapadlosti
+ Znesek obljube
+ Dodal
+
+
+
+
+
+ {{
+ row.contract?.reference || ""
+ }}
+ {{ fmtDate(row.created_at) }}
+ {{ row.action?.name || "" }}
+ {{ row.decision?.name || "" }}
+ {{ row.note || "" }}
+ {{ fmtDate(row.due_date) }}
+ {{
+ fmtCurrency(row.amount)
+ }}
+ {{
+ row.user?.name || row.user_name || ""
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ni aktivnosti.
+
+
+
+
+
+
+
+ Potrditev
+
+ Ali ste prepričani, da želite izbrisati to aktivnost? Tega dejanja ni mogoče
+ razveljaviti.
+
+
+ Prekliči
+ Izbriši
+
+
+
diff --git a/resources/js/Pages/Cases/Partials/ContractDrawer.vue b/resources/js/Pages/Cases/Partials/ContractDrawer.vue
index be0721d..a724791 100644
--- a/resources/js/Pages/Cases/Partials/ContractDrawer.vue
+++ b/resources/js/Pages/Cases/Partials/ContractDrawer.vue
@@ -94,10 +94,21 @@ const storeOrUpdate = () => {
},
preserveScroll: true,
}
+ const params = {}
+ try {
+ const url = new URL(window.location.href)
+ const seg = url.searchParams.get('segment')
+ if (seg) params.segment = seg
+ } catch (e) {}
if (isEdit) {
- formContract.put(route('clientCase.contract.update', { client_case: props.client_case.uuid, uuid: formContract.uuid }), options)
+ formContract.put(route('clientCase.contract.update', { client_case: props.client_case.uuid, uuid: formContract.uuid, ...params }), options)
} else {
- formContract.post(route('clientCase.contract.store', props.client_case), options)
+ // route helper merges params for GET; for POST we can append query manually if needed
+ let postUrl = route('clientCase.contract.store', props.client_case)
+ if (params.segment) {
+ postUrl += (postUrl.includes('?') ? '&' : '?') + 'segment=' + encodeURIComponent(params.segment)
+ }
+ formContract.post(postUrl, options)
}
}
diff --git a/resources/js/Pages/Cases/Show.vue b/resources/js/Pages/Cases/Show.vue
index 1cad929..be88263 100644
--- a/resources/js/Pages/Cases/Show.vue
+++ b/resources/js/Pages/Cases/Show.vue
@@ -12,11 +12,11 @@ import DocumentsTable from "@/Components/DocumentsTable.vue";
import DocumentUploadDialog from "@/Components/DocumentUploadDialog.vue";
import DocumentViewerDialog from "@/Components/DocumentViewerDialog.vue";
import { classifyDocument } from "@/Services/documents";
-import { router, useForm } from '@inertiajs/vue3';
+import { router, useForm } from "@inertiajs/vue3";
import { AngleDownIcon, AngleUpIcon } from "@/Utilities/Icons";
import Pagination from "@/Components/Pagination.vue";
import ConfirmDialog from "@/Components/ConfirmDialog.vue";
-import DialogModal from '@/Components/DialogModal.vue';
+import DialogModal from "@/Components/DialogModal.vue";
const props = defineProps({
client: Object,
@@ -30,33 +30,55 @@ const props = defineProps({
documents: Array,
segments: { type: Array, default: () => [] },
all_segments: { type: Array, default: () => [] },
+ current_segment: { type: Object, default: null },
});
const showUpload = ref(false);
-const openUpload = () => { showUpload.value = true; };
-const closeUpload = () => { showUpload.value = false; };
+const openUpload = () => {
+ showUpload.value = true;
+};
+const closeUpload = () => {
+ showUpload.value = false;
+};
const onUploaded = () => {
// Refresh page data to include the new document
- router.reload({ only: ['documents'] });
+ router.reload({ only: ["documents"] });
};
-const viewer = ref({ open: false, src: '', title: '' });
+const viewer = ref({ open: false, src: "", title: "" });
const openViewer = (doc) => {
- const kind = classifyDocument(doc)
- const isContractDoc = (doc?.documentable_type || '').toLowerCase().includes('contract')
- if (kind === 'preview') {
- const url = isContractDoc && doc.contract_uuid
- ? route('contract.document.view', { contract: doc.contract_uuid, document: doc.uuid })
- : route('clientCase.document.view', { client_case: props.client_case.uuid, document: doc.uuid })
- viewer.value = { open: true, src: url, title: doc.original_name || doc.name }
+ const kind = classifyDocument(doc);
+ const isContractDoc = (doc?.documentable_type || "").toLowerCase().includes("contract");
+ if (kind === "preview") {
+ const url =
+ isContractDoc && doc.contract_uuid
+ ? route("contract.document.view", {
+ contract: doc.contract_uuid,
+ document: doc.uuid,
+ })
+ : route("clientCase.document.view", {
+ client_case: props.client_case.uuid,
+ document: doc.uuid,
+ });
+ viewer.value = { open: true, src: url, title: doc.original_name || doc.name };
} else {
- const url = isContractDoc && doc.contract_uuid
- ? route('contract.document.download', { contract: doc.contract_uuid, document: doc.uuid })
- : route('clientCase.document.download', { client_case: props.client_case.uuid, document: doc.uuid })
- window.location.href = url
+ const url =
+ isContractDoc && doc.contract_uuid
+ ? route("contract.document.download", {
+ contract: doc.contract_uuid,
+ document: doc.uuid,
+ })
+ : route("clientCase.document.download", {
+ client_case: props.client_case.uuid,
+ document: doc.uuid,
+ });
+ window.location.href = url;
}
-}
-const closeViewer = () => { viewer.value.open = false; viewer.value.src = ''; };
+};
+const closeViewer = () => {
+ viewer.value.open = false;
+ viewer.value.src = "";
+};
const clientDetails = ref(false);
@@ -82,17 +104,36 @@ const openDrawerAddActivity = (c = null) => {
};
// delete confirmation
-const confirmDelete = ref({ show: false, contract: null })
-const requestDeleteContract = (c) => { confirmDelete.value = { show: true, contract: c } }
-const closeConfirmDelete = () => { confirmDelete.value.show = false; confirmDelete.value.contract = null }
+const confirmDelete = ref({ show: false, contract: null });
+const requestDeleteContract = (c) => {
+ confirmDelete.value = { show: true, contract: c };
+};
+const closeConfirmDelete = () => {
+ confirmDelete.value.show = false;
+ confirmDelete.value.contract = null;
+};
const doDeleteContract = () => {
- const c = confirmDelete.value.contract
- if (!c) return closeConfirmDelete()
- router.delete(route('clientCase.contract.delete', { client_case: props.client_case.uuid, uuid: c.uuid }), {
- preserveScroll: true,
- onFinish: () => closeConfirmDelete(),
- })
-}
+ const c = confirmDelete.value.contract;
+ if (!c) return closeConfirmDelete();
+ // Keep segment filter in redirect
+ const params = {};
+ try {
+ const url = new URL(window.location.href);
+ const seg = url.searchParams.get("segment");
+ if (seg) params.segment = seg;
+ } catch (e) {}
+ router.delete(
+ route("clientCase.contract.delete", {
+ client_case: props.client_case.uuid,
+ uuid: c.uuid,
+ ...params,
+ }),
+ {
+ preserveScroll: true,
+ onFinish: () => closeConfirmDelete(),
+ }
+ );
+};
//Close drawer (all)
const closeDrawer = () => {
@@ -109,35 +150,52 @@ const hideClietnDetails = () => {
};
// Attach segment to case
-const showAttachSegment = ref(false)
-const openAttachSegment = () => { showAttachSegment.value = true }
-const closeAttachSegment = () => { showAttachSegment.value = false }
-const attachForm = useForm({ segment_id: null })
+const showAttachSegment = ref(false);
+const openAttachSegment = () => {
+ showAttachSegment.value = true;
+};
+const closeAttachSegment = () => {
+ showAttachSegment.value = false;
+};
+const attachForm = useForm({ segment_id: null });
const availableSegments = computed(() => {
- const current = new Set((props.segments || []).map(s => s.id))
- return (props.all_segments || []).filter(s => !current.has(s.id))
-})
+ const current = new Set((props.segments || []).map((s) => s.id));
+ return (props.all_segments || []).filter((s) => !current.has(s.id));
+});
const submitAttachSegment = () => {
- if (!attachForm.segment_id) { return }
- attachForm.post(route('clientCase.segments.attach', props.client_case), {
+ if (!attachForm.segment_id) {
+ return;
+ }
+ attachForm.post(route("clientCase.segments.attach", props.client_case), {
preserveScroll: true,
- only: ['segments'],
+ only: ["segments"],
onSuccess: () => {
- closeAttachSegment()
- attachForm.reset('segment_id')
- }
- })
-}
+ closeAttachSegment();
+ attachForm.reset("segment_id");
+ },
+ });
+};
+
+
+
+ Segment:
+
+ {{ current_segment.name }}
+
+
+
-
+
@@ -189,7 +253,11 @@ const submitAttachSegment = () => {
class="bg-white overflow-hidden shadow-xl sm:rounded-lg border-l-4 border-red-400"
>
@@ -204,8 +272,16 @@ const submitAttachSegment = () => {
Nova
-
- {{ availableSegments.length ? 'Dodaj segment' : 'Ni razpoložljivih segmentov' }}
+
+ {{
+ availableSegments.length
+ ? "Dodaj segment"
+ : "Ni razpoložljivih segmentov"
+ }}
@@ -222,7 +298,7 @@ const submitAttachSegment = () => {