Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Micros 3700 LoadKyBdMacro Invalid Entry

Status
Not open for further replies.

mvelazquez

Technical User
Mar 14, 2015
115
0
16
MX
We have a SIM to generate cash withdrawals with certain characteristics using Pickups, the problem is that on some occasions when reaching the line where the Pickup is made with the Tender 602 the system shows invalid entry and continues with the code.

I have identified that having an open Check affects but I have already taken measures to detect and request to cancel it but still they continue to report me cases but I cannot identify what other problems cause it or if there is a way to catch it, if there was an error and how to stop the code with an additional message.

Code:
LoadKyBdMacro Cash_Pickup, MakeKeys(CASH_AMNT), @Key_Enter

/////////IF Invalid  Entry it's detected after this line exitwitherror!!!
    			
      				Call Ultimo_retiro( 2 )
				Call UnloadDLL
     				Call Load_ODBC_DLL
        			Call ConnectDBRetiros
				Call Agrega_Retiro_Bd
				Call Lee_Folio
			        Call Imprime_Ficha
 
What is the Cash_Pickup value?

Specialist in creating custom applications for the Micros POS range: 3700, 9700, Simphony FE, Simphony. SIM Scripts, Data Exports, Simphony extension applications, API Creation and integration. If you need anything please contact me via my website
 

@CathalMF

This is the Value

Cash_Pickup = Key(9, 602)

Here a little more detail of the function:

Code:
Sub Retiro_Pesos

       //////////////////        RETIRO DE EFECTIVO PESOS    //////////////

      Var Cash_Pickup 	 : Key
      Var Numeric_Screen : N4    = 0
      Var CASH_AMNT	     : $10   = 0
      Var Campo_01       : A100  = ""
      Var Sql            : A100  = ""
      Var hODBCDLL       : N12   = 0
 	Var HaloLine         : A70
  	Var PromptLine       : A40

      	MONEDA = 1
	TempCurrency = "P"
       
        Forever
         Call Autorizacion
          IF autorizado =  "S"  
        
	   IF @InStandaloneMode = 0 and @InBackupMode = 0
	
      		Cash_Pickup = Key(9, 602)
      		Call Load_ODBC_DLL
      		Call ConnectDB
      		Call Lee_Fondo_Caja
		Call Actualiza_Tracking_Totals
      		Call Procesa_Consulta
		call procesa_consulta_empleado
       		call DESGLOCEMONEDAPESOS
                //  Consulta  del turno el empleado
 		call Consulta_turno
		
	        CASH_AMNT = Importe
		
        	 	IF CASH_AMNT > venta
             		   Format HaloLine as "Monto del Retiro de Efectivo "," ", CASH_AMNT, " es mas que ", venta
             		   ErrorMessage HaloLine
                
	  		ELSE 

	     	 		LoadKyBdMacro Cash_Pickup, MakeKeys(CASH_AMNT), @Key_Enter
     			
      				Call Ultimo_retiro( 2 )
				Call UnloadDLL
     				Call Load_ODBC_DLL
        			Call ConnectDBRetiros
				Call Agrega_Retiro_Bd
				Call Lee_Folio
			        Call Imprime_Ficha


                       	 ENDIF
                Break       
     	  ELSE 

	   	InfoMessage "Control Efectivo", "FUNCION NO DISPONIBLE EN MODO STANDALONE" 	
       	  ENDIF


	ELSE
		InfoMessage "Control De Seguridad", "Tarjeta Invalida o Usuario no Autorizado Para Esta Funcion"
	ENDIF	

   endfor
EndSub
 
Looks like it's your CASH_AMNT value is sometimes invalid.
Have a look at how you are getting that value.

Specialist in creating custom applications for the Micros POS range: 3700, 9700, Simphony FE, Simphony. SIM Scripts, Data Exports, Simphony extension applications, API Creation and integration. If you need anything please contact me via my website
 
I have reviewed it but I do not think that is the reason since the screen where it is captured validates that the value is numeric

7603d939-195c-4b75-90ae-b396e2810e39_zdk7sg.jpg


On the other hand precisely part of the problem is that the withdrawal with all its detail is written to another DB (Which is what I want to prevent it from happening in case it fails) and there I can see the amount and it is correct.


In a moment I copy the important parts of the code to make the process more understandable.
 
I highlight the important parts.

Code:
[COLOR=#73D216]//Verify Open Check[/color]
Sub verifica_ticket

	var cancela_orden : key
	
	[b]IF @CKNUM > 0[/b]
        	
 		InfoMessage "Aviso", "Existe cheque abierto se debe cancelara para realizar retiro" 	
                [COLOR=#73D216]//Cancel Order[/color]
		[b]cancela_orden = key(1, 458844)          
                LoadKyBdMacro cancela_orden, @Key_Enter[/b]

    ENDIF
	
        [COLOR=#73D216]//Call INQ 21[/color]
	//Manda Llamar INQ 21 (PESOS)
[b]	IF inq_origen = 1
		loadkybdmacro key(24,16384*21+@PMSSeqNum)[/b]
	//Manda Llamar INQ 22 (DOLARES)
	ELSEIF inq_origen = 2
		loadkybdmacro key(24,16384*22+@PMSSeqNum)
	ENDIF

	
EndSub

Event Inq: 21

	//////////////////        RETIRO DE EFECTIVO PESOS    //////////////
[COLOR=#73D216]//Verify again if no open Check & call subroutine "Retiro_Pesos"[/color]
	[b]IF @CKNUM = 0
		Call Retiro_Pesos[/b]
	ELSE
		InfoMessage "Aviso", "No se puede continuar con el retiro sin cancelar el cheque" 	

	ENDIF
			
endevent

Sub Retiro_Pesos

       //////////////////        RETIRO DE EFECTIVO PESOS    //////////////

      [b]Var Cash_Pickup 	 : Key[/b]
      Var Numeric_Screen : N4    = 0
      [b]Var CASH_AMNT	     : $10   = 0[/b]
      Var Campo_01       : A100  = ""
      Var Sql            : A100  = ""
      Var hODBCDLL       : N12   = 0
 	Var HaloLine         : A70
  	Var PromptLine       : A40

      	MONEDA = 1
	TempCurrency = "P"
       
        Forever
         Call Autorizacion
          IF autorizado =  "S"  
        
	   IF @InStandaloneMode = 0 and @InBackupMode = 0
	
      		[b]Cash_Pickup = Key(9, 602)[/b]
      		Call Load_ODBC_DLL
      		Call ConnectDB
      		Call Lee_Fondo_Caja
		Call Actualiza_Tracking_Totals
      		Call Procesa_Consulta
		call procesa_consulta_empleado
       		call DESGLOCEMONEDAPESOS
                //  Consulta  del turno el empleado
 		call Consulta_turno
		
	       [b] CASH_AMNT = Importe[/b]
		
        	 	[b]IF CASH_AMNT > venta[/b]
             		   Format HaloLine as "Monto del Retiro de Efectivo "," ", CASH_AMNT, " es mas que ", venta
             		   ErrorMessage HaloLine
                
	  		ELSE 

	     	 		[b]LoadKyBdMacro Cash_Pickup, MakeKeys(CASH_AMNT), @Key_Enter[/b]
     			
[COLOR=#CC0000][b]/////////IF Invalid  Entry it's detected after this line exitwitherror!!![/b][/color]

      				Call Ultimo_retiro( 2 )
				Call UnloadDLL
     				Call Load_ODBC_DLL
        			Call ConnectDBRetiros
				Call Agrega_Retiro_Bd
				Call Lee_Folio
			        Call Imprime_Ficha


                       	 ENDIF
                Break       
     	  ELSE 

	   	InfoMessage "Control Efectivo", "FUNCION NO DISPONIBLE EN MODO STANDALONE" 	
       	  ENDIF


	ELSE
		InfoMessage "Control De Seguridad", "Tarjeta Invalida o Usuario no Autorizado Para Esta Funcion"
	ENDIF	

   endfor
EndSub
 
Can you show where the Importe value comes from?

You are checking for numeric but what happens if they enter 0.00 for everything?

Specialist in creating custom applications for the Micros POS range: 3700, 9700, Simphony FE, Simphony. SIM Scripts, Data Exports, Simphony extension applications, API Creation and integration. If you need anything please contact me via my website
 
I have tested it with 0.00 and its variations as well as special values.

Here I copy the code from the capture screen.



Code:
SUB desglocemonedapesos 
     
      
	VAR importeretiro : N6 = 0
	

	VAR Referencia : A12
	Var Key_Pressed  :  key
	VAR Data : A10

	subtotal1 = 0 
	subtotal2 = 0
 	subtotal3 = 0 
	subtotal4 = 0 
	subtotal5 = 0 		
	subtotal6 = 0 
	cantdenominacion1=0
	cantdenominacion2=0
	cantdenominacion3=0
	cantdenominacion4=0
	cantdenominacion5=0
	cantdenominacion6=0
	totalmoralla = 0 
	importe=0

      	WINDOW 10, 51
     
        
         DISPLAYINVERSE  1,  1, "             Retiro de Efectivo Pesos           "
         
	 DISPLAY   3,  2, "1000.00   X "
         DISPLAY   4,  2, " 500.00   X "
	 DISPLAY   5,  2, " 200.00   X "
	 DISPLAY   6,  2, " 100.00   X "
	 DISPLAY   7,  2, "  50.00   X "
	 DISPLAY   8,  2, "  20.00   X "
	 DISPLAY   3,  30, "  TOTAL MORALLA "
	// DISPLAY   6,  30, "  REFERENCIA "
    forever

	forever
	 DISPLAYINPUT  3, 16, cantdenominacion1, "BILLETES DE MIL PESOS"
         WINDOWINPUT        
 	 IF cantdenominacion1 >= 0 AND LEN(cantdenominacion1) <= 2
		//waitforenter cantdenominacion1
		//waitforenter len(cantdenominacion1)

                DISPLAY 3, 16, cantdenominacion1
		subtotal1 = cantdenominacion1  * Denominacion_pesos1
		DISPLAY 3, 22, subtotal1
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		DISPLAY   9,  10, "  Total =  ", Importe
		break

	  ENDIF 
	endfor

	forever
     	 DISPLAYINPUT  4, 16, cantdenominacion2, "BILLETES DE 500 PESOS"
         WINDOWINPUT
 	  IF cantdenominacion2 >= 0 AND LEN(cantdenominacion2) <= 2
                DISPLAY 4, 16, cantdenominacion2
		subtotal2 = cantdenominacion2  * Denominacion_pesos2
		DISPLAY 4, 22, subtotal2
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		DISPLAY   9,  10, "  Total =  ", Importe
		break
  	  ENDIF
	endfor

	forever
 	DISPLAYINPUT  5, 16, cantdenominacion3, "BILLETES DE 200 PESOS"
	WINDOWINPUT
	IF cantdenominacion3 >= 0 AND LEN(cantdenominacion3) <= 2
                DISPLAY 5, 16, cantdenominacion3
		subtotal3 = cantdenominacion3  * Denominacion_pesos3
		DISPLAY 5, 22, subtotal3
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		 DISPLAY   9,  10, "  Total =  ", Importe	
		break
         ENDIF
	endfor

	forever
	DISPLAYINPUT  6, 16, cantdenominacion4, "BILLETES DE 100 PESOS"
	WINDOWINPUT
	IF cantdenominacion4 >= 0 AND LEN(cantdenominacion4) <= 2
                DISPLAY 6, 16, cantdenominacion4
		subtotal4 = cantdenominacion4  * Denominacion_pesos4
		DISPLAY 6, 22, subtotal4
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		 DISPLAY   9,  10, "  Total =  ", Importe
		break
         ENDIF
	endfor

	forever
	DISPLAYINPUT  7, 16, cantdenominacion5, "BILLETES DE 50 PESOS"
	WINDOWINPUT
	IF cantdenominacion5 >= 0 AND LEN(cantdenominacion5) <= 2
                DISPLAY 7, 16, cantdenominacion5
		subtotal5 = cantdenominacion5  * Denominacion_pesos5
		DISPLAY 7, 22, subtotal5
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		 DISPLAY   9,  10, "  Total =  ", Importe
		break
	ENDIF
	endfor

	forever
	DISPLAYINPUT  8, 16, cantdenominacion6, "BILLETES DE 20 PESOS"
	WINDOWINPUT
	IF cantdenominacion6 >= 0 AND LEN(cantdenominacion6) <= 2
                DISPLAY 8, 16, cantdenominacion6
		subtotal6 = cantdenominacion6  * Denominacion_pesos6
		DISPLAY 8, 22, subtotal6
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		DISPLAY   9,  10, "  Total =  ", Importe
		break
	ENDIF
	endfor

	DISPLAYINPUT  4, 35, totalmoralla, "TOTAL MORALLA"
	WINDOWINPUT
	IF totalmoralla >= 0
                DISPLAY 4, 35, totalmoralla
		CALL CALCULAIMPORTE(cantdenominacion1,cantdenominacion2,cantdenominacion3,cantdenominacion4,cantdenominacion5,cantdenominacion6,totalmoralla)
		DISPLAY   9,  10, "  Total =  ", Importe

	ENDIF

	

///	forever
///	 DISPLAYINPUT  7, 35, Referencia, "REFERENCIA"
///	 WINDOWINPUT
///	 IF LEN(referencia) > 2
///                DISPLAY 7, 35, Referencia
///		Tempreferencia	= Referencia
///		break
///	 ENDIF	
///	endfor




	inputkey key_pressed, data, "Enter O Cancelar "
      
	IF key_pressed = @Key_Clear
        	
   		elseif key_pressed = @Key_Cancel
       		
		elseif key_pressed = @Key_Enter

		//	if Importe > tope_retiro_pesos * .8
				WINDOWCLOSE
				BREAK
                //        Endif
	
	
  

  	 ENDIF

  ENDFOR


  //  waitforenter importe
               
ENDSUB
 
Another reason why I do not think it is the capture (I do not rule it out 100% either) is that I have this example of 3 withdrawals that they made in a row, only one remained in the micros database and 3 in my withdrawal database, the 3 have the correct amount.

image_qd46qx.png


The WS through this SIM are programmed to require withdrawal of a certain amount and blocks the ability to collect another order.

I assume the following:

[ul]
[li]The Supervisor makes the withdrawal, in this case for 3,080.00[/li]
[li]The system displays the Invalid Entry sign, no withdrawal is made at the Micros DB and the cashier continues with the same amount at the cash register.[/li]
[li]The program continues its course, insert the withdrawal in the external DB of withdrawals.[/li]
[li]Print the withdrawal receipt with the breakdown of bills and coins.[/li]
[li]The supervisor as he sees the report ignores the Invalid Entry.[/li]
[li]When trying to open another Check, the SIM demands the withdrawal again since the PickUp was not made in the ATM totals, it assumes that no withdrawal has been made.[/li]
[li]The cycle repeats.[/li]
[/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top