#AutoIt3Wrapper_UseUpx=n #include Opt("GUIOnEventMode", 1) $ouvrirou = FileOpenDialog("Ouvrir ou :",@ScriptDir & "\data","Fiche SAV(*.fsav)") If @error then Exit EndIf $gui = GUICreate("Ethnel-SAV :: Création de fiche", 820, 600, -1, -1,-1,0x00000080) GUISetOnEvent($GUI_EVENT_CLOSE, "quitter") $l1 = GUICtrlCreateLabel("Nom : ", 32, 24, 35, 17) $l2 = GUICtrlCreateLabel("Prénom :", 32, 48, 46, 17) $l3 = GUICtrlCreateLabel("Adresse :", 32, 80, 48, 17) $l4 = GUICtrlCreateLabel("Téléphone", 32, 176, 55, 17) $l5 = GUICtrlCreateLabel("Fax :", 32, 200, 27, 17) $l6 = GUICtrlCreateLabel("Lieu intervention :", 512, 24, 88, 17) $l7 = GUICtrlCreateLabel("Type de panne :", 512, 176, 82, 17) $l8 = GUICtrlCreateLabel("Mode de paiment", 512, 272, 86, 17) $l9 = GUICtrlCreateLabel("Date intervention :", 512, 48, 91, 17) $l10 = GUICtrlCreateLabel("Marque :", 512, 200, 46, 17) $l11 = GUICtrlCreateLabel("Prix déplacement :", 512, 296, 91, 17) $l12 = GUICtrlCreateLabel("Prix intervention :", 512, 320, 85, 17) $l13 = GUICtrlCreateLabel("Total TTC :", 512, 344, 58, 17) $l14 = GUICtrlCreateLabel("Type de PC :", 512, 152, 66, 17) $l15 = GUICtrlCreateLabel("Description de la panne :", 32, 272, 122, 17) $l16 = GUICtrlCreateLabel("Ville :", 232, 200, 29, 17) $l17 = GUICtrlCreateLabel("Code poste :", 232, 176, 64, 17) $l18 = GUICtrlCreateLabel(IniRead($ouvrirou,"Fiche SAV","total",""), 616, 344, 100, 17) $l19 = GUICtrlCreateLabel("Technicien :", 512, 72, 63, 17) $l20 = GUICtrlCreateLabel("ID :", 320, 24, 20, 17) $e1 = GUICtrlCreateEdit(StringReplace(IniRead($ouvrirou,"Fiche SAV","adresse",""),"@CRLF",@CRLF), 96, 80, 321, 89) $e2 = GUICtrlCreateEdit(StringReplace(IniRead($ouvrirou,"Fiche SAV","panne",""),"@CRLF",@CRLF), 32, 288, 433, 289) $i1 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","nom",""), 96, 24, 200, 21) $i2 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","prenom",""), 96, 48, 321, 21) $i3 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","telephone",""), 96, 176, 121, 21) $i4 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","fax",""), 96, 200, 121, 21) $i5 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","codep",""), 296, 176, 121, 21) $i6 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","ville",""), 264, 200, 153, 21) $i7 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","date",""), 608, 48, 177, 21) $i8 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","marque",""), 616, 200, 169, 21) $i9 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","prixdep",""), 616, 296, 169, 21) $i10 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","prixint",""), 616, 320, 169, 21) $i11 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","technicien",""), 608, 72, 177, 21) $i12 = GUICtrlCreateInput(IniRead($ouvrirou,"Fiche SAV","id",""), 340, 24, 77, 21) $g1 = GUICtrlCreateGroup("Information", 8, 8, 417, 225) $g2 = GUICtrlCreateGroup("Lieu et date", 488, 8, 305, 97) $g3 = GUICtrlCreateGroup("Info PC", 488, 136, 305, 97) $g4 = GUICtrlCreateGroup("Info panne", 8, 256, 465, 337) $g5 = GUICtrlCreateGroup("Facture", 488, 256, 313, 145) $c1 = GUICtrlCreateCombo(IniRead($ouvrirou,"Fiche SAV","lieu",""), 608, 24, 177, 25) GUICtrlSetData(-1,"En Atelier|Chez le client|Autre : ") $c2 = GUICtrlCreateCombo(IniRead($ouvrirou,"Fiche SAV","typepanne",""), 616, 176, 169, 25) GUICtrlSetData(-1,"Logiciel|Matériel|Autre : ") $c3 = GUICtrlCreateCombo(IniRead($ouvrirou,"Fiche SAV","modep",""), 616, 272, 169, 25) GUICtrlSetData(-1,"Chèque|Carte bleue|Espèce|Autre : ") $c4 = GUICtrlCreateCombo(IniRead($ouvrirou,"Fiche SAV","typepc",""), 616, 152, 169, 25) GUICtrlSetData(-1,"PC Fixe|PC portable|Autre : ") $b1 = GUICtrlCreateButton("Calculer", 616, 368, 171, 25, 0) GUICtrlSetOnEvent(-1, "calculer") $b2 = GUICtrlCreateButton("Sauvegarder", 488, 424, 315, 73, 0) GUICtrlSetOnEvent(-1, "sauvegarder") $b3 = GUICtrlCreateButton("Quitter", 488, 512, 315, 73, 0) GUICtrlSetOnEvent(-1, "quitter") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func quitter() Exit EndFunc Func calculer() $total = GUICtrlRead($i9) + GUICtrlRead($i10) $totalttc1 = $total * 19.6 $totalttc2 = $totalttc1 / 100 $totalttc3 = $totalttc2 + $total GUICtrlSetData($l18,$totalttc3 & " €") EndFunc Func sauvegarder() ;; $saveou = FileSaveDialog("Sauvegarder ou :",@ScriptDir & "\data\en attente","Fiche SAV(*.fsav)") If not @error then IniWrite($ouvrirou,"Fiche SAV","id",GUICtrlRead($i12)) IniWrite($ouvrirou,"Fiche SAV","nom",GUICtrlRead($i1)) IniWrite($ouvrirou,"Fiche SAV","prenom",GUICtrlRead($i2)) IniWrite($ouvrirou,"Fiche SAV","adresse",StringReplace(GUICtrlRead($e1),@CRLF,"@CRLF")) IniWrite($ouvrirou,"Fiche SAV","telephone",GUICtrlRead($i3)) IniWrite($ouvrirou,"Fiche SAV","fax",GUICtrlRead($i4)) IniWrite($ouvrirou,"Fiche SAV","codep",GUICtrlRead($i5)) IniWrite($ouvrirou,"Fiche SAV","ville",GUICtrlRead($i6)) IniWrite($ouvrirou,"Fiche SAV","lieu",GUICtrlRead($c1)) IniWrite($ouvrirou,"Fiche SAV","date",GUICtrlRead($i7)) IniWrite($ouvrirou,"Fiche SAV","technicien",GUICtrlRead($i11)) IniWrite($ouvrirou,"Fiche SAV","typepc",GUICtrlRead($c4)) IniWrite($ouvrirou,"Fiche SAV","typepanne",GUICtrlRead($c2)) IniWrite($ouvrirou,"Fiche SAV","marque",GUICtrlRead($i8)) IniWrite($ouvrirou,"Fiche SAV","panne",StringReplace(GUICtrlRead($e2),@CRLF,"@CRLF")) IniWrite($ouvrirou,"Fiche SAV","modep",GUICtrlRead($c3)) IniWrite($ouvrirou,"Fiche SAV","prixdep",GUICtrlRead($i9)) IniWrite($ouvrirou,"Fiche SAV","prixint",GUICtrlRead($i10)) IniWrite($ouvrirou,"Fiche SAV","total",GUICtrlRead($l18)) EndIf EndFunc