Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2003
    Location
    19° 26' N, 99° 7' W
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    creating an invoice

    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.
    Last edited by af11kcc; 10-04-2003 at 09:25 AM.

  • #2
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Toobad

  • #3
    New Coder
    Join Date
    Oct 2003
    Location
    19° 26' N, 99° 7' W
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •