import React, { useRef, useState, useEffect } from "react";
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
import Button from '@mui/material/Button';
import axios from "axios";
import { useParams } from 'react-router-dom';
import { getCookie, setCookie } from 'react-use-cookie';
import { useHistory } from "react-router-dom";
import CheckOut from "./CheckOut";
import {
DataGrid, frFR, GridToolbar,
} from '@mui/x-data-grid';
import * as XLSX from 'xlsx';
import { Fab } from "@material-ui/core";
import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import { Editor } from '@tinymce/tinymce-react';
import parse from 'html-react-parser';
import { FcViewDetails, FcDisapprove, FcInfo } from "react-icons/fc";
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
import add_plus from "../mysy_img/plus.png";
import excel_icone from "../mysy_img/excel_icone.png";
import participants from "../mysy_img/participants.png";
import fileDownload from 'js-file-download'
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import { format } from 'date-fns'
import moment from "moment";
import InputAdornment from '@mui/material/InputAdornment';
import { AiFillCloseCircle } from "react-icons/ai";
import Box from '@mui/material/Box';
import { Typography, LinearProgress, sliderClasses } from '@mui/material';
import styled from 'styled-components';
import { CiTrash } from "react-icons/ci";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
import Autocomplete from '@mui/material/Autocomplete';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { gridClasses } from '@mui/x-data-grid';
import {
GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton,
GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext,
gridFilteredSortedRowIdsSelector,
gridVisibleColumnFieldsSelector,
GridValueGetterParams,
GridPreferencePanelsValue,
} from '@mui/x-data-grid';
import AttachFileIcon from '@mui/icons-material/AttachFile';
//import { utils, writeFileXLSX } from "xlsx";
import { IconButton } from '@material-ui/core';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import Menu from '@mui/material/Menu';
const Modules_Mes_Documents = (props) => {
const { action, orderid } = useParams();
const history = useHistory();
const [submenu, setsubmenu] = useState("");
const [rowss, setRows] = useState([]);
const [rowss_total_data, setRows_total_data] = useState([]);
const [selectionModel, setSelectionModel] = React.useState([]);
const [myprops_type_document, setmyprops_type_document] = React.useState("");
const [rows_invoice_lines, setrows_invoice_lines] = useState([]);
const [selectionModel_invoice_lines, setselectionModel_invoice_lines] = React.useState([]);
const [gridline_id, setgridline_id] = useState("");
var date_today_90j = new Date();
date_today_90j.setDate(date_today_90j.getDate() + 90);
const [p_filtre1, setp_filtre1] = useState("");
const [p_filtre1_value, setp_filtre1_value] = useState();
const [p_filtre2, setp_filtre2] = useState("");
const [p_filtre2_value, setp_filtre2_value] = useState();
const [p_filtre3, setp_filtre3] = useState("");
const [p_filtre3_value, setp_filtre3_value] = useState();
const [p_filtre4, setp_filtre4] = useState("");
const [p_filtre4_value, setp_filtre4_value] = useState();
function ExpandableCell_50({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
);
}
const options_menu_vertical = [
'',
'Télécharger',
];
const ITEM_HEIGHT = 48;
const [anchorEl, setAnchorEl] = React.useState(null);
const open = Boolean(anchorEl);
const handleClick_option_button_vertical = (event) => {
setAnchorEl(event.currentTarget);
};
const handleClose_option_button_vertical = (event, value) => {
setAnchorEl(null);
};
const columns = [
{ field: '_id', headerName: '_id', hide: true, editable: false },
{ field: 'id', headerName: 'id', hide: true, editable: false },
{ field: 'file_extention', hide: true, editable: false },
{ field: 'file_name', headerName: 'file_name', hide: true, disableExport: true },
{
field: 'created_date', headerName: 'Date Creation', Width: 100, flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
{String(cellValues.row.created_date).substring(0, 10)}
)
},
},
{ field: 'file_business_object', headerName: 'file_business_object', minWidth: 200, flex: 1, hide: false, editable: false, },
{ field: 'object_owner_collection', headerName: 'object_owner_collection', minWidth: 200, flex: 1, hide: false, editable: false },
{ field: 'client_raison_sociale', headerName: 'client_raison_sociale', minWidth: 200, flex: 1, hide: false, editable: false },
{ field: 'client_nom', headerName: 'client_nom', minWidth: 150, flex: 1, hide: false, editable: false },
{
field: 'type_document', headerName: 'type_document', minWidth: 100, flex: 1, hide: false, editable: false,
renderCell: (cellValues) => {
return (
{String(cellValues.row.type_document).charAt(0).toUpperCase() + String(cellValues.row.type_document).slice(1)}
)
},
},
{
field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center",
renderCell: (cellValues,) => {
return (
{
handleClick_option_button_vertical(e);
setprint_doc_id(cellValues.row._id);
setprint_file_extention(cellValues.row.file_extention);
setprint_file_business_object(cellValues.row.file_business_object);
}}
>
);
},
},
]
const [print_doc_id, setprint_doc_id] = useState("");
const [print_file_extention, setprint_file_extention] = useState("");
const [print_file_business_object, setprint_file_business_object] = useState("");
function print_document_pdf(doc_id, file_extention, file_business_object) {
const stored_cookie = getCookie('tokenmysych');
var nom_fichier_cmd = String(file_business_object) + "." + String(file_extention);
console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- doc_id = ", doc_id);
var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File_From_Id/" + stored_cookie + "/" + doc_id;
//console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
fileDownload(res.data, nom_fichier_cmd)
}).catch((error) => {
console.error('Error:', error);
});
}
const [isLoading, setLoading] = useState();
const [p_detail_header_client_nom_id, setp_detail_header_client_nom_id] = useState();
const myRef = useRef(null);
const [history_securite_read, sethistory_securite_read] = useState("");
const autorized_type_document = ['devis', 'convention', 'convocation', 'attestation'];
useEffect(() => {
console.log(" ### props.type_document = ", props.type_document)
if (props.type_document && autorized_type_document.includes(String(props.type_document))) {
console.log(" ### iciiii ")
setmyprops_type_document(props.type_document);
setp_filtre1("filter_type_document");
setp_filtre1_value(props.type_document);
Get_All_Documents_With_Filter();
} else {
Get_List_Of_All_PJ();
}
}, [])
const [display_detail_invoice, setdisplay_detail_invoice] = React.useState();
const myRef_head = useRef(null);
const [selected_id, setselected_id] = useState("");
const [selected_order_line_id, setselected_order_line_id] = useState("");
const [selected_order_header_type, setselected_order_header_type] = useState();
const [order_internal_ref, setorder_internal_ref] = useState("");
const [invoice_internal_ref, setinvoice_internal_ref] = useState("");
function submenu_color_management(current_menu) {
const list_sous_menu = ["order_header_facturation", "order_header_detail", "order_header_main", "order_header_detail", "paiement"]
for (let i = 0; i < list_sous_menu.length; i++) {
var sous_menu = list_sous_menu[i];
if (String(sous_menu) !== current_menu) {
if (document.getElementById(sous_menu)) {
document.getElementById(sous_menu).style.backgroundColor = "#d8edfc";
document.getElementById(sous_menu).style.color = "black";
document.getElementById(sous_menu).style.fontWeight = "normal";
}
}
}
if (document.getElementById(current_menu)) {
document.getElementById(current_menu).style.backgroundColor = "#104277";
document.getElementById(current_menu).style.color = "white";
document.getElementById(current_menu).style.fontWeight = "bold";
}
}
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
function print_invoice_pdf() {
const stored_cookie = getCookie('tokenmysych');
var nom_fichier_cmd = "Facture_" + invoice_internal_ref + ".pdf";
// console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id);
var url = process.env.REACT_APP_API_URL + "myclass/api/GerneratePDF_Partner_Invoice/" + stored_cookie + "/" + selected_id;
//console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
fileDownload(res.data, nom_fichier_cmd)
}).catch((error) => {
console.error('Error:', error);
});
}
function clean_all_filters() {
setp_filtre1("");
setp_filtre1_value();
setp_filtre2("");
setp_filtre2_value();
setp_filtre3("");
setp_filtre3_value();
setp_filtre4("");
setp_filtre4_value();
clean_order_detail_fields();
setsubmenu();
setSelectionModel([]);
setgridline_id("");
Get_List_Of_All_PJ();
}
function clean_order_detail_fields() {
}
const [Dialog_Detail_Article_open, setDialog_Detail_Article_open] = React.useState(false);
const Close_Dialog_Detail_Article_open = () => {
setDialog_Detail_Article_open(false);
};
const Dialog_1_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_1_handleClose_buton = () => {
setDialog_1_open(false);
};
const [Dialog_1_open, setDialog_1_open] = React.useState(false);
const [Dialog_annotation_1_message, setDialog_annotation_1_message] = React.useState(false);
const [Dialog_annotation_1_open, setDialog_annotation_1_open] = React.useState(false);
function Dialog_1_handle_change_annotation(message) {
setDialog_annotation_1_message(message);
setDialog_annotation_1_open(true);
}
const Dialog_annotation_1_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_annotation_1_handleClose_buton = () => {
setDialog_annotation_1_open(false);
/* if (document.getElementById('myRef')) {
var divh = document.getElementById('myRef').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}*/
};
const New_Option_Filter = [
{ "id": "filter_file_business_object", "label": "Nom Document", "value": "filter_file_business_object" },
{ "id": "filter_type_document", "label": "Type Document", "value": "filter_type_document" },
{ "id": "filter_nom_client", "label": "Nom Client", "value": "filter_nom_client" },
{ "id": "date_create_start_date", "label": "Crée après (jj/mm/aaaa) ", "value": "date_create_start_date" },
{ "id": "date_create_end_date", "label": "Crée avant (jj/mm/aaaa)", "value": "date_create_end_date" },
{ "id": "filter_formation_external_code", "label": "Lié a la Formation (code externe)", "value": "filter_formation_external_code" },
{ "id": "filter_session_code", "label": "Lié a la session (code session)", "value": "filter_session_code" },
{ "id": "", "label": "", "value": "" },
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
const Option_Type_Document = [
{ "id": "devis", "label": "Devis", "value": "devis" },
{ "id": "convention", "label": "Convention", "value": "convention" },
{ "id": "convocation", "label": "Convocation", "value": "convocation" },
{ "id": "attestation", "label": "Attestation", "value": "attestation" },
{ "id": "autre", "label": "Autre", "value": "autre" },
{ "id": "", "label": "", "value": "" },
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
function handleClick_menu_droite_facture(e) {
console.log(" III ");
}
const New_type_apprenant = [
{ "id": "0", "label": "Autre", "value": "0" },
{ "id": "1", "label": "Salariés", "value": "1" },
{ "id": "2", "label": "Apprentis", "value": "2" },
{ "id": "3", "label": "Particuliers", "value": "3" },
{ "id": "4", "label": "Rech. Emploi", "value": "4" },
{ "id": "", "label": "", "value": "" },
]
// DEBUT EXPORT EXCEL DATAGRID
function CustomToolbar(props) {
return (
);
}
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
});
return row;
});
return data;
}
function ExportButton(props) {
return (
);
}
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
const local_config = {
keys: visibleColumnsField,
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
}
}
}),
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
local_config.columnNames = local_config.columnNames.filter(function (element) {
return element !== undefined;
});
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
);
}
// FIN EXPORT EXCEL DATAGRID
const [Dialog_send_invoice_with_PJ_message, setDialog_send_invoice_with_PJ_message] = React.useState(false);
const [Dialog_send_invoice_with_PJ_open, setDialog_send_invoice_with_PJ_open] = React.useState(false);
function Dialog_send_invoice_with_PJ_handle_change_participant_session(message) {
setDialog_send_invoice_with_PJ_message(message);
setDialog_send_invoice_with_PJ_open(true);
}
const [tab_invoice_mail_pieces_jointes_result, settab_invoice_mail_pieces_jointes_result] = useState([]);
const [Dialog_invoice_history_message, setDialog_invoice_history_message] = React.useState(false);
const [Dialog_invoice_history_open, setDialog_invoice_history_open] = React.useState(false);
function Dialog_invoice_history_handle_change_participant_session(message) {
setDialog_invoice_history_message(message);
setDialog_invoice_history_open(true);
}
const Dialog_invoice_history_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_invoice_history_handleClose_buton = () => {
setDialog_invoice_history_open(false);
settab_invoice_mail_pieces_jointes_result([]);
if (document.getElementsByName("invoice_history_bton") && document.getElementsByName("invoice_history_bton")[0]) {
document.getElementsByName("invoice_history_bton")[0].style.backgroundColor = "#d8edfc";
document.getElementsByName("invoice_history_bton")[0].style.color = "#3b3e40";
}
};
const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState();
const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState();
const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState();
function Get_List_Of_All_PJ() {
const formData = new FormData();
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
const stored_cookie = getCookie('tokenmysych');
formData.append("token", stored_cookie);
formData.append("object_owner_id", props.partner_client_id);
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
setLoading(true);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
{
method: 'POST',
body: formData,
}
)
.then((response) => response.json())
.then((result) => {
setLoading(false);
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
// console.log('Message :', result['message']);
setGet_List_Of_All_PJ_result(result['message']);
setGet_List_Of_All_PJ_api("true");
setRows(result['message']);
}
else {
setGet_List_Of_All_PJ_message(result['message']);
setGet_List_Of_All_PJ_api("false");
}
})
.catch((error) => {
setLoading(false);
console.error(' Get_List_Of_All_PJ Error:', error);
setGet_List_Of_All_PJ_api("false");
});
}
// -- Gestion pièces jointes
const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
const Download_one_attached_document = (event) => {
const stored_cookie = getCookie('tokenmysych');
var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
var token = stored_cookie;
var file_name = event.target.id;
var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
fileDownload(res.data, nom_fiche_detaillee);
setDownload_one_attached_document_api("true");
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
setDownload_one_attached_document_api("false");
});
}
const [Get_All_Documents_With_Filter_api, setGet_All_Documents_With_Filter_api] = useState();
const [Get_All_Documents_With_Filter_message, setGet_All_Documents_With_Filter_message] = useState();
const [Get_All_Documents_With_Filter_result, setGet_All_Documents_With_Filter_result] = useState();
function Get_All_Documents_With_Filter() {
setgridline_id("");
var form = new FormData();
const stored_cookie = getCookie('tokenmysych');
form.append("token", stored_cookie);
// Recuperation des parametres
var filtre1 = p_filtre1;
var filtre2 = p_filtre2;
var filtre3 = p_filtre3;
var filtre1_value = "";
var filtre2_value = "";
var filtre3_value = "";
// Recuperation des valeurs de filtres
if (p_filtre1_value) {
filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value);
}
if (p_filtre2_value) {
filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value);
}
if (p_filtre3_value) {
filtre3_value = p_filtre3_value;
form.append(filtre3, filtre3_value);
}
/*** Si le formulaire est appelé avec un type de document;
* on va forcer dans les argument un champ avec filter_type_document
*/
if (props.type_document && autorized_type_document.includes(String(props.type_document))) {
form.delete("filter_type_document");
form.append("filter_type_document", props.type_document);
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Get_All_Documents_With_Filter res.data.status = " + res.data.status);
// console.log(" In Get_All_Documents_With_Filter res.data.message r_class = " + res.data.message);
setGet_All_Documents_With_Filter_api("true");
setGet_All_Documents_With_Filter_result(res.data.message);
setRows(res.data.message);
//setRows_total_data(JSON.parse(res.data.total_data));
}
else {
setGet_All_Documents_With_Filter_api("false");
setGet_All_Documents_With_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Get_All_Documents_With_Filter = ', error);
setGet_All_Documents_With_Filter_api("false");
alert(" Impossible de recuperer la liste des factures");
//setm yApimyApiMessage("")
})
}
/***
* IMPORTANT
* Ce module permet d'afficher et telecharger tous les documents qui sont dans la collection 'download_files', c'est à dire :
* 1 - Les documents importés manuellement sur l'espace du client
* 2 - Les devis signés electroniquement (en effet ils sont automatiquement importés dans l'espace du client)
* 3 - Les Convention signés electroniquement (en effet ils sont automatiquement importés dans l'espace du client)
* 4 - A ajouter : les convocations adressées à ses apprenants
* 5 - A ajouter : les attestations adressées à ses apprenants
*
* /!\ /!\ /!\ /!\ /!\ /!\ /!\ Les factures sont bien dans la collection, mais pour recuperer il faut passer par la collection 'partner_invoice_header'
* /!\ /!\ /!\ /!\ /!\ /!\ /!\ raison pour laquel, on va mettre les documents d'un coté et les facture de l'autre.
*/
return (
{isLoading &&
}
{props.my_title &&
{props.my_title}
}
{!props.my_title &&
Tous vos documents
}
Utilisez les filtres !
{New_Option_Filter && New_Option_Filter.length > 0 &&
(data).value === String(p_filtre1))[0].label}
options={New_Option_Filter}
onChange={(event, value) => {
if (value && value.value) {
setp_filtre1(value.value);
} else {
setp_filtre1("");
}
}}
renderInput={(params) =>
}
/>}
{p_filtre1 && String(p_filtre1) !== "filter_type_document" &&
{ setp_filtre1_value(e.target.value); }}
InputProps={{
endAdornment: (
{
setp_filtre1_value("");
}} />
),
}}
/>
}
{p_filtre1 && String(p_filtre1) === "filter_type_document" &&
{
if (value && value.value) {
setp_filtre1_value(value.value);
} else {
setp_filtre1_value("");
}
}}
renderInput={(params) =>
}
/>
}
{p_filtre1 &&
}
{p_filtre1 &&
}
{p_filtre2 &&
{New_Option_Filter && New_Option_Filter.length > 0 &&
(data).value === String(p_filtre2))[0].label}
options={New_Option_Filter}
onChange={(event, value) => {
if (value && value.value) {
setp_filtre2(value.value);
}
}}
renderInput={(params) =>
}
/>}
{String(p_filtre2).length > 2 && String(p_filtre2) !== "filter_type_document" &&
setp_filtre2_value(e.target.value)}
InputProps={{
endAdornment: (
{
setp_filtre2_value("");
}} />
),
}}
/>}
{String(p_filtre2).length > 2 && String(p_filtre2) === "filter_type_document" &&
{
if (value && value.value) {
setp_filtre2_value(value.value);
} else {
setp_filtre2_value("");
}
}}
renderInput={(params) =>
}
/>}
{String(p_filtre2).length > 2 &&
}
{String(p_filtre2).length > 2 &&
}
}
{p_filtre3 &&
{New_Option_Filter && New_Option_Filter.length > 0 &&
(data).value === String(p_filtre3))[0].label}
options={New_Option_Filter}
onChange={(event, value) => {
if (value && value.value) {
setp_filtre3(value.value);
}
}}
renderInput={(params) =>
}
/>}
{String(p_filtre3).length > 2 && String(p_filtre3) !== "filter_type_document" &&
setp_filtre3_value(e.target.value)}
InputProps={{
endAdornment: (
{
setp_filtre3_value("");
}} />
),
}}
/>}
{String(p_filtre3).length > 2 && String(p_filtre3) === "filter_type_document" &&
{
if (value && value.value) {
setp_filtre3_value(value.value);
} else {
setp_filtre3_value("");
}
}}
renderInput={(params) =>
}
/>}
{String(p_filtre2).length > 2 &&
}
{String(p_filtre3).length > 2 &&
}
}
{
setSelectionModel(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_invoice_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
//clean_order_detail_fields();
//setsubmenu();
setdisplay_detail_invoice();
}
}}
onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id);
// setp_detail_header_client_nom_id(newSelectionModel.row.order_header_client_id);
// handleClick_edit_invoice_From_Line(newSelectionModel.row.id);
}
}
selectionModel={selectionModel}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={rowss.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
file_name: JSON.parse(item).file_name,
file_business_object: JSON.parse(item).file_business_object,
object_owner_collection: JSON.parse(item).object_owner_collection,
type_document: JSON.parse(item).type_document,
file_extention: JSON.parse(item).file_extention,
client_raison_sociale: JSON.parse(item).client_raison_sociale,
client_nom: JSON.parse(item).client_nom,
created_date: JSON.parse(item).created_date,
}
))}
columns={columns}
pageSize={10}
className="datagridclass"
rowsPerPageOptions={[10]}
//disableSelectionOnClick
/* components={{
Toolbar: GridToolbar,
}}*/
//sx={datagridSx}
getCellClassName={(params) => {
}}
getRowClassName={(params) => {
// Pour la gestion de la couleur de zone double cliquée
if (String(params.row.id) === String(gridline_id)) {
return 'line--statut--selected';
}
else if (parseInt(String(params.row.id)) % 2 === 0) {
return 'line--statut--pair';
}
else if (parseInt(String(params.row.id)) % 2 !== 0) {
return 'line--statut--impair';
}
}}
/>
{/*
{Get_List_Of_All_PJ_result &&
Liste des pièces jointes
{Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
{(JSON.parse(val).file_business_object)}
Télécharger
Supprimer
}
modal
nested
position="center center"
>
{close => (
MySy Information
{' '}
En confirmant cette opération, la pièce jointe sera définitivement supprimée.
)}
))}
}
*/}
)
}
export default Modules_Mes_Documents;