diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index 746e179..b55a46c 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -271,9 +271,11 @@ const AddParnerClient = (props) => { ); } function ExpandableCell_String_to_monetaire({ value }) { + var new_val = String(value).replaceAll(" ", ''); const [expanded, setExpanded] = React.useState(false); - const number = parseFloat(value); + const number = parseFloat(new_val); + var new_value = "" if (isNaN(number)) { new_value = "—" @@ -328,73 +330,6 @@ const AddParnerClient = (props) => { { field: 'commentaire', headerName: 'commentaire', flex: 1, editable: false, hide: false, renderCell: (params) => , }, - - - { - field: "delete", headerName: 'Supprimer', disableExport: true, - renderCell: (cellValues) => { - return ( -
- {String(props.check_user_acces_right("facture", "write")) === "1" && - cellValues.row.invoice_header_type !== "brouillon" && } - {String(props.check_user_acces_right("facture", "write")) === "1" && - cellValues.row.invoice_header_type === "brouillon" && { - // handleClick_delete(event, cellValues); - }} - > - - - } - modal - nested - position="center center" - > - {close => ( -
- -
MySy Information
-
- {' '} - - En confirmant cette opération, le document sera définitivement supprimé.
- -
-
-
- - -
-
- -
-
-
- )} -
} -
- - ); - } - } - - ] function sleep(ms) { @@ -5345,6 +5280,9 @@ const AddParnerClient = (props) => { {} + + + - - + @@ -6854,182 +6791,6 @@ const AddParnerClient = (props) => { } - - {String(submenu).trim() === "submenu_paiement" &&
- Total Paiement - {local_format_monetaire(New_Get_All_Paiement_Total_Payed)} * Paiement en attente --- * paiement en retard
-
- -
- - {/*rowss_total_data && rowss_total_data.length > 0 && rowss_total_data.map((val) => ())*/} - -
-
-   - - { - setselectionModel_paiement(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) => { - - } - } - selectionModel={selectionModel_paiement} - - localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={Get_All_Paiement_of_Client_result.map((item, index) => ( - { - id: index, - _id: JSON.parse(item)._id, - invoice_id: JSON.parse(item).invoice_id, - - paiement_amount: JSON.parse(item).paiement_amount, - paiement_mode: JSON.parse(item).paiement_mode, - paiement_ref: JSON.parse(item).paiement_ref, - paiement_date: JSON.parse(item).paiement_date, - commentaire: JSON.parse(item).commentaire, - client_id: JSON.parse(item).client_id, - invoice_ref: JSON.parse(item).invoice_ref, - - } - ))} - - columns={columns_paiement} - pageSize={10} - className="datagridclass" - - rowsPerPageOptions={[10]} - //disableSelectionOnClick - /* components={{ - Toolbar: GridToolbar, - }}*/ - - - //sx={datagridSx} - getCellClassName={(params) => { - - }} - getRowClassName={(params) => { - - if (parseInt(parseFloat(params.row.reste_to_paye)) <= 0 && String(params.row.invoice_header_type) === "facture") { - - return 'line--statut--payed'; - } - - // Pour la gestion de la couleur de zone double cliquée - if (String(params.row.id) === String(gridline_id_paiement)) { - 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'; - } - }} - - - /> - -
- -
- - -
- -
- - ICIII FAIRE UN HISTOGRAMME DES PAIEMENT SUR LES 6 DERNIMER MOIS - -
- -
} - - - {String(submenu).trim() === "submenu_relance" &&
- submenu_relance
- - -
} - - }   @@ -7623,7 +7384,7 @@ const AddParnerClient = (props) => {

{p_client_raison_sociale}

{p_client_is_company === "1" && "Entreprise"} {p_client_is_company !== "1" && "Particulier"} - Compte prioritaire + {p_detail_archive && String(p_detail_archive) === "1" && Archivé}
@@ -9124,6 +8885,184 @@ const AddParnerClient = (props) => { } + {String(submenu).trim() === "submenu_paiement" &&
+ + {Get_All_Paiement_of_Client_result && Get_All_Paiement_of_Client_result.length > 0 && +
+

Total Paiement - {local_format_monetaire(New_Get_All_Paiement_Total_Payed)}

+ + +
+ +
+
+   + + { + setselectionModel_paiement(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) => { + + } + } + selectionModel={selectionModel_paiement} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Get_All_Paiement_of_Client_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + invoice_id: JSON.parse(item).invoice_id, + + paiement_amount: JSON.parse(item).paiement_amount, + paiement_mode: JSON.parse(item).paiement_mode, + paiement_ref: JSON.parse(item).paiement_ref, + paiement_date: JSON.parse(item).paiement_date, + commentaire: JSON.parse(item).commentaire, + client_id: JSON.parse(item).client_id, + invoice_ref: JSON.parse(item).invoice_ref, + + } + ))} + + columns={columns_paiement} + pageSize={10} + className="datagridclass" + + rowsPerPageOptions={[10]} + //disableSelectionOnClick + /* components={{ + Toolbar: GridToolbar, + }}*/ + + + //sx={datagridSx} + getCellClassName={(params) => { + + }} + getRowClassName={(params) => { + + if (parseInt(parseFloat(params.row.reste_to_paye)) <= 0 && String(params.row.invoice_header_type) === "facture") { + + return 'line--statut--payed'; + } + + // Pour la gestion de la couleur de zone double cliquée + if (String(params.row.id) === String(gridline_id_paiement)) { + 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_All_Paiement_of_Client_result || Get_All_Paiement_of_Client_result.length > 0 && +
+ Aucun paiement +
} + +
} + + {String(submenu).trim() === "submenu_relance" &&
+ + +
} + @@ -10641,4 +10580,9 @@ position: relative; .elyos-btn-secondary { width: 100%; } + .mysy_h3 { + margin: 0; + font-size: 25px; + letter-spacing: -0.04em; +} `; diff --git a/src/components/DisplayPartnerPromotion.js b/src/components/DisplayPartnerPromotion.js index 5fdbf76..5f885c0 100644 --- a/src/components/DisplayPartnerPromotion.js +++ b/src/components/DisplayPartnerPromotion.js @@ -266,18 +266,20 @@ const DisplayPartnerPromotion = (props) => { function ExpandableCell_String_to_monetaire({ value }) { - const [expanded, setExpanded] = React.useState(false); - - const number = parseFloat(value); - var new_value = "" - if (isNaN(number)) { - new_value = "—" - } else { - new_value = new Intl.NumberFormat('fr-FR', { - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(number); - } + var new_val = String(value).replaceAll(" ", ''); + const [expanded, setExpanded] = React.useState(false); + + const number = parseFloat(new_val); + + var new_value = "" + if (isNaN(number)) { + new_value = "—" + } else { + new_value = new Intl.NumberFormat('fr-FR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(number); + } diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index cb2c143..e7ccc81 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -309,18 +309,20 @@ const DisplayPartnerSession = (props) => { function ExpandableCell_String_to_monetaire({ value }) { - const [expanded, setExpanded] = React.useState(false); - - const number = parseFloat(value); - var new_value = "" - if (isNaN(number)) { - new_value = "—" - } else { - new_value = new Intl.NumberFormat('fr-FR', { - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(number); - } + var new_val = String(value).replaceAll(" ", ''); + const [expanded, setExpanded] = React.useState(false); + + const number = parseFloat(new_val); + + var new_value = "" + if (isNaN(number)) { + new_value = "—" + } else { + new_value = new Intl.NumberFormat('fr-FR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(number); + } @@ -848,9 +850,9 @@ const DisplayPartnerSession = (props) => { { field: 'nom', headerName: 'Nom', minWidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'prenom', headerName: 'Prénom', minWidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, - { field: 'email', headerName: 'Email', minWidth: 200, flex: 1, flex: 1, renderCell: (params) => , editable: false,}, + { field: 'email', headerName: 'Email', minWidth: 200, flex: 1, flex: 1, renderCell: (params) => , editable: false, }, - { field: 'telephone', headerName: 'Téléphone', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => , editable: false,}, + { field: 'telephone', headerName: 'Téléphone', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => , editable: false, }, { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: false, }, @@ -924,66 +926,66 @@ const DisplayPartnerSession = (props) => { } }, - /* { - field: "update", headerName: 'Mise à jour', - renderCell: (cellValues) => { - return ( - <> - {String(props.check_user_acces_right("session", "write")) === "1" && { - handleClick_accept(event, cellValues); - }} + /* { + field: "update", headerName: 'Mise à jour', + renderCell: (cellValues) => { + return ( + <> + {String(props.check_user_acces_right("session", "write")) === "1" && { + handleClick_accept(event, cellValues); + }} + > + + + } + modal + nested + position="center center" > - - - } - modal - nested - position="center center" - > - {close => ( -
- -
MySy Information
-
- {' '} - - Confirmer la mise à jour des informations du stagiaire -
-
-
- - + {close => ( +
+ +
MySy Information
+
+ {' '} + + Confirmer la mise à jour des informations du stagiaire
-
- + }}> Valider + +
+
+ +
-
- )} - } - - - - ); - } - }, -*/ + )} + } + + + + ); + } + }, + */ { field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", @@ -12679,7 +12681,11 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Update_Comment_Given_Emargement : Not good man :( mysearchtext = ' + error); setUpdate_Comment_Given_Emargement_api("false"); - alert(" Impossible de mettre à jour l'émargement"); + + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de mettre à jour l'émargement"); + setalert_type("error"); }) @@ -12733,7 +12739,11 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Delete_List_Emargement : Not good man :( mysearchtext = ' + error); setDelete_List_Emargement_api("false"); - alert(" Impossible de supprimer les demandes d'émargement"); + + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de supprimer les demandes d'émargement"); + setalert_type("error"); }) @@ -12777,15 +12787,21 @@ const DisplayPartnerSession = (props) => { if (file_type !== "application/pdf") { - alert("Le fichier n'est pas de type PDF"); + + setdisplay_alert_mysy("1"); + setalert_message("Le fichier n'est pas de type PDF"); + setalert_type("error"); return; } if (file_size > 10000000) { - alert("Le fichier ne doit pas depasser un 1 Méga octets"); + console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas depasser un 1 Méga octets"); + setalert_type("error"); return; } @@ -13433,7 +13449,11 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Not good man :( Get_Stagiaire_List_Email_Com = ', error); setGet_Stagiaire_List_Email_Com_api("false"); - alert("Impossible de récupérer les adresses email de communication"); + + + setdisplay_alert_mysy("1"); + setalert_message("Impossible de récupérer les adresses email de communication"); + setalert_type("error"); //setmyApimyApiMessage("") }) } @@ -15338,7 +15358,10 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Not good man :( Get_List_Stagiaire_Convocations = ', error); setGet_List_Stagiaire_Convocations_api("false"); - alert("Impossible de récupérer les modèles de convocations"); + + setdisplay_alert_mysy("1"); + setalert_message("Impossible de récupérer les modèles de convocations"); + setalert_type("error"); //setmyApimyApiMessage("") }) } @@ -15433,7 +15456,11 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Not good man :( Send_Stagiaire_Convocations_By_Email = ', error); setSend_Stagiaire_Convocations_By_Email_api("false"); - alert("Impossible d'envoyer la convocation par email"); + + + setdisplay_alert_mysy("1"); + setalert_message("Impossible d'envoyer la convocation par email"); + setalert_type("error"); //setmyApimyApiMessage("") }) } @@ -15479,7 +15506,12 @@ const DisplayPartnerSession = (props) => { setLoading(false); //console.log(" In Download_Stagiaire_Conventions_PDF res.data = " + res.data); if (String(res.data) === String("false")) { - alert("Impossible de télécharger la convocation (2) "); + + + setdisplay_alert_mysy("1"); + setalert_message("Impossible de télécharger la convocation (2) "); + setalert_type("error"); + } else { fileDownload(res.data, nom_fichier_cmd); Getall_Editable_Document_By_Partner_By_Collection(); @@ -15490,7 +15522,10 @@ const DisplayPartnerSession = (props) => { }).catch((error) => { setLoading(false); console.error('Error:', error); - alert(" Impossible de télécharger la convocation ") + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de télécharger la convocation "); + setalert_type("error"); }); @@ -25458,7 +25493,7 @@ const DisplayPartnerSession = (props) => {

Affichage planning

  - +
{ ); } function ExpandableCell_String_to_monetaire({ value }) { + + var new_val = String(value).replaceAll(" ", ''); const [expanded, setExpanded] = React.useState(false); - const number = parseFloat(value); + const number = parseFloat(new_val); + var new_value = "" if (isNaN(number)) { new_value = "—" @@ -181,18 +193,43 @@ const Module_Relance_Client_Facture = (props) => { const [selected_id, setselected_id] = useState(""); const [gridline_id, setgridline_id] = useState(""); + + const [gridline_id_facture_retard, setgridline_id_facture_retard] = useState(""); + const [isLoading, setLoading] = useState(); const columns_relances = [ { field: '_id', headerName: '_id', hide: true, disableExport: true, }, { field: 'id', headerName: 'id', hide: true, disableExport: true }, { field: 'client_id', headerName: 'client_id', hide: true, disableExport: true }, - { field: 'relance_date', headerName: 'Date Relance', width: 150, hide: false, editable: false }, - { field: 'relance_level', headerName: 'relance_level', hide: false, minWidth: 200, flex: 1, editable: false, renderCell: (params) => , align: 'center', headerAlign: "center" }, + { field: 'relance_date', headerName: 'Date Relance', maxwidth: 250, flex: 1, hide: false, editable: false }, { - field: 'total_reste_to_paye', headerName: 'Montant Rel.', width: 150, hide: false, editable: false, align: 'right', headerAlign: "right", + field: 'total_reste_to_paye', headerName: 'Montant Rel.', maxwidth: 250, flex: 1, hide: false, editable: false, align: 'right', headerAlign: "right", renderCell: (params) => , }, + { field: 'relance_level', headerName: 'Niveau Relance', hide: false, minWidth: 200, flex: 1, editable: false, renderCell: (params) => , align: 'center', headerAlign: "center" }, + + + ] + + + const columns_facture_retard = [ + { field: '_id', headerName: '_id', hide: true, disableExport: true, }, + { field: 'id', headerName: 'id', hide: true, disableExport: true }, + { field: 'order_header_client_raison_sociale', headerName: 'Client', flex: 1, editable: false, hide: true, renderCell: (params) => , }, + { field: 'invoice_date_echeance', headerName: 'Date Echéance', flex: 1, maxWidth: 200, hide: false, editable: false }, + { field: 'invoice_header_ref_interne', headerName: 'Ref. Facture', hide: false, minWidth: 200, flex: 1, editable: false, renderCell: (params) => , align: 'center', headerAlign: "center" }, + { + field: 'reste_to_paye', headerName: 'Montant restant', minwidth: 200, flex: 1, hide: false, editable: false, align: 'right', headerAlign: "right", + renderCell: (params) => , + }, + + { + field: 'total_header_toutes_taxes', headerName: 'Montant Fact.', minwidth: 200, flex: 1, hide: false, editable: false, align: 'right', headerAlign: "right", + renderCell: (params) => , + }, + + ] @@ -209,12 +246,13 @@ const Module_Relance_Client_Facture = (props) => { form.append("token", stored_cookie); + form.append("client_id", props.client_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Relance_with_filter/"; axios.post(myurl, form).then(res => { //console.log(" In Get_List_Relance_Client_Facture res.data.status = " + res.data.status); - //console.log(" In Get_List_Relance_Client_Facture res.data.message r_class = " + res.data.message); + // console.log(" In Get_List_Relance_Client_Facture res.data.message r_class = " + res.data.message); if (String(res.data.status) === String("true")) { setGet_List_Relance_Client_Facture_api("true"); @@ -222,7 +260,7 @@ const Module_Relance_Client_Facture = (props) => { var new_data2 = []; const new_data = res.data.message.map((x) => { - new_data2.push(XMLHttpRequest); + new_data2.push(x); }); @@ -258,9 +296,86 @@ const Module_Relance_Client_Facture = (props) => { } + const [New_Get_List_Client_Facture_En_Retard_result, setNew_Get_List_Client_Facture_En_Retard_result] = useState([]); + + const [Get_List_Client_Facture_En_Retard_api, setGet_List_Client_Facture_En_Retard_api] = useState(); + const [Get_List_Client_Facture_En_Retard_message, setGet_List_Client_Facture_En_Retard_message] = useState(); + const [Get_List_Client_Facture_En_Retard_result, setGet_List_Client_Facture_En_Retard_result] = useState([]); + function Get_List_Client_Facture_En_Retard(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + + form.append("token", stored_cookie); + form.append("order_header_client_id", props.client_id); + form.append("date_echeance", format(new Date(), 'dd/MM/yyyy')); + form.append("solde_operateur", "sup"); + form.append("solde", "0"); + form.append("echeance_operateur", "inf"); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Invoice_with_filter/"; + + axios.post(myurl, form).then(res => { + //console.log(" In Get_List_Client_Facture_En_Retard res.data.status = " + res.data.status); + // console.log(" In Get_List_Client_Facture_En_Retard res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setGet_List_Client_Facture_En_Retard_api("true"); + setGet_List_Client_Facture_En_Retard_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_order_header_client_raison_sociale = JSON.parse(x).order_header_client_raison_sociale; + var local_order_header_email_client = JSON.parse(x).order_header_email_client; + var local_invoice_header_ref_interne = JSON.parse(x).invoice_header_ref_interne; + var local_invoice_date_echeance = JSON.parse(x).invoice_date_echeance; + var local_invoice_date = JSON.parse(x).invoice_date; + + var local_total_header_toutes_taxes = JSON.parse(x).total_header_toutes_taxes; + var local_reste_to_paye = JSON.parse(x).reste_to_paye; + + }); + + + if (new_data2.length > 0) + setNew_Get_List_Client_Facture_En_Retard_result(new_data2); + else + setNew_Get_List_Client_Facture_En_Retard_result([]); + + + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_List_Client_Facture_En_Retard_api("false"); + setGet_List_Client_Facture_En_Retard_message(res.data.message); + //alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + console.warn('Not good man :( Get_List_Client_Facture_En_Retard = ', error); + setGet_List_Client_Facture_En_Retard_api("false"); + //alert(" Impossible de récupérer les types de clients"); + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de récupérer les factures en retard"); + setalert_type("error"); + }) + } + useEffect(() => { Get_List_Relance_Client_Facture(); + Get_List_Client_Facture_En_Retard(); }, []); @@ -397,7 +512,335 @@ const Module_Relance_Client_Facture = (props) => { setdisplay_alert_mysy(""); } - const [selectionModel_relance, setselectionModel_relance] = React.useState([]); + const [selectionModel_relance, setselectionModel_relance] = React.useState([]); + const [selectionModel_facture_retard, setselectionModel_facture_retard] = React.useState([]); + + const New_Option_Type_Document = [ + { "id": "email", "label": "Email", "value": "email" }, + { "id": "pdf", "label": "PDF", "value": "pdf" }, + ] + + const [New_Get_List_Relance_Modele_Doc_result, setNew_Get_List_Relance_Modele_Doc_result] = useState([]); + + const [Get_List_Relance_Modele_Doc_api, setGet_List_Relance_Modele_Doc_api] = useState(); + const [Get_List_Relance_Modele_Doc_message, setGet_List_Relance_Modele_Doc_message] = useState(); + const [Get_List_Relance_Modele_Doc_result, setGet_List_Relance_Modele_Doc_result] = useState(); + function Get_List_Relance_Modele_Doc(type_doc) { + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("courrier_template_type", type_doc); + form.append("courrier_template_ref_interne", "RELANCE_FACTURE_CLIENT"); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Front_Partner_Courrier_Model/"; + setLoading(true); + + + axios.post(myurl, form).then(res => { + //console.log(" In Get_List_Relance_Modele_Doc res.data.status = " + res.data.status); + console.log(" In Get_List_Relance_Modele_Doc res.data.message r_class = " + res.data.message); + setLoading(false); + if (String(res.data.status) === String("true")) { + + + setGet_List_Relance_Modele_Doc_api("true"); + setGet_List_Relance_Modele_Doc_result(res.data.message); + + var new_data2 = []; + + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_ref_interne = JSON.parse(x).ref_interne; + var local_nom = JSON.parse(x).nom; + var local_type_doc = JSON.parse(x).type_doc; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "ref_interne": local_ref_interne, + "nom": local_nom, + "type_doc": local_type_doc, + + + }; + new_data2.push(node); + }); + + var node = { + "_id": "", + "id": "", + "label": "", + "ref_interne": "", + "nom": "", + "type_doc": "", + + + }; + new_data2.push(node); + + if (new_data2.length > 0) + setNew_Get_List_Relance_Modele_Doc_result(new_data2); + else + setNew_Get_List_Relance_Modele_Doc_result([]) + + } + else { + setGet_List_Relance_Modele_Doc_api("false"); + setGet_List_Relance_Modele_Doc_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Get_List_Relance_Modele_Doc = ', error); + setGet_List_Relance_Modele_Doc_api("false"); + + + setdisplay_alert_mysy("1"); + setalert_message("Impossible de récupérer les modèles de relance"); + setalert_type("error"); + //setmyApimyApiMessage("") + }) + } + + const [Dialog_Relance_Client_open, setDialog_Relance_Client_open] = React.useState(false); + const Dialog_Relance_Client_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_Relance_Client_handleClose_buton = () => { + setDialog_Relance_Client_open(false); + setselected_modele_relance_id(""); + setselected_modele_relance_type(""); + setselected_modele_relance_email_destinataire_prod(""); + setselected_modele_relance_email_test(""); + }; + + const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState(); + const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState(); + const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState(); + const sessions_file_change_1_convention = event => { + + + const fileUploaded = event.target.files[0]; + let file_size = event.target.files[0].size; + let file_type = event.target.files[0].type; + + + if (file_type !== "application/pdf") { + + setdisplay_alert_mysy("1"); + setalert_message("Le fichier n'est pas de type PDF"); + setalert_type("error"); + return; + } + + + + if (file_size > 10000000) { + // alert("Le fichier ne doit pas depasser un 1 Méga octets"); + console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas depasser un 1 Méga octets"); + setalert_type("error"); + return; + } + + //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type} + + + var new_tmp = []; + + if (tab_relance_client_pieces_jointes_result && tab_relance_client_pieces_jointes_result.length > 0) { + + tab_relance_client_pieces_jointes_result.map((x) => { + new_tmp.push(x); + + }); + + } + + new_tmp.push(event.target.files[0]) + + settab_relance_client_pieces_jointes_result(new_tmp); + + //console.log(" tab_relance_client_pieces_jointes_result = ", tab_relance_client_pieces_jointes_result) + return; + }; + + const [tab_relance_client_pieces_jointes_result, settab_relance_client_pieces_jointes_result] = useState([]); + + const [selected_modele_relance_id, setselected_modele_relance_id] = useState(""); + const [selected_modele_relance_type, setselected_modele_relance_type] = useState(""); + const [selected_modele_relance_email_destinataire_prod, setselected_modele_relance_email_destinataire_prod] = useState(""); + const [selected_modele_relance_email_test, setselected_modele_relance_email_test] = useState(""); + + const [Get_Relance_List_Of_All_PJ_result, setGet_Relance_List_Of_All_PJ_result] = useState([]); + + function Delete_Relance_Attached_Doc(event) { + + var doc_to_del_name = event.target.id; + const myArray = tab_relance_client_pieces_jointes_result; + + + + let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name)); + + // console.log(" new_myArray = ", new_myArray); + + + var new_tab = [] + for (let i = 0; i < new_myArray.length; i++) { + new_tab.push(new_myArray[i]); + } + + settab_relance_client_pieces_jointes_result(new_tab); + } + + + function Download_Relance_Client_PDF() { + + const stored_cookie = getCookie('tokenmysypart'); + + var nom_fichier_cmd = "Relance_Client.pdf"; + + if (String(selected_modele_relance_id).trim() === "") { + setdisplay_alert_mysy("1"); + setalert_message("Vous devez choisir un modèle de document "); + setalert_type("error"); + + return; + } + + + var url = process.env.REACT_APP_API_URL + "myclass/api/Create_Relance_Client_Facture_Given_Client_PDF/" + stored_cookie + "/" + props.client_id; + + + //console.log(" ### url = ", url); + + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convocation_id =", selected_convocation_id); + setLoading(true); + axios.get(url, { responseType: 'blob', },) + .then((res) => { + setLoading(false); + //console.log(" In Download_Stagiaire_Conventions_PDF res.data = " + res.data); + if (String(res.data) === String("false")) { + + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de télécharger la relance client (2)"); + setalert_type("error"); + + } else { + fileDownload(res.data, nom_fichier_cmd); + Get_List_Relance_Client_Facture(); + } + }).catch((error) => { + setLoading(false); + console.error('Error:', error); + // alert(" Impossible de télécharger la convocation ") + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de télécharger la relance client "); + setalert_type("error"); + + }); + } + + + const [Send_Relance_Client_By_Email_api, setSend_Relance_Client_By_Email_api] = useState(); + const [Send_Relance_Client_By_Email_message, setSend_Relance_Client_By_Email_message] = useState(); + const [Send_Relance_Client_By_Email_result, setSend_Relance_Client_By_Email_result] = useState(); + function Send_Relance_Client_By_Email(event) { + + var form = new FormData(); + + if (!selected_modele_relance_id || String(selected_modele_relance_id).trim() === "") { + // alert(" Vous devez choisir un document"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez choisir un modèle de document"); + setalert_type("error"); + return; + } + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("client_id", props.client_id); + form.append("courrier_template_id", selected_modele_relance_id); + form.append("email_test", selected_modele_relance_email_test); + form.append("email_production", selected_modele_relance_email_destinataire_prod); + + + // pièce jointe + var list_files = new FormData(); + + for (let i = 0; i < tab_relance_client_pieces_jointes_result.length; i++) { + form.append('File', tab_relance_client_pieces_jointes_result[i]); + + } + //form.append("File", list_files); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Relance_Client_Facture_Given_Client_Email/"; + + + console.log(" ### form = ", form); + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + //console.log(" In Send_Relance_Client_By_Email res.data.status = " + res.data.status); + //console.log(" In Send_Relance_Client_By_Email res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setSend_Relance_Client_By_Email_api("true"); + setSend_Relance_Client_By_Email_result(res.data.message); + + Get_List_Relance_Client_Facture(); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + + Dialog_Relance_Client_handleClose_buton(); + } + else { + setSend_Relance_Client_By_Email_api("false"); + setSend_Relance_Client_By_Email_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Send_Relance_Client_By_Email = ', error); + setSend_Relance_Client_By_Email_api("false"); + + + setdisplay_alert_mysy("1"); + setalert_message("Impossible d'envoyer la relance client par email"); + setalert_type("error"); + //setmyApimyApiMessage("") + }) + } return (
@@ -417,159 +860,662 @@ const Module_Relance_Client_Facture = (props) => { } {/*** FIN Affichage des messages d'alerte*/} -
Module de gestion des relance client
- Total Relance
-
+ {/* Dialog pour gerer les Relance_Client */} + + className="displaypartnersession" - {/*rowss_total_data && rowss_total_data.length > 0 && rowss_total_data.map((val) => ())*/} + static + onClose={() => null} -
-
-   - - '& .line--statut--selected': { - backgroundColor: '#e9f7f1', - color: '#0a2a4d', - }, - '& .line--statut--pair': { - backgroundColor: 'rgba(235, 235, 235, .7)', - color: '#0a2a4d', - }, - '& .line--statut--impair': { - backgroundColor: '#FFFFFF', - color: '#0a2a4d', - }, + Relance Client - Facture(s) + - '& .line--statut--payed': { - backgroundColor: '#EAFAF1', - color: '#239B56', - fontWeight: '700' - }, +
Type Document
+ - { + setselected_modele_relance_id(""); + settab_relance_client_pieces_jointes_result([]); + setNew_Get_List_Relance_Modele_Doc_result([]) + if (value && value.value) { + setselected_modele_relance_type(value.value); + Get_List_Relance_Modele_Doc(String(value.value)); - components={{ - Toolbar: CustomToolbar - }} - componentsProps={{ toolbar: { data_colums: columns_relances } }} + } + }} + renderInput={(params) => { - setselectionModel_relance(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) => { - - } - } - selectionModel={selectionModel_relance} - - localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={Get_List_Relance_Client_Facture_result.map((item, index) => ( - { - id: index, - _id: JSON.parse(item)._id, - clien_id: JSON.parse(item).clien_id, - tab_invoice: JSON.parse(item).tab_invoice, - relance_date: JSON.parse(item).relance_date, - relance_level: JSON.parse(item).relance_level, - total_reste_to_paye: JSON.parse(item).total_reste_to_paye, - - } - ))} - - columns={columns_relances} - 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'; - } - }} - - - /> - -
- -
-
+ {(String(selected_modele_relance_type) === "email" || String(selected_modele_relance_type) === "pdf") && + New_Get_List_Relance_Modele_Doc_result && New_Get_List_Relance_Modele_Doc_result.length > 0 && +
Choisir un modèle de relance + (data)._id === String(selected_modele_relance_id))[0].label} + onChange={(event, value) => { + if (value && value._id) { - ICIII FAIRE UN HISTOGRAMME DES PAIEMENT SUR LES 6 DERNIMER MOIS + setselected_modele_relance_id(value._id); + + + if (String(value._id) === "default_mail") { + setselected_modele_relance_type("email"); + } + else if (String(value._id) === "default_pdf") { + setselected_modele_relance_type("pdf"); + } else { + var result2 = Get_List_Relance_Modele_Doc_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id)) + setselected_modele_relance_type(JSON.parse(result2).type_doc); + } + settab_relance_client_pieces_jointes_result([]); + } + else { + setselected_modele_relance_id(""); + settab_relance_client_pieces_jointes_result([]); + } + }} + + renderInput={(params) => + } + /> + +
} + + {String(selected_modele_relance_type) === "email" && +
+ + + + + + { + setselected_modele_relance_email_test(e.target.value); + } + } + /> + + + + {String(selected_modele_relance_type) === "email" && } + +
} + + {String(selected_modele_relance_type) === "email" &&
Email destinaitaire + { + setselected_modele_relance_email_destinataire_prod(e.target.value); + } + } + /> + +
+ } + + + + {String(selected_modele_relance_type) === "email" &&
+ +
+
+
+
+ +
+ Pièces jointes + +
+ +
+ +
+ +
+ + +
+ + + {tab_relance_client_pieces_jointes_result &&
+ +
+ Liste des pièces jointes
+ {
+ {tab_relance_client_pieces_jointes_result && tab_relance_client_pieces_jointes_result.map((val) => ( +
+
+ + +
+ ))} +
} +
+
} + + + +
+
} + + + + + + + + + + + +
+
+ {String(selected_modele_relance_type) === "email" && } + + + {String(selected_modele_relance_type) === "pdf" && + } + +
+ +
+ +
+
+ +
+ +
+ {/* FIN Dialog pour gerer les Relance_Client */} + + + + +
+

Facture(s) en retard - {props.client_12_retard_a_payer}

+ {Get_List_Client_Facture_En_Retard_result && Get_List_Client_Facture_En_Retard_result.length > 0 && +
+
+ +
+ +
+
+   + + { + setselectionModel_relance(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) => { + + } + } + selectionModel={selectionModel_facture_retard} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Get_List_Client_Facture_En_Retard_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + order_header_client_raison_sociale: JSON.parse(item).order_header_client_raison_sociale, + order_header_email_client: JSON.parse(item).order_header_email_client, + invoice_header_ref_interne: JSON.parse(item).invoice_header_ref_interne, + invoice_date_echeance: JSON.parse(item).invoice_date_echeance, + invoice_date: JSON.parse(item).invoice_date, + + total_header_toutes_taxes: JSON.parse(item).total_header_toutes_taxes, + reste_to_paye: JSON.parse(item).reste_to_paye, + } + ))} + + columns={columns_facture_retard} + 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_facture_retard)) { + 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_Client_Facture_En_Retard_result || Get_List_Client_Facture_En_Retard_result.length <= 0 && +
+ Aucune facture en soufrance +
} +
+ + + +
+

Les relances - {Get_List_Relance_Client_Facture_result.length}

+ + {Get_List_Relance_Client_Facture_result && Get_List_Relance_Client_Facture_result.length > 0 && +
+ +
+
+   + + { + setselectionModel_relance(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) => { + + } + } + selectionModel={selectionModel_relance} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Get_List_Relance_Client_Facture_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + client_id: JSON.parse(item).client_id, + tab_invoice: JSON.parse(item).tab_invoice, + relance_date: JSON.parse(item).relance_date, + relance_level: JSON.parse(item).relance_level, + total_reste_to_paye: JSON.parse(item).total_reste_to_paye, + + } + ))} + + onRowDoubleClick={(newSelectionModel) => { + console.log(" ## newSelectionModel = ", newSelectionModel.row.total_reste_to_paye) + + }} + columns={columns_relances} + 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_Relance_Client_Facture_result || Get_List_Relance_Client_Facture_result.length <= 0 && +
+ Aucune relance +
}
@@ -582,6 +1528,8 @@ const Module_Relance_Client_Facture = (props) => { export default Module_Relance_Client_Facture; const local_css = ` + + :root { --bg: #f6f8fb; --card: #ffffff; @@ -596,6 +1544,13 @@ const local_css = ` --radius: 14px; --radius-sm: 10px; } + +.mysy_h3 { + margin: 0; + font-size: 25px; + letter-spacing: -0.04em; +} + .Grid_2_col{ margin-top: 12px; display:grid; @@ -676,4 +1631,36 @@ width: 100%; border: unset; border-radius: 10px; } + + + .btn { + height: 42px; + border-radius: 12px; + padding: 0 18px; + border: 1px solid var(--border); + display: inline-flex; + align-items: center; + gap: 9px; + font-weight: 700; + cursor: pointer; + background: #fff; + color: var(--text); + transition: 0.18s ease; +} + +.btn:hover { + transform: translateY(-1px); + box-shadow: 0 10px 24px rgba(16, 66, 119, 0.1); +} + +.btn-primary { + background: #0b55c4; + color: #fff; + border-color: #0b55c4; +} + +.btn-light { + background: rgba(255, 255, 255, 0.86); +} + `; diff --git a/src/components/PartnerClient_Activite_For_Client.js b/src/components/PartnerClient_Activite_For_Client.js index 0aa7c17..c426dae 100644 --- a/src/components/PartnerClient_Activite_For_Client.js +++ b/src/components/PartnerClient_Activite_For_Client.js @@ -41,6 +41,12 @@ import { AiOutlinePlusCircle } from "react-icons/ai"; import FiberNewIcon from '@mui/icons-material/FiberNew'; +import { + Clock3, + CheckCircle2, + Ban, + Archive +} from "lucide-react"; import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; @@ -1243,41 +1249,8 @@ const PartnerClient_Activite_For_Client = (props) => { /******* kanban */ - const [kanban_colonne_width, setkanban_colonne_width] = useState("20vw"); + const [kanban_colonne_width, setkanban_colonne_width] = useState("17vw"); - // MySy Comment : design d'une tache (couleur, taille, etc) - const classes_old = { - board: { - display: "flex", - margin: "0 auto", - width: "100%", - fontFamily: 'Arial, "Helvetica Neue", sans-serif' - }, - column: { - // minWidth: 200, - //width: "16vw", - width: kanban_colonne_width, - height: "80vh", - margin: "0 auto", - backgroundColor: "#212F3D", - border: 'double #32a1ce', - - }, - columnHead: { - textAlign: "center", - padding: 10, - fontSize: "1.2em", - backgroundColor: "#C6D8AF", - border: "red", - }, - item: { - padding: 10, - margin: 10, - fontSize: "0.8em", - cursor: "pointer", - backgroundColor: "white" - } - }; const classes = { board: { @@ -1290,12 +1263,21 @@ const PartnerClient_Activite_For_Client = (props) => { // minWidth: 200, //width: "16vw", width: kanban_colonne_width, + textAlign: "center", height: "80vh", margin: "0 auto", backgroundColor: "#FFFFFF", border: 'solid 1px', borderLeft: "1px solid #ecf1fc", borderRight: "1px solid #ecf1fc", + borderRadius: "24px", + backgroundColor: "rgba(255, 255, 255, 0.68)", + border: "1px solid rgba(221, 229, 239, 0.8)", + boxShadow: "var(--shadow-lg)", + overflow: "hidden", + backdropFilter: "blur(10px)", + fontFamily: "'DM Sans', Arial, Helvetica, sans-serif", + marginLeft: "30px", }, @@ -1303,11 +1285,21 @@ const PartnerClient_Activite_For_Client = (props) => { // minWidth: 200, //width: "16vw", width: kanban_colonne_width, + textAlign: "center", height: "80vh", margin: "0 auto", backgroundColor: "#FFFFFF", border: 'solid 1px', borderTop: 'none', + borderRadius: "24px", + backgroundColor: "rgba(255, 255, 255, 0.68)", + border: "1px solid rgba(221, 229, 239, 0.8)", + boxShadow: "var(--shadow-lg)", + overflow: "hidden", + backdropFilter: "blur(10px)", + fontFamily: "'DM Sans', Arial, Helvetica, sans-serif", + marginLeft: "30px", + // borderRight: "1px solid #ecf1fc", }, @@ -1316,23 +1308,72 @@ const PartnerClient_Activite_For_Client = (props) => { // minWidth: 200, //width: "16vw", width: kanban_colonne_width, + textAlign: "center", height: "80vh", margin: "0 auto", backgroundColor: "#FFFFFF", - border: "1px solid #ecf1fc", - borderRight: 'solid 1px', - borderBottom: 'solid 1px', + + borderRadius: "24px", + backgroundColor: "rgba(255, 255, 255, 0.68)", + border: "1px solid rgba(221, 229, 239, 0.8)", + boxShadow: "var(--shadow-lg)", + overflow: "hidden", + backdropFilter: "blur(10px)", + fontFamily: "'DM Sans', Arial, Helvetica, sans-serif", + marginLeft: "30px", + }, - columnHead: { + columnHead_Encours: { textAlign: "center", padding: 5, - fontSize: "14px", - backgroundColor: "rgb(103, 164, 239)", - border: "1px solid", + border: "none", marginBottom: "5px", + background: "linear-gradient(180deg, #eef4ff 0%, #f7faff 100%)", + fontSize: "17px", + color: "#0f2552", + fontWeight: 600, + padding: "18px 18px 16px", }, + + columnHead_Fait: { + textAlign: "center", + padding: 5, + border: "none", + marginBottom: "5px", + background: "linear-gradient(180deg, #edfdf4 0%, #f8fffb 100%)", + fontSize: "17px", + color: "#0f2552", + fontWeight: 600, + padding: "18px 18px 16px", + }, + + + columnHead_Annule: { + textAlign: "center", + padding: 5, + border: "none", + marginBottom: "5px", + background: "linear-gradient(180deg, #fff5e9 0%, #fffaf3 100%)", + fontSize: "17px", + color: "#0f2552", + fontWeight: 600, + padding: "18px 18px 16px", + }, + + columnHead_Archivé: { + textAlign: "center", + padding: 5, + border: "none", + marginBottom: "5px", + background: "linear-gradient(180deg, #f2f6fb 0%, #f9fbfd 100%)", + fontSize: "17px", + color: "#0f2552", + fontWeight: 600, + padding: "18px 18px 16px", + }, + item: { padding: 5, marginBottom: 10, @@ -1790,201 +1831,22 @@ const PartnerClient_Activite_For_Client = (props) => {
{String(show_all_activite_list) === "1" && String(showactivite_detail) !== "1" && String(add_one_activite) !== "1" &&
-
Ajouter une activité
- - {/*
-
Activité(s) qui me sont Assignée(s)
+ + +
- - -
- -
- {activite_status_list_pave_affiche.map((channel, index) => ( - - - {String(index) === "0" &&
-
{Opportunite_chanel_label[channel.id]}
-
- {Get_List_Activite_Assign_To_Me_result && Get_List_Activite_Assign_To_Me_result.length > 0 && - Get_List_Activite_Assign_To_Me_result.filter(item => JSON.parse(item).status === channel.id) - .map(item => ( - -
-
- - {String(String(JSON.parse(item).status)) === "1" && - } - - {String(String(JSON.parse(item).status)) === "0" && - } - - {String(String(JSON.parse(item).status)) === "-1" && - } -
- -
- ))} -
-
} - - {String(index) !== "0" &&
-
{Opportunite_chanel_label[channel.id]}
-
- {Get_List_Activite_Assign_To_Me_result && Get_List_Activite_Assign_To_Me_result.length > 0 && - Get_List_Activite_Assign_To_Me_result.filter(item => JSON.parse(item).status === channel.id) - .map(item => ( - -
-
- - {String(String(JSON.parse(item).status)) === "1" && - } - - {String(String(JSON.parse(item).status)) === "0" && - } - - {String(String(JSON.parse(item).status)) === "-1" && - } -
- -
- ))} -
-
} + {/*
Ajouter une activité
*/} -
- ))} - - - - -
-
-
 
- - -
-*/} @@ -1998,7 +1860,9 @@ const PartnerClient_Activite_For_Client = (props) => { changeTaskStatus={changeTaskStatus} > {String(index) === "0" &&
-
{Opportunite_chanel_label[channel.id]}
+ {Opportunite_chanel_label[channel.id] === "Encours" &&
  {Opportunite_chanel_label[channel.id]}
} + +
{Get_List_Activite_Of_client_Part_result && Get_List_Activite_Of_client_Part_result.length > 0 && Get_List_Activite_Of_client_Part_result.filter(item => JSON.parse(item).status === channel.id) @@ -2078,7 +1942,11 @@ const PartnerClient_Activite_For_Client = (props) => {
} {String(index) !== "0" &&
-
{Opportunite_chanel_label[channel.id]}
+ {Opportunite_chanel_label[channel.id] === "Fait" &&
 {Opportunite_chanel_label[channel.id]}
} + {Opportunite_chanel_label[channel.id] === "Annulé" &&
  {Opportunite_chanel_label[channel.id]}
} + {Opportunite_chanel_label[channel.id] === "Archivé" &&
  {Opportunite_chanel_label[channel.id]}
} + +
{Get_List_Activite_Of_client_Part_result && Get_List_Activite_Of_client_Part_result.length > 0 && Get_List_Activite_Of_client_Part_result.filter(item => JSON.parse(item).status === channel.id) @@ -2086,9 +1954,7 @@ const PartnerClient_Activite_For_Client = (props) => {
-
+
{String(String(JSON.parse(item).status)) === "1" && } + + {String(String(JSON.parse(item).status)) === "2" && + }
@@ -2613,13 +2497,13 @@ const PartnerClient_Activite_For_Client = (props) => {
- - +
 
@@ -2732,4 +2616,127 @@ width: 100%; .react-datepicker-wrapper{ width: 100%; } + + .kanban_item_css{ + position: relative; + background: rgba(255, 255, 255, 0.96); + border: 1px solid #edf2f8; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + padding: 16px; + overflow: hidden; + cursor: move !important; + overflow: hidden; + cursor: move !important; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + } + + + .kanban_item_css-0{ + padding: 5px; + margin-bottom: 10px; + font-size: 0.8em; + cursor: move; + background: #f4f6f6; + border: 0px solid; + border-left-width: 0px; + width: 94%; + margin-left: 3%; + min-height: 5rem; + border-left-width: 10px; + border-left-color : #f3f7ff; + overflow: hidden; + cursor: move !important; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + } + + .kanban_item_css-1{ + padding: 5px; + margin-bottom: 10px; + font-size: 0.8em; + cursor: move; + background: #f4f6f6; + border: 0px solid; + border-left-width: 0px; + width: 94%; + margin-left: 3%; + min-height: 5rem; + border-left-width: 10px; + border-left-color : #4d6a58; + overflow: hidden; + cursor: move !important; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + } + + .kanban_item_css--1{ + padding: 5px; + margin-bottom: 10px; + font-size: 0.8em; + cursor: move; + background: #f4f6f6; + border: 0px solid; + border-left-width: 0px; + width: 94%; + margin-left: 3%; + min-height: 5rem; + border-left-width: 10px; + border-left-color : #F5C527; + overflow: hidden; + cursor: move !important; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + } + + .kanban_item_css-2{ + padding: 5px; + margin-bottom: 10px; + font-size: 0.8em; + cursor: move; + background: #f4f6f6; + border: 0px solid; + border-left-width: 0px; + width: 94%; + margin-left: 3%; + min-height: 5rem; + border-left-width: 10px; + border-left-color : #bfd7f5; + overflow: hidden; + cursor: move !important; + border-radius: 18px; + box-shadow: 0 4px 14px rgba(17, 39, 76, 0.06); + } + + .btn { + height: 42px; + border-radius: 12px; + padding: 0 18px; + border: 1px solid var(--border); + display: inline-flex; + align-items: center; + gap: 9px; + font-weight: 700; + cursor: pointer; + background: #fff; + color: var(--text); + transition: 0.18s ease; +} + +.btn:hover { + transform: translateY(-1px); + box-shadow: 0 10px 24px rgba(16, 66, 119, 0.1); +} + +.btn-primary { + background: #0b55c4; + color: #fff; + border-color: #0b55c4; +} + +.btn-light { + background: rgba(255, 255, 255, 0.86); +} + `; diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 61bbc35..810f373 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -187,18 +187,20 @@ const Partner_Commande = (props) => { function ExpandableCell_String_to_monetaire({ value }) { - const [expanded, setExpanded] = React.useState(false); - - const number = parseFloat(value); - var new_value = "" - if (isNaN(number)) { - new_value = "—" - } else { - new_value = new Intl.NumberFormat('fr-FR', { - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }).format(number); - } + var new_val = String(value).replaceAll(" ", ''); + const [expanded, setExpanded] = React.useState(false); + + const number = parseFloat(new_val); + + var new_value = "" + if (isNaN(number)) { + new_value = "—" + } else { + new_value = new Intl.NumberFormat('fr-FR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(number); + } diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index 7682b89..8748c78 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -250,18 +250,20 @@ const Partner_Facture = (props) => { } function ExpandableCell_String_to_monetaire({ value }) { - const [expanded, setExpanded] = React.useState(false); - - const number = parseFloat(value); - var new_value = "" - if (isNaN(number)) { - new_value = "—" - } else { - new_value = new Intl.NumberFormat('fr-FR', { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }).format(number); - } + var new_val = String(value).replaceAll(" ", ''); + const [expanded, setExpanded] = React.useState(false); + + const number = parseFloat(new_val); + + var new_value = "" + if (isNaN(number)) { + new_value = "—" + } else { + new_value = new Intl.NumberFormat('fr-FR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(number); + } diff --git a/src/components/Partner_Facture_ARG.js b/src/components/Partner_Facture_ARG.js index 197fc83..5821b2b 100644 --- a/src/components/Partner_Facture_ARG.js +++ b/src/components/Partner_Facture_ARG.js @@ -218,18 +218,20 @@ const Partner_Facture_ARG = (props) => { } function ExpandableCell_String_to_monetaire({ value }) { - const [expanded, setExpanded] = React.useState(false); - - const number = parseFloat(value); - var new_value = "" - if (isNaN(number)) { - new_value = "—" - } else { - new_value = new Intl.NumberFormat('fr-FR', { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }).format(number); - } + var new_val = String(value).replaceAll(" ", ''); + const [expanded, setExpanded] = React.useState(false); + + const number = parseFloat(new_val); + + var new_value = "" + if (isNaN(number)) { + new_value = "—" + } else { + new_value = new Intl.NumberFormat('fr-FR', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(number); + }