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
| Private Sub Ajouter_Click()
Text1.SetFocus
If Text1 = "" Then
MsgBox "Veuillez un CODE-BARRE avant de continuer.", vbInformation, "Erreur"
Text1.SetFocus
Else
Dim c As Integer
Dim L As Integer
If T_Quachete.Text = 0 Or T_Quachete = "" Then
MsgBox "Veuillez entrer la quantité d'article à vendu.", vbInformation, "Information"
T_Quachete.SetFocus
End If
End If
If Text1.Text <> "" And T_Quachete.Text <> 0 And T_Quachete.Text <> "" And IsNumeric(Text1.Text) = True Then
Loop
'C = Flex.Cols
L = Flex.Rows - 1
Flex.TextMatrix(L, 0) = 1
Flex.TextMatrix(L, 1) = Text1.Text
Flex.TextMatrix(L, 2) = text2.Text
Flex.TextMatrix(L, 3) = text9.Text
Flex.TextMatrix(L, 4) = T_Quachete.Text
Flex.TextMatrix(L, 5) = ((Val(text9))) * ((CSng(T_Quachete.Text)))
Flex.TextMatrix(L, 5) = Replace(Flex.TextMatrix(L, 5), ",", ".")
Flex.TextMatrix(L, 6) = ((Val(Text8))) * ((CSng(T_Quachete.Text)))
Flex.TextMatrix(L, 6) = Replace(Flex.TextMatrix(L, 6), ",", ".")
Flex.TextMatrix(L, 7) = (Text3.Text - Val(Flex.TextMatrix(L, 4)))
Flex.Rows = Flex.Rows + 1
text2.Text = ""
text9.Text = ""
T_Quachete.Text = ""
Else
MsgBox " erreur !!!! ", vbOKOnly
End If
Text1.Text = ""
T_Quachete.Text = 1
For i = 1 To Flex.Rows - 1
cel = Val(Flex.TextMatrix(i, 5))
cel2 = Val(Flex.TextMatrix(i, 6))
s = s + cel
s2 = s2 + cel2
Next i
T_TTC.Text = s
T_achat.Text = s2
T_gains.Text = s - s2
'Text2 = Format(Val(Text3) - Val(Text1), "00.00")
End Sub |
Partager