diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js
index d83988d..acecb29 100644
--- a/src/components/AddPartnerClient.js
+++ b/src/components/AddPartnerClient.js
@@ -31,6 +31,7 @@ import { PiDotsThree } from "react-icons/pi";
import { IoCloseCircleOutline } from "react-icons/io5";
import AttachFileIcon from '@mui/icons-material/AttachFile';
import Radio from '@mui/material/Radio';
+import { FcOpenedFolder } from "react-icons/fc";
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
const AddParnerClient = (props) => {
@@ -152,6 +153,28 @@ const AddParnerClient = (props) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
+
+ function inactive_active_menu_header(current_menu_header) {
+
+ const list_fields = ['submenu_devis', 'submenu_factures', 'submenu_piece_jointe',
+ 'submenu_activite', 'submenu_contact', 'submenu_donnee_facturation', 'submenu_donnee_client']
+
+ for (let i = 0; i < list_fields.length; i++) {
+ if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) {
+ document.getElementsByName(String(list_fields[i]))[0].style.background = "#d8edfc";
+ document.getElementsByName(String(list_fields[i]))[0].style.color = "#3b3e40";
+
+ }
+ }
+
+ if (document.getElementsByName(String(current_menu_header)) && document.getElementsByName(String(current_menu_header))[0]) {
+ document.getElementsByName(String(current_menu_header))[0].style.background = "#104277";
+ document.getElementsByName(String(current_menu_header))[0].style.color = "white";
+ }
+
+
+ }
+
const [importmessage, setimportmessage] = useState("");
async function submenu_donnee_client() {
setsubmenu("submenu_donnee_client");
@@ -165,36 +188,7 @@ const AddParnerClient = (props) => {
Enable_fields();
}
- /*
- document.getElementById("submenu_factures").style.background = "#d8edfc";
- document.getElementById("submenu_factures").style.color = "#3b3e40";
-
- document.getElementById("submenu_stagiaires").style.background = "#d8edfc";
- document.getElementById("submenu_stagiaires").style.color = "#3b3e40";
-
- document.getElementById("submenu_devis").style.background = "#d8edfc";
- document.getElementById("submenu_devis").style.color = "#3b3e40";
-
- document.getElementById("submenu_cmd").style.background = "#d8edfc";
- document.getElementById("submenu_cmd").style.color = "#3b3e40";
-
- */
- document.getElementById("submenu_contact").style.background = "#d8edfc";
- document.getElementById("submenu_contact").style.color = "#3b3e40";
-
- document.getElementById("submenu_activite").style.background = "#d8edfc";
- document.getElementById("submenu_activite").style.color = "#3b3e40";
-
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_piece_jointe").style.background = "#d8edfc";
- document.getElementById("submenu_piece_jointe").style.color = "#3b3e40";
-
-
- document.getElementById("submenu_donnee_client").style.background = "#104277";
- document.getElementById("submenu_donnee_client").style.color = "white";
+ inactive_active_menu_header("submenu_donnee_client");
}
@@ -212,28 +206,7 @@ const AddParnerClient = (props) => {
Enable_invoice_fields();
}
-
-
- document.getElementById("submenu_contact").style.background = "#d8edfc";
- document.getElementById("submenu_contact").style.color = "#3b3e40";
-
- document.getElementById("submenu_activite").style.background = "#d8edfc";
- document.getElementById("submenu_activite").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_client").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_client").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_piece_jointe").style.background = "#d8edfc";
- document.getElementById("submenu_piece_jointe").style.color = "#3b3e40";
-
-
- document.getElementById("submenu_donnee_facturation").style.background = "#104277";
- document.getElementById("submenu_donnee_facturation").style.color = "white";
-
-
+ inactive_active_menu_header("submenu_donnee_facturation");
}
@@ -244,25 +217,7 @@ const AddParnerClient = (props) => {
*/
await sleep(5);
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_activite").style.background = "#d8edfc";
- document.getElementById("submenu_activite").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_client").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_client").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_piece_jointe").style.background = "#d8edfc";
- document.getElementById("submenu_piece_jointe").style.color = "#3b3e40";
-
-
- document.getElementById("submenu_contact").style.background = "#104277";
- document.getElementById("submenu_contact").style.color = "white";
+ inactive_active_menu_header("submenu_contact");
}
@@ -278,27 +233,7 @@ const AddParnerClient = (props) => {
} else {
//Enable_invoice_fields();
}
-
-
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_client").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_client").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_contact").style.background = "#d8edfc";
- document.getElementById("submenu_contact").style.color = "#3b3e40";
-
- document.getElementById("submenu_piece_jointe").style.background = "#d8edfc";
- document.getElementById("submenu_piece_jointe").style.color = "#3b3e40";
-
-
- document.getElementById("submenu_activite").style.background = "#104277";
- document.getElementById("submenu_activite").style.color = "white";
+ inactive_active_menu_header("submenu_activite");
}
@@ -316,28 +251,7 @@ const AddParnerClient = (props) => {
} else {
//Enable_invoice_fields();
}
-
-
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_client").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_client").style.color = "#3b3e40";
-
- document.getElementById("submenu_donnee_facturation").style.background = "#d8edfc";
- document.getElementById("submenu_donnee_facturation").style.color = "#3b3e40";
-
- document.getElementById("submenu_contact").style.background = "#d8edfc";
- document.getElementById("submenu_contact").style.color = "#3b3e40";
-
- document.getElementById("submenu_activite").style.background = "#d8edfc";
- document.getElementById("submenu_activite").style.color = "#3b3e40";
-
- document.getElementById("submenu_piece_jointe").style.background = "#104277";
- document.getElementById("submenu_piece_jointe").style.color = "white";
-
-
+ inactive_active_menu_header("submenu_piece_jointe");
// Refresh affichage des pièces jointes
Get_List_Of_All_PJ(props.client_id);
}
@@ -349,6 +263,7 @@ const AddParnerClient = (props) => {
Ceci est super crade, fair eun wait de pour attendre l'afficage avant de desacitcation si on a desactiver, mais bon ... on avance.
*/
await sleep(5);
+ inactive_active_menu_header("submenu_devis");
}
async function submenu_cmd() {
@@ -365,6 +280,7 @@ const AddParnerClient = (props) => {
Ceci est super crade, fair eun wait de pour attendre l'afficage avant de desacitcation si on a desactiver, mais bon ... on avance.
*/
await sleep(5);
+ inactive_active_menu_header("submenu_factures");
}
@@ -3554,11 +3470,36 @@ const AddParnerClient = (props) => {
+
+
+
+
+
- {/*
-
-
- */}
diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js
index ee61628..31f42bf 100644
--- a/src/components/DisplayPartnerSession.js
+++ b/src/components/DisplayPartnerSession.js
@@ -14600,9 +14600,6 @@ const DisplayPartnerSession = (props) => {
{String(addOneSession) !== "1" &&
diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js
index 67c435a..fdd57d2 100644
--- a/src/components/Module_Session_Planification.js
+++ b/src/components/Module_Session_Planification.js
@@ -1484,7 +1484,7 @@ const Module_Session_Planification = (props) => {
if (new_data2.length > 0) {
setGetall_Sequence_Of_Session_result_planning_view(new_data2);
- // console.log(" ### new_data2 = ", new_data2);
+ // console.log(" ### new_data2 Getall_Sequence_Of_Session = ", new_data2);
}
@@ -1635,6 +1635,7 @@ const Module_Session_Planification = (props) => {
var localid = (x)._id; // on donne volontairement a l'id la valeur de '_id'
var local_id = (x)._id;
var local_title = (x).sequence_title;
+
var local_start = new Date(moment((x).new_sequence_start, "DD/MM/YYYY hh:mm"))
var local_end = new Date(moment((x).new_sequence_end, "DD/MM/YYYY hh:mm"))
@@ -1675,7 +1676,7 @@ const Module_Session_Planification = (props) => {
if (new_data2.length > 0) {
setnew_planification_lines(new_data2);
- // console.log(" ### new_data2 = ", new_data2);
+ // console.log(" ### new_data2 = ", new_data2);
}
// console.log(" ### ENN new_data2 = ", new_data2);
@@ -3128,16 +3129,81 @@ const Module_Session_Planification = (props) => {
form.append("token", stored_cookie);
form.append("session_id", selected_session_id);
- var json_str = JSON.stringify(new_planification_lines)
+
+
+ var new_planification_lines_normalized = [];
+ const new_data = new_planification_lines.map((x) => {
+
+ var _id = x._id;
+
+ var color = "";
+ if (x.color)
+ color = x.color;
+
+ var grp_code = "";
+ if (x.grp_code)
+ grp_code = x.grp_code
+
+
+ var id = x.id;
+ var local_agenda = x.local_agenda;
+ var local_comment = x.local_comment;
+
+ var local_grp_apprenant_id = "";
+ if (x.local_grp_apprenant_id)
+ local_grp_apprenant_id = x.local_grp_apprenant_id
+
+ var local_objectif = x.local_objectif;
+ var local_type = x.local_type;
+
+
+ var local_ue_id = "";
+ if( x.local_ue_id )
+ local_ue_id = x.local_ue_id
+
+
+ var local_ue_planif_line_id = "";
+ if (x.local_ue_planif_line_id)
+ local_ue_planif_line_id = x.local_ue_planif_line_id
+
+ var title = x.title;
+
+
+
+ var start = moment(x.start).format("DD/MM/YYYY HH:mm");
+ var end = moment(x.end).format("DD/MM/YYYY HH:mm");
+
+ //---
+ var node = {
+ "_id": _id,
+ "color": color,
+ "title": title,
+ "start": start,
+ "end": end,
+
+ "grp_code": grp_code,
+ "id": id,
+ "local_agenda": local_agenda,
+
+ "local_agenda": local_agenda,
+ "local_comment": local_comment,
+ "local_grp_apprenant_id": local_grp_apprenant_id,
+ "local_objectif": local_objectif,
+ "local_type": local_type,
+ "local_ue_id": local_ue_id,
+ "local_ue_planif_line_id": local_ue_planif_line_id,
+
+ }
+ new_planification_lines_normalized.push(node);
+
+ });
+
+
+ var json_str = JSON.stringify(new_planification_lines_normalized)
form.append("tab_sequence_modele", json_str);
-
-
- //console.log(" form == ", form);
-
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Apply_Planning_Model_To_Session/";
-
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Apply_Planning_To_Session res.data.status = " + res.data.status);
diff --git a/src/components/Partner.js b/src/components/Partner.js
index 69e4fb6..1a28fa0 100644
--- a/src/components/Partner.js
+++ b/src/components/Partner.js
@@ -22,7 +22,7 @@ import Header from "./Header";
import Facture from "./Facture";
import Abonnement from "./Abonnement";
import { useLocation } from "react-router-dom";
-import { useParams } from 'react-router-dom'
+import { useParams } from 'react-router-dom';
import CheckOut from "./CheckOut";
import { FaHandPointRight } from "react-icons/fa";
diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js
index 6ba0921..e694d3a 100644
--- a/src/components/Partner_Client.js
+++ b/src/components/Partner_Client.js
@@ -408,7 +408,6 @@ const Partner_Client = (props) => {
//menu_info();
Get_List_Partner_Clients();
-
if (props.object_key && String(props.object_key).length > 3) {
handleClick_edit_session_From_Props(props.object_key);
diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js
index 0d20adc..e4fd540 100644
--- a/src/components/Partner_Commande.js
+++ b/src/components/Partner_Commande.js
@@ -55,6 +55,10 @@ import { makeStyles } from "@material-ui/core/styles";
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { IconButton } from '@material-ui/core';
import Checkbox from '@mui/material/Checkbox';
+import { FcOpenedFolder } from "react-icons/fc";
+
+import { useParams } from 'react-router-dom';
+
const useStyles = makeStyles((theme) => ({
@@ -77,13 +81,17 @@ const useStyles = makeStyles((theme) => ({
}));
+
const Partner_Commande = (props) => {
+ const { action, orderid } = useParams();
+
const classes = useStyles();
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 [article_formation_ou_produit, setarticle_formation_ou_produit] = useState("formation");
@@ -184,8 +192,6 @@ const Partner_Commande = (props) => {
{ field: 'order_header_date_cmd', headerName: 'Date', minWidth: 150, hide: false, editable: false, flex: 1, renderCell: (params) =>
, },
{ field: 'order_header_date_expiration', headerName: 'Date Expiration', minWidth: 150, hide: false, editable: false },
-
-
{
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
@@ -257,7 +263,38 @@ const Partner_Commande = (props) => {
{ field: 'order_line_formation', headerName: 'intenal_url', width: 0, hide: true, editable: false },
{ field: 'order_line_session_id', headerName: 'session_id', width: 0, hide: true, editable: false },
- { field: 'order_line_formation_title', headerName: 'Titre', minWidth: 200, flex: 1, renderCell: (params) =>
, },
+ {
+ field: 'order_line_formation_title', headerName: 'Titre', minWidth: 200, flex: 1,
+ renderCell: (cellValues) => {
+ return (
+
+ );
+ }
+ },
{
field: 'order_line_session_code', headerName: 'Code Session', minwidth: 200, flex: 1, hideable: true, resizable: true,
renderCell: (cellValues) => {
@@ -944,15 +981,27 @@ const Partner_Commande = (props) => {
Get_List_Partner_Clients();
Getall_Training_Employee_No_Filter();
- Getall_Parter_Orders_No_Filter();
GetCurrentPartnerClass();
Get_Given_Partner_Config_Point_Taux_TVA();
Getall_Partner_Paiement_Condition();
Getall_TrainingSession();
Getall_Partner_Digital_Sign_Status();
-
Getall_Partner_Product_Service();
+ console.log(" ~### mes facture props action, orderid = ", action, orderid);
+ if (orderid && String(orderid).length > 3) {
+
+ /*
+ Dans le cas précis des produits et service, "props.class_external_code" est utilisé comme
+ l'_id du client*/
+
+ Getall_Parter_Orders_With_Filter_On_Client_Id(orderid);
+ console.log(" ~### 222 mes facture props action, orderid = ", action, orderid);
+
+ } else {
+ Getall_Parter_Orders_No_Filter();
+ }
+
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
@@ -961,6 +1010,7 @@ const Partner_Commande = (props) => {
});
}
+
Getall_Parter_Devis_Config_Points();
}, [])
@@ -986,6 +1036,7 @@ const Partner_Commande = (props) => {
setGetall_Parter_Orders_No_Filter_api("true");
setGetall_Parter_Orders_No_Filter_result(res.data.message);
setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
}
else {
setGetall_Parter_Orders_No_Filter_api("false");
@@ -1054,6 +1105,7 @@ const Partner_Commande = (props) => {
setGetall_Parter_Orders_With_Filter_api("true");
setGetall_Parter_Orders_With_Filter_result(res.data.message);
setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
}
else {
setGetall_Parter_Orders_With_Filter_api("false");
@@ -1069,6 +1121,45 @@ const Partner_Commande = (props) => {
})
}
+ const [Getall_Parter_Orders_With_Filter_On_Client_Id_api, setGetall_Parter_Orders_With_Filter_On_Client_Id_api] = useState();
+ const [Getall_Parter_Orders_With_Filter_On_Client_Id_message, setGetall_Parter_Orders_With_Filter_On_Client_Id_message] = useState();
+ const [Getall_Parter_Orders_With_Filter_On_Client_Id_result, setGetall_Parter_Orders_With_Filter_On_Client_Id_result] = useState();
+ function Getall_Parter_Orders_With_Filter_On_Client_Id(local_client_id) {
+
+ var form = new FormData();
+
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("order_header_client_id", local_client_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Order_with_filter/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Parter_Orders_With_Filter_On_Client_Id res.data.status = " + res.data.status);
+ //console.log(" In Getall_Parter_Orders_With_Filter_On_Client_Id res.data.message r_class = " + res.data.message);
+ setGetall_Parter_Orders_With_Filter_On_Client_Id_api("true");
+ setGetall_Parter_Orders_With_Filter_On_Client_Id_result(res.data.message);
+ setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
+ }
+ else {
+ setGetall_Parter_Orders_With_Filter_On_Client_Id_api("false");
+ setGetall_Parter_Orders_With_Filter_On_Client_Id_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( Getall_Parter_Orders_With_Filter_On_Client_Id = ', error);
+ setGetall_Parter_Orders_With_Filter_On_Client_Id_api("false");
+ alert(" Impossible de recuperer la liste des commandes et devis");
+ //setmyApimyApiMessage("")
+ })
+ }
+
const [session_file_name, setsession_file_name] = useState();
const [liste_sessions_file_change_api, setliste_sessions_file_change_api] = useState();
@@ -5961,6 +6052,8 @@ const Partner_Commande = (props) => {
+ {rowss_total_data && rowss_total_data.length > 0 && rowss_total_data.map((val) => (
))}
+
@@ -6053,6 +6146,7 @@ const Partner_Commande = (props) => {
onRowDoubleClick={(newSelectionModel) => {
setgridline_id(newSelectionModel.row.id);
+ setp_detail_header_client_nom_id(newSelectionModel.row.order_header_client_id);
handleClick_edit_order_From_Line(newSelectionModel.row.id);
}
}
@@ -6474,7 +6568,7 @@ const Partner_Commande = (props) => {
- {String(order_data_edit_mode) !== "1" &&
Nom Client
+ {String(order_data_edit_mode) !== "1" &&
}
- {String(order_data_edit_mode) === "1" &&
Nom Client
+ {String(order_data_edit_mode) === "1" &&
Nom Client
{
+ const { action, orderid } = useParams();
+
const csvOptions = { delimiter: ';' };
function CustomExportButton(props) {
return (
@@ -113,6 +116,7 @@ const Partner_Facture = (props) => {
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 [rows_invoice_lines, setrows_invoice_lines] = useState([]);
@@ -273,7 +277,38 @@ const Partner_Facture = (props) => {
{ field: '_id', headerName: '_id', hide: true, editable: false },
{ field: 'id', headerName: 'id', hide: true, editable: false },
{ field: 'order_line_formation', headerName: 'intenal_url', width: 0, hide: true, editable: false },
- { field: 'order_line_formation_title', headerName: 'Titre', width: 250, hide: false, editable: false, flex: 1 },
+ {
+ field: 'order_line_formation_title', headerName: 'Titre', width: 250, hide: false, editable: false, flex: 1,
+ renderCell: (cellValues) => {
+ return (
+
+ );
+ }
+ },
{ field: 'order_line_formation_external_code', headerName: 'Code Formation', width: 150, hide: false, editable: false },
{ field: 'order_line_formation_duration', headerName: 'Durée', width: 80, hide: false, editable: false },
@@ -285,6 +320,7 @@ const Partner_Facture = (props) => {
{ field: 'order_header_id', headerName: 'Id_Entete', hide: true, editable: false },
{ field: 'order_header_ref_interne', headerName: 'Ref_Interne', hide: true, editable: false },
{ field: 'order_line_type', headerName: 'Type', width: 100, hide: false, editable: false },
+ { field: 'order_line_type_article', headerName: 'Type Article', width: 100, hide: true, editable: false },
{
field: "Detail", headerName: 'Voir detail',
@@ -951,9 +987,11 @@ const Partner_Facture = (props) => {
}
+
+
const [Getall_Parter_Invoice_No_Filter_api, setGetall_Parter_Invoice_No_Filter_api] = useState();
const [Getall_Parter_Invoice_No_Filter_message, setGetall_Parter_Invoice_No_Filter_message] = useState();
- const [Getall_Parter_Invoice_No_Filter_result, setGetall_Parter_Invoice_No_Filter_result] = useState();
+ const [Getall_Parter_Invoice_No_Filter_result, setGetall_Parter_Invoice_No_Filter_result] = useState([]);
function Getall_Parter_Invoice_No_Filter(event) {
var form = new FormData();
@@ -969,9 +1007,11 @@ const Partner_Facture = (props) => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Parter_Invoice_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Parter_Invoice_No_Filter res.data.message r_class = " + res.data.message);
+ console.log(" In Getall_Parter_Invoice_No_Filter res.data.total_data r_class = ", res.data.total_data);
setGetall_Parter_Invoice_No_Filter_api("true");
setGetall_Parter_Invoice_No_Filter_result(res.data.message);
setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
}
else {
setGetall_Parter_Invoice_No_Filter_api("false");
@@ -987,12 +1027,66 @@ const Partner_Facture = (props) => {
})
}
+
+ const [Getall_Parter_Invoice_With_Filter_On_Client_Id_api, setGetall_Parter_Invoice_With_Filter_On_Client_Id_api] = useState();
+ const [Getall_Parter_Invoice_With_Filter_On_Client_Id_message, setGetall_Parter_Invoice_With_Filter_On_Client_Id_message] = useState();
+ const [Getall_Parter_Invoice_With_Filter_On_Client_Id_result, setGetall_Parter_Invoice_With_Filter_On_Client_Id_result] = useState();
+ function Getall_Parter_Invoice_With_Filter_On_Client_Id(local_client_id) {
+
+ setgridline_id("");
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("order_header_client_id", local_client_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Invoice_with_filter/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Parter_Invoice_With_Filter_On_Client_Id res.data.status = " + res.data.status);
+ // console.log(" In Getall_Parter_Invoice_With_Filter_On_Client_Id res.data.message r_class = " + res.data.message);
+ setGetall_Parter_Invoice_With_Filter_On_Client_Id_api("true");
+ setGetall_Parter_Invoice_With_Filter_On_Client_Id_result(res.data.message);
+ setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
+ }
+ else {
+ setGetall_Parter_Invoice_With_Filter_On_Client_Id_api("false");
+ setGetall_Parter_Invoice_With_Filter_On_Client_Id_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( Getall_Parter_Invoice_With_Filter_On_Client_Id = ', error);
+ setGetall_Parter_Invoice_With_Filter_On_Client_Id_api("false");
+ alert(" Impossible de recuperer la liste des factures");
+ //setm yApimyApiMessage("")
+ })
+ }
+
const myRef = useRef(null);
useEffect(() => {
Get_List_Partner_Clients();
- Getall_Parter_Invoice_No_Filter();
+
+
+ if (orderid && String(orderid).length > 3) {
+
+ /*
+ Dans le cas précis des produits et service, "props.class_external_code" est utilisé comme
+ l'_id du client*/
+
+ Getall_Parter_Invoice_With_Filter_On_Client_Id(orderid);
+ //console.log(" ~### mes facture props action, orderid = ", action, orderid);
+
+ } else {
+ Getall_Parter_Invoice_No_Filter();
+
+ }
if (document.getElementById('myRef_head')) {
@@ -1564,6 +1658,7 @@ const Partner_Facture = (props) => {
setGetall_Parter_Invoice_With_Filter_api("true");
setGetall_Parter_Invoice_With_Filter_result(res.data.message);
setRows(res.data.message);
+ setRows_total_data(JSON.parse(res.data.total_data));
}
else {
setGetall_Parter_Invoice_With_Filter_api("false");
@@ -2814,22 +2909,29 @@ const Partner_Facture = (props) => {
{/*** Fin annotation */}
-
- {/******* Menu droire 'Client_Facturé' */}
-