' Copyright (C) 2025  P4pillon.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as
' published by the Free Software Foundation, either version 3 of the
' License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program.  If not, see <https://www.gnu.org/licenses/>.
Public Class Commandes_PharmaML2

    Public List_Désignation As List(Of String)
    Public List_Code As List(Of String)
    Public List_Vendus As List(Of Integer)
    'Public List_Stock As List(Of Integer)
    Public List_Commande As List(Of Integer)



    Private Sub Recherche_Actes(ByVal NbrHeure As Integer)

        List_Désignation = New List(Of String)
        List_Code = New List(Of String)
        List_Vendus = New List(Of Integer)
        List_Commande = New List(Of Integer)
        Dim Actes = BDD.ActesTableAdapter.GetDataBy_Date_Sup(DateAdd(DateInterval.Hour, CDbl(Heure_TextBox.Text) * (-1), Now))
        For r = 0 To Actes.Rows.Count - 1
            If Actes(r).EAN13 <> "" Then
                If Not List_Code.Contains(Actes(r).EAN13) Then
                    List_Désignation.Add(Actes(r).Désignation)
                    List_Code.Add(Actes(r).EAN13)
                    List_Vendus.Add(CInt(Actes(r).Quantité))
                    List_Commande.Add(0)

                End If
            End If
        Next

    End Sub

End Class