tlincre = 150
pag = 0
FOR facturas%
= 1 TO tlincre
pag = pag + 1
venta$(0) = "1"
envas$(0) = "0": menv = 0
abono = 0: sitfac2 = 0: rappel = 0: trappel = 0
menvases$(n%) = ""
op = 1
reimp = 1
tbole = 1: nbole = 1
tipocopia = 2
v = 1: a% = 1
v = v + 24
nbole = nbole + 1
20000 '------------------ RUTINA DE IMPRESION --------------------------------
IF tipocopia
= 2 THEN copias
= 2 PageScale = 10
PageHeight = 297 * PageScale 'A4 paper size is 210 X 297 mm
PageWidth = 210 * PageScale
source_handle
= _LOADIMAGE("disenofactura6.jpg", 32) 'CursorPosY = 570
PointSize = 12
PointSize = 9
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
)
CursorPosY
= 438: CursorPosX
= 42: text$
= " N. de Factura ":
GOSUB PrintTextGris
PointSize = 12
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
)
CursorPosY
= 326: CursorPosX
= 70: text$
= "18/11/19":
GOSUB PrintText
CursorPosY
= 326: CursorPosX
= 410: text$
= "12:25":
GOSUB PrintText
CursorPosY
= 475: CursorPosX
= 95: text$
= mfac$:
GOSUB PrintText
CursorPosY
= 475: CursorPosX
= 400: text$
= a$:
GOSUB PrintText
CursorPosY
= 330: CursorPosX
= 680: text$
= "CLIENTE DE PRUEBA":
GOSUB PrintText
CursorPosY
= 330: CursorPosX
= 1895: text$
= "0125":
GOSUB PrintText
CursorPosY
= 379: CursorPosX
= 680: text$
= "C/la que sea, 2":
GOSUB PrintText
CursorPosY
= 426: CursorPosX
= 680: text$
= "Sevilla":
GOSUB PrintText
CursorPosY
= 476: CursorPosX
= 680: text$
= "Telefono: 902555555":
GOSUB PrintText
CursorPosY = 660
'--- Bultos
CursorPosX
= 240: a$
= "2":
CALL converprin
(a$
, 10): text$
= a$:
GOSUB PrintTextNum
'--- Articulos
CursorPosX
= 255: text$
= "PATATAS":
GOSUB PrintText
'--- Trazabilidad
CursorPosX
= 780: text$
= "1023589547":
GOSUB PrintText
'--- K Bruto
CursorPosX
= 1206: a$
= "10.25":
CALL converprin
(a$
, 10): text$
= a$:
GOSUB PrintTextNum
'--- K Tara
CursorPosX
= 1413: a$
= "2":
CALL converprin
(a$
, 9): text$
= a$:
GOSUB PrintTextNum
'--- K Neto
CursorPosX
= 1622: a$
= "8.25":
CALL converprin
(a$
, 10): text$
= a$:
GOSUB PrintTextNum
'--- Precio
CursorPosX
= 1804: a$
= "1.3":
CALL converprin
(a$
, 8): text$
= a$:
GOSUB PrintTextNum
'--- Total
CursorPosX
= 2020:
CALL converprin
(a$
, 10): text$
= a$:
GOSUB PrintTextNum
CursorPosY = CursorPosY + 48
CursorPosY
= 1948: CursorPosX
= 388: a$
= "10.73":
CALL converprin
(a$
, 13): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1995: CursorPosX
= 388: a$
= "0":
CALL converprin
(a$
, 13): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 2045: CursorPosX
= 388: a$
= "0":
CALL converprin
(a$
, 13): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1948: CursorPosX
= 560: a$
= "4":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1995: CursorPosX
= 560: a$
= "12":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 2045: CursorPosX
= 560: a$
= "21":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1948: CursorPosX
= 800: a$
= "0.43":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1995: CursorPosX
= 800: a$
= "0":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 2045: CursorPosX
= 800: a$
= "0":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1948: CursorPosX
= 970: a$
= "0.5":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1995: CursorPosX
= 970: a$
= "1.4":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 2045: CursorPosX
= 970: a$
= "5.3":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1948: CursorPosX
= 1212: a$
= "0.05":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1995: CursorPosX
= 1212: a$
= "0":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 2045: CursorPosX
= 1212: a$
= "0":
CALL converprin
(a$
, 12): text$
= a$:
GOSUB PrintTextNum
CursorPosY
= 1948: CursorPosX
= 1380: a$
= "0":
CALL converprin
(a$
, 5): text$
= a$:
GOSUB PrintTextNumGris
CursorPosY
= 1948: CursorPosX
= 1585: a$
= "0":
CALL converprin
(a$
, 10): text$
= a$:
GOSUB PrintTextNumGris
CursorPosY
= 2045: CursorPosX
= 1340: text$
= " ":
GOSUB PrintText
PointSize = 15
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
) a$
= "11.21":
CALL converprin
(a$
, 13): text$
= a$
+ " EU"
CursorPosY
= 1992: CursorPosX
= 2019:
GOSUB PrintTextNum
PointSize = 12
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
) menvases$(1) = "1"
CursorPosY = 2295: CursorPosX = 230
text$
= "18/11/19":
GOSUB PrintText
CursorPosY
= 2350: CursorPosX
= 230: text$
= mfac$:
GOSUB PrintText
CursorPosY
= 2405: CursorPosX
= 230: text$
= "0125":
GOSUB PrintText
CursorPosY
= 2460: CursorPosX
= 230: text$
= "CLIENTE DE PRUEBA":
GOSUB PrintText
PointSize = 15
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
) a$
= "11.21":
CALL converprin
(a$
, 13): text$
= a$
+ " EU" CursorPosY
= 2535: CursorPosX
= 1230:
GOSUB PrintTextNumGris
CursorPosY
= 2535: CursorPosX
= 1229:
GOSUB PrintTextNumGris
CursorPosY
= 2535: CursorPosX
= 1231:
GOSUB PrintTextNumGris
PointSize = 12
FontHeight
= INT(PointSize
* 0.3527 * PageScale
) FontHandle
= _LOADFONT("c:\windows\fonts\times.ttf", FontHeight
)
CursorPosY = 2310
CursorPosX
= 1486: a$
= "2":
CALL converprin
(a$
, 8): a$
= LEFT$(a$
, 5): text$
= a$:
GOSUB PrintTextNum
CursorPosX
= 1504: text$
= "BATEA":
GOSUB PrintText
CursorPosX
= 2010: a$
= "0":
CALL converprin
(a$
, 8): text$
= a$:
GOSUB PrintTextNum
CursorPosX
= 1380: text$
= "-----":
GOSUB PrintText
CursorPosX
= 1590: text$
= "----------":
GOSUB PrintText
CursorPosX
= 1870: text$
= "--------":
GOSUB PrintText
CursorPosY = CursorPosY + 45
CursorPosY = 2850: CursorPosX = 50
text$ = " Fecha: 18/11/19 N.F.:" + nbol$ + " Cli.:0125 Imp.:"
_FONT 16 'change to the QB64 default font to free it
PrintText:
COLOR _RGB(0, 0, 0), _RGBA(255, 255, 255, 255) 'RED text on clear black background 'COLOR 0, 15
'CursorPosY = CursorPosY + FontHeight 'adjust print position down
PrintTextNum:
COLOR _RGB(0, 0, 0), _RGBA(255, 255, 255, 255) 'RED text on clear black background 'COLOR 0, 15
'CursorPosY = CursorPosY + FontHeight 'adjust print position down
PrintTextNumGris:
'COLOR _RGB(210, 210, 210), _RGBA(256, 256, 256, 256) 'texto gris con fondo blanco
'fondo$ = STRING$(LEN(text$), CHR$(219))
'_PRINTSTRING (CursorPosX - _PRINTWIDTH(fondo$), CursorPosY), fondo$
COLOR _RGB(0, 0, 0), _RGBA(210, 210, 210, 0) 'texto negro con fondo gris transparente 'CursorPosX = CursorPosX + 2 * _PRINTWIDTH(text$)
'CursorPosY = CursorPosY + FontHeight 'adjust print position down
PrintTextGris:
COLOR _RGB(0, 0, 0), _RGBA(210, 210, 210, 0) 'texto negro con fondo gris transparente 'CursorPosY = CursorPosY + FontHeight 'adjust print position down
'-----------------------------------------------------------------------------------------------------------------------------
'----------------------------------------------------------- RUTINAS ---------------------------------------------------------
'-----------------------------------------------------------------------------------------------------------------------------
'----------------------------------------- CONVERTIR NUMERO CON SEPARADORES DE MILES Y 2 DECIMALES -----------------------
d# = c# * 100 + .5
a$ = "0.0" + a$
a$ = "0." + a$
a$ = "0.00"
a$
= MID$(a$
, 2):
'--para quitar caracter que se ha generado por meter la coma a$
= MID$(a$
, 2):
'--para quitar caracter que se ha generado por meter la coma a$
= MID$(a$
, 2):
'--para quitar caracter que se ha generado por meter la coma