...

View Full Version : creating an invoice



af11kcc
10-04-2003, 09:15 AM
Hi, I need to create an invoice manually using ASP.

SKU QTY DESCRIPTION UNIT PRICE TOTAL PRICE

QTY and UNIT PRICE are <input> fields.

1.- I scan the barcode of the product, I look up the product description and insert a line on a database containing the SKU, QTY = 0, DESC = DESC, UNIT PRICE = 0, TOTAL PRICE = 0

2.- I reload the page and display the header and the line created

SKU QTY DESCRIPTION UNIT PRICE TOTAL PRICE
123....[ ]..123 Description[ ]

3.- I enter the QTY and UNIT PRICE (Which is always variable).
Calculate TOTAL PRICE = QTY * UNIT PRICE

Update these values on the inserted record, reload to show the changes...

This works fine, but when I have 50 or more lines the page is taking too long to refresh...

Can you recommend a more efficient way to do this?

I was thinking on an iframe or something to avoid reloading the page each time....

Thanks in advance.

Toobad
10-08-2003, 02:18 PM
Do the calculation when you retrive the data row back. There is no need to get the total line price then save it and bring it back.

I suggest Response.Writing the result of the calculation per row rather than storing it. Obviously you can not calculate the price on the initial insert due to the quantity.

af11kcc
10-08-2003, 07:37 PM
Thanks for your suggestion...
At the moment the approach to solve the problem has changed to adding an iframe to retrieve the product info without reloading the whole page...
Within the iframe I have input boxes for quantity and price, I perform the calculation and after that I reload the main page and insert the new line...
The edit mode has become a chalenge, if I click on an item the item info loads into the iframe and after changing the data I refresh the page again...
I was also thinking on using some kind of flag to detect changes on each row and then update only those rows that have changed instead of updating all the rows wasting precious time...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum