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
| Dim rst As ADODB.Recordset
Set rst = cnn1.Execute("SELECT v.date_vente, TO_CHAR(v.montant, 'FM999 999 999 999 999 999')||' F CFA' as montant," _
& " v.numero, v.reduction||' %' as reduction, v.soldee," _
& " (u.prenom||' '||u.nom) as Vendeur" _
& " FROM ventes v INNER JOIN utilisateurs u ON v.vendeur = u.numero" _
& " WHERE v.numero=" & id & ";")
If Not rst.EOF Then
With rptDetailVenteDup
.Hide
With .Sections("maitre").Controls
.Item("lblNumero").Caption = rst("numero")
.Item("lblDate").Caption = rst("date_vente")
.Item("lblReduction").Caption = rst("reduction")
.Item("lblMontant").Caption = rst("montant")
End With
End With
rst.Close
Set rst = cnn1.Execute("SELECT p.libelle, vp.quantite, vp.prixVente, vp.numeroVente," _
& " ((1+vp.bic/100::numeric(8, 2))*(1+vp.taxe/100::numeric(8, 2))*(vp.quantite * vp.prixVente)) AS Montant," _
& " vp.taxe/100::numeric(8, 2) as tva, vp.bic/100::numeric(8, 2) as bic" _
& " FROM ventesProduits vp INNER JOIN produits p ON vp.numeroProduit = p.numero" _
& " WHERE vp.numerovente=" & id & ";")
With rptDetailVenteDup
.Hide
Set .DataSource = rst
.DataMember = ""
With .Sections("detail").Controls
.Item("txtlibelle").DataMember = ""
.Item("txtlibelle").DataField = "libelle"
.Item("txtprixvente").DataMember = ""
.Item("txtprixvente").DataField = "prixvente"
.Item("txtquantite").DataMember = ""
.Item("txtquantite").DataField = "quantite"
.Item("txttaxe").DataMember = ""
.Item("txttaxe").DataField = "taxe"
.Item("txtbic").DataMember = ""
.Item("txtbic").DataField = "bic"
.Item("txtmt").DataMember = ""
.Item("txtmt").DataField = "montant"
End With
.Refresh
.Show
rst.Close
End With
End If |
Partager