FoxPro/Visual FoxPro - Ayuda con codigos

 
Vista:

Ayuda con codigos

Publicado por many (127 intervenciones) el 25/10/2017 13:32:44
Quisiera saber si este código le he familiar a alquilen que haya usado alguna impresora fiscal star 650.

1
2
3
4
5
6
m.cantidad = ALLTRIM(STR(dettem.cantidad, 6,2)) &&cantidad vendida
m.descrip = ALLTRIM(dettem.descrip)             &&nombre articulo vendido
m.ge = ALLTRIM(dettem.ge)						&&Contiene una E si esta exento
m.precio = ALLTRIM(STR(dettem.venta, 7,2))  	&&precio unitario
m.itbis = ALLTRIM(STR(dettem.itbis, 7,2))   	&&precio unitario
m.valor = ALLTRIM(STR(dettem.valor, 8,2))		&&valor es igual a cantidad*precio


Aquí esta el problema:

Archivo de entrada PRINT.TXT:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<ABRIR_CF,0,0,001,0001,0001,A010010010200174351,Razon Social: Nombre,RNC: J4056780545, >
<ITEM_CF,0, , , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,23340,1600>
<ITEM_CF,0, , , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,23340,1800>
<ITEM_CF,0, , , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,23340,0800>
<ITEM_CF,1, Anulacion de item, , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,23340,1800>
<ITEM_CF,2, Descuento de Item, , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,340,1600>
<ITEM_CF,3, Recargo de Item, , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,500,1600>
<ITEM_CF,0, , , , , , , , , ,ULTRATEX AZUL CIELO TROPICAL,100,23340,1800>
<SUBTOTAL_CF>
<DESC_REC_CF,0, Descuento subtotal,10000>
<DESC_REC_CF,1, Recargo subtotal,5000>
<PAGO_CF,0,1,500000,dESCRIPCION 1 , , >
<DONACION_CF,0,Donacion Text,30000>
<CERRAR_CF,1,1, ,2, ,3, >
<END>
Archivo de salida OUT_ PRINT.TXT:
<ABRIR_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<ITEM_CF OK>
<SUBTOTAL_CF 000000000000 000000000000 0000 000000000000 000000000000 0000 000000000000 000000000000 0000 000000000000 OK>
<DESC_REC_CF OK>
<DESC_REC_CF OK>
<PAGO_CF OK>
<DONACION_CF OK>
<CERRAR_CF 00000000 OK>



Nota:
Para que no crean que quiero ser cómodo yo lo hice de otra forma que me funciona pero no es así:
solo para que lo vean

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
archivo=fcreate("c:\prueba\factura.txt")
 
fputs(archivo,"        CASA DE PRUEBA")
fputs(archivo,"  19  Esq. mayor")
fputs(archivo,"  Tel. , RNC.15863847264")
 
fputs(archivo, " ")
 
m.condicion = ALLTRIM(thisform.condicion.value)
m.factura = ALLTRIM(STR(thisform.factura.value))
*m.fecha = ALLTRIM(STR(thisform.fecha.value))
m.abc = ALLTRIM(thisform.abc.value)
m.tipo = ALLTRIM(thisform.tipo.value)
m.ncf = ALLTRIM(thisform.ncf.value)
m.rnc = ALLTRIM(thisform.rnc.value)
m.codcli = ALLTRIM(STR(thisform.codcli.value))
m.cliente = ALLTRIM(thisform.cliente.value)
 
	fputs(archivo,"Factura ",m.factura,"   ")
	fputs(archivo,m.condicion)
 
	fputs(archivo,m.tipo)
	fputs(archivo,"NCF ",m.ncf)
	fputs(archivo,"Cliente:",m.cliente)
	fputs(archivo,"RNC:",m.rnc)
 
	fputs(archivo, " ")
 
fputs(archivo,"------------------------------")
fputs(archivo,"Cant.  Descripcion")
fputs(archivo,"Precio Valor  ")
fputs(archivo,"------------------------------")
 
SCAN
m.cantidad = ALLTRIM(STR(dettem.cantidad, 6,2))
m.descrip = ALLTRIM(dettem.descrip)
m.ge = ALLTRIM(dettem.ge)
m.precio = ALLTRIM(STR(dettem.venta, 7,2))
m.valor = ALLTRIM(STR(dettem.valor, 8,2))
 
*X2 = ALLTRIM(STR(X, 8, 2))
 
	fputs(archivo,m.cantidad," ")
	fputs(archivo,m.descrip, " ")
	fputs(archivo,m.ge)
	fputs(archivo,m.precio," ")
	fputs(archivo,m.valor)
 
ENDSCAN
 
	m.grabado = ALLTRIM(STR(thisform.grabado.value,10,2))
	m.exento = ALLTRIM(STR(thisform.exento.value,10,2))
	m.itbis = ALLTRIM(STR(thisform.itbis.value,10,2))
	m.totalgral = ALLTRIM(STR(thisform.totalgral.value,10,2))
	fputs(archivo,"------------------------------")
 
	fputs(archivo,"TOTAL GRABADO =>"," ")
	fputs(archivo,m.grabado)
 
	fputs(archivo,"TOTAL EXENTO ==>"," ")
	fputs(archivo,m.exento)
 
	fputs(archivo,"TOTAL ITBIS ===>"," ")
	fputs(archivo,m.itbis)
 
	fputs(archivo,"TOTAL GENERAL =>"," ")
	fputs(archivo,m.totalgral)
 
	Fclose(archivo)
 
	MESSAGEBOX("Bien")
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder