diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index af35271..94fc936 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -911,7 +911,7 @@ const Partner_Facture = (props) => { } - disable_Order_Header_DetailFields(); + disable_Order_Header_DetailFields(); } @@ -977,7 +977,7 @@ const Partner_Facture = (props) => { 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); + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -989,6 +989,73 @@ const Partner_Facture = (props) => { } + const [Getall_Parter_Invoice_With_Filter_api, setGetall_Parter_Invoice_With_Filter_api] = useState(); + const [Getall_Parter_Invoice_With_Filter_message, setGetall_Parter_Invoice_With_Filter_message] = useState(); + const [Getall_Parter_Invoice_With_Filter_result, setGetall_Parter_Invoice_With_Filter_result] = useState(); + function Getall_Parter_Invoice_With_Filter(event) { + + var form = new FormData(); + + // Recuperation des parametres + var filtre1 = p_filtre1; + var filtre2 = p_filtre2; + var filtre3 = p_filtre3; + var filtre4 = p_filtre4; + + var filtre1_value = ""; + var filtre2_value = ""; + var filtre3_value = ""; + var filtre4_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, p_filtre3_value); + } + + if (p_filtre4_value) { + filtre4_value = p_filtre4_value; + form.append(filtre4, p_filtre4_value); + } + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + 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 res.data.status = " + res.data.status); + //console.log(" In Getall_Parter_Invoice_With_Filter res.data.message r_class = " + res.data.message); + setGetall_Parter_Invoice_With_Filter_api("true"); + setGetall_Parter_Invoice_With_Filter_result(res.data.message); + setRows(res.data.message); + } + else { + setGetall_Parter_Invoice_With_Filter_api("false"); + setGetall_Parter_Invoice_With_Filter_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Getall_Parter_Invoice_With_Filter = ', error); + setGetall_Parter_Invoice_With_Filter_api("false"); + alert(" Impossible de recuperer la liste des factures"); + //setmyApimyApiMessage("") + }) + } + const [Send_Invoice_By_Email_api, setSend_Invoice_By_Email_api] = useState(); const [Send_Invoice_By_Email_message, setSend_Invoice_By_Email_message] = useState(); const [Send_Invoice_By_Email_result, setSend_Invoice_By_Email_result] = useState(); @@ -1078,7 +1145,7 @@ const Partner_Facture = (props) => { function Enable_Order_Header_DetailFields() { - + if (document.getElementsByName("detail_header_type")[0]) { document.getElementsByName("detail_header_type")[0].disabled = false; @@ -1350,6 +1417,33 @@ const Partner_Facture = (props) => { } + 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([]); + setselectionModel_invoice_lines([]); + + Getall_Parter_Invoice_No_Filter(); + setdisplay_detail_invoice(); + } + + function clean_order_detail_fields() { + + } + return ( @@ -1374,8 +1468,9 @@ const Partner_Facture = (props) => { }} > - Ref. Interne   - Ref. Externe (chez le client)   + Num Facture   + Ref. Interne Cmd   + Ref. Externe Cmd (chez le client)   Nom Client   Lié a la Formation (code externe)   @@ -1454,11 +1549,11 @@ const Partner_Facture = (props) => { }} > - Ref. Interne   - Ref. Externe (chez le client)   - Nom Client   - Lié a la Formation (code externe)   - + Num Facture   + Ref. Interne Cmd   + Ref. Externe Cmd (chez le client)   + Nom Client   + Lié a la Formation (code externe)   @@ -1534,10 +1629,11 @@ const Partner_Facture = (props) => { setp_filtre3(e.target.value) }} > - Ref. Interne   - Ref. Externe (chez le client)   - Nom Client   - Lié a la Formation (code externe)   + Num Facture   + Ref. Interne Cmd   + Ref. Externe Cmd (chez le client)   + Nom Client   + Lié a la Formation (code externe)   @@ -1600,12 +1696,12 @@ const Partner_Facture = (props) => {
-
-
@@ -1974,9 +2070,9 @@ const Partner_Facture = (props) => {
*/} - -
Type de Reduction (entete)
+ +
Type de Reduction (entete)
{ disabled={false} className="disabled_style" value={p_detail_header_type_reduction_valeur} - + />
@@ -2027,7 +2123,7 @@ const Partner_Facture = (props) => { className="disabled_style" value={p_detail_header_total_reduction_amount} - + />
@@ -2166,7 +2262,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_fact_adr} - + /> @@ -2184,7 +2280,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_fact_code_postal} - + /> @@ -2201,7 +2297,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_fact_ville} - + /> @@ -2219,7 +2315,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_fact_pays} - + /> @@ -2239,7 +2335,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_liv_adr} - + /> @@ -2257,7 +2353,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_liv_code_postal} - + /> @@ -2275,7 +2371,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_liv_ville} - + /> @@ -2293,7 +2389,7 @@ const Partner_Facture = (props) => { disabled={false} className="disabled_style" value={p_detail_header_liv_pays} - + />