Assigning An Invoice Number To An Order

I am trying to assign an invoice number to orders that are made on my website so that i can combine multiple order numbers into one invoice number. Here is the code i am using to insert the invoice number into the orders table.

It works if there is only one order in the table but if you try and order again it multiplies the orders by the number of invoice rows for example if there was 3 invoice fields it would add the same order 3 times into the order table. Its got stuck in some sort of loop. Code:

View Replies


ADVERTISEMENT

Invoice Number

i am doing an shopping cart project and i am stuck at generating an unique cart id which will also be the invoice number. and that it should not be random but should start from 1000 and then go on. so, guyz if u can give me the code or help me with this let me know at the earliest.

is this a good way to generate or should generate cart id with session.sessionid and should generate invoice no starting from 1000 and so on. if this is also ok. then plz let me know how to generate invoice no.

View Replies View Related

How Create Invoice Number

how do i create an invoice no with addition.. sample of my code.. which is not working...
Code:


if rs.EOF then
invoiceno="fm1193-01"
else
rs.movelast
lastinvoiceno=rs("Invoice Number")
invoiceval=trim(mid(lastinvoiceno,3,6))
invoiceval=CLng(invoiceval)+1
invoiceno="fm1193-01" & invoiceval
end if
rs.AddNew
rs("Invoice Number")=invoiceno
rs.Update

View Replies View Related

Invoice Number In Shopping Cart

I have a ASP shopping cart web site with Access db. I need to assign an invoice number (1,2,3,4 etc.) to orders which have status "completed" ("invoice number" used only to count completed orders and different from OrderID, which is unique).

Also, if i change status from completed to something else (in case if it was completed by mistake) then the invoice number from that order will be available for the next completed order. I am not sure if it's possible. I need it for tax dep. they don't except a list with missing invoice numbers.

View Replies View Related

Order By Number

Everytime I try to pull a query and order it by the price of something, 1123 comes before 300.

It just makes no sense, all that I can think of is that it is ordering by the first digit of the number. Is there anyway to sort it the right way having 300 come before 1123 when you want to sort it in lowest to highest numbers? Code:

<%
Set rsTest = Server.CreateObject("ADODB.Recordset") rsTest.Open " Select * from special WHERE CURDATE() <= dat AND line='me' ORDER BY price asc limit 0,1",conn
if NOT rsTest.EOF then
do while NOT rsTest.EOF
%>

View Replies View Related

Order Number

how i can have a number which can be generated gradually instead of randomly. I have a script for order number in my transaction page but it generates in random. we prefer order number generated gradually cos random numbers will be hard to trace should we ever need to retrieve it. okay here is the script Code:

Dim MyNewRandomNum
Randomize
MyNewRandomNum = Round(Rnd * 100000000000)+1

strTitle = "Customer ID: " &Cust_Id & "--" & Cust_Name & " " & Cust_FirstName & " " &Cust_LastName & " has made purchases from Mellon Commercial Pte Ltd. " & "on " & date() & "--" & time() & "<br>" & "PURCHASE ID: " &Trim(MyNewRandomNum) & "<BR>"
strLine= strLine&

View Replies View Related

Order By (number/number2) Not Exact

Here's the problem I'm running into:Code:

Set RS = Conn.Execute("SELECT TOP 10 id, score, numvotes FROM [user] WHERE active = '1' ORDER BY (score/numvotes) DESC")
Simple query, nothing to fancy. However it doesn't order highest to lowest correctly. Here's a sample output:

10.00
10.00
9.63
8.00
8.25
8.00
7.00
7.82
7.42
7.86

As you can see it's not correctly ordered from highest to lowest.

View Replies View Related

Producing An Invoice

I have just finished writing my site in ASP with Access I thought it would be useful to continue using this technology to create this invoice. Basically the details will be added to the invoice by retrieveing records from a database or creating new ones.

What I am looking for advice is regarding the end product, i.e. the printed invoice. I should be able to format the page correctly so that it prints to A4, but my concern is what about the header and footer information that the user controls.

I don't want any of this information to appear on the print out therefore I'm wondering if there are any other options that I can look at for producing this invoice. for example is it possible to create a properly laid out word document or pdf from the data?

View Replies View Related

Invoice Calulating Problems

The first page I`m calculating all the units fields and add them
to the second page as total without VAT and works fine, Code:

<input type="hidden" name="tphtva" value="<%=tfp1+tfp2+tfp3+tfp4+tfp5+tfp6+tfp7+tfp8+tfp9+tfp 10%>">

but the 3th page I want to calculate the VAT Code:

<%=Request.Form("tphtva")%>

and I get the error anitel/verify_invoice_2.asp, line 254 where the ]<%=Request.Form("tphtva")%> is.... where I`m wrong...

View Replies View Related

Generate An Invoice From Data

I need to be able to generate an invoice from an ASP page. Currently, the invoice is drawn in a web page and my client prints the page from their browser. This doesn't work too well in terms of graphics resolution and also requires endless positioning tweaking on my part.

Is there a way to use Word or Excel on the client, and send the invoice data down so that some sort of invoice template could be used? This needs to work on a Mac and ideally on a PC as well. The client machines have Office installed. I'm thinking this would be the best way to eliminate the positioning and resolution problems.

View Replies View Related

Assigning Values

I know I can use

Dim Array1(item1,item2,item3)
Session("Array2") = Array1

To copy a local array to a session array. What syntax do I use to copy a local array to another local array (without using a loop to load each element)?

View Replies View Related

Assigning The Result

How can I assign the result of a SQL-query to an ASP variable? This is what I have so far but it doesn't seem to work. Code:

dim strSQL
strSQL="select TestID FROM TestID_Description WHERE CL1='" &Request.Form("CL1")& "' AND CL2='" &Request.Form("CL2")& "'AND CL3='" &Request.Form("CL3")& "'AND CL4='" &Request.Form("CL4")& "'AND CL5='" &Request.Form("CL5")& "'AND CL6='" &Request.Form("CL6")& "'"
objRS("TC_Number")=objConn.execute(strSQL)

Maybe it's interesting to know that TC_Number is the primary key of the table.

View Replies View Related

Assigning An ASP Object To A Jscript Var

I have an ASP variable containing an XML object, i want to pass this object to a javascript object .... how can i do that?

one solution i know of is to write the xml in the page as an xml island and retriving this code using the document.getElementById....

is there another way where i can do that directly?

View Replies View Related

Using Checkbox For Assigning Items

I have a catalog of books which need to be categorized into different
groups. Some of the books can be listed under more than one category.
I'm creating a page where I can assign a group of books to a category
by checking the checkbox next to their name (say I've looped out 100
of them, and check some, and not others) then submitting the form for
processing, so that those titles where the checkbox is checked will
get the categoryid number assigned to them on a one-to-many table

I need to know how to read the checkbox value as it comes in if it is
selected or not, if it is, I'll send the isbn in one direction, and if
not, I won't send it at all.

So, how would I read this on the sheet that grabs the values?

View Replies View Related

Assigning Variable Value In Global.asa

I'd like to have a variable that I assign a value to for an entire website. It's a variable that contains the DSN name for my ADODB Connection.

This variable value is necessary on every page on the website. Is it incorrect to assign a variable the value in global.asa so it just stays for the entire site?

View Replies View Related

Assigning Values In A While Loop

I don't know if this is possible, but I have a Do While Not rs.EOF loop that is pulling values from a SQL database and writes it to an html form. I'm trying to figure out how to tally the values as they are siphoned from the database -- I'm assuming I have to set a unique variable equal to that value as it goes through the loop, but I'm not certain how to pull it off. Code:

View Replies View Related

Assigning A Default Value To A Function-variable

Well, it's quite simple, it's easily done in C, but in ASP (and VB in
general) i haven't been able to see it done...

function setvalues(var1, var2="a", var3="b")
if var2="a" then
response.write("Var2 wasn't defined")
end if
if var3="b" then
response.write("Var3 wasn't defined")
end if
end function

I hope it makes sense, and that someone has the solution to it...

View Replies View Related

Assigning A Boolean Of True Or False To VBScript Variable...

Is there a way I can assign a value of true or false to a VBScript variable? I have a function where I want to initiate a value of false: Would this work? Code:

View Replies View Related

Convert Real Number Into Text Number

I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?

View Replies View Related

Sequential Number After Batch Number

here is the scenerio

in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003

Now each master batch can have multiple final mixed batch like

200701-0001-01
200701-0001-02
200701-0001-03

and this record is inserted in to fmix table.

so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,

how to achieve this

so in short each master batch will have more than one final mixed batch.

pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.

View Replies View Related

Retrieve The Error Number In VB With Err.Number

I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.

How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?

View Replies View Related

SQL: How To Use WHERE And ORDER BY?

I have a code looking like this, but i can't seem to get it to work:

strSQL = "SELECT * FROM files WHERE Subject = 1 ORDER BY ID DESC"

What am i doing wrong?

View Replies View Related

Order By A-z

This is a follow up to a question I asked two weeks ago which I thought was solved but on further inspection I realised it wasn't working fully. I have an ORDER BY on my search results page, the search uses two dropdown menus, the first one is start character (A-Z), and the other is grade.

The problem I have is that the ORDER BY work perfectly when I leave the start character dropdown blank, and when I use the grade selection dropdown, but when I select a start character I get this error message:

Microsoft JET Database Engine error '80040e14'

Characters found after end of SQL statement.

/html/advanced_comic_search.asp, line 56

Can any one shed any light on this for me?

View Replies View Related

SQL Order

I have records which I want to display a certain way, i.e. the records are in the database like this:

24TR
9L
133JF

But I want to display them as:

9L
133JF
24TR

Is it possible?

View Replies View Related

SQL Order

I am using an sql inner join like below:

strSQL = "SELECT * FROM tblPage INNER JOIN tblNews ON tblNews.NewsID=tblPage.pageID ORDER BY newsDate DESC"

However this orders both by newsDate which causes problems with the ordering of the page, As I want the page not to be ordered just the news item.

View Replies View Related

ORDER BY By Id

An ASP page outputs data from the query
"Select ThisAndThat from comments WHERE pageURL='" & pageURL & "' ORDER BY
threadID, datesent"
(Access mdb)
threadID is a string (OK, I know!), which means that 103 displays before 99.
Is there a way to write the SQL query to order them numerically? This would
be much easier for me than changing the data type and hunting down every
page that INSERTS or UPDATES the db.

View Replies View Related

Going To The Next Order

I am extremely confused about how i should go about doing this:
I have puled out current orders and have displayed in a table .These orders have their own order numbers.

Once the person clicks on first order,the order is displayed in a form,where the user can edit the order details and hit submit.

Now when he hits submit ,I want his to go the previous page where the orders are displayed in table ,so that he can click on the next order and process it/OR may be whent he user hits submit ,i want the next order directly to be displayed in the form.

View Replies View Related

Not Considering 0 (zero) Using Order By!

I have a table in my database with several numbers.(2, 5, 8, 0, 9, 0).Now i retrieve the numbers to my page using "order by numbers", and my page look like this.

0
0
2
5
8
9

I want the lowest number to be first, but if the number is 0 (zero) I want it to go to the bottom.Can that be done

View Replies View Related

SQL Order By

At the moment I have:

SQL = "SELECT sample.* FROM sample WHERE (id = " & teamid & ") ORDER by pos"

Which orders my players like:
ATT
DEF
GK
MID
in alphabetical order.

Is there anyway to specify this order so that it still orders the players by "pos"(position) but in this order:

GK
DEF
MID
ATT

View Replies View Related

Order By NUM

i want to order by NUMBERS:

BUS n 1
bus n 2
ect.
bus n 10 bus n 11

But the order goes like this:
bus n 1
bus n 10
bus n 11
bus n 2
how can i get right order:
bus n 1
bus n 2
bus n 10
bus n 11 ....

View Replies View Related

Order By Where....

I am performing a basic sql query. select * from tablename order by featured asc, id asc

BUT...I want all those listings with FEATURED as a Y to show up first.
All other listings should show up afterwards.

How do I do this? I may be thinking too hard about it.

View Replies View Related

SQL Order BY Question

I have one table wich has a unique ID feild for each record and other feilds, and another table that has one field that is a number that contains the an ID from the other table and another field that contains some text.

I want to open with sql the first table, but order its records alphabetically by the text in the second table. is it possible? Code:

View Replies View Related

Changing Order

I have used ASP for years using MS Access and have used MSSQL quite a lot as
well. I have never came across something like this before.

MSSQL table names and types:

ProductName nvarchar
ShortDescription nText
ThumbNail nvarchar
etc

When I have the recordset in the order as follows, all works well:
(Recordset2.Fields.Item("ProductName").Value)
(Recordset2.Fields.Item("ShortDescription").Value)
(Recordset2.Fields.Item("Thumbnail").Value)

Though if I have the Thumbnail first the description does'nt show.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved