ptechcore_ui 1.0.76 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +279 -192
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +306 -218
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -405,7 +405,8 @@ import {
|
|
|
405
405
|
Save,
|
|
406
406
|
Loader2,
|
|
407
407
|
Check as Check2,
|
|
408
|
-
Trash2
|
|
408
|
+
Trash2,
|
|
409
|
+
MailOpen
|
|
409
410
|
} from "lucide-react";
|
|
410
411
|
|
|
411
412
|
// src/assets/modules-icons/crm-blue.svg
|
|
@@ -507,6 +508,25 @@ function formatCurrency(amount, currency = "XAF") {
|
|
|
507
508
|
}
|
|
508
509
|
return new Intl.NumberFormat("fr-FR").format(amount) + " " + currency;
|
|
509
510
|
}
|
|
511
|
+
function formatDateTime(date) {
|
|
512
|
+
if (!date) return "Non d\xE9fini";
|
|
513
|
+
try {
|
|
514
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
515
|
+
if (isNaN(dateObj.getTime())) {
|
|
516
|
+
return "Date invalide";
|
|
517
|
+
}
|
|
518
|
+
return dateObj.toLocaleDateString("fr-FR", {
|
|
519
|
+
year: "numeric",
|
|
520
|
+
month: "long",
|
|
521
|
+
day: "numeric",
|
|
522
|
+
hour: "2-digit",
|
|
523
|
+
minute: "2-digit",
|
|
524
|
+
second: "2-digit"
|
|
525
|
+
});
|
|
526
|
+
} catch (error) {
|
|
527
|
+
return "Erreur de format";
|
|
528
|
+
}
|
|
529
|
+
}
|
|
510
530
|
|
|
511
531
|
// src/contexts/ThemeContext.tsx
|
|
512
532
|
import { createContext, useContext, useState as useState2, useEffect as useEffect2 } from "react";
|
|
@@ -982,6 +1002,80 @@ var FetchApi = class {
|
|
|
982
1002
|
if (!res.ok) throw new Error(await res.text());
|
|
983
1003
|
return res.json();
|
|
984
1004
|
}
|
|
1005
|
+
static async postFile(url, payload, token) {
|
|
1006
|
+
const headers = {};
|
|
1007
|
+
const local_token = localStorage.getItem("token");
|
|
1008
|
+
if (local_token) {
|
|
1009
|
+
headers["Authorization"] = `Token ${local_token}`;
|
|
1010
|
+
}
|
|
1011
|
+
let body;
|
|
1012
|
+
const business_entity_id = localStorage.getItem("active_center_id");
|
|
1013
|
+
if (payload instanceof FormData) {
|
|
1014
|
+
if (business_entity_id) {
|
|
1015
|
+
payload.append("business_entity_id", business_entity_id);
|
|
1016
|
+
payload.append("business_entity", business_entity_id);
|
|
1017
|
+
}
|
|
1018
|
+
body = payload;
|
|
1019
|
+
} else if (payload) {
|
|
1020
|
+
const formData = new FormData();
|
|
1021
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
1022
|
+
if (Array.isArray(value)) {
|
|
1023
|
+
formData.append(key, value.join(","));
|
|
1024
|
+
} else if (value !== null && value !== void 0) {
|
|
1025
|
+
formData.append(key, value);
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
if (business_entity_id) {
|
|
1029
|
+
formData.append("business_entity_id", business_entity_id);
|
|
1030
|
+
formData.append("business_entity", business_entity_id);
|
|
1031
|
+
}
|
|
1032
|
+
body = formData;
|
|
1033
|
+
}
|
|
1034
|
+
const res = await fetch(url, {
|
|
1035
|
+
method: "POST",
|
|
1036
|
+
headers,
|
|
1037
|
+
body
|
|
1038
|
+
});
|
|
1039
|
+
if (!res.ok) throw new Error(await res.text());
|
|
1040
|
+
return res.json();
|
|
1041
|
+
}
|
|
1042
|
+
static async putFile(url, payload, token) {
|
|
1043
|
+
const headers = {};
|
|
1044
|
+
const local_token = localStorage.getItem("token");
|
|
1045
|
+
if (local_token) {
|
|
1046
|
+
headers["Authorization"] = `Token ${local_token}`;
|
|
1047
|
+
}
|
|
1048
|
+
let body;
|
|
1049
|
+
const business_entity_id = localStorage.getItem("active_center_id");
|
|
1050
|
+
if (payload instanceof FormData) {
|
|
1051
|
+
if (business_entity_id) {
|
|
1052
|
+
payload.append("business_entity_id", business_entity_id);
|
|
1053
|
+
payload.append("business_entity", business_entity_id);
|
|
1054
|
+
}
|
|
1055
|
+
body = payload;
|
|
1056
|
+
} else if (payload) {
|
|
1057
|
+
const formData = new FormData();
|
|
1058
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
1059
|
+
if (Array.isArray(value)) {
|
|
1060
|
+
formData.append(key, value.join(","));
|
|
1061
|
+
} else if (value !== null && value !== void 0) {
|
|
1062
|
+
formData.append(key, value);
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
if (business_entity_id) {
|
|
1066
|
+
formData.append("business_entity_id", business_entity_id);
|
|
1067
|
+
formData.append("business_entity", business_entity_id);
|
|
1068
|
+
}
|
|
1069
|
+
body = formData;
|
|
1070
|
+
}
|
|
1071
|
+
const res = await fetch(url, {
|
|
1072
|
+
method: "PUT",
|
|
1073
|
+
headers,
|
|
1074
|
+
body
|
|
1075
|
+
});
|
|
1076
|
+
if (!res.ok) throw new Error(await res.text());
|
|
1077
|
+
return res.json();
|
|
1078
|
+
}
|
|
985
1079
|
static async patch(url, payload, token) {
|
|
986
1080
|
const headers = {
|
|
987
1081
|
"Content-Type": "application/json"
|
|
@@ -1003,14 +1097,18 @@ var FetchApi = class {
|
|
|
1003
1097
|
var apiClient = {
|
|
1004
1098
|
get: (path) => FetchApi.get(`${API_URL}${path}`),
|
|
1005
1099
|
post: (path, data) => FetchApi.post(`${API_URL}${path}`, data),
|
|
1100
|
+
postFile: (path, data) => FetchApi.postFile(`${API_URL}${path}`, data),
|
|
1006
1101
|
put: (path, data) => FetchApi.put(`${API_URL}${path}`, data),
|
|
1102
|
+
putFile: (path, data) => FetchApi.putFile(`${API_URL}${path}`, data),
|
|
1007
1103
|
patch: (path, data) => FetchApi.patch(`${API_URL}${path}`, data),
|
|
1008
1104
|
delete: (path) => FetchApi.delete(`${API_URL}${path}`)
|
|
1009
1105
|
};
|
|
1010
1106
|
var coreApiClient = {
|
|
1011
1107
|
get: (path) => FetchApi.get(`${API_URL}/core${path}`),
|
|
1012
1108
|
post: (path, data) => FetchApi.post(`${API_URL}/core${path}`, data),
|
|
1109
|
+
postFile: (path, data) => FetchApi.postFile(`${API_URL}/core${path}`, data),
|
|
1013
1110
|
put: (path, data) => FetchApi.put(`${API_URL}/core${path}`, data),
|
|
1111
|
+
putFile: (path, data) => FetchApi.putFile(`${API_URL}/core${path}`, data),
|
|
1014
1112
|
patch: (path, data) => FetchApi.patch(`${API_URL}/core${path}`, data),
|
|
1015
1113
|
delete: (path) => FetchApi.delete(`${API_URL}/core${path}`)
|
|
1016
1114
|
};
|
|
@@ -1237,7 +1335,7 @@ var UserServices = {
|
|
|
1237
1335
|
// Obtenir toutes les notifications de l'utilisateur
|
|
1238
1336
|
getUsersNotifications: () => FetchApi.get(`${USERS_API_URL}notifications/`),
|
|
1239
1337
|
// Marquer une notification comme lue
|
|
1240
|
-
markNotificationAsRead: (notificationId) => FetchApi.post(`${
|
|
1338
|
+
markNotificationAsRead: (notificationId) => FetchApi.post(`${API_URL}/core/notifications/${notificationId}/mark-read/`, {}),
|
|
1241
1339
|
// Obtenir un utilisateur par ID
|
|
1242
1340
|
getUser: (id, token) => FetchApi.get(`${USERS_API_URL}${id}/`, token),
|
|
1243
1341
|
// Mettre à jour un utilisateur
|
|
@@ -2791,11 +2889,11 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2791
2889
|
{
|
|
2792
2890
|
className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2793
2891
|
onClick: () => setShowNotifications(!showNotifications),
|
|
2794
|
-
|
|
2892
|
+
title: `Notifications ${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 ? `(${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length} non lues)` : ""}`,
|
|
2795
2893
|
"aria-expanded": showNotifications,
|
|
2796
2894
|
children: [
|
|
2797
2895
|
/* @__PURE__ */ jsx9(Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
|
|
2798
|
-
notifications.filter((n) => !n.
|
|
2896
|
+
notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 && /* @__PURE__ */ jsx9("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
|
|
2799
2897
|
]
|
|
2800
2898
|
}
|
|
2801
2899
|
),
|
|
@@ -2807,31 +2905,29 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2807
2905
|
"aria-label": "Centre de notifications",
|
|
2808
2906
|
children: [
|
|
2809
2907
|
/* @__PURE__ */ jsx9("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx9("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
|
|
2810
|
-
/* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
"
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
"
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
notif.id
|
|
2834
|
-
)) })
|
|
2908
|
+
/* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
|
|
2909
|
+
(notif) => {
|
|
2910
|
+
const is_read = notif.is_read || ["approved"].includes(notif?.object_detail?.answer);
|
|
2911
|
+
return /* @__PURE__ */ jsx9(
|
|
2912
|
+
"div",
|
|
2913
|
+
{
|
|
2914
|
+
className: cn(
|
|
2915
|
+
"p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer"
|
|
2916
|
+
),
|
|
2917
|
+
onClick: () => markNotificationAsRead(notif.id),
|
|
2918
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3", children: [
|
|
2919
|
+
/* @__PURE__ */ jsx9("div", { className: "mt-2", children: !is_read ? /* @__PURE__ */ jsx9(Mail, { size: 15, className: "text-[var(--color-primary)]" }) : /* @__PURE__ */ jsx9(MailOpen, { size: 15, className: "text-gray-500" }) }),
|
|
2920
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
|
|
2921
|
+
/* @__PURE__ */ jsx9("p", { className: `text-sm ${!is_read ? "text-black font-bold" : " font-normal text-[var(--color-text-primary)]"}`, children: /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-2", children: notif.title }) }),
|
|
2922
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
|
|
2923
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: formatDateTime(notif?.created_at) ?? "-" })
|
|
2924
|
+
] })
|
|
2925
|
+
] })
|
|
2926
|
+
},
|
|
2927
|
+
notif.id
|
|
2928
|
+
);
|
|
2929
|
+
}
|
|
2930
|
+
) })
|
|
2835
2931
|
]
|
|
2836
2932
|
}
|
|
2837
2933
|
)
|
|
@@ -7029,7 +7125,7 @@ var formatFileSize = (bytes) => {
|
|
|
7029
7125
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
7030
7126
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${units[i]}`;
|
|
7031
7127
|
};
|
|
7032
|
-
var
|
|
7128
|
+
var formatDate2 = (date) => {
|
|
7033
7129
|
if (!date) {
|
|
7034
7130
|
return "-";
|
|
7035
7131
|
}
|
|
@@ -7043,7 +7139,7 @@ var formatDate = (date) => {
|
|
|
7043
7139
|
year: "numeric"
|
|
7044
7140
|
});
|
|
7045
7141
|
};
|
|
7046
|
-
var
|
|
7142
|
+
var formatDateTime2 = (date) => {
|
|
7047
7143
|
if (!date) {
|
|
7048
7144
|
return "-";
|
|
7049
7145
|
}
|
|
@@ -7199,7 +7295,7 @@ var FileCard = ({ item, variant = "grid" }) => {
|
|
|
7199
7295
|
}
|
|
7200
7296
|
) : /* @__PURE__ */ jsx20("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
|
|
7201
7297
|
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
|
|
7202
|
-
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children:
|
|
7298
|
+
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate2(item.updatedAt || item.createdAt) })
|
|
7203
7299
|
]
|
|
7204
7300
|
}
|
|
7205
7301
|
);
|
|
@@ -9542,13 +9638,12 @@ var FormVendor = ({
|
|
|
9542
9638
|
}
|
|
9543
9639
|
),
|
|
9544
9640
|
/* @__PURE__ */ jsx30(
|
|
9545
|
-
|
|
9641
|
+
SelectLegalForm,
|
|
9546
9642
|
{
|
|
9547
|
-
label: "Forme juridique",
|
|
9548
|
-
name: "legal_form",
|
|
9549
9643
|
value: formData.legal_form || "",
|
|
9550
|
-
|
|
9551
|
-
|
|
9644
|
+
onSelect: (option) => setFormData((prev) => ({ ...prev, legal_form: String(option.value) })),
|
|
9645
|
+
allowClear: true,
|
|
9646
|
+
onRemove: () => setFormData((prev) => ({ ...prev, legal_form: "" }))
|
|
9552
9647
|
}
|
|
9553
9648
|
),
|
|
9554
9649
|
/* @__PURE__ */ jsx30(
|
|
@@ -10148,13 +10243,12 @@ var FormClient = ({
|
|
|
10148
10243
|
}
|
|
10149
10244
|
),
|
|
10150
10245
|
/* @__PURE__ */ jsx31(
|
|
10151
|
-
|
|
10246
|
+
SelectLegalForm,
|
|
10152
10247
|
{
|
|
10153
|
-
label: "Forme juridique",
|
|
10154
|
-
name: "legal_form",
|
|
10155
10248
|
value: formData.legal_form || "",
|
|
10156
|
-
|
|
10157
|
-
|
|
10249
|
+
onSelect: (option) => setFormData((prev) => ({ ...prev, legal_form: String(option.value) })),
|
|
10250
|
+
allowClear: true,
|
|
10251
|
+
onRemove: () => setFormData((prev) => ({ ...prev, legal_form: "" }))
|
|
10158
10252
|
}
|
|
10159
10253
|
),
|
|
10160
10254
|
/* @__PURE__ */ jsx31(
|
|
@@ -10599,7 +10693,7 @@ var FormClient = ({
|
|
|
10599
10693
|
|
|
10600
10694
|
// src/components/common/ApprovalWorkflow.tsx
|
|
10601
10695
|
import { useState as useState22, useEffect as useEffect15 } from "react";
|
|
10602
|
-
import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3,
|
|
10696
|
+
import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3, Eye as Eye4, FileText as FileText6, History, Edit as Edit2, MessageSquare } from "lucide-react";
|
|
10603
10697
|
import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10604
10698
|
var ApprovalWorkflow = ({
|
|
10605
10699
|
process,
|
|
@@ -10672,6 +10766,7 @@ var ApprovalWorkflow = ({
|
|
|
10672
10766
|
if (!token) return;
|
|
10673
10767
|
try {
|
|
10674
10768
|
const response = await ApprovalServices.getDetails(process, object_id, token);
|
|
10769
|
+
console.log("Response case details:", response.success && response.data);
|
|
10675
10770
|
if (response.success && response.data) {
|
|
10676
10771
|
const caseInfo = response.data;
|
|
10677
10772
|
setCaseData(caseInfo);
|
|
@@ -10691,7 +10786,7 @@ var ApprovalWorkflow = ({
|
|
|
10691
10786
|
email: v.user_detail?.email || "",
|
|
10692
10787
|
role: v.user_detail?.phonenumber || "-",
|
|
10693
10788
|
status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
|
|
10694
|
-
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
|
|
10789
|
+
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
|
|
10695
10790
|
rank: v.rank,
|
|
10696
10791
|
note: v.note
|
|
10697
10792
|
})));
|
|
@@ -10706,7 +10801,7 @@ var ApprovalWorkflow = ({
|
|
|
10706
10801
|
email: v.user_detail?.email || "",
|
|
10707
10802
|
role: v.user_detail?.phonenumber || "-",
|
|
10708
10803
|
status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
|
|
10709
|
-
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
|
|
10804
|
+
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
|
|
10710
10805
|
rank: v.rank,
|
|
10711
10806
|
note: v.note
|
|
10712
10807
|
})));
|
|
@@ -10781,14 +10876,24 @@ var ApprovalWorkflow = ({
|
|
|
10781
10876
|
}
|
|
10782
10877
|
setTransmitting(true);
|
|
10783
10878
|
try {
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
const response = await ApprovalServices.start(caseData.id, token);
|
|
10879
|
+
if (formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && caseData?.id) {
|
|
10880
|
+
const response = await ApprovalServices.restart(caseData.id, token);
|
|
10787
10881
|
if (response.success) {
|
|
10788
|
-
showSuccess("
|
|
10882
|
+
showSuccess("Nouvelle version cr\xE9\xE9e et transmise avec succ\xE8s");
|
|
10789
10883
|
await loadCase();
|
|
10790
10884
|
} else {
|
|
10791
|
-
showError("Erreur lors de la transmission");
|
|
10885
|
+
showError("Erreur lors de la re-transmission");
|
|
10886
|
+
}
|
|
10887
|
+
} else {
|
|
10888
|
+
await handleSave();
|
|
10889
|
+
if (caseData?.id) {
|
|
10890
|
+
const response = await ApprovalServices.start(caseData.id, token);
|
|
10891
|
+
if (response.success) {
|
|
10892
|
+
showSuccess("Demande de validation transmise avec succ\xE8s");
|
|
10893
|
+
await loadCase();
|
|
10894
|
+
} else {
|
|
10895
|
+
showError("Erreur lors de la transmission");
|
|
10896
|
+
}
|
|
10792
10897
|
}
|
|
10793
10898
|
}
|
|
10794
10899
|
} catch (error) {
|
|
@@ -10947,64 +11052,37 @@ var ApprovalWorkflow = ({
|
|
|
10947
11052
|
switch (activeTab) {
|
|
10948
11053
|
case "workflow":
|
|
10949
11054
|
return /* @__PURE__ */ jsxs26("div", { className: "space-y-6", children: [
|
|
11055
|
+
formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && /* @__PURE__ */ jsxs26("div", { className: "p-4 rounded-lg border border-[var(--color-warning)] bg-[var(--color-warning-light)] flex items-start gap-3", children: [
|
|
11056
|
+
/* @__PURE__ */ jsx32(Edit2, { className: "w-5 h-5 flex-shrink-0 mt-0.5", style: { color: "var(--color-warning)" } }),
|
|
11057
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
11058
|
+
/* @__PURE__ */ jsx32("p", { className: "text-sm font-medium", style: { color: "var(--color-warning)" }, children: "Une modification a \xE9t\xE9 sugg\xE9r\xE9e sur cette demande" }),
|
|
11059
|
+
/* @__PURE__ */ jsx32("p", { className: "text-xs text-gray-500 mt-1", children: "Veuillez prendre en compte les commentaires et re-transmettre la demande." })
|
|
11060
|
+
] })
|
|
11061
|
+
] }),
|
|
10950
11062
|
renderStageSection("Verification", verification, setVerification, "verification"),
|
|
10951
11063
|
renderStageSection("Validation", validation, setValidation, "validation"),
|
|
10952
11064
|
!readOnly && /* @__PURE__ */ jsxs26("div", { className: "flex justify-between pt-4 border-t border-[#D9D9D9]", children: [
|
|
11065
|
+
/* @__PURE__ */ jsx32("div", { className: "flex gap-3" }),
|
|
10953
11066
|
/* @__PURE__ */ jsxs26("div", { className: "flex gap-3", children: [
|
|
10954
|
-
/* @__PURE__ */
|
|
10955
|
-
SecondaryButton,
|
|
10956
|
-
{
|
|
10957
|
-
onClick: () => window.history.back(),
|
|
10958
|
-
type: "button",
|
|
10959
|
-
children: "Retour"
|
|
10960
|
-
}
|
|
10961
|
-
),
|
|
10962
|
-
caseData?.id && formData.status !== "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsxs26(Fragment9, { children: [
|
|
10963
|
-
/* @__PURE__ */ jsxs26(
|
|
10964
|
-
SecondaryButton,
|
|
10965
|
-
{
|
|
10966
|
-
onClick: handleCancel,
|
|
10967
|
-
disabled: canceling,
|
|
10968
|
-
type: "button",
|
|
10969
|
-
classname: "flex items-center gap-2",
|
|
10970
|
-
children: [
|
|
10971
|
-
/* @__PURE__ */ jsx32(Ban, { className: "w-4 h-4" }),
|
|
10972
|
-
canceling ? "Annulation..." : "Annuler la demande"
|
|
10973
|
-
]
|
|
10974
|
-
}
|
|
10975
|
-
),
|
|
10976
|
-
/* @__PURE__ */ jsxs26(
|
|
10977
|
-
SecondaryButton,
|
|
10978
|
-
{
|
|
10979
|
-
onClick: handleRestart,
|
|
10980
|
-
disabled: restarting,
|
|
10981
|
-
type: "button",
|
|
10982
|
-
classname: "flex items-center gap-2",
|
|
10983
|
-
children: [
|
|
10984
|
-
/* @__PURE__ */ jsx32(RotateCcw, { className: "w-4 h-4" }),
|
|
10985
|
-
restarting ? "Red\xE9marrage..." : "Recommencer"
|
|
10986
|
-
]
|
|
10987
|
-
}
|
|
10988
|
-
)
|
|
10989
|
-
] })
|
|
10990
|
-
] }),
|
|
10991
|
-
/* @__PURE__ */ jsxs26("div", { className: "flex gap-3", children: [
|
|
10992
|
-
/* @__PURE__ */ jsx32(
|
|
11067
|
+
(formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsxs26(
|
|
10993
11068
|
Buttons_default,
|
|
10994
11069
|
{
|
|
10995
11070
|
onClick: handleSave,
|
|
10996
11071
|
disabled: saving,
|
|
10997
11072
|
type: "button",
|
|
10998
|
-
children:
|
|
11073
|
+
children: [
|
|
11074
|
+
" ",
|
|
11075
|
+
saving ? "Enregistrement..." : "Enregistrer"
|
|
11076
|
+
]
|
|
10999
11077
|
}
|
|
11000
11078
|
),
|
|
11001
|
-
formData.status === "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsx32(
|
|
11079
|
+
(formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsx32(
|
|
11002
11080
|
Buttons_default,
|
|
11003
11081
|
{
|
|
11004
11082
|
onClick: handleTransmit,
|
|
11005
11083
|
disabled: transmitting || saving,
|
|
11006
11084
|
type: "button",
|
|
11007
|
-
children: transmitting ? "Transmission..." : "Transmettre"
|
|
11085
|
+
children: transmitting ? "Transmission..." : formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ ? "Re-transmettre" : "Transmettre"
|
|
11008
11086
|
}
|
|
11009
11087
|
)
|
|
11010
11088
|
] })
|
|
@@ -11209,71 +11287,81 @@ var StageRow = ({
|
|
|
11209
11287
|
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-gray-300 rounded-full", children: /* @__PURE__ */ jsx32("span", { className: "text-white text-xs", children: "\u23F1" }) });
|
|
11210
11288
|
} else if (answer === -1) {
|
|
11211
11289
|
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-error)] rounded-full", children: /* @__PURE__ */ jsx32("svg", { className: "w-4 h-4 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx32("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) });
|
|
11290
|
+
} else if (answer === -2) {
|
|
11291
|
+
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-warning)] rounded-full", children: /* @__PURE__ */ jsx32(Edit2, { className: "w-4 h-4 text-white" }) });
|
|
11212
11292
|
}
|
|
11213
11293
|
return /* @__PURE__ */ jsx32("span", { className: "text-gray-400 text-xs", children: "-" });
|
|
11214
11294
|
};
|
|
11215
|
-
return /* @__PURE__ */ jsxs26(
|
|
11216
|
-
/* @__PURE__ */
|
|
11217
|
-
"
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
"
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11295
|
+
return /* @__PURE__ */ jsxs26(Fragment9, { children: [
|
|
11296
|
+
/* @__PURE__ */ jsxs26("tr", { className: "hover:bg-gray-50", children: [
|
|
11297
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ jsx32(
|
|
11298
|
+
"button",
|
|
11299
|
+
{
|
|
11300
|
+
type: "button",
|
|
11301
|
+
onClick: onRemove,
|
|
11302
|
+
className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
|
|
11303
|
+
title: "Supprimer",
|
|
11304
|
+
children: /* @__PURE__ */ jsx32(Trash25, { className: "w-4 h-4" })
|
|
11305
|
+
}
|
|
11306
|
+
) }),
|
|
11307
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
|
|
11308
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11309
|
+
SelectInput,
|
|
11310
|
+
{
|
|
11311
|
+
value: stage.space_answer,
|
|
11312
|
+
onChange: (e) => handleSpaceAnswerChange(e),
|
|
11313
|
+
disabled: readOnly,
|
|
11314
|
+
options: [
|
|
11315
|
+
{ value: "internal", label: "Interne" },
|
|
11316
|
+
{ value: "external", label: "Externe" }
|
|
11317
|
+
]
|
|
11318
|
+
}
|
|
11319
|
+
) }),
|
|
11320
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ jsx32(
|
|
11321
|
+
SearchableSelect,
|
|
11322
|
+
{
|
|
11323
|
+
options: userOptions,
|
|
11324
|
+
value: stage.user,
|
|
11325
|
+
placeholder: "S\xE9lectionner...",
|
|
11326
|
+
searchPlaceholder: "Rechercher...",
|
|
11327
|
+
onSelect: handleUserSelect,
|
|
11328
|
+
disabled: readOnly || loadingUsers,
|
|
11329
|
+
filterFunction: userFilterFunction
|
|
11330
|
+
}
|
|
11331
|
+
) : /* @__PURE__ */ jsx32(
|
|
11332
|
+
TextInput,
|
|
11333
|
+
{
|
|
11334
|
+
value: stage.name,
|
|
11335
|
+
onChange: (e) => onUpdate({ name: e.target.value }),
|
|
11336
|
+
disabled: readOnly
|
|
11337
|
+
}
|
|
11338
|
+
) }),
|
|
11339
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11340
|
+
TextInput,
|
|
11341
|
+
{
|
|
11342
|
+
type: "email",
|
|
11343
|
+
value: stage.email,
|
|
11344
|
+
onChange: (e) => onUpdate({ email: e.target.value }),
|
|
11345
|
+
disabled: readOnly || stage.space_answer === "internal"
|
|
11346
|
+
}
|
|
11347
|
+
) }),
|
|
11348
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11349
|
+
"input",
|
|
11350
|
+
{
|
|
11351
|
+
type: "text",
|
|
11352
|
+
value: stage.role,
|
|
11353
|
+
disabled: true,
|
|
11354
|
+
className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
|
|
11355
|
+
}
|
|
11356
|
+
) }),
|
|
11357
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
|
|
11358
|
+
] }),
|
|
11359
|
+
stage.note && /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { colSpan: 7, className: "border border-gray-300 px-4 py-2 bg-[var(--color-warning-light)]", children: /* @__PURE__ */ jsxs26("p", { className: "text-xs text-gray-600 italic flex items-center gap-1", children: [
|
|
11360
|
+
/* @__PURE__ */ jsx32(MessageSquare, { className: "w-3 h-3" }),
|
|
11361
|
+
' Note : "',
|
|
11362
|
+
stage.note,
|
|
11363
|
+
'"'
|
|
11364
|
+
] }) }) })
|
|
11277
11365
|
] });
|
|
11278
11366
|
};
|
|
11279
11367
|
var AddStageButton = ({
|
|
@@ -11824,7 +11912,7 @@ var getRole = (a, center_id) => {
|
|
|
11824
11912
|
console.log(a.user_detail, center_id);
|
|
11825
11913
|
return a.user_detail?.centers_access?.find((c) => c.id === center_id)?.fonction ?? "";
|
|
11826
11914
|
};
|
|
11827
|
-
var
|
|
11915
|
+
var formatDate3 = (date) => date ? formatDateFR(date) : "-";
|
|
11828
11916
|
var borderStyle = { borderColor: "var(--color-border)" };
|
|
11829
11917
|
var cellClass = "border px-2 py-1";
|
|
11830
11918
|
var headerStyle = { ...borderStyle, color: "var(--color-text-secondary)" };
|
|
@@ -11859,7 +11947,7 @@ var ApprovalRecap = ({ process, object_id }) => {
|
|
|
11859
11947
|
return /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11860
11948
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getName(item) }),
|
|
11861
11949
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getRole(item, activeBusinessEntity?.id ?? null) }),
|
|
11862
|
-
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children:
|
|
11950
|
+
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(item.answered_at) }),
|
|
11863
11951
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: s.color }, children: s.icon }) }),
|
|
11864
11952
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
|
|
11865
11953
|
] }, i);
|
|
@@ -11880,7 +11968,7 @@ var ApprovalRecap = ({ process, object_id }) => {
|
|
|
11880
11968
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: "Demand\xE9 par" }),
|
|
11881
11969
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: `${requester.first_name} ${requester.last_name}`.trim() }),
|
|
11882
11970
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: requester?.centers_access?.find((c) => c.id === activeBusinessEntity?.id)?.fonction ?? "" }),
|
|
11883
|
-
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children:
|
|
11971
|
+
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(caseData.created_at) }),
|
|
11884
11972
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: "var(--color-primary)" }, children: /* @__PURE__ */ jsx34(CheckCircle3, { className: "w-3.5 h-3.5" }) }) }),
|
|
11885
11973
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
|
|
11886
11974
|
] }),
|
|
@@ -12624,7 +12712,7 @@ var DetailField = ({ label, value }) => value ? /* @__PURE__ */ jsxs32("div", {
|
|
|
12624
12712
|
/* @__PURE__ */ jsx39("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: label }),
|
|
12625
12713
|
/* @__PURE__ */ jsx39("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: typeof value === "string" || typeof value === "number" ? value : value })
|
|
12626
12714
|
] }) : null;
|
|
12627
|
-
var
|
|
12715
|
+
var formatDate4 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
|
|
12628
12716
|
var ActivityDetailModal = ({ activity }) => {
|
|
12629
12717
|
const d = activity.detail;
|
|
12630
12718
|
if (!d) return /* @__PURE__ */ jsx39("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Aucun d\xE9tail disponible." });
|
|
@@ -12647,7 +12735,7 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12647
12735
|
/* @__PURE__ */ jsx39(DetailField, { label: "Adresse de livraison", value: d.delivery_address }),
|
|
12648
12736
|
/* @__PURE__ */ jsx39(DetailField, { label: "Contact livraison", value: d.delivery_contact }),
|
|
12649
12737
|
/* @__PURE__ */ jsx39(DetailField, { label: "T\xE9l. livraison", value: d.delivery_phone }),
|
|
12650
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12738
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) }),
|
|
12651
12739
|
/* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments })
|
|
12652
12740
|
] }),
|
|
12653
12741
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
@@ -12702,7 +12790,7 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12702
12790
|
/* @__PURE__ */ jsx39(DetailField, { label: "Prix final", value: d.final_price ? `${d.final_price.toLocaleString("fr-FR")} FCFA` : void 0 }),
|
|
12703
12791
|
/* @__PURE__ */ jsx39(DetailField, { label: "Remise", value: d.global_discount ? `${d.global_discount}${d.global_discount_type === "percentage" ? "%" : " FCFA"}` : void 0 }),
|
|
12704
12792
|
/* @__PURE__ */ jsx39(DetailField, { label: "Observations", value: d.observations }),
|
|
12705
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12793
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
|
|
12706
12794
|
] }),
|
|
12707
12795
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
12708
12796
|
/* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
|
|
@@ -12749,9 +12837,9 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12749
12837
|
/* @__PURE__ */ jsxs32("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4 bg-[var(--color-surface-hover)] rounded-lg p-4", children: [
|
|
12750
12838
|
/* @__PURE__ */ jsx39(DetailField, { label: "Type de r\xE9ception", value: d.type_of_receipt }),
|
|
12751
12839
|
/* @__PURE__ */ jsx39(DetailField, { label: "Adresse de r\xE9ception", value: d.receipt_address }),
|
|
12752
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value:
|
|
12840
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value: formatDate4(d.received_at) }),
|
|
12753
12841
|
/* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments }),
|
|
12754
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12842
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
|
|
12755
12843
|
] }),
|
|
12756
12844
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
12757
12845
|
/* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
|
|
@@ -17918,7 +18006,7 @@ import { useState as useState34, useEffect as useEffect26, useCallback as useCal
|
|
|
17918
18006
|
import {
|
|
17919
18007
|
Plus as Plus6,
|
|
17920
18008
|
MoreVertical as MoreVertical2,
|
|
17921
|
-
MessageSquare,
|
|
18009
|
+
MessageSquare as MessageSquare2,
|
|
17922
18010
|
Paperclip,
|
|
17923
18011
|
Search as Search4,
|
|
17924
18012
|
Filter as Filter2,
|
|
@@ -18220,7 +18308,7 @@ var TaskCard = ({ task, isDragging, onDragStart, onDragEnd, onEdit, onDelete })
|
|
|
18220
18308
|
/* @__PURE__ */ jsx56("span", { children: new Date(task.end_date).toLocaleDateString("fr-FR") })
|
|
18221
18309
|
] }),
|
|
18222
18310
|
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-3", children: [
|
|
18223
|
-
task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(
|
|
18311
|
+
task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(MessageSquare2, { className: "w-3.5 h-3.5" }) }),
|
|
18224
18312
|
task.file && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(Paperclip, { className: "w-3.5 h-3.5" }) })
|
|
18225
18313
|
] })
|
|
18226
18314
|
] })
|
|
@@ -18455,7 +18543,7 @@ var TaskPilot = () => {
|
|
|
18455
18543
|
};
|
|
18456
18544
|
var TaskPilot_default = TaskPilot;
|
|
18457
18545
|
|
|
18458
|
-
// src/components/purchase-request/
|
|
18546
|
+
// src/components/purchase-request/ProcuLink.tsx
|
|
18459
18547
|
import { useEffect as useEffect29, useState as useState37 } from "react";
|
|
18460
18548
|
import { ClipboardCheck, Plus as Plus9 } from "lucide-react";
|
|
18461
18549
|
|
|
@@ -19038,7 +19126,7 @@ var FormPurchaseRequest = ({
|
|
|
19038
19126
|
const { success, error: showError } = useToast();
|
|
19039
19127
|
const [showCatalogueSelector, setShowCatalogueSelector] = useState36(false);
|
|
19040
19128
|
const [budgetInfo, setBudgetInfo] = useState36({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
|
|
19041
|
-
const readonly = false;
|
|
19129
|
+
const readonly = object ? object.status !== "draft" : false;
|
|
19042
19130
|
const fetchDepartmentBudget = async (departmentId) => {
|
|
19043
19131
|
if (!departmentId) {
|
|
19044
19132
|
setBudgetInfo({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
|
|
@@ -19611,7 +19699,7 @@ var FormPurchaseRequest = ({
|
|
|
19611
19699
|
PrimaryButton,
|
|
19612
19700
|
{
|
|
19613
19701
|
type: "submit",
|
|
19614
|
-
disabled: loading,
|
|
19702
|
+
disabled: loading || readonly,
|
|
19615
19703
|
children: loading ? "chargement..." : "Enregistrer"
|
|
19616
19704
|
}
|
|
19617
19705
|
)
|
|
@@ -19826,7 +19914,7 @@ var PrintablePurchaseRequest = ({
|
|
|
19826
19914
|
] });
|
|
19827
19915
|
};
|
|
19828
19916
|
|
|
19829
|
-
// src/components/purchase-request/
|
|
19917
|
+
// src/components/purchase-request/ProcuLink.tsx
|
|
19830
19918
|
import { jsx as jsx60, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
19831
19919
|
var PurchaseRequestsPage = () => {
|
|
19832
19920
|
const [refreshToggle, setRefreshToggle] = useState37(false);
|
|
@@ -19834,7 +19922,7 @@ var PurchaseRequestsPage = () => {
|
|
|
19834
19922
|
const [showPrintPreview, setShowPrintPreview] = useState37(false);
|
|
19835
19923
|
const [selectedPurchaseRequest, setSelectedPurchaseRequest] = useState37(null);
|
|
19836
19924
|
const { success, error: showError, confirm: confirm2 } = useToast();
|
|
19837
|
-
const { activeBusinessEntity } = useSession();
|
|
19925
|
+
const { activeBusinessEntity, loggedUser } = useSession();
|
|
19838
19926
|
useEffect29(() => {
|
|
19839
19927
|
}, []);
|
|
19840
19928
|
const loadPurchaseRequests = async () => {
|
|
@@ -19946,7 +20034,7 @@ var PurchaseRequestsPage = () => {
|
|
|
19946
20034
|
process: "PCR-PR",
|
|
19947
20035
|
object_id: item.id,
|
|
19948
20036
|
CustomBtn: (props) => /* @__PURE__ */ jsx60(Buttons_default, { className: "rounded-[6px] bg-gray-500 p-1 text-white", ...props, children: /* @__PURE__ */ jsx60(ClipboardCheck, {}) }),
|
|
19949
|
-
readOnly:
|
|
20037
|
+
readOnly: loggedUser?.id !== item.created_by
|
|
19950
20038
|
}
|
|
19951
20039
|
);
|
|
19952
20040
|
}
|
|
@@ -20210,7 +20298,7 @@ import {
|
|
|
20210
20298
|
Plus as Plus11,
|
|
20211
20299
|
Search as Search7,
|
|
20212
20300
|
MoreVertical as MoreVertical4,
|
|
20213
|
-
Edit as
|
|
20301
|
+
Edit as Edit4,
|
|
20214
20302
|
Trash2 as Trash29,
|
|
20215
20303
|
Eye as Eye8,
|
|
20216
20304
|
Phone as Phone6,
|
|
@@ -20226,7 +20314,7 @@ import { useParams as useParams3, useNavigate as useNavigate11 } from "react-rou
|
|
|
20226
20314
|
import {
|
|
20227
20315
|
ArrowLeft as ArrowLeft2,
|
|
20228
20316
|
Building2 as Building28,
|
|
20229
|
-
Edit as
|
|
20317
|
+
Edit as Edit5,
|
|
20230
20318
|
Trash2 as Trash210,
|
|
20231
20319
|
Plus as Plus12,
|
|
20232
20320
|
MapPin as MapPin8,
|
|
@@ -20335,7 +20423,7 @@ import { useState as useState54, useEffect as useEffect40 } from "react";
|
|
|
20335
20423
|
import { useNavigate as useNavigate17 } from "react-router-dom";
|
|
20336
20424
|
import {
|
|
20337
20425
|
Plus as Plus14,
|
|
20338
|
-
Edit as
|
|
20426
|
+
Edit as Edit6,
|
|
20339
20427
|
Trash2 as Trash212
|
|
20340
20428
|
} from "lucide-react";
|
|
20341
20429
|
import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -20379,7 +20467,7 @@ import {
|
|
|
20379
20467
|
Activity as Activity2,
|
|
20380
20468
|
Briefcase as Briefcase4,
|
|
20381
20469
|
Plus as Plus15,
|
|
20382
|
-
Edit as
|
|
20470
|
+
Edit as Edit7,
|
|
20383
20471
|
Loader2 as Loader210
|
|
20384
20472
|
} from "lucide-react";
|
|
20385
20473
|
import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
@@ -20420,7 +20508,7 @@ import { jsx as jsx87, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
|
20420
20508
|
import { useState as useState60, useEffect as useEffect44 } from "react";
|
|
20421
20509
|
import {
|
|
20422
20510
|
Plus as Plus16,
|
|
20423
|
-
Edit as
|
|
20511
|
+
Edit as Edit8,
|
|
20424
20512
|
Trash2 as Trash214
|
|
20425
20513
|
} from "lucide-react";
|
|
20426
20514
|
import { Fragment as Fragment20, jsx as jsx88, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
@@ -20430,7 +20518,7 @@ import React55, { useState as useState61, useEffect as useEffect45, useRef as us
|
|
|
20430
20518
|
import { useReactToPrint as useReactToPrint2 } from "react-to-print";
|
|
20431
20519
|
import {
|
|
20432
20520
|
Plus as Plus17,
|
|
20433
|
-
Edit as
|
|
20521
|
+
Edit as Edit9,
|
|
20434
20522
|
Trash2 as Trash215,
|
|
20435
20523
|
GripVertical as GripVertical2,
|
|
20436
20524
|
X as X19,
|
|
@@ -20678,7 +20766,7 @@ var PrintableFormPreview = React55.forwardRef(
|
|
|
20678
20766
|
import { useState as useState62, useEffect as useEffect46 } from "react";
|
|
20679
20767
|
import {
|
|
20680
20768
|
Plus as Plus18,
|
|
20681
|
-
Edit as
|
|
20769
|
+
Edit as Edit10,
|
|
20682
20770
|
Trash2 as Trash217,
|
|
20683
20771
|
Shield as Shield7,
|
|
20684
20772
|
CheckCircle as CheckCircle13,
|
|
@@ -26288,7 +26376,7 @@ import {
|
|
|
26288
26376
|
BarChart3 as BarChart37,
|
|
26289
26377
|
Users as Users17,
|
|
26290
26378
|
Target as Target6,
|
|
26291
|
-
Edit as
|
|
26379
|
+
Edit as Edit14,
|
|
26292
26380
|
Trash2 as Trash223,
|
|
26293
26381
|
TrendingUp as TrendingUp12,
|
|
26294
26382
|
TrendingDown as TrendingDown4,
|
|
@@ -26304,7 +26392,7 @@ import {
|
|
|
26304
26392
|
ChevronRight as ChevronRight7,
|
|
26305
26393
|
ClipboardList as ClipboardList5,
|
|
26306
26394
|
User as User5,
|
|
26307
|
-
MessageSquare as
|
|
26395
|
+
MessageSquare as MessageSquare3,
|
|
26308
26396
|
Zap as Zap5,
|
|
26309
26397
|
Activity as Activity3,
|
|
26310
26398
|
Filter as Filter5,
|
|
@@ -27511,7 +27599,7 @@ import {
|
|
|
27511
27599
|
Calendar as Calendar10,
|
|
27512
27600
|
Euro,
|
|
27513
27601
|
Download as Download7,
|
|
27514
|
-
Edit as
|
|
27602
|
+
Edit as Edit11,
|
|
27515
27603
|
Archive,
|
|
27516
27604
|
RefreshCw as RefreshCw10,
|
|
27517
27605
|
CheckCircle as CheckCircle14,
|
|
@@ -27806,7 +27894,7 @@ var ViewContractContent = ({
|
|
|
27806
27894
|
};
|
|
27807
27895
|
}, [contract]);
|
|
27808
27896
|
if (!contract) return null;
|
|
27809
|
-
const
|
|
27897
|
+
const formatDate5 = (dateString) => {
|
|
27810
27898
|
if (!dateString) return "Non d\xE9fini";
|
|
27811
27899
|
return new Date(dateString).toLocaleDateString("fr-FR");
|
|
27812
27900
|
};
|
|
@@ -28085,19 +28173,19 @@ var ViewContractContent = ({
|
|
|
28085
28173
|
/* @__PURE__ */ jsxs122("dl", { className: "space-y-3", children: [
|
|
28086
28174
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28087
28175
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de cr\xE9ation" }),
|
|
28088
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28176
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.created_at || contract.created_at) })
|
|
28089
28177
|
] }),
|
|
28090
28178
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28091
28179
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de signature" }),
|
|
28092
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28180
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.signature_date || "") })
|
|
28093
28181
|
] }),
|
|
28094
28182
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28095
28183
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "D\xE9but" }),
|
|
28096
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28184
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.start_date) })
|
|
28097
28185
|
] }),
|
|
28098
28186
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28099
28187
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Fin" }),
|
|
28100
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children:
|
|
28188
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate5(contract.end_date) })
|
|
28101
28189
|
] }),
|
|
28102
28190
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28103
28191
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Pr\xE9avis de r\xE9siliation" }),
|
|
@@ -28215,11 +28303,11 @@ var ViewContractContent = ({
|
|
|
28215
28303
|
/* @__PURE__ */ jsxs122("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [
|
|
28216
28304
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
28217
28305
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-success)]", children: "Date de d\xE9but" }),
|
|
28218
|
-
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children:
|
|
28306
|
+
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.start_date) })
|
|
28219
28307
|
] }),
|
|
28220
28308
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
|
|
28221
28309
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-error)]", children: "Date de fin" }),
|
|
28222
|
-
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children:
|
|
28310
|
+
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.end_date) })
|
|
28223
28311
|
] }),
|
|
28224
28312
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
28225
28313
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-info)]", children: "Jours restants" }),
|
|
@@ -28252,7 +28340,7 @@ var ViewContractContent = ({
|
|
|
28252
28340
|
] }),
|
|
28253
28341
|
contract.renewal_date && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28254
28342
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de renouvellement" }),
|
|
28255
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28343
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.renewal_date) })
|
|
28256
28344
|
] }),
|
|
28257
28345
|
contract.duration && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28258
28346
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Dur\xE9e" }),
|
|
@@ -28393,7 +28481,7 @@ var ViewContractContent = ({
|
|
|
28393
28481
|
milestone.percentage,
|
|
28394
28482
|
"%"
|
|
28395
28483
|
] }),
|
|
28396
|
-
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children:
|
|
28484
|
+
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: formatDate5(milestone.dueDate) }),
|
|
28397
28485
|
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: /* @__PURE__ */ jsx133(Badge2, { variant: milestone.status === "paid" ? "success" : milestone.status === "overdue" ? "error" : milestone.status === "invoiced" ? "warning" : "default", children: milestone.status === "paid" ? "Pay\xE9" : milestone.status === "overdue" ? "En retard" : milestone.status === "invoiced" ? "Factur\xE9" : "En attente" }) })
|
|
28398
28486
|
] }, milestone.id)) })
|
|
28399
28487
|
] }) })
|
|
@@ -28662,11 +28750,11 @@ var ViewContractContent = ({
|
|
|
28662
28750
|
] }),
|
|
28663
28751
|
/* @__PURE__ */ jsxs122("div", { children: [
|
|
28664
28752
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'\xE9mission" }),
|
|
28665
|
-
/* @__PURE__ */ jsx133("p", { className: "font-medium", children:
|
|
28753
|
+
/* @__PURE__ */ jsx133("p", { className: "font-medium", children: formatDate5(guarantee.issueDate) })
|
|
28666
28754
|
] }),
|
|
28667
28755
|
/* @__PURE__ */ jsxs122("div", { children: [
|
|
28668
28756
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'expiration" }),
|
|
28669
|
-
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children:
|
|
28757
|
+
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(guarantee.expiryDate) })
|
|
28670
28758
|
] })
|
|
28671
28759
|
] }),
|
|
28672
28760
|
guarantee.releaseConditions && /* @__PURE__ */ jsxs122("div", { className: "mt-3 p-3 bg-gray-50 rounded-lg", children: [
|
|
@@ -28706,7 +28794,7 @@ var ViewContractContent = ({
|
|
|
28706
28794
|
] }),
|
|
28707
28795
|
insurance.validUntil && /* @__PURE__ */ jsxs122("div", { children: [
|
|
28708
28796
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Valide jusqu'au" }),
|
|
28709
|
-
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children:
|
|
28797
|
+
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(insurance.validUntil) })
|
|
28710
28798
|
] })
|
|
28711
28799
|
] })
|
|
28712
28800
|
] }, insurance.id)) }) : /* @__PURE__ */ jsxs122("div", { className: "text-center py-8 text-gray-500", children: [
|
|
@@ -28777,7 +28865,7 @@ var ViewContractContent = ({
|
|
|
28777
28865
|
] }),
|
|
28778
28866
|
/* @__PURE__ */ jsxs122("div", { className: "text-right", children: [
|
|
28779
28867
|
/* @__PURE__ */ jsx133(Badge2, { variant: approver.status === "approved" ? "success" : approver.status === "rejected" ? "error" : "default", children: approver.status === "approved" ? "Approuv\xE9" : approver.status === "rejected" ? "Rejet\xE9" : "En attente" }),
|
|
28780
|
-
approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children:
|
|
28868
|
+
approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children: formatDate5(approver.approvalDate) })
|
|
28781
28869
|
] })
|
|
28782
28870
|
] }, index)) })
|
|
28783
28871
|
] }),
|
|
@@ -28831,11 +28919,11 @@ var ViewContractContent = ({
|
|
|
28831
28919
|
] }),
|
|
28832
28920
|
contract.governance.steeringCommittee.lastMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28833
28921
|
/* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Derni\xE8re r\xE9union" }),
|
|
28834
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children:
|
|
28922
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children: formatDate5(contract.governance.steeringCommittee.lastMeetingDate) })
|
|
28835
28923
|
] }),
|
|
28836
28924
|
contract.governance.steeringCommittee.nextMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28837
28925
|
/* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Prochaine r\xE9union" }),
|
|
28838
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children:
|
|
28926
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children: formatDate5(contract.governance.steeringCommittee.nextMeetingDate) })
|
|
28839
28927
|
] })
|
|
28840
28928
|
] })
|
|
28841
28929
|
] })
|
|
@@ -28908,7 +28996,7 @@ var ViewContractContent = ({
|
|
|
28908
28996
|
] }),
|
|
28909
28997
|
contract.regulatoryCompliance.sanctionsScreening?.lastScreeningDate && /* @__PURE__ */ jsxs122("p", { className: "text-sm text-gray-500", children: [
|
|
28910
28998
|
"Dernier contr\xF4le: ",
|
|
28911
|
-
|
|
28999
|
+
formatDate5(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
|
|
28912
29000
|
] })
|
|
28913
29001
|
] })
|
|
28914
29002
|
] })
|
|
@@ -28964,7 +29052,7 @@ var ViewContractContent = ({
|
|
|
28964
29052
|
] }),
|
|
28965
29053
|
/* @__PURE__ */ jsxs122("p", { className: "text-xs text-[var(--color-success)] mt-1", children: [
|
|
28966
29054
|
"\xC9valu\xE9 le ",
|
|
28967
|
-
|
|
29055
|
+
formatDate5(contract.esgCriteria.lastAssessmentDate)
|
|
28968
29056
|
] })
|
|
28969
29057
|
] }),
|
|
28970
29058
|
/* @__PURE__ */ jsx133(RewiseCard, { className: "p-4", children: /* @__PURE__ */ jsxs122("div", { className: "flex items-center space-x-3", children: [
|
|
@@ -29135,7 +29223,7 @@ var ViewContractContent = ({
|
|
|
29135
29223
|
/* @__PURE__ */ jsx133("span", { children: "\u2022" }),
|
|
29136
29224
|
/* @__PURE__ */ jsxs122("span", { children: [
|
|
29137
29225
|
"\xC9ch\xE9ance: ",
|
|
29138
|
-
|
|
29226
|
+
formatDate5(obligation.dueDate)
|
|
29139
29227
|
] })
|
|
29140
29228
|
] }),
|
|
29141
29229
|
/* @__PURE__ */ jsx133("span", { children: "\u2022" }),
|
|
@@ -29201,7 +29289,7 @@ var ViewContractContent = ({
|
|
|
29201
29289
|
] }),
|
|
29202
29290
|
sla.last_evaluation && /* @__PURE__ */ jsxs122("span", { children: [
|
|
29203
29291
|
"Derni\xE8re mesure: ",
|
|
29204
|
-
|
|
29292
|
+
formatDate5(sla.last_evaluation)
|
|
29205
29293
|
] })
|
|
29206
29294
|
] })
|
|
29207
29295
|
] }, sla.id)) }) : /* @__PURE__ */ jsxs122(RewiseCard, { className: "p-8 text-center", children: [
|
|
@@ -29412,7 +29500,7 @@ var ViewContractContent = ({
|
|
|
29412
29500
|
" MB \u2022 Version ",
|
|
29413
29501
|
doc.version,
|
|
29414
29502
|
" \u2022 Ajout\xE9 le ",
|
|
29415
|
-
|
|
29503
|
+
formatDate5(doc.uploadedAt)
|
|
29416
29504
|
] }),
|
|
29417
29505
|
doc.description && /* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mt-1", children: doc.description })
|
|
29418
29506
|
] })
|
|
@@ -29443,7 +29531,7 @@ var ViewContractContent = ({
|
|
|
29443
29531
|
] }),
|
|
29444
29532
|
/* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mb-2", children: amendment.description }),
|
|
29445
29533
|
/* @__PURE__ */ jsxs122("p", { className: "text-xs text-gray-500", children: [
|
|
29446
|
-
|
|
29534
|
+
formatDate5(amendment.date),
|
|
29447
29535
|
" \u2022 Raison: ",
|
|
29448
29536
|
amendment.reason
|
|
29449
29537
|
] })
|
|
@@ -29453,7 +29541,7 @@ var ViewContractContent = ({
|
|
|
29453
29541
|
const renderHistoryTab = () => /* @__PURE__ */ jsxs122("div", { className: "space-y-4", children: [
|
|
29454
29542
|
/* @__PURE__ */ jsx133("h3", { className: "text-lg font-semibold text-gray-900", children: "Historique des actions" }),
|
|
29455
29543
|
contract.auditTrail && contract.auditTrail.length > 0 ? /* @__PURE__ */ jsx133("div", { className: "space-y-4", children: contract.auditTrail.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()).map((entry, index) => /* @__PURE__ */ jsxs122("div", { className: "flex space-x-4", children: [
|
|
29456
|
-
/* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(
|
|
29544
|
+
/* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(Edit11, { className: "w-5 h-5 text-[var(--color-warning)]" }) : /* @__PURE__ */ jsx133(Clock11, { className: "w-5 h-5 text-gray-600" }) }) }),
|
|
29457
29545
|
/* @__PURE__ */ jsxs122("div", { className: "flex-1 min-w-0", children: [
|
|
29458
29546
|
/* @__PURE__ */ jsxs122("div", { className: "flex items-center justify-between", children: [
|
|
29459
29547
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-gray-900 capitalize", children: entry.action === "created" ? "Cr\xE9ation" : entry.action === "updated" ? "Mise \xE0 jour" : entry.action === "approved" ? "Approbation" : entry.action === "rejected" ? "Rejet" : entry.action === "signed" ? "Signature" : entry.action === "renewed" ? "Renouvellement" : entry.action === "terminated" ? "R\xE9siliation" : entry.action === "amended" ? "Avenant" : entry.action === "viewed" ? "Consultation" : entry.action === "exported" ? "Export" : entry.action }),
|
|
@@ -29501,7 +29589,7 @@ var ViewContractContent = ({
|
|
|
29501
29589
|
size: "sm",
|
|
29502
29590
|
onClick: () => handleAction("edit"),
|
|
29503
29591
|
children: [
|
|
29504
|
-
/* @__PURE__ */ jsx133(
|
|
29592
|
+
/* @__PURE__ */ jsx133(Edit11, { className: "w-4 h-4 mr-2" }),
|
|
29505
29593
|
"Modifier"
|
|
29506
29594
|
]
|
|
29507
29595
|
}
|
|
@@ -29541,7 +29629,7 @@ var ViewContractContent = ({
|
|
|
29541
29629
|
"Ce contrat expire dans ",
|
|
29542
29630
|
daysUntilExpiry,
|
|
29543
29631
|
" jours (",
|
|
29544
|
-
|
|
29632
|
+
formatDate5(contract.end_date),
|
|
29545
29633
|
")"
|
|
29546
29634
|
] })
|
|
29547
29635
|
] }),
|
|
@@ -29626,7 +29714,7 @@ import {
|
|
|
29626
29714
|
Table as Table3,
|
|
29627
29715
|
Plus as Plus22,
|
|
29628
29716
|
Trash2 as Trash221,
|
|
29629
|
-
Edit as
|
|
29717
|
+
Edit as Edit12,
|
|
29630
29718
|
CheckCircle as CheckCircle15,
|
|
29631
29719
|
XCircle as XCircle6,
|
|
29632
29720
|
AlertTriangle as AlertTriangle10,
|
|
@@ -30597,7 +30685,7 @@ var ContractForm = ({ contract, onSubmit, onCancel, onShowToast, isEdit = false
|
|
|
30597
30685
|
type: "button",
|
|
30598
30686
|
onClick: () => handleEditSLA(indicator),
|
|
30599
30687
|
className: "p-1 text-[#78a6d2] hover:bg-[#78a6d2]/10 rounded",
|
|
30600
|
-
children: /* @__PURE__ */ jsx134(
|
|
30688
|
+
children: /* @__PURE__ */ jsx134(Edit12, { className: "w-4 h-4" })
|
|
30601
30689
|
}
|
|
30602
30690
|
),
|
|
30603
30691
|
/* @__PURE__ */ jsx134(
|
|
@@ -32227,7 +32315,7 @@ import {
|
|
|
32227
32315
|
Smartphone as Smartphone3,
|
|
32228
32316
|
Filter as Filter4,
|
|
32229
32317
|
Search as Search11,
|
|
32230
|
-
Edit as
|
|
32318
|
+
Edit as Edit13,
|
|
32231
32319
|
Trash2 as Trash222,
|
|
32232
32320
|
Eye as Eye15,
|
|
32233
32321
|
EyeOff as EyeOff5
|
|
@@ -32563,7 +32651,7 @@ var AlertsManagementModal = ({
|
|
|
32563
32651
|
] })
|
|
32564
32652
|
] }),
|
|
32565
32653
|
/* @__PURE__ */ jsxs125("div", { className: "flex items-center space-x-2", children: [
|
|
32566
|
-
/* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(
|
|
32654
|
+
/* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(Edit13, { className: "w-4 h-4" }) }),
|
|
32567
32655
|
/* @__PURE__ */ jsx137(
|
|
32568
32656
|
Button2,
|
|
32569
32657
|
{
|
|
@@ -33885,7 +33973,7 @@ var SLAManagementModal = ({
|
|
|
33885
33973
|
onShowToast("Indicateur SLA supprim\xE9", "success");
|
|
33886
33974
|
}
|
|
33887
33975
|
};
|
|
33888
|
-
const
|
|
33976
|
+
const formatDate5 = (dateString) => {
|
|
33889
33977
|
if (!dateString) return "N/A";
|
|
33890
33978
|
return new Date(dateString).toLocaleDateString("fr-FR");
|
|
33891
33979
|
};
|
|
@@ -34040,7 +34128,7 @@ var SLAManagementModal = ({
|
|
|
34040
34128
|
/* @__PURE__ */ jsx139("p", { className: "text-sm", style: { color: colors.text.secondary }, children: indicator.description })
|
|
34041
34129
|
] }),
|
|
34042
34130
|
/* @__PURE__ */ jsxs127("div", { className: "flex space-x-2", children: [
|
|
34043
|
-
/* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(
|
|
34131
|
+
/* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(Edit14, { className: "w-4 h-4" }) }),
|
|
34044
34132
|
/* @__PURE__ */ jsx139(
|
|
34045
34133
|
"button",
|
|
34046
34134
|
{
|
|
@@ -34399,7 +34487,7 @@ var SLAManagementModal = ({
|
|
|
34399
34487
|
] }),
|
|
34400
34488
|
/* @__PURE__ */ jsxs127("p", { className: "text-xs mt-1", style: { color: colors.text.tertiary }, children: [
|
|
34401
34489
|
"D\xE9tect\xE9 le ",
|
|
34402
|
-
|
|
34490
|
+
formatDate5(incident.detected_date)
|
|
34403
34491
|
] })
|
|
34404
34492
|
] })
|
|
34405
34493
|
] }),
|
|
@@ -34524,7 +34612,7 @@ var SLAManagementModal = ({
|
|
|
34524
34612
|
const getNoteTypeIcon = (type) => {
|
|
34525
34613
|
switch (type) {
|
|
34526
34614
|
case "comment":
|
|
34527
|
-
return
|
|
34615
|
+
return MessageSquare3;
|
|
34528
34616
|
case "decision":
|
|
34529
34617
|
return CheckCircle18;
|
|
34530
34618
|
case "action":
|
|
@@ -34532,7 +34620,7 @@ var SLAManagementModal = ({
|
|
|
34532
34620
|
case "meeting":
|
|
34533
34621
|
return Users17;
|
|
34534
34622
|
default:
|
|
34535
|
-
return
|
|
34623
|
+
return MessageSquare3;
|
|
34536
34624
|
}
|
|
34537
34625
|
};
|
|
34538
34626
|
const getNoteTypeColor = (type) => {
|
|
@@ -34552,7 +34640,7 @@ var SLAManagementModal = ({
|
|
|
34552
34640
|
return /* @__PURE__ */ jsxs127("div", { className: "space-y-4", children: [
|
|
34553
34641
|
/* @__PURE__ */ jsxs127("div", { className: "flex items-center justify-between", children: [
|
|
34554
34642
|
/* @__PURE__ */ jsxs127("h3", { className: "text-lg font-semibold flex items-center gap-2", style: { color: colors.text.primary }, children: [
|
|
34555
|
-
/* @__PURE__ */ jsx139(
|
|
34643
|
+
/* @__PURE__ */ jsx139(MessageSquare3, { className: "w-5 h-5", style: { color: colors.primary } }),
|
|
34556
34644
|
"Notes et commentaires (",
|
|
34557
34645
|
notes.length,
|
|
34558
34646
|
")"
|
|
@@ -34636,7 +34724,7 @@ var SLAManagementModal = ({
|
|
|
34636
34724
|
] })
|
|
34637
34725
|
] }),
|
|
34638
34726
|
notesLoading ? /* @__PURE__ */ jsx139("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx139(RefreshCw11, { className: "w-8 h-8 animate-spin", style: { color: colors.primary } }) }) : filteredNotes.length === 0 ? /* @__PURE__ */ jsxs127("div", { className: "text-center py-12", children: [
|
|
34639
|
-
/* @__PURE__ */ jsx139(
|
|
34727
|
+
/* @__PURE__ */ jsx139(MessageSquare3, { className: "w-12 h-12 mx-auto mb-4", style: { color: colors.text.tertiary } }),
|
|
34640
34728
|
/* @__PURE__ */ jsx139("p", { style: { color: colors.text.secondary }, children: "Aucune note" })
|
|
34641
34729
|
] }) : /* @__PURE__ */ jsx139("div", { className: "space-y-3", children: filteredNotes.map((note) => {
|
|
34642
34730
|
const Icon = getNoteTypeIcon(note.note_type);
|
|
@@ -34678,7 +34766,7 @@ var SLAManagementModal = ({
|
|
|
34678
34766
|
{ id: "evaluations", label: "Journal des \xE9valuations", icon: FileText23 },
|
|
34679
34767
|
{ id: "incidents", label: "Incidents", icon: AlertCircle10 },
|
|
34680
34768
|
{ id: "penalties", label: "P\xE9nalit\xE9s & Bonus", icon: DollarSign3 },
|
|
34681
|
-
{ id: "notes", label: "Notes", icon:
|
|
34769
|
+
{ id: "notes", label: "Notes", icon: MessageSquare3 }
|
|
34682
34770
|
];
|
|
34683
34771
|
return /* @__PURE__ */ jsxs127(
|
|
34684
34772
|
Modal,
|
|
@@ -35412,9 +35500,9 @@ export {
|
|
|
35412
35500
|
fileManagerApi,
|
|
35413
35501
|
findFolderById2 as findFolderById,
|
|
35414
35502
|
formatCurrency,
|
|
35415
|
-
formatDate,
|
|
35503
|
+
formatDate2 as formatDate,
|
|
35416
35504
|
formatDateFR,
|
|
35417
|
-
formatDateTime,
|
|
35505
|
+
formatDateTime2 as formatDateTime,
|
|
35418
35506
|
formatFileSize,
|
|
35419
35507
|
getAllFolders,
|
|
35420
35508
|
getAllSLATemplates,
|