ptechcore_ui 1.0.36 → 1.0.38
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 +1634 -83
- package/dist/index.d.cts +127 -1
- package/dist/index.d.ts +127 -1
- package/dist/index.js +1680 -83
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var index_exports = {};
|
|
|
31
31
|
__export(index_exports, {
|
|
32
32
|
ACCOUNT_TYPE_LABELS: () => ACCOUNT_TYPE_LABELS,
|
|
33
33
|
AccountServices: () => AccountServices,
|
|
34
|
+
AccountingWorkspace: () => AccountingWorkspace_default,
|
|
34
35
|
Alert: () => Alert_default,
|
|
35
36
|
AlertProvider: () => AlertProvider,
|
|
36
37
|
ApprovalAnswerModal: () => ApprovalAnswerModal,
|
|
@@ -41,8 +42,11 @@ __export(index_exports, {
|
|
|
41
42
|
AuthServices: () => AuthServices,
|
|
42
43
|
BALANCE_TYPE_LABELS: () => BALANCE_TYPE_LABELS,
|
|
43
44
|
CHOICES: () => Choices_default,
|
|
45
|
+
CardBody: () => CardBody,
|
|
46
|
+
CardHeader: () => CardHeader,
|
|
44
47
|
ClientServices: () => ClientServices,
|
|
45
48
|
CountrySelector: () => CountrySelector,
|
|
49
|
+
CrmWorkspace: () => CrmWorkspace_default,
|
|
46
50
|
DataTable: () => DataTable,
|
|
47
51
|
DateInput: () => DateInput,
|
|
48
52
|
DocumentFooter: () => DocumentFooter,
|
|
@@ -50,6 +54,7 @@ __export(index_exports, {
|
|
|
50
54
|
EntityFileManager: () => EntityFileManager,
|
|
51
55
|
FDrawer: () => FDrawer,
|
|
52
56
|
FROM_MODULE_CHOICES: () => FROM_MODULE_CHOICES,
|
|
57
|
+
FacilityWorkspace: () => FacilityWorkspace_default,
|
|
53
58
|
FetchApi: () => FetchApi,
|
|
54
59
|
FileInput: () => FileInput,
|
|
55
60
|
FileManager: () => FileManager,
|
|
@@ -63,6 +68,7 @@ __export(index_exports, {
|
|
|
63
68
|
LegalFormSelector: () => LegalFormSelector,
|
|
64
69
|
MinimalVendorForm: () => MinimalVendorForm,
|
|
65
70
|
Modal: () => Modals_default,
|
|
71
|
+
ModernCard: () => ModernCard,
|
|
66
72
|
NumberInput: () => NumberInput,
|
|
67
73
|
PRINT_GREEN: () => PRINT_GREEN,
|
|
68
74
|
Pages: () => Pages_default,
|
|
@@ -70,6 +76,7 @@ __export(index_exports, {
|
|
|
70
76
|
PrimaryButton: () => Buttons_default,
|
|
71
77
|
PrintPreview: () => PrintPreview,
|
|
72
78
|
PrintableDocument: () => PrintableDocument,
|
|
79
|
+
PurchaseWorkspace: () => PurchaseWorkspace_default,
|
|
73
80
|
RewiseLayout: () => ModernDoubleSidebarLayout_default,
|
|
74
81
|
SYSCOHADA_CLASSES: () => SYSCOHADA_CLASSES,
|
|
75
82
|
SecondaryButton: () => SecondaryButton,
|
|
@@ -83,6 +90,7 @@ __export(index_exports, {
|
|
|
83
90
|
SelectVendor: () => SelectVendor,
|
|
84
91
|
SessionProvider: () => SessionProvider,
|
|
85
92
|
SignatureSection: () => SignatureSection,
|
|
93
|
+
StatCard: () => StatCard,
|
|
86
94
|
TEMPLATE_FNE_CHOICES: () => TEMPLATE_FNE_CHOICES,
|
|
87
95
|
TaxSelector: () => TaxSelector,
|
|
88
96
|
TemplateFNESelector: () => TemplateFNESelector,
|
|
@@ -94,6 +102,8 @@ __export(index_exports, {
|
|
|
94
102
|
UnitServices: () => UnitServices,
|
|
95
103
|
UserServices: () => UserServices,
|
|
96
104
|
VendorServices: () => VendorServices,
|
|
105
|
+
WorkSpace: () => WorkSpace_default,
|
|
106
|
+
WorkspaceServices: () => WorkspaceServices,
|
|
97
107
|
fileManagerApi: () => fileManagerApi,
|
|
98
108
|
formatCurrency: () => formatCurrency,
|
|
99
109
|
formatDate: () => formatDate,
|
|
@@ -1840,8 +1850,8 @@ var getModuleUrls = (token) => {
|
|
|
1840
1850
|
var MODULE_CODE_MAP = {
|
|
1841
1851
|
"CRM": "WiseConnect",
|
|
1842
1852
|
"MARKETING": "WiseReach",
|
|
1843
|
-
"FACILITY": "
|
|
1844
|
-
"SECURITY": "
|
|
1853
|
+
"FACILITY": "WiseFm",
|
|
1854
|
+
"SECURITY": "WiseHSC",
|
|
1845
1855
|
"THRIVE": "WiseThrive",
|
|
1846
1856
|
"BI": "WiseView",
|
|
1847
1857
|
"SOP": "WiseProcess",
|
|
@@ -2213,6 +2223,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2213
2223
|
setSecondaryCollapsed(true);
|
|
2214
2224
|
} else {
|
|
2215
2225
|
setSelectedModule(item.id);
|
|
2226
|
+
if (secondaryMenuItems[item.id] && secondaryMenuItems[item.id].length > 0) {
|
|
2227
|
+
setSecondaryCollapsed(false);
|
|
2228
|
+
}
|
|
2216
2229
|
}
|
|
2217
2230
|
},
|
|
2218
2231
|
className: cn(
|
|
@@ -2719,7 +2732,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2719
2732
|
"button",
|
|
2720
2733
|
{
|
|
2721
2734
|
onClick: () => {
|
|
2722
|
-
|
|
2735
|
+
window.location.href = "https://core.rewise.praedium-tech.com/parameters/profit-cost-centers/";
|
|
2723
2736
|
setShowUserMenu(false);
|
|
2724
2737
|
},
|
|
2725
2738
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
@@ -2834,8 +2847,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2834
2847
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
|
|
2835
2848
|
{ name: "WiseConnect", icon: crm_blue_default, iconWhite: crmwhite_default, url: moduleUrls.wiseConnect },
|
|
2836
2849
|
{ name: "WiseReach", icon: marketingblue_default, iconWhite: marketingblanc_default, url: moduleUrls.wiseReach },
|
|
2837
|
-
{ name: "
|
|
2838
|
-
{ name: "
|
|
2850
|
+
{ name: "WiseFm", icon: facilityblue_default, iconWhite: facilityblanc_default, url: moduleUrls.wiseOps },
|
|
2851
|
+
{ name: "WiseHSE", icon: security_managementblue_default, iconWhite: security_managementblanc_default, url: moduleUrls.wiseGuard }
|
|
2839
2852
|
].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2840
2853
|
"button",
|
|
2841
2854
|
{
|
|
@@ -4804,6 +4817,7 @@ var import_react10 = require("react");
|
|
|
4804
4817
|
|
|
4805
4818
|
// src/components/common/SearchableSelect.tsx
|
|
4806
4819
|
var import_react9 = require("react");
|
|
4820
|
+
var import_react_dom2 = require("react-dom");
|
|
4807
4821
|
var import_lucide_react7 = require("lucide-react");
|
|
4808
4822
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4809
4823
|
var SearchableSelect = ({
|
|
@@ -4821,7 +4835,9 @@ var SearchableSelect = ({
|
|
|
4821
4835
|
}) => {
|
|
4822
4836
|
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
4823
4837
|
const [searchTerm, setSearchTerm] = (0, import_react9.useState)("");
|
|
4838
|
+
const [dropdownPosition, setDropdownPosition] = (0, import_react9.useState)({ top: 0, left: 0, width: 0 });
|
|
4824
4839
|
const dropdownRef = (0, import_react9.useRef)(null);
|
|
4840
|
+
const dropdownMenuRef = (0, import_react9.useRef)(null);
|
|
4825
4841
|
const inputRef = (0, import_react9.useRef)(null);
|
|
4826
4842
|
const selectedOption = options.find((option) => option.value === value);
|
|
4827
4843
|
const defaultFilter = (option, searchTerm2) => {
|
|
@@ -4830,9 +4846,22 @@ var SearchableSelect = ({
|
|
|
4830
4846
|
const filteredOptions = options.filter(
|
|
4831
4847
|
(option) => filterFunction ? filterFunction(option, searchTerm) : defaultFilter(option, searchTerm)
|
|
4832
4848
|
);
|
|
4849
|
+
(0, import_react9.useEffect)(() => {
|
|
4850
|
+
if (isOpen && dropdownRef.current) {
|
|
4851
|
+
const rect = dropdownRef.current.getBoundingClientRect();
|
|
4852
|
+
setDropdownPosition({
|
|
4853
|
+
top: rect.bottom + window.scrollY,
|
|
4854
|
+
left: rect.left + window.scrollX,
|
|
4855
|
+
width: rect.width
|
|
4856
|
+
});
|
|
4857
|
+
}
|
|
4858
|
+
}, [isOpen]);
|
|
4833
4859
|
(0, import_react9.useEffect)(() => {
|
|
4834
4860
|
const handleClickOutside = (event) => {
|
|
4835
|
-
|
|
4861
|
+
const target = event.target;
|
|
4862
|
+
const isOutsideTrigger = dropdownRef.current && !dropdownRef.current.contains(target);
|
|
4863
|
+
const isOutsideMenu = dropdownMenuRef.current && !dropdownMenuRef.current.contains(target);
|
|
4864
|
+
if (isOutsideTrigger && isOutsideMenu) {
|
|
4836
4865
|
setIsOpen(false);
|
|
4837
4866
|
setSearchTerm("");
|
|
4838
4867
|
}
|
|
@@ -4871,17 +4900,17 @@ var SearchableSelect = ({
|
|
|
4871
4900
|
${isOpen ? "ring-2 ring-[#6B7C92] border-transparent" : ""}
|
|
4872
4901
|
`,
|
|
4873
4902
|
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4874
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center space-x-2 flex-1", children: selectedOption ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center space-x-2 flex-1 min-w-0", children: selectedOption ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
4875
4904
|
selectedOption.image && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4876
4905
|
"img",
|
|
4877
4906
|
{
|
|
4878
4907
|
src: selectedOption.image,
|
|
4879
4908
|
alt: selectedOption.label,
|
|
4880
|
-
className: "w-6 h-6 rounded-full object-cover"
|
|
4909
|
+
className: "w-6 h-6 rounded-full object-cover flex-shrink-0"
|
|
4881
4910
|
}
|
|
4882
4911
|
),
|
|
4883
|
-
selectedOption.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900", children: selectedOption.label })
|
|
4884
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-400", children: placeholder }) }),
|
|
4912
|
+
selectedOption.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900 truncate", children: selectedOption.label })
|
|
4913
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-400 truncate", children: placeholder }) }),
|
|
4885
4914
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
4886
4915
|
allowClear && selectedOption && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4887
4916
|
"button",
|
|
@@ -4903,64 +4932,80 @@ var SearchableSelect = ({
|
|
|
4903
4932
|
] })
|
|
4904
4933
|
}
|
|
4905
4934
|
),
|
|
4906
|
-
isOpen &&
|
|
4907
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4908
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
|
|
4909
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
|
|
4910
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4911
|
-
"input",
|
|
4912
|
-
{
|
|
4913
|
-
ref: inputRef,
|
|
4914
|
-
type: "text",
|
|
4915
|
-
placeholder: searchPlaceholder,
|
|
4916
|
-
value: searchTerm,
|
|
4917
|
-
onChange: (e) => setSearchTerm(e.target.value),
|
|
4918
|
-
className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
|
|
4919
|
-
}
|
|
4920
|
-
)
|
|
4921
|
-
] }),
|
|
4922
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4923
|
-
"button",
|
|
4924
|
-
{
|
|
4925
|
-
type: "button",
|
|
4926
|
-
onClick: refresh,
|
|
4927
|
-
disabled,
|
|
4928
|
-
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4929
|
-
title: "Rafra\xEEchir la liste",
|
|
4930
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
|
|
4931
|
-
}
|
|
4932
|
-
),
|
|
4933
|
-
addElement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4934
|
-
"button",
|
|
4935
|
-
{
|
|
4936
|
-
type: "button",
|
|
4937
|
-
onClick: addElement,
|
|
4938
|
-
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4939
|
-
title: "Rafra\xEEchir la liste",
|
|
4940
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, { className: "w-4 h-4" })
|
|
4941
|
-
}
|
|
4942
|
-
)
|
|
4943
|
-
] }),
|
|
4944
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4935
|
+
isOpen && (0, import_react_dom2.createPortal)(
|
|
4936
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4945
4937
|
"div",
|
|
4946
4938
|
{
|
|
4947
|
-
|
|
4948
|
-
className: "
|
|
4939
|
+
ref: dropdownMenuRef,
|
|
4940
|
+
className: "fixed bg-white border border-gray-200 rounded-lg shadow-lg",
|
|
4941
|
+
style: {
|
|
4942
|
+
top: dropdownPosition.top,
|
|
4943
|
+
left: dropdownPosition.left,
|
|
4944
|
+
width: dropdownPosition.width,
|
|
4945
|
+
zIndex: 9999
|
|
4946
|
+
},
|
|
4949
4947
|
children: [
|
|
4950
|
-
|
|
4951
|
-
"
|
|
4948
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 border-b border-gray-200 flex", children: [
|
|
4949
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
|
|
4950
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
|
|
4951
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4952
|
+
"input",
|
|
4953
|
+
{
|
|
4954
|
+
ref: inputRef,
|
|
4955
|
+
type: "text",
|
|
4956
|
+
placeholder: searchPlaceholder,
|
|
4957
|
+
value: searchTerm,
|
|
4958
|
+
onChange: (e) => setSearchTerm(e.target.value),
|
|
4959
|
+
className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
|
|
4960
|
+
}
|
|
4961
|
+
)
|
|
4962
|
+
] }),
|
|
4963
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4964
|
+
"button",
|
|
4965
|
+
{
|
|
4966
|
+
type: "button",
|
|
4967
|
+
onClick: refresh,
|
|
4968
|
+
disabled,
|
|
4969
|
+
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4970
|
+
title: "Rafra\xEEchir la liste",
|
|
4971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
|
|
4972
|
+
}
|
|
4973
|
+
),
|
|
4974
|
+
addElement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4975
|
+
"button",
|
|
4976
|
+
{
|
|
4977
|
+
type: "button",
|
|
4978
|
+
onClick: addElement,
|
|
4979
|
+
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4980
|
+
title: "Ajouter un \xE9l\xE9ment",
|
|
4981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, { className: "w-4 h-4" })
|
|
4982
|
+
}
|
|
4983
|
+
)
|
|
4984
|
+
] }),
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
4986
|
+
"div",
|
|
4952
4987
|
{
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4988
|
+
onClick: () => handleSelect(option),
|
|
4989
|
+
className: "px-4 py-3 hover:bg-gray-50 cursor-pointer flex items-center space-x-3",
|
|
4990
|
+
children: [
|
|
4991
|
+
option.image && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4992
|
+
"img",
|
|
4993
|
+
{
|
|
4994
|
+
src: option.image,
|
|
4995
|
+
alt: option.label,
|
|
4996
|
+
className: "w-8 h-8 rounded-full object-cover"
|
|
4997
|
+
}
|
|
4998
|
+
),
|
|
4999
|
+
option.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900", children: option.label })
|
|
5000
|
+
]
|
|
5001
|
+
},
|
|
5002
|
+
option.value
|
|
5003
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-4 py-3 text-gray-500 text-center", children: "Aucun r\xE9sultat trouv\xE9" }) })
|
|
4959
5004
|
]
|
|
4960
|
-
}
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
5005
|
+
}
|
|
5006
|
+
),
|
|
5007
|
+
document.body
|
|
5008
|
+
)
|
|
4964
5009
|
] });
|
|
4965
5010
|
};
|
|
4966
5011
|
|
|
@@ -5028,7 +5073,10 @@ var PROFIT_URI = `${API_URL}/accounting/profit-center/`;
|
|
|
5028
5073
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
5029
5074
|
var SelectVendor = ({
|
|
5030
5075
|
value,
|
|
5031
|
-
onSelect
|
|
5076
|
+
onSelect,
|
|
5077
|
+
allowClear,
|
|
5078
|
+
onRemove,
|
|
5079
|
+
label = "Ajouter un fournisseur"
|
|
5032
5080
|
}) => {
|
|
5033
5081
|
const [showModal, setShowModal] = (0, import_react10.useState)(false);
|
|
5034
5082
|
const [selectedVendor, setSelectedVendor] = (0, import_react10.useState)(null);
|
|
@@ -5078,7 +5126,7 @@ var SelectVendor = ({
|
|
|
5078
5126
|
loadVendors();
|
|
5079
5127
|
};
|
|
5080
5128
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5081
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5129
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5082
5130
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5083
5131
|
SearchableSelect,
|
|
5084
5132
|
{
|
|
@@ -5091,7 +5139,9 @@ var SelectVendor = ({
|
|
|
5091
5139
|
refresh: handleRefresh,
|
|
5092
5140
|
addElement: () => {
|
|
5093
5141
|
setShowModal(true);
|
|
5094
|
-
}
|
|
5142
|
+
},
|
|
5143
|
+
allowClear,
|
|
5144
|
+
onRemove
|
|
5095
5145
|
},
|
|
5096
5146
|
"fourni" + value
|
|
5097
5147
|
),
|
|
@@ -5110,7 +5160,10 @@ var SelectVendor = ({
|
|
|
5110
5160
|
};
|
|
5111
5161
|
var SelectUser = ({
|
|
5112
5162
|
value,
|
|
5113
|
-
onSelect
|
|
5163
|
+
onSelect,
|
|
5164
|
+
allowClear,
|
|
5165
|
+
onRemove,
|
|
5166
|
+
label = "S\xE9lectionner un utilisateur"
|
|
5114
5167
|
}) => {
|
|
5115
5168
|
const { token, activeBusinessEntity } = useSession();
|
|
5116
5169
|
const [users, setUsers] = (0, import_react10.useState)(() => {
|
|
@@ -5166,7 +5219,7 @@ var SelectUser = ({
|
|
|
5166
5219
|
}));
|
|
5167
5220
|
};
|
|
5168
5221
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5169
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5222
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5170
5223
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5171
5224
|
SearchableSelect,
|
|
5172
5225
|
{
|
|
@@ -5176,7 +5229,9 @@ var SelectUser = ({
|
|
|
5176
5229
|
searchPlaceholder: "Rechercher...",
|
|
5177
5230
|
onSelect,
|
|
5178
5231
|
disabled: loading,
|
|
5179
|
-
refresh: handleRefresh
|
|
5232
|
+
refresh: handleRefresh,
|
|
5233
|
+
allowClear,
|
|
5234
|
+
onRemove
|
|
5180
5235
|
},
|
|
5181
5236
|
"user" + value
|
|
5182
5237
|
),
|
|
@@ -5185,7 +5240,10 @@ var SelectUser = ({
|
|
|
5185
5240
|
};
|
|
5186
5241
|
var SelectDepartment = ({
|
|
5187
5242
|
value,
|
|
5188
|
-
onSelect
|
|
5243
|
+
onSelect,
|
|
5244
|
+
allowClear,
|
|
5245
|
+
onRemove,
|
|
5246
|
+
label = "S\xE9lectionner un d\xE9partement"
|
|
5189
5247
|
}) => {
|
|
5190
5248
|
const { token, activeBusinessEntity } = useSession();
|
|
5191
5249
|
const [departments, setDepartments] = (0, import_react10.useState)(() => {
|
|
@@ -5231,7 +5289,7 @@ var SelectDepartment = ({
|
|
|
5231
5289
|
}));
|
|
5232
5290
|
};
|
|
5233
5291
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5234
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5292
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5235
5293
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5236
5294
|
SearchableSelect,
|
|
5237
5295
|
{
|
|
@@ -5241,7 +5299,9 @@ var SelectDepartment = ({
|
|
|
5241
5299
|
searchPlaceholder: "Rechercher...",
|
|
5242
5300
|
onSelect,
|
|
5243
5301
|
disabled: loading,
|
|
5244
|
-
refresh: handleRefresh
|
|
5302
|
+
refresh: handleRefresh,
|
|
5303
|
+
allowClear,
|
|
5304
|
+
onRemove
|
|
5245
5305
|
},
|
|
5246
5306
|
"dept" + value
|
|
5247
5307
|
),
|
|
@@ -5250,7 +5310,10 @@ var SelectDepartment = ({
|
|
|
5250
5310
|
};
|
|
5251
5311
|
var SelectCostCenter = ({
|
|
5252
5312
|
value,
|
|
5253
|
-
onSelect
|
|
5313
|
+
onSelect,
|
|
5314
|
+
allowClear,
|
|
5315
|
+
onRemove,
|
|
5316
|
+
label = "S\xE9lectionner un centre de co\xFBt"
|
|
5254
5317
|
}) => {
|
|
5255
5318
|
const { token, activeBusinessEntity } = useSession();
|
|
5256
5319
|
const [costCenters, setCostCenters] = (0, import_react10.useState)(() => {
|
|
@@ -5303,7 +5366,7 @@ var SelectCostCenter = ({
|
|
|
5303
5366
|
}));
|
|
5304
5367
|
};
|
|
5305
5368
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5306
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5369
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5307
5370
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5308
5371
|
SearchableSelect,
|
|
5309
5372
|
{
|
|
@@ -5313,7 +5376,9 @@ var SelectCostCenter = ({
|
|
|
5313
5376
|
searchPlaceholder: "Rechercher...",
|
|
5314
5377
|
onSelect,
|
|
5315
5378
|
disabled: loading,
|
|
5316
|
-
refresh: handleRefresh
|
|
5379
|
+
refresh: handleRefresh,
|
|
5380
|
+
allowClear,
|
|
5381
|
+
onRemove
|
|
5317
5382
|
},
|
|
5318
5383
|
"cost" + value
|
|
5319
5384
|
),
|
|
@@ -5322,7 +5387,10 @@ var SelectCostCenter = ({
|
|
|
5322
5387
|
};
|
|
5323
5388
|
var SelectUnit = ({
|
|
5324
5389
|
value,
|
|
5325
|
-
onSelect
|
|
5390
|
+
onSelect,
|
|
5391
|
+
allowClear,
|
|
5392
|
+
onRemove,
|
|
5393
|
+
label = "S\xE9lectionner une unit\xE9"
|
|
5326
5394
|
}) => {
|
|
5327
5395
|
const { token, activeBusinessEntity } = useSession();
|
|
5328
5396
|
const [units, setUnits] = (0, import_react10.useState)(() => {
|
|
@@ -5377,7 +5445,7 @@ var SelectUnit = ({
|
|
|
5377
5445
|
}));
|
|
5378
5446
|
};
|
|
5379
5447
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5380
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5448
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5381
5449
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5382
5450
|
SearchableSelect,
|
|
5383
5451
|
{
|
|
@@ -5387,7 +5455,9 @@ var SelectUnit = ({
|
|
|
5387
5455
|
searchPlaceholder: "Rechercher...",
|
|
5388
5456
|
onSelect,
|
|
5389
5457
|
disabled: loading,
|
|
5390
|
-
refresh: handleRefresh
|
|
5458
|
+
refresh: handleRefresh,
|
|
5459
|
+
allowClear,
|
|
5460
|
+
onRemove
|
|
5391
5461
|
},
|
|
5392
5462
|
"unit" + value
|
|
5393
5463
|
),
|
|
@@ -5418,7 +5488,9 @@ var SelectAccount = ({
|
|
|
5418
5488
|
filterClass,
|
|
5419
5489
|
filterType,
|
|
5420
5490
|
showInactive = false,
|
|
5421
|
-
label = "Selectionner un compte"
|
|
5491
|
+
label = "Selectionner un compte",
|
|
5492
|
+
allowClear,
|
|
5493
|
+
onRemove
|
|
5422
5494
|
}) => {
|
|
5423
5495
|
const { token, activeBusinessEntity } = useSession();
|
|
5424
5496
|
const [accounts, setAccounts] = (0, import_react10.useState)(() => {
|
|
@@ -5585,7 +5657,9 @@ var SelectAccount = ({
|
|
|
5585
5657
|
onSelect,
|
|
5586
5658
|
disabled: loading,
|
|
5587
5659
|
refresh: handleRefresh,
|
|
5588
|
-
addElement: handleOpenModal
|
|
5660
|
+
addElement: handleOpenModal,
|
|
5661
|
+
allowClear,
|
|
5662
|
+
onRemove
|
|
5589
5663
|
},
|
|
5590
5664
|
"account" + value
|
|
5591
5665
|
),
|
|
@@ -5695,7 +5769,10 @@ var SelectAccount = ({
|
|
|
5695
5769
|
};
|
|
5696
5770
|
var SelectClient = ({
|
|
5697
5771
|
value,
|
|
5698
|
-
onSelect
|
|
5772
|
+
onSelect,
|
|
5773
|
+
allowClear,
|
|
5774
|
+
onRemove,
|
|
5775
|
+
label = "S\xE9lectionner un client"
|
|
5699
5776
|
}) => {
|
|
5700
5777
|
const { token, activeBusinessEntity } = useSession();
|
|
5701
5778
|
const [clients, setClients] = (0, import_react10.useState)(() => {
|
|
@@ -5745,7 +5822,7 @@ var SelectClient = ({
|
|
|
5745
5822
|
loadClients();
|
|
5746
5823
|
};
|
|
5747
5824
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
5748
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children:
|
|
5825
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
|
|
5749
5826
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5750
5827
|
SearchableSelect,
|
|
5751
5828
|
{
|
|
@@ -5755,7 +5832,9 @@ var SelectClient = ({
|
|
|
5755
5832
|
searchPlaceholder: "Rechercher...",
|
|
5756
5833
|
onSelect,
|
|
5757
5834
|
disabled: loading,
|
|
5758
|
-
refresh: handleRefresh
|
|
5835
|
+
refresh: handleRefresh,
|
|
5836
|
+
allowClear,
|
|
5837
|
+
onRemove
|
|
5759
5838
|
},
|
|
5760
5839
|
"client" + value
|
|
5761
5840
|
),
|
|
@@ -10320,10 +10399,1473 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10320
10399
|
maximumFractionDigits: showDecimals ? 2 : 0
|
|
10321
10400
|
}) + (currency ? ` ${currency}` : "");
|
|
10322
10401
|
};
|
|
10402
|
+
|
|
10403
|
+
// src/components/common/ModernCard.tsx
|
|
10404
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10405
|
+
var ModernCard = ({
|
|
10406
|
+
children,
|
|
10407
|
+
className,
|
|
10408
|
+
hoverable = false,
|
|
10409
|
+
bordered = true,
|
|
10410
|
+
elevated = false,
|
|
10411
|
+
gradient = false,
|
|
10412
|
+
onClick
|
|
10413
|
+
}) => {
|
|
10414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
10415
|
+
"div",
|
|
10416
|
+
{
|
|
10417
|
+
onClick,
|
|
10418
|
+
className: cn(
|
|
10419
|
+
"bg-[var(--color-surface)] rounded-xl transition-all duration-300",
|
|
10420
|
+
bordered && "border border-[var(--color-border)]",
|
|
10421
|
+
elevated && "shadow-[var(--shadow-md)]",
|
|
10422
|
+
hoverable && "hover:shadow-[var(--shadow-lg)] hover:-translate-y-1 cursor-pointer",
|
|
10423
|
+
gradient && "bg-gradient-to-br from-[var(--color-surface)] to-[var(--color-surface-hover)]",
|
|
10424
|
+
onClick && "cursor-pointer",
|
|
10425
|
+
className
|
|
10426
|
+
),
|
|
10427
|
+
children
|
|
10428
|
+
}
|
|
10429
|
+
);
|
|
10430
|
+
};
|
|
10431
|
+
var CardHeader = ({
|
|
10432
|
+
title,
|
|
10433
|
+
subtitle,
|
|
10434
|
+
icon: Icon,
|
|
10435
|
+
action,
|
|
10436
|
+
className,
|
|
10437
|
+
children
|
|
10438
|
+
}) => {
|
|
10439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("p-4 border-b border-[var(--color-border-light)]", className), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between", children: [
|
|
10440
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start gap-4", children: [
|
|
10441
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "p-2 bg-[var(--color-primary-light)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { className: "w-4 h-4 text-[var(--color-primary)]" }) }),
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
10443
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "text-lg font-semibold text-[var(--color-text-primary)]", children: title }),
|
|
10444
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-1 text-sm text-[var(--color-text-secondary)]", children: subtitle })
|
|
10445
|
+
] })
|
|
10446
|
+
] }),
|
|
10447
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: action }),
|
|
10448
|
+
children
|
|
10449
|
+
] }) });
|
|
10450
|
+
};
|
|
10451
|
+
var CardBody = ({
|
|
10452
|
+
children,
|
|
10453
|
+
className,
|
|
10454
|
+
noPadding = false
|
|
10455
|
+
}) => {
|
|
10456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(!noPadding && "p-4", className), children });
|
|
10457
|
+
};
|
|
10458
|
+
var StatCard = ({
|
|
10459
|
+
title,
|
|
10460
|
+
value,
|
|
10461
|
+
change,
|
|
10462
|
+
icon: Icon,
|
|
10463
|
+
color = "primary",
|
|
10464
|
+
className
|
|
10465
|
+
}) => {
|
|
10466
|
+
const colorClasses = {
|
|
10467
|
+
primary: "bg-[var(--color-primary-light)] text-[var(--color-primary)]",
|
|
10468
|
+
success: "bg-[var(--color-success-light)] text-[var(--color-success)]",
|
|
10469
|
+
warning: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
|
|
10470
|
+
error: "bg-[var(--color-error-light)] text-[var(--color-error)]",
|
|
10471
|
+
info: "bg-[var(--color-info-light)] text-[var(--color-info)]"
|
|
10472
|
+
};
|
|
10473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ModernCard, { className: cn("p-4", className), hoverable: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between", children: [
|
|
10474
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex-1", children: [
|
|
10475
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-secondary)]", children: title }),
|
|
10476
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-2 text-3xl font-bold text-[var(--color-text-primary)]", children: value }),
|
|
10477
|
+
change && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: cn(
|
|
10479
|
+
"text-sm font-medium",
|
|
10480
|
+
change.type === "increase" ? "text-[var(--color-success)]" : "text-[var(--color-error)]"
|
|
10481
|
+
), children: [
|
|
10482
|
+
change.type === "increase" ? "\u2191" : "\u2193",
|
|
10483
|
+
" ",
|
|
10484
|
+
Math.abs(change.value),
|
|
10485
|
+
"%"
|
|
10486
|
+
] }),
|
|
10487
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: "vs p\xE9riode pr\xE9c\xE9dente" })
|
|
10488
|
+
] })
|
|
10489
|
+
] }),
|
|
10490
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("p-2.5 rounded-lg", colorClasses[color]), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { className: "w-5 h-5" }) })
|
|
10491
|
+
] }) });
|
|
10492
|
+
};
|
|
10493
|
+
|
|
10494
|
+
// src/services/WorkspaceServices.ts
|
|
10495
|
+
var WorkspaceServices = {
|
|
10496
|
+
/**
|
|
10497
|
+
* Récupère les données du workspace Procurement (Achats)
|
|
10498
|
+
*/
|
|
10499
|
+
getProcurementWorkspace: async (businessEntityId) => {
|
|
10500
|
+
const params = new URLSearchParams();
|
|
10501
|
+
if (businessEntityId) {
|
|
10502
|
+
params.append("business_entity", businessEntityId);
|
|
10503
|
+
}
|
|
10504
|
+
const queryString = params.toString();
|
|
10505
|
+
const url = `${API_URL}/core/workspaces/procurement/${queryString ? `?${queryString}` : ""}`;
|
|
10506
|
+
const response = await FetchApi.get(url);
|
|
10507
|
+
if (!response.success) {
|
|
10508
|
+
throw new Error(response.message || "Erreur lors de la r\xE9cup\xE9ration des donn\xE9es du workspace");
|
|
10509
|
+
}
|
|
10510
|
+
return response.data;
|
|
10511
|
+
}
|
|
10512
|
+
};
|
|
10513
|
+
|
|
10514
|
+
// src/pages/workspaces/WorkSpace.tsx
|
|
10515
|
+
var import_react29 = require("react");
|
|
10516
|
+
var import_lucide_react25 = require("lucide-react");
|
|
10517
|
+
|
|
10518
|
+
// src/pages/workspaces/PurchaseWorkspace.tsx
|
|
10519
|
+
var import_react25 = require("react");
|
|
10520
|
+
var import_lucide_react21 = require("lucide-react");
|
|
10521
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
10522
|
+
var formatCurrency2 = (amount) => {
|
|
10523
|
+
return new Intl.NumberFormat("fr-FR", {
|
|
10524
|
+
style: "decimal",
|
|
10525
|
+
minimumFractionDigits: 0,
|
|
10526
|
+
maximumFractionDigits: 0
|
|
10527
|
+
}).format(amount) + " FCFA";
|
|
10528
|
+
};
|
|
10529
|
+
var formatCurrencyShort = (amount) => {
|
|
10530
|
+
if (amount >= 1e6) {
|
|
10531
|
+
return `${(amount / 1e6).toFixed(1)}M FCFA`;
|
|
10532
|
+
} else if (amount >= 1e3) {
|
|
10533
|
+
return `${(amount / 1e3).toFixed(0)}k FCFA`;
|
|
10534
|
+
}
|
|
10535
|
+
return formatCurrency2(amount);
|
|
10536
|
+
};
|
|
10537
|
+
var formatRelativeTime = (timestamp) => {
|
|
10538
|
+
if (!timestamp) return "";
|
|
10539
|
+
const date = new Date(timestamp);
|
|
10540
|
+
const now = /* @__PURE__ */ new Date();
|
|
10541
|
+
const diffMs = now.getTime() - date.getTime();
|
|
10542
|
+
const diffMins = Math.floor(diffMs / 6e4);
|
|
10543
|
+
const diffHours = Math.floor(diffMs / 36e5);
|
|
10544
|
+
const diffDays = Math.floor(diffMs / 864e5);
|
|
10545
|
+
if (diffMins < 1) return "A l'instant";
|
|
10546
|
+
if (diffMins < 60) return `Il y a ${diffMins} min`;
|
|
10547
|
+
if (diffHours < 24) return `Il y a ${diffHours}h`;
|
|
10548
|
+
if (diffDays === 1) return "Hier";
|
|
10549
|
+
if (diffDays < 7) return `Il y a ${diffDays} jours`;
|
|
10550
|
+
return date.toLocaleDateString("fr-FR");
|
|
10551
|
+
};
|
|
10552
|
+
var PurchaseWorkspace = () => {
|
|
10553
|
+
const [stats, setStats] = (0, import_react25.useState)(null);
|
|
10554
|
+
const [recentActivities, setRecentActivities] = (0, import_react25.useState)([]);
|
|
10555
|
+
const [pendingTasks, setPendingTasks] = (0, import_react25.useState)([]);
|
|
10556
|
+
const [loading, setLoading] = (0, import_react25.useState)(true);
|
|
10557
|
+
const [error, setError] = (0, import_react25.useState)(null);
|
|
10558
|
+
(0, import_react25.useEffect)(() => {
|
|
10559
|
+
loadWorkspaceData();
|
|
10560
|
+
}, []);
|
|
10561
|
+
const loadWorkspaceData = async () => {
|
|
10562
|
+
setLoading(true);
|
|
10563
|
+
setError(null);
|
|
10564
|
+
try {
|
|
10565
|
+
const businessEntityId = localStorage.getItem("active_center_id") || void 0;
|
|
10566
|
+
const data = await WorkspaceServices.getProcurementWorkspace(businessEntityId);
|
|
10567
|
+
setStats(data);
|
|
10568
|
+
setRecentActivities(data.recent_activities || []);
|
|
10569
|
+
setPendingTasks(data.pending_tasks || []);
|
|
10570
|
+
} catch (err) {
|
|
10571
|
+
console.error("Erreur lors du chargement du workspace:", err);
|
|
10572
|
+
setError("Impossible de charger les donnees du workspace. Veuillez reessayer.");
|
|
10573
|
+
setStats({
|
|
10574
|
+
purchase_requests: {
|
|
10575
|
+
total: 0,
|
|
10576
|
+
draft: 0,
|
|
10577
|
+
pending_approval: 0,
|
|
10578
|
+
approved: 0,
|
|
10579
|
+
in_sourcing: 0,
|
|
10580
|
+
completed: 0,
|
|
10581
|
+
rejected: 0,
|
|
10582
|
+
trend: 0
|
|
10583
|
+
},
|
|
10584
|
+
rfqs: {
|
|
10585
|
+
total: 0,
|
|
10586
|
+
draft: 0,
|
|
10587
|
+
open: 0,
|
|
10588
|
+
pending_evaluation: 0,
|
|
10589
|
+
closed: 0
|
|
10590
|
+
},
|
|
10591
|
+
purchase_orders: {
|
|
10592
|
+
total: 0,
|
|
10593
|
+
pending_delivery: 0,
|
|
10594
|
+
delivered: 0,
|
|
10595
|
+
total_value: 0,
|
|
10596
|
+
trend: 0
|
|
10597
|
+
},
|
|
10598
|
+
receipts: {
|
|
10599
|
+
total: 0,
|
|
10600
|
+
pending_validation: 0,
|
|
10601
|
+
validated: 0
|
|
10602
|
+
},
|
|
10603
|
+
vendors: {
|
|
10604
|
+
total: 0,
|
|
10605
|
+
active: 0
|
|
10606
|
+
},
|
|
10607
|
+
alerts: {
|
|
10608
|
+
overdue_deliveries: 0,
|
|
10609
|
+
expiring_contracts: 0,
|
|
10610
|
+
pending_approvals: 0
|
|
10611
|
+
},
|
|
10612
|
+
recent_activities: [],
|
|
10613
|
+
pending_tasks: []
|
|
10614
|
+
});
|
|
10615
|
+
} finally {
|
|
10616
|
+
setLoading(false);
|
|
10617
|
+
}
|
|
10618
|
+
};
|
|
10619
|
+
const getPriorityColor = (priority) => {
|
|
10620
|
+
const colors = {
|
|
10621
|
+
low: "bg-[var(--color-border-light)] text-[var(--color-text-secondary)]",
|
|
10622
|
+
medium: "bg-[var(--color-info-light)] text-[var(--color-info)]",
|
|
10623
|
+
high: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
|
|
10624
|
+
critical: "bg-[var(--color-error-light)] text-[var(--color-error)]"
|
|
10625
|
+
};
|
|
10626
|
+
return colors[priority] || colors.medium;
|
|
10627
|
+
};
|
|
10628
|
+
const getActivityIcon = (type) => {
|
|
10629
|
+
const icons = {
|
|
10630
|
+
pr_created: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileText, { className: "w-4 h-4" }),
|
|
10631
|
+
rfq_sent: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Send, { className: "w-4 h-4" }),
|
|
10632
|
+
quote_received: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileCheck, { className: "w-4 h-4" }),
|
|
10633
|
+
po_issued: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ShoppingCart, { className: "w-4 h-4" }),
|
|
10634
|
+
receipt_created: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Package, { className: "w-4 h-4" }),
|
|
10635
|
+
approval_pending: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Clock, { className: "w-4 h-4" })
|
|
10636
|
+
};
|
|
10637
|
+
return icons[type] || /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileText, { className: "w-4 h-4" });
|
|
10638
|
+
};
|
|
10639
|
+
const getActivityStatusColor = (status) => {
|
|
10640
|
+
const colors = {
|
|
10641
|
+
info: "bg-[var(--color-info-light)] text-[var(--color-info)]",
|
|
10642
|
+
success: "bg-[var(--color-success-light)] text-[var(--color-success)]",
|
|
10643
|
+
warning: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
|
|
10644
|
+
error: "bg-[var(--color-error-light)] text-[var(--color-error)]"
|
|
10645
|
+
};
|
|
10646
|
+
return colors[status] || colors.info;
|
|
10647
|
+
};
|
|
10648
|
+
if (loading) {
|
|
10649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-center", children: [
|
|
10650
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
|
|
10651
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Achats..." })
|
|
10652
|
+
] }) });
|
|
10653
|
+
}
|
|
10654
|
+
if (!stats) return null;
|
|
10655
|
+
const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
10656
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
|
|
10657
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
|
|
10658
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10659
|
+
"button",
|
|
10660
|
+
{
|
|
10661
|
+
onClick: loadWorkspaceData,
|
|
10662
|
+
className: "text-sm text-[var(--color-error)] hover:underline font-medium",
|
|
10663
|
+
children: "Reessayer"
|
|
10664
|
+
}
|
|
10665
|
+
)
|
|
10666
|
+
] }) }) : null;
|
|
10667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-6", children: [
|
|
10668
|
+
ErrorBanner,
|
|
10669
|
+
(stats.alerts.overdue_deliveries > 0 || stats.alerts.expiring_contracts > 0 || stats.alerts.pending_approvals > 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
10670
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
|
|
10671
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1", children: [
|
|
10672
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes necessitant votre attention" }),
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
|
|
10674
|
+
stats.alerts.overdue_deliveries > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10675
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.overdue_deliveries }),
|
|
10676
|
+
" livraisons en retard"
|
|
10677
|
+
] }),
|
|
10678
|
+
stats.alerts.expiring_contracts > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10679
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.expiring_contracts }),
|
|
10680
|
+
" contrats expirant bientot"
|
|
10681
|
+
] }),
|
|
10682
|
+
stats.alerts.pending_approvals > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.pending_approvals }),
|
|
10684
|
+
" approbations en attente"
|
|
10685
|
+
] })
|
|
10686
|
+
] })
|
|
10687
|
+
] })
|
|
10688
|
+
] }) }),
|
|
10689
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
|
|
10690
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10691
|
+
StatCard,
|
|
10692
|
+
{
|
|
10693
|
+
title: "Demandes d'achat",
|
|
10694
|
+
value: stats.purchase_requests.total,
|
|
10695
|
+
icon: import_lucide_react21.FileText,
|
|
10696
|
+
color: "primary",
|
|
10697
|
+
change: stats.purchase_requests.trend !== 0 ? {
|
|
10698
|
+
value: stats.purchase_requests.trend,
|
|
10699
|
+
type: stats.purchase_requests.trend > 0 ? "increase" : "decrease"
|
|
10700
|
+
} : void 0
|
|
10701
|
+
}
|
|
10702
|
+
),
|
|
10703
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10704
|
+
StatCard,
|
|
10705
|
+
{
|
|
10706
|
+
title: "Appels d'offres actifs",
|
|
10707
|
+
value: stats.rfqs.open,
|
|
10708
|
+
icon: import_lucide_react21.ClipboardList,
|
|
10709
|
+
color: "info"
|
|
10710
|
+
}
|
|
10711
|
+
),
|
|
10712
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10713
|
+
StatCard,
|
|
10714
|
+
{
|
|
10715
|
+
title: "Commandes en cours",
|
|
10716
|
+
value: stats.purchase_orders.pending_delivery,
|
|
10717
|
+
icon: import_lucide_react21.Truck,
|
|
10718
|
+
color: "warning"
|
|
10719
|
+
}
|
|
10720
|
+
),
|
|
10721
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10722
|
+
StatCard,
|
|
10723
|
+
{
|
|
10724
|
+
title: "Budget engage",
|
|
10725
|
+
value: formatCurrencyShort(stats.purchase_orders.total_value),
|
|
10726
|
+
icon: import_lucide_react21.Banknote,
|
|
10727
|
+
color: "success",
|
|
10728
|
+
change: stats.purchase_orders.trend !== 0 ? {
|
|
10729
|
+
value: stats.purchase_orders.trend,
|
|
10730
|
+
type: stats.purchase_orders.trend > 0 ? "increase" : "decrease"
|
|
10731
|
+
} : void 0
|
|
10732
|
+
}
|
|
10733
|
+
)
|
|
10734
|
+
] }),
|
|
10735
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
|
|
10736
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
|
|
10737
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10738
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10739
|
+
CardHeader,
|
|
10740
|
+
{
|
|
10741
|
+
title: "Taches en attente",
|
|
10742
|
+
icon: import_lucide_react21.Clock,
|
|
10743
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
|
|
10744
|
+
"Voir tout ",
|
|
10745
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ArrowRight, { className: "w-4 h-4 ml-1" })
|
|
10746
|
+
] })
|
|
10747
|
+
}
|
|
10748
|
+
),
|
|
10749
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: pendingTasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
10750
|
+
"div",
|
|
10751
|
+
{
|
|
10752
|
+
className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer flex items-center justify-between",
|
|
10753
|
+
children: [
|
|
10754
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
10755
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getPriorityColor(task.priority)}`, children: task.priority === "critical" ? "Critique" : task.priority === "high" ? "Haute" : task.priority === "medium" ? "Moyenne" : "Basse" }),
|
|
10756
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
10757
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: task.title }),
|
|
10758
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: [
|
|
10759
|
+
"Echeance: ",
|
|
10760
|
+
task.dueDate
|
|
10761
|
+
] })
|
|
10762
|
+
] })
|
|
10763
|
+
] }),
|
|
10764
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ArrowRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" })
|
|
10765
|
+
]
|
|
10766
|
+
},
|
|
10767
|
+
task.id
|
|
10768
|
+
)) }) })
|
|
10769
|
+
] }),
|
|
10770
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
10771
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10772
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Demandes d'achat", icon: import_lucide_react21.FileText }),
|
|
10773
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
|
|
10774
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
|
|
10775
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10776
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-text-tertiary)] rounded-full" }),
|
|
10777
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Brouillons" })
|
|
10778
|
+
] }),
|
|
10779
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.draft })
|
|
10780
|
+
] }),
|
|
10781
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-warning-light)] rounded-lg", children: [
|
|
10782
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-warning)] rounded-full" }),
|
|
10784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En attente d'approbation" })
|
|
10785
|
+
] }),
|
|
10786
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.pending_approval })
|
|
10787
|
+
] }),
|
|
10788
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
|
|
10791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Approuvees" })
|
|
10792
|
+
] }),
|
|
10793
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.approved })
|
|
10794
|
+
] }),
|
|
10795
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
10796
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10797
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
|
|
10798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En sourcing" })
|
|
10799
|
+
] }),
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.in_sourcing })
|
|
10801
|
+
] })
|
|
10802
|
+
] }) })
|
|
10803
|
+
] }),
|
|
10804
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Appels d'offres (RFQ)", icon: import_lucide_react21.ClipboardList }),
|
|
10806
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
|
|
10807
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
10808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10809
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
|
|
10810
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Ouverts" })
|
|
10811
|
+
] }),
|
|
10812
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.open })
|
|
10813
|
+
] }),
|
|
10814
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-secondary)] bg-opacity-10 rounded-lg", children: [
|
|
10815
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10816
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-secondary)] rounded-full" }),
|
|
10817
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En evaluation" })
|
|
10818
|
+
] }),
|
|
10819
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.pending_evaluation })
|
|
10820
|
+
] }),
|
|
10821
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
10822
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
10823
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
|
|
10824
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Clotures" })
|
|
10825
|
+
] }),
|
|
10826
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.closed })
|
|
10827
|
+
] })
|
|
10828
|
+
] }) })
|
|
10829
|
+
] })
|
|
10830
|
+
] })
|
|
10831
|
+
] }),
|
|
10832
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-6", children: [
|
|
10833
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10834
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10835
|
+
CardHeader,
|
|
10836
|
+
{
|
|
10837
|
+
title: "Activites recentes",
|
|
10838
|
+
icon: import_lucide_react21.Clock,
|
|
10839
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: "text-sm text-[var(--color-primary)] hover:underline", children: "Historique" })
|
|
10840
|
+
}
|
|
10841
|
+
),
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: recentActivities.map((activity) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
10843
|
+
"div",
|
|
10844
|
+
{
|
|
10845
|
+
className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
10846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
10847
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `p-2 rounded-lg ${getActivityStatusColor(activity.status)}`, children: getActivityIcon(activity.type) }),
|
|
10848
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
10849
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: activity.title }),
|
|
10850
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] truncate", children: activity.description }),
|
|
10851
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-1", children: formatRelativeTime(activity.timestamp) })
|
|
10852
|
+
] })
|
|
10853
|
+
] })
|
|
10854
|
+
},
|
|
10855
|
+
activity.id
|
|
10856
|
+
)) }) })
|
|
10857
|
+
] }),
|
|
10858
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10859
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Fournisseurs", icon: import_lucide_react21.Users }),
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-center py-4", children: [
|
|
10861
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-4xl font-bold text-[var(--color-text-primary)]", children: stats.vendors.total }),
|
|
10862
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "fournisseurs references" }),
|
|
10863
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-4 flex justify-center space-x-6", children: [
|
|
10864
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
10865
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg font-semibold text-[var(--color-success)]", children: stats.vendors.active }),
|
|
10866
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Actifs" })
|
|
10867
|
+
] }),
|
|
10868
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
10869
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg font-semibold text-[var(--color-text-tertiary)]", children: stats.vendors.total - stats.vendors.active }),
|
|
10870
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Inactifs" })
|
|
10871
|
+
] })
|
|
10872
|
+
] })
|
|
10873
|
+
] }) })
|
|
10874
|
+
] }),
|
|
10875
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
|
|
10876
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Receptions", icon: import_lucide_react21.Package }),
|
|
10877
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
|
|
10878
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
10879
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "En attente de validation" }),
|
|
10880
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.receipts.pending_validation })
|
|
10881
|
+
] }),
|
|
10882
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
10883
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Validees ce mois" }),
|
|
10884
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.receipts.validated })
|
|
10885
|
+
] })
|
|
10886
|
+
] }) })
|
|
10887
|
+
] })
|
|
10888
|
+
] })
|
|
10889
|
+
] })
|
|
10890
|
+
] });
|
|
10891
|
+
};
|
|
10892
|
+
var PurchaseWorkspace_default = PurchaseWorkspace;
|
|
10893
|
+
|
|
10894
|
+
// src/pages/workspaces/AccountingWorkspace.tsx
|
|
10895
|
+
var import_react26 = require("react");
|
|
10896
|
+
var import_lucide_react22 = require("lucide-react");
|
|
10897
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10898
|
+
var formatCurrency3 = (amount) => {
|
|
10899
|
+
return new Intl.NumberFormat("fr-FR", {
|
|
10900
|
+
style: "decimal",
|
|
10901
|
+
minimumFractionDigits: 0,
|
|
10902
|
+
maximumFractionDigits: 0
|
|
10903
|
+
}).format(amount) + " FCFA";
|
|
10904
|
+
};
|
|
10905
|
+
var formatCurrencyShort2 = (amount) => {
|
|
10906
|
+
if (amount >= 1e6) {
|
|
10907
|
+
return `${(amount / 1e6).toFixed(1)}M FCFA`;
|
|
10908
|
+
} else if (amount >= 1e3) {
|
|
10909
|
+
return `${(amount / 1e3).toFixed(0)}k FCFA`;
|
|
10910
|
+
}
|
|
10911
|
+
return formatCurrency3(amount);
|
|
10912
|
+
};
|
|
10913
|
+
var AccountingWorkspace = () => {
|
|
10914
|
+
const [stats, setStats] = (0, import_react26.useState)(null);
|
|
10915
|
+
const [loading, setLoading] = (0, import_react26.useState)(true);
|
|
10916
|
+
const [error, setError] = (0, import_react26.useState)(null);
|
|
10917
|
+
(0, import_react26.useEffect)(() => {
|
|
10918
|
+
loadWorkspaceData();
|
|
10919
|
+
}, []);
|
|
10920
|
+
const loadWorkspaceData = async () => {
|
|
10921
|
+
setLoading(true);
|
|
10922
|
+
setError(null);
|
|
10923
|
+
try {
|
|
10924
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
10925
|
+
setStats({
|
|
10926
|
+
journal_entries: {
|
|
10927
|
+
total: 0,
|
|
10928
|
+
draft: 0,
|
|
10929
|
+
pending_validation: 0,
|
|
10930
|
+
validated: 0,
|
|
10931
|
+
trend: 0
|
|
10932
|
+
},
|
|
10933
|
+
invoices: {
|
|
10934
|
+
receivable: 0,
|
|
10935
|
+
payable: 0,
|
|
10936
|
+
overdue_receivable: 0,
|
|
10937
|
+
overdue_payable: 0
|
|
10938
|
+
},
|
|
10939
|
+
cash_flow: {
|
|
10940
|
+
inflow: 0,
|
|
10941
|
+
outflow: 0,
|
|
10942
|
+
balance: 0
|
|
10943
|
+
},
|
|
10944
|
+
bank_reconciliation: {
|
|
10945
|
+
pending: 0,
|
|
10946
|
+
reconciled: 0
|
|
10947
|
+
},
|
|
10948
|
+
alerts: {
|
|
10949
|
+
unbalanced_entries: 0,
|
|
10950
|
+
overdue_invoices: 0,
|
|
10951
|
+
pending_approvals: 0
|
|
10952
|
+
}
|
|
10953
|
+
});
|
|
10954
|
+
} catch (err) {
|
|
10955
|
+
console.error("Erreur lors du chargement du workspace:", err);
|
|
10956
|
+
setError("Impossible de charger les donnees du workspace comptabilite.");
|
|
10957
|
+
} finally {
|
|
10958
|
+
setLoading(false);
|
|
10959
|
+
}
|
|
10960
|
+
};
|
|
10961
|
+
if (loading) {
|
|
10962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-center", children: [
|
|
10963
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
|
|
10964
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Comptabilite..." })
|
|
10965
|
+
] }) });
|
|
10966
|
+
}
|
|
10967
|
+
if (!stats) return null;
|
|
10968
|
+
const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
10969
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
|
|
10970
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
|
|
10971
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10972
|
+
"button",
|
|
10973
|
+
{
|
|
10974
|
+
onClick: loadWorkspaceData,
|
|
10975
|
+
className: "text-sm text-[var(--color-error)] hover:underline font-medium",
|
|
10976
|
+
children: "Reessayer"
|
|
10977
|
+
}
|
|
10978
|
+
)
|
|
10979
|
+
] }) }) : null;
|
|
10980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-6", children: [
|
|
10981
|
+
ErrorBanner,
|
|
10982
|
+
(stats.alerts.unbalanced_entries > 0 || stats.alerts.overdue_invoices > 0 || stats.alerts.pending_approvals > 0) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
10983
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
|
|
10984
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-1", children: [
|
|
10985
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes comptables" }),
|
|
10986
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
|
|
10987
|
+
stats.alerts.unbalanced_entries > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10988
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.unbalanced_entries }),
|
|
10989
|
+
" ecritures non equilibrees"
|
|
10990
|
+
] }),
|
|
10991
|
+
stats.alerts.overdue_invoices > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10992
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.overdue_invoices }),
|
|
10993
|
+
" factures en retard"
|
|
10994
|
+
] }),
|
|
10995
|
+
stats.alerts.pending_approvals > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
10996
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.pending_approvals }),
|
|
10997
|
+
" validations en attente"
|
|
10998
|
+
] })
|
|
10999
|
+
] })
|
|
11000
|
+
] })
|
|
11001
|
+
] }) }),
|
|
11002
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
|
|
11003
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11004
|
+
StatCard,
|
|
11005
|
+
{
|
|
11006
|
+
title: "Ecritures comptables",
|
|
11007
|
+
value: stats.journal_entries.total,
|
|
11008
|
+
icon: import_lucide_react22.BookOpen,
|
|
11009
|
+
color: "primary",
|
|
11010
|
+
change: stats.journal_entries.trend !== 0 ? {
|
|
11011
|
+
value: stats.journal_entries.trend,
|
|
11012
|
+
type: stats.journal_entries.trend > 0 ? "increase" : "decrease"
|
|
11013
|
+
} : void 0
|
|
11014
|
+
}
|
|
11015
|
+
),
|
|
11016
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11017
|
+
StatCard,
|
|
11018
|
+
{
|
|
11019
|
+
title: "Creances clients",
|
|
11020
|
+
value: formatCurrencyShort2(stats.invoices.receivable),
|
|
11021
|
+
icon: import_lucide_react22.TrendingUp,
|
|
11022
|
+
color: "success"
|
|
11023
|
+
}
|
|
11024
|
+
),
|
|
11025
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11026
|
+
StatCard,
|
|
11027
|
+
{
|
|
11028
|
+
title: "Dettes fournisseurs",
|
|
11029
|
+
value: formatCurrencyShort2(stats.invoices.payable),
|
|
11030
|
+
icon: import_lucide_react22.TrendingDown,
|
|
11031
|
+
color: "warning"
|
|
11032
|
+
}
|
|
11033
|
+
),
|
|
11034
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11035
|
+
StatCard,
|
|
11036
|
+
{
|
|
11037
|
+
title: "Solde tresorerie",
|
|
11038
|
+
value: formatCurrencyShort2(stats.cash_flow.balance),
|
|
11039
|
+
icon: import_lucide_react22.PiggyBank,
|
|
11040
|
+
color: "info"
|
|
11041
|
+
}
|
|
11042
|
+
)
|
|
11043
|
+
] }),
|
|
11044
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
|
|
11045
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
|
|
11046
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
|
|
11047
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11048
|
+
CardHeader,
|
|
11049
|
+
{
|
|
11050
|
+
title: "Ecritures comptables",
|
|
11051
|
+
icon: import_lucide_react22.BookOpen,
|
|
11052
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
|
|
11053
|
+
"Voir tout ",
|
|
11054
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.ArrowRight, { className: "w-4 h-4 ml-1" })
|
|
11055
|
+
] })
|
|
11056
|
+
}
|
|
11057
|
+
),
|
|
11058
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
11059
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-surface-hover)] rounded-lg text-center", children: [
|
|
11060
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-tertiary)]", children: stats.journal_entries.draft }),
|
|
11061
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Brouillons" })
|
|
11062
|
+
] }),
|
|
11063
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
|
|
11064
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.journal_entries.pending_validation }),
|
|
11065
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "A valider" })
|
|
11066
|
+
] }),
|
|
11067
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
|
|
11068
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.journal_entries.validated }),
|
|
11069
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Validees" })
|
|
11070
|
+
] })
|
|
11071
|
+
] }) })
|
|
11072
|
+
] }),
|
|
11073
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
|
|
11074
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Flux de tresorerie (ce mois)", icon: import_lucide_react22.Banknote }),
|
|
11075
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
11076
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
11077
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
11078
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.TrendingUp, { className: "w-5 h-5 text-[var(--color-success)]" }),
|
|
11079
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Entrees" })
|
|
11080
|
+
] }),
|
|
11081
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-success)]", children: formatCurrencyShort2(stats.cash_flow.inflow) })
|
|
11082
|
+
] }),
|
|
11083
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
|
|
11084
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
11085
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.TrendingDown, { className: "w-5 h-5 text-[var(--color-error)]" }),
|
|
11086
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Sorties" })
|
|
11087
|
+
] }),
|
|
11088
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-error)]", children: formatCurrencyShort2(stats.cash_flow.outflow) })
|
|
11089
|
+
] }),
|
|
11090
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
11091
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
11092
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.PiggyBank, { className: "w-5 h-5 text-[var(--color-info)]" }),
|
|
11093
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Solde" })
|
|
11094
|
+
] }),
|
|
11095
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-info)]", children: formatCurrencyShort2(stats.cash_flow.balance) })
|
|
11096
|
+
] })
|
|
11097
|
+
] }) })
|
|
11098
|
+
] })
|
|
11099
|
+
] }),
|
|
11100
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-6", children: [
|
|
11101
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
|
|
11102
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Factures en cours", icon: import_lucide_react22.Receipt }),
|
|
11103
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-4", children: [
|
|
11104
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
11105
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
11106
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Creances clients" }),
|
|
11107
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-semibold text-[var(--color-success)]", children: formatCurrencyShort2(stats.invoices.receivable) })
|
|
11108
|
+
] }),
|
|
11109
|
+
stats.invoices.overdue_receivable > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-xs text-[var(--color-error)] flex items-center space-x-1", children: [
|
|
11110
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-3 h-3" }),
|
|
11111
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
11112
|
+
"Dont ",
|
|
11113
|
+
formatCurrencyShort2(stats.invoices.overdue_receivable),
|
|
11114
|
+
" en retard"
|
|
11115
|
+
] })
|
|
11116
|
+
] })
|
|
11117
|
+
] }),
|
|
11118
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "border-t border-[var(--color-border-light)] pt-4", children: [
|
|
11119
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
11120
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Dettes fournisseurs" }),
|
|
11121
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-semibold text-[var(--color-warning)]", children: formatCurrencyShort2(stats.invoices.payable) })
|
|
11122
|
+
] }),
|
|
11123
|
+
stats.invoices.overdue_payable > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-xs text-[var(--color-error)] flex items-center space-x-1", children: [
|
|
11124
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-3 h-3" }),
|
|
11125
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
|
|
11126
|
+
"Dont ",
|
|
11127
|
+
formatCurrencyShort2(stats.invoices.overdue_payable),
|
|
11128
|
+
" en retard"
|
|
11129
|
+
] })
|
|
11130
|
+
] })
|
|
11131
|
+
] })
|
|
11132
|
+
] }) })
|
|
11133
|
+
] }),
|
|
11134
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
|
|
11135
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Rapprochement bancaire", icon: import_lucide_react22.CreditCard }),
|
|
11136
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-3", children: [
|
|
11137
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11138
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Operations a pointer" }),
|
|
11139
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.bank_reconciliation.pending })
|
|
11140
|
+
] }),
|
|
11141
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11142
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Operations pointees" }),
|
|
11143
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.bank_reconciliation.reconciled })
|
|
11144
|
+
] })
|
|
11145
|
+
] }) })
|
|
11146
|
+
] })
|
|
11147
|
+
] })
|
|
11148
|
+
] })
|
|
11149
|
+
] });
|
|
11150
|
+
};
|
|
11151
|
+
var AccountingWorkspace_default = AccountingWorkspace;
|
|
11152
|
+
|
|
11153
|
+
// src/pages/workspaces/CrmWorkspace.tsx
|
|
11154
|
+
var import_react27 = require("react");
|
|
11155
|
+
var import_lucide_react23 = require("lucide-react");
|
|
11156
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11157
|
+
var formatCurrencyShort3 = (amount) => {
|
|
11158
|
+
if (amount >= 1e6) {
|
|
11159
|
+
return `${(amount / 1e6).toFixed(1)}M FCFA`;
|
|
11160
|
+
} else if (amount >= 1e3) {
|
|
11161
|
+
return `${(amount / 1e3).toFixed(0)}k FCFA`;
|
|
11162
|
+
}
|
|
11163
|
+
return `${amount.toLocaleString("fr-FR")} FCFA`;
|
|
11164
|
+
};
|
|
11165
|
+
var CrmWorkspace = () => {
|
|
11166
|
+
const [stats, setStats] = (0, import_react27.useState)(null);
|
|
11167
|
+
const [recentContacts, setRecentContacts] = (0, import_react27.useState)([]);
|
|
11168
|
+
const [loading, setLoading] = (0, import_react27.useState)(true);
|
|
11169
|
+
const [error, setError] = (0, import_react27.useState)(null);
|
|
11170
|
+
(0, import_react27.useEffect)(() => {
|
|
11171
|
+
loadWorkspaceData();
|
|
11172
|
+
}, []);
|
|
11173
|
+
const loadWorkspaceData = async () => {
|
|
11174
|
+
setLoading(true);
|
|
11175
|
+
setError(null);
|
|
11176
|
+
try {
|
|
11177
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
11178
|
+
setStats({
|
|
11179
|
+
clients: {
|
|
11180
|
+
total: 0,
|
|
11181
|
+
active: 0,
|
|
11182
|
+
new_this_month: 0,
|
|
11183
|
+
trend: 0
|
|
11184
|
+
},
|
|
11185
|
+
opportunities: {
|
|
11186
|
+
total: 0,
|
|
11187
|
+
qualified: 0,
|
|
11188
|
+
negotiation: 0,
|
|
11189
|
+
won: 0,
|
|
11190
|
+
lost: 0,
|
|
11191
|
+
total_value: 0
|
|
11192
|
+
},
|
|
11193
|
+
activities: {
|
|
11194
|
+
pending_calls: 0,
|
|
11195
|
+
pending_meetings: 0,
|
|
11196
|
+
pending_emails: 0,
|
|
11197
|
+
overdue: 0
|
|
11198
|
+
},
|
|
11199
|
+
revenue: {
|
|
11200
|
+
monthly: 0,
|
|
11201
|
+
quarterly: 0,
|
|
11202
|
+
trend: 0
|
|
11203
|
+
},
|
|
11204
|
+
alerts: {
|
|
11205
|
+
overdue_activities: 0,
|
|
11206
|
+
expiring_opportunities: 0,
|
|
11207
|
+
inactive_clients: 0
|
|
11208
|
+
}
|
|
11209
|
+
});
|
|
11210
|
+
setRecentContacts([]);
|
|
11211
|
+
} catch (err) {
|
|
11212
|
+
console.error("Erreur lors du chargement du workspace:", err);
|
|
11213
|
+
setError("Impossible de charger les donnees du workspace CRM.");
|
|
11214
|
+
} finally {
|
|
11215
|
+
setLoading(false);
|
|
11216
|
+
}
|
|
11217
|
+
};
|
|
11218
|
+
const getStatusColor = (status) => {
|
|
11219
|
+
const colors = {
|
|
11220
|
+
hot: "bg-[var(--color-error-light)] text-[var(--color-error)]",
|
|
11221
|
+
warm: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
|
|
11222
|
+
cold: "bg-[var(--color-info-light)] text-[var(--color-info)]"
|
|
11223
|
+
};
|
|
11224
|
+
return colors[status] || colors.cold;
|
|
11225
|
+
};
|
|
11226
|
+
const getStatusLabel = (status) => {
|
|
11227
|
+
const labels = { hot: "Chaud", warm: "Tiede", cold: "Froid" };
|
|
11228
|
+
return labels[status] || status;
|
|
11229
|
+
};
|
|
11230
|
+
if (loading) {
|
|
11231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "text-center", children: [
|
|
11232
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
|
|
11233
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace CRM..." })
|
|
11234
|
+
] }) });
|
|
11235
|
+
}
|
|
11236
|
+
if (!stats) return null;
|
|
11237
|
+
const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
11238
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
|
|
11239
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
|
|
11240
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11241
|
+
"button",
|
|
11242
|
+
{
|
|
11243
|
+
onClick: loadWorkspaceData,
|
|
11244
|
+
className: "text-sm text-[var(--color-error)] hover:underline font-medium",
|
|
11245
|
+
children: "Reessayer"
|
|
11246
|
+
}
|
|
11247
|
+
)
|
|
11248
|
+
] }) }) : null;
|
|
11249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-6", children: [
|
|
11250
|
+
ErrorBanner,
|
|
11251
|
+
(stats.alerts.overdue_activities > 0 || stats.alerts.expiring_opportunities > 0) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
11252
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
|
|
11253
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex-1", children: [
|
|
11254
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes CRM" }),
|
|
11255
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
|
|
11256
|
+
stats.alerts.overdue_activities > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
11257
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.overdue_activities }),
|
|
11258
|
+
" activites en retard"
|
|
11259
|
+
] }),
|
|
11260
|
+
stats.alerts.expiring_opportunities > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
11261
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.expiring_opportunities }),
|
|
11262
|
+
" opportunites a relancer"
|
|
11263
|
+
] }),
|
|
11264
|
+
stats.alerts.inactive_clients > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
11265
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.inactive_clients }),
|
|
11266
|
+
" clients inactifs"
|
|
11267
|
+
] })
|
|
11268
|
+
] })
|
|
11269
|
+
] })
|
|
11270
|
+
] }) }),
|
|
11271
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
|
|
11272
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11273
|
+
StatCard,
|
|
11274
|
+
{
|
|
11275
|
+
title: "Clients actifs",
|
|
11276
|
+
value: stats.clients.active,
|
|
11277
|
+
icon: import_lucide_react23.Users,
|
|
11278
|
+
color: "primary",
|
|
11279
|
+
change: stats.clients.trend !== 0 ? {
|
|
11280
|
+
value: stats.clients.trend,
|
|
11281
|
+
type: stats.clients.trend > 0 ? "increase" : "decrease"
|
|
11282
|
+
} : void 0
|
|
11283
|
+
}
|
|
11284
|
+
),
|
|
11285
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11286
|
+
StatCard,
|
|
11287
|
+
{
|
|
11288
|
+
title: "Opportunites",
|
|
11289
|
+
value: stats.opportunities.total,
|
|
11290
|
+
icon: import_lucide_react23.Target,
|
|
11291
|
+
color: "info"
|
|
11292
|
+
}
|
|
11293
|
+
),
|
|
11294
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11295
|
+
StatCard,
|
|
11296
|
+
{
|
|
11297
|
+
title: "Pipeline",
|
|
11298
|
+
value: formatCurrencyShort3(stats.opportunities.total_value),
|
|
11299
|
+
icon: import_lucide_react23.TrendingUp,
|
|
11300
|
+
color: "success"
|
|
11301
|
+
}
|
|
11302
|
+
),
|
|
11303
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11304
|
+
StatCard,
|
|
11305
|
+
{
|
|
11306
|
+
title: "CA mensuel",
|
|
11307
|
+
value: formatCurrencyShort3(stats.revenue.monthly),
|
|
11308
|
+
icon: import_lucide_react23.Banknote,
|
|
11309
|
+
color: "warning",
|
|
11310
|
+
change: stats.revenue.trend !== 0 ? {
|
|
11311
|
+
value: stats.revenue.trend,
|
|
11312
|
+
type: stats.revenue.trend > 0 ? "increase" : "decrease"
|
|
11313
|
+
} : void 0
|
|
11314
|
+
}
|
|
11315
|
+
)
|
|
11316
|
+
] }),
|
|
11317
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
|
|
11319
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
|
|
11320
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11321
|
+
CardHeader,
|
|
11322
|
+
{
|
|
11323
|
+
title: "Pipeline commercial",
|
|
11324
|
+
icon: import_lucide_react23.Target,
|
|
11325
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
|
|
11326
|
+
"Voir tout ",
|
|
11327
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.ArrowRight, { className: "w-4 h-4 ml-1" })
|
|
11328
|
+
] })
|
|
11329
|
+
}
|
|
11330
|
+
),
|
|
11331
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-4 gap-4", children: [
|
|
11332
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg text-center", children: [
|
|
11333
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-info)]", children: stats.opportunities.qualified }),
|
|
11334
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Qualifiees" })
|
|
11335
|
+
] }),
|
|
11336
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
|
|
11337
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.opportunities.negotiation }),
|
|
11338
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Negociation" })
|
|
11339
|
+
] }),
|
|
11340
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
|
|
11341
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.opportunities.won }),
|
|
11342
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gagnees" })
|
|
11343
|
+
] }),
|
|
11344
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg text-center", children: [
|
|
11345
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-error)]", children: stats.opportunities.lost }),
|
|
11346
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Perdues" })
|
|
11347
|
+
] })
|
|
11348
|
+
] }) })
|
|
11349
|
+
] }),
|
|
11350
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
|
|
11351
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11352
|
+
CardHeader,
|
|
11353
|
+
{
|
|
11354
|
+
title: "Contacts recents",
|
|
11355
|
+
icon: import_lucide_react23.Users,
|
|
11356
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
|
|
11357
|
+
"Voir tout ",
|
|
11358
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.ArrowRight, { className: "w-4 h-4 ml-1" })
|
|
11359
|
+
] })
|
|
11360
|
+
}
|
|
11361
|
+
),
|
|
11362
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: recentContacts.map((contact) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11363
|
+
"div",
|
|
11364
|
+
{
|
|
11365
|
+
className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer flex items-center justify-between",
|
|
11366
|
+
children: [
|
|
11367
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
11368
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm font-semibold text-[var(--color-primary)]", children: contact.name.split(" ").map((n) => n[0]).join("") }) }),
|
|
11369
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
11370
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: contact.name }),
|
|
11371
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: contact.company })
|
|
11372
|
+
] })
|
|
11373
|
+
] }),
|
|
11374
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getStatusColor(contact.status)}`, children: getStatusLabel(contact.status) })
|
|
11375
|
+
]
|
|
11376
|
+
},
|
|
11377
|
+
contact.id
|
|
11378
|
+
)) }) })
|
|
11379
|
+
] })
|
|
11380
|
+
] }),
|
|
11381
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-6", children: [
|
|
11382
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
|
|
11383
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardHeader, { title: "Activites a faire", icon: import_lucide_react23.Activity }),
|
|
11384
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-3", children: [
|
|
11385
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
|
|
11386
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11387
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Phone, { className: "w-4 h-4 text-[var(--color-info)]" }),
|
|
11388
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Appels" })
|
|
11389
|
+
] }),
|
|
11390
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-info-light)] text-[var(--color-info)] rounded-full", children: stats.activities.pending_calls })
|
|
11391
|
+
] }),
|
|
11392
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
|
|
11393
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11394
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Calendar, { className: "w-4 h-4 text-[var(--color-warning)]" }),
|
|
11395
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Reunions" })
|
|
11396
|
+
] }),
|
|
11397
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.activities.pending_meetings })
|
|
11398
|
+
] }),
|
|
11399
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
|
|
11400
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11401
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Mail, { className: "w-4 h-4 text-[var(--color-success)]" }),
|
|
11402
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Emails" })
|
|
11403
|
+
] }),
|
|
11404
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.activities.pending_emails })
|
|
11405
|
+
] }),
|
|
11406
|
+
stats.activities.overdue > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-error-light)] rounded-lg", children: [
|
|
11407
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11408
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-4 h-4 text-[var(--color-error)]" }),
|
|
11409
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En retard" })
|
|
11410
|
+
] }),
|
|
11411
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-error)] text-white rounded-full", children: stats.activities.overdue })
|
|
11412
|
+
] })
|
|
11413
|
+
] }) })
|
|
11414
|
+
] }),
|
|
11415
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
|
|
11416
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardHeader, { title: "Nouveaux clients", icon: import_lucide_react23.UserPlus }),
|
|
11417
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "text-center py-4", children: [
|
|
11418
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "text-4xl font-bold text-[var(--color-success)]", children: [
|
|
11419
|
+
"+",
|
|
11420
|
+
stats.clients.new_this_month
|
|
11421
|
+
] }),
|
|
11422
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "ce mois-ci" }),
|
|
11423
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-4 pt-4 border-t border-[var(--color-border-light)]", children: [
|
|
11424
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: stats.clients.total }),
|
|
11425
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "clients au total" })
|
|
11426
|
+
] })
|
|
11427
|
+
] }) })
|
|
11428
|
+
] })
|
|
11429
|
+
] })
|
|
11430
|
+
] })
|
|
11431
|
+
] });
|
|
11432
|
+
};
|
|
11433
|
+
var CrmWorkspace_default = CrmWorkspace;
|
|
11434
|
+
|
|
11435
|
+
// src/pages/workspaces/FacilityWorkspace.tsx
|
|
11436
|
+
var import_react28 = require("react");
|
|
11437
|
+
var import_lucide_react24 = require("lucide-react");
|
|
11438
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11439
|
+
var FacilityWorkspace = () => {
|
|
11440
|
+
const [stats, setStats] = (0, import_react28.useState)(null);
|
|
11441
|
+
const [maintenanceTasks, setMaintenanceTasks] = (0, import_react28.useState)([]);
|
|
11442
|
+
const [loading, setLoading] = (0, import_react28.useState)(true);
|
|
11443
|
+
const [error, setError] = (0, import_react28.useState)(null);
|
|
11444
|
+
(0, import_react28.useEffect)(() => {
|
|
11445
|
+
loadWorkspaceData();
|
|
11446
|
+
}, []);
|
|
11447
|
+
const loadWorkspaceData = async () => {
|
|
11448
|
+
setLoading(true);
|
|
11449
|
+
setError(null);
|
|
11450
|
+
try {
|
|
11451
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
11452
|
+
setStats({
|
|
11453
|
+
sites: {
|
|
11454
|
+
total: 0,
|
|
11455
|
+
active: 0
|
|
11456
|
+
},
|
|
11457
|
+
maintenance: {
|
|
11458
|
+
scheduled: 0,
|
|
11459
|
+
in_progress: 0,
|
|
11460
|
+
completed: 0,
|
|
11461
|
+
overdue: 0
|
|
11462
|
+
},
|
|
11463
|
+
incidents: {
|
|
11464
|
+
open: 0,
|
|
11465
|
+
in_progress: 0,
|
|
11466
|
+
resolved: 0,
|
|
11467
|
+
critical: 0
|
|
11468
|
+
},
|
|
11469
|
+
equipment: {
|
|
11470
|
+
total: 0,
|
|
11471
|
+
operational: 0,
|
|
11472
|
+
under_maintenance: 0,
|
|
11473
|
+
out_of_service: 0
|
|
11474
|
+
},
|
|
11475
|
+
alerts: {
|
|
11476
|
+
critical_incidents: 0,
|
|
11477
|
+
overdue_maintenance: 0,
|
|
11478
|
+
expiring_contracts: 0
|
|
11479
|
+
}
|
|
11480
|
+
});
|
|
11481
|
+
setMaintenanceTasks([]);
|
|
11482
|
+
} catch (err) {
|
|
11483
|
+
console.error("Erreur lors du chargement du workspace:", err);
|
|
11484
|
+
setError("Impossible de charger les donnees du workspace Facility.");
|
|
11485
|
+
} finally {
|
|
11486
|
+
setLoading(false);
|
|
11487
|
+
}
|
|
11488
|
+
};
|
|
11489
|
+
const getPriorityColor = (priority) => {
|
|
11490
|
+
const colors = {
|
|
11491
|
+
low: "bg-[var(--color-border-light)] text-[var(--color-text-secondary)]",
|
|
11492
|
+
medium: "bg-[var(--color-info-light)] text-[var(--color-info)]",
|
|
11493
|
+
high: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
|
|
11494
|
+
critical: "bg-[var(--color-error-light)] text-[var(--color-error)]"
|
|
11495
|
+
};
|
|
11496
|
+
return colors[priority] || colors.medium;
|
|
11497
|
+
};
|
|
11498
|
+
const getPriorityLabel = (priority) => {
|
|
11499
|
+
const labels = { low: "Basse", medium: "Moyenne", high: "Haute", critical: "Critique" };
|
|
11500
|
+
return labels[priority] || priority;
|
|
11501
|
+
};
|
|
11502
|
+
const getTypeColor = (type) => {
|
|
11503
|
+
return type === "corrective" ? "bg-[var(--color-error-light)] text-[var(--color-error)]" : "bg-[var(--color-info-light)] text-[var(--color-info)]";
|
|
11504
|
+
};
|
|
11505
|
+
if (loading) {
|
|
11506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-center", children: [
|
|
11507
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
|
|
11508
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Facility..." })
|
|
11509
|
+
] }) });
|
|
11510
|
+
}
|
|
11511
|
+
if (!stats) return null;
|
|
11512
|
+
const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
11513
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
|
|
11514
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
|
|
11515
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11516
|
+
"button",
|
|
11517
|
+
{
|
|
11518
|
+
onClick: loadWorkspaceData,
|
|
11519
|
+
className: "text-sm text-[var(--color-error)] hover:underline font-medium",
|
|
11520
|
+
children: "Reessayer"
|
|
11521
|
+
}
|
|
11522
|
+
)
|
|
11523
|
+
] }) }) : null;
|
|
11524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-6", children: [
|
|
11525
|
+
ErrorBanner,
|
|
11526
|
+
(stats.alerts.critical_incidents > 0 || stats.alerts.overdue_maintenance > 0) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
11527
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)] mt-0.5" }),
|
|
11528
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex-1", children: [
|
|
11529
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes critiques" }),
|
|
11530
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
|
|
11531
|
+
stats.alerts.critical_incidents > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-error)]", children: [
|
|
11532
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.critical_incidents }),
|
|
11533
|
+
" incident(s) critique(s)"
|
|
11534
|
+
] }),
|
|
11535
|
+
stats.alerts.overdue_maintenance > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-error)]", children: [
|
|
11536
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.overdue_maintenance }),
|
|
11537
|
+
" maintenance(s) en retard"
|
|
11538
|
+
] }),
|
|
11539
|
+
stats.alerts.expiring_contracts > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
|
|
11540
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.expiring_contracts }),
|
|
11541
|
+
" contrat(s) expirant bientot"
|
|
11542
|
+
] })
|
|
11543
|
+
] })
|
|
11544
|
+
] })
|
|
11545
|
+
] }) }),
|
|
11546
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
|
|
11547
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11548
|
+
StatCard,
|
|
11549
|
+
{
|
|
11550
|
+
title: "Sites actifs",
|
|
11551
|
+
value: stats.sites.active,
|
|
11552
|
+
icon: import_lucide_react24.Building2,
|
|
11553
|
+
color: "primary"
|
|
11554
|
+
}
|
|
11555
|
+
),
|
|
11556
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11557
|
+
StatCard,
|
|
11558
|
+
{
|
|
11559
|
+
title: "Maintenances planifiees",
|
|
11560
|
+
value: stats.maintenance.scheduled,
|
|
11561
|
+
icon: import_lucide_react24.Wrench,
|
|
11562
|
+
color: "info"
|
|
11563
|
+
}
|
|
11564
|
+
),
|
|
11565
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11566
|
+
StatCard,
|
|
11567
|
+
{
|
|
11568
|
+
title: "Incidents ouverts",
|
|
11569
|
+
value: stats.incidents.open,
|
|
11570
|
+
icon: import_lucide_react24.AlertTriangle,
|
|
11571
|
+
color: "warning"
|
|
11572
|
+
}
|
|
11573
|
+
),
|
|
11574
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11575
|
+
StatCard,
|
|
11576
|
+
{
|
|
11577
|
+
title: "Equipements operationnels",
|
|
11578
|
+
value: stats.equipment.total > 0 ? `${Math.round(stats.equipment.operational / stats.equipment.total * 100)}%` : "0%",
|
|
11579
|
+
icon: import_lucide_react24.CheckCircle,
|
|
11580
|
+
color: "success"
|
|
11581
|
+
}
|
|
11582
|
+
)
|
|
11583
|
+
] }),
|
|
11584
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
|
|
11585
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
|
|
11586
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
|
|
11587
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11588
|
+
CardHeader,
|
|
11589
|
+
{
|
|
11590
|
+
title: "Maintenances a venir",
|
|
11591
|
+
icon: import_lucide_react24.Wrench,
|
|
11592
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
|
|
11593
|
+
"Voir tout ",
|
|
11594
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.ArrowRight, { className: "w-4 h-4 ml-1" })
|
|
11595
|
+
] })
|
|
11596
|
+
}
|
|
11597
|
+
),
|
|
11598
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: maintenanceTasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11599
|
+
"div",
|
|
11600
|
+
{
|
|
11601
|
+
className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer",
|
|
11602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11603
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
11604
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getPriorityColor(task.priority)}`, children: getPriorityLabel(task.priority) }),
|
|
11605
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
11606
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: task.title }),
|
|
11607
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2 mt-1", children: [
|
|
11608
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.MapPin, { className: "w-3 h-3 text-[var(--color-text-tertiary)]" }),
|
|
11609
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: task.site })
|
|
11610
|
+
] })
|
|
11611
|
+
] })
|
|
11612
|
+
] }),
|
|
11613
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
|
|
11614
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: `px-2 py-1 text-xs rounded ${getTypeColor(task.type)}`, children: task.type === "preventive" ? "Preventive" : "Corrective" }),
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-right", children: [
|
|
11616
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Echeance" }),
|
|
11617
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: new Date(task.dueDate).toLocaleDateString("fr-FR") })
|
|
11618
|
+
] })
|
|
11619
|
+
] })
|
|
11620
|
+
] })
|
|
11621
|
+
},
|
|
11622
|
+
task.id
|
|
11623
|
+
)) }) })
|
|
11624
|
+
] }),
|
|
11625
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
|
|
11626
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Etat des maintenances", icon: import_lucide_react24.Calendar }),
|
|
11627
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-4 gap-4", children: [
|
|
11628
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg text-center", children: [
|
|
11629
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-info)]", children: stats.maintenance.scheduled }),
|
|
11630
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Planifiees" })
|
|
11631
|
+
] }),
|
|
11632
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
|
|
11633
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.maintenance.in_progress }),
|
|
11634
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "En cours" })
|
|
11635
|
+
] }),
|
|
11636
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
|
|
11637
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.maintenance.completed }),
|
|
11638
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Terminees" })
|
|
11639
|
+
] }),
|
|
11640
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg text-center", children: [
|
|
11641
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-error)]", children: stats.maintenance.overdue }),
|
|
11642
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "En retard" })
|
|
11643
|
+
] })
|
|
11644
|
+
] }) })
|
|
11645
|
+
] })
|
|
11646
|
+
] }),
|
|
11647
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-6", children: [
|
|
11648
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
|
|
11649
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Incidents", icon: import_lucide_react24.AlertTriangle }),
|
|
11650
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-3", children: [
|
|
11651
|
+
stats.incidents.critical > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-error-light)] rounded-lg", children: [
|
|
11652
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11653
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-error)] rounded-full animate-pulse" }),
|
|
11654
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm font-medium text-[var(--color-error)]", children: "Critiques" })
|
|
11655
|
+
] }),
|
|
11656
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-bold text-[var(--color-error)]", children: stats.incidents.critical })
|
|
11657
|
+
] }),
|
|
11658
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-warning-light)] rounded-lg", children: [
|
|
11659
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11660
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-warning)] rounded-full" }),
|
|
11661
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Ouverts" })
|
|
11662
|
+
] }),
|
|
11663
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.open })
|
|
11664
|
+
] }),
|
|
11665
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
11666
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11667
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
|
|
11668
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En cours" })
|
|
11669
|
+
] }),
|
|
11670
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.in_progress })
|
|
11671
|
+
] }),
|
|
11672
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
11673
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
11674
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
|
|
11675
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Resolus" })
|
|
11676
|
+
] }),
|
|
11677
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.resolved })
|
|
11678
|
+
] })
|
|
11679
|
+
] }) })
|
|
11680
|
+
] }),
|
|
11681
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
|
|
11682
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Equipements", icon: import_lucide_react24.Shield }),
|
|
11683
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-center py-4", children: [
|
|
11684
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-4xl font-bold text-[var(--color-text-primary)]", children: stats.equipment.total }),
|
|
11685
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "equipements references" }),
|
|
11686
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-4 grid grid-cols-3 gap-2", children: [
|
|
11687
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-success-light)] rounded", children: [
|
|
11688
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-success)]", children: stats.equipment.operational }),
|
|
11689
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "OK" })
|
|
11690
|
+
] }),
|
|
11691
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-warning-light)] rounded", children: [
|
|
11692
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-warning)]", children: stats.equipment.under_maintenance }),
|
|
11693
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Maint." })
|
|
11694
|
+
] }),
|
|
11695
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-error-light)] rounded", children: [
|
|
11696
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-error)]", children: stats.equipment.out_of_service }),
|
|
11697
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "HS" })
|
|
11698
|
+
] })
|
|
11699
|
+
] })
|
|
11700
|
+
] }) })
|
|
11701
|
+
] })
|
|
11702
|
+
] })
|
|
11703
|
+
] })
|
|
11704
|
+
] });
|
|
11705
|
+
};
|
|
11706
|
+
var FacilityWorkspace_default = FacilityWorkspace;
|
|
11707
|
+
|
|
11708
|
+
// src/pages/workspaces/WorkSpace.tsx
|
|
11709
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11710
|
+
var MODULES_CONFIG = [
|
|
11711
|
+
{
|
|
11712
|
+
id: "purchase",
|
|
11713
|
+
label: "Achats",
|
|
11714
|
+
description: "Gestion des achats et approvisionnements",
|
|
11715
|
+
icon: import_lucide_react25.ShoppingCart,
|
|
11716
|
+
color: "text-blue-600",
|
|
11717
|
+
bgColor: "bg-blue-50",
|
|
11718
|
+
component: PurchaseWorkspace_default
|
|
11719
|
+
},
|
|
11720
|
+
{
|
|
11721
|
+
id: "accounting",
|
|
11722
|
+
label: "Comptabilite",
|
|
11723
|
+
description: "Gestion comptable et financiere",
|
|
11724
|
+
icon: import_lucide_react25.Calculator,
|
|
11725
|
+
color: "text-green-600",
|
|
11726
|
+
bgColor: "bg-green-50",
|
|
11727
|
+
component: AccountingWorkspace_default
|
|
11728
|
+
},
|
|
11729
|
+
{
|
|
11730
|
+
id: "crm",
|
|
11731
|
+
label: "CRM",
|
|
11732
|
+
description: "Gestion de la relation client",
|
|
11733
|
+
icon: import_lucide_react25.Users,
|
|
11734
|
+
color: "text-purple-600",
|
|
11735
|
+
bgColor: "bg-purple-50",
|
|
11736
|
+
component: CrmWorkspace_default
|
|
11737
|
+
},
|
|
11738
|
+
{
|
|
11739
|
+
id: "facility",
|
|
11740
|
+
label: "Facility",
|
|
11741
|
+
description: "Gestion des installations et maintenances",
|
|
11742
|
+
icon: import_lucide_react25.Building2,
|
|
11743
|
+
color: "text-orange-600",
|
|
11744
|
+
bgColor: "bg-orange-50",
|
|
11745
|
+
component: FacilityWorkspace_default
|
|
11746
|
+
}
|
|
11747
|
+
];
|
|
11748
|
+
var WorkSpace = () => {
|
|
11749
|
+
const [activeModule, setActiveModule] = (0, import_react29.useState)(null);
|
|
11750
|
+
const [availableModules, setAvailableModules] = (0, import_react29.useState)([]);
|
|
11751
|
+
const [loading, setLoading] = (0, import_react29.useState)(true);
|
|
11752
|
+
const [showModuleSelector, setShowModuleSelector] = (0, import_react29.useState)(false);
|
|
11753
|
+
(0, import_react29.useEffect)(() => {
|
|
11754
|
+
loadAvailableModules();
|
|
11755
|
+
}, []);
|
|
11756
|
+
const loadAvailableModules = async () => {
|
|
11757
|
+
setLoading(true);
|
|
11758
|
+
try {
|
|
11759
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
11760
|
+
const userModules = ["purchase", "accounting", "crm", "facility"];
|
|
11761
|
+
setAvailableModules(userModules);
|
|
11762
|
+
if (userModules.length > 0 && !activeModule) {
|
|
11763
|
+
setActiveModule(userModules[0]);
|
|
11764
|
+
}
|
|
11765
|
+
} catch (error) {
|
|
11766
|
+
console.error("Erreur lors du chargement des modules:", error);
|
|
11767
|
+
setAvailableModules(["purchase"]);
|
|
11768
|
+
setActiveModule("purchase");
|
|
11769
|
+
} finally {
|
|
11770
|
+
setLoading(false);
|
|
11771
|
+
}
|
|
11772
|
+
};
|
|
11773
|
+
const filteredModules = (0, import_react29.useMemo)(() => {
|
|
11774
|
+
return MODULES_CONFIG.filter((m) => availableModules.includes(m.id));
|
|
11775
|
+
}, [availableModules]);
|
|
11776
|
+
const currentModule = (0, import_react29.useMemo)(() => {
|
|
11777
|
+
return MODULES_CONFIG.find((m) => m.id === activeModule);
|
|
11778
|
+
}, [activeModule]);
|
|
11779
|
+
const ActiveWorkspaceComponent = currentModule?.component;
|
|
11780
|
+
if (loading) {
|
|
11781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center h-screen bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-center", children: [
|
|
11782
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
|
|
11783
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement des workspaces..." })
|
|
11784
|
+
] }) });
|
|
11785
|
+
}
|
|
11786
|
+
if (filteredModules.length === 0) {
|
|
11787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center h-screen bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-center", children: [
|
|
11788
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.LayoutDashboard, { className: "w-16 h-16 text-[var(--color-text-tertiary)] mx-auto mb-4" }),
|
|
11789
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h2", { className: "text-xl font-semibold text-[var(--color-text-primary)] mb-2", children: "Aucun workspace disponible" }),
|
|
11790
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Contactez votre administrateur pour obtenir l'acces aux modules." })
|
|
11791
|
+
] }) });
|
|
11792
|
+
}
|
|
11793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "min-h-screen bg-[var(--color-background)]", children: [
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "sticky top-0 z-40 bg-[var(--color-surface)] border-b border-[var(--color-border-light)] shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11795
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center space-x-4", children: [
|
|
11796
|
+
currentModule && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `p-2 rounded-lg ${currentModule.bgColor}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(currentModule.icon, { className: `w-6 h-6 ${currentModule.color}` }) }),
|
|
11797
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
|
|
11798
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
11799
|
+
"button",
|
|
11800
|
+
{
|
|
11801
|
+
onClick: () => setShowModuleSelector(!showModuleSelector),
|
|
11802
|
+
className: "flex items-center space-x-2 hover:bg-[var(--color-surface-hover)] px-3 py-2 rounded-lg transition-colors",
|
|
11803
|
+
children: [
|
|
11804
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { children: [
|
|
11805
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("h1", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: [
|
|
11806
|
+
"Workspace - ",
|
|
11807
|
+
currentModule?.label
|
|
11808
|
+
] }),
|
|
11809
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: currentModule?.description })
|
|
11810
|
+
] }),
|
|
11811
|
+
filteredModules.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.ChevronDown, { className: `w-5 h-5 text-[var(--color-text-tertiary)] transition-transform ${showModuleSelector ? "rotate-180" : ""}` })
|
|
11812
|
+
]
|
|
11813
|
+
}
|
|
11814
|
+
),
|
|
11815
|
+
showModuleSelector && filteredModules.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
11816
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11817
|
+
"div",
|
|
11818
|
+
{
|
|
11819
|
+
className: "fixed inset-0 z-10",
|
|
11820
|
+
onClick: () => setShowModuleSelector(false)
|
|
11821
|
+
}
|
|
11822
|
+
),
|
|
11823
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute top-full left-0 mt-2 w-72 bg-[var(--color-surface)] rounded-xl shadow-xl border border-[var(--color-border-light)] z-20 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "p-2", children: [
|
|
11824
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-xs font-semibold text-[var(--color-text-tertiary)] uppercase tracking-wide px-3 py-2", children: "Changer de workspace" }),
|
|
11825
|
+
filteredModules.map((module2) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
11826
|
+
"button",
|
|
11827
|
+
{
|
|
11828
|
+
onClick: () => {
|
|
11829
|
+
setActiveModule(module2.id);
|
|
11830
|
+
setShowModuleSelector(false);
|
|
11831
|
+
},
|
|
11832
|
+
className: `
|
|
11833
|
+
w-full flex items-center space-x-3 px-3 py-3 rounded-lg transition-colors
|
|
11834
|
+
${activeModule === module2.id ? "bg-[var(--color-primary-light)]" : "hover:bg-[var(--color-surface-hover)]"}
|
|
11835
|
+
`,
|
|
11836
|
+
children: [
|
|
11837
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `p-2 rounded-lg ${module2.bgColor}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(module2.icon, { className: `w-5 h-5 ${module2.color}` }) }),
|
|
11838
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-left", children: [
|
|
11839
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: `font-medium ${activeModule === module2.id ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"}`, children: module2.label }),
|
|
11840
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: module2.description })
|
|
11841
|
+
] })
|
|
11842
|
+
]
|
|
11843
|
+
},
|
|
11844
|
+
module2.id
|
|
11845
|
+
))
|
|
11846
|
+
] }) })
|
|
11847
|
+
] })
|
|
11848
|
+
] })
|
|
11849
|
+
] }),
|
|
11850
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11851
|
+
"button",
|
|
11852
|
+
{
|
|
11853
|
+
onClick: loadAvailableModules,
|
|
11854
|
+
className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
11855
|
+
title: "Actualiser",
|
|
11856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.RefreshCw, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
11857
|
+
}
|
|
11858
|
+
)
|
|
11859
|
+
] }) }) }),
|
|
11860
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "p-6", children: ActiveWorkspaceComponent && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ActiveWorkspaceComponent, {}) })
|
|
11861
|
+
] });
|
|
11862
|
+
};
|
|
11863
|
+
var WorkSpace_default = WorkSpace;
|
|
10323
11864
|
// Annotate the CommonJS export names for ESM import in node:
|
|
10324
11865
|
0 && (module.exports = {
|
|
10325
11866
|
ACCOUNT_TYPE_LABELS,
|
|
10326
11867
|
AccountServices,
|
|
11868
|
+
AccountingWorkspace,
|
|
10327
11869
|
Alert,
|
|
10328
11870
|
AlertProvider,
|
|
10329
11871
|
ApprovalAnswerModal,
|
|
@@ -10334,8 +11876,11 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10334
11876
|
AuthServices,
|
|
10335
11877
|
BALANCE_TYPE_LABELS,
|
|
10336
11878
|
CHOICES,
|
|
11879
|
+
CardBody,
|
|
11880
|
+
CardHeader,
|
|
10337
11881
|
ClientServices,
|
|
10338
11882
|
CountrySelector,
|
|
11883
|
+
CrmWorkspace,
|
|
10339
11884
|
DataTable,
|
|
10340
11885
|
DateInput,
|
|
10341
11886
|
DocumentFooter,
|
|
@@ -10343,6 +11888,7 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10343
11888
|
EntityFileManager,
|
|
10344
11889
|
FDrawer,
|
|
10345
11890
|
FROM_MODULE_CHOICES,
|
|
11891
|
+
FacilityWorkspace,
|
|
10346
11892
|
FetchApi,
|
|
10347
11893
|
FileInput,
|
|
10348
11894
|
FileManager,
|
|
@@ -10356,6 +11902,7 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10356
11902
|
LegalFormSelector,
|
|
10357
11903
|
MinimalVendorForm,
|
|
10358
11904
|
Modal,
|
|
11905
|
+
ModernCard,
|
|
10359
11906
|
NumberInput,
|
|
10360
11907
|
PRINT_GREEN,
|
|
10361
11908
|
Pages,
|
|
@@ -10363,6 +11910,7 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10363
11910
|
PrimaryButton,
|
|
10364
11911
|
PrintPreview,
|
|
10365
11912
|
PrintableDocument,
|
|
11913
|
+
PurchaseWorkspace,
|
|
10366
11914
|
RewiseLayout,
|
|
10367
11915
|
SYSCOHADA_CLASSES,
|
|
10368
11916
|
SecondaryButton,
|
|
@@ -10376,6 +11924,7 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10376
11924
|
SelectVendor,
|
|
10377
11925
|
SessionProvider,
|
|
10378
11926
|
SignatureSection,
|
|
11927
|
+
StatCard,
|
|
10379
11928
|
TEMPLATE_FNE_CHOICES,
|
|
10380
11929
|
TaxSelector,
|
|
10381
11930
|
TemplateFNESelector,
|
|
@@ -10387,6 +11936,8 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
|
|
|
10387
11936
|
UnitServices,
|
|
10388
11937
|
UserServices,
|
|
10389
11938
|
VendorServices,
|
|
11939
|
+
WorkSpace,
|
|
11940
|
+
WorkspaceServices,
|
|
10390
11941
|
fileManagerApi,
|
|
10391
11942
|
formatCurrency,
|
|
10392
11943
|
formatDate,
|