Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

SQL receipt Printer Function

Options
  • 07-02-2007 3:03pm
    #1
    Registered Users Posts: 2,953 ✭✭✭


    Hello,

    Basically i have a receipt layout saved as a .txt file. Here it is:

    //Start of Code :

    &format_datetime=mm/dd/yyyy hh:nn:ss AM/PM
    &format_numtoword=North America
    &header
    ^L
    Please Retain This Receipt. The waitress
    Will Call out the last 2 digits of the
    Order No Below When your order is ready
    ^L
    ^C^WOrder No#: &trans_num
    &date_time
    ^L
    Quan Description Cost
    ^L
    &section_detail
    &item_quantity:4 &item_descr:-23&item_cost:12
    &section_end
    ^L

    Net Totals:&net_total:15
    &tax1_descr:25&skip_zero&tax1:15
    &tax2_descr:25&skip_zero&tax2:15
    &tax3_descr:25&skip_zero&tax3:15
    &tax4_descr:25&skip_zero&tax4:15
    &tax5_descr:25&skip_zero&tax5:15
    TIP:&tip:15
    ==============
    ^C^W TOTAL:&total_with_tip:10

    &_
    &section_seating
    &seating_descr &seating_total
    &section_end

    &section_payment
    &payment_descr:-28&payment_total:12
    &section_end

    &footer
    //Start of Code :

    I have a little experience in database queries but not with SQL. This system is run of SQL, its an Electronic Point Of Sale System (EPOS) running on windows 2000 and the above code is the receipt layout. Just so as you know the ^L tells the receipt printer to draw a line and ^c^w means wide print and centered.

    Now on to what i want to achieve

    I have a cafe and someone places the order, they get a receipt and a receipt goes to the Kitchen and/or Deli counter. Each receipt would have the same transaction no like #12563 for example. The transaction # increases indefinetely and cannot be reset. When the customer places the order they get a reciept and take a seat, when the order is ready in the kitchen the waitress will call out the number when they are on the floor and the customer will check there ticket and call the waitress if its their order no#.

    Unfortunately the transaction no is a 5 digit code and this is a bit awkward as id rather a 2 digit code. Is there anyway to set this up. Im thinking like setting up a loop starting at 1 and running to 99 so i will always have a unique number. I expect that this function might need to be done outside of the receipt layout so it might not work.

    Is there any way i could use the following function to make a unique No:

    &format_datetime=mm/dd/yyyy hh:nn:ss AM/PM

    Has anyone any ideas. I know i could just tell the customer we will call the last 2 digits of the transaction number and i can write this note on the receipt but id rather do it right.


Advertisement