<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Admin Volley-Ball Club Tihange - Huy

<% IDJ = Request.QueryString("IDJ") IDV = Request.QueryString("IDV") PrenomJ = DLookUp("Joueurs_club", "Prenom", "id=" & IDJ) NomJ = DLookUp("Joueurs_club", "Nom", "id=" & IDJ) NomVente = DLookUp("Ventes_club", "Description", "id=" & IDV) PrixVente = DLookUp("Ventes_club", "PrixVente", "id=" & idV) APayer = Request.QueryString("APayer") If Request.QueryString("idRelJVCModif") <> "" then idRelJVCModif = Request.QueryString("idRelJVCModif") montantPaye = Request.QueryString("montantPaye") PayDay = Request.QueryString("PayDay") PayMonth = Request.QueryString("PayMonth") PayYear = Request.QueryString("PayYear") datePaiement = PayYear & "-" & PayMonth & "-" & PayDay typePaiement = Request.QueryString("typePaiement") Communication = Request.QueryString("Communication") Set rsModifRelJVC = Server.CreateObject("ADODB.Recordset") sqlModifRelJVC = "UPDATE RelVenteJoueurCompte_club SET " & _ "typePaiement=" & ToSQL(typePaiement, "Text") & ", " & _ "datePaiement='" & datePaiement & "', " & _ "montantPaye=" & ToSQL(montantPaye, "Number") & ", " & _ "Communication=" & ToSQL(Communication, "Text") & " " & _ "WHERE id=" & idRelJVCModif openrs rsModifRelJVC, sqlModifRelJVC Set rsCalculApayer = Server.CreateObject("ADODB.Recordset") sqlCalculApayer = "SELECT * FROM RelVenteJoueur_club WHERE idJ=" & IDJ & " AND idV=" & IDV ChkTotalApayer = 0 openrs rsCalculApayer, sqlCalculApayer While not rsCalculApayer.eof ChkTotalApayer = ChkTotalApayer + (rsCalculApayer("NbPces") * PrixVente) rsCalculApayer.movenext Wend rsCalculApayer.close set rsCalculApayer = nothing Set rsCalculPaye = Server.CreateObject("ADODB.Recordset") sqlCalculPaye = "SELECT * FROM RelVenteJoueurCompte_club WHERE idJ=" & IDJ & " AND idV=" & IDV ChkTotalPaye = 0 openrs rsCalculPaye, sqlCalculPaye While not rsCalculPaye.eof ChkTotalPaye = ChkTotalPaye + rsCalculPaye("montantPaye") rsCalculPaye.movenext Wend rsCalculPaye.close set rsCalculPaye = nothing APayer = ChkTotalApayer - ChkTotalPaye ''' !!!! Calcul reste à payer après mise à jour !!!!!!!!! '''''' end if Response.Write("

Vente " & NomVente & "

") Response.Write("

Paiements " & NomJ & " " & PrenomJ & "

") Set rsVentesJCompte = Server.CreateObject("ADODB.Recordset") sqlVentesJCompte = "SELECT * FROM RelVenteJoueurCompte_club WHERE idJ=" & IDJ & " AND idV=" & IDV & " ORDER BY DatePaiement" openrs rsVentesJCompte, sqlVentesJCompte If not rsVentesJCompte.eof then %> <% TotalPaiements = 0 While not rsVentesJCompte.eof TotalPaiements = TotalPaiements + rsVentesJCompte("montantPaye") If isnull(rsVentesJCompte("Communication")) OR rsVentesJCompte("Communication") = "" then Communication = " " else Communication = rsVentesJCompte("Communication") end if %> <% rsVentesJCompte.movenext Wend rsVentesJCompte.close set rsVentesJCompte = nothing %>
Date Montant Type Communication    
<%=rsVentesJCompte("datePaiement")%> <%=rsVentesJCompte("montantPaye")%> € <%=rsVentesJCompte("typePaiement")%> <%=Communication%> &IDJ=<%=IDJ%>&IDV=<%=IDV%>&APayer=<%=APayer%>" target="_self">Modifier &IDJ=<%=IDJ%>&IDV=<%=IDV%>&location=admin" target="_self">Supprimer
Total : <%=TotalPaiements%> € - Reste <%=APayer%> € à payer


<% end if ShowForm = 0 If APayer <> 0 then ShowForm = 1 PayDay = Day(Date()) PayMonth = Month(Date()) PayYear = Year(Date()) Response.Write("

" & APayer & " € à payer

") end if If Request.QueryString("idRelJVC") <> "" then ShowForm = 1 idRelJVC = Request.QueryString("idRelJVC") TitreForm = "Modifier paiement" Set rsRelJVC = Server.CreateObject("ADODB.Recordset") sqlRelJVC = "SELECT * FROM RelVenteJoueurCompte_club WHERE id=" & idRelJVC openrs rsRelJVC, sqlRelJVC APayer = rsRelJVC("montantPaye") datePaiement = rsRelJVC("datePaiement") PayDay = Day(datePaiement) PayMonth = Month(datePaiement) PayYear = Year(datePaiement) typePaiement = rsRelJVC("typePaiement") Communication = rsRelJVC("Communication") targetform = "mypayventeadmin.asp" submitvalue = "Modifier" else TitreForm = "Ajouter paiement" targetform = "addmypayvente.asp" submitvalue = "Ajouter" end if If ShowForm = 1 then %> <% If Request.QueryString("idRelJVC") <> "" then Response.Write("") else Response.Write("") end if %>

<%=TitreForm%>

Montant :
Date : / /
Type paiement :
Communication :
 


<% end if %> Retour au recapitulatif des ventes