1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
Option Explicit
Dim i As Long
Private Sub ajout_Click()
Dim t
'venant de DARANC du forum developpez
Dim tva7 As Double
Dim tva196 As Double
On Error Resume Next
If cbotva.Value = 7 Then
OptionButton1.Visible = True
If TextBox17.Value = "" Then
TextBox17.Value = TextBox8.Value * Txt_qté_vente.Value * 0.07
Else
TextBox17.Value = CDbl(TextBox17.Value) + TextBox8.Value * Txt_qté_vente.Value * 0.07
End If
Else
If TextBox18.Value = "" Then
TextBox18.Value = TextBox8.Value * Txt_qté_vente.Value * 0.196
Else
TextBox18.Value = CDbl(TextBox18.Value) + TextBox8.Value * Txt_qté_vente.Value * 0.196
End If
End If
If TextBox17.Value = "" Then
tva7 = 0
Else
tva7 = CDbl(TextBox17.Value)
End If
If TextBox18.Value = "" Then
tva196 = 0
Else
tva196 = CDbl(TextBox18.Value)
End If
TextBox13.Value = tva7 + tva196
TextBox15.Value = CDbl(TextBox13.Value) + CDbl(TextBox12.Value)
With UserForm1.ListView1
.listitems.Add , , UserForm1.TextBox2.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.TextBox9.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.TextBox6.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.TextBox7.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.Txt_qté_vente.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.TextBox8.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.cbotva.Value
.listitems(.listitems.Count).ListSubItems.Add , , UserForm1.TextBox8.Value * Txt_qté_vente.Value
.listitems(1).Selected = False
Set .SelectedItem = Nothing
For i = 1 To .listitems.Count
t = t + CDbl(.listitems(i).ListSubItems(7))
Next i
End With
TextBox12 = Format(t, "0.00")
TextBox13 = Format(TextBox13, "0.00")
TextBox15 = Format(TextBox15, "0.00")
TextBox17 = Format(TextBox17, "0.00")
TextBox18 = Format(TextBox18, "0.00")
TextBox6 = "": TextBox7 = "": Txt_qté_vente = "": TextBox2 = "": TextBox4 = "": TextBox8 = ""
End Sub |
Partager