recette2
parent
5eed52a57e
commit
298402dbf2
|
@ -247,7 +247,7 @@ const DisplayPartnerSession = (props) => {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'etape', headerName: 'Etape', hide: true, width: datagrid_columns_size_model2, renderCell: (params) => <ExpandableCell_50 {...params} />,
|
field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, renderCell: (params) => <ExpandableCell_50 {...params} />,
|
||||||
|
|
||||||
},
|
},
|
||||||
{ field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
{ field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
|
||||||
|
|
|
@ -234,6 +234,11 @@ const Partner_Commande = (props) => {
|
||||||
{ field: 'order_line_qty', headerName: 'Qte', width: 100, hide: false, editable: false },
|
{ field: 'order_line_qty', headerName: 'Qte', width: 100, hide: false, editable: false },
|
||||||
{ field: 'order_line_prix_unitaire', headerName: 'Prix Unit.', width: 100, hide: false, editable: false },
|
{ field: 'order_line_prix_unitaire', headerName: 'Prix Unit.', width: 100, hide: false, editable: false },
|
||||||
{ field: 'order_line_montant_hors_taxes', headerName: 'Total HT', width: 100, hide: false, editable: false },
|
{ field: 'order_line_montant_hors_taxes', headerName: 'Total HT', width: 100, hide: false, editable: false },
|
||||||
|
{ field: 'order_line_tax_amount', headerName: 'Taxe', width: 100, hide: false, editable: false },
|
||||||
|
|
||||||
|
{ field: 'order_line_taux_taxe', headerName: '% Taxe', width: 100, hide: false, editable: false },
|
||||||
|
|
||||||
|
{ field: 'order_line_montant_toutes_taxes', headerName: 'Montant TTC', width: 100, hide: false, editable: false },
|
||||||
{ field: 'order_header_id', headerName: 'Id_Entete', hide: true, editable: false },
|
{ 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_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', headerName: 'Type', width: 100, hide: false, editable: false },
|
||||||
|
@ -470,7 +475,7 @@ const Partner_Commande = (props) => {
|
||||||
setp_add_line_order_line_type_article(String(cellValues.row.order_line_type_article));
|
setp_add_line_order_line_type_article(String(cellValues.row.order_line_type_article));
|
||||||
setarticle_formation_ou_produit(String(cellValues.row.order_line_type_article));
|
setarticle_formation_ou_produit(String(cellValues.row.order_line_type_article));
|
||||||
|
|
||||||
console.log(" String(cellValues.row.order_line_type_article = ", String(cellValues.row.order_line_type_article));
|
//console.log(" String(cellValues.row.order_line_type_article = ", String(cellValues.row.order_line_type_article));
|
||||||
|
|
||||||
Get_Given_Line_Of_Partner_Order_Line_Data(order_line_id, order_internal_ref);
|
Get_Given_Line_Of_Partner_Order_Line_Data(order_line_id, order_internal_ref);
|
||||||
|
|
||||||
|
@ -1865,6 +1870,10 @@ const Partner_Commande = (props) => {
|
||||||
setp_add_line_item_taxe(mylocal_order.order_line_tax);
|
setp_add_line_item_taxe(mylocal_order.order_line_tax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mylocal_order.order_line_taux_taxe) {
|
||||||
|
setpartner_taux_tva(mylocal_order.order_line_taux_taxe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mylocal_order.order_line_tax_amount) {
|
if (mylocal_order.order_line_tax_amount) {
|
||||||
setp_add_line_item_taxe_amount(mylocal_order.order_line_tax_amount);
|
setp_add_line_item_taxe_amount(mylocal_order.order_line_tax_amount);
|
||||||
|
@ -2683,10 +2692,72 @@ const Partner_Commande = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const [Add_Update_One_Order_Line_Data_api, setAdd_Update_One_Order_Line_Data_api] = useState();
|
const [Add_Update_One_Order_Line_Data_api, setAdd_Update_One_Order_Line_Data_api] = useState();
|
||||||
const [Add_Update_One_Order_Line_Data_message, setAdd_Update_One_Order_Line_Data_message] = useState();
|
const [Add_Update_One_Order_Line_Data_message, setAdd_Update_One_Order_Line_Data_message] = useState();
|
||||||
const [Add_Update_One_Order_Line_Data_result, setAdd_Update_One_Order_Line_Data_result] = useState();
|
const [Add_Update_One_Order_Line_Data_result, setAdd_Update_One_Order_Line_Data_result] = useState();
|
||||||
function Add_Update_One_Order_Line_Data() {
|
function Add_Update_One_Order_Line_Data() {
|
||||||
|
|
||||||
|
/*** Recualcule des taux et montants */
|
||||||
|
|
||||||
|
var qty = parseFloat(document.getElementById("ref_article_qty").value);
|
||||||
|
var unit_price = parseFloat(document.getElementById("ref_article_unit_price").value);
|
||||||
|
var total_base1 = (unit_price * qty).toFixed(2);
|
||||||
|
var total_reduction = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var reduct_type = document.getElementById("ref_article_type_reduction").value;
|
||||||
|
var reduct_value = document.getElementById("ref_article_reduction_value").value;
|
||||||
|
|
||||||
|
//var reduct_type = p_add_line_item_type_reduction;
|
||||||
|
|
||||||
|
//console.log(" reduct_type = ", reduct_type);
|
||||||
|
//console.log(" p_add_line_item_type_reduction = ", p_add_line_item_type_reduction);
|
||||||
|
|
||||||
|
if (String(p_add_line_item_type_reduction) === "fixe") {
|
||||||
|
//console.log("fixe : p_add_line_item_reduction_value = ", reduct_value);
|
||||||
|
total_reduction = (parseFloat(String(reduct_value)) * qty).toFixed(2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} if (String(p_add_line_item_type_reduction) === "percent") {
|
||||||
|
//console.log("percent p_add_line_item_reduction_value = ", reduct_value);
|
||||||
|
total_reduction = ((unit_price * parseFloat(String(reduct_value)) * qty) / 100).toFixed(2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
console.log(" GLOBAL #### partner_taux_tva = ", partner_taux_tva, " ### qty = ", qty, " ### unit_price = ", unit_price, " ### total_base1 = ", total_base1, " ### total_reduction = ", total_reduction, " ### reduct_value = ", reduct_value);
|
||||||
|
|
||||||
|
const total_taux_tax_bef = parseFloat(String(partner_taux_tva)) / 100;
|
||||||
|
|
||||||
|
console.log(" GLOBAL #### total_taux_tax_bef = ", total_taux_tax_bef);
|
||||||
|
|
||||||
|
const total_taux_tax =1 + total_taux_tax_bef;
|
||||||
|
|
||||||
|
const total_base1_total_reduction = (total_base1 - total_reduction) ;
|
||||||
|
|
||||||
|
const montant_ttc = (total_base1_total_reduction * total_taux_tax).toFixed(2);
|
||||||
|
|
||||||
|
console.log(" GLOBAL #### total_taux_tax = ", total_taux_tax);
|
||||||
|
console.log(" GLOBAL #### total_base1_total_reduction = ", total_base1_total_reduction);
|
||||||
|
console.log(" GLOBAL #### montant_ttc = ", montant_ttc);
|
||||||
|
|
||||||
|
|
||||||
|
var montant_taxe_tva = ((total_base1 - total_reduction) * total_taux_tax_bef ).toFixed(2);
|
||||||
|
// var montant_ttc = ((total_base1 - total_reduction) * (1 + [parseFloat(String(partner_taux_tva)) / 100])).toFixed(2); //(total_base2 + montant_taxe_tva).toFixed(2);
|
||||||
|
|
||||||
|
console.log(" GLOBAL #### montant_taxe_tva = ", montant_taxe_tva, " ### montant_ttc = ", montant_ttc);
|
||||||
|
|
||||||
|
setp_add_line_item_reduction_total_amount(String(total_reduction));
|
||||||
|
setp_add_line_item_total_amount_ht(String(total_base1));
|
||||||
|
setp_add_line_item_taxe("tva");
|
||||||
|
setp_add_line_item_taxe_amount(String(montant_taxe_tva));
|
||||||
|
setp_add_line_item_total_amount_ttc(String(montant_ttc));
|
||||||
|
/*** FINNN Recualcule des taux et montants */
|
||||||
|
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||||
|
|
||||||
|
@ -2707,12 +2778,14 @@ const Partner_Commande = (props) => {
|
||||||
|
|
||||||
form.append("order_line_type_reduction", p_add_line_item_type_reduction);
|
form.append("order_line_type_reduction", p_add_line_item_type_reduction);
|
||||||
form.append("order_line_type_valeur", p_add_line_item_reduction_value);
|
form.append("order_line_type_valeur", p_add_line_item_reduction_value);
|
||||||
form.append("order_line_montant_reduction", p_add_line_item_reduction_total_amount);
|
form.append("order_line_montant_reduction", String(total_reduction));
|
||||||
form.append("order_line_montant_hors_taxes", p_add_line_item_total_amount_ht);
|
form.append("order_line_montant_hors_taxes", String(total_base1));
|
||||||
|
|
||||||
|
form.append("order_line_taux_taxe", partner_taux_tva);
|
||||||
|
|
||||||
form.append("order_line_tax", p_add_line_item_taxe);
|
form.append("order_line_tax", p_add_line_item_taxe);
|
||||||
form.append("order_line_tax_amount", p_add_line_item_taxe_amount);
|
form.append("order_line_tax_amount", String(montant_taxe_tva));
|
||||||
form.append("order_line_montant_toutes_taxes", p_add_line_item_total_amount_ttc);
|
form.append("order_line_montant_toutes_taxes", String(montant_ttc));
|
||||||
|
|
||||||
if (p_add_line_session_id && String(p_add_line_session_id).length > 2)
|
if (p_add_line_session_id && String(p_add_line_session_id).length > 2)
|
||||||
form.append("order_line_session_id", p_add_line_session_id);
|
form.append("order_line_session_id", p_add_line_session_id);
|
||||||
|
@ -2748,7 +2821,7 @@ const Partner_Commande = (props) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//onsole.log("### form = ", form);
|
console.log("### form = ", form);
|
||||||
|
|
||||||
|
|
||||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Order_Line/";
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Order_Line/";
|
||||||
|
@ -2844,6 +2917,8 @@ const Partner_Commande = (props) => {
|
||||||
setp_add_line_item_taxe_amount("");
|
setp_add_line_item_taxe_amount("");
|
||||||
setp_add_line_item_total_amount_ttc("");
|
setp_add_line_item_total_amount_ttc("");
|
||||||
|
|
||||||
|
setpartner_taux_tva("20");
|
||||||
|
|
||||||
setselected_order_line_id("");
|
setselected_order_line_id("");
|
||||||
|
|
||||||
setp_add_line_item_status(p_detail_header_statut);
|
setp_add_line_item_status(p_detail_header_statut);
|
||||||
|
@ -3217,11 +3292,13 @@ const Partner_Commande = (props) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//console.log(" ### qty = ", qty, " ### unit_price = ", unit_price, " ### total_base1 = ", total_base1, " ### total_reduction = ", total_reduction, " ### reduct_value = ", reduct_value);
|
console.log(" #### partner_taux_tva = ", partner_taux_tva, " ### qty = ", qty, " ### unit_price = ", unit_price, " ### total_base1 = ", total_base1, " ### total_reduction = ", total_reduction, " ### reduct_value = ", reduct_value);
|
||||||
|
|
||||||
var montant_taxe_tva = ((total_base1 - total_reduction) * [parseFloat(String(partner_taux_tva)) / 100]).toFixed(2);
|
var montant_taxe_tva = ((total_base1 - total_reduction) * [parseFloat(String(partner_taux_tva)) / 100]).toFixed(2);
|
||||||
var montant_ttc = ((total_base1 - total_reduction) * (1 + [parseFloat(String(partner_taux_tva)) / 100])).toFixed(2); //(total_base2 + montant_taxe_tva).toFixed(2);
|
var montant_ttc = ((total_base1 - total_reduction) * (1 + [parseFloat(String(partner_taux_tva)) / 100])).toFixed(2); //(total_base2 + montant_taxe_tva).toFixed(2);
|
||||||
|
|
||||||
|
console.log(" #### montant_taxe_tva = ", montant_taxe_tva, " ### montant_ttc = ", montant_ttc);
|
||||||
|
|
||||||
setp_add_line_item_reduction_total_amount(String(total_reduction));
|
setp_add_line_item_reduction_total_amount(String(total_reduction));
|
||||||
setp_add_line_item_total_amount_ht(String(total_base1));
|
setp_add_line_item_total_amount_ht(String(total_base1));
|
||||||
setp_add_line_item_taxe("tva");
|
setp_add_line_item_taxe("tva");
|
||||||
|
@ -4504,6 +4581,7 @@ const Partner_Commande = (props) => {
|
||||||
|
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setpartner_taux_tva(e.target.value);
|
setpartner_taux_tva(e.target.value);
|
||||||
|
Recalcul_Item_Amounts();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4668,7 +4746,7 @@ const Partner_Commande = (props) => {
|
||||||
|
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setpartner_taux_tva(e.target.value);
|
setpartner_taux_tva(e.target.value);
|
||||||
|
Recalcul_Item_Amounts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4849,7 +4927,12 @@ const Partner_Commande = (props) => {
|
||||||
|
|
||||||
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="div_row">
|
{String(p_detail_header_statut_label).toLowerCase() !== "facturé" && <div className="div_row">
|
||||||
<div className="div_row_gauche">
|
<div className="div_row_gauche">
|
||||||
<Button onClick={Update_Dialog_Detail_Article_open} className="bton_enreg_dialog">Mettre à jour</Button>
|
<Button onClick={(event) => {
|
||||||
|
Recalcul_Item_Amounts();
|
||||||
|
Update_Dialog_Detail_Article_open();
|
||||||
|
|
||||||
|
}}
|
||||||
|
className="bton_enreg_dialog">Mettre à jour</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||||
<Button onClick={Close_Dialog_Detail_Article_open} className="bton_annule_dialog" >Annuler</Button>
|
<Button onClick={Close_Dialog_Detail_Article_open} className="bton_annule_dialog" >Annuler</Button>
|
||||||
|
@ -6746,7 +6829,7 @@ const Partner_Commande = (props) => {
|
||||||
String(p_detail_header_statut_label).toLowerCase() === "traité" &&
|
String(p_detail_header_statut_label).toLowerCase() === "traité" &&
|
||||||
<Button variant="outlined" onClick={Invoice_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Facturer </Button>}
|
<Button variant="outlined" onClick={Invoice_Order_Data} className="detail_class_submenu bton_add_sous_menu_cmd_gauche"> Facturer </Button>}
|
||||||
|
|
||||||
|
|
||||||
{String(selected_order_header_type) === "devis" &&
|
{String(selected_order_header_type) === "devis" &&
|
||||||
(String(p_detail_header_statut_label).toLowerCase().trim() === "en cours" || String(p_detail_header_statut_label).toLowerCase().trim() === "gagné") &&
|
(String(p_detail_header_statut_label).toLowerCase().trim() === "en cours" || String(p_detail_header_statut_label).toLowerCase().trim() === "gagné") &&
|
||||||
String(p_detail_header_order_header_ref_interne) === "" &&
|
String(p_detail_header_order_header_ref_interne) === "" &&
|
||||||
|
@ -7027,6 +7110,12 @@ const Partner_Commande = (props) => {
|
||||||
order_line_type_article: JSON.parse(item).order_line_type_article,
|
order_line_type_article: JSON.parse(item).order_line_type_article,
|
||||||
order_line_montant_hors_taxes: JSON.parse(item).order_line_montant_hors_taxes,
|
order_line_montant_hors_taxes: JSON.parse(item).order_line_montant_hors_taxes,
|
||||||
related_order_internal_ref: JSON.parse(item).related_order_internal_ref,
|
related_order_internal_ref: JSON.parse(item).related_order_internal_ref,
|
||||||
|
|
||||||
|
order_line_tax_amount: JSON.parse(item).order_line_tax_amount,
|
||||||
|
order_line_montant_toutes_taxes: JSON.parse(item).order_line_montant_toutes_taxes,
|
||||||
|
|
||||||
|
order_line_taux_taxe: JSON.parse(item).order_line_taux_taxe,
|
||||||
|
|
||||||
}
|
}
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|
|
@ -4114,11 +4114,7 @@ const Partner_Facture = (props) => {
|
||||||
{String(header_submenu) !== "paiement" && <div className="session_data" >
|
{String(header_submenu) !== "paiement" && <div className="session_data" >
|
||||||
|
|
||||||
<div style={{ "border": "None" }}>
|
<div style={{ "border": "None" }}>
|
||||||
<nav onClick={"Ajouter_une_ligne_article"} style={{ "fontSize": "18px", "fontWeight": '600', "marginLeft": "10px", "marginTop": "10px", "cursor": "pointer" }}> <Button> Ajouter une annotation
|
|
||||||
|
|
||||||
</Button>
|
|
||||||
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
|
||||||
</nav>
|
|
||||||
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
|
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
|
|
Loading…
Reference in New Issue