{
    "idDS": "Doc_Num",
    "TableRE": "docCmd&param=CMD",
    "Webformgroup": null,
    "DS": "DS_Doc_CMD",
    "Titre": "Bon de commande",
    "id": "CMD",
    "U_timestamp": [
        0,
        0,
        0,
        0,
        0,
        87,
        145,
        249
    ],
    "pieceJoint": true,
    "TitreOnglet": null,
    "Drawer": false,
    "Onglet": false,
    "SubTitle": "Bon de commande",
    "Detail": null,
    "TableRE_Detail": null,
    "Config": {
        "type": "div",
        "class": "",
        "buttons": [
            {
                "name": "Article",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "icon": "far fa-newspaper",
                "dynamicBtn": true
            },
            {
                "name": "Email",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "icon": "fas fa-envelope",
                "dynamicBtn": true,
                "onClick": "DV_Email"
            },
            {
                "name": "Copier document",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true
            },
            {
                "name": "Generer CMA",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true
            },
            {
                "name": "Ajouter articles",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true,
                "onClick": "Doc_openModalAddArticles"
            },
            {
                "name": "Frais d'approche",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true,
                "onClick": "Doc_openModalFraisApproche"
            },
            {
                "name": "Remise",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true,
                "onClick": "Doc_openModalRemise"
            },
            {
                "name": "Réservation",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true
            },
            {
                "name": "Acompte",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-pink-600 hover:border-pink-600 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true
            },
            {
                "name": "BL",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-orange-700 hover:border-orange-700 hover:text-white transition",
                "visible": true,
                "fonction": "calc",
                "dynamicBtn": true
            },
            {
                "name": "Valider",
                "style": "flex items-center gap-1 h-8 px-3 text-xs font-medium rounded-md border border-gray-500 text-gray-600 hover:bg-green-500 hover:border-green-500 hover:text-white transition",
                "visible": true,
                "fonction": "valider",
                "icon": "fas fa-check",
                "dynamicBtn": true
            }
        ],
        "children": [
            {
                "type": "tab",
                "width": "12",
                "children": [
                    {
                        "label": "Général",
                        "children": [
                            {
                                "type": "div",
                                "width": "12",
                                "children": [
                                    {
                                        "label": "Attention ! Vérifier les commentaires du client",
                                        "type": "span",
                                        "width": "12",
                                        "class_label": "hidden bg-red-200 text-red-800 p-2 rounded-md",
                                        "champs": "msg_commentaireClients",
                                        "table": "msg"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Num",
                                        "label": "Num",
                                        "type": "Input",
                                        "width": "2",
                                        "readonly": "true"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Date",
                                        "label": "Date",
                                        "type": "date",
                                        "width": "2"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_DateP",
                                        "label": "Date Exp.souhaitée",
                                        "type": "date",
                                        "width": "2"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Tiers_code",
                                        "label": "Client",
                                        "type": "search",
                                        "width": "2",
                                        "tableRE_Code": "Client",
                                        "TableRE_ChampRetour": "Tiers_code",
                                        "TableRE_ChampRetourAffichage": "Tiers_RS"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Site_Code",
                                        "label": "Magasin",
                                        "type": "search",
                                        "width": "2",
                                        "tableRE_Code": "SITES",
                                        "TableRE_ChampRetour": "Site_Code",
                                        "TableRE_ChampRetourAffichage": "Site_Des",
                                        "onValidate": "Doc_openModalModifierSiteLignes"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Ref",
                                        "label": "Réf",
                                        "type": "Input",
                                        "width": "2"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_RS",
                                        "label": "Nom client",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Tiers_Adresse1",
                                        "label": "Adresse 1",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Tiers_Adresse2",
                                        "label": "Adresse 2",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Tiers_CP",
                                        "label": "CP",
                                        "type": "search",
                                        "width": "1",
                                        "tableRE_Code": "API_CodePostal",
                                        "TableRE_ChampRetour": "id",
                                        "TableRE_ChampRetourAffichage": "XCodePostal_Code"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Tiers_Ville",
                                        "label": "Ville",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "API_CodePostal",
                                        "TableRE_ChampRetour": "id",
                                        "TableRE_ChampRetourAffichage": "XCodePostal_Libelle"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Tiers_TiersC_Id",
                                        "label": "N° contact",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "TiersC",
                                        "TableRE_ChampRetour": "TiersC_Id",
                                        "TableRE_ChampRetourAffichage": "TiersC_Id",
                                        "TableRE_Filter": "\"Tiers_code = '\" + ds['Document'][0]['Tiers_code'] + \"'\"",
                                        "children": []
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "xCMD_urgent",
                                        "label": "Commande urgente",
                                        "type": "checkbox",
                                        "width": "1"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xBPPrinted",
                                        "label": "BP Imprimé",
                                        "type": "checkbox",
                                        "width": "1"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Valide",
                                        "label": "Statut",
                                        "type": "search",
                                        "width": "1",
                                        "tableRE_Code": "DiverSys&param=cmd",
                                        "TableRE_ChampRetour": "DiverSys_Index",
                                        "TableRE_ChampRetourAffichage": "DiverSys_Libelle"
                                    },
                                    {
                                        "type": "table",
                                        "width": "12",
                                        "table": "DocumentD",
                                        "ds": "DocumentD",
                                        "idDS": "DocD_Id",
                                        "contextMenu": [
                                            {
                                                "label": "Kit",
                                                "shortcut": "F2",
                                                "action": "OPEN_MODAL",
                                                "configId": "table-kit",
                                                "filter": "item.DocD_Lien == ds['DocumentD'][activeRows['table1']]['DocD_Lien'] && item.DocD_ArtType == 2",
                                                "defaultValues": {
                                                    "DocD_ArtType": 2,
                                                    "DocD_Lien": "ds['DocumentD'][activeRows['table1']]['DocD_Lien']"
                                                }
                                            }
                                        ],
                                      "children": [
                                        {
                                          "table": "DocumentD",
                                          "champs": "Art_Code",
                                          "label": "Code",
                                          "type": "search",
                                          "width": 100,
                                          "tableRE_Code": "Article",
                                          "TableRE_ChampRetour": "Art_Code",
                                          "TableRE_ChampRetourAffichage": "Art_Code"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "Art_Des",
                                          "label": "Désignation",
                                          "type": "Input",
                                          "width": 200,
                                          "class": "text-red-500"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xDivers",
                                          "label": "Divers",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_Q",
                                          "label": "Qté",
                                          "type": "Input",
                                          "width": "40"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_Unite",
                                          "label": "Unité",
                                          "type": "search",
                                          "width": "60",
                                          "tableRE_Code": "Unit",
                                          "TableRE_ChampRetourAffichage": "Unit_Code",
                                          "TableRE_ChampRetour": "Unit_Code"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_PUHTB",
                                          "label": "PV brut ",
                                          "type": "Input",
                                          "width": 90,
                                          "class_wrapper": "bg-stone-200"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_TxRem1",
                                          "label": "R 1",
                                          "type": "Input",
                                          "width": "40",
                                          "class_wrapper": "bg-[#B4C6E7]"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_TxRem",
                                          "label": "R 2",
                                          "type": "Input",
                                          "width": "40",
                                          "class_wrapper": "bg-[#B4C6E7]"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_PUHTN",
                                          "label": "PV net",
                                          "type": "Input",
                                          "width": 90,
                                          "class_wrapper": "bg-lime-400"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xPUHTNArticle",
                                          "label": "PU Article",
                                          "type": "Input",
                                          "width": 90,
                                          "readonly": "false"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xFAUnitVente",
                                          "label": "FA Net Unit",
                                          "type": "Input",
                                          "width": 90,
                                          "readonly": "true"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xFDUnitVente",
                                          "label": "FD Net Unit",
                                          "type": "Input",
                                          "width": 90,
                                          "readonly": "true"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_THT",
                                          "label": "Montant HT Ligne",
                                          "type": "Input",
                                          "width": 90,
                                          "class_wrapper": "bg-[#B4C6E7]",
                                          "readonly": "true"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_TxTVA",
                                          "label": "Taux TVA",
                                          "type": "search",
                                          "width": 40,
                                          "tableRE_Code": "TVA",
                                          "TableRE_ChampRetour": "TVA_Code",
                                          "TableRE_ChampRetourAffichage": "TVA_Taux"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "QStock",
                                          "label": "Qté Dispo",
                                          "type": "Input",
                                          "width": 100,
                                          "readonly": "true"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "Site_Code",
                                          "label": "Magasin",
                                          "type": "search",
                                          "width": 80,
                                          "tableRE_Code": "SITES",
                                          "TableRE_ChampRetour": "Site_Code",
                                          "TableRE_ChampRetourAffichage": "Site_Code"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XProcedureAchat",
                                          "label": "Proc. Achat",
                                          "type": "select",
                                          "width": "100",
                                          "param": "PROCACH"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xaffichePrixNet",
                                          "label": "Affiche Prix Net",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xBlocage_Conditions",
                                          "label": "Blocage Condition",
                                          "type": "checkbox",
                                          "width": 100
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XCommentaire",
                                          "label": "Commentaire",
                                          "type": "Input",
                                          "width": 160
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xCommentaire_BL",
                                          "label": "Commentaire BL",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xCommentaire_CMD",
                                          "label": "Commentaire Commande",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xCommentaire_FACT",
                                          "label": "Commentaire Facture",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xTypeDelai",
                                          "label": "Type délai",
                                          "type": "select",
                                          "param": "TypeDelai",
                                          "width": 100
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XDateLiv",
                                          "label": "Délai",
                                          "type": "date",
                                          "width": 100
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xDocD_FraisPort",
                                          "label": "Frais Port",
                                          "type": "Input",
                                          "width": 100,
                                          "class_wrapper": "bg-[#B4C6E7]",
                                          "readonly": "true"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xgratuit",
                                          "label": "Gratuit",
                                          "type": "checkbox",
                                          "width": 60
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "xMotif_gratuite",
                                          "label": "Motif de Gratuité",
                                          "type": "Input",
                                          "width": 160
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XLigneComplete",
                                          "label": "Ligne complète",
                                          "type": "checkbox",
                                          "width": 90
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XProcedureAchat",
                                          "label": "Procédure Achat",
                                          "type": "checkbox",
                                          "width": 90,
                                          "tableRE_Code": "5555",
                                          "children": []
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "XStockReserve",
                                          "label": "Quantité reservée",
                                          "type": "Input",
                                          "width": 100
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "DocD_xFraisApproche",
                                          "label": "frais d'approche",
                                          "type": "decimal",
                                          "width": "100"
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "Date_Create",
                                          "label": "Date de création",
                                          "type": "date",
                                          "width": 200,
                                          "readonly": true
                                        },
                                        {
                                          "table": "DocumentD",
                                          "champs": "Date_Modif",
                                          "label": "Date de modification",
                                          "type": "date",
                                          "width": 200,
                                          "readonly": true
                                        }
                                      ],
                                        "id": "table1"
                                    },
                                    {
                                        "type": "table",
                                        "table": "DocumentD",
                                        "width": "12",
                                        "ds": "DocumentD",
                                        "idDS": "DocD_Id",
                                        "children": [
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_Fournisseur",
                                                "label": "Fournisseur",
                                                "type": "search",
                                                "width": 100,
                                                "tableRE_Code": "FOURNISSEUR",
                                                "TableRE_ChampRetour": "Tiers_code",
                                                "TableRE_ChampRetourAffichage": "Tiers_code",
                                                "class_input": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_UniteAchat",
                                                "label": "Unité Achat",
                                                "type": "search",
                                                "width": 60,
                                                "tableRE_Code": "Unit",
                                                "class_input": "bg-yellow-300",
                                                "TableRE_ChampRetour": "Unit_Code",
                                                "TableRE_ChampRetourAffichage": "Unit_Code"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_RefFour",
                                                "label": "Ref",
                                                "type": "Input",
                                                "width": 100,
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "XInfoAchat",
                                                "label": "Info Achat",
                                                "type": "Input",
                                                "width": 100,
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xMargeProduit",
                                                "label": "M Pdt %",
                                                "type": "Input",
                                                "width": "70",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xMargeFA",
                                                "label": "M FA %",
                                                "type": "Input",
                                                "width": "70",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xMargeFD",
                                                "label": "M FD %",
                                                "type": "Input",
                                                "width": "70",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xMargeTotale",
                                                "label": "M Total %",
                                                "type": "Input",
                                                "width": "70",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_PUBA",
                                                "label": "Prix achat",
                                                "type": "Input",
                                                "width": "80",
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_RemA",
                                                "label": "Rem1 %",
                                                "type": "Input",
                                                "width": "60",
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_TxRemA1",
                                                "label": "Rem2 %",
                                                "type": "Input",
                                                "width": "60",
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_PUNA",
                                                "label": "PUNA",
                                                "type": "Input",
                                                "width": "80",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xFATotalAchat",
                                                "label": "FA Total",
                                                "type": "Input",
                                                "width": "80",
                                                "class_wrapper": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xFAUnitAchat",
                                                "label": "FA Unit",
                                                "type": "Input",
                                                "width": "80",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xPrixAchatTotalUnitaire",
                                                "label": "P A Total",
                                                "type": "Input",
                                                "width": "80",
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xFDTotalAchat",
                                                "label": "FD Total",
                                                "type": "Input",
                                                "width": "80",
                                                "class_input": "bg-yellow-300"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_Four_FraisDivers",
                                                "label": "Fournisseur Frais Divers",
                                                "type": "search",
                                                "width": 100,
                                                "tableRE_Code": "FOURNISSEUR",
                                                "TableRE_ChampRetour": "Tiers_code",
                                                "TableRE_ChampRetourAffichage": "Tiers_code"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_CoeffFA",
                                                "label": "Coeff FA",
                                                "type": "Input",
                                                "width": 60
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_CoeffFD",
                                                "label": "Coeff FD",
                                                "type": "Input",
                                                "width": 60
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "xDocD_CoeffMarge",
                                                "label": "Coeff Marge",
                                                "type": "Input",
                                                "width": 60
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xCoutUI",
                                                "label": "Coût unitaire initial",
                                                "type": "decimal",
                                                "width": "3"
                                            },
                                            {
                                                "table": "DocumentD",
                                                "champs": "DocD_xMargeLI",
                                                "label": "Marge ligne initiale",
                                                "type": "decimal",
                                                "width": "3"
                                            }
                                        ],
                                        "filter": "item.DocD_PosId == ds['DocumentD'][activeRows['table1']]['DocD_PosId']"
                                    },
                                    {
                                        "type": "div",
                                        "width": "12",
                                        "class": "flex flex-nowrap overflow-auto",
                                        "table": "Document",
                                        "children": [
                                            {
                                                "table": "Document",
                                                "champs": "Doc_THT",
                                                "label": "THT",
                                                "type": "Input",
                                                "width": 2
                                            },
                                            {
                                                "table": "Document",
                                                "champs": "Doc_RemT",
                                                "label": "Remise Globale",
                                                "type": "Input",
                                                "width": 2
                                            },
                                            {
                                                "table": "Document",
                                                "champs": "Doc_TTTC",
                                                "label": "TOTAL NET TTC",
                                                "type": "Input",
                                                "width": 2,
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "Document",
                                                "champs": "xDoc_TotalTHTAchat",
                                                "label": "Total Achat",
                                                "type": "Input",
                                                "width": 2,
                                                "readonly": "true"
                                            },
                                            {
                                                "table": "Document",
                                                "champs": "xDoc_MargeTotale",
                                                "label": "% Marge Cde",
                                                "type": "Input",
                                                "width": "3",
                                                "readonly": "true"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "label": "Facturation",
                        "children": [
                            {
                                "type": "div",
                                "children": [
                                    {
                                        "table": "Document",
                                        "champs": "Devise_Code",
                                        "label": "Devise",
                                        "type": "search",
                                        "width": "2",
                                        "tableRE_Code": "devises",
                                        "TableRE_ChampRetour": "Devise_Code",
                                        "TableRE_ChampRetourAffichage": "Devise_Code"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Devise_Cours",
                                        "label": "Cours",
                                        "type": "Input",
                                        "width": "1"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "ModeReg_Code",
                                        "label": "Mode Paiement",
                                        "type": "search",
                                        "width": "2",
                                        "tableRE_Code": "ModeReg",
                                        "TableRE_ChampRetour": "ModeReg_Code",
                                        "TableRE_ChampRetourAffichage": "ModeReg_Libelle"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xControleFcaturé",
                                        "label": "Controle facturation",
                                        "type": "select",
                                        "width": "2",
                                        "param": "controlFcat"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Code",
                                        "label": "Client facturé",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "Client",
                                        "TableRE_ChampRetour": "Tiers_code",
                                        "TableRE_ChampRetourAffichage": "Tiers_code",
                                        "TableRE_ChampRetourExtra": "{ \"Doc_xClientFact_Nom\" : \"Tiers_RS\", \"Doc_xClientFact_Adresse1\" : \"Tiers_Adresse\", \"Doc_xClientFact_Adresse2\" : \"XAdresse2\", \"Doc_xClientFact_CP\" : \"Tiers_CP\", \"Doc_xClientFact_Ville\" : \"Tiers_Ville\"  }"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Nom",
                                        "label": "Nom",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Adresse1",
                                        "label": "Adresse facturation",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Adresse2",
                                        "label": "Adresse facturation 2",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_CP",
                                        "label": "CP",
                                        "type": "search",
                                        "width": "4",
                                        "tableRE_Code": "API_CodePostal",
                                        "TableRE_ChampRetour": "XCodePostal_Code",
                                        "TableRE_ChampRetourExtra": "{ \"Doc_xClientFact_Ville\" : \"XCodePostal_Libelle\" }"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Ville",
                                        "label": "Ville",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_TiersC_Id",
                                        "label": "N° Contact facturation",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "TiersC",
                                        "TableRE_ChampRetour": "TiersC_Id",
                                        "TableRE_Filter": "\"Tiers_code = '\" + ds['Document'][0]['Doc_xClientFact_Code'] + \"'\"",
                                        "TableRE_ChampRetourExtra": "{ \"Doc_xClientFact_Contact\" : \"TiersC_Nom\" }"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientFact_Contact",
                                        "label": "Contact",
                                        "type": "Input",
                                        "width": "4"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Groupe prix client",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xModeFacturation",
                                        "label": "Mode de facturation",
                                        "type": "select",
                                        "width": "3",
                                        "param": "0111"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xModeExpedition",
                                        "label": "Mode d'expédition",
                                        "type": "select",
                                        "width": "2",
                                        "param": "ModeExp"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Code Agence",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Condition paiement",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Mode de réglement",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Groupe compta. marché",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Groupe rem. client",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    }
                                ],
                                "width": "12"
                            }
                        ]
                    },
                    {
                        "label": "Livraision",
                        "children": [
                            {
                                "type": "div",
                                "children": [
                                    {
                                        "table": "Document",
                                        "champs": "Doc_Param1",
                                        "label": "Transporteur",
                                        "type": "search",
                                        "width": "2",
                                        "tableRE_Code": "Transporteurs",
                                        "TableRE_ChampRetour": "Tiers_code",
                                        "TableRE_ChampRetourAffichage": "Tiers_RS"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Code",
                                        "label": "Code destinataire",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "Client",
                                        "TableRE_ChampRetour": "Tiers_code",
                                        "TableRE_ChampRetourAffichage": "Tiers_code",
                                        "TableRE_ChampRetourExtra": "{ \"Doc_xClientDest_Nom\" : \"Tiers_RS\", \"Doc_xClientDest_Adresse\" : \"Tiers_Adresse\", \"Doc_xClientDest_Adresse2\" : \"XAdresse2\", \"Doc_xClientDest_CP\" : \"Tiers_CP\", \"Doc_xClientDest_Ville\" : \"Tiers_Ville\"  }"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Nom",
                                        "label": "Nom du destinataire",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Adresse",
                                        "label": "Adresse destinataire",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Adresse2",
                                        "label": "Adresse destinataire 2",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_CP",
                                        "label": "CP",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "API_CodePostal",
                                        "TableRE_ChampRetour": "XCodePostal_Code",
                                        "TableRE_ChampRetourAffichage": "",
                                        "TableRE_ChampRetourExtra": "{ \"Doc_xClientDest_Ville\" : \"XCodePostal_Libelle\" }"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Ville",
                                        "label": "Ville",
                                        "type": "Input",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "Doc_xClientDest_Contact",
                                        "label": "Contact destinataire",
                                        "type": "Input",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Date livraison demandée",
                                        "type": "date",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Affichage prix net",
                                        "type": "checkbox",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": "",
                                        "width": 0
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Port Usine",
                                        "type": "Input",
                                        "width": "2"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Code magasin",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": "",
                                        "children": []
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Code transporteur",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Code condition livraison",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Date de préparation",
                                        "type": "date",
                                        "width": "3"
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Code Agence",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Groupe prix client",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Client modèle remise",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    },
                                    {
                                        "table": "Document",
                                        "champs": "",
                                        "label": "Client modèle tarif",
                                        "type": "search",
                                        "width": "3",
                                        "tableRE_Code": "",
                                        "TableRE_ChampRetour": "",
                                        "TableRE_ChampRetourAffichage": ""
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "label": "Commentaires",
                        "children": [
                            {
                                "type": "table",
                                "table": "xDocCommentaires",
                                "width": "12",
                                "children": [
                                    {
                                        "table": "xDocCommentaires",
                                        "champs": "Date_Create",
                                        "label": "Date",
                                        "type": "date",
                                        "width": "100",
                                        "readonly": "true"
                                    },
                                    {
                                        "type": "Input",
                                        "width": "200",
                                        "table": "xDocCommentaires",
                                        "label": "Commenatires",
                                        "champs": "xCommentaire"
                                    },
                                    {
                                        "table": "xDocCommentaires",
                                        "champs": "User_Id_Create",
                                        "label": "Créé par",
                                        "type": "Input",
                                        "width": "100",
                                        "readonly": "true"
                                    }
                                ],
                                "ds": "xDocCommentaires",
                                "idDS": "xDocComm_Id"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "Table_Name": "Document"
}