her er så de opretsiden....
<!--#include file="common2.asp"-->
<html>
<script type="text/vbscript">
'dato = DateSerial(Year(date),Month(Date)+1,30)
'do while weekday(dato) = 1 or weekday(dato) = 7
' dato = DateAdd("d",-1,dato)
'loop
function findtal(inputstreng)
dim regcon
set regcon = new RegExp
regcon.ignoreCase = true
regcon.Global = true
regcon.pattern = "([^\d])"
findtal = regcon.replace(inputstreng,"")
end function
function adddato()
str = document.bilag.betaling.value
tal = findtal(str)
document.bilag.forfaldsdato.value = CDate(document.bilag.fakturadato.value) + Cint(tal)
end function
function addatt()
document.bilag.deresref.value = document.bilag.attention.value
end function
function addref()
document.bilag.voresref.value = document.bilag.ref.value
end function
</script>
<%
' Følgende felter skal findes
' Kundenavn, kontraktnr, serviceantal, antal besøg, servicestart, løbetid, serviceslut
' konsulent
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_Customer WHERE ID_Deb = " & request.querystring("idtag") & ";"
rsstr.Open strSQL, dsn1, 1
do until rsstr.eof
debnr = rsstr("Cust_no")
navn = rsstr("Customer")
adresse1 = rsstr("Cust_adr1")
adresse2 = rsstr("Cust_adr2")
if adresse2 = "~empty~" then adresse2 = ""
postby = rsstr("Zip") & " " & rsstr("Town")
betaling = rsstr("Cust_Bet")
betalingsdag = rsstr("Cust_betdage")
attention = rsstr("Attention")
if attention = "~empty~" then attention = ""
debid = rsstr("ID_Deb")
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_Enclose WHERE VBOEncloseNøgle LIKE 'Faktura';"
rsstr.Open strSQL, dsn, 1
do until rsstr.eof
bilag = rsstr("VBOEncloseVærdi")
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_System WHERE VBOSystemNøgle LIKE 'Defaultref';"
rsstr.Open strSQL, dsn, 1
do until rsstr.eof
ref = rsstr("VBOSystemVærdi")
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
%>
<script language="javascript" src="../system/cal2.js">
/*
Xin's Popup calendar script- Xin Yang (
http://www.yxscripts.com/)
Script featured on/available at
http://www.dynamicdrive.com/This notice must stay intact for use
*/
</script>
<script language="javascript" src="system/cal_conf2.js"></script>
<script>
//VED START GÅ TIL DEBITORNR
function vedstart(){
}
//VALG AF SERVICEMAND
function seridtoservicemand(){
document.Service.servicemand.value = document.Service.serviceid.options[document.Service.serviceid.selectedIndex].text
}
function CheckForm(){
var errorMsg = "";
//Faktura
if (document.bilag.fakturadato.value==""){
errorMsg += "\n\tFakturadato \t-\tIndtast/Vælg en dato";
}
//Forfaldsdato
if (document.bilag.forfaldsdato.value==""){
errorMsg += "\n\tForfaldsdato \t-\tIndtast/Vælg en dato";
}
//If there is a problem with the form then display an error
if (errorMsg != ""){
msg = "VBO 2004 Bilag ________________________________________________\n\n";
msg += "Bilag er ikke blevet tilføjet/opdateret fordi der er problemer.\n";
msg += "Venligst korriger disse problemer.\n";
msg += "________________________________________________________Rev 1.00a\n\n";
msg += "Følgende felter bør rettes: -\n";
//errorMsg += alert(msg + errorMsg + "\n\n");
window.alert(msg + errorMsg + "\n\n");
return false;
}
//return true;
}
</script>
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>VBO 2004 DEBITOR OPRET NY...</title>
</head>
<body bgcolor="#C0C0C0" topmargin="0" leftmargin="5" onload="vedstart()">
<form name="bilag" action="bilagaction.asp?action=Opret" method="post" onSubmit="return CheckForm()">
<input type="hidden" name="betalingsdage" value="<%=betalingsdag%>">
<input type="hidden" name="faktype" value="<%=request.querystring("faktype")%>">
<input type="hidden" name="betaling" value="<%=betaling%>">
<input type="hidden" name="attention" value="<%=attention%>">
<input type="hidden" name="ref" value="<%=ref%>">
<input type="hidden" name="navn" value="<%=navn%>">
<input type="hidden" name="adresse1" value="<%=adresse1%>">
<input type="hidden" name="adresse2" value="<%=adresse2%>">
<input type="hidden" name="postnr" value="<%=postby%>">
<input type="hidden" name="debnr" value="<%=debnr%>">
<input type="hidden" name="debid" value="<%=debid%>">
<input type="hidden" name="fakturanummer" value="<%=bilag & CStr(Right(DatePart("yyyy", date()),2))%>">
<table border="0" width="100%" cellpadding="0" height="1" cellspacing="0">
<tr>
<td width="50%" colspan="2" bgcolor="#808080"
style="border-left:1px solid #000000; border-top:1px solid #000000; border-bottom:1px solid #000000; border-right-width:1"
height="1"><%=Application("vboapp")%><font face="Verdana"
color="#000000">: BILAG </font><font face="Verdana"
color="#FFFFFF">OPRET NY...</font></b></td>
<td width="50%" colspan="2" bgcolor="#808080" style="border-right:1px solid #000000; border-top:1px solid #000000; border-bottom:1px solid #000000; "
height="1"> </td>
</tr>
<tr>
<td width="2%" height="20">
<p align="left"><b><font face="Verdana" size="2"><u>DEBITOR</u></font></b></td>
<td width="48%" height="20"
style="font-family: Verdana; font-size: 12; color: #000080; font-weight: bold"> </td>
<td width="1%" height="20"><b><font face="Verdana" size="2">
<%if request.querystring("faktype") = "Faktura" then
response.write("Fakturanr.")
else
response.write("Kreditnr.")
end if
%>
</font></b></td>
<td width="56%" height="20"
style="font-family: Verdana; font-size: 12; color: #000080; font-weight: bold"> <font
color="#0000FF">*<%=bilag & CStr(Right(DatePart("yyyy", date()),2))%></font></td>
</tr>
<tr>
<td width="50%" height="35" rowspan="3" colspan="2" valign="top"
style="font-family: Verdana; font-size: 11; color: #000080; font-weight: bold; border-bottom: 1px solid #0000FF; ">
<font size="2" color="#0000FF"><%=navn%><br>
<%=adresse1%><br>
<%=adresse2%><br>
<%=postby%></font></td>
<td width="1%" height="20"><b><font face="Verdana" size="2"><%if request.querystring("faktype") = "Faktura" then
response.write("Fakturadato.")
else
response.write("Kreditdato.")
end if
%>
</font></b></td>
<td width="56%" height="20"><input type="text" name="fakturadato" size="10" style="text-align: center" onblur="adddato()"><b><font face="Verdana"
color="#000000"><input type="button" value="Vælg dato" name="select" style="font-size: 9" onclick="java script:showCal('Calendar1')"></font></b></td>
</tr>
<tr>
<td width="1%" height="20"><b><font face="Verdana" size="2">Betaling</font></b></td>
<td width="56%" height="20"><font color="#0000FF"> <b><font
face="Verdana" size="2"><%=betaling%></font></b></font></td>
</tr>
<tr>
<td width="1%" height="20" style="border-bottom: 1px solid #0000FF; "><b><font face="Verdana" size="2">Forfaldsdato</font></b></td>
<td width="56%" height="20" style="border-bottom: 1px solid #0000FF; "><input type="text" name="forfaldsdato" size="10" style="text-align: center"><b><font face="Verdana"
color="#000000"><input type="button" value="Vælg dato" name="select1" style="font-size: 9" onclick="java script:showCal('Calendar2')"></font></b></td>
</tr>
<tr>
<td width="14%" height="22"
style="border-bottom:1px solid #0000FF; font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
<b><font face="Verdana" size="2" color="#000000">Deres ref.</font></b></td>
<td width="36%" height="22"
style="border-bottom:1px solid #0000FF; font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
<input type="text" name="deresref" size="24"><img border="0"
src="system/vis2.gif" width="17" height="17" onclick="addatt()" alt="Overfør attention"></td>
<td width="1%" height="22" style="border-bottom: 1px solid #0000FF"><b><font face="Verdana" size="2">Vores ref.</font></b></td>
<td width="56%" height="22" style="border-bottom: 1px solid #0000FF">
<input type="text" name="voresref" size="24"><img border="0"
src="system/vis2.gif" onclick="addref()" alt="Overfør standard reference"></td>
</tr>
<tr>
<td width="14%" height="13" valign="top"
style="font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
</td>
<td width="36%" height="13" valign="top"
style="font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
</td>
<td width="10%" height="13">
</td>
<td width="40%" height="13">
<p align="right"><input type="submit" value="Opret" name="B1"><input
type="reset" value="Nulstil" name="B2"></td>
</tr>
</table>
</form>
</body>
</html>
<!--#include file="commonbottom2.asp"-->
Og redigeringssiden...
<!--#include file="common2.asp"-->
<%
session.LCID = 1030
%>
<html>
<script type="text/vbscript">
'dato = DateSerial(Year(date),Month(Date)+1,30)
'do while weekday(dato) = 1 or weekday(dato) = 7
' dato = DateAdd("d",-1,dato)
'loop
function findtal(inputstreng)
dim regcon
set regcon = new RegExp
regcon.ignoreCase = true
regcon.Global = true
regcon.pattern = "([^\d])"
findtal = regcon.replace(inputstreng,"")
end function
function adddato()
str = document.bilag.betaling.value
tal = findtal(str)
document.bilag.forfaldsdato.value = CDate(document.bilag.fakturadato.value) + Cint(tal)
end function
function addatt()
document.bilag.deresref.value = document.bilag.attention.value
end function
function addref()
document.bilag.voresref.value = document.bilag.ref.value
end function
</script>
<%
' Følgende felter skal findes
' Kundenavn, kontraktnr, serviceantal, antal besøg, servicestart, løbetid, serviceslut
' konsulent
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_Fakturahead WHERE FakID=" & request.querystring("idtag") & ";"
rsstr.Open strSQL, dsn1, 1
do until rsstr.eof
debnr = rsstr("Debitornr")
navn = rsstr("Debitornavn")
adresse1 = rsstr("Debitoradr1")
adresse2 = rsstr("Debitoradr2")
if adresse2 = "~empty~" then adresse2 = ""
postby = rsstr("PostnrBy")
betaling = rsstr("Bettekst")
betalingsdage = rsstr("Betdage")
fakturadato = rsstr("Faktureringsdato")
voresref = rsstr("Voresref")
if voresref = "~empty~" then voresref = ""
deresref = rsstr("Deresrefrekv")
if deresref = "~empty~" then deresref = ""
fakturanr = rsstr("Fakturanummer")
betalingsdato = rsstr("Betalingsdato")
faktype = rsstr("Fakturatype")
debid = rsstr("DebID")
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_System WHERE VBOSystemNøgle LIKE 'Defaultref';"
rsstr.Open strSQL, dsn2, 1
do until rsstr.eof
ref = rsstr("VBOSystemVærdi")
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
%>
<script language="javascript" src="../system/cal2.js">
/*
Xin's Popup calendar script- Xin Yang (
http://www.yxscripts.com/)
Script featured on/available at
http://www.dynamicdrive.com/This notice must stay intact for use
*/
</script>
<script language="javascript" src="system/cal_conf2.js"></script>
<script>
//VED START GÅ TIL DEBITORNR
function vedstart(){
}
//VALG AF SERVICEMAND
function seridtoservicemand(){
document.Service.servicemand.value = document.Service.serviceid.options[document.Service.serviceid.selectedIndex].text
}
function CheckForm(){
var errorMsg = "";
//Faktura
if (document.bilag.fakturadato.value==""){
errorMsg += "\n\tFakturadato \t-\tIndtast/Vælg en dato";
}
//Forfaldsdato
if (document.bilag.forfaldsdato.value==""){
errorMsg += "\n\tForfaldsdato \t-\tIndtast/Vælg en dato";
}
//If there is a problem with the form then display an error
if (errorMsg != ""){
msg = "VBO 2004 Bilag ________________________________________________\n\n";
msg += "Bilag er ikke blevet tilføjet/opdateret fordi der er problemer.\n";
msg += "Venligst korriger disse problemer.\n";
msg += "________________________________________________________Rev 1.00a\n\n";
msg += "Følgende felter bør rettes: -\n";
//errorMsg += alert(msg + errorMsg + "\n\n");
window.alert(msg + errorMsg + "\n\n");
return false;
}
//return true;
}
</script>
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>VBO 2004 DEBITOR OPRET NY...</title>
</head>
<body bgcolor="#C0C0C0" topmargin="0" leftmargin="5" onload="vedstart()">
<form name="bilag" action="bilagaction.asp?action=Rediger&idtag=<%=request.querystring("idtag")%>" method="post" onSubmit="return CheckForm()" enctype="multipart/form-data">
<input type="hidden" name="betalingsdage" value="<%=betalingsdage%>">
<input type="hidden" name="betaling" value="<%=betaling%>">
<input type="hidden" name="ref" value="<%=ref%>">
<input type="hidden" name="navn" value="<%=navn%>">
<input type="hidden" name="adresse1" value="<%=adresse1%>">
<input type="hidden" name="adresse2" value="<%=adresse2%>">
<input type="hidden" name="postnr" value="<%=postnr%>">
<input type="hidden" name="debnr" value="<%=debnr%>">
<input type="hidden" name="debid" value="<%=debid%>">
<input type="hidden" name="fakturanummer" value="<%=fakturanr%>">
<input type="hidden" name="attention" value="<%=deresref%>">
<table border="0" width="100%" cellpadding="0" height="3" cellspacing="0">
<tr>
<td width="50%" colspan="2" bgcolor="#808080"
style="border-left:1px solid #000000; border-top:1px solid #000000; border-bottom:1px solid #000000; border-right-width:1"
height="1"><%=Application("vboapp")%><font face="Verdana"
color="#000000">: BILAG </font><font face="Verdana"
color="#FFFFFF">REDIGER...</font></b></td>
<td width="50%" colspan="2" bgcolor="#808080" style="border-right:1px solid #000000; border-top:1px solid #000000; border-bottom:1px solid #000000; "
height="1"> </td>
</tr>
<tr>
<td width="2%" height="20">
<p align="left"><b><font face="Verdana" size="2"><u>DEBITOR</u></font></b></td>
<td width="48%" height="20"
style="font-family: Verdana; font-size: 12; color: #000080; font-weight: bold"> </td>
<td width="1%" height="20"><b><font face="Verdana" size="2"><%if left(request.querystring("faktype"), 7) = "Faktura" then
response.write("Fakturanr.")
else
response.write("Kreditnr.")
end if
%>
</font></b></td>
<td width="56%" height="20"
style="font-family: Verdana; font-size: 12; color: #000080; font-weight: bold"> <font
color="#0000FF"><%=fakturanr%></font></td>
</tr>
<tr>
<td width="50%" height="35" rowspan="3" colspan="2" valign="top"
style="font-family: Verdana; font-size: 11; color: #000080; font-weight: bold; border-bottom: 1px solid #0000FF; ">
<font size="2" color="#0000FF"><%=navn%><br>
<%=adresse1%><br>
<%=adresse2%><br>
<%=postby%></font></td>
<td width="1%" height="20"><b><font face="Verdana" size="2"><%if left(request.querystring("faktype"), 7) = "Faktura" then
response.write("Fakturadato.")
else
response.write("Kreditdato.")
end if
%>
</font></b></td>
<td width="56%" height="20"><input type="text" name="fakturadato" size="10" style="text-align: center" onblur="adddato()" value="<%=fakturadato%>"><b><font face="Verdana"
color="#000000"><input type="button" value="Vælg dato" name="select" style="font-size: 9" onclick="java script:showCal('Calendar1')"></font></b></td>
</tr>
<tr>
<td width="1%" height="20"><b><font face="Verdana" size="2">Betaling</font></b></td>
<td width="56%" height="20"><font color="#0000FF"> <b><font
face="Verdana" size="2"><%=betaling%></font></b></font></td>
</tr>
<tr>
<td width="1%" height="20" style="border-bottom: 1px solid #0000FF; "><b><font face="Verdana" size="2">Forfaldsdato</font></b></td>
<td width="56%" height="20" style="border-bottom: 1px solid #0000FF; ">
<input type="text" name="forfaldsdato" size="10" style="text-align: center" value="<%=betalingsdato%>"><b><font face="Verdana"
color="#000000"><input type="button" value="Vælg dato" name="select1"
style="font-size: 9" onclick="java script:showCal('Calendar2')"></font></b></td>
</tr>
<tr>
<td width="14%" height="22"
style="border-bottom:1px solid #0000FF; font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
<b><font face="Verdana" size="2" color="#000000">Deres ref.</font></b></td>
<td width="36%" height="22"
style="border-bottom:1px solid #0000FF; font-family: Verdana; font-size: 11; color: #000080; font-weight: bold">
<input type="text" name="deresref" size="24" value="<%=deresref%>"><img border="0"
src="system/vis2.gif" width="17" height="17" onclick="addatt()" alt="Overfør attention"></td>
<td width="1%" height="22" style="border-bottom: 1px solid #0000FF"><b><font face="Verdana" size="2">Vores ref.</font></b></td>
<td width="56%" height="22" style="border-bottom: 1px solid #0000FF">
<input type="text" name="voresref" size="24" value="<%=voresref%>"><img border="0"
src="system/vis2.gif" onclick="addref()" alt="Overfør standard reference"></td>
</tr>
<tr>
<td width="50%" height="15"
style="font-family: Verdana; font-size: 11; color: #000080; font-weight: bold" colspan="2">
<p align="right">[ <a href="fakturaforside.asp?fra=<%=request.querystring("idtag")%>&til=<%=request.querystring("idtag")%>&kopi=1&antal=1">Udskriv bilag</a> ]</td>
<td width="10%" height="15">
</td>
<td width="40%" height="15">
<p align="right"><input type="submit" value="Opdater" name="B1"><input
type="reset" value="Nulstil" name="B2"></td>
</tr>
</form>
<tr>
<td width="50%" height="13" valign="top"
style="border-bottom:1px solid #0000FF; font-family: Verdana; font-size: 11; color: #000080; font-weight: bold" colspan="2">
BILAGSLINIER<a href="fakturalinierNew.asp?idtag=<%=request.querystring("idtag")%>"><img border="0" src="system/debitorliste.gif" alt="Opret bilagslinie"></a></td>
<td width="10%" height="13" style="border-bottom: 1px solid #0000FF">
</td>
<td width="40%" height="13" style="border-bottom: 1px solid #0000FF">
</td>
</tr>
<tr>
<td width="100%" height="13" valign="top" colspan="4">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="5%" style="border-bottom: 1px solid #000000"> </td>
<td width="55%" style="border-bottom: 1px solid #000000"><b>Tekst</b></td>
<td width="11%" style="border-bottom: 1px solid #000000">
<p align="right"><b>Antal</b></td>
<td width="14%" style="border-bottom: 1px solid #000000">
<p align="right"><b>Pris</b></td>
<td width="15%" style="border-bottom: 1px solid #000000">
<p align="right"><b>Sum</b></td>
</tr>
<%
summen = 0
Set rsstr = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM TB_Fakturalinier WHERE FakturaID=" & request.querystring("idtag") & ""
rsstr.Open strSQL, dsn1, 1
do until rsstr.eof
Response.Write("<tr>" & vbcrlf)
Response.Write(" <td width=""5%"" valign=""top"" style=""border-bottom: 1px dashed #000080"">" & vbcrlf)
Response.Write(" <a href=""fakturalinierEdit.asp?idtag=" & request.querystring("idtag") & "&linie=" & rsstr("LinieID") & """><img border=""0"" src=""system/rediger.gif""></a><a href=""linieaction.asp?action=Slet&linie=" & rsstr("LinieID") & "&idtag=" & request.querystring("idtag") & """><img border=""0"" src=""../images/delete2.jpg"" alt=""Slet linie""></a></td>" & vbcrlf)
Response.Write(" <td width=""55%"" valign=""top"" style=""border-bottom: 1px dashed #000080"">" & vbcrlf)
Response.Write(" " & rsstr("Tekst") & "" & vbcrlf)
Response.Write(" </td>" & vbcrlf)
Response.Write(" <td width=""11%"" align=""right"" valign=""top"" style=""border-bottom: 1px dashed #000080"">" & vbcrlf)
Response.Write(" " & formatnumber(rsstr("Antalt"),2) & "</td>" & vbcrlf)
Response.Write(" <td width=""14%"" align=""right"" valign=""top"" style=""border-bottom: 1px dashed #000080"">" & vbcrlf)
Response.Write(" " & formatnumber(rsstr("Pris"), 2) & "</td>" & vbcrlf)
Response.Write(" <td width=""15%"" align=""right"" valign=""top"" style=""border-bottom: 1px dashed #000080"">" & vbcrlf)
Response.Write(" " & formatnumber((rsstr("Antalt") * rsstr("Pris")),2) & "</td>" & vbcrlf)
Response.Write(" </tr>")
summen = summen + (formatnumber(rsstr("Antalt"), 2) * formatnumber(rsstr("Pris"), 2))
rsstr.movenext
loop
rsstr.close
set rsstr = nothing
%>
</table>
</td>
</tr>
<tr>
<td width="50%" height="13" valign="top" colspan="2">
</td>
<td width="10%" height="13">
</td>
<td width="40%" height="13">
</td>
</tr>
<tr>
<td width="99%" height="13" valign="top" colspan="4" align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="89%">
<p align="right"><b>Netto<br>
Moms (25%)<br>
Total</b></p>
<p> </td>
<td width="11%" valign="top">
<p align="right"><b><%=formatnumber(summen,2)%><br>
<%=formatnumber((summen * 0.25),2)%><br>
<%=formatnumber((summen * 1.25),2)%></b></td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
<!--#include file="commonbottom2.asp"-->