Avatar billede bassa Nybegynder
07. april 2006 - 20:50 Der er 17 kommentarer

Moms regnes fra?

Til eagleeye->

Du hjalp mig forleden, og det er jeg meget glad for, mit problem er bare nu, at jeg faktisk har fået dig til at rette noget som alligevel ikke skulle ændres, så jeg håber derfor, at du kan hjælpe mig igen...

Eller måske hvis der er en anden som kan hjælpe?

Anyway, hér er .asp-scriptet:

<%@ Language=VBScript %>
<% Session.LCID = 1030 %>
<%
Dim sSubject
Dim sBody, sBodyHtml
Dim iTotal, iXtraRengoring
iTotal = 0
iXtraRengoring = 0

'Ønsker vedr. rengøring
Dim bRengoringService, bRengoringGrill
If Request.Form("RengoringService") = "ON" Then
    bRengoringService = True
Else
    bRengoringService = False
End If
If Request.Form("RengoringGrill") = "ON" Then
    bRengoringGrill = True
Else
    bRengoringGrill = False
End If


sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Dato: " & Now & "</font><br>"

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Kunde oplysninger:</strong><br>"
sBodyHtml = sBodyHtml & "Kontaktperson: " & Chr(9) & Request.Form("Kontaktperson") & "<br>"
sBodyHtml = sBodyHtml & "Adresse: " & Chr(9) & Chr(9) & Request.Form("Adresse") & "<br>"
sBodyHtml = sBodyHtml & "Postnr.: " & Chr(9) & Chr(9) & Request.Form("Postnr") & "<br>"
sBodyHtml = sBodyHtml & "By: " & Chr(9) & Chr(9) & Chr(9) & Request.Form("By") & "<br>"
sBodyHtml = sBodyHtml & "Telefon nr.: " & Chr(9) & Request.Form("Telefon nr.") & "<br>"
sBodyHtml = sBodyHtml & "Email: " & Chr(9) & Chr(9) & Request.Form("Email") & "<br>"
sBodyHtml = sBodyHtml & "Bemærkninger: " & Chr(9) & Chr(9) & Request.Form("Bemærkninger") & "<br>"
sBodyHtml = sBodyHtml & "Levering: " & Chr(9) & Chr(9) & Request.Form("Levering") & "<br>" & "<br></font>"

'Overføre header til renell mail
sBodyRenell = sBodyHtml

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Din ordre:</strong></font>"

sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""> <strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

sBodyRenell = sBodyRenell & "<font size=""2"" face=""Verdana""><strong>Kundens ordre:</strong></font>"

sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

For each item In Request.Form
    If (LCase(Left(item, 5)) = "antal") And (IsNumeric(Request.Form(item))) Then
        sFormItemNumber = Replace(LCase(item), "antal", "")
               
        sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "</tr></table>"
       
        sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
        sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "</tr></table>"
       
        'Prisberegninger
        If IsNumeric(Request.Form("Stk. pris" & sFormItemNumber)) Then
            iPrice = FormatNumber(Request.Form("Stk. pris" & sFormItemNumber))
            iTotal = iTotal + (CDbl(iPrice)*Request.Form(item))
        End If
       
        'porcelæn & glas
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "04" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "06") Then
            'If not = ikke pris for salt og peber bøsse
            If Not Trim(Request.Form("Varenummer" & sFormItemNumber)) = "04-400" Then
                iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
            End If
        End If
       
        'Kaffe kander
        If bRengoringService And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-400" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-401") Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
       
        'bestik
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "07" Then
            iXtraRengoring = iXtraRengoring + .5*Request.Form(item)
        End If

        'skåle og fade
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "08" Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
       
        'kopper
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-1" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-2" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-3") Then
            iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
        End If
       
        'grill
        If bRengoringGrill And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-100" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-101") Then
            iXtraRengoring = iXtraRengoring + 350*Request.Form(item)
        End If
    End If
Next

'Tilføjer pris for rengøring
If iXtraRengoring > 0 Then
    'kundens mail
    sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyHtml = sBodyHtml & "</tr></table>"
   
    'renell mail
    sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
    sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyRenell = sBodyRenell & "</tr></table>"
End If

'Føjer rengørings omkostninger til total
If iXtraRengoring > 0 Then
    iTotal = iTotal + iXtraRengoring
End If

'Kørsel
If Request.Form("selKommune") = "Helsingør" Then
    'iPriceKorsel = FormatNumber(300, 2)
    iPriceKorsel = 300
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
ElseIf Request.Form("selKommune") = "Øvrige" Then
    iPriceKorsel = "?"
    iKorselComment = True
Else
    'iPriceKorsel = FormatNumber(400, 2)
    iPriceKorsel = 400
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
End If

'Divide by 100
'iTotal = (iTotal/100)  'Hack som fjernes

'kørsel kunde mail
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"
   
'kørsel renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Tilføjer total linie
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Denne antager priserne er incl moms.
'sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"
'sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Rette til at priserne er excl. moms.
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal*1.25, 2) & "</strong></u></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'Føjer total til renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Disse to angater alle priser er incl. moms
'sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"

'sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Her rettet til de er excl. moms som så ligges til
sBodyRenell = sBodyRenell & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal*1.25, 2) & "</strong></u></font></td>"

sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Om kørsel
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><i>OBS! Den oplyste pris er uden kørsel.</i></font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel indenfor Helsingør Kommune kr. 300,00 incl. Moms.</font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel til Fredensborg-Humlebæk, Græsted-Gilleleje, Karlebo og Hørsholm kommune kr. 400,00 incl. Moms.</font><br>"

'Forbehold
sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Med forbehold for prisændringer, fejl, m.m.</i></font><br><br>"
'Hvis kommune = øvrige
If iKorselComment Then
    sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, du vil blive kontaktet af Renell vedrørende prisen.</i></font><br><br>"
    sBodyRenell = sBodyRenell & "<br><br><font color=""red"" size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, kontakt kunden vedrørende prisen.</i></font><br><br>"
End if

'Hilsen
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Med venlig hilsen</font><br>"
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Servicefirmaet Renell A/S</font><br>"

'mail to website
Dim jmail
Set jmail = Server.CreateObject("JMail.smtpmail")
jmail.ServerAddress = "jaynet"
jmail.ContentType = "text/html"
jmail.AddRecipient "mads@renell.dk"
jmail.Sender = "postmaster@renell.dk"
jmail.SenderName = "Renell website"
jmail.Subject = "Bestilling på nettet"
jmail.Body = "<html><body>" & sBodyRenell & "</body></html>"
jmail.Execute
jmail.Close
Set jmail = Nothing

'html to customer
If Len(Request.Form("Email")) > 6 Then
    Set jmail = Server.CreateObject("JMail.smtpmail")
    jmail.ServerAddress = "jaynet"
    jmail.ContentType = "text/html"
    jmail.Sender = "postmaster@renell.dk"
    jmail.SenderName = "Renell website"
    jmail.Subject = "Bestilling hos Servicefirmaet Renell A/S"
    jmail.AddRecipient Request.Form("Email")
    jmail.Body = "<html><body>" & sBodyHtml & "</body></html>"
    jmail.Execute
    jmail.close
    Set jmail = Nothing
End If

%>
<html>
<head>
<title>Renell Service A/S</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="graphics/leftmenu_bg.gif" link="#032956" vlink="#000000" alink="#000000">
<table width="100%" border="0">
<tr>
<td width="100%" align="center"><font face="Verdana" size="2" color="#000000"><br><br>Deres bestilling er afsendt til Renell.</font></td>
</tr>
</table>
</body>
</html>

MOMS bliver lagt oven i disse varer på faktura, men det skal de ikke.

På bundlinien skal der bare stå en notits, hvor køber kan se i hvor mange kroner Moms udgør... det er allerede en del af scriptet, det er faktisk bare Momsen som ikke skal lægges oven i de øvrige priser.

Håber nogen kan hjælpe, da jeg ingen forstand har på .asp. :(


Mvh
Bassa
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:26 #1
Jeg forstår det du siger som at alle priserne i dokumentet allerede er skrevet om exclusiv moms, så det er faktisk kun slutresultates kode som skal rettes.

Linje 182 og 183 herunder:
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total excl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"


Det jeg har gjort er at ændre FormatNumber(iTotal*1.25,2) til FormatNumber(iTotal, 2). Den ganger altså ikke med 1.25 mere (hvilket vil svare til at ligge 25% oveni.
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:27 #2
Hele koden i øvrigt:
<%@ Language=VBScript %>
<% Session.LCID = 1030 %>
<%
Dim sSubject
Dim sBody, sBodyHtml
Dim iTotal, iXtraRengoring
iTotal = 0
iXtraRengoring = 0

'Ønsker vedr. rengøring
Dim bRengoringService, bRengoringGrill
If Request.Form("RengoringService") = "ON" Then
    bRengoringService = True
Else
    bRengoringService = False
End If
If Request.Form("RengoringGrill") = "ON" Then
    bRengoringGrill = True
Else
    bRengoringGrill = False
End If


sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Dato: " & Now & "</font><br>"

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Kunde oplysninger:</strong><br>"
sBodyHtml = sBodyHtml & "Kontaktperson: " & Chr(9) & Request.Form("Kontaktperson") & "<br>"
sBodyHtml = sBodyHtml & "Adresse: " & Chr(9) & Chr(9) & Request.Form("Adresse") & "<br>"
sBodyHtml = sBodyHtml & "Postnr.: " & Chr(9) & Chr(9) & Request.Form("Postnr") & "<br>"
sBodyHtml = sBodyHtml & "By: " & Chr(9) & Chr(9) & Chr(9) & Request.Form("By") & "<br>"
sBodyHtml = sBodyHtml & "Telefon nr.: " & Chr(9) & Request.Form("Telefon nr.") & "<br>"
sBodyHtml = sBodyHtml & "Email: " & Chr(9) & Chr(9) & Request.Form("Email") & "<br>"
sBodyHtml = sBodyHtml & "Bemærkninger: " & Chr(9) & Chr(9) & Request.Form("Bemærkninger") & "<br>"
sBodyHtml = sBodyHtml & "Levering: " & Chr(9) & Chr(9) & Request.Form("Levering") & "<br>" & "<br></font>"

'Overføre header til renell mail
sBodyRenell = sBodyHtml

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Din ordre:</strong></font>"

sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""> <strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

sBodyRenell = sBodyRenell & "<font size=""2"" face=""Verdana""><strong>Kundens ordre:</strong></font>"

sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

For each item In Request.Form
    If (LCase(Left(item, 5)) = "antal") And (IsNumeric(Request.Form(item))) Then
        sFormItemNumber = Replace(LCase(item), "antal", "")
             
        sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "</tr></table>"
     
        sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
        sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "</tr></table>"
     
        'Prisberegninger
        If IsNumeric(Request.Form("Stk. pris" & sFormItemNumber)) Then
            iPrice = FormatNumber(Request.Form("Stk. pris" & sFormItemNumber))
            iTotal = iTotal + (CDbl(iPrice)*Request.Form(item))
        End If
     
        'porcelæn & glas
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "04" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "06") Then
            'If not = ikke pris for salt og peber bøsse
            If Not Trim(Request.Form("Varenummer" & sFormItemNumber)) = "04-400" Then
                iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
            End If
        End If
     
        'Kaffe kander
        If bRengoringService And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-400" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-401") Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
     
        'bestik
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "07" Then
            iXtraRengoring = iXtraRengoring + .5*Request.Form(item)
        End If

        'skåle og fade
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "08" Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
     
        'kopper
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-1" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-2" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-3") Then
            iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
        End If
     
        'grill
        If bRengoringGrill And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-100" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-101") Then
            iXtraRengoring = iXtraRengoring + 350*Request.Form(item)
        End If
    End If
Next

'Tilføjer pris for rengøring
If iXtraRengoring > 0 Then
    'kundens mail
    sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyHtml = sBodyHtml & "</tr></table>"
 
    'renell mail
    sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
    sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyRenell = sBodyRenell & "</tr></table>"
End If

'Føjer rengørings omkostninger til total
If iXtraRengoring > 0 Then
    iTotal = iTotal + iXtraRengoring
End If

'Kørsel
If Request.Form("selKommune") = "Helsingør" Then
    'iPriceKorsel = FormatNumber(300, 2)
    iPriceKorsel = 300
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
ElseIf Request.Form("selKommune") = "Øvrige" Then
    iPriceKorsel = "?"
    iKorselComment = True
Else
    'iPriceKorsel = FormatNumber(400, 2)
    iPriceKorsel = 400
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
End If

'Divide by 100
'iTotal = (iTotal/100)  'Hack som fjernes

'kørsel kunde mail
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"
 
'kørsel renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Tilføjer total linie
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Denne antager priserne er incl moms.
'sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"
'sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Rette til at priserne er excl. moms.
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total excl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'Føjer total til renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Disse to angater alle priser er incl. moms
'sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"

'sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Her rettet til de er excl. moms som så ligges til
sBodyRenell = sBodyRenell & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal*1.25, 2) & "</strong></u></font></td>"

sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Om kørsel
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><i>OBS! Den oplyste pris er uden kørsel.</i></font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel indenfor Helsingør Kommune kr. 300,00 incl. Moms.</font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel til Fredensborg-Humlebæk, Græsted-Gilleleje, Karlebo og Hørsholm kommune kr. 400,00 incl. Moms.</font><br>"

'Forbehold
sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Med forbehold for prisændringer, fejl, m.m.</i></font><br><br>"
'Hvis kommune = øvrige
If iKorselComment Then
    sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, du vil blive kontaktet af Renell vedrørende prisen.</i></font><br><br>"
    sBodyRenell = sBodyRenell & "<br><br><font color=""red"" size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, kontakt kunden vedrørende prisen.</i></font><br><br>"
End if

'Hilsen
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Med venlig hilsen</font><br>"
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Servicefirmaet Renell A/S</font><br>"

'mail to website
Dim jmail
Set jmail = Server.CreateObject("JMail.smtpmail")
jmail.ServerAddress = "jaynet"
jmail.ContentType = "text/html"
jmail.AddRecipient "mads@renell.dk"
jmail.Sender = "postmaster@renell.dk"
jmail.SenderName = "Renell website"
jmail.Subject = "Bestilling på nettet"
jmail.Body = "<html><body>" & sBodyRenell & "</body></html>"
jmail.Execute
jmail.Close
Set jmail = Nothing

'html to customer
If Len(Request.Form("Email")) > 6 Then
    Set jmail = Server.CreateObject("JMail.smtpmail")
    jmail.ServerAddress = "jaynet"
    jmail.ContentType = "text/html"
    jmail.Sender = "postmaster@renell.dk"
    jmail.SenderName = "Renell website"
    jmail.Subject = "Bestilling hos Servicefirmaet Renell A/S"
    jmail.AddRecipient Request.Form("Email")
    jmail.Body = "<html><body>" & sBodyHtml & "</body></html>"
    jmail.Execute
    jmail.close
    Set jmail = Nothing
End If

%>
<html>
<head>
<title>Renell Service A/S</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="graphics/leftmenu_bg.gif" link="#032956" vlink="#000000" alink="#000000">
<table width="100%" border="0">
<tr>
<td width="100%" align="center"><font face="Verdana" size="2" color="#000000"><br><br>Deres bestilling er afsendt til Renell.</font></td>
</tr>
</table>
</body>
</html>
Avatar billede eagleeye Praktikant
07. april 2006 - 21:29 #3
husk moms udgør 20% af del fulde beløb.
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:31 #4
eagleeye: Man ligger 25% til, men trækker 20% fra. :)

basso: GLEMTE lige at rette den e-mail firmaet modtager!


Her er den rette kode:
<%@ Language=VBScript %>
<% Session.LCID = 1030 %>
<%
Dim sSubject
Dim sBody, sBodyHtml
Dim iTotal, iXtraRengoring
iTotal = 0
iXtraRengoring = 0

'Ønsker vedr. rengøring
Dim bRengoringService, bRengoringGrill
If Request.Form("RengoringService") = "ON" Then
    bRengoringService = True
Else
    bRengoringService = False
End If
If Request.Form("RengoringGrill") = "ON" Then
    bRengoringGrill = True
Else
    bRengoringGrill = False
End If


sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Dato: " & Now & "</font><br>"

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Kunde oplysninger:</strong><br>"
sBodyHtml = sBodyHtml & "Kontaktperson: " & Chr(9) & Request.Form("Kontaktperson") & "<br>"
sBodyHtml = sBodyHtml & "Adresse: " & Chr(9) & Chr(9) & Request.Form("Adresse") & "<br>"
sBodyHtml = sBodyHtml & "Postnr.: " & Chr(9) & Chr(9) & Request.Form("Postnr") & "<br>"
sBodyHtml = sBodyHtml & "By: " & Chr(9) & Chr(9) & Chr(9) & Request.Form("By") & "<br>"
sBodyHtml = sBodyHtml & "Telefon nr.: " & Chr(9) & Request.Form("Telefon nr.") & "<br>"
sBodyHtml = sBodyHtml & "Email: " & Chr(9) & Chr(9) & Request.Form("Email") & "<br>"
sBodyHtml = sBodyHtml & "Bemærkninger: " & Chr(9) & Chr(9) & Request.Form("Bemærkninger") & "<br>"
sBodyHtml = sBodyHtml & "Levering: " & Chr(9) & Chr(9) & Request.Form("Levering") & "<br>" & "<br></font>"

'Overføre header til renell mail
sBodyRenell = sBodyHtml

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Din ordre:</strong></font>"

sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""> <strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

sBodyRenell = sBodyRenell & "<font size=""2"" face=""Verdana""><strong>Kundens ordre:</strong></font>"

sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

For each item In Request.Form
    If (LCase(Left(item, 5)) = "antal") And (IsNumeric(Request.Form(item))) Then
        sFormItemNumber = Replace(LCase(item), "antal", "")
           
        sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "</tr></table>"
   
        sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
        sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "</tr></table>"
   
        'Prisberegninger
        If IsNumeric(Request.Form("Stk. pris" & sFormItemNumber)) Then
            iPrice = FormatNumber(Request.Form("Stk. pris" & sFormItemNumber))
            iTotal = iTotal + (CDbl(iPrice)*Request.Form(item))
        End If
   
        'porcelæn & glas
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "04" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "06") Then
            'If not = ikke pris for salt og peber bøsse
            If Not Trim(Request.Form("Varenummer" & sFormItemNumber)) = "04-400" Then
                iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
            End If
        End If
   
        'Kaffe kander
        If bRengoringService And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-400" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-401") Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
   
        'bestik
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "07" Then
            iXtraRengoring = iXtraRengoring + .5*Request.Form(item)
        End If

        'skåle og fade
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "08" Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
   
        'kopper
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-1" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-2" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-3") Then
            iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
        End If
   
        'grill
        If bRengoringGrill And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-100" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-101") Then
            iXtraRengoring = iXtraRengoring + 350*Request.Form(item)
        End If
    End If
Next

'Tilføjer pris for rengøring
If iXtraRengoring > 0 Then
    'kundens mail
    sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyHtml = sBodyHtml & "</tr></table>"

    'renell mail
    sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
    sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyRenell = sBodyRenell & "</tr></table>"
End If

'Føjer rengørings omkostninger til total
If iXtraRengoring > 0 Then
    iTotal = iTotal + iXtraRengoring
End If

'Kørsel
If Request.Form("selKommune") = "Helsingør" Then
    'iPriceKorsel = FormatNumber(300, 2)
    iPriceKorsel = 300
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
ElseIf Request.Form("selKommune") = "Øvrige" Then
    iPriceKorsel = "?"
    iKorselComment = True
Else
    'iPriceKorsel = FormatNumber(400, 2)
    iPriceKorsel = 400
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
End If

'Divide by 100
'iTotal = (iTotal/100)  'Hack som fjernes

'kørsel kunde mail
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'kørsel renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Tilføjer total linie
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Denne antager priserne er incl moms.
'sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"
'sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Rette til at priserne er excl. moms.
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total excl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'Føjer total til renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Disse to angater alle priser er incl. moms
'sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"

'sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Her rettet til de er excl. moms som så ligges til
sBodyRenell = sBodyRenell & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"

sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Om kørsel
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><i>OBS! Den oplyste pris er uden kørsel.</i></font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel indenfor Helsingør Kommune kr. 300,00 incl. Moms.</font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel til Fredensborg-Humlebæk, Græsted-Gilleleje, Karlebo og Hørsholm kommune kr. 400,00 incl. Moms.</font><br>"

'Forbehold
sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Med forbehold for prisændringer, fejl, m.m.</i></font><br><br>"
'Hvis kommune = øvrige
If iKorselComment Then
    sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, du vil blive kontaktet af Renell vedrørende prisen.</i></font><br><br>"
    sBodyRenell = sBodyRenell & "<br><br><font color=""red"" size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, kontakt kunden vedrørende prisen.</i></font><br><br>"
End if

'Hilsen
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Med venlig hilsen</font><br>"
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Servicefirmaet Renell A/S</font><br>"

'mail to website
Dim jmail
Set jmail = Server.CreateObject("JMail.smtpmail")
jmail.ServerAddress = "jaynet"
jmail.ContentType = "text/html"
jmail.AddRecipient "mads@renell.dk"
jmail.Sender = "postmaster@renell.dk"
jmail.SenderName = "Renell website"
jmail.Subject = "Bestilling på nettet"
jmail.Body = "<html><body>" & sBodyRenell & "</body></html>"
jmail.Execute
jmail.Close
Set jmail = Nothing

'html to customer
If Len(Request.Form("Email")) > 6 Then
    Set jmail = Server.CreateObject("JMail.smtpmail")
    jmail.ServerAddress = "jaynet"
    jmail.ContentType = "text/html"
    jmail.Sender = "postmaster@renell.dk"
    jmail.SenderName = "Renell website"
    jmail.Subject = "Bestilling hos Servicefirmaet Renell A/S"
    jmail.AddRecipient Request.Form("Email")
    jmail.Body = "<html><body>" & sBodyHtml & "</body></html>"
    jmail.Execute
    jmail.close
    Set jmail = Nothing
End If

%>
<html>
<head>
<title>Renell Service A/S</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="graphics/leftmenu_bg.gif" link="#032956" vlink="#000000" alink="#000000">
<table width="100%" border="0">
<tr>
<td width="100%" align="center"><font face="Verdana" size="2" color="#000000"><br><br>Deres bestilling er afsendt til Renell.</font></td>
</tr>
</table>
</body>
</html>
Avatar billede eagleeye Praktikant
07. april 2006 - 21:37 #5
Stadigvæk momsen udgør 20% af et beløb incl. moms.
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:40 #6
Ja? Og hvad så? Tænkte der måske var en fejl i koden et sted? Jeg har forsøgt at læse den igennem et par gange, men kan ikke finde fejlen? :) - Eller var det bare rent informativt?
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:42 #7
Har lige bemærket at der står at transporten ALLEREDE er inklusiv moms. Det skal lige rettes basso, men det kan du selv ;)

'Kørsel
If Request.Form("selKommune") = "Helsingør" Then
    'iPriceKorsel = FormatNumber(300, 2)
    iPriceKorsel = 300
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
ElseIf Request.Form("selKommune") = "Øvrige" Then
    iPriceKorsel = "?"
    iKorselComment = True
Else
    'iPriceKorsel = FormatNumber(400, 2)
    iPriceKorsel = 400
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
End If

iPriceKorsel som skal have trukket 20% fra...
Avatar billede eagleeye Praktikant
07. april 2006 - 21:42 #8
Ja en fejl i udregningen af hvad moms'en udgør af det fylde beløb, der står .25 da beløbet var uden moms.

sBodyRenell = sBodyRenell & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:45 #9
Du har ret ;) - Den skal da selvfølgelig være 0.20...
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:47 #10
Kan vi blive enige om følgende så? :)

<%@ Language=VBScript %>
<% Session.LCID = 1030 %>
<%
Dim sSubject
Dim sBody, sBodyHtml
Dim iTotal, iXtraRengoring
iTotal = 0
iXtraRengoring = 0

'Ønsker vedr. rengøring
Dim bRengoringService, bRengoringGrill
If Request.Form("RengoringService") = "ON" Then
    bRengoringService = True
Else
    bRengoringService = False
End If
If Request.Form("RengoringGrill") = "ON" Then
    bRengoringGrill = True
Else
    bRengoringGrill = False
End If


sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Dato: " & Now & "</font><br>"

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Kunde oplysninger:</strong><br>"
sBodyHtml = sBodyHtml & "Kontaktperson: " & Chr(9) & Request.Form("Kontaktperson") & "<br>"
sBodyHtml = sBodyHtml & "Adresse: " & Chr(9) & Chr(9) & Request.Form("Adresse") & "<br>"
sBodyHtml = sBodyHtml & "Postnr.: " & Chr(9) & Chr(9) & Request.Form("Postnr") & "<br>"
sBodyHtml = sBodyHtml & "By: " & Chr(9) & Chr(9) & Chr(9) & Request.Form("By") & "<br>"
sBodyHtml = sBodyHtml & "Telefon nr.: " & Chr(9) & Request.Form("Telefon nr.") & "<br>"
sBodyHtml = sBodyHtml & "Email: " & Chr(9) & Chr(9) & Request.Form("Email") & "<br>"
sBodyHtml = sBodyHtml & "Bemærkninger: " & Chr(9) & Chr(9) & Request.Form("Bemærkninger") & "<br>"
sBodyHtml = sBodyHtml & "Levering: " & Chr(9) & Chr(9) & Request.Form("Levering") & "<br>" & "<br></font>"

'Overføre header til renell mail
sBodyRenell = sBodyHtml

sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><strong>Din ordre:</strong></font>"

sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""> <strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

sBodyRenell = sBodyRenell & "<font size=""2"" face=""Verdana""><strong>Kundens ordre:</strong></font>"

sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana""><strong>Varenr.:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana""><strong>Varenavn:</strong></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><strong><font size=""2"" face=""Verdana"" align=""right"">Stk. pris kr.:</font></strong></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><strong><font size=""2"" face=""Verdana"">Antal:</font></strong></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

For each item In Request.Form
    If (LCase(Left(item, 5)) = "antal") And (IsNumeric(Request.Form(item))) Then
        sFormItemNumber = Replace(LCase(item), "antal", "")
         
        sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyHtml = sBodyHtml & "</tr></table>"
 
        sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
        sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16""><font size=""2"" face=""Verdana"">" & Request.Form("Varenummer" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"">" & Request.Form("Varenavn" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & Request.Form("Stk. pris" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">" & Request.Form("Antal" & sFormItemNumber) & "</font></td>"
        sBodyRenell = sBodyRenell & "</tr></table>"
 
        'Prisberegninger
        If IsNumeric(Request.Form("Stk. pris" & sFormItemNumber)) Then
            iPrice = FormatNumber(Request.Form("Stk. pris" & sFormItemNumber))
            iTotal = iTotal + (CDbl(iPrice)*Request.Form(item))
        End If
 
        'porcelæn & glas
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "04" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "06") Then
            'If not = ikke pris for salt og peber bøsse
            If Not Trim(Request.Form("Varenummer" & sFormItemNumber)) = "04-400" Then
                iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
            End If
        End If
 
        'Kaffe kander
        If bRengoringService And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-400" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "05-401") Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
 
        'bestik
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "07" Then
            iXtraRengoring = iXtraRengoring + .5*Request.Form(item)
        End If

        'skåle og fade
        If bRengoringService And Left(Trim(Request.Form("Varenummer" & sFormItemNumber)), 2) = "08" Then
            iXtraRengoring = iXtraRengoring + 1.5*Request.Form(item)
        End If
 
        'kopper
        If bRengoringService And (Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-1" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-2" Or Left(Trim(Request.Form("Varenummer" & sFormItemNumber)),4) = "05-3") Then
            iXtraRengoring = iXtraRengoring + 1*Request.Form(item)
        End If
 
        'grill
        If bRengoringGrill And (Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-100" Or Trim(Request.Form("Varenummer" & sFormItemNumber)) = "10-101") Then
            iXtraRengoring = iXtraRengoring + 350*Request.Form(item)
        End If
    End If
Next

'Tilføjer pris for rengøring
If iXtraRengoring > 0 Then
    'kundens mail
    sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyHtml = sBodyHtml & "</tr></table>"

    'renell mail
    sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
    sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Rengøring af service, grill, m.m.</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iXtraRengoring, 2) & "</font></td>"
    sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
    sBodyRenell = sBodyRenell & "</tr></table>"
End If

'Føjer rengørings omkostninger til total
If iXtraRengoring > 0 Then
    iTotal = iTotal + iXtraRengoring
End If

'Kørsel
If Request.Form("selKommune") = "Helsingør" Then
    'iPriceKorsel = FormatNumber(300, 2)
    iPriceKorsel = 240
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
ElseIf Request.Form("selKommune") = "Øvrige" Then
    iPriceKorsel = "?"
    iKorselComment = True
Else
    'iPriceKorsel = FormatNumber(400, 2)
    iPriceKorsel = 320
    iTotal = iTotal + iPriceKorsel
    iKorselComment = False
End If

'Divide by 100
'iTotal = (iTotal/100)  'Hack som fjernes

'kørsel kunde mail
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'kørsel renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Kørsel</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right"">" & FormatNumber(iPriceKorsel,2) & "</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Tilføjer total linie
sBodyHtml = sBodyHtml & "<table width=""89%""  border=""1"" bordercolor=""#AAAFB4""><tr>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" height=""16"" bgcolor=""#F0F0F0"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Denne antager priserne er incl moms.
'sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"
'sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Rette til at priserne er excl. moms.
sBodyHtml = sBodyHtml & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total excl. moms (moms udgør " & FormatNumber(iTotal*0.25, 2) & "):</font></td>"
sBodyHtml = sBodyHtml & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
sBodyHtml = sBodyHtml & "    <td width=""11%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyHtml = sBodyHtml & "</tr></table>"

'Føjer total til renell mail
sBodyRenell = sBodyRenell & "<table width=""89%""  border=""0""><tr>"
sBodyRenell = sBodyRenell & "    <td width=""11%"" height=""16"">&nbsp;<font size=""2"" face=""Verdana""></font></td>"
'Disse to angater alle priser er incl. moms
'sBodyRenell = sBodyRenell & "    <td width=""63%""><font size=""2"" face=""Verdana"" align=""right"">Total incl. moms (moms udgør " & FormatNumber(iTotal-iTotal*0.75, 2) & "):</font></td>"

'sBodyRenell = sBodyRenell & "    <td width=""15%""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"
'Her rettet til de er excl. moms som så ligges til
sBodyRenell = sBodyRenell & "    <td width=""63%"" bgcolor=""#DEE0E4""><font size=""2"" face=""Verdana"" align=""right"">Total excl. moms (moms udgør " & FormatNumber(iTotal*0.20, 2) & "):</font></td>"
sBodyRenell = sBodyRenell & "    <td width=""15%"" bgcolor=""#F0F0F0""><font size=""2"" face=""Verdana"" align=""right""><u><strong>" & FormatNumber(iTotal, 2) & "</strong></u></font></td>"

sBodyRenell = sBodyRenell & "    <td width=""11%""><font size=""2"" face=""Verdana"">&nbsp;</font></td>"
sBodyRenell = sBodyRenell & "</tr></table>"

'Om kørsel
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana""><i>OBS! Den oplyste pris er uden kørsel.</i></font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel indenfor Helsingør Kommune kr. 300,00 incl. Moms.</font><br>"
'sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Kørsel til Fredensborg-Humlebæk, Græsted-Gilleleje, Karlebo og Hørsholm kommune kr. 400,00 incl. Moms.</font><br>"

'Forbehold
sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Med forbehold for prisændringer, fejl, m.m.</i></font><br><br>"
'Hvis kommune = øvrige
If iKorselComment Then
    sBodyHtml = sBodyHtml & "<br><br><font size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, du vil blive kontaktet af Renell vedrørende prisen.</i></font><br><br>"
    sBodyRenell = sBodyRenell & "<br><br><font color=""red"" size=""1"" face=""Verdana""><i>Der er ikke medregnet pris for kørsel i dette tilbud, kontakt kunden vedrørende prisen.</i></font><br><br>"
End if

'Hilsen
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Med venlig hilsen</font><br>"
sBodyHtml = sBodyHtml & "<font size=""2"" face=""Verdana"">Servicefirmaet Renell A/S</font><br>"

'mail to website
Dim jmail
Set jmail = Server.CreateObject("JMail.smtpmail")
jmail.ServerAddress = "jaynet"
jmail.ContentType = "text/html"
jmail.AddRecipient "mads@renell.dk"
jmail.Sender = "postmaster@renell.dk"
jmail.SenderName = "Renell website"
jmail.Subject = "Bestilling på nettet"
jmail.Body = "<html><body>" & sBodyRenell & "</body></html>"
jmail.Execute
jmail.Close
Set jmail = Nothing

'html to customer
If Len(Request.Form("Email")) > 6 Then
    Set jmail = Server.CreateObject("JMail.smtpmail")
    jmail.ServerAddress = "jaynet"
    jmail.ContentType = "text/html"
    jmail.Sender = "postmaster@renell.dk"
    jmail.SenderName = "Renell website"
    jmail.Subject = "Bestilling hos Servicefirmaet Renell A/S"
    jmail.AddRecipient Request.Form("Email")
    jmail.Body = "<html><body>" & sBodyHtml & "</body></html>"
    jmail.Execute
    jmail.close
    Set jmail = Nothing
End If

%>
<html>
<head>
<title>Renell Service A/S</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="graphics/leftmenu_bg.gif" link="#032956" vlink="#000000" alink="#000000">
<table width="100%" border="0">
<tr>
<td width="100%" align="center"><font face="Verdana" size="2" color="#000000"><br><br>Deres bestilling er afsendt til Renell.</font></td>
</tr>
</table>
</body>
</html>
Avatar billede eagleeye Praktikant
07. april 2006 - 21:53 #11
Nej for nu har trykket moms fra kørsel.
Avatar billede pvtsommer Nybegynder
07. april 2006 - 21:55 #12
Ja, for alle beløb skal da være ekslusiv moms, når det vises eksklusiv moms?!?!?!
Avatar billede eagleeye Praktikant
07. april 2006 - 22:02 #13
Jeg kan se du har rettet det til at stå Total pris excl. moms... Før stod der Total pris incl. moms

Jeg har læst det sådan at moms er incl i beløbet. Og moms er blevet lagt på to gange.

Så spørgsmålet er om total prisen (iTotal) er incl. eller excl. moms?
Avatar billede bassa Nybegynder
08. april 2006 - 09:50 #14
Eagleeye -> Du har helt ret, Eagle. Moms er blevet lagt på 2 gange. Alle beløb på de forskellige produkter i selve scriptet er allerede INKL. Moms. Dvs., at den lægger Moms på 2 gange. De 3-400 kr. for Kørsel er OGSÅ inkl. Moms.

Den ekstra Moms pålægning skal fjernes, så der skal bare stå på faktura hvad Moms-beløbet udgør af de forskellige produkter tilsammen.


Mvh
BassA ;)
Avatar billede bassa Nybegynder
08. april 2006 - 10:41 #15
Nå, men jeg har selv fået bakset rundt i scriptet for at prøve at rette fejlen, og det ser ud til at lykkes.

Vender frygteligt tilbage hvis nu jeg er ude at skide igen! ;)


Cheers!
Bassa
Avatar billede eagleeye Praktikant
08. april 2006 - 10:52 #16
Ok ;)
Avatar billede bassa Nybegynder
21. april 2006 - 07:02 #17
Eagleeye -> svar for point.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester