1 Closed tickets

Tickets ended, tickets closed successfully

The most important parameters of the tickets closed are:

  • Number: It is unique, it is composed of the store, the series of the document type and a sequential numerator.
  • Store code: The code of the store that made the ticket.
  • Terminal identifier: The identifier of terminal that made the ticket.
  • Employee identifier: The identifier of the employee that made the ticket.
  • Customer identifier: The identifier of the customer that made the ticket. In mode EPOS it's optional, in moe ECOM is required.
  • ticket discount: Global discount percentage of the ticket.
  • Identifier of promotion: Related to main promotions.
  • Taxes: Total amount of ticket-taxes.
  • Total: Total amount of ticket with taxes.
  • Type: type of document, related to 'Document types' (Sale,Return, Reservation...)
  • State: [2] Ended, [3] Canceled, [4] Historified
  • Processed: Used only in server side to mark a ticket as processed.
  • Accounted: Indicative ticket is accounted.
  • Cashaudit: Indicative ticket is cashaudit.
  • Date start: Initial date of ticket.
  • Date end: Ended date of ticket.
  • Message: Used at validation process to allow or not ending the ticket, if message is informed by XUDP: pos_ticket_validate, then the ticket can't be ended showing the message.
  • Source document: The origin ticket-number. In Returns the source is the origin sale.

Aditional info:

Object also show extended info as:

  • Invoice: When an invoice ticket is requested. Show the invoice number and the customer.
  • Products: Products purchased with the ticket.
  • Payments: Payments used with the ticket. Cash, cards and vouchers.
  • Taxfree: When an taxfree ticket is requested. Show taxfree information.

Note

Closed tickets can't be modified or deleted from system.

Only the parameters accounted, processed, cash audit can be modified.



pos_ticketh
Label Description
Ticket Id Ticket Identifier
Terminal ID Terminal identification
Document type Document type
Number Number of ticket
Employee Id Employee Identifier
Customer ID Customer Identifier
promo_id
Source document Source document
Start date Start date of Ticket
End date End date of ticket
Status Receipt status

  • Default: 0
  • Values:
    • 0: Open. Open
    • 1: Paused. Paused
    • 2: Ended. Ended
    • 3: Cancelled. Cancelled
    • 4: Historified.
Processed Indicates if the receipt has already been procesed

  • Default: 0
  • Values:
    • 0: false.
    • 1: true.
Employee modified Employee has modified the dto. gen

  • Values:
    • 0: false.
    • 1: true.
Cashaudit Ticket is cashaudit

  • Default: 0
  • Values:
    • 0: false.
    • 1: true.
Accounted Indicative ticket was accounted in a process of accounting

  • Default: 0
  • Values:
    • 0: false.
    • 1: true.
Notes
Hash key Hash key generated for the document
Discount Global ticket discount
Taxes Total taxes
Total amount Total amount

2 Before closing ticket

Before closing a ticket, system allow to customize a procedure as a validating ticket.

Procedure: pos_ticket_validate

Copy
<!-- ======================================================================= -->
<!--                                                                         -->
<!--   XUDP: pos_ticket_validate                                             -->
<!--                                                                         -->
<!--   Customizable XUDP.                                                    -->
<!-- Executed before closing the ticket and printing.                        -->
<!--   At the end we call the pos_get_ticket_status function                 -->
<!--   to know if there are messages at ticketh_open and ticketl_open tables.-->
<!--                                                                         -->
<!--   Write errors to pos_ticketl_open.line_message or                      -->
<!--   pos_ticketh_open.ticket_message columns and                           -->
<!--   the function pos_get_ticket_status will retrieve them in the call     -->
<!--   before close.                                                         -->
<!-- ======================================================================= -->
<procedure name='pos_ticket_validate'>
    <args>
        <arg name='p_ticket_id'       like='pos_ticketh_open.ticket_id' mode='in'  />
        <arg name='o_ticket_status'   type='integer'                    mode='out' />
    </args>

    <define>
        <variable name='m_linid'          like='pos_ticketl_open.linid'  />
        <variable name='m_product_id'     like='pos_ticketl_open.product_id'  />
        <variable name='m_product_active' like='pos_product.product_active'   />
    </define>

    <body>
        
        <!-- ================================== -->
        <!-- CUSTOMIZABLE BODY CODE STARTS HERE -->
        <!-- ================================== -->
        
        
        <!-- ================================ -->
        <!-- CUSTOMIZABLE BODY CODE ENDS HERE -->
        <!-- ================================ -->
        
        
        <execute-function name='pos_get_ticket_status' into='o_ticket_status'>
            p_ticket_id
        </execute-function>  
    </body>
</procedure>