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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
|
<% response.buffer=1
Session.LCID = 3084
%>
<html>
<head>
<!--#include file="checkuser.asp"-->
<title>BIOLAB - INTRANET</title>
<!--#include file="menu.asp"-->
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr height="3"><td width="100%" bgcolor="#000088">
</td></tr>
<tr><td width="100%" bgcolor="#ffcc33"><img src="../images/intranet.gif" alt="" width="217" height="20" border="0">
</td></tr>
<tr height="3"><td width="100%" bgcolor="#000088">
</td></tr>
<tr><td>
<table cellpadding="10" cellspacing="10">
<tr>
<td valign="top">
<!--#include file="sidebar.asp"-->
</td>
<td valign="top">
<!-- contenu de la page !-->
<% dim rs_facture, total, soustotal, tps, tvq
tps=0.05
tvq=0.075
'***
strDataPath = server.MapPath("access\intranet.mdb")
Set Conn_intranet = Server.CreateObject("ADODB.Connection")
strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;"_
+ " Data Source= " & strDataPath & ";"_
+ " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Conn_intranet.ConnectionTimeout = 15
Conn_intranet.CommandTimeout = 10
Conn_intranet.Mode = 3 'adModeReadWrite
if Conn_intranet.state = 0 then
Conn_intranet.Open strConnectString
end if
'****
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref"), "'", "''") & "', '" & replace(Request.form("quantite"), ".", ",") & "', '" & replace(Request.form("description"), "'", "''") & "', '" & replace(Request.form("prixunitaire"), ".", ",") & "','" & replace(Request.form("prixunitaire"), ".", ",")* replace(Request.form("quantite"), ".", ",") & "');"
'Response.write sql & "<br>"
Set rs_facture = Server.CreateObject("ADODB.Recordset")
rs_facture.Open Sql, Conn_intranet, 3, 3
if request.form("description2") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref2"), "'", "''") & "', '" & replace(Request.form("quantite2"), ".", ",") & "', '" & replace(Request.form("description2"), "'", "''") & "', '" & replace(Request.form("prixunitaire2"), ".", ",") & "','" & replace(Request.form("prixunitaire2"), ".", ",")* replace(Request.form("quantite2"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description3") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref3"), "'", "''") & "', '" & replace(Request.form("quantite3"), ".", ",") & "', '" & replace(Request.form("description3"), "'", "''") & "', '" & replace(Request.form("prixunitaire3"), ".", ",") & "','" & replace(Request.form("prixunitaire3"), ".", ",")* replace(Request.form("quantite3"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description4") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref4"), "'", "''") & "', '" & replace(Request.form("quantite4"), ".", ",") & "', '" & replace(Request.form("description4"), "'", "''") & "', '" & replace(Request.form("prixunitaire4"), ".", ",") & "','" & replace(Request.form("prixunitaire4"), ".", ",")* replace(Request.form("quantite4"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description5") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref5"), "'", "''") & "', '" & replace(Request.form("quantite5"), ".", ",") & "', '" & replace(Request.form("description5"), "'", "''") & "', '" & replace(Request.form("prixunitaire5"), ".", ",") & "','" & replace(Request.form("prixunitaire5"), ".", ",")* replace(Request.form("quantite5"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description6") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref6"), "'", "''") & "', '" & replace(Request.form("quantite6"), ".", ",") & "', '" & replace(Request.form("description6"), "'", "''") & "', '" & replace(Request.form("prixunitaire6"), ".", ",") & "','" & replace(Request.form("prixunitaire6"), ".", ",")* replace(Request.form("quantite6"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description7") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref7"), "'", "''") & "', '" & replace(Request.form("quantite7"), ".", ",") & "', '" & replace(Request.form("description7"), "'", "''") & "', '" & replace(Request.form("prixunitaire7"), ".", ",") & "','" & replace(Request.form("prixunitaire7"), ".", ",")* replace(Request.form("quantite7"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description8") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref8"), "'", "''") & "', '" & replace(Request.form("quantite8"), ".", ",") & "', '" & replace(Request.form("description8"), "'", "''") & "', '" & replace(Request.form("prixunitaire8"), ".", ",") & "','" & replace(Request.form("prixunitaire8"), ".", ",")* replace(Request.form("quantite8"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description9") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref9"), "'", "''") & "', '" & replace(Request.form("quantite9"), ".", ",") & "', '" & replace(Request.form("description9"), "'", "''") & "', '" & replace(Request.form("prixunitaire9"), ".", ",") & "','" & replace(Request.form("prixunitaire9"), ".", ",")* replace(Request.form("quantite9"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description10") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref10"), "'", "''") & "', '" & replace(Request.form("quantite10"), ".", ",") & "', '" & replace(Request.form("description10"), "'", "''") & "', '" & replace(Request.form("prixunitaire10"), ".", ",") & "','" & replace(Request.form("prixunitaire10"), ".", ",")* replace(Request.form("quantite10"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description11") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref11"), "'", "''") & "', '" & replace(Request.form("quantite11"), ".", ",") & "', '" & replace(Request.form("description11"), "'", "''") & "', '" & replace(Request.form("prixunitaire11"), ".", ",") & "','" & replace(Request.form("prixunitaire11"), ".", ",")* replace(Request.form("quantite11"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description12") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref12"), "'", "''") & "', '" & replace(Request.form("quantite12"), ".", ",") & "', '" & replace(Request.form("description12"), "'", "''") & "', '" & replace(Request.form("prixunitaire12"), ".", ",") & "','" & replace(Request.form("prixunitaire12"), ".", ",")* replace(Request.form("quantite12"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description13") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref13"), "'", "''") & "', '" & replace(Request.form("quantite13"), ".", ",") & "', '" & replace(Request.form("description13"), "'", "''") & "', '" & replace(Request.form("prixunitaire13"), ".", ",") & "','" & replace(Request.form("prixunitaire13"), ".", ",")* replace(Request.form("quantite13"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description14") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref14"), "'", "''") & "', '" & replace(Request.form("quantite14"), ".", ",") & "', '" & replace(Request.form("description14"), "'", "''") & "', '" & replace(Request.form("prixunitaire14"), ".", ",") & "','" & replace(Request.form("prixunitaire14"), ".", ",")* replace(Request.form("quantite14"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
if request.form("description15") <> "" then
Sql = "INSERT INTO Facture_comptoir_ligne ( NoFacture, NoRef, Qtee, description, Prixunitaire, Prixtotal) VALUES ( '" & Request.form("nofacture") & "', '" & replace(Request.form("noref15"), "'", "''") & "', '" & replace(Request.form("quantite15"), ".", ",") & "', '" & replace(Request.form("description15"), "'", "''") & "', '" & replace(Request.form("prixunitaire15"), ".", ",") & "','" & replace(Request.form("prixunitaire15"), ".", ",")* replace(Request.form("quantite15"), ".", ",") & "');"
rs_facture.Open Sql, Conn_intranet, 3, 3
end if
'******************** Load la facture ***********
Sql = "SELECT NoFacture, Division, NomClient, Adresse, Ville, Province, CodePostal, Telephone, Fax, Datefct, NoClient, NoCommande, Paye, Modepayment, Datepaye, Soustot, TPS, TVQ, Total, Commentaire FROM Facture_comptoir WHERE NoFacture=" & request.form("nofacture") & ";"
rs_facture.Open Sql, Conn_intranet, 3, 3
select case rs_facture("division")
case "A"
%>
<img src="thetford.gif" alt="" width="600" height="67" border="0">
<% case "B" %>
<img src="chicoutimi.gif" alt="" width="600" height="67" border="0">
<% case "C" %>
<img src="joliette.gif" alt="" width="600" height="67" border="0">
<% case "D" %>
<img src="cap.gif" alt="" width="600" height="112" border="0">
<% End select
'response.end%>
<div align="center">
<table cellpadding=4 border=0>
<tr><td valign="top"><strong>Vendu :</strong></td><td><%= rs_facture("nomclient") %><br>
<%= rs_facture("adresse") %><br>
<%= rs_facture("ville") %>,
<%= rs_facture("province") %><br>
<%= rs_facture("codepostal") %></td> <td> </td><td valign="top"><strong>Date:</strong><br>
<br>
<strong>No facture:</strong></td><td valign="top"><%= date() %><br>
<br>
<%= rs_facture("nofacture") %></td></tr>
<tr><td><strong>Tl:</strong></td><td><%= rs_facture("Telephone") %></td><td> </td> <td><strong>No de client</strong></td><td><%= rs_facture("noclient") %></td></tr>
<tr><td valign="top"><strong>Fax:</strong></td><td valign="top"><%= rs_facture("fax") %></td> <td> </td><td valign="top"><strong>No de commande:</strong><br>
<strong>Commentaire:</strong></td><td valign="top"><%= rs_facture("nocommande") %><br>
<%= rs_facture("commentaire") %></td></tr>
<% if rs_facture("Modepayment")<>"" then
Modepayment=1
else
Modepayment=0
end if %>
</table></div><br>
<br>
<form action="Nouv_facture_final.asp" name="formu" id="formu" method="POST">
<table align="center" border=1>
<tr>
<td align="center"><strong>NoRef</strong></td>
<td align="center"><strong>Quantit</strong></td>
<td align="center"><strong>Description</strong></td>
<td align="center"><strong>Prix unitaire</strong></td>
<td align="center"><strong>Total</strong></td>
</tr>
<%
rs_facture.Close
sql = "SELECT NoRef, Qtee, Description, Prixunitaire, Prixtotal FROM Facture_comptoir_ligne WHERE NoFacture = " & request.form("nofacture") & ";"
rs_facture.Open Sql, Conn_intranet, 3, 3
soustotal=0
Do Until rs_facture.EOF
%>
<tr>
<td align="center"><%= rs_facture("noref") %> </td>
<td align="center"><%= formatnumber(rs_facture("qtee"),2) %></td>
<td align="center"><%= rs_facture("description") %></td>
<td align="center"><%= formatnumber(rs_facture("prixunitaire"),2) %> $</td>
<td align="center"><%= formatnumber(rs_facture("prixtotal"),2) %> $</td>
</tr>
<%
soustotal = soustotal+rs_facture("prixtotal")
rs_facture.MoveNext
Loop
%>
<tr><td colspan="5"><div align="right">
Sous-total: <%= formatnumber(soustotal,2) %> $<input type="hidden" name="soustotal" value="<%= soustotal %>"><br>
TPS: <%= formatnumber(soustotal*tps,2) %> $<input type="hidden" name="tps" value="<%= soustotal*tps %>"><br>
TVQ: <%= formatnumber(((soustotal*tps)+soustotal)*tvq,2) %> $<input type="hidden" name="tvq" value="<%= ((soustotal*tps)+soustotal)*tvq %>"><br>
Total: <%= formatnumber((soustotal*tps) + (((soustotal*tps)+soustotal)*tvq)+soustotal,2) %> $<input type="hidden" name="total" value="<%= (soustotal*tps) + (((soustotal*tps)+soustotal)*tvq)+soustotal %>">
<br>
<% If Modepayment=1 then %>
Pay: <input type="checkbox" name="paye" value="oui">
<% End If %>
<input type="hidden" name="nofacture" value="<%= request.form("nofacture") %>">
</form>
</div></td></tr>
</table>
<br>
<div align="center"><a href="Nouv_facture_correct.asp?no=<%= request.form("nofacture") %>">Corriger la facture</a> <a href="javascript:document.forms(0).submit();">Accepter la facture</a></div>
<!-- fin contenu de la page !-->
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
rs_facture.close
set rs_facture = Nothing
Conn_Intranet.Close
set Conn_Intranet = Nothing %>
</body>
</html> |
Partager