اذهب الي المحتوي
أوفيسنا

تعديل فى رصيد المخزون بناء على المخزن


الردود الموصى بها

صباح الخير

هذا الكود لايحدث المخزون بالقيمة الصحيحة فما الخطاء هنا

Private Sub valid_vente_Click() 'valider vente
On Error Resume Next
 Dim i As Integer, lig As Long, rep As Byte
 If Me.OptionButton1 = False And Me.OptionButton2 = False And Me.OptionButton3 = False Then
   rep = MsgBox("Vous n'avez oas choisi de moyen de paiement", vbCritical, "Contrôle")
   Exit Sub
 End If
 If Me.Total_vente = "" Then Exit Sub
 'effacer facture
 Sheets("Facture").Range("F2:f6").ClearContents
 Sheets("Facture").Range("A11:E46").ClearContents
 Sheets("Facture").Range("B8,E8").ClearContents
 Sheets("Facture").Range("B8").Value = Year(Date) & "-" & Format(Sheets("Facture").Range("L1").Value + 1, "0000")
 Sheets("Facture").Range("L1").Value = Sheets("Facture").Range("L1").Value + 1 'N° Facture
 Sheets("Facture").Range("E8").Value = Date 'date
 Sheets("Facture").Range("F2").Value = Me.nom_vente.Value
 If Me.nom_vente <> "" Then
  Sheets("Facture").Range("F3").Value = [Client].Item(Me.nom_vente.Column(0), 3)
  Sheets("Facture").Range("F4").Value = [Client].Item(Me.nom_vente.Column(0), 4)
  Sheets("Facture").Range("F5").Value = [Client].Item(Me.nom_vente.Column(0), 5)
  Sheets("Facture").Range("F6").Value = [Client].Item(Me.nom_vente.Column(0), 6)
 End If
 For i = 0 To ListBox1.ListCount - 1
   Sheets("Facture").Range("A" & 11 + i) = Me.ListBox1.List(i, 1) 'Rayon
   Sheets("Facture").Range("B" & 11 + i) = Me.ListBox1.List(i, 2) 'article
   Sheets("Facture").Range("E" & 11 + i) = Me.ListBox1.List(i, 4) 'tva
   Sheets("Facture").Range("D" & 11 + i) = Me.ListBox1.List(i, 6) 'prix de vente
   Sheets("Facture").Range("C" & 11 + i) = Me.ListBox1.List(i, 5) 'quantité
   Sheets("Facture").Range("G47") = CDbl(Me.Remise)
 'mettre a jour mouvement et stock
    If [Mouvement].Item(1, 1) = "" Then lig = 1 Else lig = [Mouvement].Rows.Count + 1
    [Mouvement].Item(lig, 1) = Me.ListBox1.List(i, 1) 'Rayon
    [Mouvement].Item(lig, 2) = Me.ListBox1.List(i, 2) 'article
    [Mouvement].Item(lig, 4) = Me.ListBox1.List(i, 5) 'quantite
    [Mouvement].Item(lig, 5) = Date
    [Mouvement].Item(lig, 7) = "Vente " & Me.nom_vente.Value
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''      
[Produits].Item(CLng(CInt(Me.ListBox1.List(i, 0))), 4) = [Produits].Item(CLng(CInt(Me.ListBox1.List(i, 6))), 4) - [Mouvement].Item(lig, 4)
[Mouvement].Item(lig, 6) = [Produits].Item(CLng(Me.ListBox1.List(i, 0)), 4)

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''  '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''     
 Next i
 If Me.OptionButton1 = True Then [Mouvement].Item(lig, 8) = Me.OptionButton1.Caption
 If Me.OptionButton2 = True Then [Mouvement].Item(lig, 8) = Me.OptionButton2.Caption
 If Me.OptionButton3 = True Then [Mouvement].Item(lig, 8) = Me.OptionButton3.Caption
 [Mouvement].Item(lig, 10) = ComboBox4
 [Mouvement].Item(lig, 9) = CDbl(Me.Total_vente)
  Me.facture.Visible = True
 rep = MsgBox("Cliquez sur Facture, Nouveau ou Quitter", vbOKOnly, "Vente enregistrée.")
 End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   
'اريد اضيف خيار ثالث يشمل اسم المخزن
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''      
[Produits].Item(CLng(CInt(Me.ListBox1.List(i, 0))), 4) = [Produits].Item(CLng(CInt(Me.ListBox1.List(i, 6))), 4) - [Mouvement].Item(lig, 4)
[Mouvement].Item(lig, 6) = [Produits].Item(CLng(Me.ListBox1.List(i, 0)), 4)

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''  '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''     

مخزن.xlsm

تم تعديل بواسطه mahmoud nasr alhasany
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information