Ver Mensaje Individual
  #32
Antiguo 16 de marzo de 2025, 14:57
fastpho
El Foro es mi casa
Innovación: Por aportar innovaciones - Issue reason: SQLite + OO Cobol class Concurso: Primer puesto: Ganador/a del Primer puesto en un concurso - Issue reason: Acceso a datos Cobol vía web 
Última Actividad 21.08.2026 18:08
Posts Posts: 365
Likes enviados Enviados: 252
Likes recibidos Recibidos: 243

@Ale proba con este ejemplo a ver si enviando
valores enteros a la .dll logras facturar
algo , juga con los numeros de los campos
cantidad precio y ver si logras que el impresor
multiplique la cantidad por el precio y facture
un importe.


Otra cosa podes sacar el informe Z ?

Saludos ..
Código COBOL:
  1.  WORKING-STORAGE SECTION.
  2. *---------------------------------------------------------
  3.  01  FUNC-SAM4-LIB          PIC x(50).
  4.  01  sWait                  PIC s9(9) COMP-5.  
  5.  01  Respuesta-Impresor     PIC s9(9) COMP-5 value 0.
  6. *---------------------------------------------------------
  7.  01 AbrirTiquetSam4s        PIC x(10)  VALUE "AbrirTique".
  8.  01 CerrarSam4s             PIC x(6)   VALUE "Cerrar".
  9.  
  10.  
  11.  01 ItemVentaSam4s          PIC x(9)   VALUE  "ItemVenta".
  12.  01 ItemBonificacionSam4s   PIC x(16)  VALUE  "ItemBonificacion".
  13.  
  14.  01 titulo-descripcion      PIC x(11)  value "Descripcion".
  15.  01 titulo-precio           PIC x(6)   value "Precio".
  16.  01 titulo-iva              PIC x(3)   value "IVA".
  17.  01 titulo-codigointerno    PIC x(13)  value "CodigoInterno".
  18.  01 titulo-cantidad         PIC x(8)   value "Cantidad".
  19.  01 titulo-unidadmedida     PIC x(12)  value "UnidadMedida".
  20.  01 titulo-impinterno       PIC x(15)  value "MontoImpIntFijo".  
  21.  
  22.  01 ArticuloSam4                PIC x(13).
  23.  01 DescriptionSam4             PIC x(40).
  24.  01 PrecioSam4                  PIC s9(9)   COMP-5.
  25.  01 IvaSam4                     PIC s9(9)   COMP-5.
  26.  01 CantidadSam4                PIC s9(9)   COMP-5.
  27.  01 MontoImpIntFijoSam4         PIC S9(9)   COMP-5.
  28.  01 UnidadMedidaSam4            PIC s9(9)   COMP-5.
  29.  
  30.  PROCEDURE       DIVISION.
  31. **********************************************************    
  32. *Begin AbrirTique
  33.  
  34.      move spaces        TO FUNC-SAM4-LIB.
  35.      MOVE "IFOpBegin"   TO FUNC-SAM4-LIB.
  36.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE AbrirTiquetSam4s returning Respuesta-Impresor.
  37.  
  38.        
  39. **********************************************************    
  40. *Send AbrirTiquetSam4s
  41.      move spaces       TO FUNC-SAM4-LIB.
  42.      MOVE "IFOpSend"   TO FUNC-SAM4-LIB.
  43.      MOVE 1            TO sWait.
  44.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY VALUE sWait returning Respuesta-Impresor.
  45.  
  46.      
  47.  
  48. *-----------------------------------------------------------------------------------------------------------------------      
  49. * Los campos PrecioSam4 IvaSam4 CantidadSam4 MontoImpIntFijo UnidadMedidaSam4 USAMOS LA FUNCION ENTERO : IFOpParamIntSet
  50. *-----------------------------------------------------------------------------------------------------------------------      
  51.  
  52. *************************************************************************
  53. * muevo valores necesarios para poder facturar un item o articulo
  54.  
  55.  
  56.      move 1210          TO PrecioSam4.
  57.      move 2100          TO IvaSam4.  
  58.      move 5000          TO CantidadSam4.
  59.      move zeros         TO MontoImpIntFijoSam4.
  60.      move 7             TO UnidadMedidaSam4.
  61.  
  62.  
  63.      move "Esto es una prueba" TO DescriptionSam4.
  64.      move "7790060023417"      TO ArticuloSam4.
  65.          
  66. ****************************************    
  67. *Begin ItemVenta
  68.      move spaces        TO FUNC-SAM4-LIB.
  69.      MOVE "IFOpBegin"   TO FUNC-SAM4-LIB.
  70.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE ItemVentaSam4s
  71.                                            returning Respuesta-Impresor.
  72.                                          
  73. ************    
  74. *Descripcion
  75.  
  76.      move spaces           TO FUNC-SAM4-LIB.
  77.      MOVE "IFOpParamSet"   TO FUNC-SAM4-LIB.
  78.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE titulo-descripcion
  79.                                            BY REFERENCE DescriptionSam4
  80.                                            returning Respuesta-Impresor.
  81.  
  82.  
  83. **********
  84. *Cantidad
  85.      move spaces              TO FUNC-SAM4-LIB.
  86.      MOVE "IFOpParamIntSet"   TO FUNC-SAM4-LIB.
  87.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY CONTENT titulo-cantidad
  88.                                            BY VALUE   CantidadSam4
  89.                                            returning Respuesta-Impresor.
  90.  
  91.                                            
  92.  
  93.      
  94. *******
  95. *Precio
  96.      move spaces              TO FUNC-SAM4-LIB.
  97.      MOVE "IFOpParamIntSet"   TO FUNC-SAM4-LIB.
  98.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE titulo-precio
  99.                                            BY VALUE      PrecioSam4
  100.                                            returning Respuesta-Impresor.
  101.  
  102.                                            
  103. ****
  104. *Iva
  105.      move spaces                TO FUNC-SAM4-LIB.
  106.      MOVE "IFOpParamIntSet"     TO FUNC-SAM4-LIB.
  107.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE titulo-iva
  108.                                            BY VALUE     IvaSam4
  109.                                            returning Respuesta-Impresor.
  110.  
  111.      
  112. ****************    
  113. *Codigo Interno
  114.      move spaces           TO FUNC-SAM4-LIB.
  115.      MOVE "IFOpParamSet"   TO FUNC-SAM4-LIB.
  116.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE titulo-codigointerno
  117.                                            BY REFERENCE     ArticuloSam4
  118.                                            returning Respuesta-Impresor.
  119.  
  120. ****************************
  121. *MontoImpIntFijo
  122.      move spaces              TO FUNC-SAM4-LIB.
  123.      MOVE "IFOpParamIntSet"   TO FUNC-SAM4-LIB.
  124.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE     titulo-impinterno
  125.                                            BY VALUE         MontoImpIntFijoSam4
  126.                                            returning Respuesta-Impresor.
  127.  
  128.  
  129. *****************
  130. *Unidad de Medida
  131.      move spaces           TO FUNC-SAM4-LIB.
  132.      MOVE "IFOpParamIntSet"   TO FUNC-SAM4-LIB.
  133.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE titulo-unidadmedida
  134.                                            BY VALUE     UnidadMedidaSam4
  135.                                            returning Respuesta-Impresor.
  136.  
  137.  
  138. **********************************************************    
  139. *Send item
  140.      move spaces       TO FUNC-SAM4-LIB.
  141.      MOVE "IFOpSend"   TO FUNC-SAM4-LIB.
  142.      MOVE 1            TO sWait.
  143.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY VALUE sWait returning Respuesta-Impresor.
  144.  
  145.      
  146.      
  147.  
  148. *------------------------
  149. *Begin "Cerrar"      
  150.      move spaces        TO FUNC-SAM4-LIB.
  151.      MOVE "IFOpBegin"   TO FUNC-SAM4-LIB.
  152.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY REFERENCE CerrarSam4s  returning Respuesta-Impresor.
  153.  
  154.  
  155. *Send Cerrar        
  156.  
  157.      move spaces       TO FUNC-SAM4-LIB.
  158.      MOVE "IFOpSend"   TO FUNC-SAM4-LIB.
  159.      MOVE 1            TO sWait.
  160.      CALL FUNC-SAM4-LIB WITH STDCALL USING BY VALUE sWait returning Respuesta-Impresor.
fastpho is offline   Responder Con Cita