commit 68230059942489de900827d4125ca0b381bc0b18 Author: jdg Date: Wed Sep 8 21:44:52 2021 +0200 First commit 20/03/1997 diff --git a/BDATOS.OBJ b/BDATOS.OBJ new file mode 100644 index 0000000..002a9ff Binary files /dev/null and b/BDATOS.OBJ differ diff --git a/CHORA.CPP b/CHORA.CPP new file mode 100644 index 0000000..2069c25 --- /dev/null +++ b/CHORA.CPP @@ -0,0 +1,61 @@ +#include + +struct V +{ + int HorasMedicion[6]; +}; + +struct C +{ + struct V VProductos; + +} Config = { { 8, 12, 16, 20, 24, 4 } }; +char TablaHoraria[24]; + +void ConstruyeTablaHoraria(void); + +void main(void) +{ + int i; + + for ( i=0; i < 20; i++ ) + printf ( "\n" ); + + ConstruyeTablaHoraria(); + + printf ( "0: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[0], Config.VProductos.HorasMedicion[1] ); + printf ( "1: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[1], Config.VProductos.HorasMedicion[2] ); + printf ( "2: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[2], Config.VProductos.HorasMedicion[3] ); + printf ( "3: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[3], Config.VProductos.HorasMedicion[4] ); + printf ( "4: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[4], Config.VProductos.HorasMedicion[5] ); + printf ( "5: %02d:00 >-< %02d:00 \n", Config.VProductos.HorasMedicion[5], Config.VProductos.HorasMedicion[0] ); + + printf ( "\n" ); + for ( i = 0; i < 12; i++ ) + { + printf( " %02d >-> %d %02d >-> %d \n", i, TablaHoraria[i], i+12, TablaHoraria[i+12] ); + } + +} + +void ConstruyeTablaHoraria(void) +{ + int i, j, k; + + // Revisamos las 24 horas posibles: 00 - 1 - 2 - ... - 22 - 23 + for ( i = 0; i < 24; i ++ ) + // Por cada hora verificamos el rango donde pueda estar ( 0 - 5 ) + for ( j = 0; j < 6; j ++ ) + { + for ( k = ( Config.VProductos.HorasMedicion[j] % 24); k != (Config.VProductos.HorasMedicion[(j+1)%6]%24); k = (++k)%24 ) + { + if ( i == k ) + { + TablaHoraria[i] = j; + break; + } + } + if ( k != (Config.VProductos.HorasMedicion[(j+1)%6]%24) ) + break; + } +} diff --git a/CHORA.EXE b/CHORA.EXE new file mode 100644 index 0000000..a8c08c3 Binary files /dev/null and b/CHORA.EXE differ diff --git a/DATOS/CONFIG.022 b/DATOS/CONFIG.022 new file mode 100644 index 0000000..0d6bc74 Binary files /dev/null and b/DATOS/CONFIG.022 differ diff --git a/DATOS/CONFIG.BAK b/DATOS/CONFIG.BAK new file mode 100644 index 0000000..dd054d3 Binary files /dev/null and b/DATOS/CONFIG.BAK differ diff --git a/DATOS/CONFIG.CFG b/DATOS/CONFIG.CFG new file mode 100644 index 0000000..70c132a Binary files /dev/null and b/DATOS/CONFIG.CFG differ diff --git a/DATOS/EMP00001/CMP-1996.M01 b/DATOS/EMP00001/CMP-1996.M01 new file mode 100644 index 0000000..c133f53 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M01 differ diff --git a/DATOS/EMP00001/CMP-1996.M02 b/DATOS/EMP00001/CMP-1996.M02 new file mode 100644 index 0000000..91c66ec Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M02 differ diff --git a/DATOS/EMP00001/CMP-1996.M03 b/DATOS/EMP00001/CMP-1996.M03 new file mode 100644 index 0000000..3beeb8c Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M03 differ diff --git a/DATOS/EMP00001/CMP-1996.M04 b/DATOS/EMP00001/CMP-1996.M04 new file mode 100644 index 0000000..c32306a Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M04 differ diff --git a/DATOS/EMP00001/CMP-1996.M05 b/DATOS/EMP00001/CMP-1996.M05 new file mode 100644 index 0000000..058c3bc Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M05 differ diff --git a/DATOS/EMP00001/CMP-1996.M06 b/DATOS/EMP00001/CMP-1996.M06 new file mode 100644 index 0000000..d730598 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M06 differ diff --git a/DATOS/EMP00001/CMP-1996.M07 b/DATOS/EMP00001/CMP-1996.M07 new file mode 100644 index 0000000..3a37973 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M07 differ diff --git a/DATOS/EMP00001/CMP-1996.M08 b/DATOS/EMP00001/CMP-1996.M08 new file mode 100644 index 0000000..1d02fe4 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M08 differ diff --git a/DATOS/EMP00001/CMP-1996.M09 b/DATOS/EMP00001/CMP-1996.M09 new file mode 100644 index 0000000..c74df0a Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M09 differ diff --git a/DATOS/EMP00001/CMP-1996.M10 b/DATOS/EMP00001/CMP-1996.M10 new file mode 100644 index 0000000..7130483 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M10 differ diff --git a/DATOS/EMP00001/CMP-1996.M11 b/DATOS/EMP00001/CMP-1996.M11 new file mode 100644 index 0000000..4cfd320 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M11 differ diff --git a/DATOS/EMP00001/CMP-1996.M12 b/DATOS/EMP00001/CMP-1996.M12 new file mode 100644 index 0000000..eda29a8 Binary files /dev/null and b/DATOS/EMP00001/CMP-1996.M12 differ diff --git a/DATOS/EMP00001/CMP-1997.M01 b/DATOS/EMP00001/CMP-1997.M01 new file mode 100644 index 0000000..dae6dc8 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M01 differ diff --git a/DATOS/EMP00001/CMP-1997.M02 b/DATOS/EMP00001/CMP-1997.M02 new file mode 100644 index 0000000..ea45d74 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M02 differ diff --git a/DATOS/EMP00001/CMP-1997.M03 b/DATOS/EMP00001/CMP-1997.M03 new file mode 100644 index 0000000..ea45d74 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M03 differ diff --git a/DATOS/EMP00001/CMP-1997.M04 b/DATOS/EMP00001/CMP-1997.M04 new file mode 100644 index 0000000..c264519 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M04 differ diff --git a/DATOS/EMP00001/CMP-1997.M05 b/DATOS/EMP00001/CMP-1997.M05 new file mode 100644 index 0000000..4eb27c9 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M05 differ diff --git a/DATOS/EMP00001/CMP-1997.M06 b/DATOS/EMP00001/CMP-1997.M06 new file mode 100644 index 0000000..a664c84 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M06 differ diff --git a/DATOS/EMP00001/CMP-1997.M07 b/DATOS/EMP00001/CMP-1997.M07 new file mode 100644 index 0000000..2a35de3 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M07 differ diff --git a/DATOS/EMP00001/CMP-1997.M08 b/DATOS/EMP00001/CMP-1997.M08 new file mode 100644 index 0000000..417331d Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M08 differ diff --git a/DATOS/EMP00001/CMP-1997.M09 b/DATOS/EMP00001/CMP-1997.M09 new file mode 100644 index 0000000..4f18ae7 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M09 differ diff --git a/DATOS/EMP00001/CMP-1997.M10 b/DATOS/EMP00001/CMP-1997.M10 new file mode 100644 index 0000000..3e34da5 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M10 differ diff --git a/DATOS/EMP00001/CMP-1997.M11 b/DATOS/EMP00001/CMP-1997.M11 new file mode 100644 index 0000000..b91e82e Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M11 differ diff --git a/DATOS/EMP00001/CMP-1997.M12 b/DATOS/EMP00001/CMP-1997.M12 new file mode 100644 index 0000000..0bcd988 Binary files /dev/null and b/DATOS/EMP00001/CMP-1997.M12 differ diff --git a/DATOS/EMP00001/CMP-1998.M01 b/DATOS/EMP00001/CMP-1998.M01 new file mode 100644 index 0000000..3a04a23 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M01 differ diff --git a/DATOS/EMP00001/CMP-1998.M02 b/DATOS/EMP00001/CMP-1998.M02 new file mode 100644 index 0000000..ec05e24 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M02 differ diff --git a/DATOS/EMP00001/CMP-1998.M03 b/DATOS/EMP00001/CMP-1998.M03 new file mode 100644 index 0000000..5ae6e17 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M03 differ diff --git a/DATOS/EMP00001/CMP-1998.M04 b/DATOS/EMP00001/CMP-1998.M04 new file mode 100644 index 0000000..d7ae5f1 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M04 differ diff --git a/DATOS/EMP00001/CMP-1998.M05 b/DATOS/EMP00001/CMP-1998.M05 new file mode 100644 index 0000000..11cef29 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M05 differ diff --git a/DATOS/EMP00001/CMP-1998.M06 b/DATOS/EMP00001/CMP-1998.M06 new file mode 100644 index 0000000..7edeac5 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M06 differ diff --git a/DATOS/EMP00001/CMP-1998.M07 b/DATOS/EMP00001/CMP-1998.M07 new file mode 100644 index 0000000..0230344 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M07 differ diff --git a/DATOS/EMP00001/CMP-1998.M08 b/DATOS/EMP00001/CMP-1998.M08 new file mode 100644 index 0000000..587fce2 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M08 differ diff --git a/DATOS/EMP00001/CMP-1998.M09 b/DATOS/EMP00001/CMP-1998.M09 new file mode 100644 index 0000000..4a06f96 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M09 differ diff --git a/DATOS/EMP00001/CMP-1998.M10 b/DATOS/EMP00001/CMP-1998.M10 new file mode 100644 index 0000000..bc838fb Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M10 differ diff --git a/DATOS/EMP00001/CMP-1998.M11 b/DATOS/EMP00001/CMP-1998.M11 new file mode 100644 index 0000000..1b2b653 Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M11 differ diff --git a/DATOS/EMP00001/CMP-1998.M12 b/DATOS/EMP00001/CMP-1998.M12 new file mode 100644 index 0000000..6891d5e Binary files /dev/null and b/DATOS/EMP00001/CMP-1998.M12 differ diff --git a/DATOS/EMP00001/CMP-1999.M01 b/DATOS/EMP00001/CMP-1999.M01 new file mode 100644 index 0000000..0af8fc2 Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M01 differ diff --git a/DATOS/EMP00001/CMP-1999.M02 b/DATOS/EMP00001/CMP-1999.M02 new file mode 100644 index 0000000..0b53498 Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M02 differ diff --git a/DATOS/EMP00001/CMP-1999.M03 b/DATOS/EMP00001/CMP-1999.M03 new file mode 100644 index 0000000..ba273cc Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M03 differ diff --git a/DATOS/EMP00001/CMP-1999.M04 b/DATOS/EMP00001/CMP-1999.M04 new file mode 100644 index 0000000..433d0f9 Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M04 differ diff --git a/DATOS/EMP00001/CMP-1999.M05 b/DATOS/EMP00001/CMP-1999.M05 new file mode 100644 index 0000000..e8c94d0 Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M05 differ diff --git a/DATOS/EMP00001/CMP-1999.M06 b/DATOS/EMP00001/CMP-1999.M06 new file mode 100644 index 0000000..ad038a3 Binary files /dev/null and b/DATOS/EMP00001/CMP-1999.M06 differ diff --git a/DATOS/EMP00001/INFO_CLT.997 b/DATOS/EMP00001/INFO_CLT.997 new file mode 100644 index 0000000..0424f6c Binary files /dev/null and b/DATOS/EMP00001/INFO_CLT.997 differ diff --git a/DATOS/EMP00001/INFO_CLT.998 b/DATOS/EMP00001/INFO_CLT.998 new file mode 100644 index 0000000..8d9c20c Binary files /dev/null and b/DATOS/EMP00001/INFO_CLT.998 differ diff --git a/DATOS/EMP00001/INFO_CLT.999 b/DATOS/EMP00001/INFO_CLT.999 new file mode 100644 index 0000000..1c39ca7 Binary files /dev/null and b/DATOS/EMP00001/INFO_CLT.999 differ diff --git a/DATOS/EMP00001/INFO_CLT.DBF b/DATOS/EMP00001/INFO_CLT.DBF new file mode 100644 index 0000000..9e51f69 Binary files /dev/null and b/DATOS/EMP00001/INFO_CLT.DBF differ diff --git a/DATOS/EMP00001/INFO_EMP.DBF b/DATOS/EMP00001/INFO_EMP.DBF new file mode 100644 index 0000000..1f35249 Binary files /dev/null and b/DATOS/EMP00001/INFO_EMP.DBF differ diff --git a/DATOS/EMP00001/INFO_PRV.996 b/DATOS/EMP00001/INFO_PRV.996 new file mode 100644 index 0000000..b920ba1 Binary files /dev/null and b/DATOS/EMP00001/INFO_PRV.996 differ diff --git a/DATOS/EMP00001/INFO_PRV.997 b/DATOS/EMP00001/INFO_PRV.997 new file mode 100644 index 0000000..8295847 Binary files /dev/null and b/DATOS/EMP00001/INFO_PRV.997 differ diff --git a/DATOS/EMP00001/INFO_PRV.998 b/DATOS/EMP00001/INFO_PRV.998 new file mode 100644 index 0000000..84727ab Binary files /dev/null and b/DATOS/EMP00001/INFO_PRV.998 differ diff --git a/DATOS/EMP00001/INFO_PRV.999 b/DATOS/EMP00001/INFO_PRV.999 new file mode 100644 index 0000000..2ff700a Binary files /dev/null and b/DATOS/EMP00001/INFO_PRV.999 differ diff --git a/DATOS/EMP00001/INFO_REF.BAK b/DATOS/EMP00001/INFO_REF.BAK new file mode 100644 index 0000000..ce67805 Binary files /dev/null and b/DATOS/EMP00001/INFO_REF.BAK differ diff --git a/DATOS/EMP00001/INFO_REF.DB- b/DATOS/EMP00001/INFO_REF.DB- new file mode 100644 index 0000000..ce3f01d Binary files /dev/null and b/DATOS/EMP00001/INFO_REF.DB- differ diff --git a/DATOS/EMP00001/INFO_REF.DBF b/DATOS/EMP00001/INFO_REF.DBF new file mode 100644 index 0000000..145f4ad Binary files /dev/null and b/DATOS/EMP00001/INFO_REF.DBF differ diff --git a/DATOS/EMP00001/INFO_REF.JD b/DATOS/EMP00001/INFO_REF.JD new file mode 100644 index 0000000..2bcf110 Binary files /dev/null and b/DATOS/EMP00001/INFO_REF.JD differ diff --git a/DATOS/EMP00001/MENSAJES.DBF b/DATOS/EMP00001/MENSAJES.DBF new file mode 100644 index 0000000..871db5e Binary files /dev/null and b/DATOS/EMP00001/MENSAJES.DBF differ diff --git a/DATOS/EMP00001/N.MDB b/DATOS/EMP00001/N.MDB new file mode 100644 index 0000000..6a4a82d Binary files /dev/null and b/DATOS/EMP00001/N.MDB differ diff --git a/DATOS/EMP00001/SCROLL.TXT b/DATOS/EMP00001/SCROLL.TXT new file mode 100644 index 0000000..2129079 --- /dev/null +++ b/DATOS/EMP00001/SCROLL.TXT @@ -0,0 +1,168 @@ + + +@1,140 +Desayuno Especial +@0,130 + Cafe + + Tostada Jamon + Û + Zumo 225 + + + + +@2,140 +Pide un Baguette +@0,130 + Jamon y Queso 225 York y Queso + Pringa 200 Tortilla Patatas + Vegetal 200 Salchicha + Chorizo 200 + Pollo y Queso 225 Lomo + Roquefor y Jam. 225 + Anchoa 250 Lomo Mechado + + + ­ ­ Pida una Caipiri¤a + ­­ Pida una Caipiri¤a !! + !! pide pajaritos fritos !! + + + + ÜÜÜ ÜÜÜ ÜÜÜ ÜÜ ÜÜ Ü ÜÜÜ ÜÜÜ + ÛÜÛ ÛÜ ßÜ Û ÛÜÜÛ Û Û Û Û + Û ÛÜÜ ÜÜÛ ÛÜ Û Û Û Û ÛÜÛ + +ÜÜ ÜÜÜ Ü ÜÜÜ ÜÜÜ ÜÜÜ Ü ÜÜ Ü +ÛÜ ÛÜß Û Û Û Û ÛÜÛ ÛÜÛ ÛÜß ÛÜÛ +Û Û Û Û Û ÛÜÛ Û Û Û Û Û Û Û + + Ü Ü ÜÜ Ü Ü ÜÜÜ ÜÜ + Û Û ÛÜ Û Û ÛÜÛ ÛÜß + ÛÜ ÛÜ ÛÜ ßÜß Û Û Û Û + + + VISITANO EN NUESTRA OTRA + BODEGUILLA + VIRGEN DEL BUEN AIRE TORRE 2 + TF954453191 + + + + +@1,140 +Pescaito frito +@0,130 + +Calamares 1/4 o Raci¢n 500 +Pescadda frita " " 475 +Puntillitas " " 550 +Adobo " " 400 +Hueva Frita " " 500 +Pijota " " S/M +Boquerones " " S/M +Pavias " " 400 +Croquetas " " 400 +Frito Variado " " 1200 + +@1,140 +Carnes (en mesa o para llever ) +@0,130 + +Churrasco de cerdo 1/4 o Raci¢n 450 +Churrasco de pollo " " 500 +Churrasco de pavo " " 300 +Brocheta de solomillo " " 550 +Hamburguesa " " 250 +Pinchito de pollo " " 200 +Lomo Plancha " " 200 +Super Serranito " " 350 + +@1,140 +Ali¤os +@0,130 + TAPA RACIàN +Ensaladilla 200 350 +Ali¤o de gambas 200 350 +Ali¤o de patatas 200 300 +Pimientos asados 200 350 + TAPA RACIàN +At£n encebollado 200 350 +Patatas ali¤adas 200 350 +Melva 200 +Cocktel de Marisco 300 + + +@1,140 +Guisos +@0,130 + TAPA RACIàN +Menudo con garbanzo 200 400 +Espinacas 200 400 +Carnes con tomate 200 400 +Lomo mechado 250 400 +Solomicho al whisky 250 800 + + +Albondigas 200 350 +Gambas al ajillo 250 1200. + +Bacalao con tomate 200 400 + + +@1,140 +Chacina +@0,130 + TAPA RACIàN +Queso Oveja 200 800 + +Queso de Cabra 200 750 +Queso Cabrales 200 750 +Queso al Salmon 200 +Queso Finas Hierbas 200 +@1,140 +Bandeja de quesos variados 1700 +@0,130 + +Jamon de Bellota 250 1200 +Morcon 200 750 +Ca¤a de Lomo 200 1000 +Chicharrones 200 +@1,140 +Bandeja Serrana 2100 +@0,130 + +@1,140 +Platos combinados +@0,130 + +N§1 Tortilla francesa, pimientos fritos + y jam¢n. + 400 + +N§2 Lomo plancha con patatas fritas y + pesscada frita. + 400 + +N§3 Tortilla Jam¢n, croquetas, ensalada. + 400 + +N§4 Frito variado, 1 Persona 600 + +N§5 Tortilla de esparragos,pescada frita + ensalada. + 550 + +N§6 Huevos fritos con Jam¢n y pimientos. + 400 + +PIDA UNA CAIPIRI¥A + 300 + + + + + MENU DEL DIA + 700 PTS + diff --git a/DATOS/EMP00001/TPV.PCX b/DATOS/EMP00001/TPV.PCX new file mode 100644 index 0000000..4ea5ae7 Binary files /dev/null and b/DATOS/EMP00001/TPV.PCX differ diff --git a/DATOS/EMP00001/VISUAL.CPP b/DATOS/EMP00001/VISUAL.CPP new file mode 100644 index 0000000..b188ce5 --- /dev/null +++ b/DATOS/EMP00001/VISUAL.CPP @@ -0,0 +1,30 @@ +#include + +#include "d:\program\src_dos\libs\bdatos\bdatos.hh" +#include "d:\program\src_dos\tpv\tpv_def.h" + + +BDatos BReg; +VENTAS SReg; + + +void main ( void ) +{ + long i; + + if ( BReg.AbrirReg( "ventas.tmp", sizeof( VENTAS ) ) == ERROR ) + { + cprintf( "Error leyendo VENTAS.TMP\r\n" ); + return; + } + + for ( i = 0; i < BReg.Registros(); i++ ) + { + BReg.LeeReg( (void *)&SReg, i ); + cprintf( "Reg %02d: %09lu %06u %06lu %06lu\r\n", i, SReg.CodigoR, SReg.Cantidad, SReg.PrecioC, SReg.PrecioV ); + } + + BReg.CerrarReg(); + +} + diff --git a/DATOS/EMP00001/VISUAL.EXE b/DATOS/EMP00001/VISUAL.EXE new file mode 100644 index 0000000..d9058b3 Binary files /dev/null and b/DATOS/EMP00001/VISUAL.EXE differ diff --git a/DATOS/EMP00001/VISUAL.PRJ b/DATOS/EMP00001/VISUAL.PRJ new file mode 100644 index 0000000..3926ee0 Binary files /dev/null and b/DATOS/EMP00001/VISUAL.PRJ differ diff --git a/DATOS/EMP00001/VT1-1996.M11 b/DATOS/EMP00001/VT1-1996.M11 new file mode 100644 index 0000000..7f26bf1 Binary files /dev/null and b/DATOS/EMP00001/VT1-1996.M11 differ diff --git a/DATOS/EMP00001/VT1-1996.M12 b/DATOS/EMP00001/VT1-1996.M12 new file mode 100644 index 0000000..97f5a7c Binary files /dev/null and b/DATOS/EMP00001/VT1-1996.M12 differ diff --git a/DATOS/EMP00001/VT1-1997.M03 b/DATOS/EMP00001/VT1-1997.M03 new file mode 100644 index 0000000..7202d01 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M03 differ diff --git a/DATOS/EMP00001/VT1-1997.M06 b/DATOS/EMP00001/VT1-1997.M06 new file mode 100644 index 0000000..182fee2 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M06 differ diff --git a/DATOS/EMP00001/VT1-1997.M07 b/DATOS/EMP00001/VT1-1997.M07 new file mode 100644 index 0000000..385b4f9 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M07 differ diff --git a/DATOS/EMP00001/VT1-1997.M08 b/DATOS/EMP00001/VT1-1997.M08 new file mode 100644 index 0000000..ffc60b5 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M08 differ diff --git a/DATOS/EMP00001/VT1-1997.M09 b/DATOS/EMP00001/VT1-1997.M09 new file mode 100644 index 0000000..0c59a21 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M09 differ diff --git a/DATOS/EMP00001/VT1-1997.M10 b/DATOS/EMP00001/VT1-1997.M10 new file mode 100644 index 0000000..964fc9b Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M10 differ diff --git a/DATOS/EMP00001/VT1-1997.M11 b/DATOS/EMP00001/VT1-1997.M11 new file mode 100644 index 0000000..51fe7d8 Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M11 differ diff --git a/DATOS/EMP00001/VT1-1997.M12 b/DATOS/EMP00001/VT1-1997.M12 new file mode 100644 index 0000000..3cea2ae Binary files /dev/null and b/DATOS/EMP00001/VT1-1997.M12 differ diff --git a/DATOS/EMP00001/VT1-1998.M01 b/DATOS/EMP00001/VT1-1998.M01 new file mode 100644 index 0000000..0914bec Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M01 differ diff --git a/DATOS/EMP00001/VT1-1998.M02 b/DATOS/EMP00001/VT1-1998.M02 new file mode 100644 index 0000000..a146919 Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M02 differ diff --git a/DATOS/EMP00001/VT1-1998.M03 b/DATOS/EMP00001/VT1-1998.M03 new file mode 100644 index 0000000..79070b7 Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M03 differ diff --git a/DATOS/EMP00001/VT1-1998.M04 b/DATOS/EMP00001/VT1-1998.M04 new file mode 100644 index 0000000..95e55ab Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M04 differ diff --git a/DATOS/EMP00001/VT1-1998.M05 b/DATOS/EMP00001/VT1-1998.M05 new file mode 100644 index 0000000..4a02d8f Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M05 differ diff --git a/DATOS/EMP00001/VT1-1998.M06 b/DATOS/EMP00001/VT1-1998.M06 new file mode 100644 index 0000000..f7287c8 Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M06 differ diff --git a/DATOS/EMP00001/VT1-1998.M07 b/DATOS/EMP00001/VT1-1998.M07 new file mode 100644 index 0000000..18ff5bc Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M07 differ diff --git a/DATOS/EMP00001/VT1-1998.M08 b/DATOS/EMP00001/VT1-1998.M08 new file mode 100644 index 0000000..6569c0e Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M08 differ diff --git a/DATOS/EMP00001/VT1-1998.M09 b/DATOS/EMP00001/VT1-1998.M09 new file mode 100644 index 0000000..9b60e32 Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M09 differ diff --git a/DATOS/EMP00001/VT1-1998.M10 b/DATOS/EMP00001/VT1-1998.M10 new file mode 100644 index 0000000..401532c Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M10 differ diff --git a/DATOS/EMP00001/VT1-1998.M11 b/DATOS/EMP00001/VT1-1998.M11 new file mode 100644 index 0000000..dbd0a09 Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M11 differ diff --git a/DATOS/EMP00001/VT1-1998.M12 b/DATOS/EMP00001/VT1-1998.M12 new file mode 100644 index 0000000..b9771ae Binary files /dev/null and b/DATOS/EMP00001/VT1-1998.M12 differ diff --git a/DATOS/EMP00001/VT1-1999.M01 b/DATOS/EMP00001/VT1-1999.M01 new file mode 100644 index 0000000..fa48e89 Binary files /dev/null and b/DATOS/EMP00001/VT1-1999.M01 differ diff --git a/DATOS/EMP00001/VT1-1999.M02 b/DATOS/EMP00001/VT1-1999.M02 new file mode 100644 index 0000000..cd1583c Binary files /dev/null and b/DATOS/EMP00001/VT1-1999.M02 differ diff --git a/DATOS/EMP00001/VT1-1999.M03 b/DATOS/EMP00001/VT1-1999.M03 new file mode 100644 index 0000000..753deb0 Binary files /dev/null and b/DATOS/EMP00001/VT1-1999.M03 differ diff --git a/DATOS/EMP00001/VT2-1996.M11 b/DATOS/EMP00001/VT2-1996.M11 new file mode 100644 index 0000000..4553741 Binary files /dev/null and b/DATOS/EMP00001/VT2-1996.M11 differ diff --git a/DATOS/EMP00001/VT2-1996.M12 b/DATOS/EMP00001/VT2-1996.M12 new file mode 100644 index 0000000..f90bb67 Binary files /dev/null and b/DATOS/EMP00001/VT2-1996.M12 differ diff --git a/DATOS/EMP00001/VT2-1997.M03 b/DATOS/EMP00001/VT2-1997.M03 new file mode 100644 index 0000000..a34d034 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M03 differ diff --git a/DATOS/EMP00001/VT2-1997.M06 b/DATOS/EMP00001/VT2-1997.M06 new file mode 100644 index 0000000..47ba0a0 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M06 differ diff --git a/DATOS/EMP00001/VT2-1997.M07 b/DATOS/EMP00001/VT2-1997.M07 new file mode 100644 index 0000000..32fe2f3 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M07 differ diff --git a/DATOS/EMP00001/VT2-1997.M08 b/DATOS/EMP00001/VT2-1997.M08 new file mode 100644 index 0000000..a891145 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M08 differ diff --git a/DATOS/EMP00001/VT2-1997.M09 b/DATOS/EMP00001/VT2-1997.M09 new file mode 100644 index 0000000..96df163 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M09 differ diff --git a/DATOS/EMP00001/VT2-1997.M10 b/DATOS/EMP00001/VT2-1997.M10 new file mode 100644 index 0000000..9a9bb08 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M10 differ diff --git a/DATOS/EMP00001/VT2-1997.M11 b/DATOS/EMP00001/VT2-1997.M11 new file mode 100644 index 0000000..40249f9 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M11 differ diff --git a/DATOS/EMP00001/VT2-1997.M12 b/DATOS/EMP00001/VT2-1997.M12 new file mode 100644 index 0000000..ebb5eb9 Binary files /dev/null and b/DATOS/EMP00001/VT2-1997.M12 differ diff --git a/DATOS/EMP00001/VT2-1998.M01 b/DATOS/EMP00001/VT2-1998.M01 new file mode 100644 index 0000000..99f583d Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M01 differ diff --git a/DATOS/EMP00001/VT2-1998.M02 b/DATOS/EMP00001/VT2-1998.M02 new file mode 100644 index 0000000..54bf933 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M02 differ diff --git a/DATOS/EMP00001/VT2-1998.M03 b/DATOS/EMP00001/VT2-1998.M03 new file mode 100644 index 0000000..12a5fb1 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M03 differ diff --git a/DATOS/EMP00001/VT2-1998.M04 b/DATOS/EMP00001/VT2-1998.M04 new file mode 100644 index 0000000..6230f90 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M04 differ diff --git a/DATOS/EMP00001/VT2-1998.M05 b/DATOS/EMP00001/VT2-1998.M05 new file mode 100644 index 0000000..4795c35 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M05 differ diff --git a/DATOS/EMP00001/VT2-1998.M06 b/DATOS/EMP00001/VT2-1998.M06 new file mode 100644 index 0000000..aad439c Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M06 differ diff --git a/DATOS/EMP00001/VT2-1998.M07 b/DATOS/EMP00001/VT2-1998.M07 new file mode 100644 index 0000000..e60abd8 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M07 differ diff --git a/DATOS/EMP00001/VT2-1998.M08 b/DATOS/EMP00001/VT2-1998.M08 new file mode 100644 index 0000000..417226c Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M08 differ diff --git a/DATOS/EMP00001/VT2-1998.M09 b/DATOS/EMP00001/VT2-1998.M09 new file mode 100644 index 0000000..538a8d9 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M09 differ diff --git a/DATOS/EMP00001/VT2-1998.M10 b/DATOS/EMP00001/VT2-1998.M10 new file mode 100644 index 0000000..872ae33 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M10 differ diff --git a/DATOS/EMP00001/VT2-1998.M11 b/DATOS/EMP00001/VT2-1998.M11 new file mode 100644 index 0000000..bb5ff16 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M11 differ diff --git a/DATOS/EMP00001/VT2-1998.M12 b/DATOS/EMP00001/VT2-1998.M12 new file mode 100644 index 0000000..210d235 Binary files /dev/null and b/DATOS/EMP00001/VT2-1998.M12 differ diff --git a/DATOS/EMP00001/VT2-1999.M01 b/DATOS/EMP00001/VT2-1999.M01 new file mode 100644 index 0000000..5ff5301 Binary files /dev/null and b/DATOS/EMP00001/VT2-1999.M01 differ diff --git a/DATOS/EMP00001/VT2-1999.M02 b/DATOS/EMP00001/VT2-1999.M02 new file mode 100644 index 0000000..ad2ab43 Binary files /dev/null and b/DATOS/EMP00001/VT2-1999.M02 differ diff --git a/DATOS/EMP00001/VT2-1999.M03 b/DATOS/EMP00001/VT2-1999.M03 new file mode 100644 index 0000000..61ccfbd Binary files /dev/null and b/DATOS/EMP00001/VT2-1999.M03 differ diff --git a/DATOS/EMP00001/VT3-1996.M-- b/DATOS/EMP00001/VT3-1996.M-- new file mode 100644 index 0000000..134449f Binary files /dev/null and b/DATOS/EMP00001/VT3-1996.M-- differ diff --git a/DATOS/EMP00001/VT3-1996.M11 b/DATOS/EMP00001/VT3-1996.M11 new file mode 100644 index 0000000..134449f Binary files /dev/null and b/DATOS/EMP00001/VT3-1996.M11 differ diff --git a/DATOS/EMP00001/VT3-1996.M12 b/DATOS/EMP00001/VT3-1996.M12 new file mode 100644 index 0000000..8b4adf0 Binary files /dev/null and b/DATOS/EMP00001/VT3-1996.M12 differ diff --git a/DATOS/EMP00001/VT3-1997.M-- b/DATOS/EMP00001/VT3-1997.M-- new file mode 100644 index 0000000..134449f Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M-- differ diff --git a/DATOS/EMP00001/VT3-1997.M03 b/DATOS/EMP00001/VT3-1997.M03 new file mode 100644 index 0000000..336295f Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M03 differ diff --git a/DATOS/EMP00001/VT3-1997.M06 b/DATOS/EMP00001/VT3-1997.M06 new file mode 100644 index 0000000..3748d7c Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M06 differ diff --git a/DATOS/EMP00001/VT3-1997.M07 b/DATOS/EMP00001/VT3-1997.M07 new file mode 100644 index 0000000..6407268 Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M07 differ diff --git a/DATOS/EMP00001/VT3-1997.M08 b/DATOS/EMP00001/VT3-1997.M08 new file mode 100644 index 0000000..0d2cbda Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M08 differ diff --git a/DATOS/EMP00001/VT3-1997.M09 b/DATOS/EMP00001/VT3-1997.M09 new file mode 100644 index 0000000..1817779 Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M09 differ diff --git a/DATOS/EMP00001/VT3-1997.M10 b/DATOS/EMP00001/VT3-1997.M10 new file mode 100644 index 0000000..87fec16 Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M10 differ diff --git a/DATOS/EMP00001/VT3-1997.M11 b/DATOS/EMP00001/VT3-1997.M11 new file mode 100644 index 0000000..4574a08 Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M11 differ diff --git a/DATOS/EMP00001/VT3-1997.M12 b/DATOS/EMP00001/VT3-1997.M12 new file mode 100644 index 0000000..ce51529 Binary files /dev/null and b/DATOS/EMP00001/VT3-1997.M12 differ diff --git a/DATOS/EMP00001/VT3-1998.M-- b/DATOS/EMP00001/VT3-1998.M-- new file mode 100644 index 0000000..945d710 Binary files /dev/null and b/DATOS/EMP00001/VT3-1998.M-- differ diff --git a/DATOS/EMP00001/VT3-1998.M01 b/DATOS/EMP00001/VT3-1998.M01 new file mode 100644 index 0000000..580e9d3 Binary files /dev/null and b/DATOS/EMP00001/VT3-1998.M01 differ diff --git a/DATOS/EMP00001/VT3-1999.M-- b/DATOS/EMP00001/VT3-1999.M-- new file mode 100644 index 0000000..3a7504b Binary files /dev/null and b/DATOS/EMP00001/VT3-1999.M-- differ diff --git a/DATOS/EMP00003/CMP-1998.M01 b/DATOS/EMP00003/CMP-1998.M01 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M01 differ diff --git a/DATOS/EMP00003/CMP-1998.M02 b/DATOS/EMP00003/CMP-1998.M02 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M02 differ diff --git a/DATOS/EMP00003/CMP-1998.M03 b/DATOS/EMP00003/CMP-1998.M03 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M03 differ diff --git a/DATOS/EMP00003/CMP-1998.M04 b/DATOS/EMP00003/CMP-1998.M04 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M04 differ diff --git a/DATOS/EMP00003/CMP-1998.M05 b/DATOS/EMP00003/CMP-1998.M05 new file mode 100644 index 0000000..c8ad683 Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M05 differ diff --git a/DATOS/EMP00003/CMP-1998.M06 b/DATOS/EMP00003/CMP-1998.M06 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M06 differ diff --git a/DATOS/EMP00003/CMP-1998.M07 b/DATOS/EMP00003/CMP-1998.M07 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M07 differ diff --git a/DATOS/EMP00003/CMP-1998.M08 b/DATOS/EMP00003/CMP-1998.M08 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M08 differ diff --git a/DATOS/EMP00003/CMP-1998.M09 b/DATOS/EMP00003/CMP-1998.M09 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M09 differ diff --git a/DATOS/EMP00003/CMP-1998.M10 b/DATOS/EMP00003/CMP-1998.M10 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M10 differ diff --git a/DATOS/EMP00003/CMP-1998.M11 b/DATOS/EMP00003/CMP-1998.M11 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M11 differ diff --git a/DATOS/EMP00003/CMP-1998.M12 b/DATOS/EMP00003/CMP-1998.M12 new file mode 100644 index 0000000..26f92ee Binary files /dev/null and b/DATOS/EMP00003/CMP-1998.M12 differ diff --git a/DATOS/EMP00003/INFO_CLT.998 b/DATOS/EMP00003/INFO_CLT.998 new file mode 100644 index 0000000..6b2af41 Binary files /dev/null and b/DATOS/EMP00003/INFO_CLT.998 differ diff --git a/DATOS/EMP00003/INFO_CLT.999 b/DATOS/EMP00003/INFO_CLT.999 new file mode 100644 index 0000000..8759ad3 Binary files /dev/null and b/DATOS/EMP00003/INFO_CLT.999 differ diff --git a/DATOS/EMP00003/INFO_CLT.DBF b/DATOS/EMP00003/INFO_CLT.DBF new file mode 100644 index 0000000..31ff513 Binary files /dev/null and b/DATOS/EMP00003/INFO_CLT.DBF differ diff --git a/DATOS/EMP00003/INFO_EMP.DBF b/DATOS/EMP00003/INFO_EMP.DBF new file mode 100644 index 0000000..b73efb6 Binary files /dev/null and b/DATOS/EMP00003/INFO_EMP.DBF differ diff --git a/DATOS/EMP00003/INFO_PRV.997 b/DATOS/EMP00003/INFO_PRV.997 new file mode 100644 index 0000000..c4113b5 Binary files /dev/null and b/DATOS/EMP00003/INFO_PRV.997 differ diff --git a/DATOS/EMP00003/INFO_PRV.998 b/DATOS/EMP00003/INFO_PRV.998 new file mode 100644 index 0000000..c4113b5 Binary files /dev/null and b/DATOS/EMP00003/INFO_PRV.998 differ diff --git a/DATOS/EMP00003/INFO_PRV.999 b/DATOS/EMP00003/INFO_PRV.999 new file mode 100644 index 0000000..c4113b5 Binary files /dev/null and b/DATOS/EMP00003/INFO_PRV.999 differ diff --git a/DATOS/EMP00003/INFO_REF.DBF b/DATOS/EMP00003/INFO_REF.DBF new file mode 100644 index 0000000..f2bafd0 Binary files /dev/null and b/DATOS/EMP00003/INFO_REF.DBF differ diff --git a/DATOS/EMP00003/MENSAJES.DBF b/DATOS/EMP00003/MENSAJES.DBF new file mode 100644 index 0000000..0c35acb Binary files /dev/null and b/DATOS/EMP00003/MENSAJES.DBF differ diff --git a/DATOS/EMP00003/VT1-1997.M06 b/DATOS/EMP00003/VT1-1997.M06 new file mode 100644 index 0000000..5e80425 Binary files /dev/null and b/DATOS/EMP00003/VT1-1997.M06 differ diff --git a/DATOS/EMP00003/VT1-1997.M07 b/DATOS/EMP00003/VT1-1997.M07 new file mode 100644 index 0000000..1b7465a Binary files /dev/null and b/DATOS/EMP00003/VT1-1997.M07 differ diff --git a/DATOS/EMP00003/VT1-1997.M09 b/DATOS/EMP00003/VT1-1997.M09 new file mode 100644 index 0000000..78fe14e Binary files /dev/null and b/DATOS/EMP00003/VT1-1997.M09 differ diff --git a/DATOS/EMP00003/VT2-1997.M06 b/DATOS/EMP00003/VT2-1997.M06 new file mode 100644 index 0000000..3cb1a8e Binary files /dev/null and b/DATOS/EMP00003/VT2-1997.M06 differ diff --git a/DATOS/EMP00003/VT2-1997.M07 b/DATOS/EMP00003/VT2-1997.M07 new file mode 100644 index 0000000..4fd5008 Binary files /dev/null and b/DATOS/EMP00003/VT2-1997.M07 differ diff --git a/DATOS/EMP00003/VT2-1997.M09 b/DATOS/EMP00003/VT2-1997.M09 new file mode 100644 index 0000000..2dc6779 Binary files /dev/null and b/DATOS/EMP00003/VT2-1997.M09 differ diff --git a/DATOS/EMP00003/VT3-1997.M-- b/DATOS/EMP00003/VT3-1997.M-- new file mode 100644 index 0000000..134449f Binary files /dev/null and b/DATOS/EMP00003/VT3-1997.M-- differ diff --git a/DATOS/EMP00003/VT3-1997.M06 b/DATOS/EMP00003/VT3-1997.M06 new file mode 100644 index 0000000..61af573 Binary files /dev/null and b/DATOS/EMP00003/VT3-1997.M06 differ diff --git a/DATOS/EMP00003/VT3-1997.M07 b/DATOS/EMP00003/VT3-1997.M07 new file mode 100644 index 0000000..b6f1841 Binary files /dev/null and b/DATOS/EMP00003/VT3-1997.M07 differ diff --git a/DATOS/EMP00003/VT3-1997.M09 b/DATOS/EMP00003/VT3-1997.M09 new file mode 100644 index 0000000..0ecf370 Binary files /dev/null and b/DATOS/EMP00003/VT3-1997.M09 differ diff --git a/DATOS/EMP00010/CMP-1998.M01 b/DATOS/EMP00010/CMP-1998.M01 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M01 differ diff --git a/DATOS/EMP00010/CMP-1998.M02 b/DATOS/EMP00010/CMP-1998.M02 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M02 differ diff --git a/DATOS/EMP00010/CMP-1998.M03 b/DATOS/EMP00010/CMP-1998.M03 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M03 differ diff --git a/DATOS/EMP00010/CMP-1998.M04 b/DATOS/EMP00010/CMP-1998.M04 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M04 differ diff --git a/DATOS/EMP00010/CMP-1998.M05 b/DATOS/EMP00010/CMP-1998.M05 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M05 differ diff --git a/DATOS/EMP00010/CMP-1998.M06 b/DATOS/EMP00010/CMP-1998.M06 new file mode 100644 index 0000000..7cc0937 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M06 differ diff --git a/DATOS/EMP00010/CMP-1998.M07 b/DATOS/EMP00010/CMP-1998.M07 new file mode 100644 index 0000000..b51314c Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M07 differ diff --git a/DATOS/EMP00010/CMP-1998.M08 b/DATOS/EMP00010/CMP-1998.M08 new file mode 100644 index 0000000..d8964d7 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M08 differ diff --git a/DATOS/EMP00010/CMP-1998.M09 b/DATOS/EMP00010/CMP-1998.M09 new file mode 100644 index 0000000..ccc481d Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M09 differ diff --git a/DATOS/EMP00010/CMP-1998.M10 b/DATOS/EMP00010/CMP-1998.M10 new file mode 100644 index 0000000..c2fc678 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M10 differ diff --git a/DATOS/EMP00010/CMP-1998.M11 b/DATOS/EMP00010/CMP-1998.M11 new file mode 100644 index 0000000..3bfffff Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M11 differ diff --git a/DATOS/EMP00010/CMP-1998.M12 b/DATOS/EMP00010/CMP-1998.M12 new file mode 100644 index 0000000..e8f9557 Binary files /dev/null and b/DATOS/EMP00010/CMP-1998.M12 differ diff --git a/DATOS/EMP00010/CMP-1999.M01 b/DATOS/EMP00010/CMP-1999.M01 new file mode 100644 index 0000000..d6e8b8b Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M01 differ diff --git a/DATOS/EMP00010/CMP-1999.M02 b/DATOS/EMP00010/CMP-1999.M02 new file mode 100644 index 0000000..c55a302 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M02 differ diff --git a/DATOS/EMP00010/CMP-1999.M03 b/DATOS/EMP00010/CMP-1999.M03 new file mode 100644 index 0000000..e72e63a Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M03 differ diff --git a/DATOS/EMP00010/CMP-1999.M04 b/DATOS/EMP00010/CMP-1999.M04 new file mode 100644 index 0000000..f83bf7b Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M04 differ diff --git a/DATOS/EMP00010/CMP-1999.M05 b/DATOS/EMP00010/CMP-1999.M05 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M05 differ diff --git a/DATOS/EMP00010/CMP-1999.M06 b/DATOS/EMP00010/CMP-1999.M06 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M06 differ diff --git a/DATOS/EMP00010/CMP-1999.M07 b/DATOS/EMP00010/CMP-1999.M07 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M07 differ diff --git a/DATOS/EMP00010/CMP-1999.M08 b/DATOS/EMP00010/CMP-1999.M08 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M08 differ diff --git a/DATOS/EMP00010/CMP-1999.M09 b/DATOS/EMP00010/CMP-1999.M09 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M09 differ diff --git a/DATOS/EMP00010/CMP-1999.M10 b/DATOS/EMP00010/CMP-1999.M10 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M10 differ diff --git a/DATOS/EMP00010/CMP-1999.M11 b/DATOS/EMP00010/CMP-1999.M11 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M11 differ diff --git a/DATOS/EMP00010/CMP-1999.M12 b/DATOS/EMP00010/CMP-1999.M12 new file mode 100644 index 0000000..3f48253 Binary files /dev/null and b/DATOS/EMP00010/CMP-1999.M12 differ diff --git a/DATOS/EMP00010/INFO_CLT.998 b/DATOS/EMP00010/INFO_CLT.998 new file mode 100644 index 0000000..448b1bd Binary files /dev/null and b/DATOS/EMP00010/INFO_CLT.998 differ diff --git a/DATOS/EMP00010/INFO_CLT.DBF b/DATOS/EMP00010/INFO_CLT.DBF new file mode 100644 index 0000000..fb05ddb Binary files /dev/null and b/DATOS/EMP00010/INFO_CLT.DBF differ diff --git a/DATOS/EMP00010/INFO_EMP.DBF b/DATOS/EMP00010/INFO_EMP.DBF new file mode 100644 index 0000000..b73efb6 Binary files /dev/null and b/DATOS/EMP00010/INFO_EMP.DBF differ diff --git a/DATOS/EMP00010/INFO_PRV.998 b/DATOS/EMP00010/INFO_PRV.998 new file mode 100644 index 0000000..483fa46 Binary files /dev/null and b/DATOS/EMP00010/INFO_PRV.998 differ diff --git a/DATOS/EMP00010/INFO_PRV.999 b/DATOS/EMP00010/INFO_PRV.999 new file mode 100644 index 0000000..9b1503d Binary files /dev/null and b/DATOS/EMP00010/INFO_PRV.999 differ diff --git a/DATOS/EMP00010/INFO_REF.DBF b/DATOS/EMP00010/INFO_REF.DBF new file mode 100644 index 0000000..3fec1f5 Binary files /dev/null and b/DATOS/EMP00010/INFO_REF.DBF differ diff --git a/DATOS/EMP00010/MENSAJES.DBF b/DATOS/EMP00010/MENSAJES.DBF new file mode 100644 index 0000000..839bc1c Binary files /dev/null and b/DATOS/EMP00010/MENSAJES.DBF differ diff --git a/DATOS/EMP00010/SCROLL.TXT b/DATOS/EMP00010/SCROLL.TXT new file mode 100644 index 0000000..a1ef5bc --- /dev/null +++ b/DATOS/EMP00010/SCROLL.TXT @@ -0,0 +1,178 @@ +@1,140 +Desayuno Especial +@0,130 + Cafe + + Tostada Jamon + Û + Zumo 225 + + +@2,140 +Pide un Baguette +@0,130 + Jamon y Queso 225 York y Queso + Pringa 200 Tortilla Patatas + Vegetal 200 Salchicha + Chorizo 200 + Pollo y Queso 225 Lomo + Roquefor y Jam. 225 + Anchoa 250 Lomo Mechado + + + VISITANOS EN NUESTRA OTRA + BODEGUILLA + Plaza del Polo, l.49 + +@1,140 +Cubalibres +@0,130 + Rives 325 + Larios 325 + Bacardi 350 + Vodka 325 + Ginebra Beefeater 350 + Ron Cacique 425 + Ron Abana 550 + Ron Capitan Morgan 425 + Ron Panpero 425 + Ron Negrita 425 + Ron Burdon + Refresco 250 + +@1,140 +Medios Litros +@0,130 + Tinto + Refresco 175 M + Cerveza 175 M + Larios + Refresco 475 M + Rives + Refresco 475 M + Ron + Refresco 500 M + Cuantro + Refresco 600 M + Licor 43 + Refresco 600 M + Cacique + Refresco 500 M + Beefeater+ Refresco 500 M + Habana + Refresco 800 M + Hankey Banister + Refr. 400 M + Ballentine + Refr. 500 M + J&B + Refresco 500 M + Four Rose+ Refresco 550 M + Jack Daniels + Refr. 800 M + JimBeam + Refresco 500 M + Vac69 + Refresco 400 M + +@1,140 +Litros +@0,130 + Tinto + Refresco 275 L + Cerveza 300 L + Larios + Refresco 700 L + Rives + Refresco 700 L + Ron + Refresco 800 L + Cuantro + Refresco 900 L + Licor 43 + Refresco 900 L + Cacique + Refresco 800 L + Beefeater+ Refresco 800 L + Habana + Refresco 1200 L + Hankey Banister + Refr. 600 L + Ballentine + Refr. 900 L + J&B + Refresco 900 L + Four Rose+ Refresco 900 L + Jack Daniels + Refr. 1200 L + JimBeam + Refresco 900 L + Vac69 + Refresco 700 L + + +@1,240 +<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^> +< Posiblemente la bodega > +< mas barata de Europa > +< > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +@0,130 + + +@1,140 +Copas +@0,130 + Cortado de cervezas 100 + Tinto de verano 100 + Cruzcampo botellin 100 + Cerveza Negra 125 + Cerveza Dam Rubia 125 + Miller 200 + Elephan 200 + Guines Negra 200 + Copa de Manzanilla 100 + Copa de Vino Dulce 100 + Copa de Rioja 125 + J&B + Refresco 425 + Ballentine + Refresco 425 + Four Rose + Refresco 425 + 100 Piper + Refresco 425 + JimBeam + Refresco 425 + Vac 69 + Refresco 300 + Hankey Banister + Refr. 300 + White Label + Refresco 425 + Jack Daniels+ Refresco 500 + PassPort + Refresco 425 + Jony Walker + Refresco 425 + +@1,140 +Licores +@0,130 + Licor de Guindas 150 + Licor de Menta 150 + Licor de Bellota 150 + Bailey 250 + Licor de café 150 + Licor 43 300 + Licor de Manzana 150 + Licor de Melocoton 150 + Pacharan 125 + Crema Catalana 150 + Drambui 300 + Tia Maria 300 + Licor de Chocolate 250 + Chupito de Tequila 75 + Quantrol 300 + Licor de Natilla 150 + Licor de Avellana 150 + +@1,240 +<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^> +< Pida el agua de Sevilla > +< > +<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^> +< C O L O C A T E > +< > +< Pide un POSTURA > +< > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +@1,140 +Chacina +@0,130 + TAPA RACIàN +Queso Oveja 200 750 +Queso de Cabra 200 750 +Queso Cabrales 200 750 +Queso al Salmon 200 +Queso Finas Hierbas 200 +@1,140 +Bandeja de quesos variados 1700 +@0,130 + +Jamon de Bellota 250 750 +Morcon 200 750 +Ca¤a de Lomo 200 800 +Chicharrones 200 +@1,140 +Bandeja Serrana 1700 +@0,130 + +@1,240 +<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^> +< No tardes mucho en volver que esta > +< la cosa muy mala. > +< > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/DATOS/EMP00010/TPV.PCX b/DATOS/EMP00010/TPV.PCX new file mode 100644 index 0000000..4ea5ae7 Binary files /dev/null and b/DATOS/EMP00010/TPV.PCX differ diff --git a/DATOS/EMP00010/VT1-1998.M08 b/DATOS/EMP00010/VT1-1998.M08 new file mode 100644 index 0000000..e057eda Binary files /dev/null and b/DATOS/EMP00010/VT1-1998.M08 differ diff --git a/DATOS/EMP00010/VT1-1998.M09 b/DATOS/EMP00010/VT1-1998.M09 new file mode 100644 index 0000000..603d941 Binary files /dev/null and b/DATOS/EMP00010/VT1-1998.M09 differ diff --git a/DATOS/EMP00010/VT1-1998.M10 b/DATOS/EMP00010/VT1-1998.M10 new file mode 100644 index 0000000..e6ce0aa Binary files /dev/null and b/DATOS/EMP00010/VT1-1998.M10 differ diff --git a/DATOS/EMP00010/VT1-1998.M11 b/DATOS/EMP00010/VT1-1998.M11 new file mode 100644 index 0000000..d573f79 Binary files /dev/null and b/DATOS/EMP00010/VT1-1998.M11 differ diff --git a/DATOS/EMP00010/VT1-1998.M12 b/DATOS/EMP00010/VT1-1998.M12 new file mode 100644 index 0000000..f80d7c4 Binary files /dev/null and b/DATOS/EMP00010/VT1-1998.M12 differ diff --git a/DATOS/EMP00010/VT1-1999.M01 b/DATOS/EMP00010/VT1-1999.M01 new file mode 100644 index 0000000..1ed0dec Binary files /dev/null and b/DATOS/EMP00010/VT1-1999.M01 differ diff --git a/DATOS/EMP00010/VT1-1999.M02 b/DATOS/EMP00010/VT1-1999.M02 new file mode 100644 index 0000000..f68fd6c Binary files /dev/null and b/DATOS/EMP00010/VT1-1999.M02 differ diff --git a/DATOS/EMP00010/VT1-1999.M03 b/DATOS/EMP00010/VT1-1999.M03 new file mode 100644 index 0000000..1ac7bb4 Binary files /dev/null and b/DATOS/EMP00010/VT1-1999.M03 differ diff --git a/DATOS/EMP00010/VT1-1999.M04 b/DATOS/EMP00010/VT1-1999.M04 new file mode 100644 index 0000000..84bd638 Binary files /dev/null and b/DATOS/EMP00010/VT1-1999.M04 differ diff --git a/DATOS/EMP00010/VT2-1998.M08 b/DATOS/EMP00010/VT2-1998.M08 new file mode 100644 index 0000000..3749e48 Binary files /dev/null and b/DATOS/EMP00010/VT2-1998.M08 differ diff --git a/DATOS/EMP00010/VT2-1998.M09 b/DATOS/EMP00010/VT2-1998.M09 new file mode 100644 index 0000000..490da66 Binary files /dev/null and b/DATOS/EMP00010/VT2-1998.M09 differ diff --git a/DATOS/EMP00010/VT2-1998.M10 b/DATOS/EMP00010/VT2-1998.M10 new file mode 100644 index 0000000..c59c1bb Binary files /dev/null and b/DATOS/EMP00010/VT2-1998.M10 differ diff --git a/DATOS/EMP00010/VT2-1998.M11 b/DATOS/EMP00010/VT2-1998.M11 new file mode 100644 index 0000000..89e0076 Binary files /dev/null and b/DATOS/EMP00010/VT2-1998.M11 differ diff --git a/DATOS/EMP00010/VT2-1998.M12 b/DATOS/EMP00010/VT2-1998.M12 new file mode 100644 index 0000000..4a415b5 Binary files /dev/null and b/DATOS/EMP00010/VT2-1998.M12 differ diff --git a/DATOS/EMP00010/VT2-1999.M01 b/DATOS/EMP00010/VT2-1999.M01 new file mode 100644 index 0000000..d3ec681 Binary files /dev/null and b/DATOS/EMP00010/VT2-1999.M01 differ diff --git a/DATOS/EMP00010/VT2-1999.M02 b/DATOS/EMP00010/VT2-1999.M02 new file mode 100644 index 0000000..17b4e5a Binary files /dev/null and b/DATOS/EMP00010/VT2-1999.M02 differ diff --git a/DATOS/EMP00010/VT2-1999.M03 b/DATOS/EMP00010/VT2-1999.M03 new file mode 100644 index 0000000..1ea5a02 Binary files /dev/null and b/DATOS/EMP00010/VT2-1999.M03 differ diff --git a/DATOS/EMP00010/VT2-1999.M04 b/DATOS/EMP00010/VT2-1999.M04 new file mode 100644 index 0000000..0a5f660 Binary files /dev/null and b/DATOS/EMP00010/VT2-1999.M04 differ diff --git a/DATOS/EMP00010/VT3-0256.M-- b/DATOS/EMP00010/VT3-0256.M-- new file mode 100644 index 0000000..6d5267f Binary files /dev/null and b/DATOS/EMP00010/VT3-0256.M-- differ diff --git a/DATOS/EMP00010/VT3-1998.M-- b/DATOS/EMP00010/VT3-1998.M-- new file mode 100644 index 0000000..8a7ae83 Binary files /dev/null and b/DATOS/EMP00010/VT3-1998.M-- differ diff --git a/DATOS/EMP00010/VT3-1999.M-- b/DATOS/EMP00010/VT3-1999.M-- new file mode 100644 index 0000000..ef2ec06 Binary files /dev/null and b/DATOS/EMP00010/VT3-1999.M-- differ diff --git a/DATOS/EMPRESAS.DBF b/DATOS/EMPRESAS.DBF new file mode 100644 index 0000000..b174065 Binary files /dev/null and b/DATOS/EMPRESAS.DBF differ diff --git a/DATOS/EMPRESAS.bak b/DATOS/EMPRESAS.bak new file mode 100644 index 0000000..cdfc581 Binary files /dev/null and b/DATOS/EMPRESAS.bak differ diff --git a/DATOS/THEMES.022 b/DATOS/THEMES.022 new file mode 100644 index 0000000..71d4897 Binary files /dev/null and b/DATOS/THEMES.022 differ diff --git a/DATOS/THEMES.BAK b/DATOS/THEMES.BAK new file mode 100644 index 0000000..b817fa3 Binary files /dev/null and b/DATOS/THEMES.BAK differ diff --git a/DATOS/THEMES.CFG b/DATOS/THEMES.CFG new file mode 100644 index 0000000..ddb613a Binary files /dev/null and b/DATOS/THEMES.CFG differ diff --git a/DATOS98.RAR b/DATOS98.RAR new file mode 100644 index 0000000..53652f4 Binary files /dev/null and b/DATOS98.RAR differ diff --git a/DELMES.BAT b/DELMES.BAT new file mode 100644 index 0000000..c95373a --- /dev/null +++ b/DELMES.BAT @@ -0,0 +1 @@ +del datos\emp00001\vt?-1996.m12 \ No newline at end of file diff --git a/DEMO.EXE b/DEMO.EXE new file mode 100644 index 0000000..5b770ed Binary files /dev/null and b/DEMO.EXE differ diff --git a/DEMO/DATOS/CONFIG.CFG b/DEMO/DATOS/CONFIG.CFG new file mode 100644 index 0000000..a31dee8 Binary files /dev/null and b/DEMO/DATOS/CONFIG.CFG differ diff --git a/DEMO/DATOS/EMP00001/INFO_CLT.997 b/DEMO/DATOS/EMP00001/INFO_CLT.997 new file mode 100644 index 0000000..11fc1ff Binary files /dev/null and b/DEMO/DATOS/EMP00001/INFO_CLT.997 differ diff --git a/DEMO/DATOS/EMP00001/INFO_CLT.DBF b/DEMO/DATOS/EMP00001/INFO_CLT.DBF new file mode 100644 index 0000000..fb05ddb Binary files /dev/null and b/DEMO/DATOS/EMP00001/INFO_CLT.DBF differ diff --git a/DEMO/DATOS/EMP00001/INFO_EMP.DBF b/DEMO/DATOS/EMP00001/INFO_EMP.DBF new file mode 100644 index 0000000..3e70638 Binary files /dev/null and b/DEMO/DATOS/EMP00001/INFO_EMP.DBF differ diff --git a/DEMO/DATOS/EMP00001/INFO_PRV.997 b/DEMO/DATOS/EMP00001/INFO_PRV.997 new file mode 100644 index 0000000..2f19ce2 Binary files /dev/null and b/DEMO/DATOS/EMP00001/INFO_PRV.997 differ diff --git a/DEMO/DATOS/EMP00001/INFO_REF.DBF b/DEMO/DATOS/EMP00001/INFO_REF.DBF new file mode 100644 index 0000000..641d94e Binary files /dev/null and b/DEMO/DATOS/EMP00001/INFO_REF.DBF differ diff --git a/DEMO/DATOS/EMP00001/MENSAJES.DBF b/DEMO/DATOS/EMP00001/MENSAJES.DBF new file mode 100644 index 0000000..c679636 Binary files /dev/null and b/DEMO/DATOS/EMP00001/MENSAJES.DBF differ diff --git a/DEMO/DATOS/EMP00001/VT1-1997.M09 b/DEMO/DATOS/EMP00001/VT1-1997.M09 new file mode 100644 index 0000000..05ef08f Binary files /dev/null and b/DEMO/DATOS/EMP00001/VT1-1997.M09 differ diff --git a/DEMO/DATOS/EMP00001/VT2-1997.M09 b/DEMO/DATOS/EMP00001/VT2-1997.M09 new file mode 100644 index 0000000..deea2a4 Binary files /dev/null and b/DEMO/DATOS/EMP00001/VT2-1997.M09 differ diff --git a/DEMO/DATOS/EMP00001/VT3-1997.M09 b/DEMO/DATOS/EMP00001/VT3-1997.M09 new file mode 100644 index 0000000..134449f Binary files /dev/null and b/DEMO/DATOS/EMP00001/VT3-1997.M09 differ diff --git a/DEMO/DATOS/EMPRESAS.DBF b/DEMO/DATOS/EMPRESAS.DBF new file mode 100644 index 0000000..890b4b2 Binary files /dev/null and b/DEMO/DATOS/EMPRESAS.DBF differ diff --git a/DEMO/FONTS/PROT_PTL.FNT b/DEMO/FONTS/PROT_PTL.FNT new file mode 100644 index 0000000..31994db Binary files /dev/null and b/DEMO/FONTS/PROT_PTL.FNT differ diff --git a/DEMO/FONTS/VENT_MSG.FNT b/DEMO/FONTS/VENT_MSG.FNT new file mode 100644 index 0000000..f0b651e Binary files /dev/null and b/DEMO/FONTS/VENT_MSG.FNT differ diff --git a/DEMO/INSTALAR.BAT b/DEMO/INSTALAR.BAT new file mode 100644 index 0000000..e1f377f --- /dev/null +++ b/DEMO/INSTALAR.BAT @@ -0,0 +1,13 @@ +@echo off +md c:\tpv +xcopy a:\. c:\tpv /s /y +@echo . +@echo Proceso finalizado, para ejecutar el programa, escriba: +@echo . +@echo c: [intro] +@echo cd \tpv [intro] +@echo tpv [intro] +@echo . +@echo . + + diff --git a/DEMO/SYSTM/BOLD.CHR b/DEMO/SYSTM/BOLD.CHR new file mode 100644 index 0000000..8af2bc2 Binary files /dev/null and b/DEMO/SYSTM/BOLD.CHR differ diff --git a/DEMO/SYSTM/EGAVGA.BGI b/DEMO/SYSTM/EGAVGA.BGI new file mode 100644 index 0000000..8001631 Binary files /dev/null and b/DEMO/SYSTM/EGAVGA.BGI differ diff --git a/DEMO/SYSTM/LITT.CHR b/DEMO/SYSTM/LITT.CHR new file mode 100644 index 0000000..08c3067 Binary files /dev/null and b/DEMO/SYSTM/LITT.CHR differ diff --git a/DEMO/SYSTM/TPV.IMG b/DEMO/SYSTM/TPV.IMG new file mode 100644 index 0000000..bb1c845 --- /dev/null +++ b/DEMO/SYSTM/TPV.IMG @@ -0,0 +1,2471 @@ +** +** Codigo fuente para MAKE_BOTON +** + +***************************************************************************** +* +* ATENCION !!! +* ALTERAR ESTE FICHERO, CAUSARA EL MALFUNCIONAMIENTO DEL +* PROGRAMA DE APOYO... ( ERRORES NO DOCUMENTADOS ) +* +***************************************************************************** + +#11 + + + +************************************************ Botones D: 1 +**** **** Botones S: 10 +** M¢dulo de Ventas ** +**** **** +************************************************ +!1, 9 +$ 605, 5, 635, 120, 7, 63, 56, 2, 2, 000, 000 * Impr. £ltimo ticket +$ 490, 5, 590, 30, 7, 63, 56, 2, 2, 000, 000 * Impr. Tickets +$ 490, 50, 590, 75, 7, 63, 56, 2, 2, 000, 000 * Cobro completo +$ 490, 95, 590, 120, 7, 63, 56, 2, 2, 000, 000 * Servicio en mesa +$ 420, 5, 450, 120, 7, 63, 56, 2, 2, 000, 000 * Gastos / Compras +$ 380, 5, 410, 120, 7, 63, 56, 2, 2, 000, 50 * Menu Principal + +$ 250, 5, 370, 30, 7, 63, 56, 2, 2, 43, 000 * Fichar Tickets +$ 250, 50, 370, 75, 7, 63, 56, 2, 2, 45, 000 * Anular Tickets +$ 250, 95, 370, 120, 7, 63, 56, 2, 2, 000, 000 * ... + +­10 +* Cuadro para los numeros grandes... +& 0, 0, 240, 120, 7, 63, 56, 2, 2 +& 8, 8, 232, 82, 0, 56, 63, 2, 2 +& 8, 87, 232, 112, 0, 56, 63, 2, 2 + +***** Unos cuantos botones +& 250, 5, 370, 30, 7, 63, 56, 2, 2 +| 248, 10, 2, 4, 0, 0, Fichar Ticket, +| 249, 11, 2, 4, 0, 63, Fichar Ticket, +& 250, 50, 370, 75, 7, 63, 56, 2, 2 +| 248, 55, 2, 4, 0, 0, Anular Ticket, +| 249, 56, 2, 4, 0, 63, Anular Ticket, +& 250, 95, 370, 120, 7, 63, 56, 2, 2 +| 248, 100, 2, 4, 0, 0, ..., +| 249, 101, 2, 4, 0, 63, ..., + + +& 605, 5, 635, 120, 7, 63, 56, 2, 2 +| 610, 8, 2, 4, 1, 0, Impr £ltimo Ticket, +| 611, 9, 2, 4, 1, 63, Impr £ltimo Ticket, + +& 460, 5, 485, 30, 7, 63, 56, 2, 2 +& 490, 5, 590, 30, 7, 63, 56, 2, 2 +| 488, 10, 2, 4, 0, 0, Imprimir Tickets, +| 489, 11, 2, 4, 0, 63, Imprimir Tickets, +& 460, 50, 485, 75, 7, 63, 56, 2, 2 +& 490, 50, 590, 75, 7, 63, 56, 2, 2 +| 488, 55, 2, 4, 0, 0, Cobro Completo, +| 489, 56, 2, 4, 0, 63, Cobro Completo, +& 460, 95, 485, 120, 7, 63, 56, 2, 2 +& 490, 95, 590, 120, 7, 63, 56, 2, 2 +| 488, 100, 2, 4, 0, 0, Servicio en Mesa, +| 489, 101, 2, 4, 0, 63, Servicio en Mesa, + +& 420, 5, 450, 120, 7, 63, 56, 2, 2 +| 425, 8, 2, 4, 1, 0, Compras / Gastos , +| 426, 9, 2, 4, 1, 63, Compras / Gastos , + +& 380, 5, 410, 120, 7, 63, 56, 2, 2 +| 385, 5, 2, 5, 1, 0, Men£ Principal, +| 386, 6, 2, 5, 1, 63, Men£ Principal, + | 386, 1, 2, 5, 1, 0, _ , + | 387, 2, 2, 5, 1, 63, _ , + + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 + +| 10, 132, 2, 6, 0, 63, Codigo Art. Descripcion Unds. P.V.P, +| 11, 133, 2, 6, 0, 0, Codigo Art. Descripcion Unds. P.V.P, + +& 5, 160, 125, 450, 63, 7, 56, 2, 2 +& 135, 160, 470, 450, 63, 7, 56, 2, 2 +& 480, 160, 530, 450, 63, 7, 56, 2, 2 +& 540, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: 1 +**** M¢dulo de Ventas **** Botones S: 11 +** Cobro completo ** +**** **** +************************************************ +­11 +*240 +& 110, 160, 580, 340, 7, 63, 56, 2, 2 +| 120, 170, 2, 6, 0, 63, C¢d. Cliente: Cif/Nif:, +| 121, 171, 2, 6, 0, 0, C¢d. Cliente: Cif/Nif:, +& 240, 171, 350, 189, 63, 7, 56, 0, 2 +& 460, 171, 575, 189, 63, 7, 56, 0, 2 +| 120, 190, 2, 6, 0, 63, Nombre:, +| 121, 191, 2, 6, 0, 0, Nombre:, +& 240, 191, 575, 209, 63, 7, 56, 0, 2 +| 120, 210, 2, 6, 0, 63, Direcci¢n:, +| 121, 211, 2, 6, 0, 0, Direcci¢n:, +& 240, 211, 575, 229, 63, 7, 56, 0, 2 +| 120, 230, 2, 6, 0, 63, Localidad: Cod Post, +| 121, 231, 2, 6, 0, 0, Localidad: Cod Post, +& 240, 231, 420, 249, 63, 7, 56, 0, 2 +& 500, 231, 575, 249, 63, 7, 56, 0, 2 +| 120, 250, 2, 6, 0, 63, Provincia:, +| 121, 251, 2, 6, 0, 0, Provincia:, +& 240, 251, 420, 269, 63, 7, 56, 0, 2 +| 120, 290, 2, 6, 0, 63, Cod.Vendedor: Nombre:, +| 121, 291, 2, 6, 0, 0, Cod.Vendedor: Nombre:, +& 240, 291, 330, 309, 63, 7, 56, 0, 2 +& 400, 291, 575, 309, 63, 7, 56, 0, 2 +| 120, 310, 2, 6, 0, 63, Entregado a caja: devolver:, +| 121, 311, 2, 6, 0, 0, Entregado a caja: devolver:, +& 290, 311, 380, 329, 63, 7, 56, 0, 2 +& 475, 311, 575, 329, 63, 7, 56, 0, 2 + + + +************************************************ Botones D: 2 +**** **** Botones S: 20 +** M¢dulo de Referencias ** +**** **** +************************************************ +!2, 11 + +$ 400, 40, 515, 65, 7, 63, 56, 2, 2, 000, 23 +$ 520, 40, 635, 65, 7, 63, 56, 2, 2, 000, 50 +$ 400, 70, 515, 95, 7, 63, 56, 2, 2, 000, 83 +$ 520, 70, 635, 95, 7, 63, 56, 2, 2, 000, 82 +$ 400, 100, 440, 125, 7, 63, 56, 2, 2, 000, 73 +$ 445, 100, 475, 125, 7, 63, 56, 2, 2, 000, 71 +$ 480, 100, 555, 125, 7, 63, 56, 2, 2, 000, 48 +$ 560, 100, 590, 125, 7, 63, 56, 2, 2, 000, 79 +$ 595, 100, 635, 125, 7, 63, 56, 2, 2, 000, 81 +$ 400, 5, 635, 30, 7, 63, 56, 2, 2, 000, 000 +$ 505, 455, 635, 475, 63, 0, 0, 0, 000, 000 + +­20 + +& 5, 5, 30, 125, 7, 63, 56, 2, 2 +| 10, 5, 2, 5, 1, 63, Art. Asociados , +| 11, 6, 2, 5, 1, 0, Art. Asociados , + +& 35, 5, 130, 125, 63, 7, 56, 2, 2 +& 135, 5, 230, 125, 63, 7, 56, 2, 2 + +& 300, 10, 360, 30, 63, 7, 56, 2, 2 +| 241, 16, 2, 5, 0, 0, Hora 2:, +| 240, 15, 2, 5, 0, 63, Hora 2:, +& 300, 35, 360, 55, 63, 7, 56, 2, 2 +| 241, 41, 2, 5, 0, 0, Hora 3:, +| 240, 40, 2, 5, 0, 63, Hora 3:, +& 300, 60, 360, 80, 63, 7, 56, 2, 2 +| 241, 66, 2, 5, 0, 0, Hora 4:, +| 240, 65, 2, 5, 0, 63, Hora 4:, +& 300, 85, 360, 105, 63, 7, 56, 2, 2 +| 241, 91, 2, 5, 0, 0, Hora 5:, +| 240, 90, 2, 5, 0, 63, Hora 5:, + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Mantenimiento de Referencias, +| 401, 8, 2, 5, 0, 63, Mantenimiento de Referencias, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Ref., +| 401, 43, 2, 5, 0, 63, Imprimir Ref., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Ref., +| 401, 73, 2, 5, 0, 63, Eliminar Ref., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Ref., +| 519, 73, 2, 5, 0, 63, Insertar Ref., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Unds. P.C P.V.P IVA Stock, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Unds. P.C P.V.P IVA Stock, + +*& 5, 160, 100, 450, 63, 7, 56, 2, 2 +*& 105, 160, 360, 450, 63, 7, 56, 2, 2 +*& 365, 160, 405, 450, 63, 7, 56, 2, 2 +*& 410, 160, 468, 450, 63, 7, 56, 2, 2 +*& 473, 160, 531, 450, 63, 7, 56, 2, 2 + +& 5, 160, 97, 450, 63, 7, 56, 2, 2 +& 102, 160, 357, 450, 63, 7, 56, 2, 2 + +& 362, 160, 405, 450, 63, 7, 56, 2, 2 + +& 410, 160, 468, 450, 63, 7, 56, 2, 2 +& 473, 160, 531, 450, 63, 7, 56, 2, 2 + +& 536, 160, 565, 450, 63, 7, 56, 2, 2 + +& 570, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 21 +** M¢dulo asociado a Referencias ** +* * +** Parte utilizada para busquedas ** +**** **** +************************************************ + +­21 +& 260, 200, 360, 220, 63, 0, 56, 0, 2 +& 365, 200, 465, 220, 63, 0, 56, 0, 2 +& 260, 225, 465, 245, 63, 0, 56, 0, 2 + +& 235, 250, 315, 275, 63, 0, 56, 0, 2 +& 385, 250, 465, 275, 63, 0, 56, 0, 2 + +& 330, 275, 365, 300, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Art:, +| 176, 201, 2, 6, 0, 63, Cod.Art:, +| 175, 225, 2, 6, 0, 0, Nombre:, +| 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, P.C.: P.V.P.:, +| 176, 251, 2, 6, 0, 63, P.C.: P.V.P.:, +| 175, 275, 2, 6, 0, 0, COMBINADOS -> [ ], +| 176, 276, 2, 6, 0, 63, COMBINADOS -> [ ], + + + +************************************************ Botones D: 3 +**** **** Botones S: 22 +** M¢dulo asociado a Referencias ** +* * +** Muestra las posibilidades de impresi¢n ** +**** **** +************************************************ +!3, 4 + +$ 180, 200, 220, 305, 1, 56, 63, 2, 2, 000, 46 +$ 230, 200, 460, 230, 7, 56, 63, 2, 2, 000, 19 +$ 230, 235, 460, 270, 7, 56, 63, 2, 2, 000, 24 +$ 230, 275, 460, 305, 7, 56, 63, 2, 2, 000, 30 + +­22 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Impresion de Referencias, +| 175, 168, 2, 6, 0, 63, Impresion de Referencias, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Listado r pido, +| 231, 203, 2, 6, 0, 63, Listado r pido, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado completo, +| 231, 238, 2, 6, 0, 63, Listado completo, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, +& 230, 275, 460, 305, 7, 56, 63, 2, 2 +| 230, 277, 2, 6, 0, 0, C¢digos de barra, +| 231, 278, 2, 6, 0, 63, C¢digos de barra, + | 231, 278, 2, 6, 0, 0, _, + | 232, 279, 2, 6, 0, 63, _, + + +************************************************ +**** **** Botones S: 23 +** M¢dulo asociado a Referencias ** +* * +** Seccion para el Stock Actual ** +**** **** +************************************************ + +­23 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe del Stock Actual, +| 401, 8, 2, 5, 0, 63, Informe del Stock Actual, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Stock, +| 401, 43, 2, 5, 0, 63, Imprimir Stock, + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +*| 400, 72, 2, 5, 0, 0, Eliminar Ref., +*| 401, 73, 2, 5, 0, 63, Eliminar Ref., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +*| 518, 72, 2, 5, 0, 0, Insertar Ref., +*| 519, 73, 2, 5, 0, 63, Insertar Ref., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Stock Actual Valoraci¢n Beneficio, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Stock Actual Valoraci¢n Beneficio, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 452, 450, 63, 7, 56, 2, 2 +& 457, 160, 543, 450, 63, 7, 56, 2, 2 +& 548, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ +**** **** Botones S: 24 +** M¢dulo asociado a Gestion Ventas ** +* * +** Seccion para el Informe de Ventas ** +**** **** +************************************************ + +­24 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe Ventas de productos, +| 401, 8, 2, 5, 0, 63, Informe Ventas de productos, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Venta, +| 401, 43, 2, 5, 0, 63, Imprimir Venta, + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, MES, +*| 481, 103, 2, 5, 0, 63, MES, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Unidades Valoraci¢n Beneficio, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Unidades Valoraci¢n Beneficio, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 452, 450, 63, 7, 56, 2, 2 +& 457, 160, 543, 450, 63, 7, 56, 2, 2 +& 548, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: 3 +**** **** Botones S: 25 +** M¢dulo asociado a Referencias ** +* * +** Muestra las posibilidades de ordenaci¢n ** +**** **** +************************************************ + +­25 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Ordenar Referencias por:, +| 175, 168, 2, 6, 0, 63, Ordenar Referencias por:, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, C¢digo de articulo, +| 231, 203, 2, 6, 0, 63, C¢digo de articulo, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Nombre de articulo, +| 231, 238, 2, 6, 0, 63, Nombre de articulo, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, +& 230, 275, 460, 305, 7, 56, 63, 2, 2 +| 230, 277, 2, 6, 0, 0, Stock Actual, +| 231, 278, 2, 6, 0, 63, Stock Actual, + | 231, 278, 2, 6, 0, 0, _, + | 232, 279, 2, 6, 0, 63, _, + +************************************************ Botones D: 2 +**** **** Botones S: 30 +** M¢dulo para la Gestion de los Proveedores ** +**** **** +************************************************ +­30 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gestion de Proveedores, +| 401, 8, 2, 5, 0, 63, Gestion de Proveedores, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Prov., +| 401, 43, 2, 5, 0, 63, Imprimir Prov., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Prov., +| 401, 73, 2, 5, 0, 63, Eliminar Prov., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Prov., +| 519, 73, 2, 5, 0, 63, Insertar Prov., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +| 5, 40, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 41, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 36, 150, 59, 63, 7, 56, 0, 2 +& 245, 36, 390, 59, 63, 7, 56, 0, 2 + +| 5, 65, 2, 5, 0, 0, Nombre Proveedor:, +| 6, 66, 2, 5, 0, 63, Nombre Proveedor:, +& 150, 61, 390, 84, 63, 7, 56, 0, 2 + +| 5, 90, 2, 5, 0, 0, Actividad Prov.:, +| 6, 91, 2, 5, 0, 63, Actividad Prov.:, +& 150, 86, 390, 109, 63, 7, 56, 0, 2 + + +| 5, 115, 2, 5, 0, 0, Direccion:, +| 6, 116, 2, 5, 0, 63, Direccion:, +& 90, 111, 390, 134, 63, 7, 56, 0, 2 + +| 5, 140, 2, 5, 0, 0, Localidad: Provincia:, +| 6, 141, 2, 5, 0, 63, Localidad: Provincia:, +& 90, 136, 225, 159, 63, 7, 56, 0, 2 +& 310, 136, 440, 159, 63, 7, 56, 0, 2 + +| 450, 140, 2, 5, 0, 0, C.Postal:, +| 451, 141, 2, 5, 0, 63, C.Postal:, +& 520, 136, 600, 159, 63, 7, 56, 0, 2 + + +| 5, 165, 2, 5, 0, 0, Tel‚fono:, +| 6, 166, 2, 5, 0, 63, Tel‚fono:, +& 90, 161, 247, 184, 63, 7, 56, 0, 2 +& 253, 161, 390, 184, 63, 7, 56, 0, 2 + +| 5, 190, 2, 5, 0, 0, Estrellas Notas:, +| 6, 191, 2, 5, 0, 63, Estrellas Notas:, +& 400, 161, 635, 225, 63, 7, 56, 2, 2 + +& 90, 190, 115, 215, 7, 63, 56, 2, 2 +& 120, 190, 145, 215, 7, 63, 56, 2, 2 +& 150, 190, 175, 215, 7, 63, 56, 2, 2 +& 180, 190, 205, 215, 7, 63, 56, 2, 2 +& 210, 190, 235, 215, 7, 63, 56, 2, 2 +& 240, 190, 265, 215, 7, 63, 56, 2, 2 +& 270, 190, 295, 215, 7, 63, 56, 2, 2 +& 300, 190, 325, 215, 7, 63, 56, 2, 2 + + + + +& 5, 230, 635, 255, 7, 63, 56, 2, 2 +| 5, 235, 2, 5, 0, 0, C¢digo Proveedor Tel‚fono 1 N§ de Fax, +| 6, 236, 2, 5, 0, 63, C¢digo Proveedor Tel‚fono 1 N§ de Fax, + +& 5, 260, 100, 450, 63, 7, 56, 2, 2 +& 105, 260, 360, 450, 63, 7, 56, 2, 2 +& 365, 260, 497, 450, 63, 7, 56, 2, 2 +& 503, 260, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 31 +** M¢dulo buscar asociado a Proveedores ** +* * +** Muestreo del patr¢n para busquedas ** +**** **** +************************************************ + +­31 +& 265, 200, 365, 220, 63, 0, 56, 0, 2 +& 265, 225, 465, 245, 63, 0, 56, 0, 2 +& 265, 250, 465, 275, 63, 0, 56, 0, 2 +& 265, 280, 465, 305, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Prov:, + | 176, 201, 2, 6, 0, 63, Cod.Prov:, +| 175, 225, 2, 6, 0, 0, Proveed., + | 176, 226, 2, 6, 0, 63, Proveed., +| 175, 250, 2, 6, 0, 0, Direccion, + | 176, 251, 2, 6, 0, 63, Direccion, +| 175, 275, 2, 6, 0, 0, Poblacion, + | 176, 276, 2, 6, 0, 63, Poblacion, + + + +************************************************ Botones D: 2 +**** **** Botones S: 40 +** M¢dulo de Compras Diarias ** +**** **** +************************************************ +­40 +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gastos Diarios:, +| 401, 8, 2, 5, 0, 63, Gastos Diarios:, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Comp., +| 401, 43, 2, 5, 0, 63, Imprimir Comp., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Gasto, +| 401, 73, 2, 5, 0, 63, Eliminar Gasto, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Gasto, +| 519, 73, 2, 5, 0, 63, Insertar Gasto, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 5, 135, 2, 5, 0, 0, C¢digo Descripcion Unds. Proveedor P. Costo, +| 6, 136, 2, 5, 0, 63, C¢digo Descripcion Unds. Proveedor P. Costo, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 415, 450, 63, 7, 56, 2, 2 +& 420, 160, 545, 450, 63, 7, 56, 2, 2 +& 550, 160, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 41 +** M¢dulo asociado a Compras ** +* * +** Parte utilizada para busquedas ** +**** **** +************************************************ + +­41 +& 260, 200, 360, 220, 63, 0, 56, 0, 2 +& 365, 200, 465, 220, 63, 0, 56, 0, 2 +& 260, 225, 465, 245, 63, 0, 56, 0, 2 + +& 260, 250, 325, 275, 63, 0, 56, 0, 2 + +& 435, 250, 465, 273, 63, 0, 56, 0, 2 + +& 435, 277, 465, 300, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Art:, +| 176, 201, 2, 6, 0, 63, Cod.Art:, +| 175, 225, 2, 6, 0, 0, Nombre:, +| 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, C.Prov: Cual. dia, +| 176, 251, 2, 6, 0, 63, C.Prov: Cual. dia, +| 175, 275, 2, 6, 0, 0, Cual. mes, +| 176, 276, 2, 6, 0, 63, Cual. mes, + + +­42 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Impresion de Compras, +| 175, 168, 2, 6, 0, 63, Impresion de Compras, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Listado del Dia, +| 231, 203, 2, 6, 0, 63, Listado del Dia, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado Mensual, +| 231, 238, 2, 6, 0, 63, Listado Mensual, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, + +************************************************ Botones D: 4 +**** **** Botones S: 45 +** M¢dulo asociado a Compras Diarias ** +* * +** Calendario para Compras Diarias ** +**** **** +************************************************ +!4, 45 + +* 1ra Semana +$ 170, 5, 200, 25, 9, 63, 56, 2, 2, 000, 000 +$ 200, 5, 230, 25, 9, 63, 56, 2, 2, 000, 000 +$ 230, 5, 260, 25, 9, 63, 56, 2, 2, 000, 000 +$ 260, 5, 290, 25, 9, 63, 56, 2, 2, 000, 000 +$ 290, 5, 320, 25, 9, 63, 56, 2, 2, 000, 000 +$ 320, 5, 350, 25, 4, 63, 56, 2, 2, 000, 000 +$ 350, 5, 380, 25, 4, 63, 56, 2, 2, 000, 000 + +* 2da Semana +$ 170, 25, 200, 45, 9, 63, 56, 2, 2, 000, 000 +$ 200, 25, 230, 45, 9, 63, 56, 2, 2, 000, 000 +$ 230, 25, 260, 45, 9, 63, 56, 2, 2, 000, 000 +$ 260, 25, 290, 45, 9, 63, 56, 2, 2, 000, 000 +$ 290, 25, 320, 45, 9, 63, 56, 2, 2, 000, 000 +$ 320, 25, 350, 45, 4, 63, 56, 2, 2, 000, 000 +$ 350, 25, 380, 45, 4, 63, 56, 2, 2, 000, 000 + +* 3ra Semana +$ 170, 45, 200, 65, 9, 63, 56, 2, 2, 000, 000 +$ 200, 45, 230, 65, 9, 63, 56, 2, 2, 000, 000 +$ 230, 45, 260, 65, 9, 63, 56, 2, 2, 000, 000 +$ 260, 45, 290, 65, 9, 63, 56, 2, 2, 000, 000 +$ 290, 45, 320, 65, 9, 63, 56, 2, 2, 000, 000 +$ 320, 45, 350, 65, 4, 63, 56, 2, 2, 000, 000 +$ 350, 45, 380, 65, 4, 63, 56, 2, 2, 000, 000 + +* 4ta semana +$ 170, 65, 200, 85, 9, 63, 56, 2, 2, 000, 000 +$ 200, 65, 230, 85, 9, 63, 56, 2, 2, 000, 000 +$ 230, 65, 260, 85, 9, 63, 56, 2, 2, 000, 000 +$ 260, 65, 290, 85, 9, 63, 56, 2, 2, 000, 000 +$ 290, 65, 320, 85, 9, 63, 56, 2, 2, 000, 000 +$ 320, 65, 350, 85, 4, 63, 56, 2, 2, 000, 000 +$ 350, 65, 380, 85, 4, 63, 56, 2, 2, 000, 000 + +* 5ta semana +$ 170, 85, 200, 105, 9, 63, 56, 2, 2, 000, 000 +$ 200, 85, 230, 105, 9, 63, 56, 2, 2, 000, 000 +$ 230, 85, 260, 105, 9, 63, 56, 2, 2, 000, 000 +$ 260, 85, 290, 105, 9, 63, 56, 2, 2, 000, 000 +$ 290, 85, 320, 105, 9, 63, 56, 2, 2, 000, 000 +$ 320, 85, 350, 105, 4, 63, 56, 2, 2, 000, 000 +$ 350, 85, 380, 105, 4, 63, 56, 2, 2, 000, 000 + +* 6ta semana +$ 170, 105, 200, 125, 9, 63, 56, 2, 2, 000, 000 +$ 200, 105, 230, 125, 9, 63, 56, 2, 2, 000, 000 +$ 230, 105, 260, 125, 9, 63, 56, 2, 2, 000, 000 +$ 260, 105, 290, 125, 9, 63, 56, 2, 2, 000, 000 +$ 290, 105, 320, 125, 9, 63, 56, 2, 2, 000, 000 +$ 320, 105, 350, 125, 4, 63, 56, 2, 2, 000, 000 +$ 350, 105, 380, 125, 4, 63, 56, 2, 2, 000, 000 + + +* Mes Anterior +$ 145, 5, 165, 62, 7, 56, 63, 1, 2, 000, 000 + +* Mes Siguiente +$ 145, 68, 165, 125, 7, 56, 63, 1, 2, 000, 000 + +*­45 + +* Nombre del Mes +$ 120, 5, 140, 125, 7, 56, 63, 1, 2, 000, 000 + + +************************************************ Botones D: 5 +**** **** Botones S: 100 +** M¢dulo asociado a Compras ** +* * +** Cuadro desplegable para proveedores ** +**** **** +************************************************ + +!5, 6 + +*Cuadro envolvente +$ 415, 5, 550, 186, 63, 7, 56, 2, 2, 000, 000 + +* Botones ( Subir / S.R pido || B.R pido / Bajar ) +$ 555, 5, 570, 31, 7, 56, 63, 2, 1, 000, 072 +$ 555, 41, 570, 67, 7, 56, 63, 2, 1, 000, 073 + +$ 555, 72, 570, 118, 7, 56, 63, 2, 1, 000, 031 + +$ 555, 123, 570, 149, 7, 56, 63, 2, 1, 000, 081 +$ 555, 159, 570, 185, 7, 56, 63, 2, 1, 000, 080 + + + + +************************************************ Botones D: 6 +**** **** Botones S: +** Parte Utilizada por Optar ** +**** **** +************************************************ +!6, 2 + +$ 170, 320, 270, 350, 7, 63, 56, 2, 2, 000, 30 +$ 370, 320, 470, 350, 7, 63, 56, 2, 2, 000, 46 + +­100 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 + +& 170, 320, 270, 350, 7, 63, 56, 2, 2 +| 175, 325, 2, 6, 0, 63, Aceptar, +| 176, 326, 2, 6, 0, 0, Aceptar, +| 175, 327, 2, 6, 0, 63, _, +| 176, 328, 2, 6, 0, 0, _, + +& 370, 320, 470, 350, 7, 63, 56, 2, 2 +| 373, 325, 2, 6, 0, 63, Cancelar, +| 374, 326, 2, 6, 0, 0, Cancelar, +| 373, 327, 2, 6, 0, 63, _, +| 374, 328, 2, 6, 0, 0, _, + + + + +************************************************ Botones D: 2 +**** **** Botones S: 70 +** M¢dulo de Empleados ** +**** **** +************************************************ +­70 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Mantenimiento de Empleados, +| 401, 8, 2, 5, 0, 63, Mantenimiento de Empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Fich., +| 401, 43, 2, 5, 0, 63, Imprimir Fich., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Emp., +| 401, 73, 2, 5, 0, 63, Eliminar Emp., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Emp., +| 519, 73, 2, 5, 0, 63, Insertar Emp., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 95, 93, 180, 115, 63, 7, 56, 0, 2 +& 95, 123, 225, 145, 63, 7, 56, 0, 2 +& 95, 153, 225, 175, 63, 7, 56, 0, 2 + & 310, 153, 460, 175, 63, 7, 56, 0, 2 + +& 95, 183, 355, 205, 63, 7, 56, 0, 2 + & 410, 183, 460, 205, 63, 7, 56, 0, 2 + & 540, 183, 590, 205, 63, 7, 56, 0, 2 + +& 95, 213, 225, 235, 63, 7, 56, 0, 2 + & 310, 213, 460, 235, 63, 7, 56, 0, 2 + & 540, 213, 620, 235, 63, 7, 56, 0, 2 +& 95, 243, 225, 265, 63, 7, 56, 0, 2 + & 310, 243, 460, 265, 63, 7, 56, 0, 2 + +& 95, 273, 225, 295, 63, 7, 56, 0, 2 + & 360, 273, 460, 295, 63, 7, 56, 0, 2 + & 520, 273, 620, 295, 63, 7, 56, 0, 2 + + +| 10, 95, 2, 5, 0, 63, Codigo:, +| 10, 125, 2, 5, 0, 63, Nombre:, +| 10, 155, 2, 5, 0, 63, Apellido 1, + | 10, 155, 2, 5, 0, 63, Apellido 2, + +| 10, 185, 2, 5, 0, 63, Direccion: Num:, + | 10, 185, 2, 5, 0, 63, Piso:, + +| 10, 215, 2, 5, 0, 63, Poblacion:, + | 10, 215, 2, 5, 0, 63, Provincia:, + | 10, 215, 2, 5, 0, 63, C.Postal:, +| 10, 245, 2, 5, 0, 63, Tel‚fono1:, + | 10, 245, 2, 5, 0, 63, Telefono2:, + +| 10, 275, 2, 5, 0, 63, N.I.F:, + | 10, 275, 2, 5, 0, 63, Contrato. inicio:, + | 10, 275, 2, 5, 0, 63, fin:, + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 215, 450, 63, 7, 56, 2, 2 +& 220, 330, 350, 450, 63, 7, 56, 2, 2 +& 355, 330, 485, 450, 63, 7, 56, 2, 2 +& 490, 330, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ +**** **** Botones D: 2 + 7 +** M¢dulo asociado a Empleados ** Botones S: 71 +* * +** Control del acceso y passwords ** +**** **** +************************************************ + +!7, 21 + +$ 180, 24, 200, 42, 7, 63, 56, 2, 2, 000, 000 +$ 180, 44, 200, 62, 7, 63, 56, 2, 2, 000, 000 +$ 180, 64, 200, 84, 7, 63, 56, 2, 2, 000, 000 +$ 180, 104, 200, 122, 7, 63, 56, 2, 2, 000, 000 +$ 180, 124, 200, 142, 7, 63, 56, 2, 2, 000, 000 +$ 180, 164, 200, 182, 7, 63, 56, 2, 2, 000, 000 +$ 180, 184, 200, 202, 7, 63, 56, 2, 2, 000, 000 +$ 180, 204, 200, 222, 7, 63, 56, 2, 2, 000, 000 +$ 180, 244, 200, 262, 7, 63, 56, 2, 2, 000, 000 +$ 180, 264, 200, 282, 7, 63, 56, 2, 2, 000, 000 + +$ 390, 164, 410, 182, 7, 63, 56, 2, 2, 000, 000 +$ 390, 184, 410, 202, 7, 63, 56, 2, 2, 000, 000 +$ 390, 204, 410, 222, 7, 63, 56, 2, 2, 000, 000 +$ 390, 224, 410, 242, 7, 63, 56, 2, 2, 000, 000 + +$ 390, 264, 410, 282, 7, 63, 56, 2, 2, 000, 000 + +$ 600, 164, 620, 182, 7, 63, 56, 2, 2, 000, 000 +$ 600, 184, 620, 202, 7, 63, 56, 2, 2, 000, 000 +$ 600, 204, 620, 222, 7, 63, 56, 2, 2, 000, 000 +$ 600, 224, 620, 242, 7, 63, 56, 2, 2, 000, 000 +$ 600, 244, 620, 262, 7, 63, 56, 2, 2, 000, 000 +$ 600, 264, 620, 282, 7, 63, 56, 2, 2, 000, 000 + + +­71 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Control acceso de Empleados, +| 401, 8, 2, 5, 0, 63, Control acceso de Empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +*| 400, 42, 2, 5, 0, 0, Imprimir Fich., +*| 401, 43, 2, 5, 0, 63, Imprimir Fich., +* | 400, 43, 2, 5, 0, 0, _, +* | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Cambiar Clave, +| 401, 73, 2, 5, 0, 63, Cambiar Clave, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +*| 518, 72, 2, 5, 0, 0, Insertar Emp., +*| 519, 73, 2, 5, 0, 63, Insertar Emp., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 180, 24, 200, 42, 7, 63, 56, 2, 2 +& 180, 44, 200, 62, 7, 63, 56, 2, 2 +& 180, 64, 200, 84, 7, 63, 56, 2, 2 +& 180, 104, 200, 122, 7, 63, 56, 2, 2 +& 180, 124, 200, 142, 7, 63, 56, 2, 2 +& 180, 164, 200, 182, 7, 63, 56, 2, 2 +& 180, 184, 200, 202, 7, 63, 56, 2, 2 +& 180, 204, 200, 222, 7, 63, 56, 2, 2 +& 180, 244, 200, 262, 7, 63, 56, 2, 2 +& 180, 264, 200, 282, 7, 63, 56, 2, 2 + +& 390, 164, 410, 182, 7, 63, 56, 2, 2 +& 390, 184, 410, 202, 7, 63, 56, 2, 2 +& 390, 204, 410, 222, 7, 63, 56, 2, 2 +& 390, 224, 410, 242, 7, 63, 56, 2, 2 + +& 390, 264, 410, 282, 7, 63, 56, 2, 2 + +& 600, 164, 620, 182, 7, 63, 56, 2, 2 +& 600, 184, 620, 202, 7, 63, 56, 2, 2 +& 600, 204, 620, 222, 7, 63, 56, 2, 2 +& 600, 224, 620, 242, 7, 63, 56, 2, 2 +& 600, 244, 620, 262, 7, 63, 56, 2, 2 +& 600, 264, 620, 282, 7, 63, 56, 2, 2 + + +| 10, 5, 2, 5, 0, 63, Articulos, + | 10, 25, 2, 5, 0, 63, Referencias Art., + | 10, 45, 2, 5, 0, 63, Stock Actual, + | 10, 65, 2, 5, 0, 63, Gr ficas ventas, +| 10, 85, 2, 5, 0, 63, Proveedores, + | 10, 105, 2, 5, 0, 63, Info Proveedores, + | 10, 125, 2, 5, 0, 63, Compras Proveed., +| 10, 145, 2, 5, 0, 63, Empleados, + | 10, 165, 2, 5, 0, 63, Info Empleados, + | 10, 185, 2, 5, 0, 63, Permisos Acceso, + | 10, 205, 2, 5, 0, 63, Gr ficas ventas, +| 10, 225, 2, 5, 0, 63, Compras, + | 10, 245, 2, 5, 0, 63, Compras General, + | 10, 265, 2, 5, 0, 63, Gr ficas Compras, + + +| 210, 145, 2, 5, 0, 63, Gestion Ventas, + | 210, 165, 2, 5, 0, 63, Inicio Caja, + | 210, 185, 2, 5, 0, 63, Balance Caja, + | 210, 205, 2, 5, 0, 63, Balance Mensual, + | 210, 225, 2, 5, 0, 63, Gestion Clientes, +| 210, 245, 2, 5, 0, 63, Programas Externos, + | 210, 265, 2, 5, 0, 63, Ejecuci¢n Program., + +| 420, 145, 2, 5, 0, 63, Miscelanea, + | 420, 165, 2, 5, 0, 63, Mensajes Protector, + | 420, 185, 2, 5, 0, 63, Futura Ampliacion, + | 420, 205, 2, 5, 0, 63, Futura Ampliacion, + | 420, 225, 2, 5, 0, 63, Gestion Bases Datos, + | 420, 245, 2, 5, 0, 63, Programas Externos, + | 420, 265, 2, 5, 0, 63, Configurar Entorno, + + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 215, 450, 63, 7, 56, 2, 2 +& 220, 330, 350, 450, 63, 7, 56, 2, 2 +& 355, 330, 485, 450, 63, 7, 56, 2, 2 +& 490, 330, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 72 +** Informe Graficas de ventas por Empl ** +**** **** +************************************************ + +­72 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe venta empleados, +| 401, 8, 2, 5, 0, 63, Informe venta empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Infr., +| 401, 43, 2, 5, 0, 63, Imprimir Infr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +*| 400, 102, 2, 5, 0, 0, <<, +*| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +*| 445, 102, 2, 5, 0, 0, \/, +*| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Fecha Total Fecha Total Fecha Total, +| 11, 138, 2, 5, 0, 0, Fecha Total Fecha Total Fecha Total, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 86, 160, 210, 295, 63, 7, 56, 2, 2 + +& 215, 160, 290, 295, 63, 7, 56, 2, 2 +& 296, 160, 420, 295, 63, 7, 56, 2, 2 + +& 425, 160, 500, 295, 63, 7, 56, 2, 2 +& 506, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, C¢digo Nombre y Apellidos % mes Total Anual, +| 11, 308, 2, 5, 0, 0, C¢digo Nombre y Apellidos % mes Total Anual, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 73 +** Muestra impresiones de fichas Empl ** +**** **** +************************************************ +­73 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Imprimir Fichas Empl, +| 175, 168, 2, 6, 0, 63, Imprimir Fichas Empl, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Ficha individual, +| 231, 203, 2, 6, 0, 63, Ficha individual, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado Empleados, +| 231, 238, 2, 6, 0, 63, Listado Empleados, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, + +************************************************ Botones D: +**** **** Botones S: 74 +** M¢dulo buscar asociado a Empleados ** +* * +** Muestreo del patr¢n para busquedas ** +**** **** +************************************************ + +­74 +& 265, 200, 365, 220, 63, 0, 56, 0, 2 +& 265, 225, 465, 245, 63, 0, 56, 0, 2 +& 265, 250, 465, 275, 63, 0, 56, 0, 2 +& 265, 280, 465, 305, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Empl:, + | 176, 201, 2, 6, 0, 63, Cod.Empl:, +| 175, 225, 2, 6, 0, 0, Nombre:, + | 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, Apellido:, + | 176, 251, 2, 6, 0, 63, Apellido:, +| 175, 275, 2, 6, 0, 0, Direccion, + | 176, 276, 2, 6, 0, 63, Direccion, + +************************************************ Botones D: 8 +**** **** Botones S: 50 +** M¢dulo para definir los mensajes ** +**** **** +************************************************ + +!8, 14 +* Cambiar Fuente +* Men£ Principal +$ 416, 40, 515, 65, 7, 63, 56, 2, 2, 000, 000 +$ 520, 40, 635, 65, 7, 63, 56, 2, 2, 000, 000 +*Indicador de desplazamiento +$ 350, 27, 380, 57, 7, 63, 56, 2, 2, 000, 000 +$ 350, 61, 380, 91, 7, 63, 56, 2, 2, 000, 000 +$ 350, 95, 380, 125, 7, 63, 56, 2, 2, 000, 000 +$ 350, 129, 380, 159, 7, 63, 56, 2, 2, 000, 000 +$ 350, 163, 380, 193, 7, 63, 56, 2, 2, 000, 000 +$ 350, 197, 380, 227, 7, 63, 56, 2, 2, 000, 000 +* Avanza / Retrocede ( Pantalla de Mensajes ) +$ 385, 27, 415, 91, 7, 63, 56, 2, 2, 000, 000 +$ 385, 95, 415, 159, 7, 63, 56, 2, 2, 000, 000 +* Colores del texto y fondo +$ 385, 163, 415, 193, 7, 63, 56, 2, 2, 000, 000 +$ 385, 197, 415, 227, 7, 63, 56, 2, 2, 000, 000 + +$ 447, 163, 477, 193, 7, 63, 56, 2, 2, 000, 000 +$ 447, 197, 477, 227, 7, 63, 56, 2, 2, 000, 000 + + +­50 + +* Monitor de muestreo +& 5, 20, 346, 235, 2, 63, 56, 2, 2 +& 10, 25, 341, 230, 0, 56, 63, 2, 2 + +& 416, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Configuraci¢n de Mensajes, +| 401, 8, 2, 5, 0, 63, Configuraci¢n de Mensajes, + +& 416, 40, 515, 65, 7, 63, 56, 2, 2 +| 416, 42, 2, 5, 0, 0, Cambiar F., +| 417, 43, 2, 5, 0, 63, Cambiar F., + | 416, 43, 2, 5, 0, 0, _, + | 417, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + + +*Indicador de desplazamiento +& 350, 27, 380, 57, 7, 63, 56, 2, 2 +& 350, 61, 380, 91, 7, 63, 56, 2, 2 +& 350, 95, 380, 125, 7, 63, 56, 2, 2 +& 350, 129, 380, 159, 7, 63, 56, 2, 2 +& 350, 163, 380, 193, 7, 63, 56, 2, 2 +& 350, 197, 380, 227, 7, 63, 56, 2, 2 + +* Avanza / Retrocede ( Pantalla de Mensajes ) +& 385, 27, 415, 91, 7, 63, 56, 2, 2 +& 385, 95, 415, 159, 7, 63, 56, 2, 2 +| 390, 27, 2, 5, 1, 0, <---- ----> , +| 391, 27, 2, 5, 1, 63, <---- ----> , + +* Colores del texto y fondo +& 385, 163, 415, 193, 7, 63, 56, 2, 2 +& 385, 197, 415, 227, 7, 63, 56, 2, 2 + & 416, 163, 446, 193, 7, 63, 56, 2, 2 + & 416, 197, 446, 227, 7, 63, 56, 2, 2 +& 447, 163, 477, 193, 7, 63, 56, 2, 2 +& 447, 197, 477, 227, 7, 63, 56, 2, 2 + +| 388, 168, 2, 5, 0, 0, <-- F -->, +| 389, 169, 2, 5, 0, 63, <-- F -->, + +| 388, 202, 2, 5, 0, 0, <-- T -->, +| 389, 203, 2, 5, 0, 63, <-- T -->, + + + +& 5, 245, 635, 270, 7, 56, 63, 2, 2 +| 5, 247, 2, 6, 0, 0, Mensaje ( 1 parte ) Mensaje ( 2 parte ) Mensaje ( 3 parte ), +| 6, 248, 2, 6, 0, 63, Mensaje ( 1 parte ) Mensaje ( 2 parte ) Mensaje ( 3 parte ), + +& 5, 275, 211, 415, 63, 56, 7, 0, 2 +& 217, 275, 423, 415, 63, 56, 7, 0, 2 +& 429, 275, 635, 415, 63, 56, 7, 0, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + + +************************************************ Botones D: 9 +**** **** Botones S: 60 +** Balance Diario ** +**** **** +************************************************ +!9, 9 + +* Botones ( Imprimir / Dia Visualizaci¢n ) +$ 455, 420, 543, 445, 7, 63, 56, 2, 2, 000, 23 +$ 548, 420, 635, 445, 7, 63, 56, 2, 2, 000, 32 + +* Boton Men£ Principal +$ 455, 450, 635, 475, 7, 63, 56, 2, 2, 000, 50 + +* Notas +$ 5, 365, 25, 475, 7, 63, 56, 2, 2, 000, 49 + +* Subir empleado +$ 600, 202, 635, 220, 7, 63, 56, 2, 2, 000, 000 +* Bajar empleado +$ 560, 202, 595, 220, 7, 63, 56, 2, 2, 000, 000 + +* Subir/Bajar Articulos vendidos +$ 200, 337, 235, 355, 7, 63, 56, 2, 2, 000, 000 +$ 160, 337, 195, 355, 7, 63, 56, 2, 2, 000, 000 + +* Visualizador de productos vendidos +$ 5, 5, 240, 45, 7, 63, 56, 2, 2, 000, 000 + + +­60 + +* Visualizador de productos vendidos +& 5, 5, 240, 45, 7, 63, 56, 2, 2 + +| 5, 7, 2, 4, 0, 0, Productos Vendidos segun hora:, +| 6, 8, 2, 4, 0, 63, Productos Vendidos segun hora:, + +| 5, 25, 2, 4, 0, 0, desde las: hasta las:, +| 6, 26, 2, 4, 0, 63, desde las: hasta las:, + +* Recuadros para introducir las horas a medir +& 80, 22, 110, 40, 63, 7, 56, 0, 2 +& 175, 22, 205, 40, 63, 7, 56, 0, 2 + +* Barra para el cuadro de articulos vendidos +& 5, 50, 240, 75, 7, 63, 56, 2, 2 +| 5, 55, 2, 4, 0, 0, Producto Unds, +| 6, 56, 2, 4, 0, 63, Producto Unds, + +* Cuadro de articulos vendidos +& 5, 75, 240, 360, 63, 7, 56, 2, 2 +* Subir/Bajar Articulos vendidos +& 200, 337, 235, 355, 7, 63, 56, 2, 2 +& 160, 337, 195, 355, 7, 63, 56, 2, 2 + +| 245, 5, 2, 5, 0, 0, N§ Tickets:, +| 246, 6, 2, 5, 0, 63, N§ Tickets:, +| 245, 20, 2, 5, 0, 0, Cambio:, +| 246, 21, 2, 5, 0, 63, Cambio:, +| 245, 35, 2, 5, 0, 0, Intentos de Salir:, +| 246, 36, 2, 5, 0, 63, Intentos de Salir:, +| 245, 50, 2, 5, 0, 0, Salidas al Men£:, +| 246, 51, 2, 5, 0, 63, Salidas al Men£:, + +| 245, 65, 2, 5, 0, 0, Inicio Caja:, +| 246, 66, 2, 5, 0, 63, Inicio Caja:, +| 245, 80, 2, 5, 0, 0, Fin Caja:, +| 246, 81, 2, 5, 0, 63, Fin Caja:, + +& 380, 6, 450, 20, 7, 0, 63, 0, 2 +& 380, 21, 450, 35, 7, 0, 63, 0, 2 +& 380, 36, 450, 50, 7, 0, 63, 0, 2 +& 380, 51, 450, 65, 7, 0, 63, 0, 2 +& 380, 66, 450, 80, 7, 0, 63, 0, 2 +& 380, 81, 450, 95, 7, 0, 63, 0, 2 + + +* Cuadro de Venta Total, Gastos y Beneficio +& 245, 100, 450, 360, 7, 63, 56, 2, 2 + +| 245, 290, 2, 5, 0, 0, Total Ventas:, +| 246, 291, 2, 5, 0, 63, Total Ventas:, +| 245, 310, 2, 5, 0, 0, Gastos:, +| 246, 311, 2, 5, 0, 63, Gastos:, + +| 245, 325, 2, 5, 0, 0, -----------, +| 246, 326, 2, 5, 0, 63, -----------, + +| 242, 335, 2, 5, 0, 0, Total Bruto:, +| 243, 336, 2, 5, 0, 63, Total Bruto:, + + +* Cuadro de Ventas por Empleado +& 455, 5, 635, 25, 7, 63, 56, 2, 2 +| 455, 7, 2, 4, 0, 0, Empleado Ventas, +| 456, 8, 2, 4, 0, 63, Empleado Ventas, +& 455, 27, 635, 200, 63, 7, 56, 2, 2 + +* Subir empleado +& 600, 202, 635, 220, 7, 63, 56, 2, 2 +* Bajar empleado +& 560, 202, 595, 220, 7, 63, 56, 2, 2 + + + +* Notas +& 5, 365, 25, 475, 7, 63, 56, 2, 2 +| 5, 365, 2, 5, 1, 0, Notas: , +| 6, 366, 2, 5, 1, 63, Notas: , + | 6, 365, 2, 5, 1, 0, _ , + | 7, 366, 2, 5, 1, 63, _ , +& 30, 365, 450, 475, 63, 7, 56, 2, 2 + + + +* Botones ( Imprimir / Dia Visualizaci¢n ) +& 455, 420, 543, 445, 7, 63, 56, 2, 2 +& 548, 420, 635, 445, 7, 63, 56, 2, 2 + +* Boton Men£ Principal +& 455, 450, 635, 475, 7, 63, 56, 2, 2 + +| 455, 422, 2, 5, 0, 0, Imprimir, +| 456, 423, 2, 5, 0, 63, Imprimir, + | 455, 423, 2, 5, 0, 0, _, + | 456, 424, 2, 5, 0, 63, _, + +| 548, 422, 2, 4, 0, 0, Cambiar Dia, +| 549, 423, 2, 4, 0, 63, Cambiar Dia, + | 548, 423, 2, 4, 0, 0, _, + | 549, 424, 2, 4, 0, 63, _, + +| 455, 452, 2, 5, 0, 0, Men£ Principal, +| 456, 453, 2, 5, 0, 63, Men£ Principal, + | 455, 453, 2, 5, 0, 0, _, + | 456, 454, 2, 5, 0, 63, _, + + + +­61 + +* Visualizador de productos vendidos +& 5, 5, 240, 45, 7, 63, 56, 2, 2 + +| 5, 7, 2, 5, 0, 0, Productos Vendidos en el Mes, +| 6, 8, 2, 5, 0, 63, Productos Vendidos en el Mes, + +*| 5, 25, 2, 4, 0, 0, desde las: hasta las:, +*| 6, 26, 2, 4, 0, 63, desde las: hasta las:, + +* Barra para el cuadro de articulos vendidos +& 5, 50, 240, 75, 7, 63, 56, 2, 2 +| 5, 55, 2, 4, 0, 0, Producto Unds, +| 6, 56, 2, 4, 0, 63, Producto Unds, + +* Cuadro de articulos vendidos +& 5, 75, 240, 360, 63, 7, 56, 2, 2 +* Subir/Bajar Articulos vendidos +& 200, 337, 235, 355, 7, 63, 56, 2, 2 +& 160, 337, 195, 355, 7, 63, 56, 2, 2 + +| 245, 5, 2, 5, 0, 0, N§ Tickets:, +| 246, 6, 2, 5, 0, 63, N§ Tickets:, +| 245, 20, 2, 5, 0, 0, Cambio:, +| 246, 21, 2, 5, 0, 63, Cambio:, +| 245, 35, 2, 5, 0, 0, Intentos de Salir:, +| 246, 36, 2, 5, 0, 63, Intentos de Salir:, +| 245, 50, 2, 5, 0, 0, Salidas al Men£:, +| 246, 51, 2, 5, 0, 63, Salidas al Men£:, + +| 245, 65, 2, 5, 0, 0, Inicio Caja:, +| 246, 66, 2, 5, 0, 63, Inicio Caja:, +| 245, 80, 2, 5, 0, 0, Fin Caja:, +| 246, 81, 2, 5, 0, 63, Fin Caja:, + + +* Cuadro de Venta Total, Gastos y Beneficio +& 245, 100, 450, 360, 7, 63, 56, 2, 2 +& 447, 225, 635, 360, 7, 63, 56, 2, 2 +& 445, 228, 455, 357, 7, 7, 7, 0, 0 + +| 245, 120, 2, 5, 0, 0, Total Ventas:, +| 246, 121, 2, 5, 0, 63, Total Ventas:, + +| 245, 140, 2, 5, 0, 0, Total Gastos:, +| 246, 141, 2, 5, 0, 63, Total Gastos:, + +| 245, 160, 2, 5, 0, 0, -.-.-.-.-.-.-.-.-.-.-.-.-, +| 246, 161, 2, 5, 0, 63, -.-.-.-.-.-.-.-.-.-.-.-.-, + +| 245, 180, 2, 5, 0, 0, Benef. Bruto:, +| 246, 181, 2, 5, 0, 63, Benef. Bruto:, + +| 245, 200, 2, 5, 0, 0, Benef. Neto:, +| 246, 201, 2, 5, 0, 63, Benef. Neto:, + +* Cuadro de Ventas por Empleado +& 455, 5, 635, 25, 7, 63, 56, 2, 2 +| 455, 7, 2, 4, 0, 0, Empleado Ventas, +| 456, 8, 2, 4, 0, 63, Empleado Ventas, +& 455, 27, 635, 200, 63, 7, 56, 2, 2 + +* Subir empleado +& 600, 202, 635, 220, 7, 63, 56, 2, 2 +* Bajar empleado +& 560, 202, 595, 220, 7, 63, 56, 2, 2 + + + +* Notas +& 5, 365, 25, 475, 7, 63, 56, 2, 2 +*| 5, 365, 2, 5, 1, 0, Notas: , +*| 6, 366, 2, 5, 1, 63, Notas: , +* | 6, 365, 2, 5, 1, 0, _ , +* | 7, 366, 2, 5, 1, 63, _ , +& 30, 365, 450, 475, 63, 7, 56, 2, 2 + + + +* Botones ( Imprimir / Dia Visualizaci¢n ) +& 455, 420, 543, 445, 7, 63, 56, 2, 2 +& 548, 420, 635, 445, 7, 63, 56, 2, 2 + +* Boton Men£ Principal +& 455, 450, 635, 475, 7, 63, 56, 2, 2 + +| 455, 422, 2, 5, 0, 0, Imprimir, +| 456, 423, 2, 5, 0, 63, Imprimir, + | 455, 423, 2, 5, 0, 0, _, + | 456, 424, 2, 5, 0, 63, _, + +| 548, 422, 2, 4, 0, 0, Cambiar Mes, +| 549, 423, 2, 4, 0, 63, Cambiar Mes, + | 548, 423, 2, 4, 0, 0, _, + | 549, 424, 2, 4, 0, 63, _, + +| 455, 452, 2, 5, 0, 0, Men£ Principal, +| 456, 453, 2, 5, 0, 63, Men£ Principal, + | 455, 453, 2, 5, 0, 0, _, + | 456, 454, 2, 5, 0, 63, _, + + + +************************************************ Botones D: +**** **** Botones S: 80 +** Informe de Compras por Proveedores ** +**** **** +************************************************ + +­80 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Compras por Proveedores, +| 401, 8, 2, 5, 0, 63, Compras por Proveedores, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Cmpr., +| 401, 43, 2, 5, 0, 63, Imprimir Cmpr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, \/, +| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Codigo Actividad Proveedor % Mes Total Anual, +| 11, 138, 2, 5, 0, 0, Codigo Actividad Proveedor % Mes Total Anual, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 85, 160, 340, 295, 63, 7, 56, 2, 2 +& 345, 160, 415, 295, 63, 7, 56, 2, 2 +& 420, 160, 525, 295, 63, 7, 56, 2, 2 +& 530, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Fecha Codigo Articulo Cantidad Costo Total, +| 11, 308, 2, 5, 0, 0, Fecha Codigo Articulo Cantidad Costo Total, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 155, 450, 63, 7, 56, 2, 2 +& 160, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 43 +** Informe Graficas de compras ** +**** **** +************************************************ + +­43 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe de compras mensual, +| 401, 8, 2, 5, 0, 63, Informe de compras mensual, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Cmpr., +| 401, 43, 2, 5, 0, 63, Imprimir Cmpr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, \/, +| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Fecha Total Fecha Total Fecha Total, +| 11, 138, 2, 5, 0, 0, Fecha Total Fecha Total Fecha Total, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 86, 160, 210, 295, 63, 7, 56, 2, 2 + +& 215, 160, 290, 295, 63, 7, 56, 2, 2 +& 296, 160, 420, 295, 63, 7, 56, 2, 2 + +& 425, 160, 500, 295, 63, 7, 56, 2, 2 +& 506, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Fecha Codigo Articulo Cantidad Costo Total, +| 11, 308, 2, 5, 0, 0, Fecha Codigo Articulo Cantidad Costo Total, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 155, 450, 63, 7, 56, 2, 2 +& 160, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + +************************************************ Botones D: 2 +**** **** Botones S: 90 +** M¢dulo para la Gestion de las Empresas ** +**** **** +************************************************ +­90 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gestion de Empresas, +| 401, 8, 2, 5, 0, 63, Gestion de Empresas, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Empr., +| 401, 43, 2, 5, 0, 63, Imprimir Empr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Empr., +| 401, 73, 2, 5, 0, 63, Eliminar Empr., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Empr., +| 519, 73, 2, 5, 0, 63, Insertar Empr., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +| 5, 40, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 41, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 36, 150, 59, 63, 7, 56, 0, 2 +& 245, 36, 390, 59, 63, 7, 56, 0, 2 + +| 5, 65, 2, 5, 0, 0, Empresa:, +| 6, 66, 2, 5, 0, 63, Empresa:, +& 150, 61, 390, 84, 63, 7, 56, 0, 2 + +| 5, 90, 2, 5, 0, 0, Gestor Empr.:, +| 6, 91, 2, 5, 0, 63, Gestor Empr.:, +& 150, 86, 390, 109, 63, 7, 56, 0, 2 + + +| 5, 115, 2, 5, 0, 0, Direccion:, +| 6, 116, 2, 5, 0, 63, Direccion:, +& 90, 111, 390, 134, 63, 7, 56, 0, 2 + +| 5, 140, 2, 5, 0, 0, Localidad: Provincia:, +| 6, 141, 2, 5, 0, 63, Localidad: Provincia:, +& 90, 136, 225, 159, 63, 7, 56, 0, 2 +& 310, 136, 440, 159, 63, 7, 56, 0, 2 + +| 450, 140, 2, 5, 0, 0, C.Postal:, +| 451, 141, 2, 5, 0, 63, C.Postal:, +& 520, 136, 600, 159, 63, 7, 56, 0, 2 + + +| 5, 165, 2, 5, 0, 0, Tel‚fono:, +| 6, 166, 2, 5, 0, 63, Tel‚fono:, +& 90, 161, 247, 184, 63, 7, 56, 0, 2 +& 253, 161, 390, 184, 63, 7, 56, 0, 2 + +| 5, 190, 2, 5, 0, 0, Conexion Tlf. Notas:, +| 6, 191, 2, 5, 0, 63, Conexion Tlf. Notas:, +& 400, 161, 635, 225, 63, 7, 56, 2, 2 + +*& 90, 190, 115, 215, 7, 63, 56, 2, 2 +& 120, 190, 145, 215, 7, 63, 56, 2, 2 +*& 150, 190, 175, 215, 7, 63, 56, 2, 2 +*& 180, 190, 205, 215, 7, 63, 56, 2, 2 +*& 210, 190, 235, 215, 7, 63, 56, 2, 2 +*& 240, 190, 265, 215, 7, 63, 56, 2, 2 +*& 270, 190, 295, 215, 7, 63, 56, 2, 2 +*& 300, 190, 325, 215, 7, 63, 56, 2, 2 + +& 5, 230, 635, 255, 7, 63, 56, 2, 2 +| 5, 235, 2, 5, 0, 0, C¢digo Empresa Dir IP/tlf. C¢digo de Entrada, +| 6, 236, 2, 5, 0, 63, C¢digo Empresa Dir IP/tlf. C¢digo de Entrada, + +& 5, 260, 100, 450, 63, 7, 56, 2, 2 +& 105, 260, 360, 450, 63, 7, 56, 2, 2 +& 365, 260, 497, 450, 63, 7, 56, 2, 2 +& 503, 260, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + +************************************************ Botones D: +**** **** Botones S: 120 +** M¢dulo para configurar el entorno ** +**** **** +************************************************ +!10, 12 + +$ 195, 430, 310, 450, 7, 63, 56, 0, 2, 000, 050 * Men£ Principal +$ 181, 275, 205, 295, 7, 63, 56, 2, 2, 000, 000 * Combinaciones +$ 213, 275, 261, 295, 7, 63, 56, 2, 2, 000, 000 * Guardar +$ 262, 275, 310, 295, 7, 63, 56, 2, 2, 000, 000 * Eliminar +$ 181, 330, 205, 350, 7, 63, 56, 2, 2, 000, 000 * Elementos +$ 181, 385, 205, 405, 7, 63, 56, 2, 2, 000, 000 * Fuentes + +$ 290, 330, 310, 350, 7, 63, 56, 2, 2, 000, 000 * Color +$ 290, 358, 310, 378, 7, 63, 56, 2, 2, 000, 000 * Fondo +$ 262, 385, 310, 405, 63, 7, 56, 2, 2, 000, 000 * Tama¤o + +$ 325, 370, 345, 450, 7, 56, 63, 0, 2, 000, 000 * Impresora +$ 325, 285, 345, 365, 7, 56, 63, 0, 2, 000, 000 * Ventas +$ 325, 200, 345, 280, 7, 56, 63, 0, 2, 000, 000 * Varios... + + +­120 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Cambiar la configuraci¢n, +| 401, 8, 2, 5, 0, 63, Cambiar la configuraci¢n, + +* Linea de separaci¢n +& 319, 5, 321, 450, 0, 63, 63, 0, 2 + + +& 5, 35, 310, 240, 0, 63, 56, 0, 2 + + +| 5, 250, 2, 5, 0, 0, Combinaciones:, +| 5, 250, 2, 5, 0, 63, Combinaciones:, +& 5, 275, 180, 295, 63, 7, 56, 2, 2 +& 181, 275, 205, 295, 7, 63, 56, 2, 2 + +& 213, 275, 261, 295, 7, 63, 56, 2, 2 +& 262, 275, 310, 295, 7, 63, 56, 2, 2 +| 217, 277, 2, 4, 0, 0, Guardar Eliminar, +| 218, 278, 2, 4, 0, 63, Guardar Eliminar, + +| 5, 305, 2, 5, 0, 0, Elementos:, +| 5, 305, 2, 5, 0, 63, Elementos:, +& 5, 330, 180, 350, 63, 7, 56, 2, 2 +& 181, 330, 205, 350, 7, 63, 56, 2, 2 + +| 5, 360, 2, 5, 0, 0, Fuentes:, +| 5, 360, 2, 5, 0, 63, Fuentes:, +& 5, 385, 180, 405, 63, 7, 56, 2, 2 +& 181, 385, 205, 405, 7, 63, 56, 2, 2 + +| 210, 332, 2, 4, 0, 0, Color:, +| 211, 333, 2, 4, 0, 63, Color:, +& 290, 330, 310, 350, 7, 63, 56, 2, 2 +| 210, 360, 2, 4, 0, 0, Fondo:, +| 211, 361, 2, 4, 0, 63, Fondo:, +& 290, 358, 310, 378, 7, 63, 56, 2, 2 +| 210, 387, 2, 4, 0, 0, Tama¤o:, +| 211, 388, 2, 4, 0, 63, Tama¤o:, +& 262, 385, 310, 405, 63, 7, 56, 2, 2 + +& 195, 430, 310, 450, 7, 63, 56, 0, 2 +| 200, 430, 2, 5, 0, 0, Men£ Principal, +| 201, 431, 2, 5, 0, 63, Men£ Principal, + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +***** Configurar Impresora +& 325, 370, 345, 450, 7, 56, 63, 0, 2 +| 327, 370, 2, 4, 1, 0, Impresora , +| 328, 371, 2, 4, 1, 63, Impresora , + +& 325, 285, 345, 365, 7, 56, 63, 0, 2 +| 327, 285, 2, 4, 1, 0, Ventas , +| 328, 286, 2, 4, 1, 63, Ventas , + +& 325, 200, 345, 280, 7, 56, 63, 0, 2 +| 327, 200, 2, 4, 1, 0, Varios... , +| 328, 201, 2, 4, 1, 63, Varios... , +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +­121 + +& 200, 40, 305, 60, 7, 63, 56, 2, 2 +| 200, 41, 2, 4, 0, 0, Mensaje de Linea, +| 201, 42, 2, 4, 0, 63, Mensaje de Linea, +& 200, 62, 252, 82, 7, 63, 56, 2, 2 +& 253, 62, 305, 82, 7, 63, 56, 2, 2 +| 198, 63, 2, 4, 0, 0, Imprimir Menu Pr, +| 199, 64, 2, 4, 0, 63, Imprimir Menu Pr, + + +| 10, 51, 2, 4, 0, 0, Campo:, +| 11, 52, 2, 4, 0, 63, Campo:, +& 50, 54, 180, 64, 63, 7, 56, 0, 2 +| 10, 63, 2, 4, 0, 0, Cmo: Tlg:, +| 11, 64, 2, 4, 0, 63, Cmo: Tlg:, +& 40, 66, 85, 76, 63, 7, 56, 0, 2 +& 120, 66, 180, 76, 63, 7, 56, 0, 2 +| 10, 75, 2, 4, 0, 0, Dircc: nn:, +| 11, 76, 2, 4, 0, 63, Dircc: nn:, +& 50, 78, 100, 88, 63, 7, 56, 0, 2 +& 140, 78, 180, 88, 63, 7, 56, 0, 2 + + +& 10, 100, 305, 115, 7, 63, 56, 0, 2 +| 10, 102, 2, 4, 0, 0, C¢digo Descripci¢n Unds. P.V.P, +| 11, 103, 2, 4, 0, 63, C¢digo Descripci¢n Unds. P.V.P, + +& 10, 117, 70, 223, 63, 7, 56, 2, 2 +& 72, 117, 216, 223, 63, 7, 56, 2, 2 +& 218, 117, 245, 223, 63, 7, 56, 2, 2 +& 247, 117, 305, 223, 63, 7, 56, 2, 2 + +* Texto se¤alado +& 14, 121, 68, 130, 3, 3, 3, 0, 2 +| 11, 120, 2, 4, 0, 0, 000124 Albaranes de compra , +| 11, 130, 2, 4, 0, 0, 000136 Aliados en el juego , +| 11, 140, 2, 4, 0, 0, 000250 Baticoco de mono , +| 11, 150, 2, 4, 0, 0, 000045 Garganta profunda , +| 8, 120, 2, 4, 0, 0, 003 1.500, +| 8, 130, 2, 4, 0, 0, 045 9.999, +| 8, 140, 2, 4, 0, 0, 009 415, +| 8, 150, 2, 4, 0, 0, 010 2.250, + + +* Linea de fondo para ayudas +& 10, 225, 259, 235, 0, 63, 56, 0, 2 +& 261, 225, 305, 235, 63, 7, 56, 0, 2 +| 10, 224, 2, 4, 0, 63, C¢digo de la descripci¢n., + +­122 +* Cuadro de di logo +*& 5, 35, 310, 240, 0, 63, 56, 0, 2 +& 60, 145, 240, 230, 7, 63, 56, 0, 2 +& 63, 148, 237, 165, 1, 56, 63, 0, 2 +| 62, 148, 2, 4, 0, 0, Cuadro de Dialogo, +| 63, 149, 2, 4, 0, 63, Cuadro de Dialogo, + +& 63, 215, 113, 227, 7, 63, 56, 0, 2 +& 187, 215, 237, 227, 7, 63, 56, 0, 2 +| 62, 214, 2, 4, 0, 0, Aceptar, +| 63, 215, 2, 4, 0, 63, Aceptar, +| 64, 214, 2, 4, 0, 0, Cancelar, +| 65, 215, 2, 4, 0, 63, Cancelar, + +***** ***** +*** Color *** +***** ***** +************************************************ Botones D: 11 +**** **** Botones S: 123 +** M¢dulo para configurar el entorno ** +**** **** +************************************************ +!11, 18 +$ 170, 320, 270, 350, 7, 63, 56, 2, 2, 000, 30 * ACEPTAR +$ 370, 320, 470, 350, 7, 63, 56, 2, 2, 000, 46 * CANCELAR + +$ 180, 205, 200, 225, 0, 56, 63, 2, 2, 000, 000 +$ 205, 205, 225, 225, 1, 56, 63, 2, 2, 000, 000 +$ 230, 205, 250, 225, 2, 56, 63, 2, 2, 000, 000 +$ 255, 205, 275, 225, 3, 56, 63, 2, 2, 000, 000 + +$ 180, 230, 200, 250, 4, 56, 63, 2, 2, 000, 000 +$ 205, 230, 225, 250, 5, 56, 63, 2, 2, 000, 000 +$ 230, 230, 250, 250, 6, 56, 63, 2, 2, 000, 000 +$ 255, 230, 275, 250, 7, 56, 63, 2, 2, 000, 000 + +$ 180, 255, 200, 275, 8, 56, 63, 2, 2, 000, 000 +$ 205, 255, 225, 275, 9, 56, 63, 2, 2, 000, 000 +$ 230, 255, 250, 275, 10, 56, 63, 2, 2, 000, 000 +$ 255, 255, 275, 275, 11, 56, 63, 2, 2, 000, 000 + +$ 180, 280, 200, 300, 12, 56, 63, 2, 2, 000, 000 +$ 205, 280, 225, 300, 13, 56, 63, 2, 2, 000, 000 +$ 230, 280, 250, 300, 14, 56, 63, 2, 2, 000, 000 +$ 255, 280, 275, 300, 15, 56, 63, 2, 2, 000, 000 + + +­123 + +& 180, 205, 200, 225, 0, 56, 63, 2, 2 +& 205, 205, 225, 225, 1, 56, 63, 2, 2 +& 230, 205, 250, 225, 2, 56, 63, 2, 2 +& 255, 205, 275, 225, 3, 56, 63, 2, 2 + +& 180, 230, 200, 250, 4, 56, 63, 2, 2 +& 205, 230, 225, 250, 5, 56, 63, 2, 2 +& 230, 230, 250, 250, 6, 56, 63, 2, 2 +& 255, 230, 275, 250, 7, 56, 63, 2, 2 + +& 180, 255, 200, 275, 8, 56, 63, 2, 2 +& 205, 255, 225, 275, 9, 56, 63, 2, 2 +& 230, 255, 250, 275, 10, 56, 63, 2, 2 +& 255, 255, 275, 275, 11, 56, 63, 2, 2 + +& 180, 280, 200, 300, 12, 56, 63, 2, 2 +& 205, 280, 225, 300, 13, 56, 63, 2, 2 +& 230, 280, 250, 300, 14, 56, 63, 2, 2 +& 255, 280, 275, 300, 15, 56, 63, 2, 2 + +& 415, 200, 420, 305, 0, 56, 63, 2, 2 +& 430, 200, 435, 305, 0, 56, 63, 2, 2 +& 445, 200, 450, 305, 0, 56, 63, 2, 2 + + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +­125 + + +***** Configurar Impresora +& 345, 35, 635, 450, 7, 56, 63, 0, 2 +& 343, 372, 347, 449, 7, 7, 7, 0, 2 + +| 370, 100, 2, 5, 0, 0, Imprimir en Archivo:, +| 371, 101, 2, 5, 0, 63, Imprimir en Archivo:, +& 540, 98, 630, 117, 63, 7, 56, 0, 0 + + +| 350, 125, 2, 5, 0, 0, Longitud de la p gina:, +| 351, 126, 2, 5, 0, 63, Longitud de la p gina:, +& 540, 123, 630, 142, 63, 7, 56, 0, 0 + + +| 350, 150, 2, 5, 0, 0, C¢digos de Impresi¢n, +| 351, 151, 2, 5, 0, 63, C¢digos de Impresi¢n, + +| 350, 175, 2, 5, 0, 0, Texto Normal:, +| 351, 176, 2, 5, 0, 63, Texto Normal:, +& 465, 175, 630, 194, 63, 7, 56, 0, 0 + +| 350, 200, 2, 5, 0, 0, T. Condensado:, +| 351, 201, 2, 5, 0, 63, T. Condensado:, +& 465, 200, 630, 219, 63, 7, 56, 0, 0 + +| 350, 230, 2, 5, 0, 0, Ticket ventas INICIO / FIN, +| 351, 231, 2, 5, 0, 63, Ticket ventas INICIO / FIN, + +& 420, 249, 630, 311, 63, 7, 56, 0, 0 +& 420, 320, 630, 382, 63, 7, 56, 0, 0 + + +­126 + +*ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß +***** Configurar Ventas +& 345, 35, 635, 450, 7, 56, 63, 0, 2 +& 343, 287, 347, 363, 7, 7, 7, 0, 2 +*& 343, 202, 347, 268, 7, 7, 7, 0, 2 + +| 350, 40, 2, 5, 0, 0, Protector de pantalla:, +| 351, 41, 2, 5, 0, 63, Protector de pantalla:, +& 540, 38, 630, 57, 63, 7, 56, 0, 0 + + +| 350, 65, 2, 5, 0, 0, Tiempo de espera:, +| 351, 66, 2, 5, 0, 63, Tiempo de espera:, +& 540, 63, 630, 82, 63, 7, 56, 0, 0 + + +| 350, 120, 2, 5, 0, 0, Hora cambio del dia:, +| 351, 121, 2, 5, 0, 63, Hora cambio del dia:, +& 540, 119, 630, 135, 63, 7, 56, 0, 0 + +| 350, 160, 2, 5, 0, 0, Franjas horarias a discriminar:, +| 351, 161, 2, 5, 0, 63, Franjas horarias a discriminar:, +& 351, 180, 380, 197, 63, 7, 56, 0, 0 +& 351, 200, 380, 217, 63, 7, 56, 0, 0 +& 351, 220, 380, 237, 63, 7, 56, 0, 0 +& 351, 240, 380, 257, 63, 7, 56, 0, 0 +& 351, 260, 380, 277, 63, 7, 56, 0, 0 +& 351, 280, 380, 297, 63, 7, 56, 0, 0 +*| 351, 181, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 201, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 221, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 241, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 261, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 281, 2, 5, 0, 63, :00 >-> 00:00, + +| 350, 305, 2, 5, 0, 0, Franjas horarias de ventas:, +| 351, 306, 2, 5, 0, 63, Franjas horarias de ventas:, +& 351, 330, 380, 347, 63, 7, 56, 0, 0 +& 351, 350, 380, 367, 63, 7, 56, 0, 0 +& 351, 370, 380, 387, 63, 7, 56, 0, 0 +& 351, 390, 380, 407, 63, 7, 56, 0, 0 +| 351, 331, 2, 5, 0, 63, [ Hora 2 ], +| 351, 351, 2, 5, 0, 63, [ Hora 3 ], +| 351, 371, 2, 5, 0, 63, [ Hora 4 ], +| 351, 391, 2, 5, 0, 63, [ Hora 5 ], + + +| 350, 425, 2, 4, 0, 0, ¨ Permitir modificar P.C en compras ?:, +| 351, 426, 2, 4, 0, 63, ¨ Permitir modificar P.C en compras ?:, +& 580, 423, 630, 442, 63, 7, 56, 0, 0 +| 351, 331, 2, 5, 0, 0, ., + + + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + + + + +************************************************ Botones D: +**** **** Botones S: 130 +** M¢dulo para la Gestion de Bases de Datos ** +**** **** +************************************************ + +­130 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gesti¢n de Bases de Datos, +| 401, 8, 2, 5, 0, 63, Gesti¢n de Bases de Datos, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Inf., +| 401, 43, 2, 5, 0, 63, Imprimir Inf., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Importar Clv., +| 401, 73, 2, 5, 0, 63, Importar Clv., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Exportar Clv., +| 519, 73, 2, 5, 0, 63, Exportar Clv., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, /\, +| 446, 103, 2, 5, 0, 63, /\, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Eliminar, +| 481, 103, 2, 5, 0, 63, Eliminar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, \/, +| 561, 103, 2, 5, 0, 63, \/, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Pantalla para el arbol +& 5, 5, 270, 450, 7, 56, 63, 2, 2 +& 10, 10, 265, 445, 0, 63, 56, 1, 2 + +* Ventanas de informaci¢n suplementaria +& 275, 135, 635, 290, 63, 7, 56, 2, 2 +& 275, 295, 635, 450, 63, 7, 56, 2, 2 + + + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 140 +** M¢dulo para las Fichas de los Clientes ** +**** **** +************************************************ + +­140 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gesti¢n de Clientes, +| 401, 8, 2, 5, 0, 63, Gesti¢n de Clientes, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Inf., +| 401, 43, 2, 5, 0, 63, Imprimir Inf., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Insertar Clt., +| 401, 73, 2, 5, 0, 63, Insertar Clt., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Eliminar Clt., +| 519, 73, 2, 5, 0, 63, Eliminar Clt., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Recuadro para una posible fotografia +& 315, 5, 395, 100, 0, 63, 56, 0, 2 + +| 5, 20, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 21, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 16, 150, 39, 63, 7, 56, 0, 2 +& 245, 16, 310, 39, 63, 7, 56, 0, 2 + +| 5, 51, 2, 5, 0, 0, Nombre:, +| 6, 52, 2, 5, 0, 63, Nombre:, +& 90, 47, 310, 70, 63, 7, 56, 0, 2 + +| 5, 76, 2, 5, 0, 0, DATOa01:, +| 6, 77, 2, 5, 0, 63, DATOa01:, +& 90, 72, 310, 95, 63, 7, 56, 0, 2 + + +| 5, 101, 2, 5, 0, 0, Direccion:, +| 6, 102, 2, 5, 0, 63, Direccion:, +& 90, 97, 310, 120, 63, 7, 56, 0, 2 + + +| 5, 126, 2, 5, 0, 0, Localidad:, +| 6, 127, 2, 5, 0, 63, Localidad:, +& 90, 122, 225, 145, 63, 7, 56, 0, 2 + +| 5, 150, 2, 5, 0, 0, Provincia: Cod. Post:, +| 6, 151, 2, 5, 0, 63, Provincia: Cod. Post:, +& 90, 147, 225, 170, 63, 7, 56, 0, 2 +& 310, 147, 395, 170, 63, 7, 56, 0, 2 + +| 5, 175, 2, 5, 0, 0, Tel‚fono:, +| 6, 176, 2, 5, 0, 63, Tel‚fono:, +& 90, 172, 240, 195, 63, 7, 56, 0, 2 +& 245, 172, 395, 195, 63, 7, 56, 0, 2 + +| 5, 200, 2, 5, 0, 0, DATOa02:, +| 6, 201, 2, 5, 0, 63, DATOa02:, +& 90, 197, 195, 220, 63, 7, 56, 0, 2 + +| 5, 225, 2, 5, 0, 0, DATOa03:, +| 6, 226, 2, 5, 0, 63, DATOa03:, +& 90, 222, 195, 245, 63, 7, 56, 0, 2 + +| 5, 250, 2, 5, 0, 0, DATOa04:, +| 6, 251, 2, 5, 0, 63, DATOa04:, +& 90, 247, 195, 270, 63, 7, 56, 0, 2 + +| 5, 275, 2, 5, 0, 0, DATOa05:, +| 6, 276, 2, 5, 0, 63, DATOa05:, +& 90, 272, 195, 295, 63, 7, 56, 0, 2 + + + +* Cuadro para el comentario +| 201, 194, 2, 5, 0, 0, Notas:, +| 200, 195, 2, 5, 0, 63, Notas:, +& 200, 210, 395, 295, 7, 63, 56, 2, 2 +& 202, 212, 393, 293, 63, 56, 7, 2, 2 + + +& 5, 300, 453, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 350, 450, 63, 7, 56, 2, 2 +& 350, 330, 453, 450, 63, 7, 56, 2, 2 + +* Muestreo de compras realizadas +& 455, 140, 635, 155, 7, 56, 63, 2, 2 +| 455, 141, 2, 4, 0, 63, Concepto Unds, +| 456, 142, 2, 4, 0, 0, Concepto Unds, + +& 455, 160, 635, 450, 63, 7, 56, 2, 2 + +* Elecci¢n de dias disponibles +& 400, 140, 453, 295, 63, 7, 56, 2, 2 +| 400, 154, 2, 4, 0, 0, 00-00-00, + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 160 +** M¢dulo para Datos de interes: Clientes ** +**** **** +************************************************ + +­160 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Datos de Interes: Clientes: +| 401, 8, 2, 5, 0, 63, Datos de Interes: Clientes: + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Dat., +| 401, 43, 2, 5, 0, 63, Imprimir Dat., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Reordena Clt., +| 401, 73, 2, 5, 0, 63, Reordena Clt., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, -------------, +| 519, 73, 2, 5, 0, 63, -------------, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Cuadro de gr ficas +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 355, 130, 635, 155, 7, 63, 56, 2, 2 +| 355, 134, 2, 5, 0, 63, Total Mes éltima Cmp. Pedidos Mes, +| 356, 135, 2, 5, 0, 0, Total Mes éltima Cmp. Pedidos Mes, + +& 5, 160, 350, 450, 63, 7, 56, 2, 2 + +& 355, 160, 445, 450, 63, 7, 56, 2, 2 +& 450, 160, 575, 450, 63, 7, 56, 2, 2 +& 580, 160, 635, 450, 63, 7, 56, 2, 2 + +| 10, 165, 2, 5, 0, 0, 00000001 Juan Kronoso Pontes, +| 10, 185, 2, 5, 0, 0, 00000002 Grijander Proe Topo, +| 10, 205, 2, 5, 0, 0, 00000003 Jos‚ Marker Inkit, +| 10, 225, 2, 5, 0, 0, 00000004 Kromot Hijtu Vimto, +| 356, 165, 2, 5, 0, 0, 56.950 12-07 4.500 23, +| 356, 185, 2, 5, 0, 0, 35.200 03-06 10.550 7, +| 356, 205, 2, 5, 0, 0, 3.800 24-06 2.400 3, +| 356, 225, 2, 5, 0, 0, 1.345 12-07 1.345 1, + + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + +************************************************ Botones D: +**** **** Botones S: 500 +** Confirmaci¢n de salto al inicio ** +**** **** +************************************************ + +­500 +| 180, 195, 2, 5, 0, 63, Modo salto a Ventas Diarias: Activado, +| 181, 196, 2, 5, 0, 0, Modo salto a Ventas Diarias: Activado, + +| 180, 210, 2, 5, 0, 63, Para evitar el salto. introduzca su, +| 181, 211, 2, 5, 0, 0, Para evitar el salto. introduzca su, + +| 180, 225, 2, 5, 0, 63, login y password., +| 181, 226, 2, 5, 0, 0, login y password., + +| 180, 270, 2, 5, 0, 63, Toda entrada incorrecta, +| 181, 271, 2, 5, 0, 0, Toda entrada incorrecta, +| 180, 285, 2, 5, 0, 63, quedar  registrada!, +| 181, 286, 2, 5, 0, 0, quedar  registrada!, + + +| 410, 247, 2, 4, 0, 63, Tiempo R.:, +| 411, 248, 2, 4, 0, 0, Tiempo R.:, +& 410, 260, 465, 310, 0, 63, 56, 0, 2 diff --git a/DEMO/SYSTM/TPV.PCX b/DEMO/SYSTM/TPV.PCX new file mode 100644 index 0000000..94205e3 Binary files /dev/null and b/DEMO/SYSTM/TPV.PCX differ diff --git a/DEMO/SYSTM/TPV_MP.IMG b/DEMO/SYSTM/TPV_MP.IMG new file mode 100644 index 0000000..2d7b8fc --- /dev/null +++ b/DEMO/SYSTM/TPV_MP.IMG @@ -0,0 +1,305 @@ +#9 + +************************************************ Botones D: 1 +**** **** Botones S: 90 +** Men£ Principal ** +**** **** +************************************************ +!1, 11 + +$ 420, 160, 620, 190, 7, 63, 56, 2, 2, 000, 30 +$ 420, 200, 620, 230, 7, 63, 56, 2, 2, 000, 25 +$ 420, 240, 620, 270, 7, 63, 56, 2, 2, 000, 18 +$ 420, 280, 620, 310, 7, 63, 56, 2, 2, 000, 46 +$ 420, 320, 620, 350, 7, 63, 56, 2, 2, 000, 34 +$ 420, 360, 620, 390, 7, 63, 56, 2, 2, 000, 19 +$ 420, 400, 620, 430, 7, 63, 56, 2, 2, 000, 50 +$ 420, 440, 620, 470, 7, 63, 56, 2, 2, 000, 31 + +$ 110, 283, 297, 312, 0, 56, 63, 2, 2, 000, 000 +$ 20, 280, 300, 315, 7, 63, 56, 2, 2, 000, 000 + +$ 25, 325, 295, 465, 0, 56, 63, 2, 2, 000, 000 + + + + +­90 +| 420, 100, 10, 1, 0, 56, Men£ Principal, +| 421, 101, 10, 1, 0, 56, Men£ Principal, +| 422, 102, 10, 1, 0, 63, Men£ Principal, +*| 420, 100, 2, 8, 0, 56, Men£ Principal, +*| 421, 101, 2, 8, 0, 56, Men£ Principal, +*| 422, 102, 2, 8, 0, 63, Men£ Principal, + + +& 420, 160, 620, 190, 7, 63, 56, 2, 2 +& 420, 200, 620, 230, 7, 63, 56, 2, 2 +& 420, 240, 620, 270, 7, 63, 56, 2, 2 +& 420, 280, 620, 310, 7, 63, 56, 2, 2 +& 420, 320, 620, 350, 7, 63, 56, 2, 2 +& 420, 360, 620, 390, 7, 63, 56, 2, 2 +& 420, 400, 620, 430, 7, 63, 56, 2, 2 +& 420, 440, 620, 470, 7, 63, 56, 2, 2 + +& 20, 280, 300, 315, 7, 63, 56, 2, 2 +& 110, 283, 297, 312, 0, 56, 63, 2, 2 +| 20, 285, 2, 6, 0, 63, Empresa:, +| 21, 286, 2, 6, 0, 0, Empresa:, + +& 20, 320, 300, 470, 7, 63, 56, 2, 2 +& 25, 325, 295, 465, 0, 56, 63, 2, 2 + +*| 40, 340, 2, 6, 0, 63, Todas las opciones, +*| 40, 360, 2, 6, 0, 63, han sido desactivadas, + +*| 40, 390, 2, 6, 0, 63, C¢digo de acceso RECHAZADO, + + + +* SubMenu Dedicado a Articulo + * Ref. Articulos + * Stock Actual + * Graficas Ventas + +************************************************ Botones D: 2 +**** **** Botones S: 91 +** Articulos ** +**** **** +************************************************ +!2, 3 + $ 220, 85, 410, 115, 7, 63, 56, 2, 2, 000, 000 + $ 220, 120, 410, 150, 7, 63, 56, 2, 2, 000, 000 + $ 220, 155, 410, 185, 7, 63, 56, 2, 2, 000, 000 + +­91 +& 215, 80, 415, 190, 7, 56, 63, -2, 2 + & 220, 85, 410, 115, 7, 63, 56, 2, 2 + | 220, 88, 2, 6, 0, 0, Ref. Articulos, + | 221, 89, 2, 6, 0, 63, Ref. Articulos, + & 220, 120, 410, 150, 7, 63, 56, 2, 2 + | 220, 123, 2, 6, 0, 0, Stock Actual, + | 221, 124, 2, 6, 0, 63, Stock Actual, + & 220, 155, 410, 185, 7, 63, 56, 2, 2 + | 220, 158, 2, 6, 0, 0, Graficas Ventas, + | 221, 159, 2, 6, 0, 63, Graficas Ventas, + + +************************************************ Botones D: 3 +**** **** Botones S: 92 +** Proveedores ** +**** **** +************************************************ +!3, 2 + + $ 220, 160, 410, 190, 7, 63, 56, 2, 2, 000, 000 + $ 220, 195, 410, 225, 7, 63, 56, 2, 2, 000, 000 + +­92 +& 215, 155, 415, 230, 7, 56, 63, -2, 2 + & 220, 160, 410, 190, 7, 63, 56, 2, 2 + | 220, 163, 2, 6, 0, 0, Info Proveedores, + | 221, 164, 2, 6, 0, 63, Info Proveedores, + & 220, 195, 410, 225, 7, 63, 56, 2, 2 + | 220, 198, 2, 6, 0, 0, Compras Proveedor, + | 221, 199, 2, 6, 0, 63, Compras Proveedor, + +************************************************ Botones D: 4 +**** **** Botones S: 93 +** Compras ** +**** **** +************************************************ +!4, 2 + $ 220, 240, 410, 270, 7, 63, 56, 2, 2, 000, 000 + $ 220, 275, 410, 305, 7, 63, 56, 2, 2, 000, 000 + + +­93 +& 215, 235, 415, 310, 7, 56, 63, -2, 2 + & 220, 240, 410, 270, 7, 63, 56, 2, 2 + | 220, 243, 2, 6, 0, 0, Compras General, + | 221, 244, 2, 6, 0, 63, Compras General, + & 220, 275, 410, 305, 7, 63, 56, 2, 2 + | 220, 278, 2, 6, 0, 0, Graficas Compras, + | 221, 279, 2, 6, 0, 63, Graficas Compras, + +************************************************ Botones D: 5 +**** **** Botones S: 94 +** Ventas ** +**** **** +************************************************ +!5, 4 + $ 220, 210, 410, 240, 7, 63, 56, 2, 2, 000, 000 + $ 220, 245, 410, 275, 7, 63, 56, 2, 2, 000, 000 + $ 220, 280, 410, 310, 7, 63, 56, 2, 2, 000, 000 + $ 220, 315, 410, 345, 7, 63, 56, 2, 2, 000, 000 + + +­94 +& 215, 205, 415, 350, 7, 56, 63, -2, 2 + & 220, 210, 410, 240, 7, 63, 56, 2, 2 + | 220, 213, 2, 6, 0, 0, Inicio Caja, + | 221, 214, 2, 6, 0, 63, Inicio Caja, + & 220, 245, 410, 275, 7, 63, 56, 2, 2 + | 220, 248, 2, 6, 0, 0, Balance Caja, + | 221, 249, 2, 6, 0, 63, Balance Caja, + & 220, 280, 410, 310, 7, 63, 56, 2, 2 + | 220, 283, 2, 6, 0, 0, Balance Mensual, + | 221, 284, 2, 6, 0, 63, Balance Mensual, + & 220, 315, 410, 345, 7, 63, 56, 2, 2 + | 220, 318, 2, 6, 0, 0, Gestion Clientes, + | 221, 319, 2, 6, 0, 63, Gestion Clientes, + + + +************************************************ Botones D: 6 +**** **** Botones S: 95 +** Empleados ** +**** **** +************************************************ +!6, 3 + $ 220, 165, 410, 195, 7, 63, 56, 2, 2, 000, 000 + $ 220, 200, 410, 230, 7, 63, 56, 2, 2, 000, 000 + $ 220, 235, 410, 265, 7, 63, 56, 2, 2, 000, 000 + + + + +­95 +& 215, 160, 415, 270, 7, 56, 63, -2, 2 + & 220, 165, 410, 195, 7, 63, 56, 2, 2 + | 220, 168, 2, 6, 0, 0, Info Empleados, + | 221, 169, 2, 6, 0, 63, Info Empleados, + & 220, 200, 410, 230, 7, 63, 56, 2, 2 + | 220, 203, 2, 6, 0, 0, Permisos Acceso, + | 221, 204, 2, 6, 0, 63, Permisos Acceso, + & 220, 235, 410, 265, 7, 63, 56, 2, 2 + | 220, 238, 2, 6, 0, 0, Graficas Ventas, + | 221, 239, 2, 6, 0, 63, Graficas Ventas, + + +************************************************ Botones D: 7 +**** **** Botones S: 96 +** Miscelanea ** +**** **** +************************************************ +!7, 6 + +$ 220, 220, 410, 250, 7, 63, 56, 2, 2, 000, 000 +$ 220, 255, 410, 285, 7, 63, 56, 2, 2, 000, 000 +$ 220, 290, 410, 320, 7, 63, 56, 2, 2, 000, 000 +$ 220, 325, 410, 355, 7, 63, 56, 2, 2, 000, 000 +$ 220, 360, 410, 390, 7, 63, 56, 2, 2, 000, 000 +$ 220, 395, 410, 425, 7, 63, 56, 2, 2, 000, 000 + + +­96 + +& 215, 215, 415, 430, 7, 56, 63, -2, 2 + & 220, 220, 410, 250, 7, 63, 56, 2, 2 + | 220, 223, 2, 6, 0, 0, Mensajes Protector, + | 221, 224, 2, 6, 0, 63, Mensajes Protector, + & 220, 255, 410, 285, 7, 63, 56, 2, 2 + | 220, 258, 2, 6, 0, 0, FA, + | 221, 259, 2, 6, 0, 63, FA, + & 220, 290, 410, 320, 7, 63, 56, 2, 2 + | 220, 293, 2, 6, 0, 0, FA, + | 221, 294, 2, 6, 0, 63, FA, + & 220, 325, 410, 355, 7, 63, 56, 2, 2 + | 220, 328, 2, 6, 0, 0, Gst Bases de Datos, + | 221, 329, 2, 6, 0, 63, Gst Bases de Datos, + & 220, 360, 410, 390, 7, 63, 56, 2, 2 + | 220, 363, 2, 6, 0, 0, Programas externos, + | 221, 364, 2, 6, 0, 63, Programas externos, + & 220, 395, 410, 425, 7, 63, 56, 2, 2 + | 220, 398, 2, 6, 0, 0, Configurar Entorno, + | 221, 399, 2, 6, 0, 63, Configurar Entorno, + + + +************************************************ Botones D: 8 +**** **** Botones S: 97 +** Escoger empresa activa ** +**** **** +************************************************ +!8, 10 + +$ 110, 75, 297, 95, 7, 63, 56, 2, 2, 000, 000 +$ 110, 95, 297, 115, 7, 63, 56, 2, 2, 000, 000 +$ 110, 115, 297, 135, 7, 63, 56, 2, 2, 000, 000 +$ 110, 135, 297, 155, 7, 63, 56, 2, 2, 000, 000 +$ 110, 155, 297, 175, 7, 63, 56, 2, 2, 000, 000 +$ 110, 175, 297, 195, 7, 63, 56, 2, 2, 000, 000 +$ 110, 195, 297, 215, 7, 63, 56, 2, 2, 000, 000 +$ 110, 215, 297, 235, 7, 63, 56, 2, 2, 000, 000 +$ 110, 235, 297, 255, 7, 63, 56, 2, 2, 000, 000 +$ 110, 255, 297, 275, 7, 63, 56, 2, 2, 000, 000 + + +­97 + +*$ 20, 280, 300, 315, 7, 63, 56, 2, 2, 000, 000 +& 105, 70, 302, 280, 7, 56, 63, -2, 2 + + & 110, 255, 297, 275, 7, 63, 56, 2, 2 + & 110, 235, 297, 255, 7, 63, 56, 2, 2 + & 110, 215, 297, 235, 7, 63, 56, 2, 2 + & 110, 195, 297, 215, 7, 63, 56, 2, 2 + & 110, 175, 297, 195, 7, 63, 56, 2, 2 + & 110, 155, 297, 175, 7, 63, 56, 2, 2 + & 110, 135, 297, 155, 7, 63, 56, 2, 2 + & 110, 115, 297, 135, 7, 63, 56, 2, 2 + & 110, 95, 297, 115, 7, 63, 56, 2, 2 + & 110, 75, 297, 95, 7, 63, 56, 2, 2 + + | 110, 255, 2, 4, 0, 0, 123456789-123456789-123456789-, + | 111, 256, 2, 4, 0, 63, 123456789-123456789-123456789-, + + +************************************************ Botones D: 9 +**** **** Botones S: 98 +** Ventas -> Empleados ** +**** **** +************************************************ +!9, 3 + $ 220, 245, 410, 275, 7, 63, 56, 2, 2, 000, 000 + $ 220, 280, 410, 310, 7, 63, 56, 2, 2, 000, 000 + $ 220, 315, 410, 345, 7, 63, 56, 2, 2, 000, 000 + + +­98 +& 215, 240, 415, 350, 7, 56, 63, -2, 2 + & 220, 245, 410, 275, 7, 63, 56, 2, 2 + | 220, 248, 2, 6, 0, 0, Datos Clientes, + | 221, 249, 2, 6, 0, 63, Datos Clientes, + & 220, 280, 410, 310, 7, 63, 56, 2, 2 + | 220, 283, 2, 6, 0, 0, Venta a Clientes, + | 221, 284, 2, 6, 0, 63, Venta a Clientes, + & 220, 315, 410, 345, 7, 63, 56, 2, 2 + | 220, 318, 2, 6, 0, 0, Datos de interes, + | 221, 319, 2, 6, 0, 63, Datos de interes, + +************************************************ Botones D: 8 <-| +**** **** Botones S: 99 <-| +** Programas externos ** +**** **** +************************************************ +­99 + +& 223, 185, 420, 395, 7, 56, 63, -2, 2 + + & 228, 370, 415, 390, 7, 63, 56, 2, 2 + & 228, 350, 415, 370, 7, 63, 56, 2, 2 + & 228, 330, 415, 350, 7, 63, 56, 2, 2 + & 228, 310, 415, 330, 7, 63, 56, 2, 2 + & 228, 290, 415, 310, 7, 63, 56, 2, 2 + & 228, 270, 415, 290, 7, 63, 56, 2, 2 + & 228, 250, 415, 270, 7, 63, 56, 2, 2 + & 228, 230, 415, 250, 7, 63, 56, 2, 2 + & 228, 210, 415, 230, 7, 63, 56, 2, 2 + & 228, 190, 415, 210, 7, 63, 56, 2, 2 + + & 190, 185, 220, 288, 7, 63, 56, 2, 2 + & 190, 292, 220, 395, 7, 63, 56, 2, 2 + | 192, 185, 2, 6, 1, 0, Eliminar Insertar , + | 193, 186, 2, 6, 1, 63, Eliminar Insertar , diff --git a/DEMO/TPV.BAT b/DEMO/TPV.BAT new file mode 100644 index 0000000..04b75e0 --- /dev/null +++ b/DEMO/TPV.BAT @@ -0,0 +1,18 @@ +@echo off +@echo Atenci¢n: +@echo Cualquier fallo que o anomalia que pueda observar en el programa +@echo a sido elaborada a proposito, a modo de limitar la funcionalidad +@echo del mismo y/o alterarlo para conseguir una versi¢n final de este +@echo . +@echo Si realmente esta interesado en el programa, pongase en contacto +@echo con el programador en: Jose-David.Guillen@cs.us.es para poder +@echo ver el programa al 100% de su capacidad. +@echo . +@echo Jos‚ David Guill‚n || 1997 (c) +@echo Mi p gina ---> http://www.arrakis.es/~infomundo/JD +@echo InfoMundo "En construcci¢n" ---> http://www.arrakis.es/~infomundo +@echo . +pause +tpv_d.exe + + diff --git a/DEMO/TPV_D.EXE b/DEMO/TPV_D.EXE new file mode 100644 index 0000000..e384bc4 Binary files /dev/null and b/DEMO/TPV_D.EXE differ diff --git a/DJR-1-5.RAR b/DJR-1-5.RAR new file mode 100644 index 0000000..6f44a8b Binary files /dev/null and b/DJR-1-5.RAR differ diff --git a/DJR-6-2.RAR b/DJR-6-2.RAR new file mode 100644 index 0000000..2bd35ea Binary files /dev/null and b/DJR-6-2.RAR differ diff --git a/FONTS/PROT_PTL.FNT b/FONTS/PROT_PTL.FNT new file mode 100644 index 0000000..31994db Binary files /dev/null and b/FONTS/PROT_PTL.FNT differ diff --git a/FONTS/VENT_MSG.FNT b/FONTS/VENT_MSG.FNT new file mode 100644 index 0000000..f0b651e Binary files /dev/null and b/FONTS/VENT_MSG.FNT differ diff --git a/GO.BAT b/GO.BAT new file mode 100644 index 0000000..aaa458a --- /dev/null +++ b/GO.BAT @@ -0,0 +1,3 @@ +ren c:\tpv\tpv.exe c:\tpv\tpv.021 +xcopy a:\tpv.exe c:\tpv /Y +xcopy a:\tpv.img c:\tpv\systm /Y diff --git a/K.BAT b/K.BAT new file mode 100644 index 0000000..3ec284c --- /dev/null +++ b/K.BAT @@ -0,0 +1 @@ +edit datos\emp00001\scroll.txt diff --git a/Lbm (DOCUMENTACION).zip b/Lbm (DOCUMENTACION).zip new file mode 100644 index 0000000..bc63d84 Binary files /dev/null and b/Lbm (DOCUMENTACION).zip differ diff --git a/MAKE_BOT.OBJ b/MAKE_BOT.OBJ new file mode 100644 index 0000000..0adcc7c Binary files /dev/null and b/MAKE_BOT.OBJ differ diff --git a/MENUP.TXT b/MENUP.TXT new file mode 100644 index 0000000..40faa26 --- /dev/null +++ b/MENUP.TXT @@ -0,0 +1,77 @@ + + + / + | + /| + / |_ + __|__ \ + / _ \ \ Articulos + | | \ | __|__ + | |_ / | / __ \ Proveedores + \_____/ | | | + | \_/ | Empleados + \_____/ + Compras + + ___________________________ Gestion Ventas + / \ + | Pantalla con Scroll para | Programas Externos + | los creditos... | + | | Miscelanea + | | + \___________________________/ Salir + + + + + +Articulos + Ref. Articulos + Stock Actual + Graficas Ventas + +Proveedores + Info Proveedores + Compras Proveedor + +Empleados + Info Empleados + Permiso Accesos + Graficas de Ventas + +Compras + Compras General + Graficas Compras + +Gestion Ventas + Venta Diaria + Balance Diario + Balance Mensual + + + + + Productos vendidos, N§ Tickets: xxx.xxx.xx ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + desde: __ hasta __ Cambio: x.xxx ³ Nombre Vendido ³ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ Intentos Salir: xxx.xx ³---------------------³ + ³ Ref. Producto T.Unds ³ Salidas Menu P: x ³ ³ + ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ + ³ ³ ³ 8 : 12 x ³ ³ ³ + ³ ³ ³ 12 : 16 xx ³ ³ ³ + ³ ³ ³ 16 : 20 x.xx ³ ³ ³ + ³ ³ ³ 20 : 24 x ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ³ ³ ³ 24 : 4 xx ³ + ³ ³ ³ 4 : 8 x ³ Inicio Caja: XX:XX:xx + ³ ³ ³--------------------³ Fin Caja: XX:XX:xx + ³ ³ ³ ToTal Ventas: x.xx ³ + ³ ³ ³ ³ + ³ ³ ³ Gastos: x.xxx ³ + ³ ³ ³--------------------³ + ³ ³ ³ Beneficios: xx.xxx ³ + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ Notas: ³ + ³ ³ Recalcular Calendario + ³ ³ + ³ ³ Menu Principal + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ diff --git a/M_MB.HH b/M_MB.HH new file mode 100644 index 0000000..cea3742 --- /dev/null +++ b/M_MB.HH @@ -0,0 +1,73 @@ + + + /*************************\ + |* *| + |* Datos sobre los Botones *| + |* *| + \*************************/ + typedef struct + { + int Left, Up, Right, Down; + unsigned char Cdf, Cb1, Cb2; + char Ab, Pb; + unsigned char Isc, Sc; + } Make_Boton; + + + /*************************\ + |* *| + |* Clase Make_Boton *| + |* *| + \*************************/ + + class MBoton + { + public: + + Make_Boton far *Botones; // Puntero a la estructura MBoton + int XRaton, YRaton; // Posicion del raton + + char cError[80]; // Descripcion del error lError + char TruePush; // Control de Presi¢n Real + + + MBoton(); // Constructor de Clase + ~MBoton(); // Destructor de Clase + + + int CargarObjetos( char *file ); // Lee los objetos del fichero dado + void DespliegaDatos( void ); // Despliega los datos leidos antes + // Imprime la Sec. de botones cargados + void ImprimeSecuencia( int Secuencia ); + // Lee y muestra la secuencia SecMostrar + int MuestraEstaticos( char *file, int SecMostrar ); + // Comprueba la secuencia dada + int CompruebaSecuencia( int Secuencia, int (far *UserPointer)( int *Xraton, int *Yraton ) ); + // Recomprueba la secuencia dada + int ReComprueba_Secuencia( int Secuencia ); + + // Imprime los bordes de un solo color + void ImprimeBordes( int Secuencia, int Boton, int Color ); + + void Error( int lError ); // Carga en cError, lError + + + + private: + + int cError; // C¢digo de error interno + char NSecuencias; // N£mero de secuencias + int *NBSecuencia; // N£mero de botones de cada secuencia + void far *FBoton; // Fondo del boton (Presi¢n Real) + // Imprime Bot_Imp, rellenandolo segun D_Bord + void ImprimeBoton( int D_Bord, Make_Boton Bot_Imp ); + // Deprime o reimprime el boton + void DeprimeBoton( int DepImp, Make_Boton DepBot ); + // Puntero para recomprobar secuencias + int ReCmpPointer( int *Xraton, int *Yraton ); + // Obtienen el comienzo de la secuencia + int PrincipioSecuencia( int Secuencia ); + // Lee un n£mero del fichero handle + long ObtenNumero( FILE *handle, char *ch ); + + }; diff --git a/N_MB.CPP b/N_MB.CPP new file mode 100644 index 0000000..e1a3463 --- /dev/null +++ b/N_MB.CPP @@ -0,0 +1,1208 @@ + /**************************************************************************\ +|* *| +|* Make_Boton (orientado a objetos) *| +|* *| +|* Descripcion: *| +|* Este es mi viejo proyecto, que espero ver hecho realidad, *| +|* es Make Boton, en objeto. *| +|* *| +|* *| +|* *| +|* *| +|* *| + \**************************************************************************/ + +#include +#include +#include "N_MB.HH" + +#define JD_imagesize(int left, int top, int right, int bottom) (( (left > right) ? (left - right + 1) : ( right - left + 1) )*( ( top > bottom) ? ( top - bottom + 1) : (bottom - top + 1) )+4) + + + /**************************************************************************\ +|* *| +|* MBoton *| +|* *| +|* Descripcion: *| +|* Consturctir de clase, inicializa todos los datos necesarios *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +MBoton::MBoton() +{ + NSecuencias = 0; // N§ de secuencias + True_Push = OFF; // Pulsado real ( apagado ) +} + + + /**************************************************************************\ +|* *| +|* MBoton *| +|* *| +|* Descripcion: *| +|* Desctuctor de clase *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +MBoton::~MBoton() +{ + free( NBSecuencia ); + farfree( Botones ); +} + + /**************************************************************************\ +|* *| +|* ObtenNumero *| +|* *| +|* Descripcion: *| +|* Obtiene un numero del handle a fichero, y situa en ch el *| +|* £ltimo caracter leido *| +|* *| +|* Entradas: handle al fichero, recipiente donde guardar el caracter *| +|* *| +|* Salidas: n£mero leido del fichero *| +|* *| + \**************************************************************************/ +long MBoton::ObtenNumero( FILE *handle, char *ch ) +{ + long numero; + char signo = 1; + + numero = 0; + *ch=fgetc(handle); + while ( *ch != EOL && *ch != EOF && *ch != ',' ) + { + if ( *ch >= '0' && *ch <= '9') numero = ( numero*10 + *ch - '0' ); + else if ( *ch == '-' ) signo = -1; + *ch = fgetc(handle); + } + return numero * signo; +} + + + /**************************************************************************\ +|* *| +|* CargarObjetos *| +|* *| +|* Descripcion: *| +|* Carga los objetos del fichero, que se pasa como par metro. *| +|* *| +|* Entradas: Fichero donde se encuentran los objetos *| +|* *| +|* Salidas: OK / ERROR *| +|* *| + \**************************************************************************/ +int MBoton::CargarObjetos( char *file ) +{ + FILE *handle; + char ch; + unsigned int temp_num; + int SiZe_BoToN = 0; + int inc_Botones = -1; + + // Abrimos el archivo especificado + if ( ( handle == fopen( file, "r" ) ) == NULL ) + { + lError = 0x01; Error( lError ); + return ERROR; + } + + // Liberamos cualquier memoria previa. + if ( Botones != NULL ) + farfree ( Botones ); + if ( NBSecuencia != NULL ) + free ( NBSecuencia ); + + + // Ahora cribamos los datos del fichero, y cargamos en memoria + // todos aquellos que son DINAMICOS + + ch=fgetc(handle); //Lee el primer caracter + while (ch!=EOF) //Lee hasta fin de fichero + { + switch ( ch ) + { + // Comentarios + case '*': + while (ch!=EOL && ch!=EOF) ch=fgetc(handle); + break; + // N£mero de secuencias + case '#': + Secuencias = ObtenNumero( handle, &ch ); + + if (( NBSecuencia = (int *) malloc( sizeof(int)*Secuencias ) ) == NULL) + { + fclose( handle ); + lError = 0x05; Error( lError ); + return ERROR; + } + break; + //Numero de Botones en la secuencia + case '!': + // Obtenemos la secuencia activa + temp_num = ObtenNumero( handle, &ch ); + + // N£mero de botones para esa secuencia + NBSecuencia[ temp_num - 1 ] = ObtenNumero( handle, &ch ); + + SiZe_BoToN += ( sizeof( struct Make_Boton ) * NBSecuencia[ temp_num - 1 ] ); + + if ( (Botones = (struct Make_Boton far *)farrealloc(Botones, SiZe_BoToN )) == NULL) + { + fclose( handle ); + lError = 0x05; Error( lError ); + return ERROR; + } + break; + //C lculos del boton + case '$': + inc_Botones++; + + Botones[ inc_Botones ]. Left = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Up = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Right = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Down = ObtenNumero( handle, &ch ); + + Botones [inc_Botones]. Cdf = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Cb1 = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Cb2 = ObtenNumero( handle, &ch ); + + Botones [inc_Botones]. Ab = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Pb = ObtenNumero( handle, &ch ); + + Botones [inc_Botones]. Isc = ObtenNumero( handle, &ch ); + Botones [inc_Botones]. Sc = ObtenNumero( handle, &ch ); + break; + + } + + if (ch != EOF) ch = fgetc(handle); + } + + // Cerramos el fichero + fclose( handle ); + return OK; + +} + + + /**************************************************************************\ +|* *| +|* ImprimeSecuencia *| +|* *| +|* Descripcion: *| +|* Imprime la secuencia dada, de botones previamente cargados *| +|* *| +|* Entradas: Secuencia a imprimir *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MBoton::ImprimeSecuencia( int Secuencia ) +{ + + int IniSecuencia, i; + + IniSecuencia = PrincipioSecuencia( Secuencia - 1 ); + + for( i = 0; i 0) + { + puntos[1] = 120; puntos[2] = 300; + } else { + puntos[1] = 60; puntos[2] = 240; + } + + // Dibujamos el primer semi-ciclo + setlinestyle( 0, 1, NORM_WIDTH ); + setcolor( Bot_Imp.Cb1 ); + setfillstyle( SOLID_FILL, Bot_Imp.Cb1 ); + for ( puntos[0] = 0; puntos[0] < Bot_Imp.Ab; puntos[0]++ ) + arc( Bot_Imp.Left, Bot_Imp.Up, puntos[1]+puntos[0], puntos[2]+puntos[0], Bot_Imp.Right - puntos[0] ); + + // Dibujamos el segundo semi-ciclo + setcolor( Bot_Imp.Cb2 ); + setfillstyle( SOLID_FILL, Bot_Imp.Cb2 ); + + for ( puntos[0] = 0; puntos[0] < Bot_Imp.Ab; puntos[0]++ ) + arc( Bot_Imp.Left, Bot_Imp.Up, puntos[2]+puntos[0], puntos[1]+puntos[0], Bot_Imp.Right - puntos[0] ); + + // Lo tenemos que rellenar ??? + if( D_Bord ) + { + setcolor( Bot_Imp.Cdf ); + setfillstyle( SOLID_FILL, Bot_Imp.Cdf ); + pieslice( Bot_Imp.Left, Bot_Imp.Up, 0, 360, Bot_Imp.Right - Bot_Imp.Ab ); + } + + // Si el borde es >= 2, dibujamos un circulo negro a su alrededor + if( Bot_Imp.Ab >= 2 ) + { + setcolor( NEGRO ); + setfillstyle(EMPTY_FILL, Bot_Imp.Cdf); + circle( Bot_Imp.Left, Bot_Imp.Up, Bot_Imp.Right); + } + + break; + + default: + // Posicion de los bordes + if ( Bot_Imp.Pb == 2 ) + { + puntos[0] = Bot_Imp.Left; puntos[1] = Bot_Imp.Up; + puntos[2] = Bot_Imp.Right; puntos[3] = Bot_Imp.Up; + puntos[4] = Bot_Imp.Right; puntos[5] = Bot_Imp.Down; + puntos[6] = Bot_Imp.Right - Bot_Imp.Ab; puntos[7] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[8] = Bot_Imp.Right - Bot_Imp.Ab; puntos[9] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[10] = Bot_Imp.Left + Bot_Imp.Ab; puntos[11] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[12] = Bot_Imp.Left; puntos[13] = Bot_Imp.Up; + } else { + puntos[0] = Bot_Imp.Left; puntos[1] = Bot_Imp.Up; + puntos[2] = Bot_Imp.Right; puntos[3] = Bot_Imp.Up; + puntos[4] = Bot_Imp.Right - Bot_Imp.Ab; puntos[5] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[6] = Bot_Imp.Left + Bot_Imp.Ab; puntos[7] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[8] = Bot_Imp.Left + Bot_Imp.Ab; puntos[9] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[10] = Bot_Imp.Left; puntos[11] = Bot_Imp.Down; + puntos[12] = Bot_Imp.Left; puntos[13] = Bot_Imp.Up; + } + + // Dibujamos el primer borde + setcolor( Bot_Imp.Cb1 ); + setfillstyle( SOLID_FILL, Bot_Imp.Cb1 ); + setlinestyle( 0, 1, NORM_WIDTH ); + fillpoly( 7, puntos ); + + if ( Bot_Imp.Pb == 2 ) + { + puntos[0] = Bot_Imp.Left + Bot_Imp.Ab; puntos[1] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[2] = Bot_Imp.Left + Bot_Imp.Ab; puntos[3] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[4] = Bot_Imp.Right - Bot_Imp.Ab; puntos[5] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[6] = Bot_Imp.Right; puntos[7] = Bot_Imp.Down; + puntos[8] = Bot_Imp.Left; puntos[9] = Bot_Imp.Down; + puntos[10] = Bot_Imp.Left; puntos[11] = Bot_Imp.Up; + puntos[12] = Bot_Imp.Left + Bot_Imp.Ab; puntos[13] = Bot_Imp.Up + Bot_Imp.Ab; + } else { + puntos[0] = Bot_Imp.Right; puntos[1] = Bot_Imp.Up; + puntos[2] = Bot_Imp.Right; puntos[3] = Bot_Imp.Down; + puntos[4] = Bot_Imp.Left; puntos[5] = Bot_Imp.Down; + puntos[6] = Bot_Imp.Left + Bot_Imp.Ab; puntos[7] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[8] = Bot_Imp.Right - Bot_Imp.Ab; puntos[9] = Bot_Imp.Down - Bot_Imp.Ab; + puntos[10] = Bot_Imp.Right - Bot_Imp.Ab; puntos[11] = Bot_Imp.Up + Bot_Imp.Ab; + puntos[12] = Bot_Imp.Right; puntos[13] = Bot_Imp.Up; + } + + // Dibujamos el segundo borde + setcolor( Bot_Imp.Cb2 ); + setfillstyle( SOLID_FILL, Bot_Imp.Cb2 ); + setlinestyle( 0, 1, NORM_WIDTH ); + fillpoly( 7, puntos ); + + // Hay que rellenarlo??? + if( D_Bord ) + { + setcolor( Bot_Imp.Cdf ); + setfillstyle( SOLID_FILL, Bot_Imp.Cdf ); + bar( Bot_Imp.Left+Bot_Imp.Ab+1, Bot_Imp.Up+Bot_Imp.Ab+1, Bot_Imp.Right-Bot_Imp.Ab-1, Bot_Imp.Down-Bot_Imp.Ab-1 ); + } + + // Se le puede poner un marco negro ??? + if( Bot_Imp.Ab >= 2 ) + { + setcolor( NEGRO ); + setfillstyle( EMPTY_FILL, Bot_Imp.Cdf ); + rectangle( Bot_Imp.Left, Bot_Imp.Up, Bot_Imp.Right, Bot_Imp.Down ); + } + + break; + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeBordes *| +|* *| +|* Descripcion: *| +|* Imprime el Boton #, de la Secuencia #, con los bordes Color *| +|* *| +|* Entradas: Seuencia, Boton, Color *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MBoton::ImprimeBordes( int Secuencia, int Boton, int Color ) +{ + int IniSecuencia, puntos[14]; + unsigned int size; + + IniSecuencia = PrincipioSecuencia( Secuencia - 1 ); + + if( Boton <= 0 || Boton > NBSecuencia[ Secuencia - 1 ] ) return; + + Boton--; + + // Un Color negativo restaura sus bordes + if( Color < 0 ) + { + + ImprimeBoton( 0, Botones[ IniSecuencia + Boton ] ); + + } else { + + switch( Botones[ IniSecuencia + Boton ].Down < 0 ) + { + case -1: + setlinestyle( 0, 1, NORM_WIDTH ); + setcolor( Color ); + setfillstyle( SOLID_FILL, Color ); + for ( puntos[0] = 0; puntos[0] < Botones[ IniSecuencia + Boton ].Ab; puntos[0]++ ) + circle( Botones[ IniSecuencia + Boton ].Left, Botones[ IniSecuencia + Boton ].Up, Botones[ IniSecuencia + Boton ].Right - puntos[0] ); + + if( Botones[ IniSecuencia + Boton ].Ab >= 2 ) + { + setcolor( NEGRO ); + setfillstyle( EMPTY_FILL, Botones[ IniSecuencia + Boton ].Cdf ); + circle( Botones[ IniSecuencia + Boton].Left, Botones[ IniSecuencia + Boton].Up, Botones[ IniSecuencia + Boton].Right); + } + break; + default: + puntos[0] = Botones[ IniSecuencia + Boton ].Left; puntos[1] = Botones[ IniSecuencia + Boton ].Up; + puntos[2] = Botones[ IniSecuencia + Boton ].Right; puntos[3] = Botones[ IniSecuencia + Boton ].Up; + puntos[4] = Botones[ IniSecuencia + Boton ].Right; puntos[5] = Botones[ IniSecuencia + Boton ].Down; + puntos[6] = Botones[ IniSecuencia + Boton ].Right - Botones[ IniSecuencia + Boton].Ab); puntos[7] = Botones[ IniSecuencia + Boton ].Down - Botones[ IniSecuencia + Boton ].Ab; + puntos[8] = Botones[ IniSecuencia + Boton ].Right - Botones[ IniSecuencia + Boton].Ab); puntos[9] = Botones[ IniSecuencia + Boton ].Up + Botones[ IniSecuencia + Boton ].Ab; + puntos[10] = Botones[ IniSecuencia + Boton ].Left + Botones[ IniSecuencia + Boton].Ab); puntos[11] = Botones[ IniSecuencia + Boton ].Up + Botones[ IniSecuencia + Boton ].Ab; + puntos[12] = Botones[ IniSecuencia + Boton ].Left; puntos[13] = Botones[ IniSecuencia + Boton ].Up; + + setcolor( Color ); + setfillstyle( SOLID_FILL, Color ); + setlinestyle( 0, 1, NORM_WIDTH ); + fillpoly( 7, puntos ); + + puntos[0] = Botones[ IniSecuencia + Boton ].Left + Botones[ IniSecuencia + Boton].Ab; puntos[1] = Botones[ IniSecuencia + Boton ].Up + Botones[ IniSecuencia + Boton ].Ab; + puntos[2] = Botones[ IniSecuencia + Boton ].Left + Botones[ IniSecuencia + Boton].Ab; puntos[3] = Botones[ IniSecuencia + Boton ].Down - Botones[ IniSecuencia + Boton ].Ab; + puntos[4] = Botones[ IniSecuencia + Boton ].Right - Botones[ IniSecuencia + Boton].Ab; puntos[5] = Botones[ IniSecuencia + Boton ].Down - Botones[ IniSecuencia + Boton ].Ab; + puntos[6] = Botones[ IniSecuencia + Boton ].Right; puntos[7] = Botones[ IniSecuencia + Boton ].Down; + puntos[8] = Botones[ IniSecuencia + Boton ].Left; puntos[9] = Botones[ IniSecuencia + Boton ].Down; + puntos[10] = Botones[ IniSecuencia + Boton ].Left; puntos[11] = Botones[ IniSecuencia + Boton ].Up; + puntos[12] = Botones[ IniSecuencia + Boton ].Left + Botones[ IniSecuencia + Boton].Ab; puntos[13] = Botones[ IniSecuencia + Boton ].Up + Botones[ IniSecuencia + Boton ].Ab; + + setcolor( Color ); + setfillstyle( SOLID_FILL, Color ); + setlinestyle( 0, 1, NORM_WIDTH ); + fillpoly( 7, puntos ); + + // El marquito negro + if( Botones[ IniSecuencia + Boton].Ab >= 2 ) + { + setcolor( NEGRO ); + setfillstyle( EMPTY_FILL, Botones[ IniSecuencia + Boton ].Cdf ); + rectangle( Botones[ IniSecuencia + Boton ].Left, Botones[ IniSecuencia + Boton ].Up, Botones[ IniSecuencia + Boton ].Right, Botones[ IniSecuencia + Boton ].Down ); + } + + break; + + } + +} + + /**************************************************************************\ +|* *| +|* CompruebaSecuencia *| +|* *| +|* Descripcion: *| +|* Comprueba donde se pulsa el rat¢n o si se ha pulsado alguna *| +|* tecla que corresponde a los botones, para presionarlos *| +|* *| +|* *| +|* Entradas: Secuencia a comprobar *| +|* Puntero a la funcion de raton ( NULL == INTERNA ) *| +|* *| +|* /************************************************************\ *| +|* |* *|*| +|* |* UserPointer *|*| +|* |* *|*| +|* |* Descripcion: *|*| +|* |* Puntero a la funcion de control para el raton *|*| +|* |* carga en Xraton, Yraton las coordenadas de ‚l. *|*| +|* |* *|*| +|* |* Entradas: Punteros para guardar Xraton, Yraton *|*| +|* |* Salidas: B.Derech B.Izqu. *|*| +|* |* 0 0 0 *|*| +|* |* 1 1 0 *|*| +|* |* 2 0 1 *|*| +|* |* 3 1 1 *|*| +|* \************************************************************//*| +|* *| +|* Salidas: *| +|* -2 Tecla normal en buffer *| +|* -1 Tecla especial en buffer *| +|* 0 Raton fue pulsado pero no accion¢ nada *| +|* *| +|* >>0 N§ de boton pulsado (en orden de aparicion en el fichero ) *| +|* *| + \**************************************************************************/ +int MBoton::CompruebaSecuencia( int Secuencia, int (far *UserPointer)( int *Xraton, int *Yraton ) ) +{ + + char key, key2; + int i, IniSecuencia; + + int Xraton, Yraton; + + key2 = 0; + Pulso = 0; + IniSecuencia = PrincipioSecuencia(Secuencia-1); + + + + if ( + ( (UserPointer == NULL) ? EsperaTeclaRaton( &Xraton, &Yraton ) : UserPointer( &Xraton, &Yraton ) ) == 0 + ) + { + + if ( ( key = getch() ) == 0 ) key2 = getch(); + + for( i = 0; i < NBSecuencia[ Secuencia - 1 ]; i++ ) + if( toupper( key ) == Botones[ IniSecuencia + i ].Isc && key2 == Botones[ IniSecuencia + i ].Sc ) + { + DeprimeBoton( ON, Botones[ IniSecuencia + i ] ); + delay(50); + DeprimeBoton( OFF, Botones[ IniSecuencia + i ] ); + return i+1; + } + + if(key==0) + { + ungetch(key2); return (-1); + } else { + ungetch(key); return (-2); + } + + } + + XRaton = Xraton; + YRaton = Yraton; + for(i = 0; i < NBSecuencia[Secuencia-1]; i++) + if( ( Xraton >= Botones[ IniSecuencia + i ].Left ) && ( Xraton <= Botones[ IniSecuencia + i ].Right ) && + ( Yraton >= Botones[ IniSecuencia + i ].Up ) && ( Yraton <= Botones[ IniSecuencia + i ].Down ) ) + { + DeprimeBoton( ON, Botones[ IniSecuencia + i ] ); + AnclarRaton(); + DeprimeBoton( OFF, Botones[ IniSecuencia + i ] ); + + return ( i + 1 ); + } + + return (0); +} + + /**************************************************************************\ +|* *| +|* ReCompruebaSecuencia *| +|* *| +|* Descripcion: *| +|* Comprueba otra vez la secuencia dada, pero ahora solo tiene *| +|* en cuenta que el raton ya se ha pulsado. *| +|* *| +|* *| +|* Entradas: Secuencia a comprobar *| +|* *| +|* Salidas: *| +|* -2 Tecla normal en buffer *| +|* -1 Tecla especial en buffer *| +|* 0 Raton fue pulsado pero no accion¢ nada *| +|* *| +|* >>0 N§ de boton pulsado (en orden de aparicion en el fichero ) *| +|* *| + \**************************************************************************/ +int MBoton::ReComprueba_Secuencia( int Secuencia ) +{ + return CompruebaSecuencia( Secuencia, ReCmpPointer ); +} + + /**************************************************************************\ +|* *| +|* ReCmpPointer *| +|* *| +|* Descripcion: *| +|* Funci¢n que carga sus par metros con la £ltima posici¢n del *| +|* rat¢n y devuelve, que el rat¢n fue pulsado. *| +|* *| +|* Entradas: Punteros a donde guardar la pos. del raton *| +|* *| +|* Salidas: *| +|* 2 Raton pulsado ( Boton Izquierdo ) *| +|* *| + \**************************************************************************/ +int MBoton::ReCmpPointer( int *Xraton, int *Yraton ) +{ + *Xraton = XRaton; + *Yraton = YRaton; + + return 2; +} + + + /**************************************************************************\ +|* *| +|* DeprimeBoton *| +|* *| +|* Descripcion: *| +|* Deprime o Imprime el boton, segun se le indique. *| +|* *| +|* Entradas: ON/OFF, Boton a tratar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MBoton::DeprimeBoton( int DepImp, Make_Boton DepBot ) +{ + unsigned long size; + int SWAP_COLOR; + + switch ( Bot_Imp.Down ) + { + case -1: + // Deprimir ( Cambiamos los colores del borde ) + if ( DepImp == ON ) + { + SWAP_COLOR = DepBot.Cb1; + DepBot.Cb1 = DepBot.Cb2; + DepBot.Cb2 = SWAP_COLOR; + } + + ImprimeBoton( 0, DepBot ); + + break; + + default: + + // Si es Imprimir ( lo imprimo ) + if ( DepImp == OFF ) + { + if ( FBoton != NULL ) + { + putimage( DepBot.Left + DepBot.Ab + 1, DepBot.Up + DepBot.Ab + 1, FBoton, COPY_PUT ); + farfree( FBoton ); + } + ImprimeBoton( 0, DepBot ); + } else { + // Deprimir: ¨¨ Tengo memoria para deprimir WUAYYY ? + if ( ( FBoton = farmalloc( JD_imagesize( DepBot.Left + Ab + 1, DepBot.Up + Ab + 1, DepBot.Right - Ab - 1, DepBot.Down - Ab - 1 ) ) ) != NULL ) + { + ImprimeBoton( 0, DepBot ); + getimage( DepBot.Left + Ab + 1, DepBot.Up + Ab + 1, DepBot.Right - Ab - 1, DepBot.Down - Ab - 1, FBoton); + if( DepBot.Pb == 2) + { + putimage( DepBot.Left + 1, DepBot.Up+(Ab*2), FBoton, COPY_PUT); + } else { + putimage( DepBot.Left + (Ab*2), DepBot.Up+(Ab*2), FBoton, COPY_PUT); + } + } else { + + SWAP_COLOR = DepBot.Cb1; + DepBot.Cb1 = DepBot.Cb2; + DepBot.Cb2 = SWAP_COLOR; + + ImprimeBoton( 0, DepBot ); + + } + } + break; + } + +} + + + + /**************************************************************************\ +|* *| +|* Error *| +|* *| +|* Descripcion: *| +|* Carga en cError, el error lError que se pasa como parametro *| +|* *| +|* Entradas: Error a cargar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MBoton::Error( int lError ) +{ + switch ( lError ) + { + case 0: + strcpy( cError, "No hay ningun error" ); + break; + case 1: + strcpy( cError, "Error abriendo el archivo" ); + break; + + case 5: + strcpy( cError, "No hay memoria" ); + break; + } +} + + + + + +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + +// Funciones para el control del rat¢n ( SOLO -> VGA <- ) + +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + + +void AnclarRaton( void ) +{ + union REGS io; + + io.ax = 0; + int86(0x33, &io, &io); /* averigua si hay rat¢n conectado */ + if ( io.x.ax == 0 ) return; + + io.x.ax = 3; + do { + int86(0x33, &io, &io); + } while( (io.x.bx & 1)==1 || ((io.x.bx >> 1) & 1)==1); +} + + +int Espera_TeclaRaton(void) +{ + char Que; + + activa_raton(); + + union REGS io; + io.x.ax = 3; + + do{ + int86(0x33, &io, &io); // lee posici¢n y estados del bot¢n + Xraton = io.x.cx; + Yraton = io.x.dx; + } while( (io.x.bx & 1) == 0 && ((io.x.bx >> 1) & 1) == 0 && !MB_TeclaPulsada() ); + + ///////////////////////////////////////// + // RETURN Derecho Izquierdo // + // // + // 0 0 0 // + // 1 1 0 // + // 2 0 1 // + // 3 1 1 // + // // + ///////////////////////////////////////// + + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==0 ) Que = 0; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==0 ) Que = 1; + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==1 ) Que = 2; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==1 ) Que = 3; + + desactiva_raton(); + return Que; +} + + +void inicializa_raton_grafico(int x1, int y1, int x2, int y2) +{ + +int px = Xraton, py = Yraton; + + struct SREGS seg; + union REGS ent, sal; + long dir; + + ent.x.ax = 0; + int86(0x33, &ent, &sal); /* averigua si hay rat¢n conectado */ + + raton = sal.x.ax; /* indica a la variable global el estado + del raton */ + + if(raton!=0) { + + + ent.x.ax = 15; + ent.x.cx = 5; + ent.x.dx = 11; + int86(0x33, &ent, &sal); /* fija la raz¢n mickey/pixel */ + + ent.x.ax = 7; + ent.x.cx = x1; + ent.x.dx = x2; + int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. horizontal */ + + ent.x.ax = 8; + ent.x.cx = y1; + ent.x.dx = y2; + int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. vertical */ + + Carga_Puntero(); + + if( PunteroRaton != 0 ) + { + dir = (long)dir_raton; + ent.x.ax = 9; + ent.x.bx = 0; + ent.x.cx = 0; + ent.x.dx = (int) dir; + seg.es = (int) (dir >> 16); + int86x(0x33, &ent, &sal, &seg); /* asigna un cursor diferente */ + } + + ent.x.ax = 4; + ent.x.cx = px; + Xraton=ent.x.cx >> 1; + ent.x.dx = py; + Yraton=ent.x.dx; + int86(0x33, &ent, &sal); /* fija la posici¢n del rat¢n */ + + ent.x.ax = 1; + + int86(0x33, &ent, &sal); /* muestra el puntero del rat¢n */ + + desactiva_raton(); + + } +} + +void activa_raton(void) +{ + union REGS ent; + + ent.x.ax = 1; + int86(0x33, &ent, &ent); +} + +void desactiva_raton(void) +{ + union REGS ent; + + ent.x.ax = 2; + int86(0x33, &ent, &ent); +} + + + + + +void Initialize(int GraphDriver, int GraphMode) +{ + int errorcode; + +/* + if( (errorcode = registerbgifont(SMALL_FONT)) < 0 ) + ErrorOccurred(errorcode); +*/ + + /* report any registration errors */ +/* if ( (errorcode = registerbgidriver(EGAVGA_driver) ) < 0) + ErrorOccurred(errorcode); +*/ + /* initialize graphics and local variables */ + initgraph( &GraphDriver, &GraphMode, "" ); + + /* read result of initialization */ + errorcode = graphresult(); + if (errorcode != grOk) /* an error occurred */ + ErrorOccurred(errorcode); + + +} + +void ErrorOccurred(int errorcode) { + printf("Graphics error: %s\n", grapherrormsg(errorcode)); + printf("Press any key to halt:"); + getch(); + exit(1); /* terminate with an error code */ +} + + + + +/* +unsigned long JD_imagesize(int left, int top, int right, int bottom) +{ + unsigned long X_width, Y_width; + + X_width= ( (left > right) ? (left - right + 1) : ( right - left + 1) ); + Y_width= ( ( top > bottom) ? ( top - bottom + 1) : (bottom - top + 1) ); + + return (X_width * Y_width + 4); +}; +*/ + +void Carga_Puntero(void){ + + struct SREGS seg; + union REGS ent, sal; + long dir; + + switch( PunteroRaton ) { + + case 0: + break; + case 1: + dir_raton [ 0] = 0x007F; /*± ± ± ± ± ± ± ± ± 1 1 1 1 1 1 1*/ + dir_raton [ 1] = 0x00FF; /*± Û Û Û Û Û Û ± 1 1 1 1 1 1 1 1*/ + dir_raton [ 2] = 0x01FF; /*± Û Û Û Û Û ± 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 3] = 0x01FF; /*± Û Û Û Û Û ± 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 4] = 0x00FF; /*± Û Û Û Û Û Û ± 1 1 1 1 1 1 1 1*/ + dir_raton [ 5] = 0x007F; /*± Û Û ± ± Û Û Û ± 1 1 1 1 1 1 1*/ + dir_raton [ 6] = 0x18FF; /*± ± ± 1 1 ± Û ± 1 1 1 1 1 1 1 1*/ + + dir_raton [ 7] = 0x800F; /*1 ± ± ± ± ± ± ± ± ± ± ± 1 1 1 1*/ + dir_raton [ 8] = 0x8083; /*1 ± Û Û Û Û Û ± ± Û Û Û ± ± 1 1*/ + dir_raton [ 9] = 0x8001; /*1 ± ± ± ± ± Û ± ± Û ± ± Û ± ± 1*/ + dir_raton [10] = 0xF810; /*1 1 1 1 1 ± Û ± ± Û ± 1 ± Û ± 1*/ + dir_raton [11] = 0x8810; /*1 ± ± ± 1 ± Û ± ± Û ± 1 ± Û ± 1*/ + dir_raton [12] = 0x8811; /*1 ± Û ± 1 ± Û ± ± Û ± 1 ± Û ± 1*/ + dir_raton [13] = 0x8003; /*1 ± Û ± ± ± Û ± ± Û ± ± Û ± 1 1*/ + dir_raton [14] = 0x8007; /*1 ± Û Û Û Û Û ± ± Û Û Û ± 1 1 1*/ + dir_raton [15] = 0x800F; /*1 ± ± ± ± ± ± ± ± ± ± ± 1 1 1 1*/ + + dir_raton [16] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [17] = 0x7E00; /*0 Û Û Û Û Û Û 0 0 0 0 0 0 0 0 0*/ + dir_raton [18] = 0x7C00; /*0 Û Û Û Û Û 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [19] = 0x7C00; /*0 Û Û Û Û Û 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [20] = 0x7E00; /*0 Û Û Û Û Û Û 0 0 0 0 0 0 0 0 0*/ + dir_raton [21] = 0x6700; /*0 Û Û 0 0 Û Û Û 0 0 0 0 0 0 0 0*/ + dir_raton [22] = 0x0200; /*0 0 0 0 0 0 Û 0 0 0 0 0 0 0 0 0*/ + + dir_raton [23] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [24] = 0x3E70; /*0 0 Û Û Û Û Û 0 0 Û Û Û 0 0 0 0*/ + dir_raton [25] = 0x0248; /*0 0 0 0 0 0 Û 0 0 Û 0 0 Û 0 0 0*/ + dir_raton [26] = 0x0244; /*0 0 0 0 0 0 Û 0 0 Û 0 0 0 Û 0 0*/ + dir_raton [27] = 0x0242; /*0 0 0 0 0 0 Û 0 0 Û 0 0 0 Û 0 0*/ + dir_raton [28] = 0x2244; /*0 0 Û 0 0 0 Û 0 0 Û 0 0 0 Û 0 0*/ + dir_raton [29] = 0x2248; /*0 0 Û 0 0 0 Û 0 0 Û 0 0 Û 0 0 0*/ + dir_raton [30] = 0x3E70; /*0 0 Û Û Û Û Û 0 0 Û Û Û 0 0 0 0*/ + dir_raton [31] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir = (long)dir_raton; + ent.x.ax = 9; + ent.x.bx = 0; + ent.x.cx = 0; + ent.x.dx = (int) dir; + seg.es = (int) (dir >> 16); + int86x(0x33, &ent, &sal, &seg); /* asigna un cursor diferente */ + + break; + case 2: //þ 2 1 0 þ 2 1 0 þ 2 1 0 þ 2 1 0 + dir_raton [ 0] = 0xF11F; /*1 1 1 1 ± Û ± 1 ± Û ± 1 1 1 1 1*/ + dir_raton [ 1] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [ 2] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [ 3] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [ 4] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [ 5] = 0x0001; /*± ± ± ± ± Û Û ± Û Û ± ± ± ± ± 1*/ + dir_raton [ 6] = 0x0101; /*Û Û Û Û Û Û ± 1 ± Û Û Û Û Û Û 1*/ + dir_raton [ 7] = 0x0271; /*± Û Û Û Û ± 1 1 1 ± Û Û Û Û ± 1*/ + dir_raton [ 8] = 0x7773; /*1 ± ± ± ± 1 1 1 1 1 ± ± ± ± 1 1*/ + dir_raton [ 9] = 0x0271; /*± Û Û Û Û ± 1 1 1 ± Û Û Û Û ± 1*/ + dir_raton [10] = 0x0101; /*Û Û Û Û Û Û ± 1 ± Û Û Û Û Û Û 1*/ + dir_raton [11] = 0x0001; /*± ± ± ± ± Û Û ± Û Û ± ± ± ± ± 1*/ + dir_raton [12] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [13] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [14] = 0xF01F; /*1 1 1 1 ± Û Û ± Û Û ± 1 1 1 1 1*/ + dir_raton [15] = 0xF11F; /*1 1 1 1 ± Û ± 1 ± Û ± 1 1 1 1 1*/ + //þ 2 1 0 þ 2 1 0 þ 2 1 0 þ 2 1 0 + dir_raton [16] = 0x0440; /*0 0 0 0 0 Û 0 0 0 Û 0 0 0 0 0 0*/ + dir_raton [17] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [18] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [19] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [20] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [21] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [22] = 0xFC7E; /*Û Û Û Û Û Û 0 0 0 Û Û Û Û Û Û 0*/ + dir_raton [23] = 0x7C7C; /*0 Û Û Û Û 0 0 0 0 0 Û Û Û Û 0 0*/ + dir_raton [24] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [25] = 0x7C7C; /*0 Û Û Û Û 0 0 0 0 0 Û Û Û Û 0 0*/ + dir_raton [26] = 0xFC7E; /*Û Û Û Û Û Û 0 0 0 Û Û Û Û Û Û 0*/ + dir_raton [27] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [28] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [29] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [30] = 0x06C0; /*0 0 0 0 0 Û Û 0 Û Û 0 0 0 0 0 0*/ + dir_raton [31] = 0x0440; /*0 0 0 0 0 Û 0 0 0 Û 0 0 0 0 0 0*/ + dir = (long)dir_raton; + ent.x.ax = 9; + ent.x.bx = 0; + ent.x.cx = 0; + ent.x.dx = (int) dir; + seg.es = (int) (dir >> 16); + int86x(0x33, &ent, &sal, &seg); /* asigna un cursor diferente */ + + + break; + case 3: //þ 2 1 0 þ 2 1 0 þ 2 1 0 þ 2 1 0 + dir_raton [ 0] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 1] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 2] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 3] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [ 4] = 0xCFF3; /*1 1 ± ± 1 1 1 1 1 1 1 1 ± ± 1 1*/ + dir_raton [ 5] = 0xC7E3; /*1 1 ± Û ± 1 1 1 1 1 1 ± Û ± 1 1*/ + dir_raton [ 6] = 0x03C0; /*± ± ± Û Û ± 1 1 1 1 ± Û Û ± ± ±*/ + dir_raton [ 7] = 0x0180; /*± Û Û Û Û Û ± 1 1 ± Û Û Û Û Û ±*/ + dir_raton [ 8] = 0x0000; /*± Û Û Û Û Û Û ± ± Û Û Û Û Û Û ±*/ + dir_raton [ 9] = 0x0180; /*± Û Û Û Û Û ± 1 1 ± Û Û Û Û Û ±*/ + dir_raton [10] = 0x03C0; /*± ± ± Û Û ± 1 1 1 1 ± Û Û ± ± ±*/ + dir_raton [11] = 0xC7E3; /*1 1 ± Û ± 1 1 1 1 1 1 ± Û ± 1 1*/ + dir_raton [12] = 0xCFF3; /*1 1 ± ± 1 1 1 1 1 1 1 1 ± ± 1 1*/ + dir_raton [13] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [14] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + dir_raton [15] = 0xFFFF; /*1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/ + //þ 2 1 0 þ 2 1 0 þ 2 1 0 þ 2 1 0 + dir_raton [16] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [17] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [18] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [19] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [20] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [21] = 0x1008; /*0 0 0 Û 0 0 0 0 0 0 0 0 Û 0 0 0*/ + dir_raton [22] = 0x1818; /*0 0 0 Û Û 0 0 0 0 0 0 Û Û 0 0 0*/ + dir_raton [23] = 0x7C3E; /*0 Û Û Û Û Û 0 0 0 0 Û Û Û Û Û 0*/ + dir_raton [24] = 0x7E7E; /*0 Û Û Û Û Û Û 0 0 Û Û Û Û Û Û 0*/ + dir_raton [25] = 0x7C3E; /*0 Û Û Û Û Û 0 0 0 0 Û Û Û Û Û 0*/ + dir_raton [26] = 0x1818; /*0 0 0 Û Û 0 0 0 0 0 0 Û Û 0 0 0*/ + dir_raton [27] = 0x1008; /*0 0 0 Û 0 0 0 0 0 0 0 0 Û 0 0 0*/ + dir_raton [28] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [29] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [30] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir_raton [31] = 0x0000; /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/ + dir = (long)dir_raton; + ent.x.ax = 9; + ent.x.bx = 0; + ent.x.cx = 0; + ent.x.dx = (int) dir; + seg.es = (int) (dir >> 16); + int86x(0x33, &ent, &sal, &seg); /* asigna un cursor diferente */ + + + break; + }; + +}; + + + +/// int MB_TeclaPulsada(void) +/* Esta funci¢n mira si se ha pulsado una tecla pero SIN llamadas a la BIOS, + de forma que no se inhabilitan las interrupciones en cada llamada, cosa + que bajar¡a mucho la calidad de reproducci¢n con el altavoz interno. */ +/// { +/// return ( *(unsigned *) MK_FP(0x40,0x1A) != *(unsigned *) MK_FP(0x40,0x1C) ); +/// } \ No newline at end of file diff --git a/PFOUT.DBF b/PFOUT.DBF new file mode 100644 index 0000000..cee09df Binary files /dev/null and b/PFOUT.DBF differ diff --git a/PRNFILE.OUT b/PRNFILE.OUT new file mode 100644 index 0000000..7df852a --- /dev/null +++ b/PRNFILE.OUT @@ -0,0 +1,187 @@ + ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ÚÄ´ Balance Mensual: Abril 1999 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³± + ³ ³± + ³ N§ de tickets: 1.742 ³± + ³ Cambios efect: 6 ³± + ³ Inicio de caja: 09:28 ³± + ³ Fin de caja: 07:105 ³± + ³ -1:00 - -1:00 0 ³± + ³ Intentos de salir: 36 -1:00 - -1:00 0 ³± + ³ Salidas con exito: 42 -1:00 - -1:00 0 ³± + ³ -1:00 - -1:00 0 ³± + ³ -1:00 - -1:00 0 ³± + ³ -1:00 - -1:00 0 ³± + ³ +_____________ ³± + ³ Total Ventas: 641.600 ³± + ³ Total Gastos: - 620.822 ³± + ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -------------- ³± + ³ ³ Ventas desglosadas en DIAS ³ Benef. Bruto: 20.778 ³± + ³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³± + Àij ³Ù± + ³ 1: 18.575 2: 30.575 3: 32.375 4: 0 ³±± + ³ 5: 20.450 6: 20.425 7: 20.825 8: 29.900 ³±± + ³ 9: 30.950 10: 35.325 11: 0 12: 18.125 ³±± + ³ 13: 20.625 14: 22.400 15: 14.725 16: 23.450 ³±± + ³ 17: 25.775 18: 0 19: 35.350 20: 27.450 ³±± + ³ 21: 24.525 22: 29.875 23: 30.425 24: 28.150 ³±± + ³ 25: 0 26: 16.950 27: 17.025 28: 13.475 ³±± + Úij 29: 12.900 30: 40.975 31: 0 ³¿± + ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³± + ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³± + ³ ³ Compras desglosadas / DIAS ³ ³± + ³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³± + Àij ³Ù± + ³ 1: 0 2: 14.507 3: 0 4: 0 ³±± + ³ 5: 0 6: 0 7: 124.057 8: 55.055 ³±± + ³ 9: 0 10: 0 11: 58.028 12: 0 ³±± + ³ 13: 0 14: 15.068 15: 75.750 16: 9.020 ³±± + ³ 17: 0 18: 0 19: 55.330 20: 31.170 ³±± + ³ 21: 18.966 22: 14.334 23: 0 24: 0 ³±± + ³ 25: 0 26: 82.382 27: 46.500 28: 14.510 ³±± + Úij 29: 6.145 30: 0 31: 0 ³¿± + ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³± + ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³± + ³ ³ Beneficios / DIA ³ ³± + ³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³± + Àij ³Ù± + ³ 1: 18.575 2: 16.068 3: 32.375 4: 0 ³±± + ³ 5: 20.450 6: 20.425 7: -103.232 8: -25.155 ³±± + ³ 9: 30.950 10: 35.325 11: -58.028 12: 18.125 ³±± + ³ 13: 20.625 14: 7.332 15: -61.025 16: 14.430 ³±± + ³ 17: 25.775 18: 0 19: -19.980 20: -3.720 ³±± + ³ 21: 5.559 22: 15.541 23: 30.425 24: 28.150 ³±± + ³ 25: 0 26: -65.432 27: -29.475 28: -1.035 ³±± + ³ 29: 6.755 30: 40.975 31: 0 ³±± + ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ± + + -> Listado de productos vendidos: + ÚÄÄÄÂÄÄÄÄÄÄÄ¿ + C¢digo Descripci¢n Unds. Total Benef.B ³Dia³ Cant ³ + ÃÄÄÄÅÄÄÄÄÄÄÄ´ + 0 0 0 0 ³ -92 ³ 0³ + 110 CAFE 237 0 -1.800 ³ 29 ³ 18³ + 306 CORTADO DE CERVEZA 707 0 -2.100 ³ 07 ³ 57³ + 174 POLLO YQUESO 164 0 -2.025 ³ 02 ³ 16³ + 351 COPA VINO DULCE 38 0 -100 ³ 00 ³ 8³ + 217 COCACOLA LATA 230 0 -375 ³ 09 ³ 18³ + 162 BAGUETTE DE JAMON QUESO 89 0 -225 ³ 05 ³ 10³ + 658 AGUA DE SEVILLA 1 0 0 ³ 00 ³ 1³ + 710 CUBALIBRE RIVES 11 0 -650 ³ 00 ³ 2³ + 862 DECANO 8 0 -125 ³ 00 ³ 1³ + 319 Tinto peque¤o 59 0 0 ³ 00 ³ 6³ + 163 BAGUETTE YORK QUESO 5 0 0 ³ 00 ³ 1³ + 450 HANKEY BANISTER LITRO 60 0 -4.200 ³ 02 ³ 10³ + 317 TINTO DE VERANO 95 0 -600 ³ 07 ³ 19³ + 2018 FRUTO SECO 59 0 -200 ³ 22 ³ 7³ + 308 CRUZ CAMPO BOTELLIN 105 0 -800 ³ 07 ³ 16³ + 411 BALLENTINE CON REFRESCO 7 0 -850 ³ 28 ³ 2³ + 6710 cubalibre de rives 44 0 -750 ³ 26 ³ 8³ + 213 COCA-COLA (2L.) 7 0 0 ³ 23 ³ 5³ + 345 COPA DE FINO 6 0 0 ³ 00 ³ 3³ + 305 MEDIO LITRO DE CERVEZA 247 0 -3.675 ³ 29 ³ 21³ + 303 MACETA DE CERVEZA 127 0 -2.250 ³ 07 ³ 11³ + 483 PASPOR REFRESCO 2 0 0 ³ 00 ³ 2³ + 453 HANKEY BANISTER CON REFRESCO 19 0 -600 ³ 13 ³ 5³ + 310 CERVEZA SIN 19 0 0 ³ 02 ³ 3³ + 771 MACETA VODKA 1/2 1 0 0 ³ 00 ³ 1³ + 119 ZUMO 47 0 -375 ³ 08 ³ 5³ + 486 GLENDON MACETA LITRO 2 0 0 ³ 00 ³ 2³ + 2020 BOLSA DE PATATAS 28 0 0 ³ 19 ³ 7³ + 641 CUANTROL 4 0 0 ³ 00 ³ 2³ + 489 GLENDON CON REFRESCO 1 0 0 ³ 00 ³ 1³ + 490 GLENDON CHUPITO 2 0 0 ³ 00 ³ 2³ + 635 LICOR CHOCOLATE 3 0 -300 ³ 00 ³ 1³ + 315 TINTO DE VERANO LITRO 44 0 -500 ³ 09 ³ 8³ + 167 BAGUETTE TORTILLA 71 0 -600 ³ 19 ³ 12³ + 4006 CHUPITO LICOR DE GUINDA 12 0 -150 ³ 08 ³ 3³ + 316 TINTO DE VERANO MEDIO LITRO 2 0 0 ³ 00 ³ 1³ + 170 BAGUETTE DE ROQUEFOR JAMON 24 0 0 ³ 01 ³ 5³ + 135 MEDIO DESAYUNO 44 0 -400 ³ 18 ³ 6³ + 134 DESAYUNO COMPLETO 269 0 -2.475 ³ 18 ³ 23³ + 711 COPA GINEBRA RIVES 33 0 0 ³ 25 ³ 8³ + 705 COPA GINEBRA LARIOS 7 0 -750 ³ 29 ³ 6³ + 465 WHITE LABEL CON REFRESCO 27 0 -1.275 ³ 01 ³ 4³ + 464 WHITE LABEL (solo) 6 0 0 ³ 08 ³ 4³ + 704 CUBALIBRE LARIOS 1 0 0 ³ 01 ³ 1³ + 2029 BOLSA DE PATATAS G 8 0 0 ³ 01 ³ 2³ + 111 DESCAFEINADO 20 0 -100 ³ 11 ³ 4³ + 1530 Ca¤a de lomo 7 0 0 ³ 02 ³ 2³ + 1528 QUESO DE OVEJA TAPA 13 0 0 ³ 02 ³ 5³ + 171 MONTAITOS 1 0 0 ³ 01 ³ 1³ + 415 FOUR ROSE MEDIO LITRO 43 0 -1.100 ³ 02 ³ 13³ + 858 103 3 0 0 ³ 01 ³ 1³ + 173 BAGUETTE LOMO MECHADO 18 0 -500 ³ 18 ³ 5³ + 1502 TAPA DE JAMON 2 0 0 ³ 01 ³ 1³ + 733 RON CACIQUE MACETA LITRO 2 0 0 ³ 01 ³ 1³ + 409 BALLENTINE MEDIO LITRO 3 0 0 ³ 02 ³ 1³ + 715 CUBALIBRE BEFFETER 3 0 0 ³ 02 ³ 1³ + 463 WHITE LABEL MEDIO LITRO 6 0 0 ³ 09 ³ 2³ + 734 RON CACIQUE MACETA DE MEDIO 2 0 0 ³ 02 ³ 2³ + 427 YIN BEAN MEDIO LITRO 2 0 0 ³ 02 ³ 2³ + 857 CO¥AG 103 PROMOCION 35 0 -100 ³ 20 ³ 3³ + 130 MEDIA TOSTADA 60 0 -350 ³ 29 ³ 7³ + 131 MEDIA TOSTADA CON JAMON 2 0 0 ³ 04 ³ 1³ + 851 ANIS DULCE MIURA 19 0 0 ³ 20 ³ 3³ + 313 CERVEZA DAN RUBIA 28 0 -500 ³ 15 ³ 5³ + 772 CUBALIBRE DE VODKA REFRESCO 4 0 0 ³ 04 ³ 2³ + 452 HANKEY BANISTER SOLO 10 0 0 ³ 13 ³ 5³ + 6400 CERVEZA MILLER AMERICANA 4 0 0 ³ 04 ³ 3³ + 230 BITTER KAS (bot) 7 0 -150 ³ 04 ³ 2³ + 312 CERVEZA DAN NEGRA 2 0 0 ³ 05 ³ 1³ + 172 BAGUETE DE ANCHOAS 1 0 0 ³ 05 ³ 1³ + 852 ANIS SECO MIURA 1 0 0 ³ 06 ³ 1³ + 164 BAGUETTE DE PRINGA 18 0 0 ³ 12 ³ 3³ + 740 RON BACARDI MACETA DE MEDIO L. 4 0 0 ³ 09 ³ 2³ + 403 J.B. MEDIO LITRO 1 0 0 ³ 06 ³ 1³ + 333 COPA RIOJA BODEGUILLA D.J. 4 0 -125 ³ 06 ³ 1³ + 749 RON NEGRITA MEDIO LITRO 2 0 0 ³ 06 ³ 2³ + 861 TERRY 6 0 0 ³ 07 ³ 2³ + 307 CA¥A DE CERVEZA 11 0 0 ³ 08 ³ 3³ + 735 RON CACIQUE CUBALIBRE 9 0 0 ³ 13 ³ 5³ + 609 LICOR DE GUINDA 6 0 0 ³ 13 ³ 3³ + 750 ROM NEGRITA LITRO 3 0 0 ³ 08 ³ 3³ + 404 J.B. SOLO 2 0 0 ³ 08 ³ 2³ + 410 BALLENTINE SOLO 5 0 0 ³ 08 ³ 3³ + 741 CUBALIBRE RON BACARDI 14 0 0 ³ 20 ³ 5³ + 466 WHITE LABEL COPA 4 0 0 ³ 08 ³ 2³ + 762 CUBALIBRE RON HABANA 2 0 0 ³ 08 ³ 2³ + 554 MINIATURA FOUR ROSE 2 0 -250 ³ 09 ³ 1³ + 639 TEQUILA 12 0 -225 ³ 09 ³ 8³ + 344 REBUJITO 13 0 0 ³ 23 ³ 7³ + 6417 Four solo 1 0 0 ³ 09 ³ 1³ + 414 FOUR ROSE LITRO 7 0 -6.000 ³ 29 ³ 6³ + 253 AGUA MINERAL 1/2 5 0 0 ³ 11 ³ 2³ + 133 TOSTADA CON JAMON 12 0 -125 ³ 28 ³ 4³ + 3000 bolsa de hielo 4 0 0 ³ 15 ³ 2³ + 4002 CHUPITO ANIS SECO 5 0 0 ³ 15 ³ 3³ + 406 J.B. COPA 4 0 0 ³ 16 ³ 2³ + 763 Copa ron habana 1 0 0 ³ 16 ³ 1³ + 767 RON PAMPERO CUBALIBRE 1 0 0 ³ 16 ³ 1³ + 617 LICOR 43 1 0 0 ³ 16 ³ 1³ + 4007 CHUPITO J.B. 2 0 0 ³ 18 ³ 1³ + 342 COPA DE MANZANILLA 25 0 -200 ³ 18 ³ 8³ + 340 BOTELLA MEDIO MANZANILLA 62 0 0 ³ 18 ³ 18³ + 347 Maceta de rebujito 11 0 0 ³ 21 ³ 4³ + 423 100 PIPER CON REFRESCO 1 0 0 ³ 19 ³ 1³ + 859 MARTINI ROSSE 1 0 0 ³ 19 ³ 1³ + 865 PONCHE CABALLERO 5 0 -250 ³ 29 ³ 2³ + 168 BAGUETTE CHORIZO 4 0 0 ³ 19 ³ 4³ + 350 BOTELLA VINO DULCE 1 0 0 ³ 19 ³ 1³ + 343 botella manzanilla llevar 1 0 0 ³ 20 ³ 1³ + 357 COPA VINO MARQUES DE IRUN 1 0 0 ³ 21 ³ 1³ + 6463 Maceta litro whay label 2 0 -1.000 ³ 21 ³ 1³ + 739 RON BACARDI MACETA LITRO 3 0 0 ³ 22 ³ 2³ + 4003 CHUPITO DE TERRY 4 0 0 ³ 23 ³ 3³ + 132 TOSTADA CON MANTEQUILLA 4 0 0 ³ 25 ³ 3³ + 4009 CHUPITO FOUR ROSE 1 0 0 ³ 22 ³ 1³ + 551 MINIATURA YONI WALKER 2 0 0 ³ 23 ³ 2³ + 4004 CHUPITO DE 103 3 0 0 ³ 23 ³ 3³ + 792 LOTE GINEBRA RIVES 3/4 1 0 0 ³ 23 ³ 1³ + 652 LICOR DE MELOCOTON 5 0 -175 ³ 26 ³ 2³ + 645 CAIPIRI¥HA 2 0 -600 ³ 29 ³ 2³ + 4010 CHUPITO TIA MARIA 1 0 -125 ³ 29 ³ 1³ + 472 JACK DANIEL CHUPITO 1 0 -200 ³ 29 ³ 1³ + 553 MINIATURA WAY LABEL 3 0 -750 ³ 29 ³ 3³ + ÀÄÄÄÁÄÄÄÄÄÄÄÙ + \ No newline at end of file diff --git a/PROBAR.CPP b/PROBAR.CPP new file mode 100644 index 0000000..f8db5fe --- /dev/null +++ b/PROBAR.CPP @@ -0,0 +1,16 @@ +#include + + +void main(void) +{ + char Nombre2[] = "Esto es una prueba"; + //"Prueba"; + char Nombre; + + strcpy( Nombre , Nombre2 ); + char *p; p = Nombre2; + while ( *(p++) != '\0' ); while ( *(p--) != ' ' || p != Nombre2 ); *p = '\0'; + strcpy( Apellido1, p+1); + + printf( "Nombre: %s \nApellido: %s\n\n", Nombre, Apellido1 ); +} diff --git a/R.BAT b/R.BAT new file mode 100644 index 0000000..13b18a8 --- /dev/null +++ b/R.BAT @@ -0,0 +1 @@ +edit systm\tpv.img systm\tpv_mp.img *.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..9769525 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#TPV + + +*20/03/1997* + +ToDo: wwtcf? + + +![screenshot](/TPV.png "Screenshot") diff --git a/SYSTM/BOLD.CHR b/SYSTM/BOLD.CHR new file mode 100644 index 0000000..8af2bc2 Binary files /dev/null and b/SYSTM/BOLD.CHR differ diff --git a/SYSTM/EGAVGA.BGI b/SYSTM/EGAVGA.BGI new file mode 100644 index 0000000..8001631 Binary files /dev/null and b/SYSTM/EGAVGA.BGI differ diff --git a/SYSTM/LITT.CHR b/SYSTM/LITT.CHR new file mode 100644 index 0000000..08c3067 Binary files /dev/null and b/SYSTM/LITT.CHR differ diff --git a/SYSTM/TPV.BMP b/SYSTM/TPV.BMP new file mode 100644 index 0000000..61754b0 Binary files /dev/null and b/SYSTM/TPV.BMP differ diff --git a/SYSTM/TPV.IMG b/SYSTM/TPV.IMG new file mode 100644 index 0000000..910c789 --- /dev/null +++ b/SYSTM/TPV.IMG @@ -0,0 +1,2501 @@ +** +** Codigo fuente para MAKE_BOTON +** + +***************************************************************************** +* +* ATENCION !!! +* ALTERAR ESTE FICHERO, CAUSARA EL MALFUNCIONAMIENTO DEL +* PROGRAMA DE APOYO... ( ERRORES NO DOCUMENTADOS ) +* +***************************************************************************** + +#12 + + + +************************************************ Botones D: 1 +**** **** Botones S: 10 +** M¢dulo de Ventas ** +**** **** +************************************************ +!1, 9 +$ 605, 5, 635, 120, 7, 63, 56, 2, 2, 000, 000 * Impr. £ltimo ticket +$ 490, 5, 590, 30, 7, 63, 56, 2, 2, 000, 000 * Impr. Tickets +$ 490, 50, 590, 75, 7, 63, 56, 2, 2, 000, 000 * Cobro completo +$ 490, 95, 590, 120, 7, 63, 56, 2, 2, 000, 000 * Servicio en mesa +$ 420, 5, 450, 120, 7, 63, 56, 2, 2, 000, 000 * Gastos / Compras +$ 380, 5, 410, 120, 7, 63, 56, 2, 2, 000, 50 * Menu Principal + +$ 250, 5, 370, 30, 7, 63, 56, 2, 2, 43, 000 * Fichar Tickets +$ 250, 50, 370, 75, 7, 63, 56, 2, 2, 45, 000 * Anular Tickets +$ 250, 95, 370, 120, 7, 63, 56, 2, 2, 000, 000 * ... + +­10 +* Cuadro para los numeros grandes... +& 0, 0, 240, 120, 7, 63, 56, 2, 2 +& 8, 8, 232, 82, 0, 56, 63, 2, 2 +& 8, 87, 232, 112, 0, 56, 63, 2, 2 + +***** Unos cuantos botones +& 250, 5, 370, 30, 7, 63, 56, 2, 2 +| 248, 10, 2, 4, 0, 0, Fichar Ticket, +| 249, 11, 2, 4, 0, 63, Fichar Ticket, +& 250, 50, 370, 75, 7, 63, 56, 2, 2 +| 248, 55, 2, 4, 0, 0, Anular Ticket, +| 249, 56, 2, 4, 0, 63, Anular Ticket, +& 250, 95, 370, 120, 7, 63, 56, 2, 2 +| 248, 100, 2, 4, 0, 0, ..., +| 249, 101, 2, 4, 0, 63, ..., + + +& 605, 5, 635, 120, 7, 63, 56, 2, 2 +| 610, 8, 2, 4, 1, 0, Impr £ltimo Ticket, +| 611, 9, 2, 4, 1, 63, Impr £ltimo Ticket, + +& 460, 5, 485, 30, 7, 63, 56, 2, 2 +& 490, 5, 590, 30, 7, 63, 56, 2, 2 +| 488, 10, 2, 4, 0, 0, Imprimir Tickets, +| 489, 11, 2, 4, 0, 63, Imprimir Tickets, +& 460, 50, 485, 75, 7, 63, 56, 2, 2 +& 490, 50, 590, 75, 7, 63, 56, 2, 2 +| 488, 55, 2, 4, 0, 0, Cobro Completo, +| 489, 56, 2, 4, 0, 63, Cobro Completo, +& 460, 95, 485, 120, 7, 63, 56, 2, 2 +& 490, 95, 590, 120, 7, 63, 56, 2, 2 +| 488, 100, 2, 4, 0, 0, Servicio en Mesa, +| 489, 101, 2, 4, 0, 63, Servicio en Mesa, + +& 420, 5, 450, 120, 7, 63, 56, 2, 2 +| 425, 8, 2, 4, 1, 0, Compras / Gastos , +| 426, 9, 2, 4, 1, 63, Compras / Gastos , + +& 380, 5, 410, 120, 7, 63, 56, 2, 2 +| 385, 5, 2, 5, 1, 0, Men£ Principal, +| 386, 6, 2, 5, 1, 63, Men£ Principal, + | 386, 1, 2, 5, 1, 0, _ , + | 387, 2, 2, 5, 1, 63, _ , + + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 + +| 10, 132, 2, 6, 0, 63, Codigo Art. Descripcion Unds. P.V.P, +| 11, 133, 2, 6, 0, 0, Codigo Art. Descripcion Unds. P.V.P, + +& 5, 160, 125, 450, 63, 7, 56, 2, 2 +& 135, 160, 470, 450, 63, 7, 56, 2, 2 +& 480, 160, 530, 450, 63, 7, 56, 2, 2 +& 540, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: 1 +**** M¢dulo de Ventas **** Botones S: 11 +** Cobro completo ** +**** **** +************************************************ +­11 +*240 +& 110, 345, 200, 370, 7, 63, 56, 2, 2 +& 490, 345, 580, 370, 7, 63, 56, 2, 2 +| 110, 346, 2, 6, 0, 0, Aceptar, +| 111, 347, 2, 6, 0, 63, Aceptar, + +| 490, 346, 2, 6, 0, 0, Cancelar, +| 491, 347, 2, 6, 0, 63, Cancelar, + +& 585, 160, 610, 220, 7, 63, 56, 2, 2 +& 585, 210, 610, 290, 7, 63, 56, 2, 2 +& 585, 280, 610, 340, 7, 63, 56, 2, 2 +| 585, 161, 2, 6, 1, 0,<- Buscar ->, +| 586, 162, 2, 6, 1, 63,<- Buscar ->, + + +& 110, 160, 580, 340, 7, 63, 56, 2, 2 +| 120, 170, 2, 6, 0, 63, C¢d. Cliente: Cif/Nif:, +| 121, 171, 2, 6, 0, 0, C¢d. Cliente: Cif/Nif:, +& 240, 171, 350, 189, 63, 7, 56, 0, 2 +& 460, 171, 575, 189, 63, 7, 56, 0, 2 +| 120, 190, 2, 6, 0, 63, Nombre:, +| 121, 191, 2, 6, 0, 0, Nombre:, +& 240, 191, 575, 209, 63, 7, 56, 0, 2 +| 120, 210, 2, 6, 0, 63, Direcci¢n:, +| 121, 211, 2, 6, 0, 0, Direcci¢n:, +& 240, 211, 575, 229, 63, 7, 56, 0, 2 +| 120, 230, 2, 6, 0, 63, Localidad: Cod Post, +| 121, 231, 2, 6, 0, 0, Localidad: Cod Post, +& 240, 231, 420, 249, 63, 7, 56, 0, 2 +& 500, 231, 575, 249, 63, 7, 56, 0, 2 +| 120, 250, 2, 6, 0, 63, Provincia:, +| 121, 251, 2, 6, 0, 0, Provincia:, +& 240, 251, 420, 269, 63, 7, 56, 0, 2 +| 120, 290, 2, 6, 0, 63, Cod.Vendedor: Nombre:, +| 121, 291, 2, 6, 0, 0, Cod.Vendedor: Nombre:, +& 240, 291, 330, 309, 63, 7, 56, 0, 2 +& 400, 291, 575, 309, 63, 7, 56, 0, 2 +| 120, 310, 2, 6, 0, 63, Entregado a caja: devolver:, +| 121, 311, 2, 6, 0, 0, Entregado a caja: devolver:, +& 290, 311, 380, 329, 63, 7, 56, 0, 2 +& 475, 311, 575, 329, 63, 7, 56, 0, 2 + + + +************************************************ Botones D: 2 +**** **** Botones S: 20 +** M¢dulo de Referencias ** +**** **** +************************************************ +!2, 11 + +$ 400, 40, 515, 65, 7, 63, 56, 2, 2, 000, 23 +$ 520, 40, 635, 65, 7, 63, 56, 2, 2, 000, 50 +$ 400, 70, 515, 95, 7, 63, 56, 2, 2, 000, 83 +$ 520, 70, 635, 95, 7, 63, 56, 2, 2, 000, 82 +$ 400, 100, 440, 125, 7, 63, 56, 2, 2, 000, 73 +$ 445, 100, 475, 125, 7, 63, 56, 2, 2, 000, 71 +$ 480, 100, 555, 125, 7, 63, 56, 2, 2, 000, 48 +$ 560, 100, 590, 125, 7, 63, 56, 2, 2, 000, 79 +$ 595, 100, 635, 125, 7, 63, 56, 2, 2, 000, 81 +$ 400, 5, 635, 30, 7, 63, 56, 2, 2, 000, 000 +$ 505, 455, 635, 475, 63, 0, 0, 0, 000, 000 + +­20 + +& 5, 5, 30, 125, 7, 63, 56, 2, 2 +| 10, 5, 2, 5, 1, 63, Art. Asociados , +| 11, 6, 2, 5, 1, 0, Art. Asociados , + +& 35, 5, 130, 125, 63, 7, 56, 2, 2 +& 135, 5, 230, 125, 63, 7, 56, 2, 2 + +& 300, 10, 360, 30, 63, 7, 56, 2, 2 +| 241, 16, 2, 5, 0, 0, Hora 2:, +| 240, 15, 2, 5, 0, 63, Hora 2:, +& 300, 35, 360, 55, 63, 7, 56, 2, 2 +| 241, 41, 2, 5, 0, 0, Hora 3:, +| 240, 40, 2, 5, 0, 63, Hora 3:, +& 300, 60, 360, 80, 63, 7, 56, 2, 2 +| 241, 66, 2, 5, 0, 0, Hora 4:, +| 240, 65, 2, 5, 0, 63, Hora 4:, +& 300, 85, 360, 105, 63, 7, 56, 2, 2 +| 241, 91, 2, 5, 0, 0, Hora 5:, +| 240, 90, 2, 5, 0, 63, Hora 5:, + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Mantenimiento de Referencias, +| 401, 8, 2, 5, 0, 63, Mantenimiento de Referencias, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Ref., +| 401, 43, 2, 5, 0, 63, Imprimir Ref., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Ref., +| 401, 73, 2, 5, 0, 63, Eliminar Ref., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Ref., +| 519, 73, 2, 5, 0, 63, Insertar Ref., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Unds. P.C P.V.P IVA Stock, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Unds. P.C P.V.P IVA Stock, + +*& 5, 160, 100, 450, 63, 7, 56, 2, 2 +*& 105, 160, 360, 450, 63, 7, 56, 2, 2 +*& 365, 160, 405, 450, 63, 7, 56, 2, 2 +*& 410, 160, 468, 450, 63, 7, 56, 2, 2 +*& 473, 160, 531, 450, 63, 7, 56, 2, 2 + +& 5, 160, 97, 450, 63, 7, 56, 2, 2 +& 102, 160, 357, 450, 63, 7, 56, 2, 2 + +& 362, 160, 405, 450, 63, 7, 56, 2, 2 + +& 410, 160, 468, 450, 63, 7, 56, 2, 2 +& 473, 160, 531, 450, 63, 7, 56, 2, 2 + +& 536, 160, 565, 450, 63, 7, 56, 2, 2 + +& 570, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 21 +** M¢dulo asociado a Referencias ** +* * +** Parte utilizada para busquedas ** +**** **** +************************************************ + +­21 +& 260, 200, 360, 220, 63, 0, 56, 0, 2 +& 365, 200, 465, 220, 63, 0, 56, 0, 2 +& 260, 225, 465, 245, 63, 0, 56, 0, 2 + +& 235, 250, 315, 275, 63, 0, 56, 0, 2 +& 385, 250, 465, 275, 63, 0, 56, 0, 2 + +& 330, 275, 365, 300, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Art:, +| 176, 201, 2, 6, 0, 63, Cod.Art:, +| 175, 225, 2, 6, 0, 0, Nombre:, +| 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, P.C.: P.V.P.:, +| 176, 251, 2, 6, 0, 63, P.C.: P.V.P.:, +| 175, 275, 2, 6, 0, 0, COMBINADOS -> [ ], +| 176, 276, 2, 6, 0, 63, COMBINADOS -> [ ], + + + +************************************************ Botones D: 3 +**** **** Botones S: 22 +** M¢dulo asociado a Referencias ** +* * +** Muestra las posibilidades de impresi¢n ** +**** **** +************************************************ +!3, 4 + +$ 180, 200, 220, 305, 1, 56, 63, 2, 2, 000, 46 +$ 230, 200, 460, 230, 7, 56, 63, 2, 2, 000, 19 +$ 230, 235, 460, 270, 7, 56, 63, 2, 2, 000, 24 +$ 230, 275, 460, 305, 7, 56, 63, 2, 2, 000, 30 + +­22 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Impresion de Referencias, +| 175, 168, 2, 6, 0, 63, Impresion de Referencias, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Listado r pido, +| 231, 203, 2, 6, 0, 63, Listado r pido, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado completo, +| 231, 238, 2, 6, 0, 63, Listado completo, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, +& 230, 275, 460, 305, 7, 56, 63, 2, 2 +| 230, 277, 2, 6, 0, 0, C¢digos de barra, +| 231, 278, 2, 6, 0, 63, C¢digos de barra, + | 231, 278, 2, 6, 0, 0, _, + | 232, 279, 2, 6, 0, 63, _, + + +************************************************ +**** **** Botones S: 23 +** M¢dulo asociado a Referencias ** +* * +** Seccion para el Stock Actual ** +**** **** +************************************************ + +­23 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe del Stock Actual, +| 401, 8, 2, 5, 0, 63, Informe del Stock Actual, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Stock, +| 401, 43, 2, 5, 0, 63, Imprimir Stock, + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +*| 400, 72, 2, 5, 0, 0, Eliminar Ref., +*| 401, 73, 2, 5, 0, 63, Eliminar Ref., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +*| 518, 72, 2, 5, 0, 0, Insertar Ref., +*| 519, 73, 2, 5, 0, 63, Insertar Ref., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Stock Actual Valoraci¢n Beneficio, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Stock Actual Valoraci¢n Beneficio, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 452, 450, 63, 7, 56, 2, 2 +& 457, 160, 543, 450, 63, 7, 56, 2, 2 +& 548, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ +**** **** Botones S: 24 +** M¢dulo asociado a Gestion Ventas ** +* * +** Seccion para el Informe de Ventas ** +**** **** +************************************************ + +­24 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe Ventas de productos, +| 401, 8, 2, 5, 0, 63, Informe Ventas de productos, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Venta, +| 401, 43, 2, 5, 0, 63, Imprimir Venta, + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, MES, +*| 481, 103, 2, 5, 0, 63, MES, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 132, 2, 5, 0, 63, Codigo Art. Descripcion Unidades Valoraci¢n Beneficio, +| 11, 133, 2, 5, 0, 0, Codigo Art. Descripcion Unidades Valoraci¢n Beneficio, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 452, 450, 63, 7, 56, 2, 2 +& 457, 160, 543, 450, 63, 7, 56, 2, 2 +& 548, 160, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: 3 +**** **** Botones S: 25 +** M¢dulo asociado a Referencias ** +* * +** Muestra las posibilidades de ordenaci¢n ** +**** **** +************************************************ + +­25 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Ordenar Referencias por:, +| 175, 168, 2, 6, 0, 63, Ordenar Referencias por:, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, C¢digo de articulo, +| 231, 203, 2, 6, 0, 63, C¢digo de articulo, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Nombre de articulo, +| 231, 238, 2, 6, 0, 63, Nombre de articulo, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, +& 230, 275, 460, 305, 7, 56, 63, 2, 2 +| 230, 277, 2, 6, 0, 0, Stock Actual, +| 231, 278, 2, 6, 0, 63, Stock Actual, + | 231, 278, 2, 6, 0, 0, _, + | 232, 279, 2, 6, 0, 63, _, + +************************************************ Botones D: 2 +**** **** Botones S: 30 +** M¢dulo para la Gestion de los Proveedores ** +**** **** +************************************************ +­30 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gestion de Proveedores, +| 401, 8, 2, 5, 0, 63, Gestion de Proveedores, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Prov., +| 401, 43, 2, 5, 0, 63, Imprimir Prov., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Prov., +| 401, 73, 2, 5, 0, 63, Eliminar Prov., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Prov., +| 519, 73, 2, 5, 0, 63, Insertar Prov., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +| 5, 40, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 41, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 36, 150, 59, 63, 7, 56, 0, 2 +& 245, 36, 390, 59, 63, 7, 56, 0, 2 + +| 5, 65, 2, 5, 0, 0, Nombre Proveedor:, +| 6, 66, 2, 5, 0, 63, Nombre Proveedor:, +& 150, 61, 390, 84, 63, 7, 56, 0, 2 + +| 5, 90, 2, 5, 0, 0, Actividad Prov.:, +| 6, 91, 2, 5, 0, 63, Actividad Prov.:, +& 150, 86, 390, 109, 63, 7, 56, 0, 2 + + +| 5, 115, 2, 5, 0, 0, Direccion:, +| 6, 116, 2, 5, 0, 63, Direccion:, +& 90, 111, 390, 134, 63, 7, 56, 0, 2 + +| 5, 140, 2, 5, 0, 0, Localidad: Provincia:, +| 6, 141, 2, 5, 0, 63, Localidad: Provincia:, +& 90, 136, 225, 159, 63, 7, 56, 0, 2 +& 310, 136, 440, 159, 63, 7, 56, 0, 2 + +| 450, 140, 2, 5, 0, 0, C.Postal:, +| 451, 141, 2, 5, 0, 63, C.Postal:, +& 520, 136, 600, 159, 63, 7, 56, 0, 2 + + +| 5, 165, 2, 5, 0, 0, Tel‚fono:, +| 6, 166, 2, 5, 0, 63, Tel‚fono:, +& 90, 161, 247, 184, 63, 7, 56, 0, 2 +& 253, 161, 390, 184, 63, 7, 56, 0, 2 + +| 5, 190, 2, 5, 0, 0, Estrellas Notas:, +| 6, 191, 2, 5, 0, 63, Estrellas Notas:, +& 400, 161, 635, 225, 63, 7, 56, 2, 2 + +& 90, 190, 115, 215, 7, 63, 56, 2, 2 +& 120, 190, 145, 215, 7, 63, 56, 2, 2 +& 150, 190, 175, 215, 7, 63, 56, 2, 2 +& 180, 190, 205, 215, 7, 63, 56, 2, 2 +& 210, 190, 235, 215, 7, 63, 56, 2, 2 +& 240, 190, 265, 215, 7, 63, 56, 2, 2 +& 270, 190, 295, 215, 7, 63, 56, 2, 2 +& 300, 190, 325, 215, 7, 63, 56, 2, 2 + + + + +& 5, 230, 635, 255, 7, 63, 56, 2, 2 +| 5, 235, 2, 5, 0, 0, C¢digo Proveedor Tel‚fono 1 N§ de Fax, +| 6, 236, 2, 5, 0, 63, C¢digo Proveedor Tel‚fono 1 N§ de Fax, + +& 5, 260, 100, 450, 63, 7, 56, 2, 2 +& 105, 260, 360, 450, 63, 7, 56, 2, 2 +& 365, 260, 497, 450, 63, 7, 56, 2, 2 +& 503, 260, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 31 +** M¢dulo buscar asociado a Proveedores ** +* * +** Muestreo del patr¢n para busquedas ** +**** **** +************************************************ + +­31 +& 265, 200, 365, 220, 63, 0, 56, 0, 2 +& 265, 225, 465, 245, 63, 0, 56, 0, 2 +& 265, 250, 465, 275, 63, 0, 56, 0, 2 +& 265, 280, 465, 305, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, C¢digo: , + | 176, 201, 2, 6, 0, 63, C¢digo: , +| 175, 225, 2, 6, 0, 0, Nombre: , + | 176, 226, 2, 6, 0, 63, Nombre: , +| 175, 250, 2, 6, 0, 0, Direccion, + | 176, 251, 2, 6, 0, 63, Direccion, +| 175, 275, 2, 6, 0, 0, Tel‚fono:, + | 176, 276, 2, 6, 0, 63, Tel‚fono:, + + + +************************************************ Botones D: 2 +**** **** Botones S: 40 +** M¢dulo de Compras Diarias ** +**** **** +************************************************ +­40 +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gastos Diarios:, +| 401, 8, 2, 5, 0, 63, Gastos Diarios:, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Comp., +| 401, 43, 2, 5, 0, 63, Imprimir Comp., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Gasto, +| 401, 73, 2, 5, 0, 63, Eliminar Gasto, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Gasto, +| 519, 73, 2, 5, 0, 63, Insertar Gasto, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 5, 135, 2, 5, 0, 0, C¢digo Descripcion Unds. Proveedor P. Costo, +| 6, 136, 2, 5, 0, 63, C¢digo Descripcion Unds. Proveedor P. Costo, + +& 5, 160, 100, 450, 63, 7, 56, 2, 2 +& 105, 160, 360, 450, 63, 7, 56, 2, 2 +& 365, 160, 415, 450, 63, 7, 56, 2, 2 +& 420, 160, 545, 450, 63, 7, 56, 2, 2 +& 550, 160, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 41 +** M¢dulo asociado a Compras ** +* * +** Parte utilizada para busquedas ** +**** **** +************************************************ + +­41 +& 260, 200, 360, 220, 63, 0, 56, 0, 2 +& 365, 200, 465, 220, 63, 0, 56, 0, 2 +& 260, 225, 465, 245, 63, 0, 56, 0, 2 + +& 260, 250, 325, 275, 63, 0, 56, 0, 2 + +& 435, 250, 465, 273, 63, 0, 56, 0, 2 + +& 435, 277, 465, 300, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Art:, +| 176, 201, 2, 6, 0, 63, Cod.Art:, +| 175, 225, 2, 6, 0, 0, Nombre:, +| 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, C.Prov: Cual. dia, +| 176, 251, 2, 6, 0, 63, C.Prov: Cual. dia, +| 175, 275, 2, 6, 0, 0, Cual. mes, +| 176, 276, 2, 6, 0, 63, Cual. mes, + + +­42 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Impresion de Compras, +| 175, 168, 2, 6, 0, 63, Impresion de Compras, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Listado del Dia, +| 231, 203, 2, 6, 0, 63, Listado del Dia, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado Mensual, +| 231, 238, 2, 6, 0, 63, Listado Mensual, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, + +************************************************ Botones D: 4 +**** **** Botones S: 45 +** M¢dulo asociado a Compras Diarias ** +* * +** Calendario para Compras Diarias ** +**** **** +************************************************ +!4, 45 + +* 1ra Semana +$ 170, 5, 200, 25, 9, 63, 56, 2, 2, 000, 000 +$ 200, 5, 230, 25, 9, 63, 56, 2, 2, 000, 000 +$ 230, 5, 260, 25, 9, 63, 56, 2, 2, 000, 000 +$ 260, 5, 290, 25, 9, 63, 56, 2, 2, 000, 000 +$ 290, 5, 320, 25, 9, 63, 56, 2, 2, 000, 000 +$ 320, 5, 350, 25, 4, 63, 56, 2, 2, 000, 000 +$ 350, 5, 380, 25, 4, 63, 56, 2, 2, 000, 000 + +* 2da Semana +$ 170, 25, 200, 45, 9, 63, 56, 2, 2, 000, 000 +$ 200, 25, 230, 45, 9, 63, 56, 2, 2, 000, 000 +$ 230, 25, 260, 45, 9, 63, 56, 2, 2, 000, 000 +$ 260, 25, 290, 45, 9, 63, 56, 2, 2, 000, 000 +$ 290, 25, 320, 45, 9, 63, 56, 2, 2, 000, 000 +$ 320, 25, 350, 45, 4, 63, 56, 2, 2, 000, 000 +$ 350, 25, 380, 45, 4, 63, 56, 2, 2, 000, 000 + +* 3ra Semana +$ 170, 45, 200, 65, 9, 63, 56, 2, 2, 000, 000 +$ 200, 45, 230, 65, 9, 63, 56, 2, 2, 000, 000 +$ 230, 45, 260, 65, 9, 63, 56, 2, 2, 000, 000 +$ 260, 45, 290, 65, 9, 63, 56, 2, 2, 000, 000 +$ 290, 45, 320, 65, 9, 63, 56, 2, 2, 000, 000 +$ 320, 45, 350, 65, 4, 63, 56, 2, 2, 000, 000 +$ 350, 45, 380, 65, 4, 63, 56, 2, 2, 000, 000 + +* 4ta semana +$ 170, 65, 200, 85, 9, 63, 56, 2, 2, 000, 000 +$ 200, 65, 230, 85, 9, 63, 56, 2, 2, 000, 000 +$ 230, 65, 260, 85, 9, 63, 56, 2, 2, 000, 000 +$ 260, 65, 290, 85, 9, 63, 56, 2, 2, 000, 000 +$ 290, 65, 320, 85, 9, 63, 56, 2, 2, 000, 000 +$ 320, 65, 350, 85, 4, 63, 56, 2, 2, 000, 000 +$ 350, 65, 380, 85, 4, 63, 56, 2, 2, 000, 000 + +* 5ta semana +$ 170, 85, 200, 105, 9, 63, 56, 2, 2, 000, 000 +$ 200, 85, 230, 105, 9, 63, 56, 2, 2, 000, 000 +$ 230, 85, 260, 105, 9, 63, 56, 2, 2, 000, 000 +$ 260, 85, 290, 105, 9, 63, 56, 2, 2, 000, 000 +$ 290, 85, 320, 105, 9, 63, 56, 2, 2, 000, 000 +$ 320, 85, 350, 105, 4, 63, 56, 2, 2, 000, 000 +$ 350, 85, 380, 105, 4, 63, 56, 2, 2, 000, 000 + +* 6ta semana +$ 170, 105, 200, 125, 9, 63, 56, 2, 2, 000, 000 +$ 200, 105, 230, 125, 9, 63, 56, 2, 2, 000, 000 +$ 230, 105, 260, 125, 9, 63, 56, 2, 2, 000, 000 +$ 260, 105, 290, 125, 9, 63, 56, 2, 2, 000, 000 +$ 290, 105, 320, 125, 9, 63, 56, 2, 2, 000, 000 +$ 320, 105, 350, 125, 4, 63, 56, 2, 2, 000, 000 +$ 350, 105, 380, 125, 4, 63, 56, 2, 2, 000, 000 + + +* Mes Anterior +$ 145, 5, 165, 62, 7, 56, 63, 1, 2, 000, 000 + +* Mes Siguiente +$ 145, 68, 165, 125, 7, 56, 63, 1, 2, 000, 000 + +*­45 + +* Nombre del Mes +$ 120, 5, 140, 125, 7, 56, 63, 1, 2, 000, 000 + + +************************************************ Botones D: 5 +**** **** Botones S: 100 +** M¢dulo asociado a Compras ** +* * +** Cuadro desplegable para proveedores ** +**** **** +************************************************ + +!5, 6 + +*Cuadro envolvente +$ 415, 5, 550, 186, 63, 7, 56, 2, 2, 000, 000 + +* Botones ( Subir / S.R pido || B.R pido / Bajar ) +$ 555, 5, 570, 31, 7, 56, 63, 2, 1, 000, 072 +$ 555, 41, 570, 67, 7, 56, 63, 2, 1, 000, 073 + +$ 555, 72, 570, 118, 7, 56, 63, 2, 1, 000, 031 + +$ 555, 123, 570, 149, 7, 56, 63, 2, 1, 000, 081 +$ 555, 159, 570, 185, 7, 56, 63, 2, 1, 000, 080 + + + + +************************************************ Botones D: 6 +**** **** Botones S: +** Parte Utilizada por Optar ** +**** **** +************************************************ +!6, 2 + +$ 170, 320, 270, 350, 7, 63, 56, 2, 2, 000, 30 +$ 370, 320, 470, 350, 7, 63, 56, 2, 2, 000, 46 + +­100 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 + +& 170, 320, 270, 350, 7, 63, 56, 2, 2 +| 175, 325, 2, 6, 0, 63, Aceptar, +| 176, 326, 2, 6, 0, 0, Aceptar, +| 175, 327, 2, 6, 0, 63, _, +| 176, 328, 2, 6, 0, 0, _, + +& 370, 320, 470, 350, 7, 63, 56, 2, 2 +| 373, 325, 2, 6, 0, 63, Cancelar, +| 374, 326, 2, 6, 0, 0, Cancelar, +| 373, 327, 2, 6, 0, 63, _, +| 374, 328, 2, 6, 0, 0, _, + + + + +************************************************ Botones D: 2 +**** **** Botones S: 70 +** M¢dulo de Empleados ** +**** **** +************************************************ +­70 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Mantenimiento de Empleados, +| 401, 8, 2, 5, 0, 63, Mantenimiento de Empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Fich., +| 401, 43, 2, 5, 0, 63, Imprimir Fich., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Emp., +| 401, 73, 2, 5, 0, 63, Eliminar Emp., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Emp., +| 519, 73, 2, 5, 0, 63, Insertar Emp., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 95, 93, 180, 115, 63, 7, 56, 0, 2 +& 95, 123, 225, 145, 63, 7, 56, 0, 2 +& 95, 153, 225, 175, 63, 7, 56, 0, 2 + & 310, 153, 460, 175, 63, 7, 56, 0, 2 + +& 95, 183, 355, 205, 63, 7, 56, 0, 2 + & 410, 183, 460, 205, 63, 7, 56, 0, 2 + & 540, 183, 590, 205, 63, 7, 56, 0, 2 + +& 95, 213, 225, 235, 63, 7, 56, 0, 2 + & 310, 213, 460, 235, 63, 7, 56, 0, 2 + & 540, 213, 620, 235, 63, 7, 56, 0, 2 +& 95, 243, 225, 265, 63, 7, 56, 0, 2 + & 310, 243, 460, 265, 63, 7, 56, 0, 2 + +& 95, 273, 225, 295, 63, 7, 56, 0, 2 + & 360, 273, 460, 295, 63, 7, 56, 0, 2 + & 520, 273, 620, 295, 63, 7, 56, 0, 2 + + +| 10, 95, 2, 5, 0, 63, Codigo:, +| 10, 125, 2, 5, 0, 63, Nombre:, +| 10, 155, 2, 5, 0, 63, Apellido 1, + | 10, 155, 2, 5, 0, 63, Apellido 2, + +| 10, 185, 2, 5, 0, 63, Direccion: Num:, + | 10, 185, 2, 5, 0, 63, Piso:, + +| 10, 215, 2, 5, 0, 63, Poblacion:, + | 10, 215, 2, 5, 0, 63, Provincia:, + | 10, 215, 2, 5, 0, 63, C.Postal:, +| 10, 245, 2, 5, 0, 63, Tel‚fono1:, + | 10, 245, 2, 5, 0, 63, Telefono2:, + +| 10, 275, 2, 5, 0, 63, N.I.F:, + | 10, 275, 2, 5, 0, 63, Contrato. inicio:, + | 10, 275, 2, 5, 0, 63, fin:, + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 215, 450, 63, 7, 56, 2, 2 +& 220, 330, 350, 450, 63, 7, 56, 2, 2 +& 355, 330, 485, 450, 63, 7, 56, 2, 2 +& 490, 330, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ +**** **** Botones D: 2 + 7 +** M¢dulo asociado a Empleados ** Botones S: 71 +* * +** Control del acceso y passwords ** +**** **** +************************************************ + +!7, 21 + +$ 180, 24, 200, 42, 7, 63, 56, 2, 2, 000, 000 +$ 180, 44, 200, 62, 7, 63, 56, 2, 2, 000, 000 +$ 180, 64, 200, 84, 7, 63, 56, 2, 2, 000, 000 +$ 180, 104, 200, 122, 7, 63, 56, 2, 2, 000, 000 +$ 180, 124, 200, 142, 7, 63, 56, 2, 2, 000, 000 +$ 180, 164, 200, 182, 7, 63, 56, 2, 2, 000, 000 +$ 180, 184, 200, 202, 7, 63, 56, 2, 2, 000, 000 +$ 180, 204, 200, 222, 7, 63, 56, 2, 2, 000, 000 +$ 180, 244, 200, 262, 7, 63, 56, 2, 2, 000, 000 +$ 180, 264, 200, 282, 7, 63, 56, 2, 2, 000, 000 + +$ 390, 164, 410, 182, 7, 63, 56, 2, 2, 000, 000 +$ 390, 184, 410, 202, 7, 63, 56, 2, 2, 000, 000 +$ 390, 204, 410, 222, 7, 63, 56, 2, 2, 000, 000 +$ 390, 224, 410, 242, 7, 63, 56, 2, 2, 000, 000 + +$ 390, 264, 410, 282, 7, 63, 56, 2, 2, 000, 000 + +$ 600, 164, 620, 182, 7, 63, 56, 2, 2, 000, 000 +$ 600, 184, 620, 202, 7, 63, 56, 2, 2, 000, 000 +$ 600, 204, 620, 222, 7, 63, 56, 2, 2, 000, 000 +$ 600, 224, 620, 242, 7, 63, 56, 2, 2, 000, 000 +$ 600, 244, 620, 262, 7, 63, 56, 2, 2, 000, 000 +$ 600, 264, 620, 282, 7, 63, 56, 2, 2, 000, 000 + + +­71 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Control acceso de Empleados, +| 401, 8, 2, 5, 0, 63, Control acceso de Empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +*| 400, 42, 2, 5, 0, 0, Imprimir Fich., +*| 401, 43, 2, 5, 0, 63, Imprimir Fich., +* | 400, 43, 2, 5, 0, 0, _, +* | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Cambiar Clave, +| 401, 73, 2, 5, 0, 63, Cambiar Clave, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +*| 518, 72, 2, 5, 0, 0, Insertar Emp., +*| 519, 73, 2, 5, 0, 63, Insertar Emp., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +& 180, 24, 200, 42, 7, 63, 56, 2, 2 +& 180, 44, 200, 62, 7, 63, 56, 2, 2 +& 180, 64, 200, 84, 7, 63, 56, 2, 2 +& 180, 104, 200, 122, 7, 63, 56, 2, 2 +& 180, 124, 200, 142, 7, 63, 56, 2, 2 +& 180, 164, 200, 182, 7, 63, 56, 2, 2 +& 180, 184, 200, 202, 7, 63, 56, 2, 2 +& 180, 204, 200, 222, 7, 63, 56, 2, 2 +& 180, 244, 200, 262, 7, 63, 56, 2, 2 +& 180, 264, 200, 282, 7, 63, 56, 2, 2 + +& 390, 164, 410, 182, 7, 63, 56, 2, 2 +& 390, 184, 410, 202, 7, 63, 56, 2, 2 +& 390, 204, 410, 222, 7, 63, 56, 2, 2 +& 390, 224, 410, 242, 7, 63, 56, 2, 2 + +& 390, 264, 410, 282, 7, 63, 56, 2, 2 + +& 600, 164, 620, 182, 7, 63, 56, 2, 2 +& 600, 184, 620, 202, 7, 63, 56, 2, 2 +& 600, 204, 620, 222, 7, 63, 56, 2, 2 +& 600, 224, 620, 242, 7, 63, 56, 2, 2 +& 600, 244, 620, 262, 7, 63, 56, 2, 2 +& 600, 264, 620, 282, 7, 63, 56, 2, 2 + + +| 10, 5, 2, 5, 0, 63, Articulos, + | 10, 25, 2, 5, 0, 63, Referencias Art., + | 10, 45, 2, 5, 0, 63, Stock Actual, + | 10, 65, 2, 5, 0, 63, Gr ficas ventas, +| 10, 85, 2, 5, 0, 63, Proveedores, + | 10, 105, 2, 5, 0, 63, Info Proveedores, + | 10, 125, 2, 5, 0, 63, Compras Proveed., +| 10, 145, 2, 5, 0, 63, Empleados, + | 10, 165, 2, 5, 0, 63, Info Empleados, + | 10, 185, 2, 5, 0, 63, Permisos Acceso, + | 10, 205, 2, 5, 0, 63, Gr ficas ventas, +| 10, 225, 2, 5, 0, 63, Compras, + | 10, 245, 2, 5, 0, 63, Compras General, + | 10, 265, 2, 5, 0, 63, Gr ficas Compras, + + +| 210, 145, 2, 5, 0, 63, Gestion Ventas, + | 210, 165, 2, 5, 0, 63, Inicio Caja, + | 210, 185, 2, 5, 0, 63, Balance Caja, + | 210, 205, 2, 5, 0, 63, Balance Mensual, + | 210, 225, 2, 5, 0, 63, Gestion Clientes, +| 210, 245, 2, 5, 0, 63, Programas Externos, + | 210, 265, 2, 5, 0, 63, Ejecuci¢n Program., + +| 420, 145, 2, 5, 0, 63, Miscelanea, + | 420, 165, 2, 5, 0, 63, Mensajes Protector, + | 420, 185, 2, 5, 0, 63, Futura Ampliacion, + | 420, 205, 2, 5, 0, 63, Futura Ampliacion, + | 420, 225, 2, 5, 0, 63, Gestion Bases Datos, + | 420, 245, 2, 5, 0, 63, Programas Externos, + | 420, 265, 2, 5, 0, 63, Configurar Entorno, + + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Apellido 1 Apellido 2 Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 215, 450, 63, 7, 56, 2, 2 +& 220, 330, 350, 450, 63, 7, 56, 2, 2 +& 355, 330, 485, 450, 63, 7, 56, 2, 2 +& 490, 330, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 72 +** Informe Graficas de ventas por Empl ** +**** **** +************************************************ + +­72 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe venta empleados, +| 401, 8, 2, 5, 0, 63, Informe venta empleados, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Infr., +| 401, 43, 2, 5, 0, 63, Imprimir Infr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +*| 400, 102, 2, 5, 0, 0, <<, +*| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +*| 445, 102, 2, 5, 0, 0, \/, +*| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Fecha Total Fecha Total Fecha Total, +| 11, 138, 2, 5, 0, 0, Fecha Total Fecha Total Fecha Total, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 86, 160, 210, 295, 63, 7, 56, 2, 2 + +& 215, 160, 290, 295, 63, 7, 56, 2, 2 +& 296, 160, 420, 295, 63, 7, 56, 2, 2 + +& 425, 160, 500, 295, 63, 7, 56, 2, 2 +& 506, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, C¢digo Nombre y Apellidos % mes Total Anual, +| 11, 308, 2, 5, 0, 0, C¢digo Nombre y Apellidos % mes Total Anual, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 73 +** Muestra impresiones de fichas Empl ** +**** **** +************************************************ +­73 +& 170, 165, 470, 315, 7, 63, 56, 0, 2 +& 172, 167, 468, 190, 1, 56, 63, 0, 2 +| 175, 167, 2, 6, 0, 0, Imprimir Fichas Empl, +| 175, 168, 2, 6, 0, 63, Imprimir Fichas Empl, + +& 180, 200, 220, 305, 1, 56, 63, 2, 2 +| 190, 200, 2, 6, 1, 0, Cancelar , +| 191, 201, 2, 6, 1, 63, Cancelar , + | 191, 201, 2, 6, 1, 0, _ , + | 192, 202, 2, 6, 1, 63, _ , + +& 230, 200, 460, 230, 7, 56, 63, 2, 2 +| 230, 202, 2, 6, 0, 0, Ficha individual, +| 231, 203, 2, 6, 0, 63, Ficha individual, + | 231, 203, 2, 6, 0, 0, _, + | 232, 204, 2, 6, 0, 63, _, +& 230, 235, 460, 270, 7, 56, 63, 2, 2 +| 230, 237, 2, 6, 0, 0, Listado Empleados, +| 231, 238, 2, 6, 0, 63, Listado Empleados, + | 231, 238, 2, 6, 0, 0, _, + | 232, 239, 2, 6, 0, 63, _, + +************************************************ Botones D: +**** **** Botones S: 74 +** M¢dulo buscar asociado a Empleados ** +* * +** Muestreo del patr¢n para busquedas ** +**** **** +************************************************ + +­74 +& 265, 200, 365, 220, 63, 0, 56, 0, 2 +& 265, 225, 465, 245, 63, 0, 56, 0, 2 +& 265, 250, 465, 275, 63, 0, 56, 0, 2 +& 265, 280, 465, 305, 63, 0, 56, 0, 2 + +| 175, 200, 2, 6, 0, 0, Cod.Empl:, + | 176, 201, 2, 6, 0, 63, Cod.Empl:, +| 175, 225, 2, 6, 0, 0, Nombre:, + | 176, 226, 2, 6, 0, 63, Nombre:, +| 175, 250, 2, 6, 0, 0, Apellido:, + | 176, 251, 2, 6, 0, 63, Apellido:, +| 175, 275, 2, 6, 0, 0, Direccion, + | 176, 276, 2, 6, 0, 63, Direccion, + +************************************************ Botones D: 8 +**** **** Botones S: 50 +** M¢dulo para definir los mensajes ** +**** **** +************************************************ + +!8, 14 +* Cambiar Fuente +* Men£ Principal +$ 416, 40, 515, 65, 7, 63, 56, 2, 2, 000, 000 +$ 520, 40, 635, 65, 7, 63, 56, 2, 2, 000, 000 +*Indicador de desplazamiento +$ 350, 27, 380, 57, 7, 63, 56, 2, 2, 000, 000 +$ 350, 61, 380, 91, 7, 63, 56, 2, 2, 000, 000 +$ 350, 95, 380, 125, 7, 63, 56, 2, 2, 000, 000 +$ 350, 129, 380, 159, 7, 63, 56, 2, 2, 000, 000 +$ 350, 163, 380, 193, 7, 63, 56, 2, 2, 000, 000 +$ 350, 197, 380, 227, 7, 63, 56, 2, 2, 000, 000 +* Avanza / Retrocede ( Pantalla de Mensajes ) +$ 385, 27, 415, 91, 7, 63, 56, 2, 2, 000, 000 +$ 385, 95, 415, 159, 7, 63, 56, 2, 2, 000, 000 +* Colores del texto y fondo +$ 385, 163, 415, 193, 7, 63, 56, 2, 2, 000, 000 +$ 385, 197, 415, 227, 7, 63, 56, 2, 2, 000, 000 + +$ 447, 163, 477, 193, 7, 63, 56, 2, 2, 000, 000 +$ 447, 197, 477, 227, 7, 63, 56, 2, 2, 000, 000 + + +­50 + +* Monitor de muestreo +& 5, 20, 346, 235, 2, 63, 56, 2, 2 +& 10, 25, 341, 230, 0, 56, 63, 2, 2 + +& 416, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Configuraci¢n de Mensajes, +| 401, 8, 2, 5, 0, 63, Configuraci¢n de Mensajes, + +& 416, 40, 515, 65, 7, 63, 56, 2, 2 +| 416, 42, 2, 5, 0, 0, Cambiar F., +| 417, 43, 2, 5, 0, 63, Cambiar F., + | 416, 43, 2, 5, 0, 0, _, + | 417, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + + +*Indicador de desplazamiento +& 350, 27, 380, 57, 7, 63, 56, 2, 2 +& 350, 61, 380, 91, 7, 63, 56, 2, 2 +& 350, 95, 380, 125, 7, 63, 56, 2, 2 +& 350, 129, 380, 159, 7, 63, 56, 2, 2 +& 350, 163, 380, 193, 7, 63, 56, 2, 2 +& 350, 197, 380, 227, 7, 63, 56, 2, 2 + +* Avanza / Retrocede ( Pantalla de Mensajes ) +& 385, 27, 415, 91, 7, 63, 56, 2, 2 +& 385, 95, 415, 159, 7, 63, 56, 2, 2 +| 390, 27, 2, 5, 1, 0, <---- ----> , +| 391, 27, 2, 5, 1, 63, <---- ----> , + +* Colores del texto y fondo +& 385, 163, 415, 193, 7, 63, 56, 2, 2 +& 385, 197, 415, 227, 7, 63, 56, 2, 2 + & 416, 163, 446, 193, 7, 63, 56, 2, 2 + & 416, 197, 446, 227, 7, 63, 56, 2, 2 +& 447, 163, 477, 193, 7, 63, 56, 2, 2 +& 447, 197, 477, 227, 7, 63, 56, 2, 2 + +| 388, 168, 2, 5, 0, 0, <-- F -->, +| 389, 169, 2, 5, 0, 63, <-- F -->, + +| 388, 202, 2, 5, 0, 0, <-- T -->, +| 389, 203, 2, 5, 0, 63, <-- T -->, + + + +& 5, 245, 635, 270, 7, 56, 63, 2, 2 +| 5, 247, 2, 6, 0, 0, Mensaje ( 1 parte ) Mensaje ( 2 parte ) Mensaje ( 3 parte ), +| 6, 248, 2, 6, 0, 63, Mensaje ( 1 parte ) Mensaje ( 2 parte ) Mensaje ( 3 parte ), + +& 5, 275, 211, 415, 63, 56, 7, 0, 2 +& 217, 275, 423, 415, 63, 56, 7, 0, 2 +& 429, 275, 635, 415, 63, 56, 7, 0, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + + +************************************************ Botones D: 9 +**** **** Botones S: 60 +** Balance Diario ** +**** **** +************************************************ +!9, 9 + +* Botones ( Imprimir / Dia Visualizaci¢n ) +$ 455, 420, 543, 445, 7, 63, 56, 2, 2, 000, 23 +$ 548, 420, 635, 445, 7, 63, 56, 2, 2, 000, 32 + +* Boton Men£ Principal +$ 455, 450, 635, 475, 7, 63, 56, 2, 2, 000, 50 + +* Notas +$ 5, 365, 25, 475, 7, 63, 56, 2, 2, 000, 49 + +* Subir empleado +$ 600, 202, 635, 220, 7, 63, 56, 2, 2, 000, 000 +* Bajar empleado +$ 560, 202, 595, 220, 7, 63, 56, 2, 2, 000, 000 + +* Subir/Bajar Articulos vendidos +$ 200, 337, 235, 355, 7, 63, 56, 2, 2, 000, 000 +$ 160, 337, 195, 355, 7, 63, 56, 2, 2, 000, 000 + +* Visualizador de productos vendidos +$ 5, 5, 240, 45, 7, 63, 56, 2, 2, 000, 000 + + +­60 + +* Visualizador de productos vendidos +& 5, 5, 240, 45, 7, 63, 56, 2, 2 + +| 5, 7, 2, 4, 0, 0, Productos Vendidos segun hora:, +| 6, 8, 2, 4, 0, 63, Productos Vendidos segun hora:, + +| 5, 25, 2, 4, 0, 0, desde las: hasta las:, +| 6, 26, 2, 4, 0, 63, desde las: hasta las:, + +* Recuadros para introducir las horas a medir +& 80, 22, 110, 40, 63, 7, 56, 0, 2 +& 175, 22, 205, 40, 63, 7, 56, 0, 2 + +* Barra para el cuadro de articulos vendidos +& 5, 50, 240, 75, 7, 63, 56, 2, 2 +| 5, 55, 2, 4, 0, 0, Producto Unds, +| 6, 56, 2, 4, 0, 63, Producto Unds, + +* Cuadro de articulos vendidos +& 5, 75, 240, 360, 63, 7, 56, 2, 2 +* Subir/Bajar Articulos vendidos +& 200, 337, 235, 355, 7, 63, 56, 2, 2 +& 160, 337, 195, 355, 7, 63, 56, 2, 2 + +| 245, 5, 2, 5, 0, 0, N§ Tickets:, +| 246, 6, 2, 5, 0, 63, N§ Tickets:, +| 245, 20, 2, 5, 0, 0, Cambio:, +| 246, 21, 2, 5, 0, 63, Cambio:, +| 245, 35, 2, 5, 0, 0, Intentos de Salir:, +| 246, 36, 2, 5, 0, 63, Intentos de Salir:, +| 245, 50, 2, 5, 0, 0, Salidas al Men£:, +| 246, 51, 2, 5, 0, 63, Salidas al Men£:, + +| 245, 65, 2, 5, 0, 0, Inicio Caja:, +| 246, 66, 2, 5, 0, 63, Inicio Caja:, +| 245, 80, 2, 5, 0, 0, Fin Caja:, +| 246, 81, 2, 5, 0, 63, Fin Caja:, + +& 380, 6, 450, 20, 7, 0, 63, 0, 2 +& 380, 21, 450, 35, 7, 0, 63, 0, 2 +& 380, 36, 450, 50, 7, 0, 63, 0, 2 +& 380, 51, 450, 65, 7, 0, 63, 0, 2 +& 380, 66, 450, 80, 7, 0, 63, 0, 2 +& 380, 81, 450, 95, 7, 0, 63, 0, 2 + + +* Cuadro de Venta Total, Gastos y Beneficio +& 245, 100, 450, 360, 7, 63, 56, 2, 2 + +| 245, 290, 2, 5, 0, 0, Total Ventas:, +| 246, 291, 2, 5, 0, 63, Total Ventas:, +| 245, 310, 2, 5, 0, 0, Gastos:, +| 246, 311, 2, 5, 0, 63, Gastos:, + +| 245, 325, 2, 5, 0, 0, -----------, +| 246, 326, 2, 5, 0, 63, -----------, + +| 242, 335, 2, 5, 0, 0, Total Bruto:, +| 243, 336, 2, 5, 0, 63, Total Bruto:, + + +* Cuadro de Ventas por Empleado +& 455, 5, 635, 25, 7, 63, 56, 2, 2 +| 455, 7, 2, 4, 0, 0, Empleado Ventas, +| 456, 8, 2, 4, 0, 63, Empleado Ventas, +& 455, 27, 635, 200, 63, 7, 56, 2, 2 + +* Subir empleado +& 600, 202, 635, 220, 7, 63, 56, 2, 2 +* Bajar empleado +& 560, 202, 595, 220, 7, 63, 56, 2, 2 + + + +* Notas +& 5, 365, 25, 475, 7, 63, 56, 2, 2 +| 5, 365, 2, 5, 1, 0, Notas: , +| 6, 366, 2, 5, 1, 63, Notas: , + | 6, 365, 2, 5, 1, 0, _ , + | 7, 366, 2, 5, 1, 63, _ , +& 30, 365, 450, 475, 63, 7, 56, 2, 2 + + + +* Botones ( Imprimir / Dia Visualizaci¢n ) +& 455, 420, 543, 445, 7, 63, 56, 2, 2 +& 548, 420, 635, 445, 7, 63, 56, 2, 2 + +* Boton Men£ Principal +& 455, 450, 635, 475, 7, 63, 56, 2, 2 + +| 455, 422, 2, 5, 0, 0, Imprimir, +| 456, 423, 2, 5, 0, 63, Imprimir, + | 455, 423, 2, 5, 0, 0, _, + | 456, 424, 2, 5, 0, 63, _, + +| 548, 422, 2, 4, 0, 0, Cambiar Dia, +| 549, 423, 2, 4, 0, 63, Cambiar Dia, + | 548, 423, 2, 4, 0, 0, _, + | 549, 424, 2, 4, 0, 63, _, + +| 455, 452, 2, 5, 0, 0, Men£ Principal, +| 456, 453, 2, 5, 0, 63, Men£ Principal, + | 455, 453, 2, 5, 0, 0, _, + | 456, 454, 2, 5, 0, 63, _, + + + +­61 + +* Visualizador de productos vendidos +& 5, 5, 240, 45, 7, 63, 56, 2, 2 + +| 5, 7, 2, 5, 0, 0, Productos Vendidos en el Mes, +| 6, 8, 2, 5, 0, 63, Productos Vendidos en el Mes, + +*| 5, 25, 2, 4, 0, 0, desde las: hasta las:, +*| 6, 26, 2, 4, 0, 63, desde las: hasta las:, + +* Barra para el cuadro de articulos vendidos +& 5, 50, 240, 75, 7, 63, 56, 2, 2 +| 5, 55, 2, 4, 0, 0, Producto Unds, +| 6, 56, 2, 4, 0, 63, Producto Unds, + +* Cuadro de articulos vendidos +& 5, 75, 240, 360, 63, 7, 56, 2, 2 +* Subir/Bajar Articulos vendidos +& 200, 337, 235, 355, 7, 63, 56, 2, 2 +& 160, 337, 195, 355, 7, 63, 56, 2, 2 + +| 245, 5, 2, 5, 0, 0, N§ Tickets:, +| 246, 6, 2, 5, 0, 63, N§ Tickets:, +| 245, 20, 2, 5, 0, 0, Cambio:, +| 246, 21, 2, 5, 0, 63, Cambio:, +| 245, 35, 2, 5, 0, 0, Intentos de Salir:, +| 246, 36, 2, 5, 0, 63, Intentos de Salir:, +| 245, 50, 2, 5, 0, 0, Salidas al Men£:, +| 246, 51, 2, 5, 0, 63, Salidas al Men£:, + +| 245, 65, 2, 5, 0, 0, Inicio Caja:, +| 246, 66, 2, 5, 0, 63, Inicio Caja:, +| 245, 80, 2, 5, 0, 0, Fin Caja:, +| 246, 81, 2, 5, 0, 63, Fin Caja:, + + +* Cuadro de Venta Total, Gastos y Beneficio +& 245, 100, 450, 360, 7, 63, 56, 2, 2 +& 447, 225, 635, 360, 7, 63, 56, 2, 2 +& 445, 228, 455, 357, 7, 7, 7, 0, 0 + +| 245, 120, 2, 5, 0, 0, Total Ventas:, +| 246, 121, 2, 5, 0, 63, Total Ventas:, + +| 245, 140, 2, 5, 0, 0, Total Gastos:, +| 246, 141, 2, 5, 0, 63, Total Gastos:, + +| 245, 160, 2, 5, 0, 0, -.-.-.-.-.-.-.-.-.-.-.-.-, +| 246, 161, 2, 5, 0, 63, -.-.-.-.-.-.-.-.-.-.-.-.-, + +| 245, 180, 2, 5, 0, 0, Benef. Bruto:, +| 246, 181, 2, 5, 0, 63, Benef. Bruto:, + +| 245, 200, 2, 5, 0, 0, Benef. Neto:, +| 246, 201, 2, 5, 0, 63, Benef. Neto:, + +* Cuadro de Ventas por Empleado +& 455, 5, 635, 25, 7, 63, 56, 2, 2 +| 455, 7, 2, 4, 0, 0, Empleado Ventas, +| 456, 8, 2, 4, 0, 63, Empleado Ventas, +& 455, 27, 635, 200, 63, 7, 56, 2, 2 + +* Subir empleado +& 600, 202, 635, 220, 7, 63, 56, 2, 2 +* Bajar empleado +& 560, 202, 595, 220, 7, 63, 56, 2, 2 + + + +* Notas +& 5, 365, 25, 475, 7, 63, 56, 2, 2 +*| 5, 365, 2, 5, 1, 0, Notas: , +*| 6, 366, 2, 5, 1, 63, Notas: , +* | 6, 365, 2, 5, 1, 0, _ , +* | 7, 366, 2, 5, 1, 63, _ , +& 30, 365, 450, 475, 63, 7, 56, 2, 2 + + + +* Botones ( Imprimir / Dia Visualizaci¢n ) +& 455, 420, 543, 445, 7, 63, 56, 2, 2 +& 548, 420, 635, 445, 7, 63, 56, 2, 2 + +* Boton Men£ Principal +& 455, 450, 635, 475, 7, 63, 56, 2, 2 + +| 455, 422, 2, 5, 0, 0, Imprimir, +| 456, 423, 2, 5, 0, 63, Imprimir, + | 455, 423, 2, 5, 0, 0, _, + | 456, 424, 2, 5, 0, 63, _, + +| 548, 422, 2, 4, 0, 0, Cambiar Mes, +| 549, 423, 2, 4, 0, 63, Cambiar Mes, + | 548, 423, 2, 4, 0, 0, _, + | 549, 424, 2, 4, 0, 63, _, + +| 455, 452, 2, 5, 0, 0, Men£ Principal, +| 456, 453, 2, 5, 0, 63, Men£ Principal, + | 455, 453, 2, 5, 0, 0, _, + | 456, 454, 2, 5, 0, 63, _, + + + +************************************************ Botones D: +**** **** Botones S: 80 +** Informe de Compras por Proveedores ** +**** **** +************************************************ + +­80 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Compras por Proveedores, +| 401, 8, 2, 5, 0, 63, Compras por Proveedores, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Cmpr., +| 401, 43, 2, 5, 0, 63, Imprimir Cmpr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, \/, +| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Codigo Actividad Proveedor % Mes Total Anual, +| 11, 138, 2, 5, 0, 0, Codigo Actividad Proveedor % Mes Total Anual, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 85, 160, 340, 295, 63, 7, 56, 2, 2 +& 345, 160, 415, 295, 63, 7, 56, 2, 2 +& 420, 160, 525, 295, 63, 7, 56, 2, 2 +& 530, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Fecha Codigo Articulo Cantidad Costo Total, +| 11, 308, 2, 5, 0, 0, Fecha Codigo Articulo Cantidad Costo Total, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 155, 450, 63, 7, 56, 2, 2 +& 160, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +************************************************ Botones D: +**** **** Botones S: 43 +** Informe Graficas de compras ** +**** **** +************************************************ + +­43 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Informe de compras mensual, +| 401, 8, 2, 5, 0, 63, Informe de compras mensual, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Cmpr., +| 401, 43, 2, 5, 0, 63, Imprimir Cmpr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Mes <--, +| 401, 73, 2, 5, 0, 63, Mes <--, +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, --> Mes, +| 519, 73, 2, 5, 0, 63, --> Mes, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, \/, +| 446, 103, 2, 5, 0, 63, \/, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +*| 480, 102, 2, 5, 0, 0, Mes, +*| 481, 103, 2, 5, 0, 63, Mes, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + + +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 5, 130, 635, 155, 7, 63, 56, 2, 2 +| 10, 137, 2, 5, 0, 63, Fecha Total Fecha Total Fecha Total, +| 11, 138, 2, 5, 0, 0, Fecha Total Fecha Total Fecha Total, + +& 5, 160, 80, 295, 63, 7, 56, 2, 2 +& 86, 160, 210, 295, 63, 7, 56, 2, 2 + +& 215, 160, 290, 295, 63, 7, 56, 2, 2 +& 296, 160, 420, 295, 63, 7, 56, 2, 2 + +& 425, 160, 500, 295, 63, 7, 56, 2, 2 +& 506, 160, 635, 295, 63, 7, 56, 2, 2 + +& 5, 300, 635, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Fecha Codigo Articulo Cantidad Costo Total, +| 11, 308, 2, 5, 0, 0, Fecha Codigo Articulo Cantidad Costo Total, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 155, 450, 63, 7, 56, 2, 2 +& 160, 330, 415, 450, 63, 7, 56, 2, 2 +& 420, 330, 505, 450, 63, 7, 56, 2, 2 +& 510, 330, 635, 450, 63, 7, 56, 2, 2 + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + +************************************************ Botones D: 2 +**** **** Botones S: 90 +** M¢dulo para la Gestion de las Empresas ** +**** **** +************************************************ +­90 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gestion de Empresas, +| 401, 8, 2, 5, 0, 63, Gestion de Empresas, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Empr., +| 401, 43, 2, 5, 0, 63, Imprimir Empr., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Eliminar Empr., +| 401, 73, 2, 5, 0, 63, Eliminar Empr., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Insertar Empr., +| 519, 73, 2, 5, 0, 63, Insertar Empr., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +| 5, 40, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 41, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 36, 150, 59, 63, 7, 56, 0, 2 +& 245, 36, 390, 59, 63, 7, 56, 0, 2 + +| 5, 65, 2, 5, 0, 0, Empresa:, +| 6, 66, 2, 5, 0, 63, Empresa:, +& 150, 61, 390, 84, 63, 7, 56, 0, 2 + +| 5, 90, 2, 5, 0, 0, Gestor Empr.:, +| 6, 91, 2, 5, 0, 63, Gestor Empr.:, +& 150, 86, 390, 109, 63, 7, 56, 0, 2 + + +| 5, 115, 2, 5, 0, 0, Direccion:, +| 6, 116, 2, 5, 0, 63, Direccion:, +& 90, 111, 390, 134, 63, 7, 56, 0, 2 + +| 5, 140, 2, 5, 0, 0, Localidad: Provincia:, +| 6, 141, 2, 5, 0, 63, Localidad: Provincia:, +& 90, 136, 225, 159, 63, 7, 56, 0, 2 +& 310, 136, 440, 159, 63, 7, 56, 0, 2 + +| 450, 140, 2, 5, 0, 0, C.Postal:, +| 451, 141, 2, 5, 0, 63, C.Postal:, +& 520, 136, 600, 159, 63, 7, 56, 0, 2 + + +| 5, 165, 2, 5, 0, 0, Tel‚fono:, +| 6, 166, 2, 5, 0, 63, Tel‚fono:, +& 90, 161, 247, 184, 63, 7, 56, 0, 2 +& 253, 161, 390, 184, 63, 7, 56, 0, 2 + +| 5, 190, 2, 5, 0, 0, Conexion Tlf. Notas:, +| 6, 191, 2, 5, 0, 63, Conexion Tlf. Notas:, +& 400, 161, 635, 225, 63, 7, 56, 2, 2 + +*& 90, 190, 115, 215, 7, 63, 56, 2, 2 +& 120, 190, 145, 215, 7, 63, 56, 2, 2 +*& 150, 190, 175, 215, 7, 63, 56, 2, 2 +*& 180, 190, 205, 215, 7, 63, 56, 2, 2 +*& 210, 190, 235, 215, 7, 63, 56, 2, 2 +*& 240, 190, 265, 215, 7, 63, 56, 2, 2 +*& 270, 190, 295, 215, 7, 63, 56, 2, 2 +*& 300, 190, 325, 215, 7, 63, 56, 2, 2 + +& 5, 230, 635, 255, 7, 63, 56, 2, 2 +| 5, 235, 2, 5, 0, 0, C¢digo Empresa Dir IP/tlf. C¢digo de Entrada, +| 6, 236, 2, 5, 0, 63, C¢digo Empresa Dir IP/tlf. C¢digo de Entrada, + +& 5, 260, 100, 450, 63, 7, 56, 2, 2 +& 105, 260, 360, 450, 63, 7, 56, 2, 2 +& 365, 260, 497, 450, 63, 7, 56, 2, 2 +& 503, 260, 635, 450, 63, 7, 56, 2, 2 + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + +************************************************ Botones D: +**** **** Botones S: 120 +** M¢dulo para configurar el entorno ** +**** **** +************************************************ +!10, 12 + +$ 195, 430, 310, 450, 7, 63, 56, 0, 2, 000, 050 * Men£ Principal +$ 181, 275, 205, 295, 7, 63, 56, 2, 2, 000, 000 * Combinaciones +$ 213, 275, 261, 295, 7, 63, 56, 2, 2, 000, 000 * Guardar +$ 262, 275, 310, 295, 7, 63, 56, 2, 2, 000, 000 * Eliminar +$ 181, 330, 205, 350, 7, 63, 56, 2, 2, 000, 000 * Elementos +$ 181, 385, 205, 405, 7, 63, 56, 2, 2, 000, 000 * Fuentes + +$ 290, 330, 310, 350, 7, 63, 56, 2, 2, 000, 000 * Color +$ 290, 358, 310, 378, 7, 63, 56, 2, 2, 000, 000 * Fondo +$ 262, 385, 310, 405, 63, 7, 56, 2, 2, 000, 000 * Tama¤o + +$ 325, 370, 345, 450, 7, 56, 63, 0, 2, 000, 000 * Impresora +$ 325, 285, 345, 365, 7, 56, 63, 0, 2, 000, 000 * Ventas +$ 325, 200, 345, 280, 7, 56, 63, 0, 2, 000, 000 * Varios... + + +­120 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Cambiar la configuraci¢n, +| 401, 8, 2, 5, 0, 63, Cambiar la configuraci¢n, + +* Linea de separaci¢n +& 319, 5, 321, 450, 0, 63, 63, 0, 2 + + +& 5, 35, 310, 240, 0, 63, 56, 0, 2 + + +| 5, 250, 2, 5, 0, 0, Combinaciones:, +| 5, 250, 2, 5, 0, 63, Combinaciones:, +& 5, 275, 180, 295, 63, 7, 56, 2, 2 +& 181, 275, 205, 295, 7, 63, 56, 2, 2 + +& 213, 275, 261, 295, 7, 63, 56, 2, 2 +& 262, 275, 310, 295, 7, 63, 56, 2, 2 +| 217, 277, 2, 4, 0, 0, Guardar Eliminar, +| 218, 278, 2, 4, 0, 63, Guardar Eliminar, + +| 5, 305, 2, 5, 0, 0, Elementos:, +| 5, 305, 2, 5, 0, 63, Elementos:, +& 5, 330, 180, 350, 63, 7, 56, 2, 2 +& 181, 330, 205, 350, 7, 63, 56, 2, 2 + +| 5, 360, 2, 5, 0, 0, Fuentes:, +| 5, 360, 2, 5, 0, 63, Fuentes:, +& 5, 385, 180, 405, 63, 7, 56, 2, 2 +& 181, 385, 205, 405, 7, 63, 56, 2, 2 + +| 210, 332, 2, 4, 0, 0, Color:, +| 211, 333, 2, 4, 0, 63, Color:, +& 290, 330, 310, 350, 7, 63, 56, 2, 2 +| 210, 360, 2, 4, 0, 0, Fondo:, +| 211, 361, 2, 4, 0, 63, Fondo:, +& 290, 358, 310, 378, 7, 63, 56, 2, 2 +| 210, 387, 2, 4, 0, 0, Tama¤o:, +| 211, 388, 2, 4, 0, 63, Tama¤o:, +& 262, 385, 310, 405, 63, 7, 56, 2, 2 + +& 195, 430, 310, 450, 7, 63, 56, 0, 2 +| 200, 430, 2, 5, 0, 0, Men£ Principal, +| 201, 431, 2, 5, 0, 63, Men£ Principal, + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +***** Configurar Impresora +& 325, 370, 345, 450, 7, 56, 63, 0, 2 +| 327, 370, 2, 4, 1, 0, Impresora , +| 328, 371, 2, 4, 1, 63, Impresora , + +& 325, 285, 345, 365, 7, 56, 63, 0, 2 +| 327, 285, 2, 4, 1, 0, Ventas , +| 328, 286, 2, 4, 1, 63, Ventas , + +& 325, 200, 345, 280, 7, 56, 63, 0, 2 +| 327, 200, 2, 4, 1, 0, Varios... , +| 328, 201, 2, 4, 1, 63, Varios... , +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +­121 + +& 200, 40, 305, 60, 7, 63, 56, 2, 2 +| 200, 41, 2, 4, 0, 0, Mensaje de Linea, +| 201, 42, 2, 4, 0, 63, Mensaje de Linea, +& 200, 62, 252, 82, 7, 63, 56, 2, 2 +& 253, 62, 305, 82, 7, 63, 56, 2, 2 +| 198, 63, 2, 4, 0, 0, Imprimir Menu Pr, +| 199, 64, 2, 4, 0, 63, Imprimir Menu Pr, + + +| 10, 51, 2, 4, 0, 0, Campo:, +| 11, 52, 2, 4, 0, 63, Campo:, +& 50, 54, 180, 64, 63, 7, 56, 0, 2 +| 10, 63, 2, 4, 0, 0, Cmo: Tlg:, +| 11, 64, 2, 4, 0, 63, Cmo: Tlg:, +& 40, 66, 85, 76, 63, 7, 56, 0, 2 +& 120, 66, 180, 76, 63, 7, 56, 0, 2 +| 10, 75, 2, 4, 0, 0, Dircc: nn:, +| 11, 76, 2, 4, 0, 63, Dircc: nn:, +& 50, 78, 100, 88, 63, 7, 56, 0, 2 +& 140, 78, 180, 88, 63, 7, 56, 0, 2 + + +& 10, 100, 305, 115, 7, 63, 56, 0, 2 +| 10, 102, 2, 4, 0, 0, C¢digo Descripci¢n Unds. P.V.P, +| 11, 103, 2, 4, 0, 63, C¢digo Descripci¢n Unds. P.V.P, + +& 10, 117, 70, 223, 63, 7, 56, 2, 2 +& 72, 117, 216, 223, 63, 7, 56, 2, 2 +& 218, 117, 245, 223, 63, 7, 56, 2, 2 +& 247, 117, 305, 223, 63, 7, 56, 2, 2 + +* Texto se¤alado +& 14, 121, 68, 130, 3, 3, 3, 0, 2 +| 11, 120, 2, 4, 0, 0, 000124 Albaranes de compra , +| 11, 130, 2, 4, 0, 0, 000136 Aliados en el juego , +| 11, 140, 2, 4, 0, 0, 000250 Baticoco de mono , +| 11, 150, 2, 4, 0, 0, 000045 Garganta profunda , +| 8, 120, 2, 4, 0, 0, 003 1.500, +| 8, 130, 2, 4, 0, 0, 045 9.999, +| 8, 140, 2, 4, 0, 0, 009 415, +| 8, 150, 2, 4, 0, 0, 010 2.250, + + +* Linea de fondo para ayudas +& 10, 225, 259, 235, 0, 63, 56, 0, 2 +& 261, 225, 305, 235, 63, 7, 56, 0, 2 +| 10, 224, 2, 4, 0, 63, C¢digo de la descripci¢n., + +­122 +* Cuadro de di logo +*& 5, 35, 310, 240, 0, 63, 56, 0, 2 +& 60, 145, 240, 230, 7, 63, 56, 0, 2 +& 63, 148, 237, 165, 1, 56, 63, 0, 2 +| 62, 148, 2, 4, 0, 0, Cuadro de Dialogo, +| 63, 149, 2, 4, 0, 63, Cuadro de Dialogo, + +& 63, 215, 113, 227, 7, 63, 56, 0, 2 +& 187, 215, 237, 227, 7, 63, 56, 0, 2 +| 62, 214, 2, 4, 0, 0, Aceptar, +| 63, 215, 2, 4, 0, 63, Aceptar, +| 64, 214, 2, 4, 0, 0, Cancelar, +| 65, 215, 2, 4, 0, 63, Cancelar, + +***** ***** +*** Color *** +***** ***** +************************************************ Botones D: 11 +**** **** Botones S: 123 +** M¢dulo para configurar el entorno ** +**** **** +************************************************ +!11, 18 +$ 170, 320, 270, 350, 7, 63, 56, 2, 2, 000, 30 * ACEPTAR +$ 370, 320, 470, 350, 7, 63, 56, 2, 2, 000, 46 * CANCELAR + +$ 180, 205, 200, 225, 0, 56, 63, 2, 2, 000, 000 +$ 205, 205, 225, 225, 1, 56, 63, 2, 2, 000, 000 +$ 230, 205, 250, 225, 2, 56, 63, 2, 2, 000, 000 +$ 255, 205, 275, 225, 3, 56, 63, 2, 2, 000, 000 + +$ 180, 230, 200, 250, 4, 56, 63, 2, 2, 000, 000 +$ 205, 230, 225, 250, 5, 56, 63, 2, 2, 000, 000 +$ 230, 230, 250, 250, 6, 56, 63, 2, 2, 000, 000 +$ 255, 230, 275, 250, 7, 56, 63, 2, 2, 000, 000 + +$ 180, 255, 200, 275, 8, 56, 63, 2, 2, 000, 000 +$ 205, 255, 225, 275, 9, 56, 63, 2, 2, 000, 000 +$ 230, 255, 250, 275, 10, 56, 63, 2, 2, 000, 000 +$ 255, 255, 275, 275, 11, 56, 63, 2, 2, 000, 000 + +$ 180, 280, 200, 300, 12, 56, 63, 2, 2, 000, 000 +$ 205, 280, 225, 300, 13, 56, 63, 2, 2, 000, 000 +$ 230, 280, 250, 300, 14, 56, 63, 2, 2, 000, 000 +$ 255, 280, 275, 300, 15, 56, 63, 2, 2, 000, 000 + + +­123 + +& 180, 205, 200, 225, 0, 56, 63, 2, 2 +& 205, 205, 225, 225, 1, 56, 63, 2, 2 +& 230, 205, 250, 225, 2, 56, 63, 2, 2 +& 255, 205, 275, 225, 3, 56, 63, 2, 2 + +& 180, 230, 200, 250, 4, 56, 63, 2, 2 +& 205, 230, 225, 250, 5, 56, 63, 2, 2 +& 230, 230, 250, 250, 6, 56, 63, 2, 2 +& 255, 230, 275, 250, 7, 56, 63, 2, 2 + +& 180, 255, 200, 275, 8, 56, 63, 2, 2 +& 205, 255, 225, 275, 9, 56, 63, 2, 2 +& 230, 255, 250, 275, 10, 56, 63, 2, 2 +& 255, 255, 275, 275, 11, 56, 63, 2, 2 + +& 180, 280, 200, 300, 12, 56, 63, 2, 2 +& 205, 280, 225, 300, 13, 56, 63, 2, 2 +& 230, 280, 250, 300, 14, 56, 63, 2, 2 +& 255, 280, 275, 300, 15, 56, 63, 2, 2 + +& 415, 200, 420, 305, 0, 56, 63, 2, 2 +& 430, 200, 435, 305, 0, 56, 63, 2, 2 +& 445, 200, 450, 305, 0, 56, 63, 2, 2 + + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +­125 + + +***** Configurar Impresora +& 345, 35, 635, 450, 7, 56, 63, 0, 2 +& 343, 372, 347, 449, 7, 7, 7, 0, 2 + +| 370, 100, 2, 5, 0, 0, Imprimir en Archivo:, +| 371, 101, 2, 5, 0, 63, Imprimir en Archivo:, +& 540, 98, 630, 117, 63, 7, 56, 0, 0 + + +| 350, 125, 2, 5, 0, 0, Longitud de la p gina:, +| 351, 126, 2, 5, 0, 63, Longitud de la p gina:, +& 540, 123, 630, 142, 63, 7, 56, 0, 0 + + +| 350, 150, 2, 5, 0, 0, C¢digos de Impresi¢n, +| 351, 151, 2, 5, 0, 63, C¢digos de Impresi¢n, + +| 350, 175, 2, 5, 0, 0, Texto Normal:, +| 351, 176, 2, 5, 0, 63, Texto Normal:, +& 465, 175, 630, 194, 63, 7, 56, 0, 0 + +| 350, 200, 2, 5, 0, 0, T. Condensado:, +| 351, 201, 2, 5, 0, 63, T. Condensado:, +& 465, 200, 630, 219, 63, 7, 56, 0, 0 + +| 350, 230, 2, 5, 0, 0, Ticket ventas INICIO / FIN, +| 351, 231, 2, 5, 0, 63, Ticket ventas INICIO / FIN, + +& 420, 249, 630, 311, 63, 7, 56, 0, 0 +& 420, 320, 630, 382, 63, 7, 56, 0, 0 + + +­126 + +*ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß +***** Configurar Ventas +& 345, 35, 635, 450, 7, 56, 63, 0, 2 +& 343, 287, 347, 363, 7, 7, 7, 0, 2 +*& 343, 202, 347, 268, 7, 7, 7, 0, 2 + +| 350, 40, 2, 5, 0, 0, Protector de pantalla:, +| 351, 41, 2, 5, 0, 63, Protector de pantalla:, +& 540, 38, 630, 57, 63, 7, 56, 0, 0 + + +| 350, 65, 2, 5, 0, 0, Tiempo de espera:, +| 351, 66, 2, 5, 0, 63, Tiempo de espera:, +& 540, 63, 630, 82, 63, 7, 56, 0, 0 + + +| 350, 120, 2, 5, 0, 0, Hora cambio del dia:, +| 351, 121, 2, 5, 0, 63, Hora cambio del dia:, +& 540, 119, 630, 135, 63, 7, 56, 0, 0 + +| 350, 160, 2, 5, 0, 0, Franjas horarias a discriminar:, +| 351, 161, 2, 5, 0, 63, Franjas horarias a discriminar:, +& 351, 180, 380, 197, 63, 7, 56, 0, 0 +& 351, 200, 380, 217, 63, 7, 56, 0, 0 +& 351, 220, 380, 237, 63, 7, 56, 0, 0 +& 351, 240, 380, 257, 63, 7, 56, 0, 0 +& 351, 260, 380, 277, 63, 7, 56, 0, 0 +& 351, 280, 380, 297, 63, 7, 56, 0, 0 +*| 351, 181, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 201, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 221, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 241, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 261, 2, 5, 0, 63, :00 >-> 00:00, +*| 351, 281, 2, 5, 0, 63, :00 >-> 00:00, + +| 350, 305, 2, 5, 0, 0, Franjas horarias de ventas:, +| 351, 306, 2, 5, 0, 63, Franjas horarias de ventas:, +& 351, 330, 380, 347, 63, 7, 56, 0, 0 +& 351, 350, 380, 367, 63, 7, 56, 0, 0 +& 351, 370, 380, 387, 63, 7, 56, 0, 0 +& 351, 390, 380, 407, 63, 7, 56, 0, 0 +| 351, 331, 2, 5, 0, 63, [ Hora 2 ], +| 351, 351, 2, 5, 0, 63, [ Hora 3 ], +| 351, 371, 2, 5, 0, 63, [ Hora 4 ], +| 351, 391, 2, 5, 0, 63, [ Hora 5 ], + + +| 350, 425, 2, 4, 0, 0, ¨ Permitir modificar P.C en compras ?:, +| 351, 426, 2, 4, 0, 63, ¨ Permitir modificar P.C en compras ?:, +& 580, 423, 630, 442, 63, 7, 56, 0, 0 +| 351, 331, 2, 5, 0, 0, ., + + + +*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + + + + +************************************************ Botones D: +**** **** Botones S: 130 +** M¢dulo para la Gestion de Bases de Datos ** +**** **** +************************************************ + +­130 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gesti¢n de Bases de Datos, +| 401, 8, 2, 5, 0, 63, Gesti¢n de Bases de Datos, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Inf., +| 401, 43, 2, 5, 0, 63, Imprimir Inf., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Importar Clv., +| 401, 73, 2, 5, 0, 63, Importar Clv., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Exportar Clv., +| 519, 73, 2, 5, 0, 63, Exportar Clv., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, /\, +| 446, 103, 2, 5, 0, 63, /\, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Eliminar, +| 481, 103, 2, 5, 0, 63, Eliminar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, \/, +| 561, 103, 2, 5, 0, 63, \/, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Pantalla para el arbol +& 5, 5, 270, 450, 7, 56, 63, 2, 2 +& 10, 10, 265, 445, 0, 63, 56, 1, 2 + +* Ventanas de informaci¢n suplementaria +& 275, 135, 635, 290, 63, 7, 56, 2, 2 +& 275, 295, 635, 450, 63, 7, 56, 2, 2 + + + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 140 +** M¢dulo para las Fichas de los Clientes ** +**** **** +************************************************ + +­140 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Gesti¢n de Clientes, +| 401, 8, 2, 5, 0, 63, Gesti¢n de Clientes, + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Inf., +| 401, 43, 2, 5, 0, 63, Imprimir Inf., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Insertar Clt., +| 401, 73, 2, 5, 0, 63, Insertar Clt., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, Eliminar Clt., +| 519, 73, 2, 5, 0, 63, Eliminar Clt., + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Recuadro para una posible fotografia +& 315, 5, 395, 100, 0, 63, 56, 0, 2 + +| 5, 20, 2, 5, 0, 0, C¢digo: CIF / NIF:, +| 6, 21, 2, 5, 0, 63, C¢digo: CIF / NIF:, +& 65, 16, 150, 39, 63, 7, 56, 0, 2 +& 245, 16, 310, 39, 63, 7, 56, 0, 2 + +| 5, 51, 2, 5, 0, 0, Nombre:, +| 6, 52, 2, 5, 0, 63, Nombre:, +& 90, 47, 310, 70, 63, 7, 56, 0, 2 + +| 5, 76, 2, 5, 0, 0, DATOa01:, +| 6, 77, 2, 5, 0, 63, DATOa01:, +& 90, 72, 310, 95, 63, 7, 56, 0, 2 + + +| 5, 101, 2, 5, 0, 0, Direccion:, +| 6, 102, 2, 5, 0, 63, Direccion:, +& 90, 97, 310, 120, 63, 7, 56, 0, 2 + + +| 5, 126, 2, 5, 0, 0, Localidad:, +| 6, 127, 2, 5, 0, 63, Localidad:, +& 90, 122, 225, 145, 63, 7, 56, 0, 2 + +| 5, 150, 2, 5, 0, 0, Provincia: Cod. Post:, +| 6, 151, 2, 5, 0, 63, Provincia: Cod. Post:, +& 90, 147, 225, 170, 63, 7, 56, 0, 2 +& 310, 147, 395, 170, 63, 7, 56, 0, 2 + +| 5, 175, 2, 5, 0, 0, Tel‚fono:, +| 6, 176, 2, 5, 0, 63, Tel‚fono:, +& 90, 172, 240, 195, 63, 7, 56, 0, 2 +& 245, 172, 395, 195, 63, 7, 56, 0, 2 + +| 5, 200, 2, 5, 0, 0, DATOa02:, +| 6, 201, 2, 5, 0, 63, DATOa02:, +& 90, 197, 195, 220, 63, 7, 56, 0, 2 + +| 5, 225, 2, 5, 0, 0, DATOa03:, +| 6, 226, 2, 5, 0, 63, DATOa03:, +& 90, 222, 195, 245, 63, 7, 56, 0, 2 + +| 5, 250, 2, 5, 0, 0, DATOa04:, +| 6, 251, 2, 5, 0, 63, DATOa04:, +& 90, 247, 195, 270, 63, 7, 56, 0, 2 + +| 5, 275, 2, 5, 0, 0, DATOa05:, +| 6, 276, 2, 5, 0, 63, DATOa05:, +& 90, 272, 195, 295, 63, 7, 56, 0, 2 + + + +* Cuadro para el comentario +| 201, 194, 2, 5, 0, 0, Notas:, +| 200, 195, 2, 5, 0, 63, Notas:, +& 200, 210, 395, 295, 7, 63, 56, 2, 2 +& 202, 212, 393, 293, 63, 56, 7, 2, 2 + + +& 5, 300, 453, 325, 7, 63, 56, 2, 2 +| 10, 307, 2, 5, 0, 63, Codigo Nombre Tel‚fono, +| 11, 308, 2, 5, 0, 0, Codigo Nombre Tel‚fono, + +& 5, 330, 80, 450, 63, 7, 56, 2, 2 +& 85, 330, 350, 450, 63, 7, 56, 2, 2 +& 350, 330, 453, 450, 63, 7, 56, 2, 2 + +* Muestreo de compras realizadas +& 455, 140, 635, 155, 7, 56, 63, 2, 2 +| 455, 141, 2, 4, 0, 63, Concepto Unds, +| 456, 142, 2, 4, 0, 0, Concepto Unds, + +& 455, 160, 635, 450, 63, 7, 56, 2, 2 + +* Elecci¢n de dias disponibles +& 400, 140, 453, 295, 63, 7, 56, 2, 2 +| 400, 154, 2, 4, 0, 0, 00-00-00, + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + +************************************************ Botones D: +**** **** Botones S: 160 +** M¢dulo para Datos de interes: Clientes ** +**** **** +************************************************ + +­160 + +& 400, 5, 635, 30, 7, 63, 56, 2, 2 +| 400, 7, 2, 5, 0, 0, Datos de Interes: Clientes: +| 401, 8, 2, 5, 0, 63, Datos de Interes: Clientes: + +& 400, 40, 515, 65, 7, 63, 56, 2, 2 +| 400, 42, 2, 5, 0, 0, Imprimir Dat., +| 401, 43, 2, 5, 0, 63, Imprimir Dat., + | 400, 43, 2, 5, 0, 0, _, + | 401, 44, 2, 5, 0, 63, _, + +& 520, 40, 635, 65, 7, 63, 56, 2, 2 +| 518, 42, 2, 5, 0, 0, Men£ Principal, +| 519, 43, 2, 5, 0, 63, Men£ Principal, + | 518, 43, 2, 5, 0, 0, _, + | 519, 44, 2, 5, 0, 63, _, + +& 400, 70, 515, 95, 7, 63, 56, 2, 2 +| 400, 72, 2, 5, 0, 0, Reordena Clt., +| 401, 73, 2, 5, 0, 63, Reordena Clt., +& 520, 70, 635, 95, 7, 63, 56, 2, 2 +| 518, 72, 2, 5, 0, 0, -------------, +| 519, 73, 2, 5, 0, 63, -------------, + +& 400, 100, 440, 125, 7, 63, 56, 2, 2 +| 400, 102, 2, 5, 0, 0, <<, +| 401, 103, 2, 5, 0, 63, <<, +& 445, 100, 475, 125, 7, 63, 56, 2, 2 +| 445, 102, 2, 5, 0, 0, <-, +| 446, 103, 2, 5, 0, 63, <-, + +& 480, 100, 555, 125, 7, 63, 56, 2, 2 +| 480, 102, 2, 5, 0, 0, Buscar, +| 481, 103, 2, 5, 0, 63, Buscar, + +& 560, 100, 590, 125, 7, 63, 56, 2, 2 +| 560, 102, 2, 5, 0, 0, ->, +| 561, 103, 2, 5, 0, 63, ->, +& 595, 100, 635, 125, 7, 63, 56, 2, 2 +| 595, 102, 2, 5, 0, 0, >>, +| 596, 103, 2, 5, 0, 63, >>, + +* Cuadro de gr ficas +& 5, 5, 395, 125, 63, 7, 56, 2, 2 + +& 355, 130, 635, 155, 7, 63, 56, 2, 2 +| 355, 134, 2, 5, 0, 63, Total Mes éltima Cmp. Pedidos Mes, +| 356, 135, 2, 5, 0, 0, Total Mes éltima Cmp. Pedidos Mes, + +& 5, 160, 350, 450, 63, 7, 56, 2, 2 + +& 355, 160, 445, 450, 63, 7, 56, 2, 2 +& 450, 160, 575, 450, 63, 7, 56, 2, 2 +& 580, 160, 635, 450, 63, 7, 56, 2, 2 + +| 10, 165, 2, 5, 0, 0, 00000001 Juan Kronoso Pontes, +| 10, 185, 2, 5, 0, 0, 00000002 Grijander Proe Topo, +| 10, 205, 2, 5, 0, 0, 00000003 Jos‚ Marker Inkit, +| 10, 225, 2, 5, 0, 0, 00000004 Kromot Hijtu Vimto, +| 356, 165, 2, 5, 0, 0, 56.950 12-07 4.500 23, +| 356, 185, 2, 5, 0, 0, 35.200 03-06 10.550 7, +| 356, 205, 2, 5, 0, 0, 3.800 24-06 2.400 3, +| 356, 225, 2, 5, 0, 0, 1.345 12-07 1.345 1, + + + +* Linea de fondo para ayudas +& 5, 455, 500, 475, 0, 63, 56, 0, 2 +& 505, 455, 635, 475, 63, 0, 0, 0, 2 + + + + +************************************************ Botones D: +**** **** Botones S: 500 +** Confirmaci¢n de salto al inicio ** +**** **** +************************************************ + +­500 +| 180, 195, 2, 5, 0, 63, Modo salto a Ventas Diarias: Activado, +| 181, 196, 2, 5, 0, 0, Modo salto a Ventas Diarias: Activado, + +| 180, 210, 2, 5, 0, 63, Para evitar el salto. introduzca su, +| 181, 211, 2, 5, 0, 0, Para evitar el salto. introduzca su, + +| 180, 225, 2, 5, 0, 63, login y password., +| 181, 226, 2, 5, 0, 0, login y password., + +| 180, 270, 2, 5, 0, 63, Toda entrada incorrecta, +| 181, 271, 2, 5, 0, 0, Toda entrada incorrecta, +| 180, 285, 2, 5, 0, 63, quedar  registrada!, +| 181, 286, 2, 5, 0, 0, quedar  registrada!, + + +| 410, 247, 2, 4, 0, 63, Tiempo R.:, +| 411, 248, 2, 4, 0, 0, Tiempo R.:, +& 410, 260, 465, 310, 0, 63, 56, 0, 2 + + + +************************************************ Botones D: 1 +**** M¢dulo de Ventas **** Botones S: 11 +** Cobro completo ** +**** **** +************************************************ +!12, 5 +$ 110, 345, 200, 370, 7, 63, 56, 2, 2, 000, 30 * ACEPTAR +$ 490, 345, 580, 370, 7, 63, 56, 2, 2, 000, 46 * CANCELAR + +$ 585, 160, 610, 220, 7, 63, 56, 2, 2, 000, 000 * Busqueda atras +$ 585, 220, 610, 280, 7, 63, 56, 2, 2, 000, 48 * Buscar +$ 585, 280, 610, 340, 7, 63, 56, 2, 2, 000, 000 * Busqueda adelante diff --git a/SYSTM/TPV.PCX b/SYSTM/TPV.PCX new file mode 100644 index 0000000..94205e3 Binary files /dev/null and b/SYSTM/TPV.PCX differ diff --git a/SYSTM/TPV_BAK.PCX b/SYSTM/TPV_BAK.PCX new file mode 100644 index 0000000..4ea5ae7 Binary files /dev/null and b/SYSTM/TPV_BAK.PCX differ diff --git a/SYSTM/TPV_MP.IMG b/SYSTM/TPV_MP.IMG new file mode 100644 index 0000000..2d7b8fc --- /dev/null +++ b/SYSTM/TPV_MP.IMG @@ -0,0 +1,305 @@ +#9 + +************************************************ Botones D: 1 +**** **** Botones S: 90 +** Men£ Principal ** +**** **** +************************************************ +!1, 11 + +$ 420, 160, 620, 190, 7, 63, 56, 2, 2, 000, 30 +$ 420, 200, 620, 230, 7, 63, 56, 2, 2, 000, 25 +$ 420, 240, 620, 270, 7, 63, 56, 2, 2, 000, 18 +$ 420, 280, 620, 310, 7, 63, 56, 2, 2, 000, 46 +$ 420, 320, 620, 350, 7, 63, 56, 2, 2, 000, 34 +$ 420, 360, 620, 390, 7, 63, 56, 2, 2, 000, 19 +$ 420, 400, 620, 430, 7, 63, 56, 2, 2, 000, 50 +$ 420, 440, 620, 470, 7, 63, 56, 2, 2, 000, 31 + +$ 110, 283, 297, 312, 0, 56, 63, 2, 2, 000, 000 +$ 20, 280, 300, 315, 7, 63, 56, 2, 2, 000, 000 + +$ 25, 325, 295, 465, 0, 56, 63, 2, 2, 000, 000 + + + + +­90 +| 420, 100, 10, 1, 0, 56, Men£ Principal, +| 421, 101, 10, 1, 0, 56, Men£ Principal, +| 422, 102, 10, 1, 0, 63, Men£ Principal, +*| 420, 100, 2, 8, 0, 56, Men£ Principal, +*| 421, 101, 2, 8, 0, 56, Men£ Principal, +*| 422, 102, 2, 8, 0, 63, Men£ Principal, + + +& 420, 160, 620, 190, 7, 63, 56, 2, 2 +& 420, 200, 620, 230, 7, 63, 56, 2, 2 +& 420, 240, 620, 270, 7, 63, 56, 2, 2 +& 420, 280, 620, 310, 7, 63, 56, 2, 2 +& 420, 320, 620, 350, 7, 63, 56, 2, 2 +& 420, 360, 620, 390, 7, 63, 56, 2, 2 +& 420, 400, 620, 430, 7, 63, 56, 2, 2 +& 420, 440, 620, 470, 7, 63, 56, 2, 2 + +& 20, 280, 300, 315, 7, 63, 56, 2, 2 +& 110, 283, 297, 312, 0, 56, 63, 2, 2 +| 20, 285, 2, 6, 0, 63, Empresa:, +| 21, 286, 2, 6, 0, 0, Empresa:, + +& 20, 320, 300, 470, 7, 63, 56, 2, 2 +& 25, 325, 295, 465, 0, 56, 63, 2, 2 + +*| 40, 340, 2, 6, 0, 63, Todas las opciones, +*| 40, 360, 2, 6, 0, 63, han sido desactivadas, + +*| 40, 390, 2, 6, 0, 63, C¢digo de acceso RECHAZADO, + + + +* SubMenu Dedicado a Articulo + * Ref. Articulos + * Stock Actual + * Graficas Ventas + +************************************************ Botones D: 2 +**** **** Botones S: 91 +** Articulos ** +**** **** +************************************************ +!2, 3 + $ 220, 85, 410, 115, 7, 63, 56, 2, 2, 000, 000 + $ 220, 120, 410, 150, 7, 63, 56, 2, 2, 000, 000 + $ 220, 155, 410, 185, 7, 63, 56, 2, 2, 000, 000 + +­91 +& 215, 80, 415, 190, 7, 56, 63, -2, 2 + & 220, 85, 410, 115, 7, 63, 56, 2, 2 + | 220, 88, 2, 6, 0, 0, Ref. Articulos, + | 221, 89, 2, 6, 0, 63, Ref. Articulos, + & 220, 120, 410, 150, 7, 63, 56, 2, 2 + | 220, 123, 2, 6, 0, 0, Stock Actual, + | 221, 124, 2, 6, 0, 63, Stock Actual, + & 220, 155, 410, 185, 7, 63, 56, 2, 2 + | 220, 158, 2, 6, 0, 0, Graficas Ventas, + | 221, 159, 2, 6, 0, 63, Graficas Ventas, + + +************************************************ Botones D: 3 +**** **** Botones S: 92 +** Proveedores ** +**** **** +************************************************ +!3, 2 + + $ 220, 160, 410, 190, 7, 63, 56, 2, 2, 000, 000 + $ 220, 195, 410, 225, 7, 63, 56, 2, 2, 000, 000 + +­92 +& 215, 155, 415, 230, 7, 56, 63, -2, 2 + & 220, 160, 410, 190, 7, 63, 56, 2, 2 + | 220, 163, 2, 6, 0, 0, Info Proveedores, + | 221, 164, 2, 6, 0, 63, Info Proveedores, + & 220, 195, 410, 225, 7, 63, 56, 2, 2 + | 220, 198, 2, 6, 0, 0, Compras Proveedor, + | 221, 199, 2, 6, 0, 63, Compras Proveedor, + +************************************************ Botones D: 4 +**** **** Botones S: 93 +** Compras ** +**** **** +************************************************ +!4, 2 + $ 220, 240, 410, 270, 7, 63, 56, 2, 2, 000, 000 + $ 220, 275, 410, 305, 7, 63, 56, 2, 2, 000, 000 + + +­93 +& 215, 235, 415, 310, 7, 56, 63, -2, 2 + & 220, 240, 410, 270, 7, 63, 56, 2, 2 + | 220, 243, 2, 6, 0, 0, Compras General, + | 221, 244, 2, 6, 0, 63, Compras General, + & 220, 275, 410, 305, 7, 63, 56, 2, 2 + | 220, 278, 2, 6, 0, 0, Graficas Compras, + | 221, 279, 2, 6, 0, 63, Graficas Compras, + +************************************************ Botones D: 5 +**** **** Botones S: 94 +** Ventas ** +**** **** +************************************************ +!5, 4 + $ 220, 210, 410, 240, 7, 63, 56, 2, 2, 000, 000 + $ 220, 245, 410, 275, 7, 63, 56, 2, 2, 000, 000 + $ 220, 280, 410, 310, 7, 63, 56, 2, 2, 000, 000 + $ 220, 315, 410, 345, 7, 63, 56, 2, 2, 000, 000 + + +­94 +& 215, 205, 415, 350, 7, 56, 63, -2, 2 + & 220, 210, 410, 240, 7, 63, 56, 2, 2 + | 220, 213, 2, 6, 0, 0, Inicio Caja, + | 221, 214, 2, 6, 0, 63, Inicio Caja, + & 220, 245, 410, 275, 7, 63, 56, 2, 2 + | 220, 248, 2, 6, 0, 0, Balance Caja, + | 221, 249, 2, 6, 0, 63, Balance Caja, + & 220, 280, 410, 310, 7, 63, 56, 2, 2 + | 220, 283, 2, 6, 0, 0, Balance Mensual, + | 221, 284, 2, 6, 0, 63, Balance Mensual, + & 220, 315, 410, 345, 7, 63, 56, 2, 2 + | 220, 318, 2, 6, 0, 0, Gestion Clientes, + | 221, 319, 2, 6, 0, 63, Gestion Clientes, + + + +************************************************ Botones D: 6 +**** **** Botones S: 95 +** Empleados ** +**** **** +************************************************ +!6, 3 + $ 220, 165, 410, 195, 7, 63, 56, 2, 2, 000, 000 + $ 220, 200, 410, 230, 7, 63, 56, 2, 2, 000, 000 + $ 220, 235, 410, 265, 7, 63, 56, 2, 2, 000, 000 + + + + +­95 +& 215, 160, 415, 270, 7, 56, 63, -2, 2 + & 220, 165, 410, 195, 7, 63, 56, 2, 2 + | 220, 168, 2, 6, 0, 0, Info Empleados, + | 221, 169, 2, 6, 0, 63, Info Empleados, + & 220, 200, 410, 230, 7, 63, 56, 2, 2 + | 220, 203, 2, 6, 0, 0, Permisos Acceso, + | 221, 204, 2, 6, 0, 63, Permisos Acceso, + & 220, 235, 410, 265, 7, 63, 56, 2, 2 + | 220, 238, 2, 6, 0, 0, Graficas Ventas, + | 221, 239, 2, 6, 0, 63, Graficas Ventas, + + +************************************************ Botones D: 7 +**** **** Botones S: 96 +** Miscelanea ** +**** **** +************************************************ +!7, 6 + +$ 220, 220, 410, 250, 7, 63, 56, 2, 2, 000, 000 +$ 220, 255, 410, 285, 7, 63, 56, 2, 2, 000, 000 +$ 220, 290, 410, 320, 7, 63, 56, 2, 2, 000, 000 +$ 220, 325, 410, 355, 7, 63, 56, 2, 2, 000, 000 +$ 220, 360, 410, 390, 7, 63, 56, 2, 2, 000, 000 +$ 220, 395, 410, 425, 7, 63, 56, 2, 2, 000, 000 + + +­96 + +& 215, 215, 415, 430, 7, 56, 63, -2, 2 + & 220, 220, 410, 250, 7, 63, 56, 2, 2 + | 220, 223, 2, 6, 0, 0, Mensajes Protector, + | 221, 224, 2, 6, 0, 63, Mensajes Protector, + & 220, 255, 410, 285, 7, 63, 56, 2, 2 + | 220, 258, 2, 6, 0, 0, FA, + | 221, 259, 2, 6, 0, 63, FA, + & 220, 290, 410, 320, 7, 63, 56, 2, 2 + | 220, 293, 2, 6, 0, 0, FA, + | 221, 294, 2, 6, 0, 63, FA, + & 220, 325, 410, 355, 7, 63, 56, 2, 2 + | 220, 328, 2, 6, 0, 0, Gst Bases de Datos, + | 221, 329, 2, 6, 0, 63, Gst Bases de Datos, + & 220, 360, 410, 390, 7, 63, 56, 2, 2 + | 220, 363, 2, 6, 0, 0, Programas externos, + | 221, 364, 2, 6, 0, 63, Programas externos, + & 220, 395, 410, 425, 7, 63, 56, 2, 2 + | 220, 398, 2, 6, 0, 0, Configurar Entorno, + | 221, 399, 2, 6, 0, 63, Configurar Entorno, + + + +************************************************ Botones D: 8 +**** **** Botones S: 97 +** Escoger empresa activa ** +**** **** +************************************************ +!8, 10 + +$ 110, 75, 297, 95, 7, 63, 56, 2, 2, 000, 000 +$ 110, 95, 297, 115, 7, 63, 56, 2, 2, 000, 000 +$ 110, 115, 297, 135, 7, 63, 56, 2, 2, 000, 000 +$ 110, 135, 297, 155, 7, 63, 56, 2, 2, 000, 000 +$ 110, 155, 297, 175, 7, 63, 56, 2, 2, 000, 000 +$ 110, 175, 297, 195, 7, 63, 56, 2, 2, 000, 000 +$ 110, 195, 297, 215, 7, 63, 56, 2, 2, 000, 000 +$ 110, 215, 297, 235, 7, 63, 56, 2, 2, 000, 000 +$ 110, 235, 297, 255, 7, 63, 56, 2, 2, 000, 000 +$ 110, 255, 297, 275, 7, 63, 56, 2, 2, 000, 000 + + +­97 + +*$ 20, 280, 300, 315, 7, 63, 56, 2, 2, 000, 000 +& 105, 70, 302, 280, 7, 56, 63, -2, 2 + + & 110, 255, 297, 275, 7, 63, 56, 2, 2 + & 110, 235, 297, 255, 7, 63, 56, 2, 2 + & 110, 215, 297, 235, 7, 63, 56, 2, 2 + & 110, 195, 297, 215, 7, 63, 56, 2, 2 + & 110, 175, 297, 195, 7, 63, 56, 2, 2 + & 110, 155, 297, 175, 7, 63, 56, 2, 2 + & 110, 135, 297, 155, 7, 63, 56, 2, 2 + & 110, 115, 297, 135, 7, 63, 56, 2, 2 + & 110, 95, 297, 115, 7, 63, 56, 2, 2 + & 110, 75, 297, 95, 7, 63, 56, 2, 2 + + | 110, 255, 2, 4, 0, 0, 123456789-123456789-123456789-, + | 111, 256, 2, 4, 0, 63, 123456789-123456789-123456789-, + + +************************************************ Botones D: 9 +**** **** Botones S: 98 +** Ventas -> Empleados ** +**** **** +************************************************ +!9, 3 + $ 220, 245, 410, 275, 7, 63, 56, 2, 2, 000, 000 + $ 220, 280, 410, 310, 7, 63, 56, 2, 2, 000, 000 + $ 220, 315, 410, 345, 7, 63, 56, 2, 2, 000, 000 + + +­98 +& 215, 240, 415, 350, 7, 56, 63, -2, 2 + & 220, 245, 410, 275, 7, 63, 56, 2, 2 + | 220, 248, 2, 6, 0, 0, Datos Clientes, + | 221, 249, 2, 6, 0, 63, Datos Clientes, + & 220, 280, 410, 310, 7, 63, 56, 2, 2 + | 220, 283, 2, 6, 0, 0, Venta a Clientes, + | 221, 284, 2, 6, 0, 63, Venta a Clientes, + & 220, 315, 410, 345, 7, 63, 56, 2, 2 + | 220, 318, 2, 6, 0, 0, Datos de interes, + | 221, 319, 2, 6, 0, 63, Datos de interes, + +************************************************ Botones D: 8 <-| +**** **** Botones S: 99 <-| +** Programas externos ** +**** **** +************************************************ +­99 + +& 223, 185, 420, 395, 7, 56, 63, -2, 2 + + & 228, 370, 415, 390, 7, 63, 56, 2, 2 + & 228, 350, 415, 370, 7, 63, 56, 2, 2 + & 228, 330, 415, 350, 7, 63, 56, 2, 2 + & 228, 310, 415, 330, 7, 63, 56, 2, 2 + & 228, 290, 415, 310, 7, 63, 56, 2, 2 + & 228, 270, 415, 290, 7, 63, 56, 2, 2 + & 228, 250, 415, 270, 7, 63, 56, 2, 2 + & 228, 230, 415, 250, 7, 63, 56, 2, 2 + & 228, 210, 415, 230, 7, 63, 56, 2, 2 + & 228, 190, 415, 210, 7, 63, 56, 2, 2 + + & 190, 185, 220, 288, 7, 63, 56, 2, 2 + & 190, 292, 220, 395, 7, 63, 56, 2, 2 + | 192, 185, 2, 6, 1, 0, Eliminar Insertar , + | 193, 186, 2, 6, 1, 63, Eliminar Insertar , diff --git a/TPV.DSK b/TPV.DSK new file mode 100644 index 0000000..bdbadf7 Binary files /dev/null and b/TPV.DSK differ diff --git a/TPV.ICO b/TPV.ICO new file mode 100644 index 0000000..477f843 Binary files /dev/null and b/TPV.ICO differ diff --git a/TPV.PRJ b/TPV.PRJ new file mode 100644 index 0000000..097ae92 Binary files /dev/null and b/TPV.PRJ differ diff --git a/TPV_BLC.CPP b/TPV_BLC.CPP new file mode 100644 index 0000000..024ade9 --- /dev/null +++ b/TPV_BLC.CPP @@ -0,0 +1,1753 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLineas_PVendidos 16 + +BDatos B_IVentas1; // Archivo de Ventas 1 de 3 ( Datos Globales ) +BDatos B_IVentas2; // Archivo de Ventas 2 de 3 ( Productos Vendidos ) +BDatos B_IVentas3; // Archivo de Ventas 3 de 3 ( Ventas Empleados ) + +INFORME1_VENTAS S_IVentas1; // Datos Generales ( 1 de 3 ) +INFORME2_VENTAS S_IVentas2; // Productos Vendidos ( 2 de 3 ) +INFORME3_VENTAS S_IVentas3; // Ventas Empleados ( 3 de 3 ) + +extern BDatos BVentas; // Base de datos de Ventaserencias +extern VENTAS SVentas[100]; // 100 productos ( distintos ) maximo por ticket + // Datos sobre la venta del dia +extern INFORMACION_VENTAS S_IVentas; + +extern char EmpresaActual[9]; // Empresa a la que se le realizan las gestiones + +extern BDatos BCmp; // Base de datos de Cmperencias +extern COMPRAS SCmp; // Estructura de referencias +extern long RegCompras[31 + 2];// Indice para cado uno de los dias del mes + 2 + +extern BDatos BEmpl; // Base de datos de Empleados +extern INFO_EMPLEADOS SEmpl; // Estructura de Empleados + +extern BDatos BProv; // Base de datos de Proveedores +extern INFO_PROVEEDORES SProv; // Estructura de Proveedores + +extern BDatos BRef; // Base de datos de Referencias +extern INFO_PRODUCTOS SRef; // Estructura de referencias + // Para guardar las posiciones de los c¢digos +extern BUSQUEDA_REF far *BusquedaRef; + +extern struct date FechaGestionActual; + + // Dia y mes actual para la gestion +extern char DiaActual, MesActual; +extern char AjusteCalendario; // Ajuste para los dias del calendario +extern char DiasMes; // Dias que tiene el mes actual + +char TablaHoraria[24]; // Tabla horaria de ventas + + /*************************************\ +| | +| M¢dulo de muestro del Balance | +| | + \*************************************/ +void DespliegaCalendario( void ); +void MuestraDatosVentas( char DiaBalance ); +long SumaGastosCompras( char DiaSuma, char MesSuma ); +char MuestraBalanceDiario( char DiaBalance, char MesActual ); +void MuestraVentasEmpleados( long Pagina, char DiaMostrar ); +void MuestraProductosVendidos( long Pagina, char DiaMostrar ); +void ImprimeBalance( char DiaMes, char DiaMostrar ); + + /*************************************\ +| | +| Parte de enlace de gestion | +| | +| Secci¢n para generar el balance | +| | +| Enlaces, a TPV_VENT.CPP | +| | + \*************************************/ +void MuestraHoraVenta( void ); +void GeneraBalanceDiario( void ); +void ConstruyeTablaHoraria( void ); +int MatchVendedor( long CodigoVendedor ); +void NuevoRegistroInforme1( INFORME1_VENTAS *S_IVentas1 ); +void NuevoRegistroInforme2( INFORME2_VENTAS *S_IVentas2 ); +void NuevoRegistroInforme3( INFORME3_VENTAS *S_IVentas3 ); +int ActualizaDatosGlobales( void ); +void ActualizaVentasProductos( char DiaGestion, char HoraVenta ); +void ActualizaVentasEmpleados( char DiaGestion, char MesGestion ); + + + /*************************************\ +| | +| Parte Cuarta del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | +| Enlaces, a TPV_VENT.CPP | +| | + \*************************************/ +extern int PosicionDia( char Dia ); +extern int CargaProductos( void ); +extern int MatchRef( unsigned long Codigo, char NormalBarras ); + +extern int P_Sec(int numero); +extern void RellenaCalendario( int IncX, int IncY ); +extern void MarcaDiaActual( int Sec, int Boton, char como ); + +unsigned long GastosCompras; // Gastos del dia a evaluar + +unsigned long GastosComprasD[32]; +unsigned long VentasD[32]; + +char HoraMostrar; // Hora "codificada" a mostrar + // Linea de productos vendidos +unsigned int CurrProductosVendidos = 0; + // Linea de productos vendidos +unsigned int CurrProductosEmpleados = 0; + +void GraficaMostrada( int grafica ); +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* ConfigurarMensajes *| +|* *| +|* Descripci¢n: *| +|* Gestiona los mensajes que se mostraran en el protector *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void BalanceDiario_Mensual( char DiarioMensual ) +{ + char ok, BPush; // Dia y mes de balance a gestionar + char old_DiaActual, i; + char old_MesActual; + char CurrGraf; + char MES[12+1][15] = {"","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"}; + char buffer[80]; + + CurrProductosVendidos = 0; // Linea de productos vendidos + CurrProductosEmpleados = 0; // Linea de productos vendidos + + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); + bar( 0, 0, 640, 480 ); + + old_DiaActual = DiaActual = FechaGestionActual.da_day; + old_MesActual = MesActual = FechaGestionActual.da_mon; + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + HoraMostrar = -1; + + if ( MuestraBalanceDiario( ( DiarioMensual == DIARIO ? DiaActual : -1 ), MesActual ) == 1 ) + { + for ( i = 12; i > 0; i-- ) + { + sprintf( buffer, "datos\\%s\\VT1-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, i ); + // Miramos si este mes est  inicializado + if ( access( buffer, 0) == 0 ) + { + MesActual = i; + break; + } + } + + sprintf( buffer, "datos\\%s\\VT1-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, i ); + if ( access( buffer, 0) != 0 ) + return; + + sprintf( buffer, "mes de: %s", MES[MesActual] ); + Optar( 0, "ACCEDIENDO A OTRO MES", "Se ha movido el acceso al", buffer, NULL ); + MuestraBalanceDiario( ( DiarioMensual == DIARIO ? DiaActual : -1 ), MesActual ); + } + + ok = 0; CurrGraf = 0; + do + { + + BPush = Comprueba_Secuencia( 9, NULL ); + + switch ( BPush ) + { + case -2: + while( kbhit() ) getch(); + break; + case -1: + while( kbhit() ) getch(); + break; + case 0: + while( kbhit() ) getch(); + break; + + // Imprimir + case 1: + ImprimeBalance( DiarioMensual, ( DiarioMensual == DIARIO ? DiaActual : -1 ) ); + break; + // Dia / Mes a visionar + case 2: + if ( DiarioMensual == DIARIO ) + { + old_DiaActual = DiaActual; + old_MesActual = MesActual; + DespliegaCalendario(); + if ( MuestraBalanceDiario( DiaActual, MesActual ) == 1 ) + { + DiaActual = old_DiaActual; + MesActual = old_MesActual; + MuestraBalanceDiario( DiaActual, MesActual ); + } + } else { + old_DiaActual = DiaActual; + old_MesActual = MesActual; + DespliegaCalendario(); + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + if ( MuestraBalanceDiario( -1, MesActual ) == 1 ) + { + DiaActual = old_DiaActual; + MesActual = old_MesActual; + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + MuestraBalanceDiario( -1, MesActual ); + } + } + break; + // Menu Principal + case 3: + ok = 1; + break; + // Notas + case 4: + if ( DiarioMensual == DIARIO ) + { + if ( VisualMode == ERROR ) + { + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + EditComentario( (char *)(&S_IVentas1.Notas[0][0]), 6, 50, Config.TxtBgN, Config.TxtFgN, 34, 369, 446, 471, 15 ); + + // leemos los datos de este dia + B_IVentas1.EscribeReg( (void *)&S_IVentas1, ( DiaActual - 1 ) ); + + setfillstyle( SOLID_FILL, Config.TxtBgN ); + + bar( 34, 369, 446, 471 ); + setcolor ( Config.TxtFgN ); + for ( i = 0; i < 7; i++ ) + outtextxy( 32+2, 367 + 15*i , S_IVentas1.Notas[i] ); + } + } else { + CurrGraf++; if ( CurrGraf > 2 ) CurrGraf = 0; + GraficaMostrada( CurrGraf ); + } + break; + // Empleados: pagina anterior + case 5: + MuestraVentasEmpleados( -1, ( DiarioMensual == DIARIO ? DiaActual : -1 ) ); + break; + // Empleados: pagina posterior + case 6: + MuestraVentasEmpleados( 1, ( DiarioMensual == DIARIO ? DiaActual : -1 ) ); + break; + // Productos: pagina anterior + case 7: + MuestraProductosVendidos( -1, ( DiarioMensual == DIARIO ? DiaActual : -1 ) ); + break; + // Productos: pagina posterior + case 8: + MuestraProductosVendidos( 1, ( DiarioMensual == DIARIO ? DiaActual : -1 ) ); + break; + // Horas de ventas a visualizar + case 9: + if ( DiarioMensual == DIARIO ) + { + HoraMostrar++; + if ( HoraMostrar == 6 ) HoraMostrar = -1; + MuestraHoraVenta(); + MuestraProductosVendidos( 0, DiaActual ); + } + break; + } + + } while ( !ok ); + + B_IVentas1.CerrarReg(); + B_IVentas2.CerrarReg(); + B_IVentas3.CerrarReg(); +} + + /**************************************************************************\ +|* *| +|* MuestraHoraVenta *| +|* *| +|* Descripci¢n: *| +|* Muestra en pantalla las cotas de horas de ventas a mostrar *| +|* *| +|* Entradas: *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraHoraVenta( void ) +{ + char buffer[80]; + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 82, 24, 108, 38 ); + bar( 177, 24, 203, 38 ); + + setcolor ( Config.TxtFgN ); + + if ( HoraMostrar == -1 ) + sprintf( buffer, " þþ" ); + else + sprintf( buffer, "%02d", S_IVentas1.Hora[HoraMostrar] ); + + outtextxy( 82, 24, buffer ); + + if ( HoraMostrar == -1 ) + sprintf( buffer, " þþ" ); + else + sprintf( buffer, "%02d", S_IVentas1.Hora[(HoraMostrar + 1)%6] ); + + outtextxy( 177, 24, buffer ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraProductosVendidos *| +|* *| +|* Descripci¢n: *| +|* Redibuja toda la pantalla, y muestra el balance del dia *| +|* que se le pasa como par metro... *| +|* *| +|* *| +|* Entradas: Dia y mes a mostrar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +char MuestraBalanceDiario( char DiaActual, char MesActual ) +{ + static char ArchivoAbierto = ERROR; + char buffer[80], i; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); + bar( 0, 0, 640, 480 ); + + // Borramos toda la pantalla + Imprime_Estaticos( ( DiaActual != -1 ? 60 : 61 ), "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + if ( DiaActual != -1 ) + MuestraHoraVenta(); + + // Archivo de datos generales ( 1 de 3 ) + sprintf( buffer, "datos\\%s\\VT1-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + // Miramos si este mes est  inicializado + if ( access( buffer, 0) != 0 ) + { + Optar( 0, "ERROR DE ACCESO", "Este mes no tiene ventas", "venda algo, para acceder.", "­­­ No hay ventas !!!", NULL ); + return 1; + } + + if ( ArchivoAbierto == OK ) + { + B_IVentas1.CerrarReg(); + B_IVentas2.CerrarReg(); + B_IVentas3.CerrarReg(); + ArchivoAbierto = ERROR; + } + + if ( B_IVentas1.AbrirReg( buffer, sizeof( INFORME1_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 1 de 3" ); + + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + // Archivo de ventas por empleados ( 3 de 3 ) + sprintf( buffer, "datos\\%s\\VT3-%04d.M--", NEmpresa, FechaGestionActual.da_year/*, MesActual*/ ); + if ( B_IVentas3.AbrirReg( buffer, sizeof( INFORME3_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 3 de 3" ); + + ArchivoAbierto = OK; + + // El balance diario ya est  hecho, asi que solo tenemos que: + + // - Rastrear las compras del dia de balance a evaluar + GastosCompras = 0; + if ( DiaActual != -1 ) + { + GastosCompras = SumaGastosCompras( DiaActual, MesActual ); + } else { + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = SumaGastosCompras( i, MesActual ); + GastosCompras += GastosComprasD[i]; + } + } + + // - mostar datos sobre las ventas, incluyendo el comentario + MuestraDatosVentas( DiaActual ); + + // - listar los productos vendidos + MuestraProductosVendidos( 0, DiaActual ); + + // - listar ventas por empleados + MuestraVentasEmpleados( 0, DiaActual ); + + if ( DiaActual == -1 ) + GraficaMostrada( 0 ); + +/* + // Una vez cargado sus datos, ya no necesita seguir abierto + B_IVentas1.CerrarReg(); +*/ + return 0; +} + + /**************************************************************************\ +|* *| +|* SumaGastosCompras *| +|* *| +|* Descripci¢n: *| +|* Suma todos los gastos del mes y dia que se le pasan *| +|* como par metros... *| +|* *| +|* *| +|* Entradas: Dia y mes a sumar *| +|* *| +|* Salidas: La suma total de compras *| +|* *| + \**************************************************************************/ +long SumaGastosCompras( char DiaSuma, char MesSuma ) +{ + long SumaTotal, i; + char buffer[80]; + + + // ¨ Que archivo hay que abrir ? + sprintf( buffer, "datos\\%s\\Cmp-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesSuma ); + // Si no existe el archivo; NO HAY GASTOS + if ( access( buffer, 0 ) != 0 ) return 0; + + // Abrimos el archivo + if ( BCmp.AbrirReg( buffer, sizeof( COMPRAS ) ) == ERROR ) + Error(0x01, BCmp.cError ); + // Recuperamos los datos de usuario + BCmp.CargaDatosUsuario( (void *)&RegCompras, sizeof(long)*32 ); + + SumaTotal = 0; + + for ( i=0; i < RegCompras[ DiaSuma ]; i++ ) + { + BCmp.LeeReg( (void *)&SCmp, i + PosicionDia( DiaSuma ) ); + SumaTotal += SCmp.PrecioCosto /** SCmp.Cantidad*/; + } + + BCmp.CerrarReg(); + + return SumaTotal; +} + + + /**************************************************************************\ +|* *| +|* MuestraDatosVentas *| +|* *| +|* Descripci¢n: *| +|* Muestra los datos generales del dia que se le pasa *| +|* como parametro... *| +|* *| +|* *| +|* Entradas: Dia a mostrar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosVentas( char DiaActual ) +{ + char buffer[80], buffer1[80]; + char i, j; + INFORME1_VENTAS S_IVentasTmp; + long AperturaCajaTemph, AperturaCajaTempm, CierreCajaTemph, CierreCajaTempm; + + if ( DiaActual != -1 ) + { + // leemos los datos de este dia + B_IVentas1.LeeReg( (void *)&S_IVentas1, ( DiaActual - 1 ) ); + } else { + j = 0; + NuevoRegistroInforme1( &S_IVentas1 ); + for ( i=0; i < DiasMes; i++ ) + { + B_IVentas1.LeeReg( (void *)&S_IVentasTmp, i ); + S_IVentas1.Tickets += S_IVentasTmp.Tickets; + S_IVentas1.Cambio += S_IVentasTmp.Cambio; + S_IVentas1.IntentosSalir += S_IVentasTmp.IntentosSalir; + S_IVentas1.SalidasExito += S_IVentasTmp.SalidasExito; + + S_IVentas1.TotalVentas += S_IVentasTmp.TotalVentas; + S_IVentas1.CosteTotal += S_IVentasTmp.CosteTotal; + VentasD[i] = S_IVentasTmp.TotalVentas; + + if ( S_IVentasTmp.AperturaCaja.hora != -1 ) + { + AperturaCajaTemph += S_IVentasTmp.AperturaCaja.hora; + AperturaCajaTempm += S_IVentasTmp.AperturaCaja.min; + CierreCajaTemph += S_IVentasTmp.CierreCaja.hora; + CierreCajaTempm += S_IVentasTmp.CierreCaja.min; + j ++; + } + } + if ( j > 0 ) + { + S_IVentas1.AperturaCaja.hora = AperturaCajaTemph / j; + S_IVentas1.AperturaCaja.min = AperturaCajaTempm / j; + S_IVentas1.CierreCaja.hora = CierreCajaTemph / j; + S_IVentas1.CierreCaja.min = CierreCajaTempm / j; + } + } + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + // # de tickets emitidos hoy / mensuales + formatea_long( (long)S_IVentas1.Tickets, buffer1 ); + sprintf( buffer, " %6s", buffer1 ); + TextoDoble( 245, 5, buffer ); + + // # de cambio / mensuales + formatea_long( (long)S_IVentas1.Cambio, buffer1 ); + sprintf( buffer, " %6s", buffer1 ); + TextoDoble( 245, 20, buffer ); + + // # intentos de salir / mensuales + formatea_long( (long)S_IVentas1.IntentosSalir, buffer1 ); + sprintf( buffer, " %6s", buffer1 ); + TextoDoble( 245, 35, buffer ); + + // # salidas con exito / mensuales + formatea_long( (long)S_IVentas1.SalidasExito, buffer1 ); + sprintf( buffer, " %6s", buffer1 ); + TextoDoble( 245, 50, buffer ); + + // Inicio de la caja / media + sprintf( buffer, " %02d:%02d", S_IVentas1.AperturaCaja.hora, S_IVentas1.AperturaCaja.min ); + TextoDoble( 245, 65, buffer ); + + // Cierre de la caja / media + sprintf( buffer, " %02d:%02d", S_IVentas1.CierreCaja.hora, S_IVentas1.CierreCaja.min ); + TextoDoble( 245, 80, buffer ); + + if ( DiaActual != -1 ) + { + // Horas de venta y Total vendido por horas + for ( i = 0; i < 6; i++ ) + { + formatea_long( (long)S_IVentas1.TotalVendido[i], buffer1 ); + sprintf( buffer, " %2d:00 - %2d:00 %8s", S_IVentas1.Hora[i], S_IVentas1.Hora[(i+1)%6], buffer1 ); + TextoDoble( 245, 110 + 20*i, buffer ); + } + + // Total vendido + formatea_long( (long)S_IVentas1.TotalVentas, buffer1 ); + sprintf( buffer, " %7s", buffer1 ); + TextoDoble( 245, 290, buffer ); + + // Gastos/Compras totales + formatea_long( (long)GastosCompras, buffer1 ); + sprintf( buffer, " %7s", buffer1 ); + TextoDoble( 245, 310, buffer ); + + // Beneficio bruto + formatea_long( (long)( S_IVentas1.TotalVentas - GastosCompras ), buffer1 ); + sprintf( buffer, " %7s", buffer1 ); + TextoDoble( 245, 335, buffer ); + + // Comentario + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 34, 369, 446, 471 ); + setcolor ( Config.TxtFgN ); + for ( i = 0; i < 7; i++ ) + outtextxy( 32+2, 367 + 15*i , S_IVentas1.Notas[i] ); + + } else { + + // Total Ventas + formatea_long( (long)( S_IVentas1.TotalVentas ), buffer1 ); + sprintf( buffer, " %9s", buffer1 ); + TextoDoble( 245, 120, buffer ); + + // Total Gastos + formatea_long( (long)( GastosCompras ), buffer1 ); + sprintf( buffer, " %9s", buffer1 ); + TextoDoble( 245, 140, buffer ); + + // Beneficio Bruto + formatea_long( (long)( S_IVentas1.TotalVentas - GastosCompras ), buffer1 ); + sprintf( buffer, " %9s", buffer1 ); + TextoDoble( 245, 180, buffer ); + + // Beneficio Neto + formatea_long( (long)( S_IVentas1.TotalVentas - GastosCompras - S_IVentas1.CosteTotal ), buffer1 ); + sprintf( buffer, " %9s", buffer1 ); + TextoDoble( 245, 200, buffer ); + + } + +} + + /**************************************************************************\ +|* *| +|* MuestraVentasEmpleados *| +|* *| +|* Descripci¢n: *| +|* Muestra una lista con los vendedores que han vendido algo *| +|* en el dia actual, empezando por el registro dado *| +|* *| +|* *| +|* Entradas: Pagina a mostrar: 0 primera -1 anterior 1 siguiente *| +|* Dia a tratar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraVentasEmpleados( long Pagina, char DiaMostrar ) +{ +#ifndef DEMOSTRACION + +#else + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permite ver las ventas", "de cada empleado...", NULL ); +#endif + +} + + /**************************************************************************\ +|* *| +|* MuestraProductosVendidos *| +|* *| +|* Descripci¢n: *| +|* Muestra una lista con los productos vendidos ( segun hora *| +|* de muestreo ). *| +|* *| +|* *| +|* Entradas: Pagina a mostrar: 0 primera -1 anterior 1 siguiente *| +|* Dia y mes tratar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraProductosVendidos( long Pagina, char DiaMostrar ) +{ + static long i, oldPos; + char inc, j, Row, buffer[80], buffer1[80], lok; + long buffTmp; + char Dia; + + + oldPos = i; + + switch( Pagina ) + { + case -1: +/* + if ( i < 0 ) return; + inc = -1; + i = oldPos; + break; +*/ + case 0: + inc = 1; Pagina = 1; + i = 0; oldPos = 0; + break; + case 1: + if ( i >= B_IVentas2.Registros() ) return; + oldPos = i; + inc = 1; + break; + } + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 9, 79, 236, 335 ); + setcolor ( Config.TxtFgN ); + + for ( Row = 0; i < B_IVentas2.Registros() && Row < NLineas_PVendidos; i += inc, Row ++ ) + { + lok = B_IVentas2.LeeReg( (void *)&S_IVentas2, i ); + if ( DiaMostrar != -1 ) + while( i <= B_IVentas2.Registros() && + ( HoraMostrar == -1 ? S_IVentas2.VentaTotal[DiaMostrar-1] == 0 : + S_IVentas2.Cantidad[DiaMostrar-1][HoraMostrar] == 0 ) + ) { i += inc; lok = B_IVentas2.LeeReg( (void *)&S_IVentas2, i ); }; + + if ( lok == OK ) + { + outtextxy( 10, 80 + ( Pagina != -1 ? 15*Row : ( 15 * (NLineas_PVendidos - Row) ) ), S_IVentas2.Nombre ); + if ( DiaMostrar != -1 ) + { + if ( HoraMostrar != -1 ) + { + buffTmp = (long)S_IVentas2.Cantidad[DiaMostrar-1][HoraMostrar]; + } else { + buffTmp = 0; + for ( j = 0; j < 6; j++ ) + buffTmp += (long)S_IVentas2.Cantidad[DiaMostrar-1][j]; + } + } else { + // Total unidades en el mes + buffTmp = 0; + for ( Dia = 0; Dia < DiasMes; Dia++ ) + for ( j = 0; j < 6; j++ ) + buffTmp += (long)S_IVentas2.Cantidad[Dia][j]; + } + formatea_long( buffTmp, buffer1 ); + + sprintf( buffer, "%6s", buffer1 ); + outtextxy( 188, 80 + ( Pagina != -1 ? 15*Row : ( 15 * (NLineas_PVendidos - Row) ) ), buffer ); + } + } + + if ( Pagina == -1 ) oldPos = i; + +} + + + /**************************************************************************\ +|* *| +|* GraficaMostrada *| +|* *| +|* Descripci¢n: *| +|* Muestra que tipo de grafica estamos visualizando... *| +|* y redibuja el mismo... *| +|* *| +|* Entradas: C¢digo numerico de la gr fica... *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficaMostrada( int grafica ) +{ + char Mensajes[][12] = { "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", + "1" + }; + int i; + long TMP[32]; + char buffer[80], buffer1[80]; + + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 7, 367, 23, 473 ); + bar( 250, 227, 632, 357 ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + switch( grafica ) + { + // Total compras + case 0: + for ( i = 0; i < DiasMes; i++ ) + { + formatea_long( GastosComprasD[i+1], buffer1 ); + sprintf( buffer, "%2d: %10s", (i+1), buffer1 ); + TextoDoble( 250 + 97*(i%4), 235 + 15*(i/4), buffer ); + } + sprintf( buffer, " Compras " ); + MuestraGraficas( 35, 370, 410, 95, DiasMes, (long *)GastosComprasD, Mensajes ); + break; + // Total ventas + case 1: + for ( i = 0; i < DiasMes; i++ ) + { + formatea_long( VentasD[i], buffer1 ); + sprintf( buffer, "%2d: %10s", (i+1), buffer1 ); + TextoDoble( 250 + 97*(i%4), 235 + 15*(i/4), buffer ); + } + sprintf( buffer, " Ventas " ); + MuestraGraficas( 35, 370, 410, 95, DiasMes, (long *)VentasD, Mensajes ); + break; + // Beneficio Bruto + case 2: + for ( i = 0; i < 32; i++ ) + TMP[i] = VentasD[i] - GastosComprasD[i+1]; + for ( i = 0; i < DiasMes; i++ ) + { + formatea_long( TMP[i], buffer1 ); + sprintf( buffer, "%2d: %10s", (i+1), buffer1 ); + TextoDoble( 250 + 97*(i%4), 235 + 15*(i/4), buffer ); + } + sprintf( buffer, " Ben. Bruto " ); + MuestraGraficas( 35, 370, 410, 95, DiasMes, (long *)TMP, Mensajes ); + break; + } + + settextstyle( SMALL_FONT, VERT_DIR, 5 ); + TextoDoble( 5, 365, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Û + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Û +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Û Û +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Û Û +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß Û Û +// Û Parte enlace al m¢dulo TPV_VENT.CPP Û Û Û +// Û Û Û +// Û Secci¢n de Balance del dia Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* GeneraBalanceDiario *| +|* *| +|* Descripci¢n: *| +|* Cierra el dia actual, actualizando todas las ventas del dia *| +|* incluso si el fichero se ha abierto varias veces en el *| +|* mismo dia. *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GeneraBalanceDiario( void ) +{ + char buffer[100]; + int HoraVenta; + long i; + + // Todo esto se puede hacer si hay ventas + if ( BVentas.Registros() == 0 ) + return; + + // Con lo que abrimos a continuacion ya iran 6 ficheros abiertos al mismo tiempo + // Abrimos los ficheros en Bloque + + // Cargamos los datos existentes en el archivo temporal de ventas + BVentas.CargaDatosUsuario( (void *)&S_IVentas, sizeof( INFORMACION_VENTAS ) ); + + // Abrimos el archivo de empleados para poder realizar las busquedas + sprintf( buffer, "datos\\%s\\info_emp.dbf", NEmpresa ); + if ( BEmpl.AbrirReg( buffer, sizeof( INFO_EMPLEADOS ) ) == ERROR ) + Error(0x01, BEmpl.cError); + + // Archivo de datos generales ( 1 de 3 ) + sprintf( buffer, "datos\\%s\\VT1-%04d.M%02d", NEmpresa, S_IVentas.Anyo, (int)S_IVentas.Mes ); + if ( B_IVentas1.AbrirReg( buffer, sizeof( INFORME1_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 1 de 3" ); + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, S_IVentas.Anyo, (int)S_IVentas.Mes ); + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + // Archivo de ventas por empleados ( 3 de 3 ) + sprintf( buffer, "datos\\%s\\VT3-%04d.M--"/*%02d"*/, NEmpresa, S_IVentas.Anyo/*, (int)S_IVentas.Mes*/ ); + if ( B_IVentas3.AbrirReg( buffer, sizeof( INFORME3_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 3 de 3" ); + + // Mostramos el mensaje de lo que estamos haciendo... + Optar( ENCUADRE, "Cerrando caja", "Se esta cerrando la caja", "y generando el balance diario.", "Por favor, espere....", NULL ); + + // Si es la primera vez que se abren los ficheros, los inicializo + // Fichero 1 de 3 + if ( B_IVentas1.Registros() == 0 ) + { + NuevoRegistroInforme1( &S_IVentas1 ); + for ( i = 0; i < 31; i++ ) + B_IVentas1.InsReg( (void *)&S_IVentas1, B_IVentas1.Registros(), ARRIBA ); + } + + // Cargamos los datos globales por si este no es el primer balance del dia + B_IVentas1.LeeReg( (void *)&S_IVentas1, ( S_IVentas.Dia - 1 ) ); + + // Datos iniciales para las busquedas + if ( B_IVentas2.Registros() == 0 ) + { + NuevoRegistroInforme2( &S_IVentas2 ); + B_IVentas2.InsReg( (void *)&S_IVentas2, B_IVentas2.Registros(), ARRIBA ); + } + B_IVentas2.LeeReg( (void *)&S_IVentas2, 0 ); + +#ifndef DEMOSTRACION + if ( B_IVentas3.Registros() == 0 ) + { + NuevoRegistroInforme3( &S_IVentas3 ); + B_IVentas3.InsReg( (void *)&S_IVentas3, B_IVentas3.Registros(), ARRIBA ); + } + B_IVentas3.LeeReg( (void *)&S_IVentas3, 0 ); +#endif + // Miro si ya tenemos asignadas las horas a inspeccionar + if ( S_IVentas1.Hora[0] == -1 ) + { + for ( i = 0; i < 6; i++ ) + S_IVentas1.Hora[(int)i] = Config.HorasMedicion[(int)i]; + } + // ¨ Esta fijada la hora de apertura de caja ? + if ( S_IVentas1.AperturaCaja.hora == -1 ) + S_IVentas1.AperturaCaja = S_IVentas.AperturaCaja; + + // Fichero 2 de 3 ¿ + // Ã> Los ficheros de productos y empleados + // Fichero 3 de 3 Ù no necesitan ser inicializados. + // Actualizamos los datos globales mas externos. + S_IVentas1.CierreCaja = S_IVentas.CierreCaja; + S_IVentas1.Tickets += S_IVentas.Tickets; + S_IVentas1.Cambio += S_IVentas.Cambio; + S_IVentas1.SalidasExito += S_IVentas.SalidasExito; + S_IVentas1.IntentosSalir += S_IVentas.IntentosSalir; + + DiaActual = S_IVentas.Dia; + MesActual = S_IVentas.Mes; + + // Construimos la tabla de horas a discriminar + ConstruyeTablaHoraria(); + // Recorremos todo el archivo de ventas, reorganizando los datos + for ( i = 0; i < BVentas.Registros(); i++ ) + { + // Leemos el registro a tratar + BVentas.LeeReg( (void *)&SVentas[0], i ); + + // Actualizamos los datos globales ( 1 de 3 ) + HoraVenta = ActualizaDatosGlobales(); + + // Actualizamos los datos relativos a productos vendidos ( 2 de 3 ) + ActualizaVentasProductos( S_IVentas.Dia, HoraVenta ); +#ifndef DEMOSTRACION + // Actualizamos las ventas de cada empleado ( 3 de 3 ) + ActualizaVentasEmpleados( S_IVentas.Dia, S_IVentas.Mes ); +#endif + } + + // Salvamos los datos Globales + B_IVentas1.EscribeReg( (void *)&S_IVentas1, ( S_IVentas.Dia - 1 ) ); + + + Optar( ENCUADRE, NULL ); + + BEmpl.CerrarReg(); + B_IVentas1.CerrarReg(); + B_IVentas2.CerrarReg(); + B_IVentas3.CerrarReg(); +} + + /**************************************************************************\ +|* *| +|* ActualizaDatosGlobales *| +|* *| +|* Descripci¢n: *| +|* Recalcula los datos globales, a razon de los datos antiguos *| +|* y los nuevos, teniendo en cuenta, las horas a examinar... *| +|* mismo dia. *| +|* SVentas[0] Contiene los datos con los que actualizar *| +|* *| +|* Entradas:(ninguna) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int ActualizaDatosGlobales( void ) +{ + char j; +// Tabla horaria: +// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 00 +// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 + +// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 00 +// +// +//char TablaHoraria[24] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 }; + + // Actualizamos los datos mas directos, (dentro de lo que cabe) + S_IVentas1.CosteTotal += SVentas[0].PrecioC /** SVentas[0].Cantidad*/; + S_IVentas1.TotalVentas += SVentas[0].PrecioV * SVentas[0].Cantidad; + if ( SVentas[0].BarraMesa ) + S_IVentas1.TotalVentas += ( (S_IVentas1.TotalVentas) * Config.OpcionesCaja.PorcentajeMesa ) / 100; + // Recorremos las horas que nos interesan inspeccionar + + j = TablaHoraria[ (int)( SVentas[0].HoraV.hora % 24) ]; +// for ( j=0; j < 6; j++ ) +// if ( SVentas[0].HoraV.hora >= S_IVentas1.Hora[j] && SVentas[0].HoraV.hora < S_IVentas1.Hora[ (j+1)%6 ] ) +// { + S_IVentas1.TotalVendido[j] += SVentas[0].PrecioV * SVentas[0].Cantidad; + if ( SVentas[0].BarraMesa ) + S_IVentas1.TotalVendido[j] += ( (SVentas[0].PrecioV * SVentas[0].Cantidad/*S_IVentas1.TotalVendido[j]*/) * Config.OpcionesCaja.PorcentajeMesa ) / 100; +// break; +// } + + return (int)j; + +} + + +void ConstruyeTablaHoraria(void) +{ + int i, j, k; + + // Por defecto la tabla horaria esta toda a cero + for ( i = 0; i < 6; i++ ) + TablaHoraria[i] = 0; + + // Revisamos las 24 horas posibles: 00 - 1 - 2 - ... - 22 - 23 + for ( i = 0; i < 24; i ++ ) + // Por cada hora verificamos el rango donde pueda estar ( 0 - 5 ) + for ( j = 0; j < 6; j ++ ) + { + for ( k = ( S_IVentas1.Hora[j] % 24); k != (S_IVentas1.Hora[(j+1)%6]%24); k = (++k)%24 ) + { + if ( i == k ) + { + TablaHoraria[i] = j; + break; + } + } + if ( k != (S_IVentas1.Hora[(j+1)%6]%24) ) + break; + } + +} + + + /*************************************************************************\ +|* *| +|* ActualizaVentasProductos *| +|* *| +|* Descripci¢n: *| +|* Busca y actualiza el producto, en el dia que corresponda, *| +|* en caso de no encontrarlo, lo a¤ade. *| +|* SVentas[0] Contiene los datos con los que actualizar *| +|* *| +|* Entradas: *| +|* Puntero donde guardar la actualizacion ( 2 de 3 ) *| +|* Dia a actualizar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void ActualizaVentasProductos( char DiaGestion, char HoraVenta ) +{ + char enc; + long i; + + if ( DiaGestion != S_IVentas.Dia ) + Error( 0x00, "Sincronismo erroneo en ActualizaVentaProductos" ); + + // Quizas estamos situados sobre ella + if ( S_IVentas2.CodigoR == SVentas[0].CodigoR ) + { + // Asi que ya lo hemos encontrado + enc = OK; + } else { + enc = ERROR; + B_IVentas2.LeeReg( (void *)&S_IVentas2, 0 ); + // No estabamos sobre ella. Buscamos la referencia del producto + for ( i = 0; i < B_IVentas2.Registros() && enc == ERROR; i ++ ) + { + if ( S_IVentas2.CodigoR == SVentas[0].CodigoR ) + { + enc = OK; + } else { + B_IVentas2.LeeReg( (void *)&S_IVentas2, i ); + } + } + if ( S_IVentas2.CodigoR == SVentas[0].CodigoR ) + enc = OK; + } + + // Llegado a este punto, ya se si se encuentra en el fichero o no, + // asi que si no se encuentra en el fichero, lo inserto. + if ( enc == ERROR ) + { + + NuevoRegistroInforme2( &S_IVentas2 ); + S_IVentas2.CodigoR = SVentas[0].CodigoR; + // 1§ Obtenemos el nombre del producto ( si el Cod. 0.Tickets Varios ) + if ( MatchRef( SVentas[0].CodigoR, NORMAL ) == OK ) + { + strcpy ( S_IVentas2.Nombre, SRef.Descripcion ); + } else { + strcpy ( S_IVentas2.Nombre, "Tickets Varios" ); + } + S_IVentas2.CantUnitaria = SRef.CantUnitaria; + B_IVentas2.InsReg( (void *)&S_IVentas2, B_IVentas2.Registros(), ARRIBA ); + } + + // Para acabar, ya estoy situado sobre la referencia que tengo que actualizar + // asi que solo actualizo sus datos... + S_IVentas2.Cantidad[DiaGestion-1][HoraVenta] += SVentas[0].Cantidad; + + S_IVentas2.VentaTotal[DiaGestion-1] += SVentas[0].PrecioV*SVentas[0].Cantidad; + S_IVentas2.PrecioCosto[DiaGestion-1] += SVentas[0].PrecioC/*SVentas[0].Cantidad*/; + + // ... y grabo la informacion. + B_IVentas2.EscribeReg( (void *)&S_IVentas2, B_IVentas2.RegActual() ); + +} + +#ifndef DEMOSTRACION + /*************************************************************************\ +|* *| +|* ActualizaVentasEmpleados *| +|* *| +|* Descripci¢n: *| +|* Busca y actualiza las ventas de cada proveedor, *| +|* en caso de no encontrarlo, lo a¤ade. *| +|* SVentas[0] Contiene los datos con los que actualizar *| +|* *| +|* Entradas: *| +|* Dia a actualizar *| +|* Mes a actualizar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void ActualizaVentasEmpleados( char DiaGestion, char MesGestion ) +{ + char enc, buffer[100]; + long i; + + DiaGestion = S_IVentas.Dia; + MesGestion = S_IVentas.Mes; + + + // Quizas estamos situados sobre ella + if ( S_IVentas3.CodigoR == SVentas[0].CodigoVendedor ) + { + // Asi que ya lo hemos encontrado + enc = OK; + } else { + enc = ERROR; + B_IVentas3.LeeReg( (void *)&S_IVentas3, 0 ); + // No estabamos sobre ella. Buscamos la referencia del producto + for ( i = 0; i < B_IVentas3.Registros() && enc == ERROR; i ++ ) + { + if ( S_IVentas3.CodigoR == SVentas[0].CodigoVendedor ) + { + enc = OK; + } else { + B_IVentas3.LeeReg( (void *)&S_IVentas3, i ); + } + } + } + + // Llegado a este punto, ya se si se encuentra en el fichero o no, + // asi que si no se encuentra en el fichero, lo inserto. + if ( enc == ERROR ) + { + + NuevoRegistroInforme3( &S_IVentas3 ); + // 1§ Obtenemos el nombre del producto ( si el Cod. 0.Tickets Varios ) + S_IVentas3.CodigoR = SVentas[0].CodigoVendedor; + strcpy ( S_IVentas3.Vendedor, "Vendedor Varios" ); + if ( SVentas[0].CodigoVendedor != 0 ) + { + if ( MatchVendedor( SVentas[0].CodigoVendedor ) == OK ) + { + sprintf( buffer, "%s %s %s", SEmpl.Nombre, SEmpl.Apellido1, SEmpl.Apellido2 ); + buffer[30] = '\0'; strcpy ( S_IVentas3.Vendedor, buffer ); + } + } + + B_IVentas3.InsReg( (void *)&S_IVentas3, B_IVentas3.Registros(), ARRIBA ); + } + + // Para acabar, ya estoy situado sobre la referencia que tengo que actualizar + // asi que solo actualizo sus datos... + S_IVentas3.TotalVendido[DiaGestion-1][MesGestion-1] += SVentas[0].PrecioV; + + // ... y grabo la informacion. + B_IVentas3.EscribeReg( (void *)&S_IVentas3, B_IVentas3.RegActual() ); + +} +#endif + /*************************************************************************\ +|* *| +|* NuevoRegistroInforme1 *| +|* *| +|* Descripci¢n: *| +|* Actualiza los datos para un nuevo registro del tipo 1. *| +|* *| +|* *| +|* Entradas: *| +|* Puntero donde guardar el nuevo Reg. ( 1 de 3 ) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void NuevoRegistroInforme1( INFORME1_VENTAS *S_IVentas1 ) +{ + char i; + + for ( i = 0; i < 6; i++ ) + S_IVentas1 -> Hora[i] = -1; + + for ( i = 0; i < 6; i++ ) + S_IVentas1 -> TotalVendido[i] = 0; + + S_IVentas1 -> CosteTotal = 0; + S_IVentas1 -> TotalVentas = 0; + S_IVentas1 -> Tickets = 0; + S_IVentas1 -> Cambio = 0; + S_IVentas1 -> AperturaCaja.hora = -1; + + S_IVentas1 -> CierreCaja.hora = -1; + S_IVentas1 -> Tickets = 0; + S_IVentas1 -> Cambio = 0; + S_IVentas1 -> SalidasExito = 0; + S_IVentas1 -> IntentosSalir = 0; + + +} + + + + /*************************************************************************\ +|* *| +|* NuevoRegistroInforme2 *| +|* *| +|* Descripci¢n: *| +|* Actualiza los datos para un nuevo registro del tipo 2. *| +|* *| +|* *| +|* Entradas: *| +|* Puntero donde guardar el nuevo Reg. ( 2 de 3 ) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void NuevoRegistroInforme2( INFORME2_VENTAS *S_IVentas2 ) +{ + char i, j; + + // No // Codigo Real del Producto + // necesitan // Nombre del Producto + // ser // Cantidad de producto vendida segun horas, + // inicializados // y dia de venta ( 1, 2, ..., 31 ) + + for ( i = 0; i < 31; i++ ) + { + S_IVentas2 -> VentaTotal[i] = 0; + S_IVentas2 -> PrecioCosto[i] = 0; + for ( j = 0; j < 6; j++ ) + S_IVentas2 -> Cantidad[i][j] = 0; + } + +} + +#ifndef DEMOSTRACION + /*************************************************************************\ +|* *| +|* NuevoRegistroInforme3 *| +|* *| +|* Descripci¢n: *| +|* Actualiza los datos para un nuevo registro del tipo 3. *| +|* *| +|* *| +|* Entradas: *| +|* Puntero donde guardar el nuevo Reg. ( 3 de 3 ) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void NuevoRegistroInforme3( INFORME3_VENTAS *S_IVentas3 ) +{ + char i, j; + + // No necesitan // Codigo Real del Vendedor + // ser inicializados // Nombre del Vendedor + + // Total que Vendi¢ por dia de cada mes + for ( i = 0; i < 31; i++ ) + for ( j = 0; j < 12; j ++ ) + S_IVentas3 -> TotalVendido[i][j] = 0; + +} +#endif + + + /*************************************************************************\ +|* *| +|* MatchVendedor *| +|* *| +|* Descripci¢n: *| +|* Busca al vendedor requerido. *| +|* *| +|* *| +|* Entradas: *| +|* Codigo del Vendedor *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +int MatchVendedor( long CodigoVendedor ) +{ + char enc; + long i; + + if ( SEmpl.CodigoR == CodigoVendedor ) + return OK; + + enc = ERROR; + BEmpl.LeeReg( (void *)&SEmpl, 0 ); + for ( i = 0; i < BEmpl.Registros() && enc == ERROR; i++ ) + { + if ( SEmpl.CodigoR == CodigoVendedor ) + { + enc = OK; + } else { + BEmpl.LeeReg( (void *)&SEmpl, i ); + } + } + + return enc; +} + + + + /*************************************************************************\ +|* *| +|* DespliegaCalendario *| +|* *| +|* Descripci¢n: *| +|* Despliega un calendario y permite seleccionar el dia *| +|* y el mes a investigar. *| +|* *| +|* Entradas: *| +|* Punteros a donde guardar la seleccion *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +void DespliegaCalendario( void ) +{ + void far *fondo_pantalla; + + struct Make_Boton { + int Up, Left, Down, Right; + unsigned char Cdf, Cb1, Cb2; + unsigned char Ab, Pb; + unsigned char Isc, Sc; + }; + + extern struct Make_Boton far *Botones; + int i, IniSec; + char ok, BPush; + + IniSec = P_Sec( 4 - 1 ); + + #define DesplX 100 + #define DesplY 100 + + if ( (fondo_pantalla = (void far *)farmalloc( JD_imagesize( 120 + DesplX, 5 + DesplY, 380 + DesplX, 125 + DesplY ) ) ) != NULL ) + { + + // Recolocamos los botones para que esten centrados en la pantalla + for ( i = 0; i < 45; i++ ) + { + Botones[ i + IniSec ].Up += DesplY; + Botones[ i + IniSec ].Down += DesplY; + + Botones[ i + IniSec ].Left += DesplX; + Botones[ i + IniSec ].Right += DesplX; + } + + getimage( 120 + DesplX, 5 + DesplY, 380 + DesplX, 125 + DesplY, fondo_pantalla ); + + RellenaCalendario( DesplX, DesplY ); + + // Tratamiento de los pulsadores + ok = 0; + do { + + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + switch ( BPush = Comprueba_Secuencia( 4, NULL ) ) + { + case 0: + case -2: + case -1: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + // Retrocede un mes + case 43: + if ( MesActual > 1 ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + MesActual--; DiaActual = 1; + RellenaCalendario( DesplX, DesplY ); + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + } + break; + // Avanza un mes + case 44: + if ( MesActual < 12 ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + MesActual++; DiaActual = 1; + RellenaCalendario( DesplX, DesplY ); + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + } + break; + // Salir + case 45: + ok = 1; + break; + default: + if ( ( BPush - AjusteCalendario ) > 0 && ( BPush - AjusteCalendario ) <= DiasMes ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + + DiaActual = BPush - AjusteCalendario; + + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + + // Marcamos el dia y reconfiguramos todos los par metros + // para dicho dia... + + // Mostramos datos hasta que se nos acabe la pantalla + // para el dia dado. + + ok = 1; + } + break; + } + + + + } while ( !ok ); + + + // Recolocamos los botones a su posici¢n inicial + for ( i = 0; i < 45; i++ ) + { + Botones[ i + IniSec ].Up -= DesplY; + Botones[ i + IniSec ].Down -= DesplY; + + Botones[ i + IniSec ].Left -= DesplX; + Botones[ i + IniSec ].Right -= DesplX; + } + + putimage( 120 + DesplX, 5 + DesplY, fondo_pantalla, COPY_PUT ); + + farfree( fondo_pantalla ); + } + +} + + +void ImprimeBalance( char DiaMes, char DiaMostrar ) +{ + FILE *file_out; + long i, j, buffTmp, buffTmp1, buffTmp2; + char Dia, lok; + char buffer1[80], MejorHora; + char B1[15], B2[15], B3[15], B4[15]; + char Mes[12][10+1] = { "Enero","Febrero","Marzo","Abril","Mayo","Junio", + "Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre" }; + + // ¨ Donde debemos imprimir ? + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + + if ( DiaMes == DIARIO ) + { + fprintf( file_out, " ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\n\r"); + fprintf( file_out, "ÚÄ´ Balance de caja: %02d-%02d-%04d ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\n\r", DiaActual, MesActual, FechaGestionActual.da_year); + fprintf( file_out, "³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³±\n\r"); + fprintf( file_out, "³ ³±\n\r"); formatea_long( (long)S_IVentas1.Tickets, buffer1 ); + fprintf( file_out, "³ N§ de tickets: %-10s ³±\n\r", buffer1 ); formatea_long( (long)S_IVentas1.Cambio, buffer1 ); + fprintf( file_out, "³ Cambios efect: %-10s ³±\n\r", buffer1 ); + fprintf( file_out, "³ Inicio de caja: %02d:%02d ³±\n\r", S_IVentas1.AperturaCaja.hora, S_IVentas1.AperturaCaja.min ); + fprintf( file_out, "³ Fin de caja: %02d:%02d ³±\n\r", S_IVentas1.CierreCaja.hora, S_IVentas1.CierreCaja.min ); formatea_long( (long)S_IVentas1.TotalVendido[0], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[0], S_IVentas1.Hora[(0+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[1], buffer1 ); + fprintf( file_out, "³ Intentos de salir: %6ld %02d:00 - %02d:00 %11s ³±\n\r", (long)S_IVentas1.IntentosSalir, S_IVentas1.Hora[1], S_IVentas1.Hora[(1+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[2], buffer1 ); + fprintf( file_out, "³ Salidas con exito: %6ld %02d:00 - %02d:00 %11s ³±\n\r", (long)S_IVentas1.SalidasExito, S_IVentas1.Hora[2], S_IVentas1.Hora[(2+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[3], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[3], S_IVentas1.Hora[(3+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[4], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[4], S_IVentas1.Hora[(4+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[5], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[5], S_IVentas1.Hora[(5+1)%6], buffer1 ); + fprintf( file_out, "³ +_____________ ³±\n\r"); formatea_long( (long)S_IVentas1.TotalVentas, buffer1 ); + fprintf( file_out, "³ Total Ventas: %11s ³±\n\r", buffer1 ); formatea_long( (long)GastosCompras, buffer1 ); + fprintf( file_out, "³ Total Gastos: - %11s ³±\n\r", buffer1 ); + fprintf( file_out, "³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -------------- ³±\n\r"); formatea_long( (long)( S_IVentas1.TotalVentas - GastosCompras ), buffer1 ); + fprintf( file_out, "³ ³ Incidencias del dia: ³ Benef. Bruto: %11s ³±\n\r", buffer1 ); + fprintf( file_out, "³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³±\n\r"); + fprintf( file_out, "ÀÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±\n\r"); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[0] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[1] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[2] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[3] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[4] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[5] ); + fprintf( file_out, " ³ %-50s ³±\n\r", S_IVentas1.Notas[6] ); + fprintf( file_out, " ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±\n\r"); + } else { + fprintf( file_out, " ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\n\r"); + fprintf( file_out, "ÚÄ´ Balance Mensual: %10s %04d ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\n\r", Mes[MesActual-1], FechaGestionActual.da_year); + fprintf( file_out, "³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³±\n\r"); + fprintf( file_out, "³ ³±\n\r"); formatea_long( (long)S_IVentas1.Tickets, buffer1 ); + fprintf( file_out, "³ N§ de tickets: %-10s ³±\n\r", buffer1 ); formatea_long( (long)S_IVentas1.Cambio, buffer1 ); + fprintf( file_out, "³ Cambios efect: %-10s ³±\n\r", buffer1 ); + + fprintf( file_out, "³ Inicio de caja: %02d:%02d ³±\n\r", (int)S_IVentas1.AperturaCaja.hora, (int)S_IVentas1.AperturaCaja.min ); + fprintf( file_out, "³ Fin de caja: %02d:%02d ³±\n\r", (int)S_IVentas1.CierreCaja.hora, (int)S_IVentas1.CierreCaja.min ); formatea_long( (long)S_IVentas1.TotalVendido[0], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[0], S_IVentas1.Hora[(0+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[1], buffer1 ); + fprintf( file_out, "³ Intentos de salir: %6ld %02d:00 - %02d:00 %11s ³±\n\r", (long)S_IVentas1.IntentosSalir, S_IVentas1.Hora[1], S_IVentas1.Hora[(1+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[2], buffer1 ); + fprintf( file_out, "³ Salidas con exito: %6ld %02d:00 - %02d:00 %11s ³±\n\r", (long)S_IVentas1.SalidasExito, S_IVentas1.Hora[2], S_IVentas1.Hora[(2+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[3], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[3], S_IVentas1.Hora[(3+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[4], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[4], S_IVentas1.Hora[(4+1)%6], buffer1 ); formatea_long( (long)S_IVentas1.TotalVendido[5], buffer1 ); + fprintf( file_out, "³ %02d:00 - %02d:00 %11s ³±\n\r", S_IVentas1.Hora[5], S_IVentas1.Hora[(5+1)%6], buffer1 ); + fprintf( file_out, "³ +_____________ ³±\n\r"); formatea_long( (long)S_IVentas1.TotalVentas, buffer1 ); + fprintf( file_out, "³ Total Ventas: %11s ³±\n\r", buffer1 ); formatea_long( (long)GastosCompras, buffer1 ); + fprintf( file_out, "³ Total Gastos: - %11s ³±\n\r", buffer1 ); + fprintf( file_out, "³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ -------------- ³±\n\r"); formatea_long( (long)( S_IVentas1.TotalVentas - GastosCompras ), buffer1 ); + fprintf( file_out, "³ ³ Ventas desglosadas en DIAS ³ Benef. Bruto: %11s ³±\n\r", buffer1 ); + fprintf( file_out, "³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³±\n\r"); + fprintf( file_out, "Àij ³Ù±\n\r"); + formatea_long( VentasD[0], B1 ); + formatea_long( VentasD[1], B2 ); + formatea_long( VentasD[2], B3 ); + formatea_long( VentasD[3], B4 ); + fprintf( file_out, " ³ 1: %10s 2: %10s 3: %10s 4: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[4], B1 ); + formatea_long( VentasD[5], B2 ); + formatea_long( VentasD[6], B3 ); + formatea_long( VentasD[7], B4 ); + fprintf( file_out, " ³ 5: %10s 6: %10s 7: %10s 8: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[8], B1 ); + formatea_long( VentasD[9], B2 ); + formatea_long( VentasD[10], B3 ); + formatea_long( VentasD[11], B4 ); + fprintf( file_out, " ³ 9: %10s 10: %10s 11: %10s 12: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[12], B1 ); + formatea_long( VentasD[13], B2 ); + formatea_long( VentasD[14], B3 ); + formatea_long( VentasD[15], B4 ); + fprintf( file_out, " ³ 13: %10s 14: %10s 15: %10s 16: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[16], B1 ); + formatea_long( VentasD[17], B2 ); + formatea_long( VentasD[18], B3 ); + formatea_long( VentasD[19], B4 ); + fprintf( file_out, " ³ 17: %10s 18: %10s 19: %10s 20: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[20], B1 ); + formatea_long( VentasD[21], B2 ); + formatea_long( VentasD[22], B3 ); + formatea_long( VentasD[23], B4 ); + fprintf( file_out, " ³ 21: %10s 22: %10s 23: %10s 24: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[24], B1 ); + formatea_long( VentasD[25], B2 ); + formatea_long( VentasD[26], B3 ); + formatea_long( VentasD[27], B4 ); + fprintf( file_out, " ³ 25: %10s 26: %10s 27: %10s 28: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[28], B1 ); + formatea_long( VentasD[29], B2 ); + formatea_long( VentasD[30], B3 ); + fprintf( file_out, "Úij 29: %10s 30: %10s 31: %10s ³¿±\n\r", B1, B2, B3 ); + fprintf( file_out, "³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³±\n\r"); + fprintf( file_out, "³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³±\n\r"); + fprintf( file_out, "³ ³ Compras desglosadas / DIAS ³ ³±\n\r"); + fprintf( file_out, "³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³±\n\r"); + fprintf( file_out, "Àij ³Ù±\n\r"); + formatea_long( GastosComprasD[0+1], B1 ); + formatea_long( GastosComprasD[1+1], B2 ); + formatea_long( GastosComprasD[2+1], B3 ); + formatea_long( GastosComprasD[3+1], B4 ); + fprintf( file_out, " ³ 1: %10s 2: %10s 3: %10s 4: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[4+1], B1 ); + formatea_long( GastosComprasD[5+1], B2 ); + formatea_long( GastosComprasD[6+1], B3 ); + formatea_long( GastosComprasD[7+1], B4 ); + fprintf( file_out, " ³ 5: %10s 6: %10s 7: %10s 8: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[8+1], B1 ); + formatea_long( GastosComprasD[9+1], B2 ); + formatea_long( GastosComprasD[10+1], B3 ); + formatea_long( GastosComprasD[11+1], B4 ); + fprintf( file_out, " ³ 9: %10s 10: %10s 11: %10s 12: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[12+1], B1 ); + formatea_long( GastosComprasD[13+1], B2 ); + formatea_long( GastosComprasD[14+1], B3 ); + formatea_long( GastosComprasD[15+1], B4 ); + fprintf( file_out, " ³ 13: %10s 14: %10s 15: %10s 16: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[16+1], B1 ); + formatea_long( GastosComprasD[17+1], B2 ); + formatea_long( GastosComprasD[18+1], B3 ); + formatea_long( GastosComprasD[19+1], B4 ); + fprintf( file_out, " ³ 17: %10s 18: %10s 19: %10s 20: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[20+1], B1 ); + formatea_long( GastosComprasD[21+1], B2 ); + formatea_long( GastosComprasD[22+1], B3 ); + formatea_long( GastosComprasD[23+1], B4 ); + fprintf( file_out, " ³ 21: %10s 22: %10s 23: %10s 24: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[24+1], B1 ); + formatea_long( GastosComprasD[25+1], B2 ); + formatea_long( GastosComprasD[26+1], B3 ); + formatea_long( GastosComprasD[27+1], B4 ); + fprintf( file_out, " ³ 25: %10s 26: %10s 27: %10s 28: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( GastosComprasD[28+1], B1 ); + formatea_long( GastosComprasD[29+1], B2 ); + formatea_long( GastosComprasD[30+1], B3 ); + fprintf( file_out, "Úij 29: %10s 30: %10s 31: %10s ³¿±\n\r", B1, B2, B3 ); + fprintf( file_out, "³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³±\n\r"); + fprintf( file_out, "³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³±\n\r"); + fprintf( file_out, "³ ³ Beneficios / DIA ³ ³±\n\r"); + fprintf( file_out, "³ ³----------------------------ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³±\n\r"); + fprintf( file_out, "Àij ³Ù±\n\r"); + formatea_long( VentasD[0] - GastosComprasD[0+1], B1 ); + formatea_long( VentasD[1] - GastosComprasD[1+1], B2 ); + formatea_long( VentasD[2] - GastosComprasD[2+1], B3 ); + formatea_long( VentasD[3] - GastosComprasD[3+1], B4 ); + fprintf( file_out, " ³ 1: %10s 2: %10s 3: %10s 4: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[4] - GastosComprasD[4+1], B1 ); + formatea_long( VentasD[5] - GastosComprasD[5+1], B2 ); + formatea_long( VentasD[6] - GastosComprasD[6+1], B3 ); + formatea_long( VentasD[7] - GastosComprasD[7+1], B4 ); + fprintf( file_out, " ³ 5: %10s 6: %10s 7: %10s 8: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[8] - GastosComprasD[8+1], B1 ); + formatea_long( VentasD[9] - GastosComprasD[9+1], B2 ); + formatea_long( VentasD[10] - GastosComprasD[10+1], B3 ); + formatea_long( VentasD[11] - GastosComprasD[11+1], B4 ); + fprintf( file_out, " ³ 9: %10s 10: %10s 11: %10s 12: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[12] - GastosComprasD[12+1], B1 ); + formatea_long( VentasD[13] - GastosComprasD[13+1], B2 ); + formatea_long( VentasD[14] - GastosComprasD[14+1], B3 ); + formatea_long( VentasD[15] - GastosComprasD[15+1], B4 ); + fprintf( file_out, " ³ 13: %10s 14: %10s 15: %10s 16: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[16] - GastosComprasD[16+1], B1 ); + formatea_long( VentasD[17] - GastosComprasD[17+1], B2 ); + formatea_long( VentasD[18] - GastosComprasD[18+1], B3 ); + formatea_long( VentasD[19] - GastosComprasD[19+1], B4 ); + fprintf( file_out, " ³ 17: %10s 18: %10s 19: %10s 20: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[20] - GastosComprasD[20+1], B1 ); + formatea_long( VentasD[21] - GastosComprasD[21+1], B2 ); + formatea_long( VentasD[22] - GastosComprasD[22+1], B3 ); + formatea_long( VentasD[23] - GastosComprasD[23+1], B4 ); + fprintf( file_out, " ³ 21: %10s 22: %10s 23: %10s 24: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[24] - GastosComprasD[24+1], B1 ); + formatea_long( VentasD[25] - GastosComprasD[25+1], B2 ); + formatea_long( VentasD[26] - GastosComprasD[26+1], B3 ); + formatea_long( VentasD[27] - GastosComprasD[27+1], B4 ); + fprintf( file_out, " ³ 25: %10s 26: %10s 27: %10s 28: %10s ³±±\n\r", B1, B2, B3, B4 ); + formatea_long( VentasD[28] - GastosComprasD[28+1], B1 ); + formatea_long( VentasD[29] - GastosComprasD[29+1], B2 ); + formatea_long( VentasD[30] - GastosComprasD[30+1], B3 ); + fprintf( file_out, " ³ 29: %10s 30: %10s 31: %10s ³±±\n\r", B1, B2, B3 ); + fprintf( file_out, " ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ±\n\r"); + } + + fputc( 12, file_out ); // Salto de p gina + if ( Optar( 1, "¨ Continuar imprimiendo ?", "Si desea imprimir el listado", "de productos vendidos:", "­ Presione ACEPTAR !", NULL ) ) + { + fprintf( file_out, "\n\r-> Listado de productos vendidos: \n\r" ); + if ( DiaMostrar != -1 ) + { + fprintf( file_out, " ÚÄÄÄÄÄÂÄÄÄÄÄÄ¿\n\r" ); + fprintf( file_out, "C¢digo Descripci¢n Unds. Total Benef.B ³Hora ³ Cant ³\n\r" ); + fprintf( file_out, " ÃÄÄÄÄÄÅÄÄÄÄÄÄ´\n\r" ); + } else { + fprintf( file_out, " ÚÄÄÄÂÄÄÄÄÄÄÄ¿\n\r" ); + fprintf( file_out, "C¢digo Descripci¢n Unds. Total Benef.B ³Dia³ Cant ³\n\r" ); + fprintf( file_out, " ÃÄÄÄÅÄÄÄÄÄÄÄ´\n\r" ); + } + +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + for ( i = 0; i < B_IVentas2.Registros(); i ++ ) + { + lok = B_IVentas2.LeeReg( (void *)&S_IVentas2, i ); + if ( DiaMostrar != -1 ) + while( i <= B_IVentas2.Registros() && S_IVentas2.VentaTotal[DiaMostrar-1] == 0 ) + { + i ++; lok = B_IVentas2.LeeReg( (void *)&S_IVentas2, i ); + }; + + if ( lok == OK ) + { + if ( DiaMostrar != -1 ) + { + // Cantidad total / ( Busqueda mejor cantidad ) + { + buffTmp = MejorHora = 0; + for ( j = 0; j < 6; j++ ) + { + buffTmp += (long)S_IVentas2.Cantidad[DiaMostrar-1][j]; + if ( S_IVentas2.Cantidad[DiaMostrar-1][MejorHora] < S_IVentas2.Cantidad[DiaMostrar-1][j] ) + MejorHora = j; + } + } + } else { + // Total unidades en el mes ( Mejor Dia ) + buffTmp = 0; buffTmp2 = 0; + for ( Dia = 0; Dia < DiasMes; Dia++ ) + { + buffTmp1 = 0; + for ( j = 0; j < 6; j++ ) + { + buffTmp += (long)S_IVentas2.Cantidad[Dia][j]; + buffTmp1+= (long)S_IVentas2.Cantidad[Dia][j]; + } + if ( buffTmp2 < buffTmp1 ) + { + MejorHora = Dia; buffTmp2 = buffTmp1; + } + } + } + + formatea_long( buffTmp, buffer1 ); + fprintf( file_out, "%7ld %30s %6s ", S_IVentas2.CodigoR, S_IVentas2.Nombre, buffer1 ); + + formatea_long( S_IVentas2.VentaTotal[DiaMostrar-1], buffer1 ); + fprintf( file_out, "%9s ", buffer1 ); + + if ( DiaMostrar != -1 ) + { + formatea_long( S_IVentas2.VentaTotal[DiaMostrar-1] - S_IVentas2.PrecioCosto[DiaMostrar-1], buffer1 ); + fprintf( file_out, "%9s ³%02d-%02d³", buffer1, (int)S_IVentas1.Hora[MejorHora], (int)S_IVentas1.Hora[(MejorHora+1)%6] ); + + formatea_long( S_IVentas2.Cantidad[DiaMostrar-1][MejorHora], buffer1 ); + fprintf( file_out, "%6s³\n\r", buffer1 ); + } else { + formatea_long( S_IVentas2.VentaTotal[DiaMostrar-1] - S_IVentas2.PrecioCosto[DiaMostrar-1], buffer1 ); + fprintf( file_out, "%9s ³ %02d ³", buffer1, MejorHora ); + + formatea_long( buffTmp2, buffer1 ); + fprintf( file_out, "%8s³\n\r", buffer1 ); + } + } + } + if ( DiaMostrar != -1 ) + fprintf( file_out, " ÀÄÄÄÄÄÁÄÄÄÄÄÄÙ\n\r" ); + else + fprintf( file_out, " ÀÄÄÄÁÄÄÄÄÄÄÄÙ\n\r" ); + + } + fputc( 12, file_out ); // Salto de p gina + + + if ( !Config.Impresora.Printer ) + fclose( file_out ); + +} \ No newline at end of file diff --git a/TPV_CCLT.CPP b/TPV_CCLT.CPP new file mode 100644 index 0000000..773c35f --- /dev/null +++ b/TPV_CCLT.CPP @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +/* +BDatos BClt; // Base de datos de Clientes +INFO_EMPRESAS SClt; // Estructura de Clientes +*/ + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ + + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n para escoger Empresa | +| | + \*************************************/ + + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ + + + + + /**************************************************************************\ +|* *| +|* CompraClientes *| +|* *| +|* Descripci¢n: *| +|* Inicializaci¢n y consultas global de la fichas de Clientes *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CompraClientes(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrClt; // Cliente sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 150, "systm\\Tpv.img"); + + + getch(); +} diff --git a/TPV_CFG.CPP b/TPV_CFG.CPP new file mode 100644 index 0000000..a7e656f --- /dev/null +++ b/TPV_CFG.CPP @@ -0,0 +1,958 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" +#include "tpv_num.h" + + +CONFIG Config = { + LTBKSLASH_FILL, EGA_BLUE, EGA_BLACK, + EGA_RED, EGA_BLACK, EGA_DARKGRAY, + EGA_LIGHTRED, EGA_DARKGRAY, + EGA_WHITE, EGA_RED, EGA_BLACK, EGA_WHITE, + { 0, { "PrnFile.out" }, 66, "", "", { "\0", "\0", "\0", "\0" }, + { "\0", "\0", "\0", "\0" } }, + // Horas inicio, y fin + { + { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + 5, // 5 de la ma¤ana ( cambio horario ) + 0, + 0 + }, + + // Impr. Ticket / Cobro Completo / InicioCaja + { 0, 0, 6, 0 }, + + 0, + // Tiempo para lanzar el protector de pantalla (en sg.) + 120, + + "fonts\\prot_ptl.fnt", + "fonts\\vent_msg.fnt", + + { 8, 12, 16, 20, 24, 4 }, + + 1, 2 + + }; + +BDatos BConfig; +BDatos BThemes; + +void PreviewEntorno( void ); +void NoStandard( int BPush ); +void MuestraCFG( int Campo, int Item, char como ); + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ +#define CFG_BASE 120 +#define CFG_BASEd 10 + +#define FUENTES 0x00 + +#define COLOR 0x01 +#define FONDO 0x02 +#define TAMANO 0x04 +#define FUENTE 0x08 + + +typedef struct +{ + char Elementos[40]; + char Propiedades; + + char Color, Fondo; + char Tamano, Fuente[40]; + +} ELEMENTOS; + +typedef struct +{ + char Tema[40]; + ELEMENTOS Elementos[7]; +} THEMES; + + // Cada elemento tiene unas propiedades, de las cuales depende el poder usar + // los distintos pulsadores o no. + THEMES Tema = { + "Combinaci¢n standard", + { + { "Fondo de pantalla", COLOR | FONDO | FUENTE }, + { "Texto normal", COLOR | FONDO }, + { "Texto se¤alado", COLOR | FONDO }, + { "Digitos (numeros grandes)", COLOR | FONDO }, + { "Digitos (borde del n£mero)",COLOR }, + { "Fuente del Protector", FUENTE }, + { "Letrero digital", COLOR | FONDO | FUENTE } + // A¥ADIR NUEVOS ELEMENTOS ( RESPETANDO NO SOLAPAR LAS Ä^ + } + }; +char Elementos[][40] = { + { "Fondo de pantalla" }, + { "Texto normal" }, + { "Texto se¤alado" }, + { "Digitos (numeros grandes)" }, + { "Digitos (borde del n£mero)" }, + { "Fuente del Protector" }, + { "Letrero digital" } + // A¥ADIR NUEVOS ELEMENTOS ( RESPETANDO NO SOLAPAR LAS Ä^ + + }; + +int NumElementos = 7, NumFuentes, NumCombinaciones; + +int ListaDesplegable( char Texto[][40], int NumEtos, int DesX, int DesY, char POS ); +void CargaFuentesElemento( int NumElemento ); +void MuestraElemento( int CurrElemento ); +int ObtenTamano( int TOld ); +int ObtenColor( void ); + +void EditCFG( int Campo, int Item, char como ); + + /**************************************************************************\ +|* *| +|* ConfigurarEntorno *| +|* *| +|* Descripci¢n: *| +|* Permite cambiar las opciones de configuraci¢n... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +char Combinaciones[50][40], Fuentes[50][40]; + +void ConfigurarEntorno( void ) +{ + int CurrCombinacion, CurrElemento, CurrFuente, i, BPush, ok, oldTmp; + int CurrRow, key; + char buffer[80]; + + +char NumItems[] = { 7, 14 }; +char ItemActual = 0; + + + CurrCombinacion = 0; + CurrElemento = 0; + CurrFuente = 0; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); + bar( 0, 0, 640, 480 ); + + Imprime_Estaticos( CFG_BASE+0, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + // Flecha hacia abajo + ponicono( 184, 276, flecha, 2 ); + ponicono( 184, 331, flecha, 2 ); + ponicono( 184, 386, flecha, 2 ); + + + if ( BThemes.AbrirReg( "datos\\themes.cfg", sizeof( THEMES ) ) == ERROR ) + Error( 1, BThemes.cError); + + // Inicializamos el tema por defecto + if ( BThemes.Registros() == 0 ) + { + Tema.Elementos[0].Fondo = Config.FillBgF; + Tema.Elementos[0].Color = Config.FillBgC; Tema.Elementos[0].Tamano = Config.FillBgS; + Tema.Elementos[1].Color = Config.TxtFgN ; Tema.Elementos[1].Fondo = Config.TxtBgN ; + Tema.Elementos[2].Color = Config.TxtFgI ; Tema.Elementos[2].Fondo = Config.TxtBgI ; + Tema.Elementos[3].Color = Config.NumFg ; Tema.Elementos[3].Fondo = Config.NumBg ; + Tema.Elementos[4].Color = Config.NumLn ; + strcpy( Tema.Elementos[5].Fuente, Config.Prot_fnt ); + + Tema.Elementos[6].Color = Config.DigFg ; Tema.Elementos[6].Fondo = Config.DigBg ; + strcpy( Tema.Elementos[6].Fuente, Config.Vent_msg ); + if ( BThemes.InsReg( (void *)&Tema, 0, ARRIBA ) == ERROR ) + Error( 1, BThemes.cError); + } else + if ( BThemes.LeeReg( (void *)&Tema, CurrCombinacion ) == ERROR ) + Error( 1, BThemes.cError); + + CargaFuentesElemento( CurrElemento ); + MuestraElemento( CurrElemento ); + PreviewEntorno(); + + Imprime_Estaticos( ItemActual+125, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + for ( CurrRow = 0; CurrRow < NumItems[ ItemActual ]; CurrRow ++ ) + MuestraCFG( CurrRow, ItemActual, NORMAL ); + CurrRow = 0; + + ok = 0; + do { + + MuestraCFG( CurrRow, ItemActual, INTENSO ); + BPush = Comprueba_Secuencia( CFG_BASEd, NULL ); + MuestraCFG( CurrRow, ItemActual, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + if ( (key=getch()) != 27 && key != 13 ) + ungetch( key ); + EditCFG( CurrRow, ItemActual, NORMAL ); + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + CurrRow--; if ( CurrRow < 0 ) CurrRow = NumItems[ItemActual] - 1; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + CurrRow++; if ( CurrRow >= NumItems[ItemActual] ) CurrRow = 0; + break; + // Inicio + case 71: + CurrRow = 0; + break; + // Fin + case 79: + CurrRow = NumItems[ItemActual]; + break; + } + break; + // Men£ Principal + case 1: + ok = 1; + break; + // Combinaciones + case 2: + break; + // Guardar combinaci¢n + case 3: +// GuardaCombinacion(); + break; + // Eliminar combinaci¢n + case 4: +/* + if ( CurrCombinacion != 0 && Optar( 1, "Eliminar combinaci¢n", "Confirme la eliminaci¢n", "de la combinaci¢n actual.", NULL ) ) + { + if ( BThemes.DelReg( CurrCombinacion ) == ERROR ) + Error( 1, BThemes.cError); + CurrCombinacion --; + if ( BThemes.LeeReg( (void *)&Config, CurrCombinacion ) == ERROR ) + Error( 1, BThemes.cError); + PreviewEntorno(); + } +*/ + break; + // Elementos + case 5: + oldTmp = CurrElemento; + CurrElemento = ListaDesplegable( Elementos, NumElementos, 5, 330, ARRIBA ); + if ( oldTmp != CurrElemento ) + { + CargaFuentesElemento( CurrElemento ); + MuestraElemento( CurrElemento ); + PreviewEntorno(); + } + break; + // Fuentes + case 6: + if ( Tema.Elementos[CurrElemento].Propiedades & FUENTE ) + { + oldTmp = CurrFuente; + CurrFuente = ListaDesplegable( Fuentes, NumFuentes, 5, 385, ARRIBA ); + if ( oldTmp != CurrFuente ) + { + if ( CurrElemento == 0 ) + Tema.Elementos[CurrElemento].Tamano = CurrFuente; + + strcpy( Tema.Elementos[CurrElemento].Fuente, Fuentes[CurrFuente] ); + + PreviewEntorno(); + } + } + break; + // Color + case 7: + if ( Tema.Elementos[CurrElemento].Propiedades & COLOR ) + { + Tema.Elementos[CurrElemento].Color = ObtenColor(); + PreviewEntorno(); + setfillstyle( SOLID_FILL, Tema.Elementos[CurrElemento].Color ); + bar( 292, 332, 308, 348 ); + } + break; + // Fondo + case 8: + if ( Tema.Elementos[CurrElemento].Propiedades & FONDO ) + { + Tema.Elementos[CurrElemento].Fondo = ObtenColor(); + PreviewEntorno(); + setfillstyle( SOLID_FILL, Tema.Elementos[CurrElemento].Fondo ); + bar( 292, 360, 308, 376 ); + } + break; + // Tama¤o + case 9: + if ( Tema.Elementos[CurrElemento].Propiedades & TAMANO ) + { + Tema.Elementos[CurrElemento].Tamano = ObtenTamano( Tema.Elementos[CurrElemento].Tamano ); + PreviewEntorno(); + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 264, 387, 308, 403 ); + sprintf( buffer, "%3d", Tema.Elementos[CurrElemento].Tamano ); + outtextxy( 264, 387, buffer ); + } + break; + // Impresora + // Ventas + // Varios... + case 10: + case 11: + case 12: + ItemActual = BPush - 10; + Imprime_Estaticos( ItemActual+125, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + for ( CurrRow = 0; CurrRow < NumItems[ ItemActual ]; CurrRow ++ ) + MuestraCFG( CurrRow, ItemActual, NORMAL ); + CurrRow = 0; + break; + default: + NoStandard( BPush ); + break; + } + + } while( !ok ); + + + // Copiamos el Tema actual a las opciones de configuracion + Config.FillBgF= Tema.Elementos[0].Fondo; + Config.FillBgC= Tema.Elementos[0].Color; Config.FillBgS= Tema.Elementos[0].Tamano; + Config.TxtFgN = Tema.Elementos[1].Color; Config.TxtBgN = Tema.Elementos[1].Fondo; + Config.TxtFgI = Tema.Elementos[2].Color; Config.TxtBgI = Tema.Elementos[2].Fondo; + Config.NumFg = Tema.Elementos[3].Color; Config.NumBg = Tema.Elementos[3].Fondo; + Config.NumLn = Tema.Elementos[4].Color; + + strcpy( Config.Prot_fnt, Tema.Elementos[5].Fuente ); + + Config.DigFg = Tema.Elementos[6].Color ; Config.DigBg = Tema.Elementos[6].Fondo ; + strcpy( Config.Vent_msg, Tema.Elementos[6].Fuente ); + + // Salvamos la configuraci¢n + if ( BConfig.EscribeReg( (void *)&Config, 0 ) == ERROR ) + Error( 1, BConfig.cError); + + // Salvamos la configuraci¢n + if ( BThemes.EscribeReg( (void *)&Tema, CurrCombinacion ) == ERROR ) + Error( 1, BThemes.cError); + + + BThemes.CerrarReg(); +} + + /**************************************************************************\ +|* *| +|* PreviewPantalla *| +|* *| +|* Descripci¢n: *| +|* Realiza el preview de la mini-pantalla *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void PreviewEntorno( void ) +{ + + +// setbkcolor( Tema.Elementos[0].Fondo ); + setfillstyle( Tema.Elementos[0].Tamano, Tema.Elementos[0].Color ); + bar( 6, 36, 309, 239 ); + + Imprime_Estaticos( CFG_BASE+1, "systm\\Tpv.img" ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + + // Campos + setfillstyle( SOLID_FILL, Tema.Elementos[1].Fondo ); + bar( 51, 55, 179, 63 ); + bar( 41, 67, 84, 75 ); bar( 121, 67, 179, 75 ); + bar( 51, 79, 99, 87 ); bar( 141, 79, 179, 87 ); + + // Visualizaci¢n R pida + bar( 12, 119, 68, 221 ); + bar( 74, 119, 214, 221 ); + bar( 220, 119, 243, 221 ); + bar( 249, 119, 303, 221 ); + + // Texto Iluminado + setfillstyle( SOLID_FILL, Tema.Elementos[2].Fondo ); + setcolor( Tema.Elementos[2].Color ); + + bar( 15, 122, 67, 129 ); + outtextxy( 11, 120, " 000124 " ); + + setcolor( Tema.Elementos[1].Color ); + outtextxy( 11, 120, " Albaranes de compra " ); + outtextxy( 11, 130, " 000136 Aliados en el juego " ); + outtextxy( 11, 140, " 000250 Baticoco de mono " ); + outtextxy( 11, 150, " 000045 Garganta profunda " ); + outtextxy( 8, 120, " 003 1.500 " ); + outtextxy( 8, 130, " 045 9.999 " ); + outtextxy( 8, 140, " 009 415 " ); + outtextxy( 8, 150, " 010 2.250 " ); + + setcolor( EGA_WHITE ); + outtextxy( 10, 224, " C¢digo de la descripci¢n." ); + + Imprime_Estaticos( CFG_BASE+2, "systm\\Tpv.img" ); + + +} + + + +void MuestraElemento( int CurrElemento ) +{ + char buffer[80]; + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + setfillstyle( SOLID_FILL, Config.TxtBgN ); + setcolor( Config.TxtFgN ); + + // Nombre del elemento + bar( 7, 332, 178, 348 ); + outtextxy( 10, 332, Tema.Elementos[CurrElemento].Elementos ); + + // Fuente + bar( 7, 387, 178, 403 ); + if ( Tema.Elementos[CurrElemento].Propiedades & FUENTE ) + outtextxy( 10, 387, Tema.Elementos[CurrElemento].Fuente ); + + // Color + if ( Tema.Elementos[CurrElemento].Propiedades & COLOR ) + setfillstyle( SOLID_FILL, Tema.Elementos[CurrElemento].Color ); + else + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 292, 332, 308, 348 ); + + // Fondo + if ( Tema.Elementos[CurrElemento].Propiedades & FONDO ) + setfillstyle( SOLID_FILL, Tema.Elementos[CurrElemento].Fondo ); + else + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 292, 360, 308, 376 ); + + // Tamano + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 264, 387, 308, 403 ); + sprintf( buffer, "%3d", Tema.Elementos[CurrElemento].Tamano ); + if ( Tema.Elementos[CurrElemento].Propiedades & TAMANO ) + outtextxy( 264, 387, buffer ); + +} + + +int ObtenTamano( int TOld ) +{ + char buffer[80]; + + sprintf ( buffer, "%d", TOld ); + if ( ( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, 264, 387, 308, 403 ) >> 8 ) ) + itoa( TOld, buffer, 10 ); + + return atoi(buffer); +} + + +void CargaFuentesElemento( int NumElemento ) +{ + // Cargamos el tipo de fuente necesario + switch( NumElemento ) + { + // Fondo de pantalla + case 0: + strcpy( Fuentes[ 0], "Sin Fondo" ); + strcpy( Fuentes[ 1], "Fondo Solido" ); + strcpy( Fuentes[ 2], "Lineas Horizontales" ); + strcpy( Fuentes[ 3], "Lineas Inclinadas ////" ); + strcpy( Fuentes[ 4], "Lineas Inclinadas2 ////" ); + strcpy( Fuentes[ 5], "Lineas Inclinadas3 \\\\\\\\" ); + strcpy( Fuentes[ 6], "Lineas Inclinadas4 \\\\\\\\" ); + strcpy( Fuentes[ 7], "Crusado suave" ); + strcpy( Fuentes[ 8], "Crusado Grueso" ); + strcpy( Fuentes[ 9], "Lineas intercaladas" ); + strcpy( Fuentes[10], "Punteado" ); + strcpy( Fuentes[11], "Lineas semi-juntas" ); + NumFuentes = 12; + break; + // Fuente del Protector + // Letrero digital + case 5: + case 6: + // Realizamos una recopilaci¢n de fuentes .FNT +// NumFuentes = AdquirirArchivos( Fuentes, "FONTS\*.FNT" ); + NumFuentes = 0; + break; + default: + NumFuentes = 0; + } +} + + + + +//////////////////////////////////////////////////////////////////////// +//////////////////////C O N F I G U R A C I O N///////////////////////// +//////////////////////////////////////////////////////////////////////// +char ColorR[18*18+10], ColorG[18*18+10], ColorB[18*18+10]; +void RecuadraRGB( int Color ); + +int ObtenColor( void ) +{ + char BPush, ok, Reg; + int CurrCol, R, G, B; + + Optar( ENCUADRE, "Elija Color, o definal¢:", NULL ); + Imprime_Estaticos( CFG_BASE+3, "systm\\Tpv.img" ); + + CurrCol = 1; + RecuadraRGB( CurrCol ); + ok = 0; + do { + + Imprime_Bordes( CFG_BASEd + 1, ( CurrCol + 2 ), 11 ); + BPush = Comprueba_Secuencia( CFG_BASEd + 1, /*RatonParaColor*/NULL ); + Imprime_Bordes( CFG_BASEd + 1, ( CurrCol + 2 ), -1 ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + // Aceptar + case 1: + Reg = 0; + ok = 1; + break; + // Cancelar + case 2: + Reg = 1; + ok = 1; + break; + default: + if ( BPush >=2 && BPush <= 18 ) + { + CurrCol = BPush - 2; + putimage( 413, 295 - R - 18, ColorR, COPY_PUT ); + putimage( 428, 295 - G - 18, ColorG, COPY_PUT ); + putimage( 443, 295 - B - 18, ColorB, COPY_PUT ); + RecuadraRGB( CurrCol ); + } + } + + } while( !ok ); + + if ( Reg == 1 ) + { + // Restauro los registros anteriores + + } + + Optar( ENCUADRE, "Elija Color, o definal¢:", NULL ); + + return (CurrCol - 1); +} + +void RecuadraRGB( int Color ) +{ + char R, G, B; + + R = G = B = 0; + + getimage( 413, 295 - R - 18, 413 + 18, 295 - R, ColorR ); + getimage( 428, 295 - G - 18, 428 + 18, 295 - G, ColorG ); + getimage( 443, 295 - B - 18, 443 + 18, 295 - B, ColorB ); + + ponicono( 413, 295 - R - 18, led_off, 1); + ponicono( 428, 295 - G - 18, led_off, 1); + ponicono( 443, 295 - B - 18, led_off, 1); + +} + +int ListaDesplegable( char Texto[][40], int NumEtos, int DesX, int DesY, char POS ) +{ + static int PorDonde, NumEl = -1; + + if ( NumEl != NumEtos ) + { + NumEl = NumEtos; PorDonde = 0; + } + PorDonde ++; if ( PorDonde >= NumEtos ) PorDonde = 0; + + + // Fuente + setfillstyle( SOLID_FILL, Config.TxtBgN ); + setcolor( Config.TxtFgN ); + bar( DesX+2, DesY+2, DesX + 175, DesY + 18 ); + outtextxy( DesX + 5, DesY + 2, Texto[PorDonde] ); + + return PorDonde; +} + + + +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛA partir de aqui, ya no es standard...ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +void MuestraCFG( int Campo, int Item, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80], draw; + int i; + + draw = 1; + switch( Item ) + { + case 0: + switch ( Campo ) + { + // Imprimir en un archivo ( SI/NO ) + case 0: + draw = 0; + X0 = 350; Y0 = 95; X1 = 370; Y1 = 115; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? EGA_LIGHTGRAY : EGA_RED ); + bar( X0, Y0, X1, Y1 ); + + if ( !Config.Impresora.Printer ) + ponicono( X0+5, Y0+5, led_on, 1 ); + else + ponicono( X0+5, Y0+5, led_off, 1 ); + break; + // Archivo donde imprimir + case 1: + X0 = 541; Y0 = 99; X1 = 629; Y1 = 116; + sprintf( buffer, "%s", Config.Impresora.PrintTo ); + break; + // Numero de lineas + case 2: + X0 = 541; Y0 = 124; X1 = 629; Y1 = 141; + sprintf( buffer, "%d", Config.Impresora.Lineas ); + break; + + // Imprimir normal + case 3: + X0 = 466; Y0 = 176; X1 = 629; Y1 = 193; + sprintf( buffer, "%s", Config.Impresora.Normal ); + break; + // Imprimir Condensado + case 4: + X0 = 466; Y0 = 201; X1 = 631; Y1 = 218; + sprintf( buffer, "%s", Config.Impresora.Condensado ); + break; + // Comentario inicial ( Tickets ventas ) + case 5: + draw = 0; + X0 = 421; Y0 = 250; X1 = 629; Y1 = 310; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + for ( i=0; i<4; i++) + outtextxy( X0+3, Y0 + i*15, &Config.Impresora.PrincipioTickets[i][0] ); + break; + // Comentario inicial ( Tickets ventas ) + case 6: + draw = 0; + X0 = 421; Y0 = 321; X1 = 629; Y1 = 381; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + for ( i=0; i<4; i++) + outtextxy( X0+3, Y0 + i*15, &Config.Impresora.FinTickets[i][0] ); + break; + } + break; + case 1: + switch( Campo ) + { + case 0: + X0 = 541; Y0 = 39; X1 = 629; Y1 = 56; + { + auto char TipoProtector[3][10] = { "Scroll V.", "Externo", "Ninguno" }; + sprintf( buffer, "%s", TipoProtector[Config.TProtector] ); + } + break; + case 1: + X0 = 541; Y0 = 64; X1 = 629; Y1 = 81; + sprintf( buffer, " %03d", (int)Config.Protector ); + break; + case 2: + X0 = 541; Y0 = 120; X1 = 629; Y1 = 134; + sprintf( buffer, " %02d", (int)Config.VProductos.CambioHorario ); + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + X0 = 352; Y0 = 181 + 20*(Campo-3); X1 = 379; Y1 = Y0 + 16; + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( /*X0+*/381, Y0, /*X1+*/500, Y1 ); + sprintf( buffer, " :00 >-> %02d:00", (int)Config.HorasMedicion[ ( Campo - 3 + 1 ) % 6 ] ); + TextoDoble( X0, Y0, buffer ); + sprintf( buffer, " %02d", (int)Config.HorasMedicion[Campo-3] ); + break; + case 9: + case 10: + case 11: + case 12: + X0 = 352; Y0 = 331 + 20*(Campo-9); X1 = 379; Y1 = Y0 + 16; + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( /*X0+*/381, Y0, /*X1+*/500, Y1 ); + sprintf( buffer, " :00 >-> %02d:00", (int)Config.VProductos.HoraIni[ ( Campo - 9 + 1 ) % 4 ].hora ); + TextoDoble( X0, Y0, buffer ); + sprintf( buffer, " %02d", (int)Config.VProductos.HoraIni[ ( Campo - 9 ) % 4 ].hora ); + break; + // Permitir modificar P.C en compras ? + case 13: + X0 = 581; Y0 = 424; X1 = 629; Y1 = 441; + sprintf( buffer, "%s", Config.VProductos.CambioPC == 1 ? "SI" : "NO" ); + break; + // Reloj + case 14: + break; + } + break; + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } + + +} + +void EditCFG( int Campo, int Item, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80], draw; + + draw = 1; + switch( Item ) + { + case 0: + switch ( Campo ) + { + // Imprimir en un archivo ( SI/NO ) + case 0: + draw = 0; + X0 = 350; Y0 = 95; X1 = 370; Y1 = 115; + + Config.Impresora.Printer = !Config.Impresora.Printer; + + while( kbhit() ) getch(); + break; + // Archivo donde imprimir + case 1: + X0 = 541; Y0 = 99; X1 = 629; Y1 = 116; + strcpy( buffer, Config.Impresora.PrintTo ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( Config.Impresora.PrintTo, buffer ); + break; + // Numero de lineas + case 2: + X0 = 541; Y0 = 124; X1 = 629; Y1 = 141; + sprintf( buffer, "%d", Config.Impresora.Lineas ); + if ( !( InputCadenaG( buffer, 1, 3, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + Config.Impresora.Lineas = atoi( buffer ); + + Config.Impresora.Lineas = Config.Impresora.Lineas < 30 ? 30 : Config.Impresora.Lineas; + break; + + // Imprimir normal + case 3: + X0 = 466; Y0 = 176; X1 = 629; Y1 = 193; + strcpy( buffer, Config.Impresora.Normal ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( Config.Impresora.Normal, buffer ); + break; + // Imprimir Condensado + case 4: + X0 = 466; Y0 = 201; X1 = 631; Y1 = 218; + strcpy( buffer, Config.Impresora.Condensado ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( Config.Impresora.Condensado, buffer ); + break; + // Comentario inicial ( Tickets ventas ) + case 5: + X0 = 424; Y0 = 250; X1 = 629; Y1 = 310; + EditComentario( (char *)(&Config.Impresora.PrincipioTickets[0][0]), 3, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1, 15 ); + break; + // Comentario inicial ( Tickets ventas ) + case 6: + X0 = 424; Y0 = 321; X1 = 629; Y1 = 381; + EditComentario( (char *)(&Config.Impresora.FinTickets[0][0]), 3, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1, 15 ); + break; + } + break; + case 1: + switch( Campo ) + { + case 0: + Config.TProtector = (++Config.TProtector)%3; + break; + case 1: + X0 = 541; Y0 = 64; X1 = 629; Y1 = 81; + sprintf( buffer, "%d", (int)Config.Protector ); + if ( !( InputCadenaG( buffer, 1, 3, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + Config.Protector = atof( buffer ); + break; + case 2: + X0 = 541; Y0 = 120; X1 = 629; Y1 = 134; + sprintf( buffer, "%d", (int)Config.VProductos.CambioHorario ); + if ( !( InputCadenaG( buffer, 1, 2, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + Config.VProductos.CambioHorario = atoi( buffer ) % 25; + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + X0 = 352; Y0 = 181 + 20*(Campo-3); X1 = 379; Y1 = Y0 + 16; + sprintf( buffer, "%d", (int)Config.HorasMedicion[Campo-3] ); + if ( !( InputCadenaG( buffer, 1, 2, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + Config.HorasMedicion[Campo-3] = atoi( buffer ) % 25; + MuestraCFG( ( ( Campo - 1) < 3 ) ? 8 : ( Campo - 1), Item, NORMAL ); + } + break; + case 9: + case 10: + case 11: + case 12: + X0 = 352; Y0 = 331 + 20*(Campo-9); X1 = 379; Y1 = Y0 + 16; + sprintf( buffer, "%d", (int)Config.VProductos.HoraIni[Campo-9].hora ); + if ( !( InputCadenaG( buffer, 1, 2, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + Config.VProductos.HoraIni[Campo-9].hora = atoi( buffer ) % 25; + MuestraCFG( ( (Campo - 1) < 0 ) ? 12 : ( Campo - 1), Item, NORMAL ); + } + break; + // Permitir modificar P.C en compras ? + case 13: + X0 = 581; Y0 = 424; X1 = 629; Y1 = 441; + Config.VProductos.CambioPC = !Config.VProductos.CambioPC; + break; + } + break; + } + + while( kbhit() ) getch(); + +} +/* +void MuestraCFG( int Campo, int Item, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80], draw; + + draw = 1; + switch( Item ) + { + case 0: + switch ( Campo ) + { + // Imprimir en un archivo ( SI/NO ) + case 0: + draw = 0; + X0 = 350; Y0 = 95; X1 = 370; Y1 = 115; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? EGA_LIGHTGRAY : EGA_RED ); + bar( X0, Y0, X1, Y1 ); + + if ( !Config.Impresora.Printer ) + ponicono( X0+5, Y0+5, led_on, 1 ); + else + ponicono( X0+5, Y0+5, led_off, 1 ); + break; + // Archivo donde imprimir + case 1: + X0 = 541; Y0 = 99; X1 = 629; Y1 = 116; + sprintf( buffer, "%s", Config.Impresora.PrintTo ); + break; + // Numero de lineas + case 2: + X0 = 541; Y0 = 124; X1 = 629; Y1 = 141; + sprintf( buffer, "%d", Config.Impresora.Lineas ); + break; + + // Imprimir normal + case 3: + X0 = 466; Y0 = 324; X1 = 629; Y1 = 341; + sprintf( buffer, "%s", Config.Impresora.Normal ); + break; + // Imprimir Condensado + case 4: + X0 = 466; Y0 = 349; X1 = 631; Y1 = 366; + sprintf( buffer, "%s", Config.Impresora.Condensado ); + break; + } + break; + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } + + +} +*/ + + + /**************************************************************************\ +|* *| +|* NoStandard *| +|* *| +|* Descripci¢n: *| +|* Opciones no standard de esta configuraci¢n... *| +|* *| +|* Entradas: N§ de opci¢n seleccionada *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void NoStandard( int BPush ) +{ + + +} \ No newline at end of file diff --git a/TPV_CMP.CPP b/TPV_CMP.CPP new file mode 100644 index 0000000..7241c0b --- /dev/null +++ b/TPV_CMP.CPP @@ -0,0 +1,2470 @@ +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_CMP 15 +#define NLINEAS_PROVcmp 9 + +#define NORMAL 0 +#define BARRAS 1 + +BDatos BCmp; // Base de datos de Compras +COMPRAS SCmp; // Estructura de referencias + +/* +BDatos BVentProv; // Compras por proveedor +CMP_PROV SVentProv; // Ventas de proveedores +*/ + // Dia y mes actual para la gestion +char DiaActual, MesActual; +long RegCompras[31 + 2]; // Indice para cado uno de los dias del mes + 2 + +extern char EmpresaActual[9]; // Empresa a la que se le realizan las gestiones + +char AjusteCalendario; // Ajuste para los dias del calendario +char DiasMes; // Dias que tiene el mes actual + +extern BDatos BRef; // Base de datos de Referencias +extern INFO_PRODUCTOS SRef; // Estructura de referencias + // Para guardar las posiciones de los c¢digos +BUSQUEDA_REF far *BusquedaRef; + +extern BDatos BProv; // Base de datos de Proveedores +extern INFO_PROVEEDORES SProv; // Estructura de Proveedores + +char BusquedaDirecta; // Tipo de busqueda en Referencias + +char NomProveedor[80]; // Nombre del proveedor ( Datos Temporales ) + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +long PosicionDia( char Dia ); +void MuestraDatosCmp( long RowStart ); +void MuestraAyudaCmp( char columna ); +void CmpNuevoRegistro( COMPRAS *MSCmp ); +void EditItemCmp( char columna, int linea ); +void SeleccionaMesCompras( int NivelAcceso ); +void ManipulaIndiceDia( char Dia, char Accion ); +void MuestraCmp( char columna, int linea, char como ); +void ObtenCoordenadasCmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + +extern long ActualizaStock( int Cantidad, int VentaCompra, char ComprasVentas ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de busqueda de compras | +| | + \*************************************/ +int Match_Cmp( COMPRAS A, COMPRAS B ); +int ObtenMatchCmp( COMPRAS *MCmp, int *MesDia ); +void EditMatchCmp( char Row, COMPRAS * MCmp, int *MesDia ); +void MatchDrawCmp( char Row, COMPRAS MCmp, char como, int MesDia ); +void BuscaCmp( char TipoBusqueda, char *CurrRow, long *CurrCmp, int NivelAcceso ); +void ObtenCoordenadasMatchCmp( char Row, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | + \*************************************/ +void ImprimeCompras( char como ); +void MuestraImpresionesCmp( void ); +void ImprimeCabeceraCmp( char como, FILE *file_out ); + + /*************************************\ +| | +| Parte Cuarta del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | + \*************************************/ +int CargaProductos( void ); +void CargaProveedores( void ); +/* +void ActualizaProv( long CodigoProv ); +*/ +int MatchProveedor( long NProveedor ); +int MatchRef( unsigned long Codigo, char NormalBarras ); + + /*************************************\ +| | +| Parte Quinta del M¢dulo | +| | +| Utilidades para el calendario | +| | + \*************************************/ +void RellenaCalendario( int IncX, int IncY ); +void MarcaDiaActual( int Sec, int Boton, char como ); +extern int P_Sec(int numero); + + /*************************************\ +| | +| Parte Sexta del M¢dulo | +| | +| Edicion a‚rea de los proveedores | +| | + \*************************************/ +void DespliegaProveedoresCmp( int Row ); +void ProvNuevoRegistro( INFO_PROVEEDORES *NSProv ); +void DuplicaBaseProveedores(void); + + /*************************************\ +| | +| Parte Setima del M¢dulo | +| | +| Despliegue de los proveedores | +| | + \*************************************/ +void PreparaDespliege( int NuevaY1 ); +void DespliegaProveedoresCmp( int Row ); +void MuestraDatosProvCmp( long RowStart, int RowCmp ); +void MuestraProvCmp( int linea, char como, int RowCmp ); +void ObtenCoordenadasProvCmp( int RowCmp, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* ComprasDiarias *| +|* *| +|* Descripci¢n: *| +|* Gestiona las compras diarias que se realizan *| +|* ( Solo se muestran rio... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ComprasDiarias( int NivelAcceso ) +{ + char ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrCmp; // Producto sobre el que estamos posicionados a golpes + + // Actualizasmos el mes y dia actual en curso + DiaActual = FechaGestionActual.da_day; + MesActual = FechaGestionActual.da_mon; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 40, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 40' + + // Inicializa el tratamiento de proveedores para las compras + CargaProveedores(); + +/* + // Inicializa las compras por proveedor + sprintf( buffer, "datos\\%s\\cmp_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ); + if ( BVentProv.AbrirReg( buffer, sizeof( CMP_PROV ) ) == ERROR ) + Error(0x01, BVentProv.cError ); +*/ + + // Inicializa un indice r pido para encontrar a los productos por su c¢digo + if ( CargaProductos() != OK ) + { + Optar( 0, "Error de Gestion", "No se pueden realizar compras", "sin que existan productos", "que puedan ser comprados", NULL ); + return; + } + + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + SeleccionaMesCompras( NivelAcceso ); + + // Nos posicionamos en el ultimo registro del dia actual + CurrRow = 5; CurrCmp = RegCompras[ DiaActual ] - 5; + if ( CurrCmp < 0 ) CurrCmp = 0; else + while ( CurrCmp > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrCmp--; + while ( CurrRow > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrRow--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + + // Leemos el registro sobre el que estamos posicionados + if ( BCmp.LeeReg( (void *)&SCmp, CurrRow + CurrCmp + PosicionDia( DiaActual ) ) == ERROR ) + Error(0x01, BCmp.cError ); + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaCmp( CurrCol ); + } + + MuestraCmp( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraCmp( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + // Si se esta echando un vistazo general har  falta el calendario + if ( NivelAcceso == TOTAL ) + { + switch ( BPush = ReComprueba_Secuencia( 4 ) ) + { + case 0: + case -2: + case -1: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + // Retrocede un mes + case 43: + if ( MesActual > 1 ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + MesActual--; DiaActual = 1; + SeleccionaMesCompras( NivelAcceso ); + + // Nos posicionamos en el ultimo registro del dia actual + CurrRow = 5; CurrCmp = RegCompras[ DiaActual ] - 5; + if ( CurrCmp < 0 ) CurrCmp = 0; else + while ( CurrCmp > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrCmp--; + while ( CurrRow > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrRow--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + // Avanza un mes + case 44: + if ( MesActual < 12 ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + MesActual++; DiaActual = 1; + SeleccionaMesCompras( NivelAcceso ); + + // Nos posicionamos en el ultimo registro del dia actual + CurrRow = 5; CurrCmp = RegCompras[ DiaActual ] - 5; + if ( CurrCmp < 0 ) CurrCmp = 0; else + while ( CurrCmp > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrCmp--; + while ( CurrRow > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrRow--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + default: + if ( ( BPush - AjusteCalendario ) > 0 && ( BPush - AjusteCalendario ) <= DiasMes ) + { + MarcaDiaActual( 4, DiaActual + AjusteCalendario, NORMAL ); + + DiaActual = BPush - AjusteCalendario; + + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + + // Marcamos el dia y reconfiguramos todos los par metros + // para dicho dia... + + // Mostramos datos hasta que se nos acabe la pantalla + // para el dia dado. + + // Nos posicionamos en el ultimo registro del dia actual + CurrRow = 5; CurrCmp = RegCompras[ DiaActual ] - 5; + if ( CurrCmp < 0 ) CurrCmp = 0; else + while ( CurrCmp > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrCmp--; + while ( CurrRow > 0 && ( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] ) ) CurrRow--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + Anclar_Raton(); + break; + } + } + break; + case -2: // Hay una tecla normal en BUFFER + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + + // Descontamos del Stock ( Compra incorrecta ) + if ( ( CurrCol == 0 || CurrCol == 2 ) ) + { + + if ( MatchRef( SCmp.CodigoR, NORMAL ) == OK ) + { + ActualizaStock( SCmp.Cantidad*SRef.CantUnitaria, -1, COMPRA ); + } else { + SCmp.PrecioCosto = SCmp.PrecioCosto /*/ SCmp.Cantidad*/; + } + } +/* + // Le descontamos al proveedor esa, compra... + if ( ActualizaProv( SCmp.CodigoProveedor ) == OK ) + { + SVenProv.Compras[MesActual-1][DiaActual-1] -= SCmp.Cantidad*SCmp.PrecioCosto; + if ( BVenProv.EscribeReg( (void *)&SVenProv, BVenProv.RegActual() ) == ERROR ) + Error(0x01, BVenProv.cError ); + } +*/ + + if ( MatchProveedor( SCmp.CodigoProveedor ) == OK ) + { + SProv.Compras[MesActual-1][0/*DiaActual-1*/] -= SCmp.PrecioCosto/**SCmp.Cantidad*SRef.CantUnitaria*/; + if ( BProv.EscribeReg( (void *)&SProv, BProv.RegActual() ) == ERROR ) + Error(0x01, BProv.cError ); + } + + EditItemCmp( CurrCol, CurrRow ); +/* + // Le a¤adimos las compras a ese proveedor + if ( ActualizaProv( SCmp.CodigoProveedor ) == OK ) + { + + SVentProv.Compras[MesActual-1][DiaActual-1] += SCmp.Cantidad*SCmp.PrecioCosto; + if ( BVentProv.EscribeReg( (void *)&SVentProv, BVentProv.RegActual() ) == ERROR ) + Error(0x01, BVentProv.cError ); + } +*/ + + // Miramos si existe ese producto, en caso de haber editado + // la columna 0 || 2, ( columna del c¢digo, cantidad ) + if ( ( CurrCol == 0 || CurrCol == 2 ) ) + { + if ( SCmp.CodigoR != 0 && MatchRef( SCmp.CodigoR, NORMAL ) == OK ) + { + // Ya se debe haber cargado la referencia, asi que podemos + // copiar los datos importantes y actualizar el stock + strcpy ( SCmp.Descripcion, SRef.Descripcion ); + + // Como estamos sobre la estrcutura, sumamos nuevo stock. + SCmp.PrecioCosto = ActualizaStock( SCmp.Cantidad*SRef.CantUnitaria, +1, COMPRA ); + + MuestraCmp( 1, CurrRow, NORMAL ); + MuestraCmp( 4, CurrRow, NORMAL ); + + } else { + SCmp.CodigoR = 0; SCmp.Descripcion[0] = '\0'; + if ( SCmp.Cantidad <= 0 ) SCmp.Cantidad = 1; + SCmp.PrecioCosto = SCmp.PrecioCosto /** SCmp.Cantidad*/; + MuestraCmp( 1, CurrRow, NORMAL ); + MuestraCmp( 4, CurrRow, NORMAL ); + } + + + } + if ( BCmp.EscribeReg( (void *)&SCmp, (CurrRow + CurrCmp + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + + // Esto solo se puede hacer cuando ya tenemos el PrecioCosto + if ( MatchProveedor( SCmp.CodigoProveedor ) == OK ) + { + SProv.Compras[MesActual-1][0/*DiaActual-1*/] += SCmp.PrecioCosto/**SCmp.Cantidad*SRef.CantUnitaria*/; + if ( BProv.EscribeReg( (void *)&SProv, BProv.RegActual() ) == ERROR ) + Error(0x01, BProv.cError ); + } + + // Avanzamos a la siguiente columna + // Solo se permite acceder a Todo cuando el Codigo es 0 + MuestraCmp( CurrCol, CurrRow, NORMAL ); + if ( ( SCmp.CodigoR == 0 && CurrCol != 0 ) || SCmp.CodigoR != 0 ) + { + CurrCol++; + if ( SCmp.CodigoR == 0 ) + { + if ( CurrCol > 4 ) CurrCol = 4; + } else { + if ( CurrCol == 1 ) CurrCol = 2; + else + if ( CurrCol == 4 ) CurrCol = 0; + } + } + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Solo se permite acceder a Todo cuando el Codigo es 0 + CurrCol--; + if ( SCmp.CodigoR == 0 ) + { + if ( CurrCol < 0 ) CurrCol = 4; + + } else { + if ( CurrCol < 0 ) CurrCol = 3; + else + if ( CurrCol < 2 ) CurrCol = 0; + } + break; + // Flecha Derecha + case 77: + case 9: + // Solo se permite acceder a Todo cuando el Codigo es 0 + CurrCol++; + if ( SCmp.CodigoR == 0 ) + { + if ( CurrCol > 4 ) CurrCol = 0; + } else { + if ( CurrCol == 1 ) CurrCol = 2; + else + if ( CurrCol == 4 ) CurrCol = 0; + } + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrCmp) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_CMP - 1; CurrCmp -= NLINEAS_CMP; + if ( CurrCmp < 0 ) CurrCmp = 0; + + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrCmp > 0 ) CurrCmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol >= 6 && CurrCol < 20 ) + { + CurrCol++; if ( CurrCol > 19 ) CurrCol = 19; + } else { + if ( ( CurrRow + CurrCmp ) < ( RegCompras[DiaActual] - 1 ) ) + { + + if ( ( CurrRow ) >= NLINEAS_CMP - 1 ) + { + CurrRow = 0; CurrCmp += NLINEAS_CMP; + + while ( (CurrCmp + CurrRow) >= RegCompras[DiaActual] ) CurrCmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + } else + CurrRow++; + } + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrCmp != 0 ) + { + CurrCmp = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrCmp != RegCompras[DiaActual] - NLINEAS_CMP ) + { + CurrCmp = RegCompras[DiaActual] - NLINEAS_CMP; + if ( CurrCmp < 0 ) + { + CurrCmp = 0; + CurrRow = RegCompras[DiaActual]-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + break; + + } + break; + // Imprimir Compras + case 1: + MuestraImpresionesCmp(); + break; + // Menu Principal + case 2: + ok = 1; + break; + // Eliminar + case 3: + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + if ( Optar( 1, "ATENCION", "Seguro que desea eliminar", "la compra actual", "confirme la eliminaci¢n", NULL ) ) + { + + if ( MatchRef( SCmp.CodigoR, NORMAL ) == OK ) + { + // Como estamos sobre la estrcutura, sumamos nuevo stock. + SCmp.PrecioCosto = ActualizaStock( SCmp.Cantidad*SRef.CantUnitaria, -1, COMPRA ); + } + + if ( BCmp.DelReg( BCmp.RegActual()/*CurrCmp + CurrRow + PosicionDia( DiaActual )*/ ) == ERROR ) + Error(0x01, BCmp.cError ); + ManipulaIndiceDia( DiaActual, ELIMINAR ); + + if ( RegCompras[DiaActual] == 0 ) + { + CmpNuevoRegistro( &SCmp ); + if ( BCmp.InsReg( (void *)&SCmp, PosicionDia( DiaActual ), ARRIBA ) == ERROR ) + Error(0x01, BCmp.cError ); + ManipulaIndiceDia( DiaActual, INSERTAR ); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrCmp+CurrRow) >= ( RegCompras[DiaActual] - 2 ) ) + { + if ( (CurrRow + CurrCmp) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { +#ifndef DEMOSTRACION + CurrRow = NLINEAS_CMP - 1; CurrCmp -= NLINEAS_CMP; + if ( CurrCmp < 0 ) CurrCmp = 0; + + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrCmp > 0 ) CurrCmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); +#endif + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + } + // Insertar + case 4: + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + CmpNuevoRegistro( &SCmp ); + +#ifdef DEMOSTRACION + if ( RegCompras[DiaActual] >= 4 ) + { + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten mas de 3 compras", "por dia, en el mes.", NULL ); + break; + } +#endif + + if ( BCmp.InsReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ), ARRIBA ) == ERROR ) + Error(0x01, BCmp.cError ); + ManipulaIndiceDia( DiaActual, INSERTAR ); + if ( ( CurrRow + CurrCmp ) < RegCompras[DiaActual] - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_CMP - 1 ) + { +#ifndef DEMOSTRACION + CurrRow = 0; CurrCmp += NLINEAS_CMP; + + while ( (CurrCmp + CurrRow) >= RegCompras[DiaActual] ) CurrCmp--; +#endif + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + } + break; + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_CMP - 1; CurrCmp -= NLINEAS_CMP; + if ( CurrCmp < 0 ) CurrCmp = 0; + + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrCmp ) >= RegCompras[DiaActual] && CurrCmp > 0 ) CurrCmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; +#endif + break; + // Busqueda Atras + case 6: + BuscaCmp( ATRAS, &CurrRow, &CurrCmp, NivelAcceso ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + break; + // Buscar + case 7: + BuscaCmp( NUEVA_BUSQUEDA, &CurrRow, &CurrCmp, NivelAcceso ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + break; + // Busqueda Adelante + case 8: + BuscaCmp( ADELANTE, &CurrRow, &CurrCmp, NivelAcceso ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrCmp += NLINEAS_CMP; + + while ( (CurrCmp + CurrRow) >= RegCompras[DiaActual] ) CurrCmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( CurrCmp + PosicionDia( DiaActual ) ); + if ( BCmp.LeeReg( (void *)&SCmp, (CurrCmp + CurrRow + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + if ( SCmp.CodigoR != 0 && ( CurrCol == 1 || CurrCol == 4 ) ) CurrCol = 0; +#endif + break; + default: + break; + } + + } while( !ok ); + + farfree( BusquedaRef ); + BCmp.CerrarReg(); + BRef.CerrarReg(); + BProv.CerrarReg(); +/* + BVentProv.CerrarReg(); +*/ +} + + + /**************************************************************************\ +|* *| +|* SeleccionaMesCompras *| +|* *| +|* Descripci¢n: *| +|* Abre el archivo adecuado al mes de compras requerido. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void SeleccionaMesCompras( int NivelAcceso ) +{ + static char ArchivoAbierto = ERROR; + char buffer[80]; char i; + + if ( ArchivoAbierto == OK ) + { + BCmp.CerrarReg(); + ArchivoAbierto = ERROR; + } + + // ¨ Que archivo hay que abrir ? + sprintf( buffer, "datos\\%s\\Cmp-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + + // Abrimos el archivo + if ( BCmp.AbrirReg( buffer, sizeof( COMPRAS ) ) == ERROR ) + Error(0x01, BCmp.cError ); + else + ArchivoAbierto = OK; + + // Si no hay nada, habr  que inicializar el mes + if ( BCmp.Registros() == 0 ) + { + // Una estructura limpia + CmpNuevoRegistro( &SCmp ); + + // Tenemos que crear, almenos una compra por dia ( 31 dias ) + // e inicializamos el indice. + + for ( i = 0; i < 31; i++ ) + { + BCmp.InsReg( (void *)&SCmp, i, ARRIBA ); + RegCompras[i] = 1; + } + RegCompras[ 0] = 0; // El dia 0 no tiene ningun registro + + RegCompras[31 + 0] = 1; // Dia 31, solo 1 registro + RegCompras[31 + 1] = 1; // Por si las moscas, otro dia, D32 + + BCmp.SalvaDatosUsuario( (void *)RegCompras ); + + } else { + // Recuperamos los datos de usuario + BCmp.CargaDatosUsuario( (void *)RegCompras, sizeof(long)*32 ); + } + + if ( NivelAcceso == TOTAL ) + { + RellenaCalendario( 0, 0 ); + MarcaDiaActual( 4, DiaActual + AjusteCalendario, INTENSO ); + } + +} + + /**************************************************************************\ +|* *| +|* ManipulaIndiceDia *| +|* *| +|* Descripci¢n: *| +|* A¤ade o elimina un registro ( resta o suma al n§ regs. ) *| +|* *| +|* Entradas: Dia que estamos tratando *| +|* ELIMINAR / INSERTAR *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ManipulaIndiceDia( char Dia, char Accion ) +{ + + if ( Accion == INSERTAR ) + { + // Recorro todos los dia desde Dia hasta el 31 aumentando en 1 el n§ de registros + RegCompras[ Dia ] ++; + } else { + // Recorro todos los dia desde Dia hasta el 31 aumentando en 1 el n§ de registros + RegCompras[ Dia ] --; + } + + // Salvamos estos datos + BCmp.SalvaDatosUsuario( RegCompras ); + +} + + /**************************************************************************\ +|* *| +|* PosicionDia *| +|* *| +|* Descripci¢n: *| +|* Da el inicio f¡sico del dia rrequerido en el archivo. *| +|* *| +|* Entradas: Dia a obtener su inicio *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +long PosicionDia( char Dia ) +{ + long InicioDia, i; + + InicioDia = 0; + + // Recorro todos los dias hasta Dia - 1 para obtener el principio f¡sico + for ( i = 1; i < Dia; i++ ) + InicioDia += RegCompras[i]; + + return InicioDia; +} + + /**************************************************************************\ +|* *| +|* MuestraDatosCmp *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosCmp( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_CMP que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_CMP && dev == OK && (linea + RowStart) < PosicionDia( DiaActual + 1 ); linea++ ) + { + dev = BCmp.LeeReg( (void *)&SCmp, RowStart + linea ); + if ( dev == OK ) + { + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=0; campo < 5; campo++ ) + MuestraCmp( campo, linea, NORMAL ); + } + } + + // Ahora limpio los restantes huecos si los hay + + if ( linea < NLINEAS_CMP ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_CMP; linea++ ) + for ( campo=0; campo < 5; campo++ ) + { + ObtenCoordenadasCmp( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + /**************************************************************************\ +|* *| +|* MuestraCmp *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraCmp( char columna, int linea, char como ) +{ + char buffer[80]; + char buffer1[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasCmp( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real de la compra + case 0: + sprintf ( buffer, " %09lu", SCmp.CodigoR ); + break; + // Nombre del producto + case 1: + sprintf ( buffer, "%30s", SCmp.Descripcion ); + break; + // Cantidad + case 2: + formatea_u_long( (unsigned long)SCmp.Cantidad, buffer1 ); + sprintf ( buffer, "%5s", buffer1 ); + break; + // Proveedor + case 3: + MatchProveedor( SCmp.CodigoProveedor ); + sprintf ( buffer, "%19s", NomProveedor ); + break; + // Precio de costo Total + case 4: + formatea_u_long( (unsigned long)(SCmp.PrecioCosto), buffer1 ); + sprintf ( buffer, " %8s", buffer1 ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + + if ( columna == 3 ) settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + outtextxy( X0+2, Y0, buffer ); + + if ( columna == 3 ) settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaCmp *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaCmp( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo Real del producto + case 0: + sprintf ( buffer1, "C¢digo del producto. ( 0 si no tiene c¢digo )" ); + break; + // Nombre del producto + case 1: + sprintf ( buffer1, "Nombre ( para el producto sin catalogar )" ); + break; + // Cantidades + case 2: + sprintf ( buffer1, "Unidades de compra. (Por paquetes)" ); + break; + // Proveedores + case 3: + sprintf ( buffer1, "Nombre del proveedor del producto" ); + break; + // Precio de costo + case 4: + sprintf ( buffer1, "Precio de costo total ( Producto sin catalogar )" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemCmp *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemCmp( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasCmp( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, "%lu", SCmp.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SCmp.CodigoR = atol( buffer ); + MuestraCmp( 4, linea, NORMAL ); + break; + // Nombre del producto ( Solo si el codigo es el 0 ) + case 1: + if ( SCmp.CodigoR == 0 ) + { + strcpy ( buffer, SCmp.Descripcion ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SCmp.Descripcion, buffer ); + } + break; + // Cantidad + case 2: + sprintf ( buffer, "%u", SCmp.Cantidad ); + if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SCmp.Cantidad = atoi( buffer ); + MuestraCmp( 4, linea, NORMAL ); + break; + // Proveedor + case 3: + // El tratamiento del proveedor es especial + DespliegaProveedoresCmp( linea ); + break; + // Precio de costo ( Solo Accesible con Codigo 0 ) + case 4: + if ( SCmp.CodigoR == 0 ) + { + sprintf ( buffer, "%ld", SCmp.PrecioCosto ); + if ( !( InputCadenaG( buffer, 1, 8, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SCmp.PrecioCosto = atol( buffer ); + } + break; + } + +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasCmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasCmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 164 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 98; + break; + case 1: + *X0 = 107; *X1 = 358; + break; + case 2: + *X0 = 367; *X1 = 413; + break; + case 3: + *X0 = 422; *X1 = 543; + break; + case 4: + *X0 = 552; *X1 = 633; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* CmpNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CmpNuevoRegistro( COMPRAS *NSCmp ) +{ + + NSCmp -> CodigoR = 0; // Codigo real del producto + + NSCmp -> Descripcion[0] = '\0'; // Nombre del Producto + + NSCmp -> Cantidad = 1; // # de productos por unidad + + NSCmp -> PrecioCosto = 0; // Precio de costo + + NSCmp -> CodigoProveedor = 0; // Codigo del proveedor del producto + + NSCmp -> PrecioCosto = 0; // # de productos actualmente + + // Codigos asociados a este producto ( COMBINADOS ) +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* BuscaCmp *| +|* *| +|* Descripci¢n: *| +|* Busca una referencia por su n§ o descripcion *| +|* *| +|* Entradas: *| +|* ATRAS Busca otra coincidencia hacia atras *| +|* NUEVA_BUSQUEDA Inicia una nueva busqueda *| +|* ADELANTE Busca otra coincidencia hacia delante *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void BuscaCmp( char TipoBusqueda, char *CurrRow, long *CurrCmp, int NivelAcceso ) +{ + static COMPRAS MCmp; + static int MesDia = 0; + char enc; + long i; + int OldDiaActual = DiaActual; + + switch ( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + MesDia = 0; + if ( ObtenMatchCmp( &MCmp, &MesDia ) != OK ) + return; + // Si el acceso es total, podemos buscar en toda la base + if ( NivelAcceso == TOTAL && MesDia >> 8 ) + { + // Toda la base: + DiaActual = 1; + } + i = 0; + break; + case ATRAS: + case ADELANTE: + i = ( *CurrRow + *CurrCmp ) + TipoBusqueda; + break; + } + + Optar( ENCUADRE, "Comando: Buscar", "Ahora se inica", "la busqueda elegida", NULL ); + + enc = 0; + + if ( MesDia >> 8 ) + if ( NivelAcceso == TOTAL ) + { + // Busca a travez de todos los dias del mes + for ( ; DiaActual < DiasMes && !enc; DiaActual++, i = 0 ) + while ( i < RegCompras[DiaActual] && !enc ) + { + if ( BCmp.LeeReg( (void *)&SCmp, i + PosicionDia( DiaActual ) ) == ERROR ) + Error( 0x01, BCmp.cError ); + if ( Match_Cmp( SCmp, MCmp ) ) + enc = 1; + else + i++; + } + } else { + // Busca solo en el dia actual + while ( i < RegCompras[DiaActual] && !enc ) + { + if ( BCmp.LeeReg( (void *)&SCmp, i /*+ PosicionDia( DiaActual )*/ ) == ERROR ) + Error( 0x01, BCmp.cError ); + if ( Match_Cmp( SCmp, MCmp ) ) + enc = 1; + else + i++; + } + } + + Optar( ENCUADRE, NULL ); + + if ( enc ) + { + *CurrRow = 0; *CurrCmp = i; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( *CurrRow + *CurrCmp + PosicionDia( DiaActual ) ); + } else { + DiaActual = OldDiaActual; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosCmp( /**CurrRow + */*CurrCmp + PosicionDia( DiaActual ) ); + if ( BCmp.LeeReg( (void *)&SCmp, ( *CurrRow + *CurrCmp + PosicionDia( DiaActual ) ) ) == ERROR ) + Error(0x01, BCmp.cError ); + switch( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + case ATRAS: + case ADELANTE: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + } + } + + if ( BCmp.LeeReg( (void *)&SCmp, (*CurrRow + *CurrCmp + PosicionDia( DiaActual ) ) ) == ERROR ) + Error( 0x01, BCmp.cError ); +} + + /**************************************************************************\ +|* *| +|* Match_Cmp *| +|* *| +|* Descripci¢n: *| +|* Compara dos registros y devuelve la posible coincidencia *| +|* *| +|* Entradas: *| +|* Registros a comparar *| +|* *| +|* Salidas: *| +|* Resultado de la comparaci¢n *| +|* *| + \**************************************************************************/ +int Match_Cmp( COMPRAS A, COMPRAS B ) +{ + if ( B.CodigoR != 0 ) + return (A.CodigoR == B.CodigoR); + if ( B.Descripcion[0] != '\0' ) + return ( strncmpi( A.Descripcion, B.Descripcion, strlen( B.Descripcion ) ) == 0 ); + if ( B.CodigoProveedor != 0 ) + return (A.CodigoProveedor == B.CodigoProveedor ); + return -1; +} + + /**************************************************************************\ +|* *| +|* ObtenMatchCmp *| +|* *| +|* Descripci¢n: *| +|* Obtine los patrones de busqueda necesarios *| +|* *| +|* Entradas: *| +|* Estructura donde guardar el patron de busqueda *| +|* *| +|* Salidas: *| +|* OK La entrada es correcta *| +|* ERROR El usuario interrumpio la busqueda *| +|* *| + \**************************************************************************/ +int ObtenMatchCmp( COMPRAS *MCmp, int *MesDia ) +{ + char Row, ok, i; + int BPush, key, DEV; + struct textsettingstype texttypeinfo; + + gettextsettings( &texttypeinfo ); + + Optar( ENCUADRE, "Comando: Buscar", NULL ); + Imprime_Estaticos( 41, "systm\\tpv.img" ); + + ok = 0; Row = 0; + + CmpNuevoRegistro( MCmp ); + + do + { + MatchDrawCmp(Row, *MCmp, INTENSO, *MesDia); + BPush = Comprueba_Secuencia( SEC_OPTAR, NULL ); + MatchDrawCmp(Row, *MCmp, NORMAL, *MesDia); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + case -2: + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditMatchCmp( Row, MCmp, MesDia ); + for ( i=0; i < 6; i++ ) + MatchDrawCmp(i, *MCmp, NORMAL, *MesDia ); + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: + switch ( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + Row--; if ( Row < 0 ) Row = 5; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + Row++; if ( Row > 5 ) Row = 0; + break; + } + break; + case 1: + DEV = OK; ok = 1; + // Chequeo por si los parametros de busqueda son incorrectos + if ( Match_Cmp( *MCmp, *MCmp ) == -1 ) DEV = ERROR; + break; + case 2: + DEV = ERROR; ok = 1; + break; + } + + } while ( !ok ); + + Optar( ENCUADRE, NULL ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + return DEV; + +} + + /**************************************************************************\ +|* *| +|* EditMatchCmp *| +|* *| +|* Descripci¢n: *| +|* Edita el patron de busqueda *| +|* *| +|* Entradas: *| +|* Campo a editar, y lugar donde almacenarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditMatchCmp( char Row, COMPRAS * MCmp, int *MesDia ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchCmp( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, "%lu", MCmp -> CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CmpNuevoRegistro( MCmp ); + if ( MatchRef ( atol(buffer), NORMAL ) == OK ) + MCmp -> CodigoR = atol(buffer); + } + break; + case 1: + buffer[0] = '\0'; + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CmpNuevoRegistro( MCmp ); + if ( MatchRef ( atol(buffer), BARRAS ) == OK ) + MCmp -> CodigoR = SRef.CodigoR; + } + break; + case 2: + strcpy( buffer, MCmp -> Descripcion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CmpNuevoRegistro( MCmp ); + strcpy ( MCmp -> Descripcion, buffer ); + } + break; + case 3: + buffer[0] = '\0'; + if ( !( InputCadenaG( buffer, 1, 6, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CmpNuevoRegistro( MCmp ); + if ( MatchProveedor ( atol(buffer) ) ) + MCmp -> CodigoProveedor = SProv.CodigoR; + } + case 4: + *MesDia = ( *MesDia & 0xFF00 ) | ! ( *MesDia & 0x00FF ); + break; + case 5: + *MesDia = ( *MesDia & 0x00FF ) | ( ! ( *MesDia >> 8 ) << 8 ); + break; + } + + + +} + + /**************************************************************************\ +|* *| +|* MatchDrawCmp *| +|* *| +|* Descripci¢n: *| +|* Escribe los distintos campos seg£n se le indique *| +|* *| +|* Entradas: *| +|* Campo a mostrar, lugar donde se encuentra, y como mostrarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MatchDrawCmp( char Row, COMPRAS MCmp, char como, int MesDia ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchCmp( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, " %9lu", MCmp.CodigoR ); + break; + case 1: + buffer[0] = '\0'; + break; + case 2: + strncpy( buffer, MCmp.Descripcion, 25 ); + buffer[26] = '\0'; + break; + case 3: + sprintf( buffer, "%6ld", MCmp.CodigoProveedor ); + break; + case 4: + sprintf( buffer, "%s", ( MesDia & 0x00FF ) ? "ÛÛÛÛ" : " " ); + break; + case 5: + sprintf( buffer, "%s", ( MesDia >> 8 ) ? "ÛÛÛÛ" : " " ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasMatchCmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas relativas al campo dado. *| +|* *| +|* Entradas: *| +|* Campo a obtener las coordenadas, y coordenadas de salida *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasMatchCmp( char Row, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + switch( Row ) + { + case 0: + *X0 = 260; *X1 = 360; + *Y0 = 200; *Y1 = 220; + break; + case 1: + *X0 = 365; *X1 = 465; + *Y0 = 200; *Y1 = 220; + break; + case 2: + *X0 = 260; *X1 = 465; + *Y0 = 225; *Y1 = 245; + break; + case 3: + *X0 = 260; *X1 = 325; + *Y0 = 250; *Y1 = 275; + break; + case 4: + *X0 = 435; *X1 = 465; + *Y0 = 252; *Y1 = 273; + break; + case 5: + *X0 = 435; *X1 = 465; + *Y0 = 277; *Y1 = 300; + break; + } + + (*X0) ++; (*Y0) ++; + (*X1) --; (*Y1) --; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte terciaria del m¢dulo Û +// Û Û +// Û Secci¢n de Impresion de compras Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresionesCmp *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesCmp(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 42, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado del dia + case 2: + dev = 1; + ok = 1; + break; + // Listado mesual + case 3: + dev = 2; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + if ( dev != 0 ) + ImprimeCompras( dev ); + + } + +} + + /**************************************************************************\ +|* *| +|* ImprimeCompras *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeCompras( char como ) +{ + long i, old_reg; + char buffer[80]; + long buffTMP; + unsigned long TotalCompras; + FILE *file_out; + + old_reg = BCmp.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraCmp( como, file_out ); + + buffTMP = 0; TotalCompras = 0; + for ( ( como==2 ? i=0 : i = PosicionDia(DiaActual) ); i < ( como==2 ? BCmp.Registros() : RegCompras[DiaActual] + 1 ) ; i++ ) + { + BCmp.LeeReg( (void *)&SCmp, i ); + + switch( como ) + { + // Listado del dia // + case 1: // Ambos listados son iguales + // Mensual // + case 2: + formatea_u_long( (unsigned long)SCmp.Cantidad, buffer ); + fprintf( file_out, " ³ %8lu ³ %-30s ³ %6s ³", SCmp.CodigoR, SCmp.Descripcion, buffer ); + formatea_u_long( (unsigned long)SCmp.PrecioCosto/SCmp.Cantidad, buffer ); + fprintf( file_out, " %8s ", buffer ); + formatea_u_long( (unsigned long)SCmp.PrecioCosto, buffer ); + fprintf( file_out, "³%10s ³\n\r", buffer ); + buffTMP += SCmp.Cantidad; + TotalCompras += SCmp.PrecioCosto; + break; + case 3: + break; + case 4: + break; + } + } + + if ( como == 1 || como == 2 ) + { + fprintf( file_out, " ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÙ\n\r" ); + fprintf( file_out, "\n\r" ); + fprintf( file_out, " ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\n\r" ); + formatea_u_long( TotalCompras, buffer ); + fprintf( file_out, " ³ %05ld Productos, %10s ptas. ³\n\r", buffTMP, buffer ); + fprintf( file_out, " ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\n\r" ); + } + + + if ( !Config.Impresora.Printer ) + fclose( file_out ); + + BCmp.LeeReg( (void *)&SCmp, old_reg ); + +} + +void ImprimeCabeceraCmp( char como, FILE *file_out ) +{ + switch( como ) + { + case 1: + case 2: + fprintf( file_out, " ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿\n\r" ); + fprintf( file_out, " ³ C¢digo ³ Articulo ³ Cant. ³ P.Costo ³ P.Total ³\n\r" ); + fprintf( file_out, " ÃÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄ´\n\r" ); + break; + case 3: + break; + case 4: + break; + } +} + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte Cuarta del m¢dulo Û +// Û Û +// Û Secci¢n de Carga de elementos en Memoria Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* CargaProductos *| +|* *| +|* Descripci¢n: *| +|* Carga las direcciones de hasta 5000 c¢digos. *| +|* *| +|* Entradas:(ninguna) *| +|* *| +|* Salidas: *| +|* OK *| +|* ERROR *| +|* *| + \**************************************************************************/ +int CargaProductos(void) +{ + long i; + char buffer[80]; + + sprintf( buffer, "datos\\%s\\info_ref.dbf", NEmpresa ); + if ( BRef.AbrirReg( buffer, sizeof( INFO_PRODUCTOS ) ) == ERROR ) + Error(0x01, BRef.cError ); + + if ( BRef.Registros() > 0 ) + { + // Solo almacenaremos 5000 registros + if ( BRef.Registros() > 5000 ) + i = 5000; + else + i = BRef.Registros(); + + if ( ( BusquedaRef = ( BUSQUEDA_REF far * ) farmalloc( sizeof( BUSQUEDA_REF ) * i ) ) == NULL ) + BusquedaDirecta = ON; + else + BusquedaDirecta = OFF; + if ( BusquedaDirecta == OFF ) + for ( i = 0; i < BRef.Registros() && i < 5000; i++ ) + { + BRef.LeeReg( (void *)&SRef, i ); + BusquedaRef[i].CodigoR = SRef.CodigoR; + BusquedaRef[i].CodigoB = SRef.CodigoB; + BusquedaRef[i].Posicion = (unsigned int)i; + } + + return OK; + } + + return ERROR; +} + + /**************************************************************************\ +|* *| +|* MatchRef *| +|* *| +|* Descripci¢n: *| +|* Busca el c¢digo que se le pasa como parametro *| +|* teniendo en cuenta si es de barra o normal... *| +|* *| +|* Entradas: *| +|* C¢digo a buscar y tipo de c¢digo *| +|* *| +|* Salidas: *| +|* OK Si lo encuentra *| +|* ERROR *| +|* *| + \**************************************************************************/ +int MatchRef( unsigned long Codigo, char NormalBarras ) +{ + long i; char enc; + static char flag = 0; + + if ( Codigo == 0 ) return ERROR; + + if ( flag != 0 ) + { + // Antes de realizar la busqueda, vemos si el registro actual + // concuerda con nuestros requisitos... + if ( NormalBarras == NORMAL ) + { + if ( SRef.CodigoR == Codigo ) return OK; + } else { + if ( SRef.CodigoB == Codigo ) + { + Codigo = SRef.CodigoR; + return OK; + } + } + } else flag = 1; + + + enc = ERROR; i = 0; + if ( BusquedaDirecta == OFF ) + for ( i=0; i < BRef.Registros() && enc != OK; ) + if ( NormalBarras == NORMAL ) + { + if ( BusquedaRef[i].CodigoR == Codigo ) enc = OK; else i++; + } else { + if ( BusquedaRef[i].CodigoB == Codigo ) + { + Codigo = BusquedaRef[i].CodigoR; + enc = OK; + } else i++; + } + + // Si lo hemos encontrado, cargamos su estructura. + if ( enc == OK ) + if ( BRef.LeeReg( (void *)&SRef, BusquedaRef[i].Posicion ) == ERROR ) + Error( 0x01, BRef.cError ); + else + if ( BusquedaDirecta == ON || i >= 5000 ) + // Comenzamos una busqueda directa + for ( ; i < BRef.Registros() && enc != OK; i++ ) + { + BRef.LeeReg( (void *)&SRef, i ); + if ( NormalBarras == NORMAL ) + { + if ( SRef.CodigoR == Codigo ) enc = OK; + } else { + if ( SRef.CodigoB == Codigo ) + { + Codigo = SRef.CodigoR; + enc = OK; + } + } + } + + return enc; +} + + + /**************************************************************************\ +|* *| +|* CargaProveedores *| +|* *| +|* Descripci¢n: *| +|* Abre y carga los datos necesarios para visualizar a los *| +|* proveedores *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CargaProveedores(void) +{ + char buffer[80]; + + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + + // Este a¤o no existe la base de datos, pero quizas exista el a¤o anterior + if ( access( buffer, 0 ) != 0 ) + { + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( (FechaGestionActual.da_year-1) - ((FechaGestionActual.da_year-1)/1000)*1000 ) ); + if ( access( buffer, 0 ) == 0 ) + { + Optar( ENCUADRE, "Generando clon de Proveedores", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + DuplicaBaseProveedores(); + Optar( ENCUADRE, "Generando clon de Proveedores", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + } + } + + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BProv.AbrirReg( buffer, sizeof( INFO_PROVEEDORES ) ) == ERROR ) + Error(0x01, BProv.cError ); + if ( BProv.LeeReg( (void *)&SProv, 0 ) == ERROR ) + Error(0x01, BProv.cError ); +} + + + /**************************************************************************\ +|* *| +|* MatchProveedor *| +|* *| +|* Descripci¢n: *| +|* He decidido, que para la busqueda no utilizar‚ ninguna *| +|* estructura de datos en memoria, y ser  directa... *| +|* *| +|* Entradas: N§ de proveedor a buscar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int MatchProveedor( long NProveedor ) +{ + static char vez = 0; + int i, enc; + +/* + if ( NProveedor == 0 ) + { + strcpy ( SProv.Proveedor, "Prov. Varios" ); + return OK; + } +*/ + + // Antes de realizar la busqueda, veo si el proveedor actual es el que + // estamos buscado. + if ( NProveedor != SProv.CodigoR || vez == 0 ) + { + vez = 1; enc = ERROR; + for ( i = 0; i < BProv.Registros() && enc != OK; i++ ) + { + BProv.LeeReg( (void *)&SProv, i ); + if ( SProv.CodigoR == NProveedor ) + enc = OK; + } + if ( enc != OK ) + { + if ( SProv.CodigoR == 0 ) + { + ProvNuevoRegistro( &SProv ); + + SProv.CodigoR = 0; + strcpy ( SProv.Proveedor, "Prov. Varios" ); + strcpy ( SProv.ActividadProveedor, "Prov. Varios" ); + + BProv.InsReg( (void *)&SProv, BProv.Registros(), ARRIBA ); + } else + enc = ERROR; + } + + strcpy( NomProveedor, SProv.ActividadProveedor ); + NomProveedor[20]='\0'; + + } else enc = OK; + + return enc; +} + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte Quinta del m¢dulo Û +// ÛÛ ÛÛ +// Û Secci¢n de Utilidades para el calendario Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* RellenaCalendario *| +|* *| +|* Descripci¢n: *| +|* Rellena el calendario en pantalla y rellena el factor de *| +|* correccion para los dias. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void RellenaCalendario( int IncX, int IncY ) +{ + struct textsettingstype Tcfg; + char i; + char buffer[80]; + + char Mes[12][80] = { "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", + "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" }; + + + // Obtenemos la configuraci¢n actual del texto + gettextsettings( &Tcfg ); + + // Ponemos en blanco el calendario +/* + Imprime_Estaticos( 45, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 45' +*/ + Imprime_Secuencia( 4 ); + + // Imprimimos el mes ( centrado claro ) + settextstyle( SMALL_FONT, VERT_DIR, 5 ); + setcolor( EGA_BLACK ); outtextxy( 122+IncX, 5+IncY + ( (120 - textwidth( Mes[MesActual-1] ) ) / 2 ), Mes[MesActual-1] ); + outtextxy( 147+IncX, 5+IncY, "---> " ); + outtextxy( 147+IncX, 62+IncY, "<--- " ); + + setcolor( EGA_WHITE ); outtextxy( 123+IncX, 6+IncY + ( (120 - textwidth( Mes[MesActual-1] ) ) / 2 ), Mes[MesActual-1] ); + outtextxy( 148+IncX, 6+IncY, "---> " ); + outtextxy( 148+IncX, 63+IncY, "<--- " ); + + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + // Ahora empiezo a imprimir los dias + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + for ( i = AjusteCalendario; i < DiasMes+AjusteCalendario; i++ ) + { + sprintf( buffer, " %2d", (int)(i - AjusteCalendario + 1) ); + setcolor( EGA_WHITE ); outtextxy ( 170+IncX + 30*(i%7), 7+IncY + 20*(i/7), buffer ); + setcolor( EGA_BLACK ); outtextxy ( 171+IncX + 30*(i%7), 8+IncY + 20*(i/7), buffer ); + } + + // Restauramos la configuraci¢n anterior + settextstyle( Tcfg.font, Tcfg.direction, Tcfg.charsize ); + +} + + + + + /**************************************************************************\ +|* *| +|* MarcaDiaActual *| +|* *| +|* Descripci¢n: *| +|* Marca el dia actual, en el calendario de forma que parpadee *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MarcaDiaActual( int Sec, int Boton, char como ) +{ + + Imprime_Bordes( Sec, Boton, ( como == NORMAL ) ? -1 : 11 ); + +} + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte Sexta del m¢dulo Û +// ÛÛ ÛÛ +// Û Secci¢n de Muesteo de Proveedores Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* DespliegaProveedoresCmp *| +|* *| +|* Descripci¢n: *| +|* Dada la linea donde se iniciar  el despliegue, se encarga *| +|* de gestionar todo el depliegue y permitir seleccionar el *| +|* proveedor elegido por el usuario... *| +|* *| +|* Entradas: Linea en la que comenzar el despliegue *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void DespliegaProveedoresCmp( int Row ) +{ + void far *FondoImagen; + char buffer[80], ok, BPush; + int X0, Y0, X1, Y1; + int CurrRow, key; + long CurrProv; + + // Si no hay proveedores no podemos editar nada + if ( BProv.Registros() == 0 ) return; + + ObtenCoordenadasCmp( 3, Row, &X0, &Y0, &X1, &Y1 ); + + // ¨ Tenemos memoria para realizar el tratamiento completo ? + if ( ( FondoImagen = farmalloc( JD_imagesize( 415, Y0-159, 570, Y1 + 5 ) ) ) != NULL ) + { + // Recalculamos las coordenadas ( Almenos mostramos 15 Proveedores a la vez ) + X0 = 415; X1 = 570; + Y0 -= 159; Y1 += 5; + + getimage( X0, Y0, X1, Y1, FondoImagen ); + + PreparaDespliege( Y0 ); + + CurrProv = CurrRow = 0; + + MuestraDatosProvCmp( CurrRow + CurrProv, Row ); + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + + ok = 0; + do { + + MuestraProvCmp( CurrRow, INTENSO, Row ); + BPush = Comprueba_Secuencia( 5, NULL ); + MuestraProvCmp( CurrRow, NORMAL, Row ); + + switch( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + if ( (key = getch() ) != 27 ) + { + if ( key == 13 ) + { + SCmp.CodigoProveedor = SProv.CodigoR; + strcpy( NomProveedor, SProv.ActividadProveedor ); + NomProveedor[20]='\0'; + ok = 1; + } else { + ungetch( key ); + + buffer[0] = '\0'; + ObtenCoordenadasCmp( 3, Row, &X0, &Y0, &X1, &Y1 ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SCmp.CodigoProveedor = atol( buffer ); + + // Si el c¢digo introducido es correcto, salimos fuera... + if ( MatchProveedor( SCmp.CodigoProveedor ) == OK ) + { + SCmp.CodigoProveedor = SProv.CodigoR; + ok = 1; + } else { + X0 = 415; X1 = 570; + Y1 += 5; Y0 -= 159; + } + BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ); + } + } else { + SCmp.CodigoProveedor = SProv.CodigoR; + ok = 1; + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( ( key = getch() ) ) + { + // Inicio + case 71: + CurrRow = 0; + if ( CurrProv != 0 ) + { + CurrProv = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrProv != BProv.Registros() - NLINEAS_PROVcmp ) + { + CurrProv = BProv.Registros() - NLINEAS_PROVcmp; + if ( CurrProv < 0 ) + { + CurrProv = 0; + CurrRow = BProv.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + } + while( kbhit() ) getch(); + break; + // Flecha Arriba + case 2: + if ( ( CurrRow + CurrProv ) < ( BProv.Registros() - 1 ) ) + { + + if ( ( CurrRow ) >= NLINEAS_PROVcmp - 1 ) + { + CurrRow = 0; CurrProv += NLINEAS_PROVcmp; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + } else + CurrRow++; + } + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + // Retroceso R pido + case 3: + CurrRow = NLINEAS_PROVcmp - 1; CurrProv -= NLINEAS_PROVcmp; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + // Salir + case 4: + ok = 1; + break; + // AvanceR pido + case 5: + CurrRow = 0; CurrProv += NLINEAS_PROVcmp; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + // Flecha Abajo + case 6: + if ( (CurrRow + CurrProv) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_PROVcmp - 1; CurrProv -= NLINEAS_PROVcmp; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProvCmp( CurrProv, Row ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + break; + default: +/* + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + ( BPush - 6 ) ) ) == ERROR ) + Error(0x01, BProv.cError); + SCmp.CodigoProveedor = SProv.CodigoR; +*/ + break; + } + + } while ( !ok ); + + ObtenCoordenadasCmp( 3, Row, &X0, &Y0, &X1, &Y1 ); + // Recalculamos las coordenadas ( Almenos mostramos 10 Proveedores a la vez ) + X0 = 415; X1 = 570; + Y1 += 5; Y0 -= 159; + putimage( X0, Y0, FondoImagen, COPY_PUT ); + farfree( FondoImagen ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + } else { + // Como no hay memoria, al menos, dejaremos que introduzca el c¢digo de + // proveedor... + sprintf ( buffer, "%ld", SCmp.CodigoProveedor ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + SCmp.CodigoProveedor = atol( buffer ); + strcpy( NomProveedor, SProv.ActividadProveedor ); + NomProveedor[20]='\0'; + } + } + +} + + + /**************************************************************************\ +|* *| +|* PreparaDespliegue *| +|* *| +|* Descripci¢n: *| +|* Dada la linea donde se iniciar  el despliegue, prepara *| +|* todos los registros de botones para realizarlo... *| +|* *| +|* Entradas: Linea en la que comenzar el despliegue *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void PreparaDespliege( int NuevaY0 ) +{ + struct Make_Boton { + int Up, Left, Down, Right; + unsigned char Cdf, Cb1, Cb2; + unsigned char Ab, Pb; + unsigned char Isc, Sc; + }; + + extern struct Make_Boton far *Botones; + int i, IniSec, Incremento; + + int Up_Base[] = { 5, 5, 41, 72, 123, 159 }; + int Down_Base[] = { 186, 31, 67, 118, 149, 185 }; + + IniSec = P_Sec( 5 - 1 ); + + for ( i = 0; i < 7; i ++ ) + { + Botones[ i + IniSec ].Up = Up_Base[i]; + Botones[ i + IniSec ].Down = Down_Base[i]; + } + + + + Incremento = NuevaY0 - Botones[ 0 ]. Up; + + + for ( i = 0; i < 7; i ++ ) + { + Botones[ i + IniSec ].Up += Incremento; + Botones[ i + IniSec ].Down += Incremento; + } + + Imprime_Secuencia( 5 ); + + settextstyle( SMALL_FONT, VERT_DIR, 4 ); + + setcolor( EGA_BLACK ); + outtextxy( 556, 3 + Incremento, " --> " ); + outtextxy( 556, 41 + Incremento, " >> " ); + outtextxy( 556, 72 + Incremento, " Salir " ); + outtextxy( 556, 123 + Incremento, " << " ); + outtextxy( 556, 157 + Incremento, " <-- " ); + + setcolor( EGA_WHITE ); + outtextxy( 557, 4 + Incremento, " --> " ); + outtextxy( 557, 42 + Incremento, " >> " ); + outtextxy( 557, 73 + Incremento, " Salir " ); + outtextxy( 557, 124 + Incremento, " << " ); + outtextxy( 557, 158 + Incremento, " <-- " ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraDatosProvCmp *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosProvCmp( long RowStart, int RowCmp ) +{ + int linea; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_CMP que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_PROVcmp && dev == OK; linea++ ) + { + dev = BProv.LeeReg( (void *)&SProv, RowStart + linea ); + if ( dev == OK ) + MuestraProvCmp( linea, NORMAL, RowCmp ); + } + + // Ahora limpio los restantes huecos si los hay + if ( linea <= NLINEAS_PROVcmp ) + { + if ( dev != OK ) linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_PROVcmp; linea++ ) + { + ObtenCoordenadasProvCmp( RowCmp, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasProvCmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasProvCmp( int RowCmp, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + ObtenCoordenadasCmp( 3, RowCmp, X0, Y0, X1, Y1 ); + + *Y1 = *Y1 - 40 - 15*linea ; + *Y0 = *Y1 + 13 ; + + *X0 = 418; + *X1 = 546; + +} + + /**************************************************************************\ +|* *| +|* MuestraProvCmp *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraProvCmp( int linea, char como, int RowCmp ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasProvCmp( RowCmp, linea, &X0, &Y0, &X1, &Y1 ); + + SProv.ActividadProveedor[20] = '\0'; + sprintf ( buffer, "%21s", SProv.ActividadProveedor ); + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y1, buffer ); + + if ( como == INTENSO ) + { + ObtenCoordenadasCmp( 3, RowCmp, &X0, &Y0, &X1, &Y1 ); + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + sprintf ( buffer, "Codigo: %11ld", SProv.CodigoR ); + outtextxy( X0+2, Y0, buffer ); + } + +} + + + + + /*************************************************************************\ +|* *| +|* ActualizaProv *| +|* *| +|* Descripci¢n: *| +|* Busca y actualiza al proveedor,en el dia que corresponda, *| +|* en caso de no encontrarlo, lo a¤ade. *| +|* Entradas: *| +|* Mes a actualizar *| +|* Dia a actualizar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \*************************************************************************/ +/* +void ActualizaProv( long CodigoProv ) +{ + char enc; + long i; + + + + // Quizas estamos situados sobre ella + if ( SVentProv.CodigoR == CodigoProv ) + { + // Asi que ya lo hemos encontrado + enc = OK; + } else { + enc = ERROR; + BVentProv.LeeReg( (void *)&SVentProv, 0 ); + // No estabamos sobre ella. Buscamos la referencia del producto + for ( i = 0; i < BVentProv.Registros() && enc == ERROR; i ++ ) + { + if ( SVentProv.CodigoR == CodigoR ) + { + enc = OK; + } else { + BVentProv.LeeReg( (void *)&SVentProv, i ); + } + } + } + + // Llegado a este punto, ya se si se encuentra en el fichero o no, + // asi que si no se encuentra en el fichero, lo inserto. + if ( enc == ERROR ) + { + + NuevoRegistroInforme2( SVentProv ); + SVentProv.CodigoR = CodigoR; + // 1§ Obtenemos el nombre del producto ( si el Cod. 0 -> Tickets Varios ) + if ( MatchProveedor( CodigoR ) == OK ) + { + strcpy ( SVentProv -> Nombre, SProv.Proveedor ); + } else { + strcpy ( SVentProv -> Nombre, "Proveedor Varios" ); + } + + BVentProv.InsReg( (void *)SVentProv, BVentProv.Registros(), ARRIBA ); + } + +} +*/ \ No newline at end of file diff --git a/TPV_DCLT.CPP b/TPV_DCLT.CPP new file mode 100644 index 0000000..0f5ede3 --- /dev/null +++ b/TPV_DCLT.CPP @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +/* +BDatos BClt; // Base de datos de Clientes +INFO_EMPRESAS SClt; // Estructura de Clientes +*/ + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ + + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n para escoger Empresa | +| | + \*************************************/ + + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ + + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* DatosClientes *| +|* *| +|* Descripci¢n: *| +|* Inicializaci¢n y consultas global de la fichas de Clientes *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void DatosClientes(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrClt; // Cliente sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 160, "systm\\Tpv.img"); + + + getch(); +} diff --git a/TPV_DEF.H b/TPV_DEF.H new file mode 100644 index 0000000..4e4a632 --- /dev/null +++ b/TPV_DEF.H @@ -0,0 +1,637 @@ +#include // Estructuras varias + +// Para generar una demostraci¢n: activar la macro generadora. +// la demostraci¢n excluir  suficiente c¢digo como para no +// poder generar el programa completo a travez de ASM. +//#define DEMOSTRACION + +#define Pass_ReferArt 0 +#define Pass_StockArt 1 +#define Pass_VentaArt 2 + +#define Pass_InfoProv 3 +#define Pass_CompProv 4 + +#define Pass_InfoEmpl 5 +#define Pass_ClavEmpl 6 +#define Pass_GrafEmpl 7 + +#define Pass_GenerCmp 8 +#define Pass_GrafiCmp 9 + +#define Pass_ICajaGst 10 +#define Pass_BalcDGst 11 +#define Pass_BalcMGst 12 +#define Pass_ClienGst 13 + +#define Pass_ProgrExt 14 + +#define Pass_MsgPrMsl 15 +#define Pass_FA1 16 +#define Pass_FA2 17 +#define Pass_GBDxxMsl 18 +#define Pass_PrExtMsl 19 +#define Pass_CfgEnMsl 20 + +#define DIARIO 0 +#define MENSUAL 1 + +#define NORMAL 0 +#define INTENSO 1 + +#define ELIMINAR -1 +#define INSERTAR 1 + +#define ATRAS -1 +#define NUEVA_BUSQUEDA 0 +#define ADELANTE 1 + +#define SEC_OPTAR 6 +#define ENCUADRE 3 + +// Niveles de acceso al programa +#define TOTAL 0 +#define USUARIO 1 +#define NINGUNO 2 + +#define COMPRA 0 +#define VENTA 1 + +struct hora +{ + char min; // Minutos y hora + char hora; +}; + + +struct VentaProductos +{ + struct hora HoraIni[5]; + struct hora HoraFin[5]; + + char CambioHorario; + char CambioPC; + + char ProcentajeMesa; +}; + +struct CajaDia +{ + char ImprimirTickets; + char CobroCompleto; + + char PorcentajeMesa; + + char SaltarInicio; +}; + +typedef struct +{ + char Printer; + char PrintTo[80]; + + char Lineas; + char Normal[80], Condensado[80]; + + char PrincipioTickets[4][25+1]; + char FinTickets[4][25+1]; +} IMPRESORA; + +typedef struct +{ + char FillBgS, FillBgC, FillBgF; + char NumFg, NumBg, NumLn; + char DigFg, DigBg; + char TxtBgN, TxtBgI, TxtFgN, TxtFgI; + + IMPRESORA Impresora; + + struct VentaProductos VProductos; + + struct CajaDia OpcionesCaja; + + char TProtector; + double Protector; + + char Prot_fnt[80]; + char Vent_msg[80]; + + char HorasMedicion[6]; + + long UltimaEmpresa; + char Intentos; + +} CONFIG; + + +#define TOTAL_COMPRAS_ANUAL 17*300 + /**************************************************************************\ +|* *| +|* Estructura de Clientes (2: Enlace de compras) *| +|* *| + \**************************************************************************/ +typedef struct +{ + long CodEnlace; // Codigo de enlace para las fichas + + int MesDia; // 8 << Mes y Dia >> 8 + // Codigo de enlace si es el primer dato + long CodigoR; // C¢digo real del producto + + char Unidades; // Unidades vendidas << 99 + + // N§ de compras si es el primer dato + long Total; // Precio Total Venta +} INFO_CLIENTES2; + + /**************************************************************************\ +|* *| +|* Estructura de Clientes (1: Fichas) *| +|* *| + \**************************************************************************/ +typedef struct +{ + long CodEnlace; // Codigo de enlace para las fichas + + long Codigo; // C¢digo de cliente + char Cif[10+1]; // Nif / Cif + char Nombre[27+1]; // Nombre del cliente + char DATOa01[27+1]; // Dato sin especificar 01 + char Direccion[27+1]; // Direccion del cliente + char Localidad[15+1]; // Localidad + char Provincia[15+1]; // Provincia + long CodPostal; // Codigo Postal + char Telefono1[15+1]; // Tel‚fono 1 + char Fax[15+1]; // Tel‚fono 2 + + char DATOa02[ 6+1]; // Dato sin especificar 01 + char DATOa03[ 6+1]; // Dato sin especificar 01 + char DATOa04[ 6+1]; // Dato sin especificar 01 + char DATOa05[ 6+1]; // Dato sin especificar 01 + + char Notas[5][30+1]; // Notas sobre el cliente + +} INFO_CLIENTES1; + + /**************************************************************************\ +|* *| +|* Estructura de Empresas *| +|* *| + \**************************************************************************/ +typedef struct +{ + long CodigoR; // Codigos asiignados a los proveedores + char Empresa[30+1]; // Nombre del proveedor + char GestorEmpresa[30+1]; // Actividad del proveedor + + char Cif[10+1]; // Cif / Nif + + char Telefono1[15+1]; // Tel‚fono y fax del proveedor + char Fax[15+1]; // + + char IP_tlf[15+1]; // Direccion IP / Telefono para conectar + char AccessCode[15+1]; // Codigo de acceso + + char Direccion[37+1]; // Direccion + char Numero[3+1]; // Numero + + char Poblacion[15+1]; // Poblacion + char Provincia[15+1]; // Provincia + long CodPost; // C¢digo Postal + + char Estrellas; // Estrellas ( lo que imagina el cliente ) + + char Notas[4][37+1]; // Breves notas.... + +} INFO_EMPRESAS; + + + /**************************************************************************\ +|* *| +|* Estructura de PROVEEDORES *| +|* *| + \**************************************************************************/ +typedef struct +{ + long CodigoR; // Codigos asiignados a los proveedores + char Proveedor[30+1]; // Nombre del proveedor + char ActividadProveedor[30+1]; // Actividad del proveedor + + char Cif[10+1]; // Cif / Nif + + char Telefono1[15+1]; // Tel‚fono y fax del proveedor + char Fax[15+1]; // + + char Direccion[30+1]; // Direccion + char Numero[3+1]; // Numero + + char Poblacion[15+1]; // Poblacion + char Provincia[15+1]; // Provincia + long CodPost; // C¢digo Postal + + char Estrellas; // Estrellas ( lo que imagina el cliente ) + + char Notas[4][37+1]; // Breves notas.... + + long Compras[12][31]; // Compras en el a¤o a ese proveedor + +} INFO_PROVEEDORES; + + /**************************************************************************\ +|* *| +|* Estructura con la infomaci¢n especifica de un producto. *| +|* *| + \**************************************************************************/ +typedef struct +{ + unsigned char Categoria; // Otros, Refresco, Tapas, Barriles... + + unsigned long CodigoR; // Codigo real del producto + unsigned long CodigoB; // Codigo de barras asociado al producto + + char Descripcion[30+1]; // Nombre del Producto + + unsigned int CantUnitaria; // # de productos por unidad + + long PrecioCosto; // Precio de costo + long PrecioVenta[5]; // P.V.P seg£n horas definidas por el usuario... + + long Stock; // # de productos actualmente + + // Codigos asociados a este producto ( COMBINADOS ) + unsigned long CodigosAsociados[10]; + char Combinado; // Se activa si hay codigos asociados, + // combirtiendose en un combinado... + +} INFO_PRODUCTOS; + + /**************************************************************************\ +|* *| +|* Estructura con la infomaci¢n generica de los productos. *| +|* *| + \**************************************************************************/ +typedef struct +{ + struct hora hora_ini[5]; // Horas de inicio y finalizacion para + struct hora hora_fin[5]; // ventas especiales... + + char PorcentMesa; // Porcentaje de mas para la mesa + +} INFO_VENTA_PRODUCTOS; + + /**************************************************************************\ +|* *| +|* Estructura para las compras *| +|* *| + \**************************************************************************/ +typedef struct +{ + unsigned long CodigoR; // Codigo REAL del producto + char Descripcion[30+1]; // Nombre del producto + unsigned int Cantidad; // # productos comprados + + long CodigoProveedor; + + long PrecioCosto; // Precio de costo || C lculo interno: + // Cantidad_por_Unidades * PrecioCosto +} COMPRAS; + + /*********************************************\ +|* *| +|* Infome Ventas ( Archivo mensual 3 de 3 ) *| +|* *| + \*********************************************/ + /************************************************************************\ + |* *| + |* Estructura para las ventas diarias. *| + |* *| + \************************************************************************/ + typedef struct + { + + unsigned long CodigoR; // Codigo REAL del producto + struct hora HoraV; // Hora en la que se realiz¢ la venta + + char BarraMesa; // Vendido en Barra o en Mesa + + unsigned int Cantidad; // # productos vendidos + unsigned long PrecioV; // Precio Venta del producto + + unsigned long PrecioC; // Precio Costo del Producto + + // C¢digo del vendedor + unsigned long CodigoVendedor; + + } VENTAS; + + /************************************************************************\ + |* *| + |* Datos esenciales de una venta diaria ( < 256 bytes ) *| + |* *| + \************************************************************************/ + typedef struct + { + hora AperturaCaja; // Hora de apertura + hora CierreCaja; // Hora de cierre de caja + + char Dia, Mes; // Dia, mes y A¤o de la transacci¢n + int Anyo; + + int Tickets; + int Cambio; + + int SalidasExito; // Salidas con exito + int IntentosSalir; // Intentos de salir al men£ principal + } INFORMACION_VENTAS; + + /**************************************************************************\ +|* *| +|* Estructura para guardar las posiciones de los c¢digos *| +|* *| + \**************************************************************************/ +typedef struct +{ + unsigned long CodigoR; + unsigned long CodigoB; + + unsigned int Posicion; +} BUSQUEDA_REF; + + + /*********************************************\ +|* *| +|* Infome Ventas ( Archivo mensual 3 de 3 ) *| +|* *| + \*********************************************/ + /************************************************************************\ + |* *| + |* Datos unicos para cada dia, archivo mensual ( 1 de 3 ) *| + |* *| + \************************************************************************/ + typedef struct + { + + char Hora[6]; // Horas que desea controlar este dia + long TotalVendido[6]; // Totales vendido ( segun hora venta ) + long CosteTotal; // Coste total de lo vendido + long TotalVentas; // Venta total de este dia ( Suma de TVendido ) + int Tickets; // N§ de tickets + int Cambio; // Veces que se ha habierto la caja + int IntentosSalir; // Intentos de salir al men£ principal + int SalidasExito; // Salidas con exito + hora AperturaCaja; // Hora inicial en que se abri¢ la caja + hora CierreCaja; // Hora en que se cerr¢ la caja + + char Notas[7][50+1]; // Notas sobre la caja del dia + + } INFORME1_VENTAS; + + /************************************************************************\ + |* *| + |* Datos sobre como se vendieron los productos ( Archivo Mensual 2 de 3 ) *| + |* *| + \************************************************************************/ + typedef struct + { + + long CodigoR; // Codigo Real del Producto + char Nombre[30+1]; // Nombre del Producto + // Cantidad de producto vendida segun horas, + // y dia de venta ( 1, 2, ..., 31 ) + // Cantidad unitaria de producto + unsigned int CantUnitaria; + unsigned int Cantidad[31][6]; + // Precio de venta ( el dia de venta ) + unsigned long VentaTotal[31]; + // Precio de costo ( el dia de venta ) + unsigned long PrecioCosto[31]; + + } INFORME2_VENTAS; + + /************************************************************************\ + |* *| + |* Informe sobre cuanto vendi¢ cada empleado. ( Archivo Mensual 2 de 3 ) *| + |* *| + \************************************************************************/ + typedef struct + { + + unsigned long CodigoR; // Codigo Real del Vendedor + char Vendedor[30+1]; // Nombre del Vendedor + + // Total que Vendi¢ por dia de cada mes + unsigned long TotalVendido[31][12]; + + } INFORME3_VENTAS; + + + /**************************************************************************\ +|* *| +|* Estructura para guardar la info de los empleados *| +|* *| + \**************************************************************************/ +typedef struct +{ + long CodigoR; + + char Nombre[15+1]; + char Apellido1[15+1]; + char Apellido2[15+1]; + + char Direccion[25+1]; + char Num[4+1]; + char Piso[4+1]; + + char Poblacion[15+1]; + char Provincia[15+1]; + + long CodPostal; + + char Telefono1[15+1]; + char Telefono2[15+1]; + + char NIF[10+1]; + + struct date InicioContrato; + struct date FinContrato; + + char Acceso[30]; + + char Password[15]; + + char TEMP[45]; + char Observaciones[4][60]; + +} INFO_EMPLEADOS; + + + /**************************************************************************\ +|* *| +|* Estructura para el informe de datos varios... *| +|* *| + \**************************************************************************/ +typedef struct +{ + // Empresas + int NumEmpr; // N£mero de empresas + long EmprAct; // C¢digo de empresa actual + char NEmpresa[80]; // Nombre de la empresa + + // Articulos + long NumProd; // N£mero de productos + + // Proveedores + int NumProv; // N£mero de proveedores + + // Empleados + int NumEmpl; // N£mero de empleados + + // Compras // N£mero de compras en el mes + int NumComp[2]; // y compras en el dia actual. + + // Datos de interes vario + long EspacioCon; // Espacio consumido por el prorg. + long EspacioLib; // Espacio libre en disco. +} DatosInformativos; + + + /**************************************************************************\ +|* *| +|* Estructura para los mensajes que se muestran en pantalla *| +|* *| + \**************************************************************************/ +typedef struct +{ + + char TEspera; // Segundos de espera para pasar al siguiente bloque + + char Desplaz[6]; // Indicador si se desplaza o no. + + char Mensaje1[6][20+1];// Mensaje que se va a mostrar + char Mensaje2[6][20+1];// Mensaje que se va a mostrar + char Mensaje3[6][20+1];// Mensaje que se va a mostrar + + char CFg[6], CBg[6]; // Colores de 1er plano y fondo para cada linea + +} MENSAJES; + + + /**************************************************************************\ +|* *| +|* Estructura para el Cobro completo *| +|* *| + \**************************************************************************/ +typedef struct +{ + + long EntregadoCaja; + + long CodCliente; + + char CifNif[10+1]; // Cif / Nif + char Nombre[27+1]; // Nombre y Apellidos + char Direccion[30+1]; // Direccion + char Localidad[15+1]; // Localidad + char Provincia[15+1]; // Provincia + long CodPostal; // C¢digo Postal + +} S_CobroCompleto; + +//ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß +//ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß +//ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß +//ÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜßÜß + + +extern struct date FechaGestionActual; + +extern CONFIG Config; +extern char NEmpresa[80]; + + + + +extern char led_on [18] [18]; +extern char led_off [18] [18]; +extern char flecha [18] [18]; + +int Optar( int optar, ... ); +void ponicono(int x,int y,char matriz[18][18], char pos); +void formatea_u_long( unsigned long Numero, char *Inter_Chg); +void formatea_long( long Numero, char *Inter_Chg); +int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1); +int EditComentario( char *Comentario, int Lineas, int Columnas, int cc, int cf, int X0, int Y0, int X1, int Y1, int Inc ); + +int CalculaAjusteDias( char *Ajuste, char *DiasMes, char Mes, int Anyo ); +void TextoDoble( int x, int y, char *texto ); +void AnulaInterrupcion(void); + +extern char IntVect; +extern char VisualMode; + +void Error( int code, char *MensajeError ); + +extern int far RatonVentas(void); + +// Pide la clave de usuario +char PideClaveUsuario( void ); +char *PideClave( char *LineaVentana, char *Comprobante ); +void MuestraGraficas( int PosX, int PosY, int xWidth, int yWidth, int NDatos, long *Datos, char Mensajes[][12] ); + + +// M¢dulo para el inicio de caja +void VentasDiarias(void); + +// M¢dulo para el Balance diario +void BalanceDiario_Mensual( char DiarioMensual ); + +// M¢dulo de referencias +void InfoProductos(void); + +// Informacion sobre el stock +void InfoStock(void); + +// M¢dulo de Compras +void ComprasDiarias( int NivelAcceso ); + +// Informacion de los proveedores +void InfoProveedores(void); + +// Configuraci¢n de los mensajes para el protector de pantalla +void ConfigurarMensajes(void); + +// Informacion de los empleados +void InfoEmpleados(void); + +// Informacion acceso de los empleados +void PassEmpleados(void); + +// Informacion comrpas a proveedores +void InformeCompras( void ); + +// Informacion de las empresas disponibles +void InfoEmpresas( void ); + +// Sirve para escoger la empresa a tratar +void EscogeEmpresaActiva( void ); + +// Venta de productos por meses +void InfoVentaProductos( void ); + +// Graficas sobre compras en el mes +void GraficaCompras( void ); + +// Cambia las opciones de configuraci¢n. +void ConfigurarEntorno( void ); + +// Gr ficas de ventas por empleado +void GraficaVentaEmpleados( void ); + +// Ficha de Clientes +void FichaClientes( void ); + +// Compra de los Clientes +void CompraClientes( void ); + +// Datos de Clientes +void DatosClientes( void ); diff --git a/TPV_EMP.CPP b/TPV_EMP.CPP new file mode 100644 index 0000000..a40b216 --- /dev/null +++ b/TPV_EMP.CPP @@ -0,0 +1,1950 @@ +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_EMPL 6 + + +BDatos BEmpl; // Base de datos de Empleados +INFO_EMPLEADOS SEmpl; // Estructura de Empleados + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void MuestraDatosV2Empl( void ); +void MuestraDatosVEmpl( int linea); +void MuestraDatosEmpl( long RowStart ); +void MuestraAyudaEmpl( char columna ); +void EditItemEmpl( char columna, int linea ); +void EmplNuevoRegistro( INFO_EMPLEADOS *MSEmpl ); +void MuestraEmpl( char columna, int linea, char como ); +void ObtenCoordenadasEmpl( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de Busqueda de proveedores | +| | + \*************************************/ +void ObtenCoordenadasMatchEmpl( char Row, int *X0, int *Y0, int *X1, int *Y1 ); +void MatchDrawEmpl( char Row, INFO_EMPLEADOS MEmpl, char como ); +void BuscaEmpl( char TipoBusqueda, char *CurrRow, long *CurrEmpl ); +int Match_Empl( INFO_EMPLEADOS A, INFO_EMPLEADOS B ); +void EditMatchEmpl( char Row, INFO_EMPLEADOS * MEmpl ); +int ObtenMatchEmpl( INFO_EMPLEADOS *MEmpl ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void ImprimeCabeceraEmpl( char como, FILE *file_out ); +void MuestraImpresionesEmpl( void ); +void ImprimeEmpleados( char como ); +void ImprimeFichaEmpleado( void ); + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* InfoEmpleados *| +|* *| +|* Descripci¢n: *| +|* Controla la introduccion de datos y muestreo asi como todo *| +|* el interfaz de usuario... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoEmpleados(void) +{ + char buffer[80], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrEmpl; // Producto sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 70, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 30' + + sprintf( buffer, "datos\\%s\\info_emp.dbf", NEmpresa ); + if ( BEmpl.AbrirReg( buffer, sizeof( INFO_EMPLEADOS ) ) == ERROR ) + Error(0x01, BEmpl.cError); + + // Si no hay registros, creamos uno almenos. + if ( BEmpl.Registros() == 0 ) + { + EmplNuevoRegistro( &SEmpl ); + if ( BEmpl.InsReg( (void *)&SEmpl, BEmpl.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BEmpl.cError); + } + + CurrEmpl = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrRow + CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, 0 ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaEmpl( CurrCol ); + } + + MuestraEmpl( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraEmpl( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER +#ifndef DEMOSTRACION + if ( ( key = getch() ) != 27 ) + { + if ( key != 13 ) + ungetch( key ); + EditItemEmpl( CurrCol, CurrRow ); + if ( BEmpl.EscribeReg( (void *)&SEmpl, (CurrRow + CurrEmpl) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraEmpl( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + } +#else + while( kbhit() ) getch(); + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permite editar el campo", "de los empleados...", NULL ); +#endif + + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 19; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 19 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( CurrCol > 14 ) + { + if ( (CurrRow + CurrEmpl) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPL - 1; CurrEmpl -= NLINEAS_EMPL; + if ( CurrEmpl < 0 ) CurrEmpl = 0; + + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrEmpl > 0 ) CurrEmpl++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + } else { + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol > 14 ) + { + if ( ( CurrRow + CurrEmpl ) < BEmpl.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_EMPL - 1 ) + { + CurrRow = 0; CurrEmpl += NLINEAS_EMPL; + + while ( (CurrEmpl + CurrRow) >= BEmpl.Registros() ) CurrEmpl--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } else + CurrRow++; + } + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + } else { + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + } + break; +#ifndef DEMOSTRACION + // Inicio + case 71: + CurrRow = 0; + if ( CurrEmpl != 0 ) + { + CurrEmpl = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrEmpl != BEmpl.Registros() - NLINEAS_EMPL ) + { + CurrEmpl = BEmpl.Registros() - NLINEAS_EMPL; + if ( CurrEmpl < 0 ) + { + CurrEmpl = 0; + CurrRow = BEmpl.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + break; +#endif + } + break; + // Imprimir Emplerencias + case 1: + MuestraImpresionesEmpl(); + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Eliminar + case 3: + if ( Optar( 1, "ATENCION", "Seguro que desea eliminar", "este empleado?? El siguiente no", "puede tener el mismo c¢digo", NULL ) ) + { + if ( BEmpl.DelReg( CurrEmpl + CurrRow ) == ERROR ) + Error(0x01, BEmpl.cError); + if ( BEmpl.Registros() == 0 ) + { + EmplNuevoRegistro( &SEmpl ); + if ( BEmpl.InsReg( (void *)&SEmpl, BEmpl.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BEmpl.cError); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrEmpl+CurrRow) >= ( BEmpl.Registros() - 2 ) ) + { + if ( (CurrRow + CurrEmpl) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPL - 1; CurrEmpl -= NLINEAS_EMPL; + if ( CurrEmpl < 0 ) CurrEmpl = 0; + + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrEmpl > 0 ) CurrEmpl++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + } + break; + // Insertar + case 4: + EmplNuevoRegistro( &SEmpl ); + if ( BEmpl.InsReg( (void *)&SEmpl, (CurrEmpl + CurrRow), ARRIBA ) == ERROR ) + Error(0x01, BEmpl.cError); + if ( ( CurrRow + CurrEmpl ) < BEmpl.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_EMPL - 1 ) + { + CurrRow = 0; CurrEmpl += NLINEAS_EMPL; + + while ( (CurrEmpl + CurrRow) >= BEmpl.Registros() ) CurrEmpl--; + + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); + + break; +#else + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten eliminar o insertar", "nuevos registros...", NULL ); + break; +#endif + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_EMPL - 1; CurrEmpl -= NLINEAS_EMPL; + if ( CurrEmpl < 0 ) CurrEmpl = 0; + + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrEmpl > 0 ) CurrEmpl++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); +#endif + break; + // Busqueda Atras + case 6: + BuscaEmpl( ATRAS, &CurrRow, &CurrEmpl ); + MuestraDatosVEmpl( CurrRow ); + break; + // Buscar + case 7: + BuscaEmpl( NUEVA_BUSQUEDA, &CurrRow, &CurrEmpl ); + MuestraDatosVEmpl( CurrRow ); + break; + // Busqueda Adelante + case 8: + BuscaEmpl( ADELANTE, &CurrRow, &CurrEmpl ); + MuestraDatosVEmpl( CurrRow ); + + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrEmpl += NLINEAS_EMPL; + + while ( (CurrEmpl + CurrRow) >= BEmpl.Registros() ) CurrEmpl--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosVEmpl( CurrRow ); +#endif + break; + default: + break; + } + + } while( !ok ); + + BEmpl.CerrarReg(); +} + + + + /**************************************************************************\ +|* *| +|* MuestraDatosEmpl *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosEmpl( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_EMPL que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_EMPL && dev == OK; linea++ ) + { + dev = BEmpl.LeeReg( (void *)&SEmpl, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 4 campos, ehhh!!! + for ( campo=15; campo < 20; campo++ ) + MuestraEmpl( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) + { + linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_EMPL; linea++ ) + for ( campo=15; campo < 20; campo++ ) + { + ObtenCoordenadasEmpl( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosVEmpl( int linea ) +{ + int campo; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + // + for ( campo=0; campo < 15; campo++ ) + MuestraEmpl( campo, linea, NORMAL ); + +} + + /**************************************************************************\ +|* *| +|* MuestraEmpl *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraEmpl( char columna, int linea, char como ) +{ + char buffer[80]; + char buffer1[80], draw; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasEmpl( columna, linea, &X0, &Y0, &X1, &Y1 ); + + draw = 1; + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer, " %07lu", SEmpl.CodigoR ); +// MuestraEmpl( 15, linea, como ); + break; + // Nombre del proveedor + case 1: + sprintf ( buffer, "%15s", SEmpl.Nombre ); +// MuestraEmpl( 16, linea, como ); + break; + // Apellido1 + case 2: + sprintf ( buffer, "%15s", SEmpl.Apellido1 ); +// MuestraEmpl( 17, linea, como ); + break; + // Apellido2 + case 3: + sprintf ( buffer, "%15s", SEmpl.Apellido2 ); +// MuestraEmpl( 18, linea, como ); + break; + // Direccion + case 4: + sprintf ( buffer, "%15s", SEmpl.Direccion ); + break; + // Numero + case 5: + sprintf ( buffer, "%4s", SEmpl.Num ); + break; + // Piso + case 6: + sprintf ( buffer, "%4s", SEmpl.Piso ); + break; + // Poblacion + case 7: + sprintf ( buffer, "%15s", SEmpl.Poblacion ); + break; + // Provincia + case 8: + sprintf ( buffer, " %15s", SEmpl.Provincia ); + break; + // Codigo Postal + case 9: + formatea_u_long( SEmpl.CodPostal, buffer1 ); + sprintf ( buffer, " %6s", buffer1 ); + break; + // Telefono 1 + case 10: + sprintf ( buffer, "%15s", SEmpl.Telefono1 ); + MuestraEmpl( 19, linea, como ); + break; + // Telefono 2 + case 11: + sprintf ( buffer, " %15s", SEmpl.Telefono2 ); + break; + // NIF + case 12: + sprintf ( buffer, " %10s", SEmpl.NIF ); + break; + // Inicio Contrato + case 13: + sprintf( buffer, "%02d-%02d-%04d", (int)SEmpl.InicioContrato.da_day, (int)SEmpl.InicioContrato.da_mon, SEmpl.InicioContrato.da_year ); + break; + // Fin Contrato + case 14: + sprintf( buffer, "%02d-%02d-%04d", (int)SEmpl.FinContrato.da_day, (int)SEmpl.FinContrato.da_mon, SEmpl.FinContrato.da_year ); + break; + // Lineas de Apoyo + + // Codigo + case 15: + sprintf ( buffer, " %07lu", SEmpl.CodigoR ); + break; + // Nombre del proveedor + case 16: + sprintf ( buffer, "%15s", SEmpl.Nombre ); + break; + // Apellido1 + case 17: + sprintf ( buffer, "%15s", SEmpl.Apellido1 ); + break; + // Apellido2 + case 18: + sprintf ( buffer, "%15s", SEmpl.Apellido2 ); + break; + // Telefono 1 + case 19: + sprintf ( buffer, " %15s", SEmpl.Telefono1 ); + break; + + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + draw = 0; + break; + + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } else { + Imprime_Bordes( 7, ( columna - 20 + 1 ), ( como == NORMAL ) ? -1 : 11 ); + } + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaEmpl *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaEmpl( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer1, "Introduzca el codigo que desea asignar al vendedor" ); + break; + // Nombre del Vendedor + case 1: + sprintf ( buffer1, "Nombre del vendedor" ); + break; + // Apellido 1 + case 2: + sprintf ( buffer1, "Primer apellido del vendedor" ); + break; + // Apellido 2 + case 3: + sprintf ( buffer1, "Segundo apellido del vendedor" ); + break; + // Direccion + case 4: + sprintf ( buffer1, "Direccion del empleado" ); + break; + // Numero + case 5: + sprintf ( buffer1, "N£mero, Bloque o Plaza" ); + break; + // Piso + case 6: + sprintf ( buffer1, "Piso o Letra" ); + break; + // Localidad + case 7: + sprintf ( buffer1, "Localidad" ); + break; + // Provincia + case 8: + sprintf ( buffer1, "Provincia" ); + break; + // C¢digo Postal + case 9: + sprintf ( buffer1, "C¢digo Postal" ); + break; + // Tel‚fono 1 + case 10: + sprintf ( buffer1, "Tel‚fono 1" ); + break; + // Tel‚fono 2 + case 11: + sprintf ( buffer1, "Tel‚fono 2" ); + break; + // Nif + case 12: + sprintf ( buffer1, "N£mero de Identificaci¢n Fiscal" ); + break; + // Fecha Inicio de contrato + case 13: + sprintf ( buffer1, "Fecha inicio del contrato" ); + break; + // Fecha fin contrato + case 14: + sprintf ( buffer1, "Fecha final del contrato" ); + break; + + // Cuadro de busqueda r pida + case 15: + case 16: + case 17: + case 18: + case 19: + sprintf ( buffer1, "Visualizaci¢n r pida de los empleados" ); + break; + + case 20: + sprintf ( buffer1, "Articulos: Referencia de los Articulos" ); + break; + case 21: + sprintf ( buffer1, "Articulos: Visualizacion del Stock Actual" ); + break; + case 22: + sprintf ( buffer1, "Articulos: Graficas Ventas de Articulo" ); + break; + + case 23: + sprintf ( buffer1, "Proveedores: Fichas de los proveedores" ); + break; + case 24: + sprintf ( buffer1, "Proveedores: Informe de compras seg£n Prov." ); + break; + + case 25: + sprintf ( buffer1, "Empleados: Fichas personales de empleados" ); + break; + case 26: + sprintf ( buffer1, "Empleados: Permisos de acceso (modulo actual)" ); + break; + case 27: + sprintf ( buffer1, "Empleados: Graficas de ventas por empleado" ); + break; + + case 28: + sprintf ( buffer1, "Compras: Compras Generales ( Mensuales/Dia )" ); + break; + case 29: + sprintf ( buffer1, "Compras: Graficas de compras" ); + break; + + case 30: + sprintf ( buffer1, "Gst Ventas: Inicio de la caja diaria" ); + break; + case 31: + sprintf ( buffer1, "Gst Ventas: Balance de caja. Informe del dia" ); + break; + case 32: + sprintf ( buffer1, "Gst Ventas: Balance mensual de ventas" ); + break; + case 33: + sprintf ( buffer1, "Gst Ventas: Gestion de Clientes" ); + break; + + case 34: + sprintf ( buffer1, "Pgr. Ext.: Permiso de ejecucion de Pgr. Ext." ); + break; + + case 35: + sprintf ( buffer1, "Miscelanea: Cambio de los mensajes del Prot." ); + break; + case 36: + sprintf ( buffer1, "Miscelanea: Futura Ampliacion del Programa" ); + break; + case 37: + sprintf ( buffer1, "Miscelanea: Futura Ampliacion del Programa" ); + break; + case 38: + sprintf ( buffer1, "Miscelanea: Gestion de las bases de datos" ); + break; + case 39: + sprintf ( buffer1, "Miscelanea: Configuracion de los Pgr. Ext." ); + break; + case 40: + sprintf ( buffer1, "Miscelanea: Configuracion del Entorno Visual" ); + break; + + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemEmpl *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemEmpl( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasEmpl( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, "%lu", SEmpl.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 7, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SEmpl.CodigoR = atol( buffer ); + MuestraEmpl( 15, linea, NORMAL ); + break; + // Nombre del empleado + case 1: + strcpy ( buffer, SEmpl.Nombre ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Nombre, buffer ); + MuestraEmpl( 16, linea, NORMAL ); + break; + // Apellifo 1 + case 2: + strcpy ( buffer, SEmpl.Apellido1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Apellido1, buffer ); + MuestraEmpl( 17, linea, NORMAL ); + break; + // Apellifo 2 + case 3: + strcpy ( buffer, SEmpl.Apellido2 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Apellido2, buffer ); + MuestraEmpl( 18, linea, NORMAL ); + break; + // Direccion + case 4: + sprintf ( buffer, "%s", SEmpl.Direccion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Direccion, buffer ); + break; + // Num + case 5: + sprintf ( buffer, "%s", SEmpl.Num ); + if ( !( InputCadenaG( buffer, 0, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Num, buffer ); + break; + // Piso + case 6: + sprintf ( buffer, "%s", SEmpl.Piso ); + if ( !( InputCadenaG( buffer, 0, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Piso, buffer ); + break; + // Poblaci¢n + case 7: + sprintf ( buffer, "%s", SEmpl.Poblacion ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Poblacion, buffer ); + break; + // Provincia + case 8: + sprintf ( buffer, "%s", SEmpl.Provincia ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Provincia, buffer ); + break; + // C¢digo Postal + case 9: + sprintf ( buffer, "%ld", SEmpl.CodPostal ); + if ( !( InputCadenaG( buffer, 0, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SEmpl.CodPostal = atol ( buffer ); + break; + // Telefono 1 + case 10: + sprintf ( buffer, "%s", SEmpl.Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Telefono1, buffer ); + break; + // Telefono 2 + case 11: + sprintf ( buffer, "%s", SEmpl.Telefono2 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.Telefono2, buffer ); + break; + // NIF + case 12: + strcpy ( buffer, SEmpl.NIF ); + if ( !( InputCadenaG( buffer, 0, 10, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpl.NIF, buffer ); + break; + // Fecha inicio contrato + case 13: + sprintf( buffer, "%02d%02d%04d", (int)SEmpl.InicioContrato.da_day, (int)SEmpl.InicioContrato.da_mon, SEmpl.InicioContrato.da_year ); + if ( !( InputCadenaG( buffer, 0, 8, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + if ( strlen( buffer ) == 8 ) + { + SEmpl.InicioContrato.da_day = (buffer[0]-'0')*10 + (buffer[1]-'0'); + SEmpl.InicioContrato.da_mon = (buffer[2]-'0')*10 + (buffer[3]-'0'); + SEmpl.InicioContrato.da_year = (buffer[4]-'0')*1000 + (buffer[5]-'0')*100 + (buffer[6]-'0')*10 + (buffer[7]-'0'); + } + } + break; + // Fecha fin contrato + case 14: + sprintf( buffer, "%02d%02d%04d", (int)SEmpl.FinContrato.da_day, (int)SEmpl.FinContrato.da_mon, SEmpl.FinContrato.da_year ); + if ( !( InputCadenaG( buffer, 0, 8, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + if ( strlen( buffer ) == 8 ) + { + SEmpl.FinContrato.da_day = (buffer[0]-'0')*10 + (buffer[1]-'0'); + SEmpl.FinContrato.da_mon = (buffer[2]-'0')*10 + (buffer[3]-'0'); + SEmpl.FinContrato.da_year = (buffer[4]-'0')*1000 + (buffer[5]-'0')*100 + (buffer[6]-'0')*10 + (buffer[7]-'0'); + } + } + break; + // Observaciones + case 15: + break; + + + } + while( kbhit() ) getch(); + +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasEmpl *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasEmpl( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 332 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 97; *X1 = 178; + *Y0 = 94; *Y1 = 114; + break; + case 1: + *X0 = 97; *X1 = 223; + *Y0 = 124; *Y1 = 144; + break; + case 2: + *X0 = 97; *X1 = 223; + *Y0 = 154; *Y1 = 174; + break; + case 3: + *X0 = 312; *X1 = 458; + *Y0 = 154; *Y1 = 174; + break; + + case 4: + *X0 = 97; *X1 = 353; + *Y0 = 184; *Y1 = 204; + break; + case 5: + *X0 = 412; *X1 = 458; + *Y0 = 184; *Y1 = 204; + break; + case 6: + *X0 = 542; *X1 = 588; + *Y0 = 184; *Y1 = 204; + break; + case 7: + *X0 = 97; *X1 = 223; + *Y0 = 214; *Y1 = 234; + break; + case 8: + *X0 = 312; *X1 = 458; + *Y0 = 214; *Y1 = 234; + break; + case 9: + *X0 = 542; *X1 = 618; + *Y0 = 214; *Y1 = 234; + break; + case 10: + *X0 = 97; *X1 = 223; + *Y0 = 244; *Y1 = 264; + break; + case 11: + *X0 = 312; *X1 = 458; + *Y0 = 244; *Y1 = 264; + break; + case 12: + *X0 = 97; *X1 = 223; + *Y0 = 274; *Y1 = 294; + break; + case 13: + *X0 = 362; *X1 = 458; + *Y0 = 274; *Y1 = 294; + break; + case 14: + *X0 = 522; *X1 = 618; + *Y0 = 274; *Y1 = 294; + break; + + case 15: + *X0 = 7; *X1 = 78; + break; + case 16: + *X0 = 87; *X1 = 213; + break; + case 17: + *X0 = 222; *X1 = 348; + break; + case 18: + *X0 = 357; *X1 = 483; + break; + case 19: + *X0 = 492; *X1 = 633; + break; + + case 20: + case 21: + case 22: + *X0 = 180; + *X1 = 200; + + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 20 ) ; + *Y1 = *Y0 + 18; + break; + case 23: + case 24: + *X0 = 180; + *X1 = 200; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 20 + 1 ) ; + *Y1 = *Y0 + 18; + break; + case 25: + case 26: + case 27: + *X0 = 180; + *X1 = 200; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 20 + 2 ) ; + *Y1 = *Y0 + 18; + break; + case 28: + case 29: + *X0 = 180; + *X1 = 200; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 20 + 3 ) ; + *Y1 = *Y0 + 18; + break; + case 30: + case 31: + case 32: + case 33: + *X0 = 390; + *X1 = 410; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 23 ) ; + *Y1 = *Y0 + 18; + break; + case 34: + *X0 = 390; + *X1 = 410; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 23 + 1 ) ; + *Y1 = *Y0 + 18; + break; + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + *X0 = 600; + *X1 = 620; + *X0 -= 2; + + *Y0 = 24 + 20 * ( columna - 28 ) ; + *Y1 = *Y0 + 18; + break; + + + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* EmplNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EmplNuevoRegistro( INFO_EMPLEADOS *NSEmpl ) +{ + char i; + + NSEmpl -> CodigoR = 0; + + NSEmpl -> Nombre[0] = '\0'; + NSEmpl -> Apellido1[0] = '\0'; + NSEmpl -> Apellido2[0] = '\0'; + + NSEmpl -> Direccion[0] = '\0'; + NSEmpl -> Num[0] = '\0'; + NSEmpl -> Piso[0] = '\0'; + + NSEmpl -> CodPostal = 0; + + NSEmpl -> Telefono1[0] = '\0'; + NSEmpl -> Telefono2[0] = '\0'; + + NSEmpl -> NIF[0] = '\0'; + + NSEmpl -> InicioContrato.da_day = 0; + NSEmpl -> InicioContrato.da_mon = 0; + NSEmpl -> InicioContrato.da_year = 0; + + NSEmpl -> FinContrato.da_day = 0; + NSEmpl -> InicioContrato.da_mon = 0; + NSEmpl -> InicioContrato.da_year = 0; + + NSEmpl -> Password[0] = '\0'; + + for ( i = 0; i < 4; i++ ) + NSEmpl -> Observaciones[i][0] = '\0'; + + for ( i = 0; i < 30; i++ ) + NSEmpl -> Acceso[i] = 0; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* BuscaEmpl *| +|* *| +|* Descripci¢n: *| +|* Busca un empleado por sus distintos campos. *| +|* *| +|* Entradas: *| +|* ATRAS Busca otra coincidencia hacia atras *| +|* NUEVA_BUSQUEDA Inicia una nueva busqueda *| +|* ADELANTE Busca otra coincidencia hacia delante *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void BuscaEmpl( char TipoBusqueda, char *CurrRow, long *CurrEmpl ) +{ + static INFO_EMPLEADOS MEmpl; + char enc; long i; + + + switch ( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + if ( ObtenMatchEmpl( &MEmpl ) != OK ) + return; + i = 0; + break; + case ATRAS: + case ADELANTE: + i = ( *CurrRow + *CurrEmpl ) + TipoBusqueda; + break; + } + + Optar( ENCUADRE, "Comando: Buscar", "Ahora se inica", "la busqueda elegida", NULL ); + enc = 0; + while ( i < BEmpl.Registros() && !enc ) + { + if ( BEmpl.LeeReg( (void *)&SEmpl, i ) == ERROR ) + Error( 0x01, BEmpl.cError); + if ( Match_Empl( SEmpl, MEmpl ) ) + enc = 1; + else + i++; + } + + Optar( ENCUADRE, NULL ); + + if ( enc ) + { + *CurrRow = 0; *CurrEmpl = i; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( *CurrRow + *CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, ( *CurrRow + *CurrEmpl ) ) == ERROR ) + Error(0x01, BEmpl.cError); +// MuestraDatosVEmpl( *CurrRow ); + } else + switch( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + case ATRAS: + case ADELANTE: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (*CurrRow + *CurrEmpl) ) == ERROR ) + Error( 0x01, BEmpl.cError); + + +} + + /**************************************************************************\ +|* *| +|* Match_Empl *| +|* *| +|* Descripci¢n: *| +|* Compara dos registros y devuelve la posible coincidencia *| +|* *| +|* Entradas: *| +|* Registros a comparar *| +|* *| +|* Salidas: *| +|* Resultado de la comparaci¢n *| +|* *| + \**************************************************************************/ +int Match_Empl( INFO_EMPLEADOS A, INFO_EMPLEADOS B ) +{ + if ( B.CodigoR != 0 ) + return (A.CodigoR == B.CodigoR); + if ( B.Nombre[0] != '\0' ) + return ( strncmpi( A.Nombre, B.Nombre, strlen( B.Nombre ) ) == 0 ); + if ( B.Apellido1[0] != '\0' ) + return ( strncmpi( A.Apellido1, B.Apellido1, strlen( B.Apellido1 ) ) == 0 ); + if ( B.Direccion[0] != '\0' ) + return ( strncmpi( A.Direccion, B.Direccion, strlen( B.Direccion ) ) == 0 ); + + return 0; +} + + /**************************************************************************\ +|* *| +|* ObtenMatchEmpl *| +|* *| +|* Descripci¢n: *| +|* Obtine los patrones de busqueda necesarios *| +|* *| +|* Entradas: *| +|* Estructura donde guardar el patron de busqueda *| +|* *| +|* Salidas: *| +|* OK La entrada es correcta *| +|* ERROR El usuario interrumpio la busqueda *| +|* *| + \**************************************************************************/ +int ObtenMatchEmpl( INFO_EMPLEADOS *MEmpl ) +{ + char Row, ok, i; + int BPush, key, DEV; + struct textsettingstype texttypeinfo; + + gettextsettings( &texttypeinfo ); + + Optar( ENCUADRE, "Comando: Buscar", NULL ); + Imprime_Estaticos( 74, "systm\\tpv.img" ); + + ok = 0; Row = 0; + + EmplNuevoRegistro( MEmpl ); + + do + { + MatchDrawEmpl(Row, *MEmpl, INTENSO); + BPush = Comprueba_Secuencia( SEC_OPTAR, NULL ); + MatchDrawEmpl(Row, *MEmpl, NORMAL); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + case -2: + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditMatchEmpl( Row, MEmpl ); + for ( i=0; i < 4; i++ ) + MatchDrawEmpl(i, *MEmpl, NORMAL); + break; + case -1: + switch ( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + Row--; if ( Row < 0 ) Row = 3; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + Row++; if ( Row > 3 ) Row = 0; + break; + } + break; + case 1: + DEV = OK; ok = 1; + break; + case 2: + DEV = ERROR; ok = 1; + break; + } + + } while ( !ok ); + + Optar( ENCUADRE, NULL ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + return DEV; + +} + + /**************************************************************************\ +|* *| +|* EditMatchEmpl *| +|* *| +|* Descripci¢n: *| +|* Edita el patron de busqueda *| +|* *| +|* Entradas: *| +|* Campo a editar, y lugar donde almacenarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditMatchEmpl( char Row, INFO_EMPLEADOS * MEmpl ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchEmpl( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + // Codigo + case 0: + sprintf( buffer, "%lu", MEmpl -> CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + EmplNuevoRegistro( MEmpl ); + MEmpl -> CodigoR = atol(buffer); + } + break; + // Nombre + case 1: + sprintf( buffer, "%s", MEmpl -> Nombre ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + EmplNuevoRegistro( MEmpl ); + strcpy ( MEmpl -> Nombre, buffer ); + } + break; + // Apellido 1 + case 2: + sprintf( buffer, "%s", MEmpl -> Apellido1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + EmplNuevoRegistro( MEmpl ); + strcpy ( MEmpl -> Apellido1, buffer ); + } + break; + // Direccion + case 3: + sprintf( buffer, "%s", MEmpl -> Direccion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + EmplNuevoRegistro( MEmpl ); + strcpy ( MEmpl -> Direccion, buffer ); + } + break; + } + + + +} + + /**************************************************************************\ +|* *| +|* MatchDrawEmpl *| +|* *| +|* Descripci¢n: *| +|* Escribe los distintos campos seg£n se le indique *| +|* *| +|* Entradas: *| +|* Campo a mostrar, lugar donde se encuentra, y como mostrarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MatchDrawEmpl( char Row, INFO_EMPLEADOS MEmpl, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchEmpl( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, " %9lu", MEmpl.CodigoR ); + break; + case 1: + strncpy( buffer, MEmpl.Nombre, 15 ); + break; + case 2: + strncpy( buffer, MEmpl.Apellido1, 15 ); + break; + case 3: + strncpy( buffer, MEmpl.Direccion, 25 ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* MatchDrawEmpl *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas relativas al campo dado. *| +|* *| +|* Entradas: *| +|* Campo a obtener las coordenadas, y coordenadas de salida *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasMatchEmpl( char Row, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + switch( Row ) + { + case 0: + *X0 = 265; *X1 = 365; + *Y0 = 200; *Y1 = 220; + break; + case 1: + *X0 = 265; *X1 = 465; + *Y0 = 225; *Y1 = 245; + break; + case 2: + *X0 = 265; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 3: + *X0 = 265; *X1 = 465; + *Y0 = 280; *Y1 = 305; + break; + case 4: + *X0 = 385; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 5: + *X0 = 330; *X1 = 365; + *Y0 = 275; *Y1 = 300; + break; + } + + (*X0) ++; (*Y0) ++; + (*X1) --; (*Y1) --; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresiones *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesEmpl(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 73, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + + if ( dev == 3 ) + ImprimeFichaEmpleado(); + else + ImprimeEmpleados( dev ); + + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeEmpleados *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeEmpleados( char como ) +{ + long i, old_reg; + char buffer[80]; + + FILE *file_out; + + old_reg = BEmpl.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraEmpl(como, file_out); + + for ( i=0; i= 1 && BPush <= 21 ) + { + ObtenCoordenadasEmpl( (BPush - 1 + 20), 0, &X0, &Y0, &X1, &Y1 ); + + if ( SEmpl.Acceso[BPush - 1] ) + { + SEmpl.Acceso[BPush - 1] = 0; + ponicono( X0+5, Y0+5, led_off, 1 ); + } else { + SEmpl.Acceso[BPush - 1] = 1; + ponicono( X0+5, Y0+5, led_on, 1 ); + } + if ( BEmpl.EscribeReg( (void *)&SEmpl, (CurrRow + CurrEmpl) ) == ERROR ) + Error(0x01, BEmpl.cError); + + } + + } + Anclar_Raton(); + + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + ObtenCoordenadasEmpl( CurrCol, 0, &X0, &Y0, &X1, &Y1 ); + if ( CurrCol >= 20 && CurrCol < 41 ) + { + if ( SEmpl.Acceso[CurrCol - 20] ) + { + SEmpl.Acceso[CurrCol - 20] = 0; + ponicono( X0+5, Y0+5, led_off, 1 ); + } else { + SEmpl.Acceso[CurrCol - 20] = 1; + ponicono( X0+5, Y0+5, led_on, 1 ); + } + } + + if ( BEmpl.EscribeReg( (void *)&SEmpl, (CurrRow + CurrEmpl) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraEmpl( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 40 ) CurrCol = 20; + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 15 ) CurrCol = 40; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 40 ) CurrCol = 15; + break; + // Flecha Arriba + case 72: + if ( CurrCol < 20 ) + { + if ( (CurrRow + CurrEmpl) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPL - 1; CurrEmpl -= NLINEAS_EMPL; + if ( CurrEmpl < 0 ) CurrEmpl = 0; + + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrEmpl > 0 ) CurrEmpl++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + } else { + CurrCol--; if ( CurrCol < 20 ) CurrCol = 40; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol < 20 ) + { + if ( ( CurrRow + CurrEmpl ) < BEmpl.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_EMPL - 1 ) + { + CurrRow = 0; CurrEmpl += NLINEAS_EMPL; + + while ( (CurrEmpl + CurrRow) >= BEmpl.Registros() ) CurrEmpl--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } else + CurrRow++; + } + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + } else { + CurrCol++; if ( CurrCol > 40 ) CurrCol = 20; + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrEmpl != 0 ) + { + CurrEmpl = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrEmpl != BEmpl.Registros() - NLINEAS_EMPL ) + { + CurrEmpl = BEmpl.Registros() - NLINEAS_EMPL; + if ( CurrEmpl < 0 ) + { + CurrEmpl = 0; + CurrRow = BEmpl.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + } + + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + break; + } + break; + // Menu Principal + case 2: + ok = 1; + break; + // Retroceso R pido + case 5: + CurrRow = NLINEAS_EMPL - 1; CurrEmpl -= NLINEAS_EMPL; + if ( CurrEmpl < 0 ) CurrEmpl = 0; + + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpl ) >= BEmpl.Registros() && CurrEmpl > 0 ) CurrEmpl++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + + break; + // Busqueda Atras + case 6: + BuscaEmpl( ATRAS, &CurrRow, &CurrEmpl ); + break; + // Buscar + case 7: + BuscaEmpl( NUEVA_BUSQUEDA, &CurrRow, &CurrEmpl ); + break; + // Busqueda Adelante + case 8: + BuscaEmpl( ADELANTE, &CurrRow, &CurrEmpl ); + break; + // AvanceR pido + case 9: + CurrRow = 0; CurrEmpl += NLINEAS_EMPL; + + while ( (CurrEmpl + CurrRow) >= BEmpl.Registros() ) CurrEmpl--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpl( CurrEmpl ); + if ( BEmpl.LeeReg( (void *)&SEmpl, (CurrEmpl + CurrRow) ) == ERROR ) + Error(0x01, BEmpl.cError); + MuestraDatosV2Empl(); + break; + default: + break; + } + + } while( !ok ); + + BEmpl.CerrarReg(); +} + + +void MuestraDatosV2Empl(void) +{ + int campo; + int X0, Y0, X1, Y1; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + // + for ( campo=20; campo < 41; campo++ ) + { + ObtenCoordenadasEmpl( campo, 0, &X0, &Y0, &X1, &Y1 ); + if ( SEmpl.Acceso[campo - 20] ) + ponicono( X0+5, Y0+5, led_on, 1 ); + else + ponicono( X0+5, Y0+5, led_off, 1 ); + } + +} diff --git a/TPV_EMPR.CPP b/TPV_EMPR.CPP new file mode 100644 index 0000000..9ef5950 --- /dev/null +++ b/TPV_EMPR.CPP @@ -0,0 +1,1534 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_EMPR 9 +#define NLINEAS_EMPRelegir 10 + +BDatos BEmpr; // Base de datos de Empreedores +INFO_EMPRESAS SEmpr; // Estructura de Empreedores + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void MuestraDatosVEmpr( int linea); +int MatchEmpresa( long CEmpresa, int *Registros ); +int CompruebaPulsoConexion( void ); +void InicializaNuevasEmpresas( void ); +void MuestraAyudaEmpr( char columna ); +void MuestraDatosEmpr( long RowStart ); +int EmpresaDuplicada( long NEmpresa ); +void EditItemEmpr( char columna, int linea ); +void EmprNuevoRegistro( INFO_EMPRESAS *MSEmpr ); +void MuestraEmpr( char columna, int linea, char como ); +void ObtenCoordenadasEmpr( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n para escoger Empresa | +| | + \*************************************/ +void EscogeEmpresaActiva( void ); +void MuestraDatosEmprElegir( long RowStart ); +void MuestraEmprElegir( int linea, char como ); +void ObtenCoordenadasEmprCmp( char linea, int *X0, int *Y0, int *X1, int *Y1 ); +extern void MarcaSubItemSeleccionado( int Sec, int Columna, char como ); + + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void MuestraImpresionesEmpr( void ); +void ImprimeEmpreedores( char como ); +void ImprimeCabeceraEmpr( char como, FILE *file_out ); + + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* InfoEmpreedores *| +|* *| +|* Descripci¢n: *| +|* Controla la introduccion de datos y muestreo asi como todo *| +|* el interfaz de usuario... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoEmpresas(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrEmpr; // Producto sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 90, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 30' + + sprintf( buffer, "datos\\empresas.dbf" ); + + if ( BEmpr.AbrirReg( buffer, sizeof( INFO_EMPRESAS ) ) == ERROR ) + Error(0x01, BEmpr.cError); + + // Si no hay registros, creamos uno almenos. + if ( BEmpr.Registros() == 0 ) + { + EmprNuevoRegistro( &SEmpr ); + if ( BEmpr.InsReg( (void *)&SEmpr, BEmpr.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BEmpr.cError); + } + + CurrEmpr = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + + MuestraDatosEmpr( CurrRow + CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, 0 ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaEmpr( CurrCol ); + } + + MuestraEmpr( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraEmpr( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + if ( ( BPush = CompruebaPulsoConexion() ) != 0 ) + { + MuestraEmpr( BPush, CurrRow, INTENSO ); + if ( BEmpr.EscribeReg( (void *)&SEmpr, (CurrRow + CurrEmpr) ) == ERROR ) + Error(0x01, BEmpr.cError); + } + break; + case -2: // Hay una tecla normal en BUFFER + if ( ( key = getch() ) != 27 ) + { + if ( key != 13 ) + ungetch( key ); + EditItemEmpr( CurrCol, CurrRow ); + if ( BEmpr.EscribeReg( (void *)&SEmpr, (CurrRow + CurrEmpr) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraEmpr( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 8 ) CurrCol = 8; + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( CurrCol < 4 ) + { + if ( (CurrRow + CurrEmpr) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPR - 1; CurrEmpr -= NLINEAS_EMPR; + if ( CurrEmpr < 0 ) CurrEmpr = 0; + + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrEmpr > 0 ) CurrEmpr++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + } else { + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol < 4 ) + { + if ( ( CurrRow + CurrEmpr ) < BEmpr.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_EMPR - 1 ) + { + CurrRow = 0; CurrEmpr += NLINEAS_EMPR; + + while ( (CurrEmpr + CurrRow) >= BEmpr.Registros() ) CurrEmpr--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + } else + CurrRow++; + } + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + } else { + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrEmpr != 0 ) + { + CurrEmpr = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrEmpr != BEmpr.Registros() - NLINEAS_EMPR ) + { + CurrEmpr = BEmpr.Registros() - NLINEAS_EMPR; + if ( CurrEmpr < 0 ) + { + CurrEmpr = 0; + CurrRow = BEmpr.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + break; + } + break; + // Imprimir Empresas + case 1: + MuestraImpresionesEmpr(); + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Eliminar + case 3: + if ( strcmpi( PideClave( "­­­ C¢digo Acceso !!!", "la eliminici¢n de empresa" ), SEmpr.AccessCode ) == 0 ) + { + + if ( Optar( 1, "ATENCION", "Eliminar el proveedor", "provoc ra la perdida de datos", "para los informaes!!!", NULL ) ) + { + if ( BEmpr.DelReg( CurrEmpr + CurrRow ) == ERROR ) + Error(0x01, BEmpr.cError); + if ( BEmpr.Registros() == 0 ) + { + EmprNuevoRegistro( &SEmpr ); + if ( BEmpr.InsReg( (void *)&SEmpr, BEmpr.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BEmpr.cError); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrEmpr+CurrRow) >= ( BEmpr.Registros() - 2 ) ) + { + if ( (CurrRow + CurrEmpr) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPR - 1; CurrEmpr -= NLINEAS_EMPR; + if ( CurrEmpr < 0 ) CurrEmpr = 0; + + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrEmpr > 0 ) CurrEmpr++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + } + } + break; + // Insertar + case 4: + EmprNuevoRegistro( &SEmpr ); + if ( BEmpr.InsReg( (void *)&SEmpr, (CurrEmpr + CurrRow), ARRIBA ) == ERROR ) + Error(0x01, BEmpr.cError); + if ( ( CurrRow + CurrEmpr ) < BEmpr.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_EMPR - 1 ) + { + CurrRow = 0; CurrEmpr += NLINEAS_EMPR; + + while ( (CurrEmpr + CurrRow) >= BEmpr.Registros() ) CurrEmpr--; + + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); + + break; +#else + // Eliminar//Insertar + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten eliminar ni insertar", "nuevos registros...", NULL ); + break; +#endif + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_EMPR - 1; CurrEmpr -= NLINEAS_EMPR; + if ( CurrEmpr < 0 ) CurrEmpr = 0; + + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrEmpr > 0 ) CurrEmpr++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); +#endif + break; + // Busqueda Atras + case 6: + break; + // Buscar + case 7: + break; + // Busqueda Adelante + case 8: + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrEmpr += NLINEAS_EMPR; + + while ( (CurrEmpr + CurrRow) >= BEmpr.Registros() ) CurrEmpr--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmpr( CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + MuestraDatosVEmpr( CurrRow ); +#endif + break; + default: + break; + } + + } while( !ok ); + +#ifndef DEMOSTRACION + InicializaNuevasEmpresas(); +#else + Optar( 0, "VERSION DEMOSTRACION", "No se reevaluar n las empresas", "que cambien de c¢digo...", NULL ); +#endif + + BEmpr.CerrarReg(); +} + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* InicializaNuevasEmpresas *| +|* *| +|* Descripci¢n: *| +|* Repasa todas las empresas para ver si existen sus *| +|* directorios, y en caso contrario los crea... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InicializaNuevasEmpresas( void ) +{ + long i; + char buffer[80]; + + for ( i = 0; i < BEmpr.Registros(); i++ ) + { + if ( BEmpr.LeeReg( (void *)&SEmpr, i ) == ERROR ) + Error(0x01, BEmpr.cError); + sprintf( buffer, "datos\\EMP%05d", SEmpr.CodigoR ); + if ( access( buffer, 0 ) != 0 ) + mkdir( buffer ); + } +} +#endif + + /**************************************************************************\ +|* *| +|* MuestraDatosEmpr *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosEmpr( long RowStart ) +{ + int linea, campo; + int dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_EMPR que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_EMPR && (RowStart + linea) < BEmpr.Registros()/*dev == OK*/; linea++ ) + { + dev = BEmpr.LeeReg( (void *)&SEmpr, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 4 campos, ehhh!!! + for ( campo=0; campo < 4; campo++ ) + MuestraEmpr( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) + { + linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_EMPR; linea++ ) + for ( campo=0; campo < 4; campo++ ) + { + ObtenCoordenadasEmpr( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosVEmpr( int linea ) +{ + int campo; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + // mas 1 que pertenecen a las estrellas + for ( campo=4; campo < 15+1; campo++ ) + MuestraEmpr( campo, linea, NORMAL ); + +} + + /**************************************************************************\ +|* *| +|* MuestraEmpr *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraEmpr( char columna, int linea, char como ) +{ + char buffer[80], draw; + char buffer1[80], i; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasEmpr( columna, linea, &X0, &Y0, &X1, &Y1 ); + + draw = 1; + + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer, " %09lu", SEmpr.CodigoR ); + break; + // Nombre de la empresa + case 1: + sprintf ( buffer, "%30s", SEmpr.Empresa ); + break; + // Direccion IP / N£mero de tel‚fono + case 2: + sprintf ( buffer, "%15s", SEmpr.IP_tlf ); + break; + // Codigo Acceso a esa empresa + case 3: + sprintf ( buffer, "%15s", SEmpr.AccessCode[0] == '\0' ? "Sin Codigo" : "Con C¢digo" ); + break; + + // Codigo + case 4: + sprintf ( buffer, "%09lu", SEmpr.CodigoR ); + break; + // NIF / CIF + case 5: + sprintf ( buffer, "%10s", SEmpr.Cif ); + break; + // Nombre de la empresa + case 6: + sprintf ( buffer, "%29s", SEmpr.Empresa ); + break; + // Gestor de la Empresa + case 7: + sprintf ( buffer, "%29s", SEmpr.GestorEmpresa ); + break; + // Direccion + case 8: + sprintf ( buffer, "%36s", SEmpr.Direccion ); + break; + // Localidad + case 9: + sprintf ( buffer, "%15s", SEmpr.Poblacion ); + break; + // Provincia + case 10: + sprintf ( buffer, "%15s", SEmpr.Provincia ); + break; + // Codigo Postal + case 11: + formatea_long( SEmpr.CodPost, buffer1 ); + sprintf ( buffer, "%7s", buffer1 ); + break; + // Telefono + case 12: + sprintf ( buffer, "% 15s", SEmpr.Telefono1 ); + break; + // Fax + case 13: + sprintf ( buffer, "%15s", SEmpr.Fax ); + break; + + // Comentario + case 14: + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + for ( i = 0; i < 4; i++ ) + outtextxy( X0, Y0 + 14*i, SEmpr.Notas[i] ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + + // Estellas + case 15: + if ( ( SEmpr.Estrellas & ( 0x01 << (columna - 15) ) ) >> (columna - 15 ) ) + ponicono( X0+5, Y0+5, led_on, 1 ); + else + ponicono( X0+5, Y0+5, led_off, 1 ); + // En las estrellas no hay que imprimir nada + draw = 0; + break; + + + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaEmpr *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaEmpr( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer1, "Introduzca el codigo que desea asignar a la empresa" ); + break; + // Nombre de la empresa + case 1: + sprintf ( buffer1, "Nombre de la empresa" ); + break; + // Direccion de IP / tlf + case 2: + sprintf ( buffer1, "Direcci¢n IP, o n§ de tel‚fono ( nada == maquina actual )" ); + break; + // Codigo acceso + case 3: + sprintf ( buffer1, "C¢digo de acceso a la empresa" ); + break; + + // Codigo + case 4: + sprintf ( buffer1, "C¢digo de proveedor" ); + break; + // Nif / Cif + case 5: + sprintf ( buffer1, "N.I.F. o C.I.F. del proveedor" ); + break; + // Nombre de la empresa + case 6: + sprintf ( buffer1, "Nombre de la empresa" ); + break; + // Gestor de la empresa + case 7: + sprintf ( buffer1, "Gestor de la empresa" ); + break; + // Direccion + case 8: + sprintf ( buffer1, "Direccion completa del proveedor" ); + break; + // Poblacion + case 9: + sprintf ( buffer1, "Localidad del proveedor" ); + break; + // Emprincia + case 10: + sprintf ( buffer1, "Provincia" ); + break; + // C¢digo postal + case 11: + sprintf ( buffer1, "C¢digo Postal" ); + break; + // Telefono + case 12: + sprintf ( buffer1, "N£mero de tel‚fono del proveedor" ); + break; + // Fax + case 13: + sprintf ( buffer1, "Fax o segundo tel‚fono del proveedor" ); + break; + case 14: + sprintf ( buffer1, "Breves notas sobre el proveedor" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemEmpr *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemEmpr( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasEmpr( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + case 4: +#ifndef DEMOSTRACION + sprintf ( buffer, "%lu", SEmpr.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + SEmpr.CodigoR = 0; + if ( BEmpr.EscribeReg( (void *)&SEmpr, BEmpr.RegActual() ) == ERROR ) + Error(0x01, BEmpr.cError); + if ( atol( buffer ) != 0 ) + { + if ( EmpresaDuplicada( atol( buffer ) ) == ERROR ) + Optar( 0, "EMPRESA DUPLICADA", "Ese c¢digo esta duplicado", "cada empresa debe", "tener un c¢digo distinto", NULL ); + } + SEmpr.CodigoR = atol( buffer ); + } + + MuestraEmpr( 0, linea, NORMAL ); + MuestraEmpr( 4, linea, NORMAL ); +#else + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permite modificar el", "c¢digo de empresa...", NULL ); +#endif + break; + // Nomrbe Empresa + case 1: + case 6: + strcpy ( buffer, SEmpr.Empresa ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Empresa, buffer ); + MuestraEmpr( 1, linea, NORMAL ); + MuestraEmpr( 6, linea, NORMAL ); + break; + // Telefono + case 2: + sprintf ( buffer, "%s", SEmpr.IP_tlf ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.IP_tlf, buffer ); + break; + case 12: + sprintf ( buffer, "%s", SEmpr.Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Telefono1, buffer ); + break; + // C¢digo de acceso + case 3: +#ifndef DEMOSTRACION + if ( strcmpi( PideClave( "Antigua clave", "comprobar validez" ), SEmpr.AccessCode ) == 0 ) + { + strcpy( buffer, PideClave( "Nueva Clave", "cambiarla." ) ); + if ( PideClave( "Comfirmacion", "confirmar la misma" ) == buffer ) + strcpy(SEmpr.AccessCode, buffer); + } +#else + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten m¢dificar la clave.", NULL ); +#endif + + break; + // Fax + case 13: + sprintf ( buffer, "%s", SEmpr.Fax ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Fax, buffer ); + break; + + + // CIF / NIF + case 5: + sprintf ( buffer, "%s", SEmpr.Cif ); + if ( !( InputCadenaG( buffer, 0, 10, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Cif, buffer ); + break; + + // Gestor de la empresa + case 7: + sprintf ( buffer, "%s", SEmpr.GestorEmpresa ); + if ( !( InputCadenaG( buffer, 0, 29, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.GestorEmpresa, buffer ); + break; + + // Direccion + case 8: + sprintf ( buffer, "%s", SEmpr.Direccion ); + if ( !( InputCadenaG( buffer, 0, 37, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Direccion, buffer ); + break; + // Poblaci¢n + case 9: + sprintf ( buffer, "%s", SEmpr.Poblacion ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Poblacion, buffer ); + break; + // Empresa + case 10: + sprintf ( buffer, "%s", SEmpr.Provincia ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SEmpr.Provincia, buffer ); + break; + // C¢digo Postal + case 11: + sprintf ( buffer, "%lu", SEmpr.CodPost ); + if ( !( InputCadenaG( buffer, 0, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SEmpr.CodPost = atol ( buffer ); + break; + // Comentario + case 14: + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + EditComentario( (char *)(&SEmpr.Notas[0][0]), 3, 37, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1, 14 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + } + +} + + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* EmpresaDuplicada *| +|* *| +|* Descripci¢n: *| +|* Comprueba que el n§ que le pasamos como par metro no esta *| +|* duplicado *| +|* Entradas: *| +|* Empresa a comprobar su duplicado *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int EmpresaDuplicada( long NEmpresa ) +{ + long i, oldPos; + char dev; + + oldPos = BEmpr.RegActual(); + + dev = OK; + for ( i = 0; i < BEmpr.Registros(); i++ ) + { + if ( BEmpr.LeeReg( (void *)&SEmpr, i ) == ERROR ) + Error(0x01, BEmpr.cError); + if ( SEmpr.CodigoR == NEmpresa ) + { + dev = ERROR; + break; + } + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, oldPos ) == ERROR ) + Error(0x01, BEmpr.cError); + + return dev; +} +#endif + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasEmpr *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasEmpr( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 264 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 98; + break; + case 1: + *X0 = 107; *X1 = 358; + break; + case 2: + *X0 = 367; *X1 = 495; + break; + case 3: + *X0 = 505; *X1 = 633; + break; + + case 4: + *X0 = 67; *Y0 = 37; + *X1 = 148; *Y1 = 58; + break; + case 5: + *X0 = 247; *Y0 = 37; + *X1 = 388; *Y1 = 58; + break; + case 6: + *X0 = 152; *Y0 = 62; + *X1 = 390; *Y1 = 83; + break; + case 7: + *X0 = 152; *Y0 = 87; + *X1 = 390; *Y1 = 108; + break; + case 8: + *X0 = 92; *Y0 = 112; + *X1 = 388; *Y1 = 133; + break; + case 9: + *X0 = 92; *Y0 = 137; + *X1 = 223; *Y1 = 158; + break; + case 10: + *X0 = 312; *Y0 = 137; + *X1 = 438; *Y1 = 158; + break; + case 11: + *X0 = 522; *Y0 = 137; + *X1 = 598; *Y1 = 158; + break; + case 12: + *X0 = 92; *Y0 = 162; + *X1 = 245; *Y1 = 183; + break; + case 13: + *X0 = 255; *Y0 = 162; + *X1 = 388; *Y1 = 183; + break; + + case 14: + *X0 = 402; *Y0 = 165; + *X1 = 633; *Y1 = 221; + break; + + case 15: + *X0 = 90 + 30 + 30 * ( columna - 15 ); *Y0 = 190; + *X1 = *X0 + 25; *Y1 = 215; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* EmprNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EmprNuevoRegistro( INFO_EMPRESAS *NSEmpr ) +{ + int i; + + NSEmpr -> CodigoR = 0; // Codigos asiignados a los proveedores + strcpy( NSEmpr -> Empresa, "" ); // Nombre de la empresa + strcpy( NSEmpr -> GestorEmpresa, "" ); // Gestor de la empresa + + strcpy( NSEmpr -> Telefono1, "" ); // Tel‚fono y fax del proveedor + strcpy( NSEmpr -> Fax, "" ); // + + strcpy( NSEmpr -> IP_tlf, "" ); // Direccion IP o telefono de contacto + strcpy( NSEmpr -> AccessCode,"" ); // C¢digo de acceso + + strcpy( NSEmpr -> Direccion, "" ); // Direccion + strcpy( NSEmpr -> Numero, "" ); // Numero + + strcpy( NSEmpr -> Poblacion, "" ); // Poblacion + strcpy( NSEmpr -> Provincia, "" ); // Emprincia + NSEmpr -> CodPost = 0; // C¢digo Postal + + NSEmpr -> Estrellas = 0; // Estrellas ( lo que imagina el cliente ) + + for ( i = 0; i < 4; i++ ) + strcpy( NSEmpr -> Notas[i], "" ); + +} + +int CompruebaPulsoConexion(void) +{ + char enc, i; + + enc = 0; + + for ( i=0; i < 1; i++ ) + { + if ( y_raton > 190 && y_raton < 215 && + x_raton > ( 90 + 30 + 30 * i ) && x_raton < ( 90 + 30 + 30 * i + 25 ) ) + { + if ( SEmpr.Estrellas & ( 0x01 << i ) ) + SEmpr.Estrellas -= ( 0x01 << i ); + else + SEmpr.Estrellas += ( 0x01 << i ); + + enc = 14 + i + 1; + break; + } + } + + Anclar_Raton(); + + return enc; +} + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresiones *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesEmpr(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 22, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + + ImprimeEmpreedores( dev ); + + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeEmpreedores *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeEmpreedores( char como ) +{ + long i, old_reg; + + + FILE *file_out; + + old_reg = BEmpr.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraEmpr(como, file_out); + + for ( i=0; i= NLINEAS_EMPRelegir - 1 ) + { + CurrRow = 0; CurrEmpr += NLINEAS_EMPRelegir; + + while ( (CurrEmpr + CurrRow) >= BEmpr.Registros() ) CurrEmpr--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmprElegir( CurrRow + CurrEmpr ); + } else + CurrRow++; + } + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + break; + // Retroceso R pido + case 73: + CurrRow = NLINEAS_EMPRelegir - 1; CurrEmpr -= NLINEAS_EMPRelegir; + if ( CurrEmpr < 0 ) CurrEmpr = 0; + + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrEmpr > 0 ) CurrEmpr++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmprElegir( CurrRow + CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + break; + // AvanceR pido + case 81: + CurrRow = 0; CurrEmpr += NLINEAS_EMPRelegir; + + while ( (CurrEmpr + CurrRow) >= BEmpr.Registros() ) CurrEmpr--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmprElegir( CurrRow + CurrEmpr ); + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + break; + // Flecha Abajo + case 80: + if ( (CurrRow + CurrEmpr) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_EMPRelegir - 1; CurrEmpr -= NLINEAS_EMPRelegir; + if ( CurrEmpr < 0 ) CurrEmpr = 0; + + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrEmpr ) >= BEmpr.Registros() && CurrEmpr > 0 ) CurrEmpr++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosEmprElegir( CurrRow + CurrEmpr ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + CurrRow) ) == ERROR ) + Error(0x01, BEmpr.cError); + break; + } + while( kbhit() ) getch(); + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + if ( ( CurrEmpr + 9 - ( BPush - 1 ) ) < BEmpr.Registros() ) + { + if ( BEmpr.LeeReg( (void *)&SEmpr, (CurrEmpr + 9 - ( BPush - 1 ) ) ) == ERROR ) + Error(0x01, BEmpr.cError); + sprintf( NEmpresa, "EMP%05d", SEmpr.CodigoR ); + ok = 1; + } + break; + default: + break; + } + + } while ( !ok ); + + BEmpr.CerrarReg(); +} + + + /**************************************************************************\ +|* *| +|* MuestraDatosEmprElegir *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosEmprElegir( long RowStart ) +{ + int linea; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_CMP que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_EMPRelegir && linea < BEmpr.Registros(); linea++ ) + { + dev = BEmpr.LeeReg( (void *)&SEmpr, RowStart + linea ); + if ( dev == OK ) + MuestraEmprElegir( linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( linea < NLINEAS_EMPRelegir ) + { + setfillstyle( SOLID_FILL, 7 ); + for ( ; linea < NLINEAS_EMPRelegir; linea++ ) + { + ObtenCoordenadasEmprCmp( linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasEmprCmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasEmprCmp( char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + *Y1 = 77 + 20*(9-linea) ; + *Y0 = *Y1 + 13 ; + + *X0 = 113; + *X1 = 294; + +} + + /**************************************************************************\ +|* *| +|* MuestraEmprElegir *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraEmprElegir( int linea, char como ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasEmprCmp( linea, &X0, &Y0, &X1, &Y1 ); + + sprintf ( buffer, "%21s", SEmpr.Empresa ); + + setfillstyle( SOLID_FILL, 7 );//( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); +// setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); +// outtextxy( X0+2, Y1, buffer ); + TextoDoble( X0+2, Y1, buffer ); +} + + + + /**************************************************************************\ +|* *| +|* MatchEmpresa *| +|* *| +|* Descripci¢n: *| +|* Encuentra la empresa que se le pasa como par metro... *| +|* *| +|* Entradas: *| +|* Codigo de la Empresa, Lugar donde guardar el n§ de Registros *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int MatchEmpresa( long CEmpresa, int *Registros ) +{ + long i; + char dev, buffer[80]; + + sprintf( buffer, "datos\\empresas.dbf" ); + + if ( BEmpr.AbrirReg( buffer, sizeof( INFO_EMPRESAS ) ) == ERROR ) + Error(0x01, BEmpr.cError); + + *Registros = BEmpr.Registros(); + + dev = ERROR; + for ( i=0; i +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_Clt 6 + +extern BDatos B_IVentas2; // Archivo de Ventas 2 de 3 ( Productos Vendidos ) +extern INFORME2_VENTAS S_IVentas2; // Productos Vendidos ( 2 de 3 ) + +BDatos BClt1; // Base de datos de Clientes1: FICHAS +INFO_CLIENTES1 SClt1; // Estructura de Clientes + +BDatos BClt2; // Base de datos de Clientes2: COMPRAS +INFO_CLIENTES2 SClt2; // Estructura de Clientes + + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void DuplicaClientes( void ); +void CltNuevoEnlace( INFO_CLIENTES1 *TmpClt ); +void CltNuevoRegistro( INFO_CLIENTES1 *NSClt1 ); + + + +void MuestraDatosProductosClt( int DesdeDonde ); +void MuestraDatosDiaClt( int DesdeDonde ); +void MuestraDatosEnlace( long CodEnlace ); +void CalculaCantProdDia( int MesDia ); + +void MuestraDatosVClt( int linea ); +void MuestraAyudaClt( char columna ); +void MuestraDatoSClt1( long RowStart ); +int MatchCliente( long CodigoCliente ); +int MatchCCliente( long CodigoEnlace ); +void EditItemClt( char columna, int linea ); +void MuestraClt( char columna, int linea, char como ); +void ObtenCoordenadaSClt1( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n para las busquedas | +| | + \*************************************/ +int ObtenMatchClt( INFO_CLIENTES1 *MClt ); +void EditMatchClt( char Row, INFO_CLIENTES1 * MClt ); +int Match_Clt( INFO_CLIENTES1 *A, INFO_CLIENTES1 *B ); +void MatchDrawClt( char Row, INFO_CLIENTES1 MClt, char como ); +void BuscaClt( char TipoBusqueda, char *CurrRow, long *CurrClt ); +void ObtenCoordenadasMatchClt( char Row, int *X0, int *Y0, int *X1, int *Y1 ); + + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void ImprimeClientes( char como ); +void MuestraImpresionesClientes( void ); +void ImprimeCabeceraClt( char como, FILE *file_out ); + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + +int CurrProd; // Linea en el visor de productos vendidos a golpes +char RowProd; // Linea en el visor de productos vendidos +int CurrDias; // Linea del dia seleccionado y a inspeccionar a golpes +char RowDias; // Linea del dia seleccionado y a inspeccionar +int *MesDiaPosibles; // Meses y dias posibles +int InicioProdDia_Clt; // Inicio del dia + /**************************************************************************\ +|* *| +|* FichaClientes *| +|* *| +|* Descripci¢n: *| +|* Inicializaci¢n y consultas global de la fichas de Clientes *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void FichaClientes(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrClt; // Cliente sobre el que estamos posicionados a golpes + + + // Pedimos memoria para el almacen de compras + if ( // ( SClt2 = (INFO_CLIENTES2 *)malloc( sizeof( INFO_CLIENTES2 ) * TOTAL_COMPRAS_ANUAL ) ) == NULL || + ( MesDiaPosibles = (int *)malloc( sizeof( int ) * 367 ) ) == NULL + ) + { +// if ( SClt2 != NULL ) free ( SClt2 ); + if ( MesDiaPosibles != NULL ) free ( MesDiaPosibles ); + + Optar( 0, "Eror de asignacion de Mem.", "Atenci¢n no hay suficiente", "memorial libre para ejecutar", "la acci¢n especificada.", NULL ); + return; + } + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 140, "systm\\Tpv.img"); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + + sprintf( buffer, "datos\\%s\\info_clt2.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BClt2.AbrirReg( buffer, sizeof( INFO_CLIENTES2 ) * TOTAL_COMPRAS_ANUAL ) == ERROR ) + Error(0x01, BClt2.cError); + +/* + // Este a¤o no existe la base de datos, pero quizas exista el a¤o anterior + if ( access( buffer, 0 ) != 0 ) + { + sprintf( buffer, "datos\\%s\\info_clt2.%03d", NEmpresa, ( (FechaGestionActual.da_year-1) - ((FechaGestionActual.da_year-1)/1000)*1000 ) ); + if ( access( buffer, 0 ) == 0 ) + { + Optar( ENCUADRE, "Generando clon de Clientes", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + DuplicaClientes(); + Optar( ENCUADRE, "Generando clon de Clientes", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + } + } +*/ + + sprintf( buffer, "datos\\%s\\info_clt1.dbf", NEmpresa ); + if ( BClt1.AbrirReg( buffer, sizeof( INFO_CLIENTES1 ) ) == ERROR ) + Error(0x01, BClt1.cError); + CurrClt = 0; + // Si no hay registros, creamos uno almenos. + if ( BClt1.Registros() == 0 ) + { + // Guardamos el enlace como ocupado // Salva los 256 bytes de usuario + BClt2.SalvaDatosUsuario( (void *)&CurrClt ); + + CltNuevoRegistro( &SClt1 ); CltNuevoEnlace( &SClt1 ); + if ( BClt1.InsReg( (void *)&SClt1, BClt1.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BClt1.cError); + } + + CurrClt = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrRow + CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, 0 ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + // Mostramos los datos de estado inicial + MuestraDatosVClt( CurrRow ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaClt( CurrCol ); + } + + MuestraClt( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraClt( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER +#ifndef DEMOSTRACION + if ( ( key = getch() ) != 27 ) + { + if ( key != 13 ) + ungetch( key ); + EditItemClt( CurrCol, CurrRow ); + if ( BClt1.EscribeReg( (void *)&SClt1, (CurrRow + CurrClt) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraClt( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 17 ) CurrCol = 17; + } +#else + while( kbhit() ) getch(); + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten m¢dificar los campos,", "de los Clteedores...", NULL ); +#endif + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 17; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 17 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( CurrCol < 3 ) + { + if ( (CurrRow + CurrClt) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_Clt - 1; CurrClt -= NLINEAS_Clt; + if ( CurrClt < 0 ) CurrClt = 0; + + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrClt > 0 ) CurrClt++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + } else { + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol < 3 ) + { + if ( ( CurrRow + CurrClt ) < BClt1.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_Clt - 1 ) + { + CurrRow = 0; CurrClt += NLINEAS_Clt; + + while ( (CurrClt + CurrRow) >= BClt1.Registros() ) CurrClt--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + } else + CurrRow++; + } + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + } else { + CurrCol++; if ( CurrCol > 17 ) CurrCol = 0; + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrClt != 0 ) + { + CurrClt = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + } + + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrClt != BClt1.Registros() - NLINEAS_Clt ) + { + CurrClt = BClt1.Registros() - NLINEAS_Clt; + if ( CurrClt < 0 ) + { + CurrClt = 0; + CurrRow = BClt1.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + } + + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + break; + } + break; + // Imprimir Informe de Clientes + case 1: + MuestraImpresionesClientes(); + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Eliminar + case 3: + if ( Optar( 1, "ATENCION", "Eliminar al Cliente", "Provocar  la perdida de datos", "para los informaes!!!", NULL ) ) + { + if ( BClt1.DelReg( CurrClt + CurrRow ) == ERROR ) + Error(0x01, BClt1.cError); + if ( BClt1.Registros() == 0 ) + { + CltNuevoRegistro( &SClt1 ); CltNuevoEnlace( &SClt1 ); + if ( BClt1.InsReg( (void *)&SClt1, BClt1.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BClt1.cError); + CurrRow = 0; + } else + // Si he borrado el £ltimo registro subo una linea + if ( (CurrClt+CurrRow) >= ( BClt1.Registros() - 2 ) ) + { + if ( (CurrRow + CurrClt) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_Clt - 1; CurrClt -= NLINEAS_Clt; + if ( CurrClt < 0 ) CurrClt = 0; + + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrClt > 0 ) CurrClt++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + } + break; + // Insertar + case 4: + CltNuevoRegistro( &SClt1 ); CltNuevoEnlace( &SClt1 ); + if ( BClt1.InsReg( (void *)&SClt1, (CurrClt + CurrRow), ARRIBA ) == ERROR ) + Error(0x01, BClt1.cError); + if ( ( CurrRow + CurrClt ) < BClt1.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_Clt - 1 ) + { + CurrRow = 0; CurrClt += NLINEAS_Clt; + + while ( (CurrClt + CurrRow) >= BClt1.Registros() ) CurrClt--; + + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); + break; +#else + // insertar//eliminar + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten eliminar ni insertar", "nuevos registros...", NULL ); + break; +#endif + + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_Clt - 1; CurrClt -= NLINEAS_Clt; + if ( CurrClt < 0 ) CurrClt = 0; + + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrClt ) >= BClt1.Registros() && CurrClt > 0 ) CurrClt++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); +#endif + break; + // Busqueda Atras + case 6: + BuscaClt( ATRAS, &CurrRow, &CurrClt ); + break; + // Buscar + case 7: + BuscaClt( NUEVA_BUSQUEDA, &CurrRow, &CurrClt ); + break; + // Busqueda Adelante + case 8: + BuscaClt( ADELANTE, &CurrRow, &CurrClt ); + + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrClt += NLINEAS_Clt; + + while ( (CurrClt + CurrRow) >= BClt1.Registros() ) CurrClt--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, (CurrClt + CurrRow) ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosEnlace( SClt1.CodEnlace ); + MuestraDatosVClt( CurrRow ); +#endif + break; + default: + break; + } + + } while( !ok ); + + BClt1.CerrarReg(); + BClt2.CerrarReg(); +// free( SClt2 ); + free( MesDiaPosibles ); +} + + /**************************************************************************\ +|* *| +|* CltNuevosEnlace *| +|* *| +|* Descripci¢n: *| +|* Crea un nuevo enlace a las fichas de cliente *| +|* *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CltNuevoEnlace( INFO_CLIENTES1 *TmpClt ) +{ + long Enlaces; + + // Recuperamos el registro de enlaces ocupados + // Carga los datos de usuario + BClt2.CargaDatosUsuario( (void *)&Enlaces, sizeof( long ) ); + + Enlaces ++; + + // Utilizamos el siguiente enlace en la lista + TmpClt -> CodEnlace = Enlaces; + + // Guardamos el enlace como ocupado // Salva los 256 bytes de usuario + BClt2.SalvaDatosUsuario( (void *)&Enlaces ); + + +} + + /**************************************************************************\ +|* *| +|* MuestraDatosEnlace *| +|* *| +|* Descripci¢n: *| +|* Dado el codigo de enlace correspondiente, lo busca y muestra*| +|* *| +|* *| +|* Entradas: C¢digo de enlace a buscar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosEnlace( long CodEnlace ) +{ + long i; + int j; + + // Vemos para este cliente, cuantos dias de compra distintos posee!!! + // Como m ximo poseer  365 dias! + MesDiaPosibles[ 0] = 0; + MesDiaPosibles[366] = 0; + for ( i = 0; i < BClt2.Registros(); i++ ) + { + if ( BClt2.LeeReg( (void *)&SClt2, i ) == ERROR ) + Error(0x01, BClt2.cError); + if ( CodEnlace == SClt2.CodEnlace ) + { + for ( j = 0; j < MesDiaPosibles[366]; j++ ) + { + if ( SClt2.MesDia == MesDiaPosibles[j] ) + { + break; + } + } + if ( j >= MesDiaPosibles[366] ) + { + MesDiaPosibles[ MesDiaPosibles[366] ] = SClt2.MesDia; + MesDiaPosibles[366]++; + } + } + } + + // Ordenamos los dias que puede ver -> Y un CARAILLO <-- + +/* + if ( CodEnlace != SClt2[0].CodigoR ) + { + SClt2[0].CodigoR = CodEnlace; // Forzamos a que sea el c¢digo de enlace + SClt2[0].Total = 0; // pero sin que existan productos... + } + + RowProd = CurrProd = 0; // Linea en el visor de productos vendidos + RowDias = CurrDias = 0; // Linea del dia seleccionado y a inspeccionar +*/ + + MuestraDatosDiaClt( CurrDias ); // Dias disponibles para visualizar + // productos disponibles para el d¡a seleccionado + CalculaCantProdDia( MesDiaPosibles[ CurrDias + RowDias ] ); + + // Productos de ese dia + MuestraDatosProductosClt( CurrProd ); + +} + +#define NUM_LINEAS_DIAS_POSIBLES 15 +#define NUM_LINEAS_PRODUCTOS_CLT 25 +void MuestraDatosProductosClt( int DesdeDonde ) +{ + int i; + int X0, Y0, X1, Y1; + + for ( i = 0; i < NUM_LINEAS_PRODUCTOS_CLT && DesdeDonde + i < SClt2.Total; i++ ) + { + MuestraClt( 19, i, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + for ( ; i < NUM_LINEAS_PRODUCTOS_CLT; i++ ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + ObtenCoordenadaSClt1( 19, i, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } +} + + +void MuestraDatosDiaClt( int DesdeDonde ) +{ + int i; + int X0, Y0, X1, Y1; + + for ( i = 0; i < NUM_LINEAS_DIAS_POSIBLES && DesdeDonde + i < MesDiaPosibles[366]; i++ ) + { + MuestraClt( 18, i, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + for ( ; i < NUM_LINEAS_DIAS_POSIBLES; i++ ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + ObtenCoordenadaSClt1( 18, i, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } +} + +void CalculaCantProdDia( int MesDia ) +{ +/* + int i; + + InicioProdDia_Clt = -1; + SClt2[0].Unidades = 0; + // Contamos el n£mero de productos en este d¡a + for ( i = 1; i < SClt2[0].Total; i++ ) + { + if ( SClt2[i].MesDia == MesDia ) + { + if ( InicioProdDia_Clt == -1 ) + InicioProdDia_Clt = i; + SClt2[0].Unidades++; + } + } +*/ +} + + /**************************************************************************\ +|* *| +|* DuplicaClientes *| +|* *| +|* Descripci¢n: *| +|* Dado que he elegido un sistema rigido para tratar a los *| +|* clientes, me veo obligado una vez al a¤o a clonar la *| +|* base de datos de los clietnes... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +/* +void DuplicaClientes(void) +{ + long Regs; + BDatos BPtmp; + char buffer[80]; + + // Base a clonar + sprintf( buffer, "datos\\%s\\info_clt.%03d", NEmpresa, ( (FechaGestionActual.da_year-1) - ((FechaGestionActual.da_year-1)/1000)*1000 ) ); + if ( BPtmp.AbrirReg( buffer, sizeof( INFO_CLIENTES1 ) ) == ERROR ) + Error(0x01, BPtmp.cError); + + // Base clonada + sprintf( buffer, "datos\\%s\\info_clt.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BClt1.AbrirReg( buffer, sizeof( INFO_CLIENTES1 ) ) == ERROR ) + Error(0x01, BClt1.cError); + + for( Regs = 0; Regs < BPtmp.Registros(); Regs++ ) + { + if ( BPtmp.LeeReg( (void *)&SClt1, Regs ) == ERROR ) + Error(0x01, BPtmp.cError); + if ( BClt1.InsReg( (void *)&SClt1, BClt1.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BClt1.cError); + } + + BClt1.CerrarReg(); + BPtmp.CerrarReg(); + +} +*/ + + + + + /**************************************************************************\ +|* *| +|* MuestraDatoSClt1 *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatoSClt1( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_Clt que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_Clt && (RowStart + linea) < BClt1.Registros()/*dev == OK*/; linea++ ) + { + dev = BClt1.LeeReg( (void *)&SClt1, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 3 campos, ehhh!!! + for ( campo=0; campo < 3; campo++ ) + MuestraClt( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( linea < NLINEAS_Clt ) //dev != OK ) + { + //linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_Clt; linea++ ) + for ( campo=0; campo < 3; campo++ ) + { + ObtenCoordenadaSClt1( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosVClt( int linea ) +{ + int campo; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + for ( campo=3; campo < 18; campo++ ) + MuestraClt( campo, linea, NORMAL ); +} + + /**************************************************************************\ +|* *| +|* MuestraClt *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraClt( char columna, int linea, char como ) +{ + char buffer[80], draw; + char buffer1[80], i; + + int X0, Y0, X1, Y1; + + ObtenCoordenadaSClt1( columna, linea, &X0, &Y0, &X1, &Y1 ); + + draw = 1; + + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer, "%08lu", SClt1.Codigo ); + break; + // Nombre del Cliente + case 1: + sprintf ( buffer, " %30s", SClt1.Nombre ); + break; + // N§ de Telefono + case 2: + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + sprintf ( buffer, "%15s", SClt1.Telefono1 ); + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + draw = 0; + break; + + + // Codigo + case 3: + sprintf ( buffer, "%09lu", SClt1.Codigo ); + break; + // NIF / CIF + case 4: + sprintf ( buffer, "%10s", SClt1.Cif ); + + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0 + 2, Y0 + 2, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + break; + // Nombre del Cliente + case 5: + sprintf ( buffer, "%27s", SClt1.Nombre ); + break; + // DATOa01 + case 6: + sprintf ( buffer, "%27s", SClt1.DATOa01 ); + break; + // Direccion + case 7: + sprintf ( buffer, "%27s", SClt1.Direccion ); + break; + // Localidad + case 8: + sprintf ( buffer, "%15s", SClt1.Localidad ); + break; + // Provincia + case 9: + sprintf ( buffer, "%15s", SClt1.Provincia ); + break; + // Codigo Postal + case 10: + formatea_long( SClt1.CodPostal, buffer1 ); + sprintf ( buffer, "%10s", buffer1 ); + break; + // Telefono + case 11: + sprintf ( buffer, " %15s", SClt1.Telefono1 ); + break; + // Fax + case 12: + sprintf ( buffer, " %15s", SClt1.Fax ); + break; + + // Comentario + case 13: + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + for ( i = 0; i < 5; i++ ) + outtextxy( X0 + 2, Y0 + 14*i, SClt1.Notas[i] ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + + // DATOSa(02-05) + case 14: + sprintf ( buffer, "%6s", SClt1.DATOa02 ); + break; + case 15: + sprintf ( buffer, "%6s", SClt1.DATOa03 ); + break; + case 16: + sprintf ( buffer, "%6s", SClt1.DATOa04 ); + break; + case 17: + sprintf ( buffer, "%6s", SClt1.DATOa05 ); + break; + case 18: + sprintf ( buffer, "%02d-%02d-%02d", (int)(MesDiaPosibles[linea]>>8), (int)(MesDiaPosibles[linea]&0x0000FFFF), (int)(( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 )) ); + + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0 + 2, Y0 + 14*i, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + case 19: +/* + // Busco dentro de la base de datos B_IVentas2 el c¢digo SClt2[linea+InicioProdDia_Clt].CodigoR + strcpy ( S_IVentas2.Nombre, "Esto es una prueba" ); + sprintf ( buffer, "%30s %02d", S_IVentas2.Nombre, SClt2[linea+InicioProdDia_Clt].Unidades ); + + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0 + 2, Y0 + 14*i, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); +*/ + break; + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaClt *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaClt( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer1, "C¢digo de Cliente" ); + break; + // Nombre del Cliente + case 1: + sprintf ( buffer1, "Nombre del Cliente" ); + break; + // Telefono + case 2: + sprintf ( buffer1, "N£mero de tel‚fono (1§) del Cliente" ); + break; + + + // Codigo + case 3: + sprintf ( buffer1, "Introduzca el codigo que desea asignar al Cliente" ); + break; + // Nif / Cif + case 4: + sprintf ( buffer1, "N.I.F. o C.I.F. del Cliente" ); + break; + // Nombre del Cliente + case 5: + sprintf ( buffer1, "Introduzca el Nombre del Cliente" ); + break; + // DATOSa01 + case 6: + sprintf ( buffer1, "DATOS ampliacion 1 (a su elecci¢n)" ); + break; + // Direccion + case 7: + sprintf ( buffer1, "Direccion completa del Cliente" ); + break; + // Localidad + case 8: + sprintf ( buffer1, "Localidad del Cliente" ); + break; + // Provincia + case 9: + sprintf ( buffer1, "Provincia" ); + break; + // C¢digo postal + case 10: + sprintf ( buffer1, "C¢digo Postal" ); + break; + // Telefono + case 11: + sprintf ( buffer1, "N£mero de tel‚fono del Cliente" ); + break; + // Fax + case 12: + sprintf ( buffer1, "Fax o segundo tel‚fono del Cliente" ); + break; + case 13: + sprintf ( buffer1, "Breves notas sobre el Cliente" ); + break; + + case 14: + sprintf ( buffer1, "DATOS ampliacion a02 (a su elecci¢n)" ); + break; + case 15: + sprintf ( buffer1, "DATOS ampliacion a03 (a su elecci¢n)" ); + break; + case 16: + sprintf ( buffer1, "DATOS ampliacion a04 (a su elecci¢n)" ); + break; + case 17: + sprintf ( buffer1, "DATOS ampliacion a05 (a su elecci¢n)" ); + break; + + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* EditItemClt *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemClt( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadaSClt1( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real +// case 0: + case 3: + sprintf ( buffer, "%lu", SClt1.Codigo ); + if ( !( InputCadenaG( buffer, 1, 8, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SClt1.Codigo = atol( buffer ); + MuestraClt( 0, linea, NORMAL ); + MuestraClt( 3, linea, NORMAL ); + break; + // Nombre del Cliente +// case 1: + case 5: + strcpy ( buffer, SClt1.Nombre ); + if ( !( InputCadenaG( buffer, 0, 27, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Nombre, buffer ); + MuestraClt( 1, linea, NORMAL ); + MuestraClt( 5, linea, NORMAL ); + break; + // Telefono +// case 2: + case 11: + sprintf ( buffer, "%s", SClt1.Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Telefono1, buffer ); + MuestraClt( 2, linea, NORMAL ); + MuestraClt( 12, linea, NORMAL ); + break; + // Fax + case 12: + sprintf ( buffer, "%s", SClt1.Fax ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Fax, buffer ); + MuestraClt( 3, linea, NORMAL ); + MuestraClt( 13, linea, NORMAL ); + break; + + + // CIF / NIF + case 4: + sprintf ( buffer, "%s", SClt1.Cif ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + if ( !( InputCadenaG( buffer, 0, 10, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Cif, buffer ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + + // DATOS a01 + case 6: + sprintf ( buffer, "%s", SClt1.DATOa01 ); + if ( !( InputCadenaG( buffer, 0, 27, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.DATOa01, buffer ); + break; + + // Direccion + case 7: + sprintf ( buffer, "%s", SClt1.Direccion ); + if ( !( InputCadenaG( buffer, 0, 27, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Direccion, buffer ); + break; + // Poblaci¢n + case 8: + sprintf ( buffer, "%s", SClt1.Localidad ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Localidad, buffer ); + break; + // Provincia + case 9: + sprintf ( buffer, "%s", SClt1.Provincia ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SClt1.Provincia, buffer ); + break; + // C¢digo Postal + case 10: + sprintf ( buffer, "%lu", SClt1.CodPostal ); + if ( !( InputCadenaG( buffer, 0, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SClt1.CodPostal = atol ( buffer ); + break; + // Comentario + case 13: + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + EditComentario( (char *)(&SClt1.Notas[0][0]), 4, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1, 14 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + default: + while( kbhit() ) getch(); + } + +} +#endif + + /**************************************************************************\ +|* *| +|* ObtenCoordenadaSClt1 *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadaSClt1( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 334 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: // Codigo de Cliente + *X0 = 7; *X1 = 78; + break; + case 1: // Nombre del Cliente + *X0 = 87; *X1 = 348; + break; + case 2: // Tel‚fono + *X0 = 352; *X1 = 451; + break; + + case 3: // Introducir Codigo de Cliente + *X0 = 66; *Y0 = 17; + *X1 = 149; *Y1 = 38; + break; + case 4: // Nif / Cif + *X0 = 246; *Y0 = 17; + *X1 = 309; *Y1 = 38; + break; + case 5: // Nombre + *X0 = 91; *Y0 = 48; + *X1 = 309; *Y1 = 69; + break; + case 6: // DATO a01 + *X0 = 91; *Y0 = 73; + *X1 = 309; *Y1 = 94; + break; + case 7: // Direccion + *X0 = 91; *Y0 = 98; + *X1 = 309; *Y1 = 119; + break; + case 8: // Localidad + *X0 = 91; *Y0 = 123; + *X1 = 224; *Y1 = 144; + break; + case 9: // Provincia + *X0 = 91; *Y0 = 148; + *X1 = 224; *Y1 = 169; + break; + case 10: // Codigo Postal + *X0 = 311; *Y0 = 148; + *X1 = 394; *Y1 = 169; + break; + case 11: // Tel‚fono 1 + *X0 = 91; *Y0 = 173; + *X1 = 239; *Y1 = 194; + break; + case 12: // Tel‚fono 2 + *X0 = 246; *Y0 = 173; + *X1 = 394; *Y1 = 194; + break; + + case 13: // NOTAS + *X0 = 203; *Y0 = 215; + *X1 = 392; *Y1 = 290; + break; + + case 14: // DATOS a 02 + *X0 = 91; *Y0 = 198; + *X1 = 194; *Y1 = 219; + break; + case 15: // DATOS a 03 + *X0 = 91; *Y0 = 223; + *X1 = 194; *Y1 = 244; + break; + case 16: // DATOS a 04 + *X0 = 91; *Y0 = 248; + *X1 = 194; *Y1 = 269; + break; + case 17: // DATOS a 05 + *X0 = 91; *Y0 = 273; + *X1 = 194; *Y1 = 294; + break; + + case 18: // Dias disponibles + *X0 = 401; *Y0 = 143 + 10*linea; + *X1 = 452; *Y1 = *Y0 + 10 ; + break; + + case 19: // Productos adquiridos + *X0 = 456; *Y0 = 163 + 10*linea; + *X1 = 634; *Y1 = *Y0 + 10 ; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* CltNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CltNuevoRegistro( INFO_CLIENTES1 *NSClt1 ) +{ + char i; + + // Recogemos informaci¢n sobre el enlace de cliente (PARA CUANDO NOS HAGA FALTA) + /* + NSClt1 -> CodEnlace = CodSigEnlace; + */ + // Grabamos el nuevo siguiente c¢digo de enlace + + + NSClt1 -> Codigo = 0; // Codigos asignados a los Clientes + strcpy( NSClt1 -> Cif, "" ); // Nif / Cif del cliente + strcpy( NSClt1 -> Nombre, "" ); // Nombre del Cliente + strcpy( NSClt1 -> DATOa01, "" ); // DATO ampliacion 01 + + strcpy( NSClt1 -> Telefono1, "" ); // Tel‚fono y fax del Clteedor + strcpy( NSClt1 -> Fax, "" ); // + + strcpy( NSClt1 -> Direccion, "" ); // Direccion + + strcpy( NSClt1 -> Localidad, "" ); // Localidad + strcpy( NSClt1 -> Provincia, "" ); // Provincia + NSClt1 -> CodPostal = 0; // C¢digo Postal + + for ( i = 0; i < 6; i++ ) + NSClt1 -> Notas[i][0] = '\0'; + + strcpy( NSClt1 -> DATOa02, "" ); // DATO ampliacion 01 + strcpy( NSClt1 -> DATOa03, "" ); // DATO ampliacion 01 + strcpy( NSClt1 -> DATOa04, "" ); // DATO ampliacion 01 + strcpy( NSClt1 -> DATOa05, "" ); // DATO ampliacion 01 + +} + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* BuscaClt *| +|* *| +|* Descripci¢n: *| +|* Busca una referencia por su n§ o descripcion *| +|* *| +|* Entradas: *| +|* ATRAS Busca otra coincidencia hacia atras *| +|* NUEVA_BUSQUEDA Inicia una nueva busqueda *| +|* ADELANTE Busca otra coincidencia hacia delante *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void BuscaClt( char TipoBusqueda, char *CurrRow, long *CurrClt ) +{ + static INFO_CLIENTES1 MClt; + char enc; long i; + + + switch ( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + if ( ObtenMatchClt( &MClt ) != OK ) + return; + i = 0; + break; + case ATRAS: + case ADELANTE: + i = ( *CurrRow + *CurrClt ) + TipoBusqueda; + break; + } + + Optar( ENCUADRE, "Comando: Buscar", "Ahora se inica", "la busqueda elegida", NULL ); + enc = 0; + while ( i < BClt1.Registros() && !enc ) + { + if ( BClt1.LeeReg( (void *)&SClt1, i ) == ERROR ) + Error( 0x01, BClt1.cError); + if ( Match_Clt( &SClt1, &MClt ) ) + enc = 1; + else + i++; + } + + Optar( ENCUADRE, NULL ); + + if ( enc ) + { + *CurrRow = 0; *CurrClt = i; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatoSClt1( *CurrRow + *CurrClt ); + if ( BClt1.LeeReg( (void *)&SClt1, *CurrClt ) == ERROR ) + Error(0x01, BClt1.cError); + MuestraDatosVClt( *CurrRow ); + } else + switch( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + case ATRAS: + case ADELANTE: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + } + + if ( BClt1.LeeReg( (void *)&SClt1, (*CurrRow + *CurrClt) ) == ERROR ) + Error( 0x01, BClt1.cError); + + +} + + /**************************************************************************\ +|* *| +|* Match_Clt *| +|* *| +|* Descripci¢n: *| +|* Compara dos registros y devuelve la posible coincidencia *| +|* *| +|* Entradas: *| +|* Registros a comparar *| +|* *| +|* Salidas: *| +|* Resultado de la comparaci¢n *| +|* *| + \**************************************************************************/ +int Match_Clt( INFO_CLIENTES1 *A, INFO_CLIENTES1 *B ) +{ + if ( B -> Codigo != 0 ) + return (A -> Codigo == B -> Codigo); + if ( B -> Nombre[0] != '\0' ) + return ( strncmpi( A -> Nombre, B -> Nombre, strlen( B -> Nombre ) ) == 0 ); + if ( B -> Direccion[0] != '\0' ) + return ( strncmpi( A -> Direccion, B -> Direccion, strlen( B -> Direccion ) ) == 0 ); + if ( B -> Telefono1[0] != '\0' ) + return ( strncmpi( A -> Telefono1, B -> Telefono1, strlen( B -> Telefono1 ) ) == 0 ); + + return 0; +} + + /**************************************************************************\ +|* *| +|* ObtenMatchClt *| +|* *| +|* Descripci¢n: *| +|* Obtine los patrones de busqueda necesarios *| +|* *| +|* Entradas: *| +|* Estructura donde guardar el patron de busqueda *| +|* *| +|* Salidas: *| +|* OK La entrada es correcta *| +|* ERROR El usuario interrumpio la busqueda *| +|* *| + \**************************************************************************/ +int ObtenMatchClt( INFO_CLIENTES1 *MClt ) +{ + char Row, ok, i; + int BPush, key, DEV; + struct textsettingstype texttypeinfo; + + gettextsettings( &texttypeinfo ); + + Optar( ENCUADRE, "Comando: Buscar", NULL ); + Imprime_Estaticos( 31, "systm\\tpv.img" ); + + ok = 0; Row = 0; + + CltNuevoRegistro( MClt ); + + do + { + MatchDrawClt(Row, *MClt, INTENSO); + BPush = Comprueba_Secuencia( SEC_OPTAR, NULL ); + MatchDrawClt(Row, *MClt, NORMAL); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + case -2: + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditMatchClt( Row, MClt ); + for ( i=0; i < 4; i++ ) + MatchDrawClt(i, *MClt, NORMAL); + break; + case -1: + switch ( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + Row--; if ( Row < 0 ) Row = 3; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + Row++; if ( Row > 4 ) Row = 0; + break; + } + break; + case 1: + DEV = OK; ok = 1; + break; + case 2: + DEV = ERROR; ok = 1; + break; + } + + } while ( !ok ); + + Optar( ENCUADRE, NULL ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + return DEV; + +} + + /**************************************************************************\ +|* *| +|* EditMatchClt *| +|* *| +|* Descripci¢n: *| +|* Edita el patron de busqueda *| +|* *| +|* Entradas: *| +|* Campo a editar, y lugar donde almacenarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditMatchClt( char Row, INFO_CLIENTES1 * MClt ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchClt( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, "%lu", MClt -> Codigo ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CltNuevoRegistro( MClt ); + MClt -> Codigo = atol(buffer); + } + break; + case 1: + sprintf( buffer, "%s", MClt -> Nombre ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CltNuevoRegistro( MClt ); + strcpy ( MClt -> Nombre, buffer ); + } + break; + case 2: + sprintf( buffer, "%s", MClt -> Direccion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CltNuevoRegistro( MClt ); + strcpy ( MClt -> Direccion, buffer ); + } + break; + case 3: + sprintf( buffer, "%s", MClt -> Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + CltNuevoRegistro( MClt ); + strcpy ( MClt -> Telefono1, buffer ); + } + break; + } + + + +} + + /**************************************************************************\ +|* *| +|* MatchDrawClt *| +|* *| +|* Descripci¢n: *| +|* Escribe los distintos campos seg£n se le indique *| +|* *| +|* Entradas: *| +|* Campo a mostrar, lugar donde se encuentra, y como mostrarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MatchDrawClt( char Row, INFO_CLIENTES1 MClt, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchClt( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, " %9lu", MClt.Codigo ); + break; + case 1: + strncpy( buffer, MClt.Nombre, 25 ); + buffer[26] = '\0'; + break; + case 2: + strncpy( buffer, MClt.Direccion, 25 ); + buffer[26] = '\0'; + break; + case 3: + strncpy( buffer, MClt.Telefono1, 15 ); + buffer[26] = '\0'; + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* MatchDrawClt *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas relativas al campo dado. *| +|* *| +|* Entradas: *| +|* Campo a obtener las coordenadas, y coordenadas de salida *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasMatchClt( char Row, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + switch( Row ) + { + case 0: + *X0 = 265; *X1 = 365; + *Y0 = 200; *Y1 = 220; + break; + case 1: + *X0 = 265; *X1 = 465; + *Y0 = 225; *Y1 = 245; + break; + case 2: + *X0 = 265; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 3: + *X0 = 265; *X1 = 465; + *Y0 = 280; *Y1 = 305; + break; + case 4: + *X0 = 385; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 5: + *X0 = 330; *X1 = 365; + *Y0 = 275; *Y1 = 300; + break; + } + + (*X0) ++; (*Y0) ++; + (*X1) --; (*Y1) --; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresiones *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesClientes(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 22, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + + ImprimeClientes( dev ); + + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeNombrees *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeClientes( char como ) +{ + long i, old_reg; + + + FILE *file_out; + + old_reg = BClt1.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraClt(como, file_out); + + for ( i=0; i +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_EMPR 9 +#define NLINEAS_EMPRelegir 10 + +#define CONTRAE 0 +#define EXPANDE 1 + +extern INFO_EMPRESAS SEmpr; // Estructura de Empreedores + + typedef struct + { + // Datos de uso p£blico (->ú<-) + char file[13]; // archivo vinculado a la rama + + // Datos privados + char Titulo[80]; // Titulo de la rama + + char Disponible; // Indica si esta o no el item disponible + + unsigned char nivel; // Nivel de profundidad en el cual estamos + char ExpCont; // La rama es: + // Expansible 1 Nada -1 + // Contraible 0 + char Estado; // La rama esta: + // Expandida 1 + // Contraida 0 + char Visible; // Es visible en estos momentos? + } ARBOL_EXPANSIBLE; + + ARBOL_EXPANSIBLE *InfoGBD; // Informacion sobre la empresa + + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void ImportaFicheros(void); +void ExportaFicheros( int CurrRow ); +void GestionBaseDatos(void); +void EscalaLogotipo( char * File, int X, int Y ); +void ContraeExpandeRama( ARBOL_EXPANSIBLE *DesdeAqui, char ContraeExpande ); +void IntroduceDatos( char *titulo, char *file, unsigned char nivel, char ExpCont, char Estado, char Visible, int i ); + +int RecopilaInformacion( int *Nodos ); + +void MuestraDatosGBD( ARBOL_EXPANSIBLE *DesdeAqui ); +void MuestraGDB( ARBOL_EXPANSIBLE *EstaRama, char RowPhysic, char COMO ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void ImprimeInformacion(void); + + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* GestionBaseDatos *| +|* *| +|* Descripci¢n: *| +|* Controla todas las bases de datos, existentes en el disco *| +|* duro, de la empresa activa. *| +|* Los datos cuelgan del nombre de la empresa, clasificados *| +|* por a¤o, tema y dentro de este, mes, si corresponde... *| +|* *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GestionBaseDatos(void) +{ + char buffer2[100], ok = 0; + char buffer[100]; + int BPush, key, i; + + int CurrRow; // Linea sobre la que estamos + int RowPhysic; // Linea F¡sica sobre la que estamos + int NLineasT; // N§ total de lineas + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 130, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 30' + + sprintf( buffer, "datos\\%s\\tpv.pcx", NEmpresa ); + if ( access( buffer, 0 ) != 0 ) + sprintf( buffer, "systm\\tpv.pcx" ); + EscalaLogotipo( buffer, 275, 5 ); + + + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + if ( RecopilaInformacion( &NLineasT ) == ERROR ) + { + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + Optar( 0, "Memoria insuficiente", "No se a podido alojar la", "cantidad de memoria requerida", "libere memoria antes de", "volver a intertarlo.", NULL ); + return; + } + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + // Mostramos datos hasta que se nos acabe la pantalla + RowPhysic = CurrRow = 0; + MuestraDatosGBD( &InfoGBD[CurrRow] ); + + do { + MuestraGDB( &InfoGBD[CurrRow], RowPhysic, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraGDB( &InfoGBD[CurrRow], RowPhysic, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + switch ( getch() ) + { + // Contrae la rama + case 27: + ContraeExpandeRama( &InfoGBD[CurrRow], CONTRAE ); + setfillstyle( SOLID_FILL, 0 ); bar ( 12, 12, 263, 443 ); + RowPhysic = CurrRow = 0; + MuestraDatosGBD( &InfoGBD[CurrRow] ); + break; + // Contrae/Expande rama, dependiendo del estado + case 13: + ContraeExpandeRama( &InfoGBD[CurrRow], InfoGBD[CurrRow].Estado == EXPANDE ? CONTRAE : EXPANDE ); + setfillstyle( SOLID_FILL, 0 ); bar ( 12, 12, 263, 443 ); + RowPhysic = CurrRow = 0; + MuestraDatosGBD( &InfoGBD[CurrRow] ); + break; + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + if ( CurrRow > 0 ) + { + RowPhysic --; + do { + CurrRow--; + } while( CurrRow > 0 && !InfoGBD[CurrRow].Visible ); + } + if ( RowPhysic < 0 ) + { + i = 0; + do { + CurrRow--; + if ( InfoGBD[CurrRow].Visible ) + i ++; + } while( CurrRow > 0 && i != 28 ); + setfillstyle( SOLID_FILL, 0 ); bar ( 12, 12, 263, 443 ); + MuestraDatosGBD( &InfoGBD[CurrRow] ); + RowPhysic = 0; +// + RowPhysic += 27; + i = 0; + do { + CurrRow++; + if ( InfoGBD[CurrRow].Visible ) + i++; + } while( i != 27 && strcmp( InfoGBD[CurrRow].Titulo, "TOPE_FINAL" ) != 0 ); + if ( !InfoGBD[CurrRow].Visible || strcmp( InfoGBD[CurrRow].Titulo, "TOPE_FINAL" ) == 0 ) + { + RowPhysic --; + do { + CurrRow--; + } while( CurrRow > 0 && !InfoGBD[CurrRow].Visible ); + } +// + } + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + RowPhysic ++; + do { + CurrRow++; + } while( !InfoGBD[CurrRow].Visible && strcmp( InfoGBD[CurrRow].Titulo, "TOPE_FINAL" ) != 0 ); + if ( !InfoGBD[CurrRow].Visible || strcmp( InfoGBD[CurrRow].Titulo, "TOPE_FINAL" ) == 0 ) + { + RowPhysic --; + do { + CurrRow--; + } while( CurrRow > 0 && !InfoGBD[CurrRow].Visible ); + } + if ( RowPhysic >= 28 ) + { + RowPhysic = 0; + setfillstyle( SOLID_FILL, 0 ); bar ( 12, 12, 263, 443 ); + MuestraDatosGBD( &InfoGBD[CurrRow] ); + } + break; + // Inicio + case 71: +// RowPhysic = CurrRow = 0; + break; + // Fin + case 79: +/* + CurrRow = NLineas-1; + if ( InfoGBD[CurrRow].Estado == CONTRAIDO ) + do { + CurrRow--; + } while( CurrRow > 0 && InfoGBD[CurrRow].Estado == CONTRAIDO ); +*/ + break; + } + break; + // Imprimir Informe detallado + case 1: + break; + // Menu Principal + case 2: + ok = 1; + break; + // Exportar + case 3: + ExportaFicheros( CurrRow ); + break; + // Importar + case 4: + ImportaFicheros(); + break; + // Retroceso R pido + case 5: + ungetch(75); ungetch(0); + // Inicio + case 6: + ungetch(71); ungetch(0); + break; + // Eliminar Clave + case 7: + // No se permite eliminar TODO, TODO, del tiron + if ( CurrRow == 0 ) break; + + if ( InfoGBD[CurrRow].nivel <= InfoGBD[CurrRow+1].nivel ) + sprintf( buffer, "toda la clave COMPLETA." ); + else + sprintf( buffer, "el siguiente fichero: %s", InfoGBD[CurrRow].file ); + Optar( 0, "ALERTA de ELIMINACION!!!", "Se dispone a eliminar", buffer, "¨ Desea continuar ?", NULL ); + if ( Optar( 1, "ALERTA de ELIMINACION!!!", "Se dispone a eliminar", buffer, "¨ Esta realmente seguro ?", NULL ) ) + { + i = 0; + do { + sprintf( buffer, "datos\\%s\\%s", NEmpresa, InfoGBD[CurrRow + i].file ); + unlink( buffer ); + i ++; + } while ( InfoGBD[CurrRow + i].nivel <= InfoGBD[CurrRow + i + 1].nivel ); + } + // ReEscaneamos el  rbol + free( InfoGBD ); + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + if ( RecopilaInformacion( &NLineasT ) == ERROR ) + { + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + Optar( 0, "Memoria insuficiente", "No se a podido alojar la", "cantidad de memoria requerida", "libere memoria antes de", "volver a intertarlo.", NULL ); + return; + } + Optar( ENCUADRE, "Recopilando informaci¢n", "Se esta recopilando toda", "la informaci¢n disponible", "acerca de su empresa:", "Por favor, espere...", NULL ); + // Volvemos a mostrar todo + CurrRow--; + MuestraDatosGBD( &InfoGBD[CurrRow] ); + break; + // Fin + case 8: + ungetch(79); ungetch(0); + break; + // AvanceR pido + case 9: + ungetch(77); ungetch(0); + break; + +#ifndef DEMOSTRACION +#else +#endif + default: + break; + } + + } while( !ok ); + +#ifndef DEMOSTRACION + // Do nothing +#else + Optar( 0, "VERSION DEMOSTRACION", "Cambios realizados no ser n", "llevados a cabo.", NULL ); +#endif + + free( InfoGBD ); +} + + +void MuestraDatosGBD( ARBOL_EXPANSIBLE *DesdeAqui ) +{ + int i, j; + + for ( i = 0, j = 0; j < 28 && strcmp( DesdeAqui[i].Titulo, "TOPE_FINAL" ) != 0; i++ ) + { + if ( DesdeAqui[i].Visible ) + { + MuestraGDB( &DesdeAqui[i], j, NORMAL ); + j++; + } + } + +} + +void MuestraGDB( ARBOL_EXPANSIBLE *EstaRama, char RowPhysic, char COMO ) +{ + char buffer[80]; + int Y0, Y1, X0, X1; + + Y0 = 20 + 15*RowPhysic; + Y1 = Y0 + 17; + // Ymin => 425 + + X0 = 20; X1 = 255; + + setfillstyle( COMO == NORMAL ? SOLID_FILL : CLOSE_DOT_FILL, COMO == NORMAL ? 0 : Config.TxtBgI ); + bar ( X0, Y0, X1, Y1 ); + setcolor( COMO == NORMAL ? Config.TxtFgN + 1 : Config.TxtBgN ); + + // Mostramos si es posible CONTRAERLA/EXPANDIRLA o no se puede hacer nada + sprintf ( buffer, "%s", (EstaRama -> ExpCont) == EXPANDE ? + ( (EstaRama -> Estado ) == CONTRAE ? "+" : "-" ) : + " " ); + outtextxy ( 20 + 20*(EstaRama -> nivel), Y0, buffer ); + + if ( strcmp( (EstaRama -> file), "--------.---" ) == 0 ) + sprintf ( buffer, "%s", (EstaRama -> Titulo) ); + else + sprintf ( buffer, "%s <%s>", (EstaRama -> Titulo), (EstaRama -> file) ); + outtextxy ( 35 + 20*(EstaRama -> nivel), Y0, buffer ); +} + + /**************************************************************************\ +|* *| +|* ExportaFicheros *| +|* *| +|* Descripci¢n: *| +|* Lleva la clave seleccionada hacia A:\[NEmpresa] *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ExportaFicheros( int CurrRow ) +{ + char buffer[80]; + int i; + + Optar( 0, "Inicio de Exportaci¢n", "Inserte un disco limpio en A:", "Se dispone a copiar la clave", "seleccionada para llevarla", "a otro ordenador, o guardarla.", NULL ); + // Iniciamos la exportacion + // Vemos si tenemos suficiente espacio libre + + + // Creamos en la unidad A:\ el directorio de la empresa, lo + // limpiamos y comenzamos... + sprintf( buffer, "A:\\%s", NEmpresa ); + if ( !mkdir(buffer) ) + { + Optar( 0, "Error de escritura", "Me es imposible acceder", "a la unidad A:\\", "Proceso Abortado", NULL ); + } + + i = 0; + do { + // Solo si no es una cabecera... + if ( strcmp( InfoGBD[CurrRow + i].file, "--------.---" ) != 0 ) + { + sprintf( buffer, "datos\\%s\\%s", NEmpresa, InfoGBD[CurrRow + i].file ); + // ... a copiar los ficheros de [ buffer ] ---->>> [ A:\NEmpresa\InfoGBD[CurrRow + i ].file ] + } + i ++; + } while ( InfoGBD[CurrRow + i].nivel <= InfoGBD[CurrRow + i + 1].nivel ); + +} + + /**************************************************************************\ +|* *| +|* ImportaFicheros *| +|* *| +|* Descripci¢n: *| +|* Se trae lo ficheros previamente exportados de A:\[NEmpresa] *| +|* hasta \[NEmpresa] *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImportaFicheros(void) +{ + int i; + struct ffblk ffblk; + char buffer2[80], buffer[80]; + + if ( !Optar( 1, "Alerta ­­­ Importaci¢n !!!", "Este proceso eliminar  las", "versiones existentes de BDatos", "¨ Desea continuar ?", NULL ) ) + return; + + Optar( 0, "Inicio de Exportaci¢n", "Inserte un disco limpio en A:", "Se dispone a restaurar la", "clave seleccionada para", "reponerla o actualizarla.", NULL ); + // Iniciamos la importacion + sprintf( buffer, "A:\\%s\\*.*", NEmpresa ); + i = findfirst(buffer, &ffblk, 0); + while (!i) + { + sprintf( buffer2, "datos\\%s\\%s", NEmpresa, ffblk.ff_name ); + // ... a copiar los ficheros de [ A:\NEmpresa\ffblk.ff_name] ---> [ buffer ] + i = findnext(&ffblk); + }; +} + + + + +#define MOD_SCAL 2 +void EscalaLogotipo( char * File, int X, int Y ) +{ + FILE *fp; + int alto, ancho; unsigned char byte; + int alto2, ancho2; + int scalH = 0, scalV = 0; + int contador; + char color[17] = { 0, EGA_RED, EGA_GREEN, EGA_LIGHTGRAY, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED }; + + + if ( ( fp = fopen ( File, "rb" ) ) != NULL ) + { + + // Saltamos la cabecera + fseek( fp, 128, SEEK_SET ); + alto2 = 0; + for(alto=0; alto<279; alto++) + { + ancho2 = 0; + scalV = (scalV++)%MOD_SCAL; + { + if ( scalV == 1 ) + alto2++; + for(ancho=0; ancho<240; ) + { + byte=getc(fp); + if(byte<=0xC0) + { + scalH = (scalH++)%MOD_SCAL; + if ( scalH == 1 && scalV == 1) + { + if ( byte != 255 ) + putpixel( ancho2+X, alto2+Y, color[byte%16] ); + ancho2++; + } + ancho++; + } + else + { + contador=byte&0x3F; byte=getc(fp); + for(; contador>0; contador--) + { + scalH = (scalH++)%MOD_SCAL; + if ( scalH == 1 && scalV == 1) + { + if ( byte != 255 ) + putpixel( ancho2+X, alto2+Y, color[byte%16] ); + ancho2++; + } + ancho++; + } + } + } + } + } + fclose( fp ); + } + +} + + + + /**************************************************************************\ +|* *| +|* RecopilaInformaci¢n *| +|* *| +|* Descripci¢n: *| +|* Recopila una extensa informaci¢n sobre el estado de las *| +|* bases de datos existentes para la empresa dada, y la *| +|* clasifica por niveles expansibles... *| +|* *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int RecopilaInformacion(int *Nodos) +{ + struct ffblk ffblk; + int done; + + char buffer[80], buffer1[80]; + int Anyos[50], N_Anyos; // Como muchos gestionaremos, 50 a¤os + int i, j, k; + char Mes[12][12] = { "Enero ", "Febrero ", "Marzo ", "Abril ", "Mayo ", "Junio ", "Julio ", "Agosto ", "Septiembre", "Octubre ", "Noviembre ", "Diciembre " }; + + + // Total de ficheros: + for ( i=0; i < 50; i++ ) Anyos[i] = 0; + i = 0; j = 0; N_Anyos = 0; + sprintf( buffer, "datos\\%s\\*.*", NEmpresa ); + done = findfirst(buffer,&ffblk,0); + while (!done) + { + // Analizamos los a¤os de los que disponemos... + if ( strstr( ffblk.ff_name, "CMP" ) != NULL || strstr( ffblk.ff_name, "VT" ) != NULL ) + { + // Obtenemos el a¤o + k = (ffblk.ff_name[4]-'0') * 1000 + (ffblk.ff_name[5]-'0') * 100 + (ffblk.ff_name[6]-'0') * 10 + (ffblk.ff_name[7]-'0') * 1; + // Lo buscamos entre los que ya tenemos y de no encontrarlo lo agregamos + for ( j = 0; j < 50 && Anyos[j] != 0; j++ ) + if ( Anyos[j] == k ) + break; + if ( j < 50 && Anyos[j] == 0 ) + { + N_Anyos++; Anyos[j] = k; + } + } + + i++; done = findnext(&ffblk); + }; + + + + *Nodos = 1 + // Raiz (N0) con el nombre de la empresa + 3 + // Datos que perduran en el tiempo + ( 6 * N_Anyos)+ // Datos por a¤o * n£mero de a¤os disponibles + i + // ( n§ total de ficheros ) + 1 ; // Tope para el final de nuestras funciones... + + + + if ( ( InfoGBD = (ARBOL_EXPANSIBLE *)malloc( sizeof(ARBOL_EXPANSIBLE)*(*Nodos) ) ) == NULL ) + return ERROR; + + // Nivel 0: Nombre de la empresa + j = 0; + IntroduceDatos( SEmpr.Empresa, "--------.---", 0, 1, 0, 1, j ); j++; + // Nv Ex Es Vis + + // Datos que perduran con el tiempo + // Nivel 1: + sprintf( buffer, "datos\\%s\\info_ref.dbf", NEmpresa ); + if ( access( buffer, 0 ) == 0 ) + { + IntroduceDatos( "Articulos", "info_ref.dbf", 1, 0, 0, 0, j ); j++; + } + sprintf( buffer, "datos\\%s\\info_emp.dbf", NEmpresa ); + if ( access( buffer, 0 ) == 0 ) + { + IntroduceDatos( "Info Empleados", "info_emp.dbf", 1, 0, 0, 0, j ); j++; + } + sprintf( buffer, "datos\\%s\\mensajes.dbf", NEmpresa ); + if ( access( buffer, 0 ) == 0 ) + { + IntroduceDatos( "Mensajes Prot.", "mensajes.dbf", 1, 0, 0, 0, j ); j++; + } + + for ( i = 0; i < N_Anyos; i++ ) + { + sprintf( buffer, "%d", Anyos[i] ); + IntroduceDatos( buffer, "--------.---", 1, 1, 0, 0, j/*Tamano bloque*/ ); j++; + + // Informacion variable con el tiempo + // Nivel 2: + sprintf( buffer, "datos\\%s\\inf_prv.%03d", NEmpresa, Anyos[i] - ( Anyos[i] / 1000 ) * 1000 ); + if ( access( buffer, 0 ) == 0 ) + { + sprintf( buffer, "inf_prv.%03d", Anyos[i] - ( Anyos[i] / 1000 ) * 1000 ); + IntroduceDatos( "Proveedores", buffer, 2, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + + // Nivel 3clt: Clientes + sprintf( buffer, "datos\\%s\\inf_clt1.dbf", NEmpresa ); + sprintf( buffer1, "datos\\%s\\inf_clt2.%03d", NEmpresa, Anyos[i] - ( Anyos[i] / 1000 ) * 1000 ); + if ( access( buffer, 0 ) == 0 || access( buffer1, 0 ) == 0) + { + // Nivel 2clt: Clientes + IntroduceDatos( "Clientes", "--------.---", 2, 1, 0, 0, j/*Tamano bloque*/ ); j++; + + if ( access( buffer, 0 ) == 0 ) + { + IntroduceDatos( "Ficha Clt", "inf_clt1.dbf", 3, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + if ( access( buffer1, 0 ) == 0 ) + { + sprintf( buffer, "inf_clt2.%03d", Anyos[i] - ( Anyos[i] / 1000 ) * 1000 ); + IntroduceDatos( "Datos Clt", buffer, 3, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + } + + + IntroduceDatos( "Compras", "--------.---", 2, 1, 0, 0, j/*Tamano bloque*/ ); j++; + // Nivel 3cmp: Archivos de compras existentes + for ( k = 0; k < 12; k++ ) + { + sprintf( buffer, "datos\\%s\\cmp-%04d.m%02d", NEmpresa, Anyos[i], k+1 ); + if ( access( buffer, 0 ) == 0 ) + { + sprintf( buffer, "cmp-%04d.m%02d", Anyos[i], k+1 ); + IntroduceDatos( Mes[k], buffer, 3, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + } + + IntroduceDatos( "Gestion de Ventas", "--------.---", 2, 1, 0, 0, j/*Tamano bloque*/ ); j++; + IntroduceDatos( "Datos generales", "--------.---", 3, 1, 0, 0, j/*Tamano bloque*/ ); j++; + for ( k = 0; k < 12; k++ ) + { + sprintf( buffer, "datos\\%s\\VT1-%04d.m%02d", NEmpresa, Anyos[i], k+1 ); + if ( access( buffer, 0 ) == 0 ) + { + sprintf( buffer, "VT1-%04d.m%02d", Anyos[i], k+1 ); + IntroduceDatos( Mes[k], buffer, 4, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + } + IntroduceDatos( "Productos Vendidos", "--------.---", 3, 1, 0, 0, j/*Tamano bloque*/ ); j++; + for ( k = 0; k < 12; k++ ) + { + sprintf( buffer, "datos\\%s\\VT2-%04d.m%02d", NEmpresa, Anyos[i], k+1 ); + if ( access( buffer, 0 ) == 0 ) + { + sprintf( buffer, "VT2-%04d.m%02d", Anyos[i], k+1 ); + IntroduceDatos( Mes[k], buffer, 4, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + } + sprintf( buffer, "datos\\%s\\VT3-%04d.M--", NEmpresa, Anyos[i] ); + if ( access( buffer, 0 ) == 0 ) + { + sprintf( buffer, "VT3-%04d.M--", Anyos[i] ); + IntroduceDatos( "Ventas por Empleado", buffer, 3, 0, 0, 0, j/*Tamano bloque*/ ); j++; + } + + // Nv Ex Es Vis + } + + IntroduceDatos( "TOPE_FINAL", "--------.---", 0, 0, 0, 0, j/*Tamano bloque*/ ); + // j--; *Nodos = j; + + return OK; +} + + /**************************************************************************\ +|* *| +|* IntroduceDatos *| +|* *| +|* Descripci¢n: *| +|* Realmente esto no vale para nada, solo para tener que *| +|* escribir menos... *| +|* *| +|* Entradas: Los datos de relleno para la estructura ARBOL_EXPANSIBLE *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void IntroduceDatos( char *titulo, char *file, unsigned char nivel, char ExpCont, char Estado, char Visible, int i ) +{ + strcpy( InfoGBD[i].Titulo, titulo ); + strcpy( InfoGBD[i].file, file ); + InfoGBD[i].nivel = nivel; + InfoGBD[i].ExpCont = ExpCont; + InfoGBD[i].Estado = Estado; + InfoGBD[i].Visible = Visible; +} + + /**************************************************************************\ +|* *| +|* ContraeExpandeRama *| +|* *| +|* Descripci¢n: *| +|* Contrae o expande la rama seg£n el par metro y apartir del *| +|* punto indicado... *| +|* *| +|* Entradas: Puntero al inicio de la expanci¢n / contraccion *| +|* Accion a ejecutar: CONTRAE / EXPANDE *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ContraeExpandeRama( ARBOL_EXPANSIBLE *DesdeAqui, char ContraeExpande ) +{ + int i; + + // Solo si desde el punto donde estamos es Expansible + if ( DesdeAqui -> ExpCont == EXPANDE ) + { + DesdeAqui -> Estado = ContraeExpande; + if ( ContraeExpande == CONTRAE ) + { + for ( i=0; ( DesdeAqui -> nivel ) < DesdeAqui[i+1].nivel ; i++) + { + DesdeAqui[i+1].Visible = ContraeExpande; + DesdeAqui[i+1].Estado = ContraeExpande; + } + } else { + for ( i=0; DesdeAqui[i+1].nivel > DesdeAqui -> nivel && DesdeAqui[i+1].nivel != 0; i++) + { + if ( ( DesdeAqui -> nivel + 1 ) == DesdeAqui[i+1].nivel ) + DesdeAqui[i+1].Visible = ContraeExpande; + } + } + } +} +/* + typedef struct + { + // Datos de uso p£blico (->ú<-) + char file[13]; // archivo vinculado a la rama + + // Datos privados + char Titulo[80]; // Titulo de la rama + + unsigned char nivel; // Nivel de profundidad en el cual estamos + char ExpCont; // La rama es: + // Expansible 1 + // Nada 0 + char Estado; // La rama esta: + // Expandida 1 + // Contraida 0 + } ARBOL_EXPANSIBLE; +*/ \ No newline at end of file diff --git a/TPV_GCMP.CPP b/TPV_GCMP.CPP new file mode 100644 index 0000000..811dd70 --- /dev/null +++ b/TPV_GCMP.CPP @@ -0,0 +1,510 @@ +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_CMPg 7 + +#define NORMAL 0 +#define BARRAS 1 + +extern BDatos BCmp; // Base de datos de Compras +extern COMPRAS SCmp; // Estructura de referencias + + // Dia y mes actual para la gestion +extern char DiaActual, MesActual; +extern long RegCompras[31 + 2];// Indice para cado uno de los dias del mes + 2 + +extern char EmpresaActual[9]; // Empresa a la que se le realizan las gestiones + +extern char AjusteCalendario; // Ajuste para los dias del calendario +extern char DiasMes; // Dias que tiene el mes actual + + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void GraficaCompras( void ); +void GraficaComprasMes( void ); + +extern long SumaGastosCompras( char DiaSuma, char MesSuma ); + +extern unsigned long GastosCompras; // Gastos del dia a evaluar + +extern unsigned long GastosComprasD[32]; + +extern void ObtenCoordenadasICmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); +extern void MuestraICmp( char columna, long linea, char como ); +extern void SeleccionaMesCompras( int NivelAcceso ); +extern void MuestraMesActual( char MesMostrar ); +extern void MuestraAyudaICmp ( char columna ); +extern long PosicionDia( char Dia ); + +void MuestraDatosGCmp( long RowStart ); + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* GraficaCompras *| +|* *| +|* Descripci¢n: *| +|* Recorre el mes dado, y nos ofrece una gr fica de las compras*| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficaCompras( void ) +{ + char ok = 0, i, dia; + int BPush; + int CurrRow, CurrCol, oldCol; + long CurrGCmp; + + // Actualizasmos el mes y dia actual en curso + MesActual = FechaGestionActual.da_mon; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 43, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 40' + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = SumaGastosCompras( i, MesActual ); + GastosCompras += GastosComprasD[i]; + } + + SeleccionaMesCompras( NINGUNO ); + MuestraDatosGCmp( 0 ); + + CurrRow = 0; + CurrGCmp = 0; + CurrCol = 0; oldCol = -1; + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrGCmp + CurrRow ) ) == ERROR ) + Error(0x01, BCmp.cError ); + + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + GraficaComprasMes(); + + ok = 0; + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaICmp ( CurrCol + 5 ); + } + + MuestraICmp( CurrCol + 5, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraICmp( CurrCol + 5, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; + if ( CurrCol < 0 ) CurrCol = 4; + break; + // Flecha Derecha + case 77: + case 9: + // Solo se permite acceder a Todo cuando el Codigo es 0 + CurrCol++; + if ( CurrCol > 4 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrGCmp ) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_CMPg - 1; CurrGCmp -= NLINEAS_CMPg; + if ( CurrGCmp < 0 ) CurrGCmp = 0; + + while( ( CurrRow + CurrGCmp ) >= BCmp.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrGCmp ) >= BCmp.Registros() && CurrGCmp > 0 ) CurrGCmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrGCmp + CurrRow ) ) == ERROR ) + Error(0x01, BCmp.cError ); +// GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + } + break; + // Flecha Abajo + case 80: + if ( ( CurrRow + CurrGCmp ) < ( BCmp.Registros() - 1 ) ) + { + if ( ( CurrRow ) >= NLINEAS_CMPg - 1 ) + { + CurrRow = 0; CurrGCmp += NLINEAS_CMPg; + + while ( (CurrGCmp + CurrRow) >= BCmp.Registros() ) CurrGCmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + } else + CurrRow++; + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrGCmp + CurrRow ) ) == ERROR ) + Error(0x01, BCmp.cError ); +// GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrGCmp != 0 ) + { + CurrGCmp = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrGCmp + CurrRow ) ) == ERROR ) + Error(0x01, BCmp.cError ); + + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } +// GraficaComprasMes(); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrGCmp != BCmp.Registros() - NLINEAS_CMPg ) + { + CurrGCmp = BCmp.Registros() - NLINEAS_CMPg; + if ( CurrGCmp < 0 ) + { + CurrGCmp = 0; + CurrRow = BCmp.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + } + + if ( BCmp.LeeReg( (void *)&SCmp, (CurrGCmp + CurrRow ) ) == ERROR ) + Error(0x01, BCmp.cError ); +// GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + break; + } + break; + // Imprimir Compras + case 1: + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Mes Anterior + case 3: + MesActual --; if ( MesActual < 1 ) MesActual = 1; + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + BCmp.CerrarReg(); + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = SumaGastosCompras( i, MesActual ); + GastosCompras += GastosComprasD[i]; + } + SeleccionaMesCompras( NINGUNO ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrGCmp = CurrRow = 0; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + + // Leemos el registro sobre el que estamos posicionados + if ( BCmp.LeeReg( (void *)&SCmp, CurrRow + CurrGCmp ) == ERROR ) + Error(0x01, BCmp.cError ); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + GraficaComprasMes(); + break; + // Mes Siguiente + case 4: + MesActual ++; if ( MesActual > 12 ) MesActual = 12; + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + + BCmp.CerrarReg(); + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = SumaGastosCompras( i, MesActual ); + GastosCompras += GastosComprasD[i]; + } + SeleccionaMesCompras( NINGUNO ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrGCmp = CurrRow = 0; + // PosicionDia( DiaActual + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + + // Leemos el registro sobre el que estamos posicionados + if ( BCmp.LeeReg( (void *)&SCmp, CurrRow + CurrGCmp ) == ERROR ) + Error(0x01, BCmp.cError ); + GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia - 1; + break; + } + break; +#else + // Retroceder//Avanzar mes + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten m¢dificar la clave.", NULL ); + break; +#endif + + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_CMPg - 1; CurrGCmp -= NLINEAS_CMPg; + if ( CurrGCmp < 0 ) CurrGCmp = 0; + + while( ( CurrRow + CurrGCmp ) >= BCmp.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrGCmp ) >= BCmp.Registros() && CurrGCmp > 0 ) CurrGCmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + // Leemos el registro sobre el que estamos posicionados + if ( BCmp.LeeReg( (void *)&SCmp, CurrRow + CurrGCmp ) == ERROR ) + Error(0x01, BCmp.cError ); +// GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia - 1; + break; + } +#endif + break; + // P gina principal de la compra + case 6: +// MuestraDatosGCmp( NUEVA_BUSQUEDA ); + break; + // Cambiar el mes a observar + case 7: + break; + // Siguiente p guina de compras + case 8: +// MuestraDatosGCmp( ADELANTE ); + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrGCmp += NLINEAS_CMPg; + + while ( (CurrGCmp + CurrRow) >= BCmp.Registros() ) CurrGCmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGCmp( CurrGCmp ); + // Leemos el registro sobre el que estamos posicionados + if ( BCmp.LeeReg( (void *)&SCmp, CurrRow + CurrGCmp ) == ERROR ) + Error(0x01, BCmp.cError ); +// GraficaComprasMes(); + for ( dia = 1; dia < 31; dia++ ) + if ( (CurrGCmp + CurrRow ) >= PosicionDia( dia ) && (CurrGCmp + CurrRow ) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia - 1; + break; + } +#endif + break; + default: + break; + } + + } while( !ok ); + + + BCmp.CerrarReg(); + +} + + + + /**************************************************************************\ +|* *| +|* GraficaComprasMes *| +|* *| +|* Descripci¢n: *| +|* Muestra el porcentaje de compras por mesese *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficaComprasMes( void ) +{ + char Mensajes[][12] = { "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" + }; + char buffer[80], buffer1[80]; + int x, y; + + // Mostramos la grafica + MuestraGraficas( 10, 15, 380, 95, DiasMes, (long *)GastosComprasD, Mensajes ); + + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 5, 160, 80, 295 ); bar( 86, 160, 210, 295 ); + + bar( 215, 160, 290, 295 ); bar( 296, 160, 420, 295 ); + + bar( 425, 160, 500, 295 ); bar( 506, 160, 635, 295 ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + // Mostramos los datos num‚ricos + for ( x = 0; x < 3; x++ ) + for ( y = 0; y < 11; y ++ ) + { + if ( (x*11+y+1) <= DiasMes ) + { + formatea_long( GastosComprasD[x*11+y+1], buffer1 ); + sprintf( buffer, "%02d-%02d-%04d %20s", (x*11+y+1), MesActual, FechaGestionActual.da_year, buffer1 ); + outtextxy( 11 + x*210, 165 + y*11, buffer ); + } + } + + formatea_long( GastosCompras, buffer1 ); + sprintf( buffer, "TOTAL: %20s", buffer1 ); + outtextxy( 11 + 2*210, 165 + 10*11, buffer ); + + +} + + /**************************************************************************\ +|* *| +|* MuestraDatosGCmp *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosGCmp( long RowStart ) +{ + int linea, campo; + char dev, dia; + int X0, Y0, X1, Y1; + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + // Imprimo la NLINEAS_PROVcmp que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_CMPg && dev == OK; linea++ ) + { + dev = BCmp.LeeReg( (void *)&SCmp, RowStart + linea ); + if ( dev == OK ) + { + for ( dia = 1; dia < 31; dia++ ) + if ( (RowStart + linea) >= PosicionDia( dia ) && (RowStart + linea) < PosicionDia( dia + 1 ) ) + { + DiaActual = dia/* - 1*/; + break; + } + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=0; campo < 5; campo++ ) + MuestraICmp( campo + 5, linea, NORMAL ); + } + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) linea--; + + if ( linea < NLINEAS_CMPg ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_CMPg; linea++ ) + for ( campo=0; campo < 5; campo++ ) + { + ObtenCoordenadasICmp( campo + 5, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} diff --git a/TPV_GEMP.CPP b/TPV_GEMP.CPP new file mode 100644 index 0000000..4208cd4 --- /dev/null +++ b/TPV_GEMP.CPP @@ -0,0 +1,599 @@ +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_GEMP 7 + +#define NORMAL 0 +#define BARRAS 1 + +extern BDatos B_IVentas3; // Archivo de Ventas 3 de 3 ( Ventas Empleados ) +extern INFORME3_VENTAS S_IVentas3; // Ventas Empleados ( 3 de 3 ) + + // Dia y mes actual para la gestion +extern char DiaActual, MesActual; +extern long RegCompras[31 + 2];// Indice para cado uno de los dias del mes + 2 + +extern char EmpresaActual[9]; // Empresa a la que se le realizan las gestiones + +extern char AjusteCalendario; // Ajuste para los dias del calendario +extern char DiasMes; // Dias que tiene el mes actual + +extern unsigned long GastosCompras; // Gastos del dia a evaluar + +extern unsigned long GastosComprasD[32]; + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void ObtenCoordenadasGEmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); +void GraficasEmpleadosMes( void ); + +extern void MuestraGEmp( char columna, long linea, char como ); +extern void MuestraMesActual( char MesMostrar ); +extern void MuestraAyudaGEmp ( char columna ); + +void MuestraDatosGEmp( long RowStart ); + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* GraficaVentaEmpleados *| +|* *| +|* Descripci¢n: *| +|* Recorre el mes dado, y nos ofrece una gr fica de las ventas *| +|* por empleado... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficaVentaEmpleados( void ) +{ + char ok = 0, i; + int BPush; + int CurrRow, CurrCol, oldCol; + long CurrGEmp; + char buffer[80]; + + // Actualizasmos el mes y dia actual en curso + MesActual = FechaGestionActual.da_mon; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 72, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 40' + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + // Archivo de ventas por empleados ( 3 de 3 ) + sprintf( buffer, "datos\\%s\\VT3-%04d.M--", NEmpresa, FechaGestionActual.da_year/*, MesActual*/ ); + if ( B_IVentas3.AbrirReg( buffer, sizeof( INFORME3_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 3 de 3" ); + if ( B_IVentas3.Registros() == 0 ) + { + sprintf( buffer, "A¤o seleccionado: %04d", FechaGestionActual.da_year ); + Optar( 0, "Ventas por empleados", " No hay ventas de empleados", "en el a¤o seleccionado", buffer, NULL ); + B_IVentas3.CerrarReg(); + return; + } + + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = S_IVentas3.TotalVendido[i-1][MesActual]; + GastosCompras += GastosComprasD[i]; + } + + MuestraDatosGEmp( 0 ); + + CurrRow = 0; + CurrGEmp = 0; + CurrCol = 0; oldCol = -1; + + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, (CurrGEmp + CurrRow ) ) == ERROR ) + Error(0x01, B_IVentas3.cError ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + GraficasEmpleadosMes(); + + ok = 0; + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaGEmp ( CurrCol ); + } + + MuestraGEmp( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraGEmp( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; + if ( CurrCol < 0 ) CurrCol = 4; + break; + // Flecha Derecha + case 77: + case 9: + // Solo se permite acceder a Todo cuando el Codigo es 0 + CurrCol++; + if ( CurrCol > 4 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrGEmp ) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_GEMP - 1; CurrGEmp -= NLINEAS_GEMP; + if ( CurrGEmp < 0 ) CurrGEmp = 0; + + while( ( CurrRow + CurrGEmp ) >= B_IVentas3.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrGEmp ) >= B_IVentas3.Registros() && CurrGEmp > 0 ) CurrGEmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, (CurrGEmp + CurrRow ) ) == ERROR ) + Error(0x01, B_IVentas3.cError ); +// GraficasEmpleadosMes(); + } + break; + // Flecha Abajo + case 80: + if ( ( CurrRow + CurrGEmp ) < ( B_IVentas3.Registros() - 1 ) ) + { + if ( ( CurrRow ) >= NLINEAS_GEMP - 1 ) + { + CurrRow = 0; CurrGEmp += NLINEAS_GEMP; + + while ( (CurrGEmp + CurrRow) >= B_IVentas3.Registros() ) CurrGEmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + } else + CurrRow++; + } + + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, (CurrGEmp + CurrRow ) ) == ERROR ) + Error(0x01, B_IVentas3.cError ); +// GraficasEmpleadosMes(); + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrGEmp != 0 ) + { + CurrGEmp = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + } + + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, (CurrGEmp + CurrRow ) ) == ERROR ) + Error(0x01, B_IVentas3.cError ); + +// GraficasEmpleadosMes(); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrGEmp != B_IVentas3.Registros() - NLINEAS_GEMP ) + { + CurrGEmp = B_IVentas3.Registros() - NLINEAS_GEMP; + if ( CurrGEmp < 0 ) + { + CurrGEmp = 0; + CurrRow = B_IVentas3.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + } + + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, (CurrGEmp + CurrRow ) ) == ERROR ) + Error(0x01, B_IVentas3.cError ); +// GraficasEmpleadosMes(); + break; + } + break; + // Imprimir Compras + case 1: + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Mes Anterior + case 3: + MesActual --; if ( MesActual < 1 ) MesActual = 1; + + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = S_IVentas3.TotalVendido[i-1][MesActual]; + GastosCompras += GastosComprasD[i]; + } + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrGEmp = CurrRow = 0; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + + // Leemos el registro sobre el que estamos posicionados + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, CurrRow + CurrGEmp ) == ERROR ) + Error(0x01, B_IVentas3.cError ); + GraficasEmpleadosMes(); + break; + // Mes Siguiente + case 4: + MesActual ++; if ( MesActual > 12 ) MesActual = 12; + GastosCompras = 0; + for ( i = 1; i <= DiasMes && i <= 31; i++ ) + { + GastosComprasD[i] = S_IVentas3.TotalVendido[i-1][MesActual]; + GastosCompras += GastosComprasD[i]; + } + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrGEmp = CurrRow = 0; + // PosicionDia( DiaActual + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + + // Leemos el registro sobre el que estamos posicionados + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, CurrRow + CurrGEmp ) == ERROR ) + Error(0x01, B_IVentas3.cError ); + GraficasEmpleadosMes(); + break; +#else + // Retroceder//Avanzar mes + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten m¢dificar la clave.", NULL ); + break; +#endif + + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_GEMP - 1; CurrGEmp -= NLINEAS_GEMP; + if ( CurrGEmp < 0 ) CurrGEmp = 0; + + while( ( CurrRow + CurrGEmp ) >= B_IVentas3.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrGEmp ) >= B_IVentas3.Registros() && CurrGEmp > 0 ) CurrGEmp++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + // Leemos el registro sobre el que estamos posicionados + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, CurrRow + CurrGEmp ) == ERROR ) + Error(0x01, B_IVentas3.cError ); +// GraficasEmpleadosMes(); +#endif + break; + // P gina principal de la compra + case 6: +// MuestraDatosGEmp( NUEVA_BUSQUEDA ); + break; + // Cambiar el mes a observar + case 7: + break; + // Siguiente p guina de compras + case 8: +// MuestraDatosGEmp( ADELANTE ); + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrGEmp += NLINEAS_GEMP; + + while ( (CurrGEmp + CurrRow) >= B_IVentas3.Registros() ) CurrGEmp--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosGEmp( CurrGEmp ); + // Leemos el registro sobre el que estamos posicionados + if ( B_IVentas3.LeeReg( (void *)&S_IVentas3, CurrRow + CurrGEmp ) == ERROR ) + Error(0x01, B_IVentas3.cError ); +// GraficasEmpleadosMes(); +#endif + break; + default: + break; + } + + } while( !ok ); + + + B_IVentas3.CerrarReg(); + +} + + + + /**************************************************************************\ +|* *| +|* GraficasEmpleadosMes *| +|* *| +|* Descripci¢n: *| +|* Muestra el porcentaje de compras por mesese *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficasEmpleadosMes( void ) +{ + char Mensajes[][12] = { "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" + }; + char buffer[80], buffer1[80]; + int x, y; + + // Mostramos la grafica + MuestraGraficas( 10, 15, 380, 95, DiasMes, (long *)GastosComprasD, Mensajes ); + + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 5, 160, 80, 295 ); bar( 86, 160, 210, 295 ); + + bar( 215, 160, 290, 295 ); bar( 296, 160, 420, 295 ); + + bar( 425, 160, 500, 295 ); bar( 506, 160, 635, 295 ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + // Mostramos los datos num‚ricos + for ( x = 0; x < 3; x++ ) + for ( y = 0; y < 11; y ++ ) + { + if ( (x*11+y+1) <= DiasMes ) + { + formatea_long( GastosComprasD[x*11+y+1], buffer1 ); + sprintf( buffer, "%02d-%02d-%04d %20s", (x*11+y+1), MesActual, FechaGestionActual.da_year, buffer1 ); + outtextxy( 11 + x*210, 165 + y*11, buffer ); + } + } + + formatea_long( GastosCompras, buffer1 ); + sprintf( buffer, "TOTAL: %20s", buffer1 ); + outtextxy( 11 + 2*210, 165 + 10*11, buffer ); + + +} + + /**************************************************************************\ +|* *| +|* MuestraDatosGEmp *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosGEmp( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + // Imprimo la NLINEAS_PROVcmp que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_GEMP && dev == OK; linea++ ) + { + dev = B_IVentas3.LeeReg( (void *)&S_IVentas3, RowStart + linea ); + if ( dev == OK ) + { + // Por cada linea hay 4 campos, ehhh!!! + for ( campo=0; campo < 4; campo++ ) + MuestraGEmp( campo, linea, NORMAL ); + } + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) linea--; + + if ( linea < NLINEAS_GEMP ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_GEMP; linea++ ) + for ( campo=0; campo < 4; campo++ ) + { + ObtenCoordenadasGEmp( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasGEmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasGEmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = ( 337 + 15*linea ); + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 78; + break; + case 1: + *X0 = 87; *X1 = 413; + break; + case 2: + *X0 = 422; *X1 = 503; + break; + case 3: + *X0 = 512; *X1 = 633; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + + + /**************************************************************************\ +|* *| +|* MuestraAyudaGEmp *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaGEmp ( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo del empleado + case 0: + sprintf ( buffer1, "Codigo del Empleado" ); + break; + // Nombre Completo + case 1: + sprintf ( buffer1, "Nombre y apellidos del vendedor" ); + break; + // % de venta en el mes + case 2: + sprintf ( buffer1, "Procentaje que supone la venta frente al a¤o" ); + break; + // Venta Total en el a¤o + case 3: + sprintf ( buffer1, "Venta total en el a¤o" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraGEmp *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraGEmp( char columna, long linea, char como ) +{ + char buffer[80]; + char buffer1[80], i, j; + long TotalVentas; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasGEmp( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Parte 1 ( visualizaci¢n de proveedores y compras a ellos ) + + // Codigo Real del Vendedor + case 0: + sprintf ( buffer, "%08lu", S_IVentas3.CodigoR ); + break; + // Nombre completo del proveedor + case 1: + sprintf ( buffer, "%30s", S_IVentas3.Vendedor ); + break; + // % que supone esa compra, en todo el a¤o + case 2: + TotalVentas = 0; + for ( i = 0; i < 12; i++ ) + for ( j = 0; j < 31; j++ ) + TotalVentas += S_IVentas3.TotalVendido[j][i]; + sprintf ( buffer, " %03d", TotalVentas != 0 ? ( GastosCompras*100 ) / TotalVentas : 0 ); + break; + // Compras en ese mes + case 3: + formatea_long( GastosCompras, buffer1 ); + sprintf ( buffer, "%11s", buffer1 ); + break; + + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + + outtextxy( X0+2, Y0, buffer ); + +} diff --git a/TPV_ICMP.CPP b/TPV_ICMP.CPP new file mode 100644 index 0000000..a29e267 --- /dev/null +++ b/TPV_ICMP.CPP @@ -0,0 +1,830 @@ +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_PROVcmp 7 + +#define NORMAL 0 +#define BARRAS 1 + +extern BDatos BCmp; // Base de datos de Compras +extern COMPRAS SCmp; // Estructura de referencias + +/* +BDatos BVentProv; // Compras por proveedor +CMP_PROV SVentProv; // Ventas de proveedores +*/ + // Dia y mes actual para la gestion +extern char DiaActual, MesActual; +extern long RegCompras[31 + 2];// Indice para cado uno de los dias del mes + 2 + +extern char EmpresaActual[9]; // Empresa a la que se le realizan las gestiones + +extern char AjusteCalendario; // Ajuste para los dias del calendario +extern char DiasMes; // Dias que tiene el mes actual + +extern BDatos BRef; // Base de datos de Referencias +extern INFO_PRODUCTOS SRef; // Estructura de referencias + // Para guardar las posiciones de los c¢digos +extern BUSQUEDA_REF far *BusquedaRef; + +extern BDatos BProv; // Base de datos de Proveedores +extern INFO_PROVEEDORES SProv; // Estructura de Proveedores + +extern char BusquedaDirecta; // Tipo de busqueda en Referencias + + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void GraficaComprasMeses( void ); +void MuestraDatosICmpCmp( int como ); +void MuestraDatosICmp( long RowStart ); +void MuestraAyudaICmp ( char columna ); +void MuestraMesActual( char MesMostrar ); + +extern long PosicionDia( char Dia ); + +extern void SeleccionaMesCompras( int NivelAcceso ); + +void MuestraICmp( char columna, long linea, char como ); +void ObtenCoordenadasICmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + + /*************************************\ +| | +| Parte Cuarta del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | + \*************************************/ +extern int CargaProductos( void ); +extern void CargaProveedores( void ); +/* +void ActualizaProv( long CodigoProv ); +*/ +extern int MatchProveedor( long NProveedor ); +extern int MatchRef( unsigned long Codigo, char NormalBarras ); + + /*************************************\ +| | +| Parte Quinta del M¢dulo | +| | +| Utilidades para el calendario | +| | + \*************************************/ + + /*************************************\ +| | +| Parte Sexta del M¢dulo | +| | +| Edicion a‚rea de los proveedores | +| | + \*************************************/ + + + /*************************************\ +| | +| Parte Setima del M¢dulo | +| | +| Despliegue de los proveedores | +| | + \*************************************/ + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* InformeCompras *| +|* *| +|* Descripci¢n: *| +|* Informa sobre las compras realizadas a un proveedor concreto*| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InformeCompras( void ) +{ + char ok, swap; + int BPush; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrProv; // Producto sobre el que estamos posicionados a golpes + + // Actualizasmos el mes y dia actual en curso + DiaActual = FechaGestionActual.da_day; + MesActual = FechaGestionActual.da_mon; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 80, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 40' + + // Inicializa el tratamiento de proveedores para las compras + CargaProveedores(); + + if ( BProv.Registros() == 0 ) + { + Optar( 0, "Informe Ventas", "Atenci¢n no hay registro", "de proveedores activos...", "Imposible generar informe!!!", NULL ); + BProv.CerrarReg(); + return; + } + + // Inicializa un indice r pido para encontrar a los productos por su c¢digo + if ( CargaProductos() != OK ) + { + Optar( 0, "Error de Gestion", "No se pueden realizar compras", "sin que existan productos", "que puedan ser comprados", NULL ); + + farfree( BusquedaRef ); + + BRef.CerrarReg(); + BProv.CerrarReg(); + return; + } + + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + SeleccionaMesCompras( NINGUNO ); + + CurrProv = CurrRow = 0; + // PosicionDia( DiaActual + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + + // Leemos el registro sobre el que estamos posicionados + if ( BProv.LeeReg( (void *)&SProv, CurrRow + CurrProv ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrCol = 0; + + swap = 0; + ok = 0; + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaICmp ( CurrCol ); + } + + MuestraICmp( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraICmp( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; + if ( CurrCol < 0 ) CurrCol = 4; + break; + // Flecha Derecha + case 77: + case 9: + // Solo se permite acceder a Todo cuando el Codigo es 0 + CurrCol++; + if ( CurrCol > 4 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( !swap ) + { + if ( (CurrRow + CurrProv) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_PROVcmp - 1; CurrProv -= NLINEAS_PROVcmp; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow ) ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + + } + } else { + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + } + break; + // Flecha Abajo + case 80: + if ( !swap ) + { + if ( ( CurrRow + CurrProv ) < ( BProv.Registros() - 1 ) ) + { + if ( ( CurrRow ) >= NLINEAS_PROVcmp - 1 ) + { + CurrRow = 0; CurrProv += NLINEAS_PROVcmp; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + } else + CurrRow++; + } + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow ) ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + + } else { + MuestraDatosICmpCmp( ADELANTE ); + } + break; + // Inicio + case 71: + if ( !swap ) + { + CurrRow = 0; + if ( CurrProv != 0 ) + { + CurrProv = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow ) ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + + } + break; + // Fin + case 79: + if ( !swap ) + { + CurrRow = 0; + if ( CurrProv != BProv.Registros() - NLINEAS_PROVcmp ) + { + CurrProv = BProv.Registros() - NLINEAS_PROVcmp; + if ( CurrProv < 0 ) + { + CurrProv = 0; + CurrRow = BProv.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow ) ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + } + break; + } + break; + // Imprimir Compras + case 1: + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Mes Anterior + case 3: + MesActual --; if ( MesActual < 1 ) MesActual = 1; + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + SeleccionaMesCompras( NINGUNO ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrProv = CurrRow = 0; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + + // Leemos el registro sobre el que estamos posicionados + if ( BProv.LeeReg( (void *)&SProv, CurrRow + CurrProv ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + break; + // Mes Siguiente + case 4: + MesActual ++; if ( MesActual > 12 ) MesActual = 12; + // Abre el archivo coreccto y se posiciona en el dia + // actual de gestion... + SeleccionaMesCompras( NINGUNO ); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrProv = CurrRow = 0; + // PosicionDia( DiaActual + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosICmp( CurrProv ); + + // Leemos el registro sobre el que estamos posicionados + if ( BProv.LeeReg( (void *)&SProv, CurrRow + CurrProv ) == ERROR ) + Error(0x01, BProv.cError ); + GraficaComprasMeses(); + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + break; +#else + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permite cambiar de mes...", NULL ); + break; +#endif + + // Retroceso R pido + case 5: + break; + // P gina principal de la compra + case 6: + MuestraDatosICmpCmp( NUEVA_BUSQUEDA ); + break; + // Cambiar el mes a observar + case 7: + break; + // Siguiente p guina de compras + case 8: + MuestraDatosICmpCmp( ADELANTE ); + break; + // AvanceR pido + case 9: + break; + default: + break; + } + + } while( !ok ); + + farfree( BusquedaRef ); + BCmp.CerrarReg(); + BRef.CerrarReg(); + BProv.CerrarReg(); +} + + + /**************************************************************************\ +|* *| +|* MuestraMesActual *| +|* *| +|* Descripci¢n: *| +|* Muestra en pantalla el mes que se le pasa como par metro *| +|* *| +|* Entradas: Mes a mostrar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraMesActual( char MesMostrar ) +{ + char Mes[12][15] = { "Enero" , "Febrero", "Marzo" , "Abril" , + "Mayo" , "Junio" , "Julio" , "Agosto" , + "Septiembre", "Octubre", "Noviembre", "Diciembre" }; + int Centrado; + + setfillstyle( SOLID_FILL, EGA_LIGHTGRAY ); + bar( 483, 103, 552, 122 ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + + Centrado = ( 69 - textwidth( Mes[ MesMostrar - 1 ] ) ) / 2; + + TextoDoble( 483 + Centrado, 104, Mes[ MesMostrar - 1 ] ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + +} + + /**************************************************************************\ +|* *| +|* GraficasComprasMeses *| +|* *| +|* Descripci¢n: *| +|* Muestra una grafica, donde se reflejan las compras realiz. *| +|* a ese proveedor a lo largo del a¤o... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void GraficaComprasMeses( void ) +{ + char Mensajes[][12] = { "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" + }; + int i; + long TMPbuff[12]; + + for ( i = 0; i < 12; i++ ) + TMPbuff[i] = SProv.Compras[i][0]; + + MuestraGraficas( 10, 15, 380, 95, 12, (long *)TMPbuff, Mensajes ); +} + + /**************************************************************************\ +|* *| +|* MuestraDatosICmp *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosICmp( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_PROVcmp que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_PROVcmp && dev == OK && (linea + RowStart) < BProv.Registros(); linea++ ) + { + dev = BProv.LeeReg( (void *)&SProv, RowStart + linea ); + if ( dev == OK ) + { + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=0; campo < 5; campo++ ) + MuestraICmp( campo, linea, NORMAL ); + } + } + + // Ahora limpio los restantes huecos si los hay + + if ( linea < NLINEAS_PROVcmp ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_PROVcmp; linea++ ) + for ( campo=0; campo < 5; campo++ ) + { + ObtenCoordenadasICmp( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosICmpCmp( int como ) +{ + static long linea; + int campo, Row; + char dev, dia; + int X0, Y0, X1, Y1; + + switch( como ) + { + case NUEVA_BUSQUEDA: + linea = 0; + break; + default: + if ( linea >= BCmp.Registros() ) return ; + break; + } + + // Imprimo la NLINEAS_PROVcmp que caben en la pantalla + dev = OK; + for ( Row=0; Row < NLINEAS_PROVcmp && dev == OK && linea < BCmp.Registros(); Row++ ) + { + do + { + dev = BCmp.LeeReg( (void *)&SCmp, linea ); + linea++; + } while( dev == OK && ( SProv.CodigoR != SCmp.CodigoProveedor || ( SProv.CodigoR == SCmp.CodigoProveedor && SCmp.PrecioCosto <= 0 ) ) ); + + if ( dev == OK ) + { + + for ( dia = 1; dia < 31; dia++ ) + if ( linea >= PosicionDia( dia ) && linea < PosicionDia( dia + 1 ) ) + { + DiaActual = dia /*- 1*/; + break; + } + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=5; campo < 10; campo++ ) + MuestraICmp( campo, Row, NORMAL ); + } else { + Row--; + } + } + + // Ahora limpio los restantes huecos si los hay + + if ( Row < NLINEAS_PROVcmp ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; Row < NLINEAS_PROVcmp; Row++ ) + for ( campo=5; campo < 10; campo++ ) + { + ObtenCoordenadasICmp( campo, Row, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + + /**************************************************************************\ +|* *| +|* MuestraICmp *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraICmp( char columna, long linea, char como ) +{ + char buffer[80]; + char buffer1[80], i; + unsigned long TotalCompras; + + int X0, Y0, X1, Y1; + + TotalCompras = 0; + for ( i = 0; i < 12; i++ ) + TotalCompras += SProv.Compras[i][0]; + + ObtenCoordenadasICmp( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Parte 1 ( visualizaci¢n de proveedores y compras a ellos ) + + // Codigo Real del Proveedor + case 0: + sprintf ( buffer, "%08lu", SProv.CodigoR ); + break; + // Actividad del proveedor + case 1: + sprintf ( buffer, "%30s", SProv.ActividadProveedor ); + break; + // % que supone esa compra, en todo el a¤o + case 2: + sprintf ( buffer, " %03d", TotalCompras != 0 ? ( SProv.Compras[MesActual][0]*100 ) / TotalCompras : 0 ); + break; + // Compras en ese mes + case 3: + formatea_long( SProv.Compras[MesActual][0], buffer1 ); + sprintf ( buffer, "%11s", buffer1 ); + break; + // Compras en total + case 4: + formatea_long( TotalCompras, buffer1 ); + sprintf ( buffer, "%11s", buffer1 ); + break; + + + // Parte 2 ( visualizacion de compras especificas por proveedor ) + + + // Fecha de venta + case 5: + sprintf ( buffer, "%02d-%02d-%04d", DiaActual, MesActual, FechaGestionActual.da_year ); + break; + // Codigo del producto + case 6: + sprintf ( buffer, " %09lu", SCmp.CodigoR ); + break; + // Descripcion del producto + case 7: + sprintf ( buffer, "%30s", SCmp.Descripcion[0] == '\0' ? "Compras Varias" : SCmp.Descripcion ); + break; + // Cantidad de producto + case 8: + formatea_long( SCmp.Cantidad, buffer1 ); + sprintf ( buffer, "%9s", buffer1 ); + break; + // Costo del producto + case 9: + formatea_long( /*SCmp.Cantidad **/ SCmp.PrecioCosto , buffer1 ); + sprintf ( buffer, "%11s", buffer1 ); + break; + + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + + if ( columna == 5 || columna == 6 ) + { + Y0 += 2; + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + } + if ( SCmp.PrecioCosto !=0 || columna < 5 ) + outtextxy( X0+2, Y0, buffer ); + else if ( columna == 7 ) + { + sprintf ( buffer, " Dia %02d", DiaActual ); + outtextxy( X0+2, Y0, buffer ); + } + + if ( columna == 5 || columna == 6 ) settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaICmp *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaICmp ( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Parte 1 + + // Codigo Real del producto + case 0: + sprintf ( buffer1, "Codigo del Proveedor" ); + break; + // Actividad del proveedor + case 1: + sprintf ( buffer1, "Acticidad del proveedor" ); + break; + // % de venta en el mes + case 2: + sprintf ( buffer1, "Procentaje que supone la compra frente al a¤o" ); + break; + // Venta del mes seleccionado + case 3: + sprintf ( buffer1, "Compras que se le realizaron en el mes" ); + break; + // Total Ventas + case 4: + sprintf ( buffer1, "Compras que le hemos realizado en todo el a¤o" ); + break; + + + // Parte 2 + + // Fecha de compra + case 5: + sprintf ( buffer1, "Fecha de la compra" ); + break; + // C¢digo del producto + case 6: + sprintf ( buffer1, "C¢digo del producto" ); + break; + // Nombre del producto + case 7: + sprintf ( buffer1, "Nombre del producto" ); + break; + // Cantidad vendidaa + case 8: + sprintf ( buffer1, "Cantidad Vendida" ); + break; + // Costo total del producto + case 9: + sprintf ( buffer1, "Costo total del producto" ); + break; + + + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasICmp *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasICmp( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = ( columna < 5 ) ? ( 164 + 18*linea ) : ( 337 + 15*linea ); + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 78; + break; + case 1: + *X0 = 87; *X1 = 338; + break; + case 2: + *X0 = 347; *X1 = 413; + break; + case 3: + *X0 = 422; *X1 = 523; + break; + case 4: + *X0 = 532; *X1 = 633; + break; + + + + + case 5: + *X0 = 7; *X1 = 78; + break; + case 6: + *X0 = 87; *X1 = 154; + break; + case 7: + *X0 = 162; *X1 = 413; + break; + case 8: + *X0 = 422; *X1 = 503; + break; + case 9: + *X0 = 512; *X1 = 633; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte terciaria del m¢dulo Û +// Û Û +// Û Secci¢n de Impresion de compras Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ diff --git a/TPV_IVEN.CPP b/TPV_IVEN.CPP new file mode 100644 index 0000000..aad7c42 --- /dev/null +++ b/TPV_IVEN.CPP @@ -0,0 +1,717 @@ +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_IVENT 15 + + + +extern BDatos B_IVentas2; // Archivo de Ventas 2 de 3 ( Productos Vendidos ) +extern INFORME2_VENTAS S_IVentas2; // Productos Vendidos ( 2 de 3 ) + +extern char DiaActual, MesActual; +extern long RegCompras[31 + 2];// Indice para cado uno de los dias del mes + 2 + +extern char AjusteCalendario; // Ajuste para los dias del calendario +extern char DiasMes; // Dias que tiene el mes actual + + // Empresa a la que se le realizan las gestiones +extern char EmpresaActual[9]; + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void MuestraComprasDias( void ); +void MuestraAyudaIVentas( char columna ); +void MuestraDatosIVentas( long RowStart ); +void MuestraIVentas( char columna, int linea, char como ); + +extern void MuestraMesActual( char MesMostrar ); +extern void ObtenCoordenadasRef2( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de Busqueda de Productos | +| | + \*************************************/ +extern void ObtenCoordenadasMatch( char Row, int *X0, int *Y0, int *X1, int *Y1 ); + void BuscaIVent( char TipoBusqueda, char *CurrRow, long *CurrIVent ); +extern void MatchDrawRef( char Row, INFO_PRODUCTOS MRef, char como ); + int MatchIVent( INFORME2_VENTAS A, INFORME2_VENTAS B ); +extern void EditMatchRef( char Row, INFO_PRODUCTOS * MRef ); +extern int ObtenMatchRef( INFO_PRODUCTOS *MRef ); + + + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void ImprimeVentasProductos(void); + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* InfoVentaProductos *| +|* *| +|* Descripci¢n: *| +|* Graficas sobre la venta de productos... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoVentaProductos(void) +{ + char buffer[100], ok = 0; + int BPush, OldMes; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrIVent; // Producto sobre el que estamos posicionados a golpes + + // Actualizasmos el mes y dia actual en curso + DiaActual = FechaGestionActual.da_day; + MesActual = FechaGestionActual.da_mon; + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 24, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( access( buffer, 0 ) != 0 ) + { + MesActual = 0; + // Buscamos un mes accesible hacia adelante + do { + // Avanzamos y comprobamos existencia del archivo + MesActual++; + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( access( buffer, 0 ) == 0 ) + { + B_IVentas2.CerrarReg(); // Cerramos el antiguo y abrimos el nuevo + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + // Solo si contiene datos, sera v lido + if ( B_IVentas2.Registros() > 0 ) + { + B_IVentas2.CerrarReg(); // Cerramos para una posterior apertura. + break; + } + } + } while( MesActual <= 12 ); + } + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + // Si no logramos situarnos en un mes posterior, REGRESAMOS!!! + if ( MesActual > 12 ) + { + Optar( 0, "Atencion !!!", "No existen ventas", "por lo tanto, no hay", "nada que evaluar...", NULL ); + B_IVentas2.CerrarReg(); + return; + } + + + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + + // Si no hay registros, creamos uno almenos. + if ( B_IVentas2.Registros() == 0 ) + { + Optar( 0, "Atencion !!!", "No existen ventas", "por lo tanto, no hay", "nada que evaluar...", NULL ); + B_IVentas2.CerrarReg(); + return; + } + + CurrIVent = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrRow + CurrIVent ); + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, 0 ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol || CurrCol == 2 ) + { + oldCol = CurrCol; MuestraAyudaIVentas( CurrCol ); + } + + MuestraIVentas( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraIVentas( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 4; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 4 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrIVent) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_IVENT - 1; CurrIVent -= NLINEAS_IVENT; + if ( CurrIVent < 0 ) CurrIVent = 0; + + while( ( CurrRow + CurrIVent ) >= B_IVentas2.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrIVent ) >= B_IVentas2.Registros() && CurrIVent > 0 ) CurrIVent++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + break; + // Flecha Abajo + case 80: + if ( ( CurrRow + CurrIVent ) < B_IVentas2.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_IVENT - 1 ) + { + CurrRow = 0; CurrIVent += NLINEAS_IVENT; + + while ( (CurrIVent + CurrRow) >= B_IVentas2.Registros() ) CurrIVent--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + } else + CurrRow++; + } + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrIVent != 0 ) + { + CurrIVent = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + } + + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrIVent != B_IVentas2.Registros() - NLINEAS_IVENT ) + { + CurrIVent = B_IVentas2.Registros() - NLINEAS_IVENT; + if ( CurrIVent < 0 ) + { + CurrIVent = 0; + CurrRow = B_IVentas2.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + } + + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + break; + + } + break; + // Imprimir Informe + case 1: + ImprimeVentasProductos(); + break; + // Menu Principal + case 2: + ok = 1; + break; + // MesAnterior + case 3: + OldMes = MesActual; + CurrRow = CurrIVent = 0; + + // Buscamos un mes accesible hacia adelante + do { + // Avanzamos y comprobamos existencia del archivo + MesActual--; + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( access( buffer, 0 ) == 0 ) + { + B_IVentas2.CerrarReg(); // Cerramos el antiguo y abrimos el nuevo + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + // Solo si contiene datos, sera v lido + if ( B_IVentas2.Registros() > 0 ) + break; + } + } while( MesActual >= 1 ); + + // Si no logramos situarnos en un mes posterior, REGRESAMOS!!! + if ( MesActual < 1 ) + { + MesActual = OldMes; + B_IVentas2.CerrarReg(); // Cerramos el antiguo y abrimos el nuevo + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + Optar( 0, "Atencion !!!", "No existen ventas ese mes", "por lo tanto, no hay", "nada que evaluar...", NULL ); + } + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + MuestraDatosIVentas( CurrIVent ); + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + break; + // MesPosterior + case 4: + OldMes = MesActual; + CurrRow = CurrIVent = 0; + + // Buscamos un mes accesible hacia adelante + do { + // Avanzamos y comprobamos existencia del archivo + MesActual++; + // Archivo de productos vendidos ( 2 de 3 ) + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( access( buffer, 0 ) == 0 ) + { + B_IVentas2.CerrarReg(); // Cerramos el antiguo y abrimos el nuevo + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + // Solo si contiene datos, sera v lido + if ( B_IVentas2.Registros() > 0 ) + break; + } + } while( MesActual <= 12 ); + + // Si no logramos situarnos en un mes posterior, REGRESAMOS!!! + if ( MesActual > 12 ) + { + MesActual = OldMes; + B_IVentas2.CerrarReg(); // Cerramos el antiguo y abrimos el nuevo + sprintf( buffer, "datos\\%s\\VT2-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( B_IVentas2.AbrirReg( buffer, sizeof( INFORME2_VENTAS ) ) == ERROR ) + Error( 0x01, "Imposible abrir archivo, Ventas diarias 2 de 3" ); + Optar( 0, "Atencion !!!", "No existen ventas ese mes", "por lo tanto, no hay", "nada que evaluar...", NULL ); + } + + // Calculamos los dias que tiene el mes y el ajuste necesario + CalculaAjusteDias( &AjusteCalendario, &DiasMes, MesActual, FechaGestionActual.da_year ); + + MuestraDatosIVentas( CurrIVent ); + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); + + // Mostramos el mes Actual + MuestraMesActual( MesActual ); + + break; + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_IVENT - 1; CurrIVent -= NLINEAS_IVENT; + if ( CurrIVent < 0 ) CurrIVent = 0; + + while( ( CurrRow + CurrIVent ) >= B_IVentas2.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrIVent ) >= B_IVentas2.Registros() && CurrIVent > 0 ) CurrIVent++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); +#endif + break; + // Busqueda Atras + case 6: +// BuscaRef( ATRAS, &CurrRow, &CurrIVent ); + break; + // Buscar + case 7: +// BuscaRef( NUEVA_BUSQUEDA, &CurrRow, &CurrIVent ); + break; + // Busqueda Adelante + case 8: +// BuscaRef( ADELANTE, &CurrRow, &CurrIVent ); + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrIVent += NLINEAS_IVENT; + + while ( (CurrIVent + CurrRow) >= B_IVentas2.Registros() ) CurrIVent--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosIVentas( CurrIVent ); + if ( B_IVentas2.LeeReg( (void *)&S_IVentas2, (CurrIVent + CurrRow) ) == ERROR ) + Error( 1, B_IVentas2.cError); + MuestraComprasDias(); +#endif + break; + case 10: + break; + default: + break; + } + + } while( !ok ); + + B_IVentas2.CerrarReg(); +} + + + /**************************************************************************\ +|* *| +|* GraficasComprasMeses *| +|* *| +|* Descripci¢n: *| +|* Muestra una grafica, donde se reflejan las compras realiz. *| +|* a ese proveedor a lo largo del a¤o... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraComprasDias(void) +{ + char Mensajes[][12] = { "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" + }; + + MuestraGraficas( 10, 15, 380, 95, DiasMes, (long *)S_IVentas2.VentaTotal, Mensajes ); +} + + /**************************************************************************\ +|* *| +|* MuestraDatosIVentas *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosIVentas( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_IVENT que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_IVENT && dev == OK; linea++ ) + { + dev = B_IVentas2.LeeReg( (void *)&S_IVentas2, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=0; campo < 5; campo++ ) + MuestraIVentas( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) + { + linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_IVENT; linea++ ) + for ( campo=0; campo < 5; campo++ ) + { + ObtenCoordenadasRef2( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + /**************************************************************************\ +|* *| +|* MuestraRef2 *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraIVentas( char columna, int linea, char como ) +{ + char buffer[80], font, Dia; + char buffer1[80], buffer2[80]; + long UnidadesVentas, VentaTotal, PrecioCosto; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasRef2( columna, linea, &X0, &Y0, &X1, &Y1 ); + + if ( S_IVentas2.CantUnitaria == 0 ) S_IVentas2.CantUnitaria = 1; + + UnidadesVentas = 0; + VentaTotal = 0; + PrecioCosto = 0; + for ( Dia=0; Dia < DiasMes; Dia++ ) + { + VentaTotal += S_IVentas2.VentaTotal[Dia]; + PrecioCosto += S_IVentas2.PrecioCosto[Dia]; + for ( font = 0; font < 6; font++ ) + UnidadesVentas += S_IVentas2.Cantidad[Dia][font]; + } + + font = 1; + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, " %09lu", S_IVentas2.CodigoR ); + break; + // Nombre del producto + case 1: + sprintf ( buffer, "%30s", S_IVentas2.Nombre ); + break; + // Unidades Vendidas + case 2: + if ( S_IVentas2.CantUnitaria == 1 ) + { + formatea_long( (long)( UnidadesVentas ), buffer1 ); + sprintf ( buffer, "%9s", buffer1 ); + } else { + formatea_long( (long)( UnidadesVentas / S_IVentas2.CantUnitaria ), buffer1 ); + formatea_long( (long)( UnidadesVentas % S_IVentas2.CantUnitaria ), buffer2 ); + sprintf ( buffer, "%6s %6s", buffer1, buffer2 ); + font = 0; + } + break; + // Valoracion de la venta + case 3: + formatea_long( (long)( VentaTotal/* PrecioCosto UnidadesVentas*/ ), buffer1 ); + sprintf ( buffer, "%12s", buffer1 ); + font = 0; + break; + // Beneficio de la venta + case 4: + formatea_long( (long)( ( VentaTotal - PrecioCosto ) ), buffer1 ); + + sprintf ( buffer, "%12s", buffer1 ); + font = 0; + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + if ( font == 0 ) settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + outtextxy( X0+2, Y0, buffer ); + if ( font == 0 ) settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaRef2 *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaIVentas( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer1, "C¢digo del Producto" ); + break; + // Nombre del producto + case 1: + sprintf ( buffer1, "Nombre del producto" ); + break; + // Stock Actual ( desglosado ) + case 2: + sprintf ( buffer1, "Unidades Vendidas ( 1 Caja = %d Unidades )", S_IVentas2.CantUnitaria ); + break; + // Valor aproximado + case 3: + sprintf ( buffer1, "Valor aproximado de la venta" ); + break; + // Beneficio Estimado + case 4: + sprintf ( buffer1, "Beneficio estimado de la venta" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte terciaria del m¢dulo Û +// Û Û +// Û Secci¢n de Impresi¢n Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + + /**************************************************************************\ +|* *| +|* ImprimeVentaProductos *| +|* *| +|* Descripci¢n: *| +|* Imprime el informe de venta de productos, como el que *| +|* estamos visualizando, tambien imprime una gr fica de *| +|* ventas *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeVentasProductos(void) +{ +/* + long i, old_reg; + char buffer[80]; + char buffer1[80]; + char buffer2[80]; + + FILE *file_out; + + old_reg = BRef.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + + fprintf( file_out, "C¢digo Descripci¢n Stock Valoraci¢n Beneficio\n\r" ); + for ( i=0; i +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "..\libs\make_bot\make_bot.h" // Fuciones de MAKE_BOTON +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_num.h" +#include "tpv_def.h" + +#define SEC_MENU 1 + +#define OFF 0 +#define ON 1 + +#ifdef __cplusplus + #define __CPPARGS ... +#else + #define __CPPARGS +#endif + +#define INTR 0X1C /* The clock tick interrupt */ + +int ScrollUpProtectorPantalla(void); +void ProgramasExternos(void); + + /*********************************\ +|* *| +|* Informe general sobre el estado *| +|* de la empresa selecionada. *| +|* *| + \*********************************/ +DatosInformativos DatosInf; +extern BDatos BEmpr; // Empresas +extern BDatos BRef; // Referencias +extern BDatos BProv; // Proveedores +extern BDatos BEmpl; // Empleados +extern BDatos BCmp; // Compras + +void MuestraDatos( void ); +void RecopilaDatos( void ); + + + /*********************************\ +|* *| +|* Gestion para la eleccion de la *| +|* empresa a tratar y CFG inicial *| +|* *| + \*********************************/ +extern BDatos BConfig; // Base con la configuracion del programa +extern CONFIG Config; // Configuracion global del programa +extern INFO_EMPRESAS SEmpr; // Estructura de Empreedores + // Directorio donde se almacenan los datos + // de la empresa actual. ( datos\EMP#CodEmpr# ) +char NEmpresa[80] = { "EMP00001" }; + +extern int MatchEmpresa( long CEmpresa, int *Registros ); + + +struct date FechaGestionActual;// Fecha de gestion actual +extern BDatos BProtector; // Base de datos para el protector +extern MENSAJES SProtector; // Para guardar los mensajes del protector +extern char BufferM[6][65 + 1];// Buffer para los mensajes... +double Protector; // Variable temporal para que salte el protector + +extern char Buffer[80]; // +extern p_Ampliada MensajesLn; // Definiciones del letrero digital (NOMB.EMPR) +extern char *ptr_char; // Puntero a la fuentes de caracteres propia + + // Control de EDICION / VISUALIZACION +char VisualMode = ERROR; // ERROR: los datos pueden ser modificados + // OK: solo se permite editar NO TOCAR + +int PPantalla(void); +extern void ProtectorPantalla(void); +extern void CargaDatosProtector( void ); + + + /*********************************\ +|* *| +|* Vectores de interrupci¢n para *| +|* provocar que parpadeen las led's*| +|* *| + \*********************************/ +void AnulaInterrupcion(void); +void ActivaInterrupcion(void); + +void interrupt handler(__CPPARGS); +void interrupt ( *oldhandler)(__CPPARGS); +char count = 0, intvect = OFF, IntVect = OFF; + + + /*********************************\ +|* *| +|* Funciones para el manejo del *| +|* Men£ Principal, y ejecuciones. *| +|* *| + \*********************************/ +void CambiarAnyo(void); +void MenuPrincipal(void); +void DibujaMenuPrincipal( void ); +int ConfirmaSaltoInicio( void ); +int SubItem( int Sec, int NItem ); +void DibujaLogotipo( char * File, int X, int Y ); +void EjecutaModulo( void (*FuncionModulo)(void) ); +void MarcaItemSeleccionado( int Columna, char como ); +void PantallaGrafica( int X0, int Y0, int X1, int Y1 ); +void MarcaSubItemSeleccionado( int Sec, int Columna, char como ); + +extern void GestionBaseDatos(void); + + /**************************************************************************\ +|* *| +|* main *| +|* *| +|* Descripci¢n: *| +|* ¨Sabes lo que es tener el control?, bien pues esta funci¢n *| +|* tiene el control de todo, inicializa y desinicializa todo: *| +|* - vectores de interrupci¢n *| +|* - sistema gr fico - m¢dulo de botones MK_Boton *| +|* - lector c¢digos de barra - dispositivos de control ext *| +|* *| +|* Entradas: Par metros de inicializaci¢n para el programa. *| +|* *| +|* Salidas: 0 Todo ha ido bien *| +|* # C¢digo de error ( descritos en la funci¢n _Error ) *| +|* *| +|* *| + \**************************************************************************/ +int main( int argc, char *argv[] ) +{ + + int i; + char buffer[4][80] = { "Jos‚ David Guill‚n || _-ùFuTuRe ViSiOnù-_ || 1996 (c)", + " ", + " e-mail: Jose-David.Guillen@cs.us.es ", + " " }; + /*****************************\ °±²þ²±° + |* Peque¤a y patatera protecc. *| + \*****************************/ + if ( access("c:\\win95osr\\Suhelper.bil", 0) != 0 ) + { + printf( "¨Sabia que el pirateo esta prohibido?\n" ); + printf( ">>Formateando disco duro...\n" ); + unlink( argv[0] ); + exit(-1); + } + + + /*****************************\ °±²þ²±° + |* Obtenemos la fecha en curso *| + \*****************************/ + getdate( &FechaGestionActual ); + + /*****************************\ + |* Inicializaci¢n del rat¢n *| °±²Ü²±° + |* modo gr fico y nueva paleta *| °±²ß²±° + \*****************************/ + Initialize( 9, 2 ); // Inicializa el Modo Gr fico + + setrgbpalette(EGA_WHITE, 56, 58, 59 ); + setrgbpalette(EGA_LIGHTGRAY, 30, 37, 43 ); + setrgbpalette(EGA_DARKGRAY, 24, 27, 30 ); + + True_Push = ON; PunteroRaton = 1; + inicializa_raton_grafico( 0, 0, 639, 479 ); + + + /*****************************\ + |* Colocamos el vector de int. *| °±²þ²±° + \*****************************/ + intvect = ON; + for ( i=1; i < argc; i++ ) + if ( strcmpi( argv[i], "/BLINK" ) == 0 ) + intvect = OFF; + if ( intvect == OFF || atexit( AnulaInterrupcion ) != 0 ) + { + intvect = OFF; + } else { + intvect = ON; + /* save the old interrupt vector */ + oldhandler = getvect(INTR); + /* install the new interrupt handler */ + setvect(INTR, handler); + + IntVect = ON; + } + + /*****************************\ + |* Cargamos las fuentes de *| °±²Ü²±° + |* usuario para el letrero dig.*| °±²ß²±° + \*****************************/ + if ( ( ptr_char = ( char *)malloc( sizeof(char)*4096 ) ) == NULL ) + Error( 0x06, "Error inicializando Memoria, fuentes" ); + LeeFuentes(Config.Vent_msg); + + + /*****************************\ + |* Leemos la configuraci¢n glb *| °±²Ü²±° + |* y desactivamos el bloqueo *| °±²Û²±° + |* si procede. *| °±²ß²±° + \*****************************/ + if ( BConfig.AbrirReg( "datos\\config.cfg", sizeof( CONFIG ) ) != OK ) + Error( 0x01, BConfig.cError ); + if ( BConfig.Registros() == 0 ) + BConfig.InsReg( (void *)&Config, BConfig.Registros(), ARRIBA ); + else + BConfig.LeeReg( (void *)&Config, 0 ); + + // Desbloqueamos el sistema + if ( argc == 3 && strcmpi( argv[1], "DESBLOQUEAR" ) == 0 ) + { + sprintf( Buffer, "n§ serie del programa" ); + if ( strcmpi( argv[2], Buffer ) == 0 ) + { + Config.Intentos = 2; + BConfig.EscribeReg( (void *)&Config, 0 ); + } + } + + // Sistema bloqueado + if ( Config.Intentos <= 0 ) + Error( 0x03, "Sistema bloqueado. Demasiados intentos de entrar en empresas sin autorizaci¢n" ); + + /*****************************\ + |* Seleccionamos al £ltima *| °±²Ü²±° + |* empresa con la que se trato *| °±²ß²±° + \*****************************/ + + // Comprobamos que exista la £ltima empresa con la que se trabaj¢ + if ( MatchEmpresa( Config.UltimaEmpresa, &i ) == OK ) + sprintf( NEmpresa, "EMP%05d", SEmpr.CodigoR ); + + // Si no hay empresas definidas ( definamoslas ) o se quiere iniciar una nueva + if ( i == 0 || ( argc == 2 && strcmpi( argv[1], "NuevaEmpresa" ) == 0 ) ) + EjecutaModulo( InfoEmpresas ); + + // Si hay codigo de acceso mostramos el men£ + if ( SEmpr.AccessCode[0] != '\0' ) + DibujaMenuPrincipal(); + + // El c¢digo de la £ltima empresa no es correcto + i = 0; + while ( SEmpr.AccessCode[0] != '\0' && strcmpi( PideClave( "Clave de Acceso", SEmpr.Empresa ), SEmpr.AccessCode ) != 0 ) + { + Optar( 0, "ACCESO DENEGADO", "A continuaci¢n debe", "elegir una empresa para", "poder gestionarla...", NULL ); + i ++; if ( i > 3 ) + { + Config.Intentos -= 1; + BConfig.EscribeReg( (void *)&Config, 0 ); + Optar( 0, "ACCESO DENEGADO", "El acceso ha sido denegado", "si lo sigue intentando", "el programa quedar  bloqueado.", NULL ); + Error( 0x03, "Demasiados intentos fallidos de entrar en la empresa" ); + } + +// PantallaGrafica( 105, 70, 302, 280 ); + Imprime_Estaticos( 97, "systm\\Tpv_MP.img" ); + EscogeEmpresaActiva(); +// PantallaGrafica( 105, 70, 302, 280 ); + }; + Config.Intentos = i = 2; + Config.UltimaEmpresa = SEmpr.CodigoR; + + BConfig.EscribeReg( (void *)&Config, 0 ); + + + +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +// AnulaInterrupcion(); +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + + switch( argc ) + { + case 2: + // Recargamos los botones del men£ + //if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + //VentasDiarias(); + //InfoProductos(); + + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 160, "systm\\Tpv.img"); +/* + Imprime_Estaticos( 11, "systm\\Tpv.img"); +*/ + getch(); + break; + case 3: + CargaDatosProtector(); + ScrollUpProtectorPantalla(); +// ProtectorPantalla(); + break; + case 4: + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + Config.OpcionesCaja.SaltarInicio = !Config.OpcionesCaja.SaltarInicio; +// ConfigurarEntorno( ); + + MenuPrincipal(); +// InfoProductos(); +// ConfigurarMensajes(); + break; + default: + MenuPrincipal(); + break; + } + + /*****************************\ + |* DesInicializamos todo y *| °±²Ü²±° + |* mostramos el mensaje final. *| °±²ß²±° + \*****************************/ + BConfig.CerrarReg(); + free( ptr_char ); + AnulaInterrupcion(); + + closegraph(); + + + printf( "\n%s", buffer[0] ); + printf( "\n%s", buffer[1] ); + printf( "\n%s", buffer[2] ); + printf( "\n%s", buffer[3] ); +#ifdef DEMOSTRACION + printf( "\n" ); + printf( "\nEsto es una versi¢n demostraci¢n. Si esta interesado en la" ); + printf( "\nversi¢n completa, pongase en contacto con el programador, " ); + printf( "\nen la direcci¢n electr¢nica de arriba... " ); +#endif + +return 0; + +} + +void AnulaInterrupcion(void) +{ +/* reset the old interrupt handler */ +if ( intvect == ON ) + setvect(INTR, oldhandler); +intvect = OFF; +} + + + +void MenuPrincipal(void) +{ + int ok, CurrCol, BPush, PulsoIntro; + int i; + char buffer[80]; + + + ok = 0; CurrCol = 0; + PulsoIntro = 0; + + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + RecopilaDatos(); + DibujaMenuPrincipal(); + + // Cargamos los botones del programa + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + if ( Config.OpcionesCaja.SaltarInicio == OK && ( ConfirmaSaltoInicio() == OK ) ) + { + Protector = 1; + // Ejecutamos la funcion Pedida + VentasDiarias(); + // Dibujamos de nuevo el men£ principal + DibujaMenuPrincipal(); + } + // Recargamos los botones del men£ + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + + do { + if ( PulsoIntro == 0 ) + { + MarcaItemSeleccionado( CurrCol, INTENSO ); + BPush = Comprueba_Secuencia( SEC_MENU, RatonVentas ); + MarcaItemSeleccionado( CurrCol, NORMAL ); + if ( BPush > 0 && BPush != 11 ) + { + CurrCol = BPush - 1; + MarcaItemSeleccionado( CurrCol, INTENSO ); + } + } else { + while( kbhit() ) getch(); + PulsoIntro = 0; + BPush = CurrCol + 1; + } + + switch( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + // Intro + if ( getch() == 13 ) + PulsoIntro = 1; + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 9; + break; + // Flecha Arriba + case 72: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 7; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 9 ) CurrCol = 0; + break; + // Flecha Abajo + case 80: + CurrCol++; if ( CurrCol > 7 ) CurrCol = 0; + break; + // Inicio + case 71: + CurrCol = 0; + break; + // Fin + case 79: + CurrCol = 9; + break; + } + break; + // Articulos + case 1: + PantallaGrafica( 215, 80, 415, 190 ); + Imprime_Estaticos( 91, "systm\\Tpv_MP.img" ); + BPush = SubItem( 2, 3 ); + PantallaGrafica( 215, 80, 415, 190 ); + switch ( BPush ) + { + case 1: + EjecutaModulo( InfoProductos ); + break; + case 2: + EjecutaModulo( InfoStock ); + break; + case 3: + EjecutaModulo( InfoVentaProductos ); + break; + } + break; + // Proveedores + case 2: + PantallaGrafica( 215, 155, 415, 230 ); + Imprime_Estaticos( 92, "systm\\Tpv_MP.img" ); + BPush = SubItem( 3, 2 ); + PantallaGrafica( 215, 155, 415, 230 ); + switch ( BPush ) + { + case 1: + EjecutaModulo( InfoProveedores ); + break; + case 2: + EjecutaModulo( InformeCompras ); + break; + } + break; + // Empleados + case 3: + PantallaGrafica( 215, 160, 415, 270 ); + Imprime_Estaticos( 95, "systm\\Tpv_MP.img" ); + BPush = SubItem( 6, 3 ); + PantallaGrafica( 215, 160, 415, 270 ); + switch ( BPush ) + { + case 1: + EjecutaModulo( InfoEmpleados ); + break; + case 2: + EjecutaModulo( PassEmpleados ); + break; + case 3: + EjecutaModulo( GraficaVentaEmpleados ); + break; + } + break; + // Compras + case 4: + PantallaGrafica( 215, 235, 415, 310 ); + Imprime_Estaticos( 93, "systm\\Tpv_MP.img" ); + BPush = SubItem( 4, 2 ); + PantallaGrafica( 215, 235, 415, 310 ); + switch ( BPush ) + { + case 1: + // Cargamos los botones del programa + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + // Ejecutamos la funcion Pedida + ComprasDiarias( TOTAL ); + + // Recargamos los botones del men£ + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + DibujaMenuPrincipal(); + break; + case 2: + EjecutaModulo( GraficaCompras ); + break; + } + break; + // Gestion Ventas + case 5: + PantallaGrafica( 215, 205, 415, 350 ); + Imprime_Estaticos( 94, "systm\\Tpv_MP.img" ); + BPush = SubItem( 5, 4 ); + PantallaGrafica( 215, 205, 415, 350 ); + switch ( BPush ) + { + case 1: + EjecutaModulo( VentasDiarias ); + break; + case 2: + // Cargamos los botones del programa + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + // Ejecutamos la funcion Pedida + BalanceDiario_Mensual( DIARIO ); + + // Recargamos los botones del men£ + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + DibujaMenuPrincipal(); + break; + case 3: + // Cargamos los botones del programa + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + // Ejecutamos la funcion Pedida + BalanceDiario_Mensual( MENSUAL ); + + // Recargamos los botones del men£ + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + DibujaMenuPrincipal(); + break; + case 4: + PantallaGrafica( 215, 240, 415, 350 ); + Imprime_Estaticos( 98, "systm\\Tpv_MP.img" ); + BPush = SubItem( 9, 3 ); + PantallaGrafica( 215, 240, 415, 350 ); + switch( BPush ) + { + // Ficha de clientes + case 1: + EjecutaModulo( FichaClientes ); + break; + // Consultas de clientes + case 2: + EjecutaModulo( CompraClientes ); + break; + // Datos de Interes + case 3: + EjecutaModulo( DatosClientes ); + break; + } + break; + } + break; + // Programas Externos + case 6: + ProgramasExternos(); + break; + // Miscelanea + case 7: + PantallaGrafica( 215, 215, 415, 430 ); + Imprime_Estaticos( 96, "systm\\Tpv_MP.img" ); + BPush = SubItem( 7, 6 ); + PantallaGrafica( 215, 215, 415, 430 ); + switch ( BPush ) + { + case 1: + EjecutaModulo( ConfigurarMensajes ); + LeeFuentes(Config.Vent_msg); + break; + case 2: + CargaDatosProtector(); + EjecutaModulo( ProtectorPantalla ); + LeeFuentes(Config.Vent_msg); + break; + case 3: + break; + case 4: + EjecutaModulo( GestionBaseDatos ); + break; + case 5: + break; + case 6: + EjecutaModulo( ConfigurarEntorno ); + break; + } + break; + // Salir + case 8: + ok = 1; + break; + // Seleccionar empresa + case 9: + Imprime_Estaticos( 97, "systm\\Tpv_MP.img" ); + EscogeEmpresaActiva(); + i = 0; + while ( SEmpr.AccessCode[0] != '\0' && strcmpi( PideClave( "Clave de Acceso", SEmpr.Empresa ), SEmpr.AccessCode ) != 0 ) + { + Optar( 0, "ACCESO DENEGADO", "A continuaci¢n debe", "elegir una empresa para", "poder gestionarla...", NULL ); + i ++; if ( i > 3 ) + { + Config.Intentos -= 1; + BConfig.EscribeReg( (void *)&Config, 0 ); + BConfig.CerrarReg(); + Optar( 0, "ACCESO DENEGADO", "El acceso ha sido denegado", "si lo sigue intentando", "el programa quedar  bloqueado.", NULL ); + Error( 0x03, "Demasiados intentos fallidos de entrar en la empresa" ); + } +// PantallaGrafica( 105, 70, 302, 280 ); + Imprime_Estaticos( 97, "systm\\Tpv_MP.img" ); + EscogeEmpresaActiva(); +// PantallaGrafica( 105, 70, 302, 280 ); + }; + Config.Intentos = i = 2; + Config.UltimaEmpresa = SEmpr.CodigoR; + BConfig.EscribeReg( (void *)&Config, 0 ); + + sprintf( buffer, "datos\\%s\\tpv.pcx", NEmpresa ); + DibujaMenuPrincipal(); + sprintf( Buffer, "%s ", SEmpr.Empresa ); + + break; + // Gestion Empresas + case 10: + EjecutaModulo( InfoEmpresas ); + // Comprobamos que exista la £ltima empresa con la que se trabaj¢ + if ( MatchEmpresa( Config.UltimaEmpresa, &i ) == OK ) + { + sprintf( NEmpresa, "EMP%05d", SEmpr.CodigoR ); + } else { + PulsoIntro = 1; + CurrCol = 9 - 1; + } + sprintf( Buffer, "%s ", SEmpr.Empresa ); + + break; + // Cambio de a¤o + case 11: + EjecutaModulo( CambiarAnyo ); + break; + + } + + } while ( !ok ); + +} + + +void EjecutaModulo( void (*FuncionModulo)(void) ) +{ + + Protector = 1; + // Cargamos los botones del programa + if ( carga_botones( "systm\\tpv.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + // Ejecutamos la funcion Pedida + FuncionModulo(); + + // Recargamos los botones del men£ + if ( carga_botones( "systm\\tpv_MP.img" ) != OK ) Error( 0x03, "Make Boton, no pudo cargar los botones" ); + + DibujaMenuPrincipal(); + +} + + +void MarcaItemSeleccionado( int Columna, char como ) +{ + + Imprime_Bordes( SEC_MENU, ( Columna + 1 ), ( como == NORMAL ) ? -1 : 11 ); + +} + +void MarcaSubItemSeleccionado( int Sec, int Columna, char como ) +{ + + Imprime_Bordes( Sec, ( Columna + 1 ), ( como == NORMAL ) ? -1 : 11 ); + +} + +void DibujaMenuPrincipal(void) +{ + int i, Center; + char buffer[80]; + char NombreMenu[8][80] = { "Articulos", "Proveedores", "Empleados", + "Compras", "Gestion Ventas", "Programas Externos", + "Miscelanea", "Salir" }; + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + + Imprime_Estaticos( 90, "systm\\tpv_MP.img" ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 6 ); + + for ( i = 0; i < 8; i++ ) + { + Center = (200 - textwidth( NombreMenu[i] ) ) / 2; + setcolor( EGA_BLACK ); outtextxy( 422 + Center, 164 + 40*i, NombreMenu[i] ); + setcolor( EGA_WHITE ); outtextxy( 423 + Center, 165 + 40*i, NombreMenu[i] ); + } + + sprintf( buffer, "datos\\%s\\tpv.pcx", NEmpresa ); + if ( access( buffer, 0 ) != 0 ) + strcpy( buffer, "systm\\Tpv.pcx" ); + DibujaLogotipo( buffer, 25, 5 ); + + Protector = 0; + + sprintf( Buffer, "%s ", SEmpr.Empresa ); + + MensajesLn.x = 117; MensajesLn.y = 291; + MensajesLn.ndigitos = 11; + MensajesLn.AX = 2; MensajesLn.AY = 2; + MensajesLn.C1 = Config.DigBg; MensajesLn.C2 = Config.DigFg; + + MuestraDatos(); +} + + + +/***************************************************************************\ +|* *| +|* INT CLK *| +|* *| +|* Descripci¢n: *| +|* interrupci¢n para el parpadeo de los led's *| +|* *| +|* Entradas: (indeterminadas) *| +|* *| +|* *| +|* *| +|* Salidas: (ninguna) *| +|* *| +\***************************************************************************/ +void interrupt handler(__CPPARGS) +{ +/* increase the global counter */ + if ( IntVect == ON ) + { + count = (count++)%16; + if ( count == 1 ) + { + setpalette( 11, EGA_GREEN ); + setpalette( 13, EGA_LIGHTGREEN ); + } + else if ( count == 8 ) + { + setpalette( 11, EGA_RED ); + setpalette( 13, EGA_LIGHTRED ); + + } + } + +/* call the old routine */ + oldhandler(); +} + + +void DibujaLogotipo( char * File, int X, int Y ) +{ + FILE *fp; + int alto, ancho; unsigned char byte; + int contador; + char color[17] = { 0, EGA_RED, EGA_GREEN, EGA_LIGHTGRAY, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, + EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED, EGA_LIGHTRED }; + + + if ( ( fp = fopen ( File, "rb" ) ) != NULL ) + { + + // Saltamos la cabecera + fseek( fp, 128, SEEK_SET ); + + for(alto=0; alto<279; alto++) + { + for(ancho=0; ancho<240; ) + { + byte=getc(fp); + if(byte<=0xC0) + { + if ( byte != 255 ) + putpixel( ancho+X, alto+Y, color[byte%16] ); + ancho++; + } + else + { + contador=byte&0x3F; byte=getc(fp); + if ( byte != 255 ) + for(; contador>0; contador--) + { + + putpixel( ancho+X, alto+Y, color[byte%16] ); + ancho++; + } + else + ancho += contador; + } + } + } + + + + fclose( fp ); + } + +} + + +void PantallaGrafica( int X0, int Y0, int X1, int Y1 ) +{ + static void far *ImagenFondo; + static Memoria = 0; + + + if ( Memoria == 1 ) + { + putimage( X0, Y0, ImagenFondo, COPY_PUT ); + farfree( ImagenFondo ); + Memoria = 0; + } else + + if ( ( ImagenFondo = farmalloc( JD_imagesize( X0, Y0, X1, Y1 ) ) ) != NULL ) + { + Memoria = 1; + getimage( X0, Y0, X1, Y1, ImagenFondo ); + + } else { + + Error( 0x04, "Memoria insuficiente" ); + + } + +} + +int SubItem( int Sec, int NItem ) +{ +int ok, PulsoIntro, CurrSubCol, BPush; +int dev = -1; + ok = 0; PulsoIntro = 0; CurrSubCol = 0; + do { + + if ( PulsoIntro == 0 ) + { + MarcaSubItemSeleccionado( Sec, CurrSubCol, INTENSO ); + BPush = Comprueba_Secuencia( Sec, NULL );//RatonVentas ); + MarcaSubItemSeleccionado( Sec, CurrSubCol, NORMAL ); + } else { + PulsoIntro = 0; + BPush = CurrSubCol + 1; + } + + switch( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + ok = 1; dev = -1; + break; + case -2: // Hay una tecla normal en BUFFER + // Intro + if ( (BPush = getch()) == 13 ) + PulsoIntro = 1; + else if ( BPush == 27 ) { ok = 1; dev = -1; } + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + CurrSubCol--; if ( CurrSubCol < 0 ) CurrSubCol = NItem-1; + break; + // Flecha Derecha + case 77: + case 9: + ok = 1; + dev = -1; + break; + // Flecha Abajo + case 80: + CurrSubCol++; if ( CurrSubCol > (NItem-1) ) CurrSubCol = 0; + break; + // Inicio + case 71: + CurrSubCol = 0; + break; + // Fin + case 79: + CurrSubCol = 9; + break; + default: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + } + break; + // + default: + if ( BPush <= NItem && BPush > 0 ) + { + ok = 1; + dev = BPush; + } + break; + } + } while ( !ok ); + + return dev; +} + + + + + +#define POS_INICIAL 200 +int ScrollUpProtectorPantalla( void ) +{ + p_Ampliada LetraG; + time_t first; + FILE *ftexto; + int POS_Y; + char far *VGARam = (char far *)MK_FP( 0xA000, 0); + char *Buf2Num; + char buff_MSG[100], DRAW, ok, i; + + LeeFuentes(Config.Prot_fnt); + + sprintf( buff_MSG, "datos\\%s\\Scroll.txt", NEmpresa ); + if ( (ftexto = fopen( buff_MSG, "r" ) ) == NULL ) + { +// Optar( 0, "­ NO EXISTEN MENSAJES !", "No existen mensajes que", "mostrar, asi que esto", "no va a funcionar.", NULL ); + return 1; + } + + + LetraG . x = 0; LetraG . y = POS_INICIAL-16*2; + LetraG . ndigitos = 40; + LetraG . AX = 1; LetraG . AY = 2; + LetraG . C1 = 0; LetraG . C2 = Config.DigFg+5; + LetraG . C3 = -1; + + desactiva_raton(); + + // Cambiamos a 320x200 + IntVect = OFF; + + + restorecrtmode(); + asm mov al, 0x13 + asm mov ah, 0x00 + asm int 0x10 + + POS_Y = POS_INICIAL-1; + sprintf( buff_MSG, "TPV v1.1 JD Soft. 1997 (c)" ); + + DRAW = 1; + do { + // Si hemos terminado con esta linea, fin... + POS_Y --; + if ( POS_Y <= ( POS_INICIAL - 16*2 ) ) + { + if ( 1 == 1 || POS_Y <= ( POS_INICIAL - 16*2 - 4 ) ) + { + DRAW = 1; + + // Obtenemos la linea siguiente + do { + if ( fgets( buff_MSG, 95, ftexto ) == NULL ) + { + rewind( ftexto ); + if ( fgets( buff_MSG, 95, ftexto ) == NULL ) + { + fclose( ftexto ); + Error( 0x00, "Algo raro pasa con el archivo de mensajes" ); + } + } + i = strlen( buff_MSG ) - 1; + for ( ; i < 40; i++ ) + buff_MSG[i] = 32; + buff_MSG[41] = '\0'; + + if ( buff_MSG[0] == '@' ) + { + ok = 0; + Buf2Num = buff_MSG; + LetraG . C1 = LetraG . C2 = 0; + while ( *(Buf2Num++) != ',' ) + if ( (*Buf2Num -'0') >= 0 && (*Buf2Num -'0') <= 9 ) + LetraG . C1 = LetraG . C1*10 + (*Buf2Num - '0'); +// *(Buf2Num--); + while ( *(Buf2Num++) != '\n' && *Buf2Num != '\0' ) + if ( (*Buf2Num -'0') >= 0 && (*Buf2Num -'0') <= 9 ) + LetraG . C2 = LetraG . C2*10 + (*Buf2Num - '0'); + LetraG . C2 = LetraG . C2 / 10; + } else ok = 1; + }while( !ok ); + + // Reseteamos la posici¢n + POS_Y = POS_INICIAL-1; + } else DRAW = 0; + } + LetraG . y = POS_Y; + + // Esperamos al retrace vertical + asm mov dx,3DAh + l1: + asm in al,dx + asm and al,08h + asm jnz l1 + l2: + asm in al,dx + asm and al,08h + asm jz l2 + + _fmemcpy( &VGARam[0], &VGARam[320], 63680 ); + if ( DRAW ) + FuenteAmplia( buff_MSG, &LetraG ); + + } while( !kbhit() ); + + + fclose( ftexto ); + while ( kbhit() ) getch(); + + + // Cambiamos a 640x480 + asm mov al, 0x03 + asm mov ah, 0x00 + asm int 0x10 + + setgraphmode( 2 ); + inicializa_raton_grafico( 0, 0, 639, 479 ); + ////////// + setrgbpalette(EGA_WHITE, 56, 58, 59 ); + setrgbpalette(EGA_LIGHTGRAY, 30, 37, 43 ); + setrgbpalette(EGA_DARKGRAY, 24, 27, 30 ); + + IntVect = ON; + + ungetch( 255 ); + + return 0; +} + + +void Error( int code, char *MensajeError ) +{ + free( ptr_char ); + AnulaInterrupcion(); + restorecrtmode(); + BConfig.CerrarReg(); + + printf( "\nSe produjo un codigo de error %d, subcodigo no disponible ", code ); + switch( code ) + { + case 0: + printf( "\n Error Desconocido " ); + break; + case 1: + printf( "\n BDatos gener¢ el error de salida. |ERROR DE ACCESO| " ); + break; + case 2: + printf( "\n Make Boton gener¢ el error de salida " ); + break; + case 3: + printf( "\n Fall¢ en alg£n punto del men£ principal" ); + break; + + }; + + printf( "\n> %s_", MensajeError ); + exit(code); +} + + + + +void CambiarAnyo( void ) +{ + int VisualYear, ok; + char Mes[12+1][15] = { "cuadratura", "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" }; + char buffer[80], buffer1[80]; + + getdate( &FechaGestionActual ); + sprintf( buffer1, "Hoy es %d de %s de %d", FechaGestionActual.da_day, Mes[FechaGestionActual.da_mon], FechaGestionActual.da_year ); + + sprintf( buffer, "A¤o visual: [ %04d ]", FechaGestionActual.da_year ); + Optar( ENCUADRE, "Revisi¢n de la Fecha", buffer1, "", buffer, NULL ); + + VisualYear = FechaGestionActual.da_year; + ok = 0; + do { + switch( Comprueba_Secuencia( SEC_OPTAR, NULL ) ) + { + case 0: // No se pulso ningun BOTON + case -1: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: + do { + sprintf( buffer, "%d", VisualYear ); + // . . + if ( (ok = (InputCadenaG( buffer, 1, 4, Config.TxtFgN, Config.TxtBgN, 350, 200 /*- 2*/ + 20*3, 350+50, 200 /*- 2*/-2 + 20*4) >> 8) ) ) + break; + } while ( strlen( buffer ) != 4 ); + if ( !ok ) + VisualYear = atoi( buffer ); + + setfillstyle( SOLID_FILL, 7 ); + bar( 350, 200 /*- 2*/ + 20*3, 350+50, 200 /*- 2*/-2 + 20*4 ); + sprintf( buffer, "%d", VisualYear ); + setcolor( 0 ); outtextxy( 350, 200 + 20*3, buffer ); + ok = 0; + break; + case 1: + ok = 1; + break; + case 2: + ok = 1; + VisualYear = FechaGestionActual.da_year; + break; + } + // Obtenemos el a¤o a visualizar + // VisualYear = "" " "" "" + } while( !ok ); + + Optar( ENCUADRE, "Revisi¢n de la Fecha", "", "", buffer, NULL ); + + VisualMode = ERROR; + if ( VisualYear > FechaGestionActual.da_year ) + Optar( 0, "Cambio del A¤o", "No puede visualizar datos", "que aun no existen...", NULL ); + else + if ( VisualYear < FechaGestionActual.da_year ) + { + Optar( 0, "Cambio del A¤o", "Modo visualizaci¢n, no se", "permitir  editar ning£n dato.", NULL ); + VisualMode = OK; + FechaGestionActual.da_day = 1; + FechaGestionActual.da_mon = 1; + FechaGestionActual.da_year = VisualYear; + } +} + + + /**************************************************************************\ +|* *| +|* RecopilaDatos *| +|* *| +|* Descripci¢n: *| +|* Recopila todos los datos utilies, de la empresa seleccionada*| +|* *| +|* Entradas: (ninguna) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void RecopilaDatos( void ) +{ + char buffer[80]; + long RegComp[31 + 2]; + int scl, ctot, clib; + long bcl; + + struct ffblk ffblk; + union REGS r; + int done, i; + + int MesActual = FechaGestionActual.da_mon; + + // Recopilaci¢n de datos sobre: Empresas + sprintf( buffer, "datos\\empresas.dbf" ); + if ( access( buffer, 0 ) == 0 && BEmpr.AbrirReg( buffer, sizeof( INFO_EMPRESAS ) ) != ERROR ) + { + DatosInf.NumEmpr = (int)BEmpr.Registros(); + DatosInf.EmprAct = SEmpr.CodigoR; + strcpy( DatosInf.NEmpresa, SEmpr.Empresa ); + BEmpr.CerrarReg(); + } else + DatosInf.NumEmpr = 0; + + // Recopilaci¢n de datos sobre: Articulos + sprintf( buffer, "datos\\%s\\info_ref.dbf", NEmpresa ); + if ( access( buffer, 0 ) == 0 && BRef.AbrirReg( buffer, sizeof( INFO_PRODUCTOS ) ) != ERROR ) + { + DatosInf.NumProd = BRef.Registros(); + BRef.CerrarReg(); + } else + DatosInf.NumProd = 0; + + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( access( buffer, 0 ) == 0 && BProv.AbrirReg( buffer, sizeof( INFO_PROVEEDORES ) ) != ERROR ) + { + DatosInf.NumProv = (int)BProv.Registros(); + BProv.CerrarReg(); + } else + DatosInf.NumProv = 0; + + sprintf( buffer, "datos\\%s\\info_emp.dbf", NEmpresa ); + if ( access( buffer, 0 ) == 0 && BEmpl.AbrirReg( buffer, sizeof( INFO_EMPLEADOS ) ) != ERROR ) + { + DatosInf.NumEmpl = (int)BEmpl.Registros(); + BEmpl.CerrarReg(); + } else + DatosInf.NumEmpl = 0; + + DatosInf.NumComp[0] = DatosInf.NumComp[1] = 0; + sprintf( buffer, "datos\\%s\\Cmp-%04d.M%02d", NEmpresa, FechaGestionActual.da_year, MesActual ); + if ( access( buffer, 0 ) == 0 && BCmp.AbrirReg( buffer, sizeof( COMPRAS ) ) != ERROR ) + { + BCmp.CargaDatosUsuario( (void *)RegComp, sizeof(long)*32 ); + for ( i = 1; i <= 31; i++ ) + DatosInf.NumComp[0] += (int)RegComp[i]; + DatosInf.NumComp[1] = (int)RegComp[FechaGestionActual.da_day]; + BCmp.CerrarReg(); + } + + // Datos de interes vario: Espacio Libre en disco + char unidad = bdos(0x19,0,0); + r.h.ah = 0x36; + r.h.dl = unidad+1; + intdos(&r,&r); + scl = r.x.ax; /*sectores por cluster*/ + bcl = (long)scl*r.x.cx; /*bytes por cluster*/ + ctot = r.x.dx; /*clusters total*/ + clib = r.x.bx; /*clusters libres*/ + DatosInf.EspacioLib = (clib*bcl); + + // Datos de interes vario: + // Espacio consumido por las bases de datos ( del la EMPRESA ACTUAL ) + DatosInf.EspacioCon = 0; + sprintf( buffer, "datos\\%s\\*.*", NEmpresa ); + done = findfirst( buffer, &ffblk, 0); + while (!done) + { + DatosInf.EspacioCon += ffblk.ff_fsize; + done = findnext(&ffblk); + } +} + + + /**************************************************************************\ +|* *| +|* MuestraDatos *| +|* *| +|* Descripci¢n: *| +|* Muestra los datos previamente recopilados. *| +|* *| +|* Entradas: (ninguna) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +#define NUM_LINEAS 15 +void MuestraDatos( void ) +{ + static char LineaActual = 0; + + p_Ampliada InfoDatos; + char buffer[120]; + int i; + + LineaActual = 0; + + InfoDatos.x = 30; + InfoDatos.ndigitos = 32; + InfoDatos.AX = 1; InfoDatos.AY = 1; + InfoDatos.C1 = 0; InfoDatos.C2 = Config.TxtFgI; + InfoDatos.C3 = 0; + + for ( i = 0; i < NUM_LINEAS; i++ ) + { + switch( ( LineaActual + i ) % NUM_LINEAS ) + { + case 0: + sprintf( buffer, "Existen %d empresas definidas ", DatosInf.NumEmpr ); + break; + case 1: + buffer[0] = ' '; + buffer[1] = '\0'; + break; + case 2: + sprintf( buffer, ">>--> Datos referentes a: " ); + break; + case 3: + sprintf( buffer, "< %ld %s > ", DatosInf.EmprAct, DatosInf.NEmpresa ); + break; + case 4: + buffer[0] = ' '; + buffer[1] = '\0'; + break; + case 5: + sprintf( buffer, "Numero de articulos: %5ld ", DatosInf.NumProd ); + break; + case 6: + sprintf( buffer, "Numero de proveedores: %5d ", DatosInf.NumProv ); + break; + case 7: + sprintf( buffer, "Numero de empleados: %5d ", DatosInf.NumEmpl ); + break; + case 8: + sprintf( buffer, "Compras hoy: %d de %d ", DatosInf.NumComp[1], DatosInf.NumComp[0] ); + break; + case 9: + buffer[0] = ' '; + buffer[1] = '\0'; + break; + case 10: + buffer[0] = ' '; + buffer[1] = '\0'; + break; + case 11: + sprintf( buffer, "Espacio ocup: %ld Kb de %d Mb ", DatosInf.EspacioCon / 1024, DatosInf.EspacioLib / 1048576L ); + break; + case 12: + if ( SEmpr.AccessCode[0] != '\0' ) + sprintf( buffer, "Posee codigo de acceso global " ); + else + sprintf( buffer, "Sin codigo de acceso global " ); + break; + default: + buffer[0] = ' '; + buffer[1] = '\0'; + break; + }; + InfoDatos.y = 330 + 8*i; + // No tenemos mas remedio que acceder a los datos privados: + InfoDatos.BitByte = 0; InfoDatos.currByte = 0; + + Fuente_Amplia( buffer, &InfoDatos ); + } + LineaActual = ( LineaActual++ ) % NUM_LINEAS; +} + + + /**************************************************************************\ +|* *| +|* ConfirmaSaltoInicio *| +|* *| +|* Descripci¢n: *| +|* Confirma que el salto hacia ventas diarias a de producirse. *| +|* Se dispone de tan solo 30 segundos. *| +|* (solo si esta en modo autom tico) *| +|* *| +|* Entradas: (ninguna) *| +|* *| +|* Salidas: Confirmaci¢n del salto *| +|* *| + \**************************************************************************/ +#define TIEMPO_DE_ESPERA 15 +int ConfirmaSaltoInicio( void ) +{ + time_t t, dt; + p_graphics TiempoRestante = { 415, 265, 2, 2, 2, Config.NumFg, Config.NumBg, Config.NumLn }; + + Optar( ENCUADRE, "Confirmaci¢n de salto", NULL ); + + Imprime_Estaticos( 500, "systm\\Tpv.img" ); + Numero_Digital( -1, &TiempoRestante ); + + t = time( NULL ); + do { + dt = ( time( NULL ) - t ); + Numero_Digital( TIEMPO_DE_ESPERA - dt, &TiempoRestante ); + } while( dt < TIEMPO_DE_ESPERA ); + + Optar( ENCUADRE, "Confirmaci¢n de salto", NULL ); + +// return ERROR; +return OK; +} + +void ProgramasExternos(void) +{ + Imprime_Estaticos( 99, "systm\\Tpv_MP.img" ); + getch(); +} \ No newline at end of file diff --git a/TPV_MSG.CPP b/TPV_MSG.CPP new file mode 100644 index 0000000..17c5177 --- /dev/null +++ b/TPV_MSG.CPP @@ -0,0 +1,641 @@ +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" +#include "tpv_num.h" + + +BDatos BProtector; // Base de datos para el protector +MENSAJES SProtector; // Para guardar los mensajes del protector + + + +char BufferM[6][65 + 1]; + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +int far RatonMensajes( void ); +void ConfigurarMensajes( void ); +void CargaDatosProtector( void ); +void MuestraAyudaProtector( char columna ); +void MuestraDatosProtector( int RowStart ); +void EditItemProtector( char columna, int linea ); +void NuevoRegistroProtector( MENSAJES *NSProtector ); +void MuestraMensajes( char columna, int linea, char como ); +void ObtenCoordenadasProtector( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + +p_Ampliada *LetraG[6]; + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* ConfigurarMensajes *| +|* *| +|* Descripci¢n: *| +|* Gestiona los mensajes que se mostraran en el protector *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ConfigurarMensajes(void) +{ + char i, buffer[80], key; + char CurrProtector, CurrRow, CurrCol, oldCol; + int BPush, ok; + int X0, Y0, X1, Y1; + + LeeFuentes(Config.Prot_fnt); + + + for ( i = 0; i < 6; i++ ) + if ( ( LetraG[i] = ( p_Ampliada * )malloc( sizeof( p_Ampliada ) ) ) == NULL ) + { + for ( i=0; i < 6; i++ ) + free( LetraG[i] ); + return; + } + + sprintf( buffer, "datos\\%s\\mensajes.dbf", NEmpresa ); + if ( BProtector.AbrirReg( buffer, sizeof( MENSAJES ) ) == ERROR ) + Error(0x01, BProtector.cError); + + // Si no hay registros, creamos uno almenos. + if ( BProtector.Registros() != 0 ) + { + if ( BProtector.LeeReg( (void *)&SProtector, 0 ) == ERROR ) + Error(0x01, BProtector.cError); + } else { + NuevoRegistroProtector( &SProtector ); + if ( BProtector.InsReg( (void *)&SProtector, 0, ARRIBA ) == ERROR ) + Error(0x01, BProtector.cError); + } + + + LetraG[0] -> x = 17; LetraG[0] -> y = 32; + LetraG[0] -> ndigitos = 20; + LetraG[0] -> AX = 2; LetraG[0] -> AY = 2; + + *LetraG[5] = *LetraG[4] = *LetraG[3] = *LetraG[2] = *LetraG[1] = *LetraG[0]; + + LetraG[1] -> y = 64; + LetraG[2] -> y = 96; + LetraG[3] -> y = 128; + LetraG[4] -> y = 160; + LetraG[5] -> y = 192; + + for ( i = 0; i < 6; i++ ) + { + LetraG[i] -> C1 = SProtector.CBg[i]; + LetraG[i] -> C2 = SProtector.CFg[i]; + } + + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); + bar( 0, 0, 640, 480 ); + + Imprime_Estaticos( 50, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + for ( i = 0; i < 6; i++ ) + sprintf( BufferM[i], "%-20s%-20s%-20s", SProtector.Mensaje1[i], SProtector.Mensaje2[i], SProtector.Mensaje3[i] ); + + CurrProtector = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProtector( CurrProtector*6 + CurrRow ); + + CurrCol = 0; ok = 0; + oldCol = -1; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaProtector( CurrCol ); + } + + MuestraMensajes( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 8, RatonMensajes ); + MuestraMensajes( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + if ( ( key = getch() ) != 27 ) + { + if ( key != 13 ) + ungetch( key ); + EditItemProtector( CurrCol, CurrRow ); + + for ( i = 0; i < 6; i++ ) + sprintf( BufferM[i], "%-20s%-20s%-20s", SProtector.Mensaje1[i], SProtector.Mensaje2[i], SProtector.Mensaje3[i] ); + + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 2; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol ++; if ( CurrCol > 2 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + CurrRow --; if ( CurrRow < 0 ) CurrRow = 5; + break; + // Flecha Abajo + case 80: + CurrRow ++; if ( CurrRow > 5 ) CurrRow = 0; + break; + } + break; + // Cambiar Fuente + case 1: + break; + // Menu Principal + case 2: + ok = 1; + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + ObtenCoordenadasProtector( BPush, CurrRow, &X0, &Y0, &X1, &Y1 ); + if ( SProtector.Desplaz[ BPush - 3 ] ) + { + SProtector.Desplaz[ BPush - 3 ] = 0; + ponicono( X0+5, Y0+5, led_off, 1 ); + } else { + SProtector.Desplaz[ BPush - 3 ] = 1; + ponicono( X0+5, Y0+5, led_on, 1 ); + } + break; + case 9: + CurrProtector--; if ( CurrProtector < 0 ) CurrProtector = 0; + break; + case 10: + CurrProtector++; if ( CurrProtector > 5 ) CurrProtector = 5; + break; + case 11: + LetraG[CurrRow] -> C2 =SProtector.CFg[CurrRow] = (SProtector.CFg[CurrRow] + 1) % 256; + break; + case 12: + LetraG[CurrRow] -> C1 =SProtector.CBg[CurrRow] = (SProtector.CBg[CurrRow] + 1 ) % 256; + break; + case 13: + LetraG[CurrRow] -> C2 =SProtector.CFg[CurrRow] = (SProtector.CFg[CurrRow] - 1 ) % 256; + break; + case 14: + LetraG[CurrRow] -> C1 =SProtector.CBg[CurrRow] = (SProtector.CBg[CurrRow] - 1 ) % 256; + break; + default: + break; + } + + } while( !ok ); + + + if ( BProtector.EscribeReg( (void *)&SProtector, 0 ) == ERROR ) + Error(0x01, BProtector.cError); + BProtector.CerrarReg(); + + + for ( i=0; i < 6; i++ ) + free( LetraG[i] ); +} + + + /**************************************************************************\ +|* *| +|* MuestraDatosSProtector *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosProtector( int RowStart ) +{ + int linea, campo; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_EMPL que caben en la pantalla + + for ( linea=0; linea < 6; linea++ ) + { + // Por cada linea hay 3 campos, ehhh!!! + for ( campo=0; campo < 3; campo++ ) + MuestraMensajes( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < 6; linea++ ) + for ( campo=0; campo < 3; campo++ ) + { + ObtenCoordenadasProtector( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + + for ( campo=3; campo < 9; campo++ ) + { + ObtenCoordenadasProtector( campo, 1, &X0, &Y0, &X1, &Y1 ); + if ( SProtector.Desplaz[ campo - 3 ] ) + { + ponicono( X0+5, Y0+5, led_on, 1 ); + } else { + ponicono( X0+5, Y0+5, led_off, 1 ); + } + } + +} + + /**************************************************************************\ +|* *| +|* MuestraMensajes *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraMensajes( char columna, int linea, char como ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasProtector( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + case 0: + sprintf ( buffer, "%s", SProtector.Mensaje1[linea] ); + break; + case 1: + sprintf ( buffer, "%s", SProtector.Mensaje2[linea] ); + break; + case 2: + sprintf ( buffer, "%s", SProtector.Mensaje3[linea] ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* MuestraAyudaSProtector *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaProtector( char columna ) +{ + char buffer1[80]; + + buffer1[0] = '\0'; + + switch( columna ) + { + case 0: + sprintf ( buffer1, "Introduzca mensaje del 1er Bloque" ); + break; + case 1: + sprintf ( buffer1, "Introduzca mensaje del 2er Bloque" ); + break; + case 2: + sprintf ( buffer1, "Introduzca mensaje del 3er Bloque" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemSProtector *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemProtector( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasProtector( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + case 0: + sprintf ( buffer, "%s", SProtector.Mensaje1[linea] ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( SProtector.Mensaje1[linea], buffer ); + break; + case 1: + sprintf ( buffer, "%s", SProtector.Mensaje2[linea] ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( SProtector.Mensaje2[linea], buffer ); + break; + case 2: + sprintf ( buffer, "%s", SProtector.Mensaje3[linea] ); + if ( !( InputCadenaG( buffer, 0, 20, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy( SProtector.Mensaje3[linea], buffer ); + break; + } + while( kbhit() ) getch(); + +} + + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasProtector *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasProtector( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 3 ) + *Y0 = 280 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 209; + break; + case 1: + *X0 = 219; *X1 = 421; + break; + case 2: + *X0 = 431; *X1 = 633; + break; + + + case 3: + *X0 = 350; *X1 = 380; + *Y0 = 27; *Y1 = 57; + break; + case 4: + *X0 = 350; *X1 = 380; + *Y0 = 61; *Y1 = 91; + break; + case 5: + *X0 = 350; *X1 = 380; + *Y0 = 95; *Y1 = 125; + break; + case 6: + *X0 = 350; *X1 = 380; + *Y0 = 129; *Y1 = 159; + break; + case 7: + *X0 = 350; *X1 = 380; + *Y0 = 163; *Y1 = 193; + break; + case 8: + *X0 = 350; *X1 = 380; + *Y0 = 197; *Y1 = 227; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + + + /**************************************************************************\ +|* *| +|* CargaDatosProtextor *| +|* *| +|* Descripci¢n: *| +|* Carga los datos del Protector *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void CargaDatosProtector( void ) +{ + char buffer[80]; + + sprintf( buffer, "datos\\%s\\mensajes.dbf", NEmpresa ); + if ( BProtector.AbrirReg( buffer, sizeof( MENSAJES ) ) == ERROR ) + Error(0x01, BProtector.cError); + + // Si no hay registros, creamos uno almenos. + if ( BProtector.Registros() != 0 ) + { + if ( BProtector.LeeReg( (void *)&SProtector, 0 ) == ERROR ) + Error(0x01, BProtector.cError); + } else { + NuevoRegistroProtector( &SProtector ); + if ( BProtector.InsReg( (void *)&SProtector, 0, ARRIBA ) == ERROR ) + Error(0x01, BProtector.cError); + } + + BProtector.CerrarReg(); + +} + +void NuevoRegistroProtector( MENSAJES *NSProtector ) +{ + int i; + + + NSProtector ->TEspera = 15; // Segundos de espera para pasar al siguiente bloque + + for ( i = 0; i < 6; i++ ) + { + NSProtector ->Desplaz[i] = 0; // Indicador si se desplaza o no. + + NSProtector ->Mensaje1[i][0] = '\0';// Mensaje que se va a mostrar + NSProtector ->Mensaje2[i][0] = '\0';// Mensaje que se va a mostrar + NSProtector ->Mensaje3[i][0] = '\0';// Mensaje que se va a mostrar + + NSProtector ->CFg[i] = 63; + NSProtector ->CBg[i] = 0; + } + + NSProtector ->Desplaz[3] = 1; // Indicador si se desplaza o no. + strcpy( NSProtector ->Mensaje1[3], "Programa realizado p" ); + strcpy( NSProtector ->Mensaje2[3], "or: Jose David Guil" );// Mensaje que se va a mostrar + strcpy( NSProtector ->Mensaje3[3], "len" );// Mensaje que se va a mostrar + + +} + + /**************************************************************************\ +|* *| +|* PreviewPantalla *| +|* *| +|* Descripci¢n: *| +|* Muestra un preview de como quedar  el mensaje del protector *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void PreviewPantalla(void) +{ + static int Pasadas = 20*8 - 1; + static time_t first; + static char Paso = 0; + char i; + + if ( Pasadas == -1 && difftime( time(NULL), first ) >= SProtector.TEspera ) + { + Pasadas = 0; + if ( Paso == 4 ) Paso = 1; + } + + if ( Pasadas >= 0 ) + { + Pasadas ++; + if ( Pasadas > (Paso != 3 ? 20*8 : 25*8 ) ) + { + time( &first ); + Pasadas = -1; + Paso++; + } + } + + for ( i = 0; i < 6; i++ ) + { + if ( SProtector.Desplaz[i] || Pasadas != -1 ) + Fuente_Amplia3( BufferM[i], LetraG[i] ); + } + + +} + + + /**************************************************************************\ +|* *| +|* RatonMensajes *| +|* *| +|* Descripci¢n: *| +|* Funci¢n soporte para el control del raton, que ademas se *| +|* encarga de mostrar el letrero digital y el protector de *| +|* pantalla. *| +|* *| +|* Entradas: *| +|* Linea en la que se inserta y posici¢n f¡sica, y columna *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int far RatonMensajes(void) +{ + +// inicializa_raton_grafico(0, 0, 624, 464); +// char boton_izq, boton_der; + char Que; + + activa_raton(); + + union REGS io; + io.x.ax = 3; + + + + do{ + PreviewPantalla(); + + int86(0x33, &io, &io); // lee posici¢n y estados del bot¢n + + x_raton = io.x.cx; + y_raton = io.x.dx; + + }while( (io.x.bx & 1) == 0 && ((io.x.bx >> 1) & 1) == 0 && !kbhit() ); + + + ///////////////////////////////////////// + // RETURN Derecho Izquierdo // + // // + // 0 0 0 // + // 1 1 0 // + // 2 0 1 // + // 3 1 1 // + // // + ///////////////////////////////////////// + + + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==0 ) Que = 0; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==0 ) Que = 1; + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==1 ) Que = 2; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==1 ) Que = 3; + + desactiva_raton(); + return Que; +} diff --git a/TPV_NUM.CPP b/TPV_NUM.CPP new file mode 100644 index 0000000..677ccd3 --- /dev/null +++ b/TPV_NUM.CPP @@ -0,0 +1,463 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "tpv_def.h" + +char *ptr_char; + +char far *VidRam = (char far *)MK_FP( 0xA000, 0); +void far PutPixel(unsigned int x, unsigned int y, int c_elec ); + +typedef struct + { + int x, y; + char ndigitos; + char AX, AY; + char C1, C2, C3; + } p_graphics; + +typedef struct + { + int x, y; // Coordenadas iniciales de muestreo + char ndigitos; // n£mero de digitos a mostrar + char AX, AY; // factor de espaciado + char C1, C2, C3; // colores de fondo, texto, borde + + // Datos privados y uso interno exclusivamente + unsigned int Flen; // longitud de la frase actual + char BitByte; // bit del byte por el que va en el recorrido + char currByte; // byte actual dentro de la frase + + } p_Ampliada; + +int Numero_Digital( long numero, p_graphics *ND ); +void Fuente_Amplia( char *Frase, p_graphics *FA ); + + + /**************************************************************************\ +|* *| +|* Numero_Digital *| +|* *| +|* Descripcion: *| +|* Muestra un numero, con forma digital en pantalla, *| +|* escalandolo seg£n los factores indicados en p_graphics *| +|* ( 9 digitos como m ximo ) *| +|* *| +|* Entradas: *| +|* N£mero y estructura de muestreo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int Numero_Digital( long numero, p_graphics *ND ) +{ +// Son 9 digitos VARIABLES +// 0 +// _________ _________ _________ _________ _________ _________ _________ +// |\______ /| |\______ /| |\______ /| |\______ /| |\______ /| |\______ /| |\______ /| +// | | | | | | | | | | | | | | | | | | | | | | | | | | | | +//3 | | 1 | | 5 | | | | | | | | | | | | | | | | | | | | | | | | +// | /-----\ | | /-----\ | | /-----\ | | /-----\ | | /-----\ | | /-----\ | | /-----\ | +// | \-----/ | | \-----/ | | \-----/ | | \-----/ | | \-----/ | | \-----/ | | \-----/ | +//4 | | | | 6 | | | | | | | | | | | | | | | | | | | | | | | | +// | |_____| | | |_____| | | |_____| | | |_____| | | |_____| | | |_____| | | |_____| | +// |/_______\| |/_______\| |/_______\| |/_______\| |/_______\| |/_______\| |/_______\| +// 2 + + static char dnumero[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + static char Dn[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + static char vez = 0; + static p_graphics ND1; + + char dnum=0, i, j, digital; + int punto[10]; + int CONST = 0; + char DnTmp[2]; + char signo = 0; + static old_signo = 0; + + + // Si ha cambiado la posicion, el n§ de digitos, o el factor de escala + // habr  que recalcularlo todo. + if ( + ND1.x != ND -> x || ND1.y != ND -> y || + ND1.ndigitos != ND -> ndigitos || + ND1.AX != ND -> AX || ND1.AY != ND -> AY + ) + { + dnumero[0] = -1; dnumero[1] = -1; dnumero[2] = -1; + dnumero[3] = -1; dnumero[4] = -1; dnumero[5] = -1; + dnumero[6] = -1; dnumero[7] = -1; dnumero[8] = -1; + + Dn[0] = 0; Dn[1] = 0; Dn[2] = 0; + Dn[3] = 0; Dn[4] = 0; Dn[5] = 0; + Dn[6] = 0; Dn[7] = 0; Dn[8] = 0; + + //ndigitos1 = ndigitos; + ND1 = *ND; + vez = 0; + } + + // Miramos el signo del n£mero + if ( numero < 0 ) + { + numero *= -1; + signo = 1; + } + + if ( signo != old_signo ) vez = 0; + + setcolor(ND -> C3); + + // Miro todas las cifras que componen el n£mero + for( i=0; i < ND -> ndigitos; i++ ) + { + dnum = numero % 10; + digital = numero; + numero /= 10; + + // Si el n£mero pintado con anterioridad es distinto al actual, lo dibujamos + if ( dnumero[ ND -> ndigitos - 1 - i] != dnum || digital == 0 || vez == 0 ) + { + // digital = dnumero[5 - i]; + dnumero[ND -> ndigitos - 1 - i] = dnum; + //////// Esta parte del c¢digo imprime el digito en pantalla + CONST = 12*ND -> AX*(ND -> ndigitos - 1 - i); + DnTmp[1] = Dn[ND -> ndigitos - 1 -i]; + + // Antes de nada, eliminamos los cero a la izquierda + if ( digital == 0 && i != 0 ) { Dn[ND -> ndigitos - 1 -i] = 0; dnumero[ND -> ndigitos - 1 - i] = -1; } else + switch( dnum ) + { + case 0: + Dn[ND -> ndigitos - 1 -i] = 0x7D; // 0111 1101 + break; + case 1: + Dn[ND -> ndigitos - 1 -i] = 0x60; // 0110 0000 + break; + case 2: + Dn[ND -> ndigitos - 1 -i] = 0x37; // 0011 0111 + break; + case 3: + Dn[ND -> ndigitos - 1 -i] = 0x67; // 0110 0111 + break; + case 4: + Dn[ND -> ndigitos - 1 -i] = 0x6A; // 0110 1010 + break; + case 5: + Dn[ND -> ndigitos - 1 -i] = 0x4F; // 0100 1111 + break; + case 6: + Dn[ND -> ndigitos - 1 -i] = 0x5F; // 0101 1111 + break; + case 7: + Dn[ND -> ndigitos - 1 -i] = 0x61; // 0110 0001 + break; + case 8: + Dn[ND -> ndigitos - 1 -i] = 0x7F; // 0111 1111 + break; + case 9: + Dn[ND -> ndigitos - 1 -i] = 0x6F; // 0110 1111 + break; + } + + DnTmp[0] = Dn[ND -> ndigitos - 1 -i]; + for( j=0; j<7; j++ ) + { + if ( DnTmp[1]%2 != DnTmp[0]%2 || vez == 0 ) + { + if ( DnTmp[0]%2 ) + setfillstyle(SOLID_FILL, ND -> C1); + else + setfillstyle(SOLID_FILL, ND -> C2); + + switch( j ) + { + case 0: + punto[0] = 0*ND -> AX + CONST + ND -> x; punto[1] = 0*ND -> AY + ND -> y; + punto[2] = 10*ND -> AX + CONST + ND -> x; punto[3] = 0*ND -> AY + ND -> y; + punto[4] = 8*ND -> AX + CONST + ND -> x; punto[5] = 2*ND -> AY + ND -> y; + punto[6] = 2*ND -> AX + CONST + ND -> x; punto[7] = 2*ND -> AY + ND -> y; + punto[8] = 0*ND -> AX + CONST + ND -> x; punto[9] = 0*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + case 3: + punto[0] = 0*ND -> AX + CONST + ND -> x; punto[1] = 0*ND -> AY + ND -> y; + punto[2] = 2*ND -> AX + CONST + ND -> x; punto[3] = 2*ND -> AY + ND -> y; + punto[4] = 2*ND -> AX + CONST + ND -> x; punto[5] = 9*ND -> AY + ND -> y; + punto[6] = 1*ND -> AX + CONST + ND -> x; punto[7] = 10*ND -> AY + ND -> y; + punto[8] = 0*ND -> AX + CONST + ND -> x; punto[9] = 9*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + case 5: + punto[0] = 10*ND -> AX + CONST + ND -> x; punto[1] = 0*ND -> AY + ND -> y; + punto[2] = 10*ND -> AX + CONST + ND -> x; punto[3] = 9*ND -> AY + ND -> y; + punto[4] = 9*ND -> AX + CONST + ND -> x; punto[5] = 10*ND -> AY + ND -> y; + punto[6] = 8*ND -> AX + CONST + ND -> x; punto[7] = 9*ND -> AY + ND -> y; + punto[8] = 8*ND -> AX + CONST + ND -> x; punto[9] = 2*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + case 1: + int punto1[12]; + punto1[0] = 1*ND -> AX + CONST + ND -> x; punto1[1] = 10*ND -> AY + ND -> y; + punto1[2] = 2*ND -> AX + CONST + ND -> x; punto1[3] = 9*ND -> AY + ND -> y; + punto1[4] = 8*ND -> AX + CONST + ND -> x; punto1[5] = 9*ND -> AY + ND -> y; + punto1[6] = 9*ND -> AX + CONST + ND -> x; punto1[7] = 10*ND -> AY + ND -> y; + punto1[8] = 8*ND -> AX + CONST + ND -> x; punto1[9] = 11*ND -> AY + ND -> y; + punto1[10] = 2*ND -> AX + CONST + ND -> x; punto1[11] = 11*ND -> AY +ND -> y; + fillpoly( 6, punto1 ); + break; + case 4: + punto[0] = 1*ND -> AX + CONST + ND -> x; punto[1] = 10*ND -> AY + ND -> y; + punto[2] = 2*ND -> AX + CONST + ND -> x; punto[3] = 11*ND -> AY + ND -> y; + punto[4] = 2*ND -> AX + CONST + ND -> x; punto[5] = 18*ND -> AY + ND -> y; + punto[6] = 0*ND -> AX + CONST + ND -> x; punto[7] = 20*ND -> AY + ND -> y; + punto[8] = 0*ND -> AX + CONST + ND -> x; punto[9] = 11*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + case 6: + punto[0] = 9*ND -> AX + CONST + ND -> x; punto[1] = 10*ND -> AY + ND -> y; + punto[2] = 10*ND -> AX + CONST + ND -> x; punto[3] = 11*ND -> AY + ND -> y; + punto[4] = 10*ND -> AX + CONST + ND -> x; punto[5] = 20*ND -> AY + ND -> y; + punto[6] = 8*ND -> AX + CONST + ND -> x; punto[7] = 18*ND -> AY + ND -> y; + punto[8] = 8*ND -> AX + CONST + ND -> x; punto[9] = 11*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + case 2: + punto[0] = 2*ND -> AX + CONST + ND -> x; punto[1] = 18*ND -> AY + ND -> y; + punto[2] = 8*ND -> AX + CONST + ND -> x; punto[3] = 18*ND -> AY + ND -> y; + punto[4] = 10*ND -> AX + CONST + ND -> x; punto[5] = 20*ND -> AY + ND -> y; + punto[6] = 0*ND -> AX + CONST + ND -> x; punto[7] = 20*ND -> AY + ND -> y; + punto[8] = 2*ND -> AX + CONST + ND -> x; punto[9] = 18*ND -> AY + ND -> y; + fillpoly( 5, punto ); + break; + default: + break; + } + } + DnTmp[0] /= 2; + DnTmp[1] /= 2; + } + } + } + + if ( signo != old_signo ) + { + + if ( (old_signo = signo) == 1 ) + { + setfillstyle(SOLID_FILL, ND -> C1); + + int punto1[12]; + punto1[0] = 1*ND -> AX + ND -> x; punto1[1] = 10*ND -> AY + ND -> y; + punto1[2] = 2*ND -> AX + ND -> x; punto1[3] = 9*ND -> AY + ND -> y; + punto1[4] = 8*ND -> AX + ND -> x; punto1[5] = 9*ND -> AY + ND -> y; + punto1[6] = 9*ND -> AX + ND -> x; punto1[7] = 10*ND -> AY + ND -> y; + punto1[8] = 8*ND -> AX + ND -> x; punto1[9] = 11*ND -> AY + ND -> y; + punto1[10] = 2*ND -> AX + ND -> x; punto1[11] = 11*ND -> AY +ND -> y; + fillpoly( 6, punto1 ); + } + } + + vez = 1; + return 0; +} + + + +//////////////////////////////////////////////////////////////////////////////////// +void far PutPixel(unsigned int x, unsigned int y, int c_elec ) +{ + if ( x < 320 && y < 200 ) + *(VidRam + (x + y*320) ) = c_elec; +} + + +void LeeFuentes(char *file) +{ +FILE *fich; + /* Reservamos 4 Kb. para cargar la fuente en memoria */ + + /* Abrimos el fichero de la fuente */ + + if ((fich=fopen(file,"rb"))==NULL) { + printf("\a\nArchivo %s no encontrado.\n",file); + Error(0, "No se encuentra el archivo de fuentes"); + } + + fseek(fich, SEEK_SET, 0); /* Nos colocamos al principio del fichero */ + fread(ptr_char,1,4096,fich); /* Cargamos en memoria 4096 bytes del fichero */ + fclose(fich); /* Cerramos el fichero */ +} + + + + + + + + +#define TAMx 8 +#define TAMy 8 +void Fuente_Amplia( char *Frase, p_Ampliada far *FA ) +{ + int i, j, k; // Variables de avance + int c_elec; // Color en el momento de imprimir + int PosX, PosY; // Posicion fisica final + char LCaract; // Caracter de linea a tratar + + if ( FA->Flen != _fstrlen( Frase ) ) // Reseteamos las variables de control interno + { + // Obtenemos la longitud de la frase. ( En d¡gitos ) + FA -> Flen = _fstrlen( Frase ); + // Contador de digito actual a cero + FA -> BitByte = 0; + // Posicion dentro de la frase + FA -> currByte = 0; + } + + // Avance horizontal de bit's ( avance de digitos ) + for ( i = 0; i < ( TAMx * (FA -> ndigitos) ); i++ ) + { + k = ( (unsigned char)Frase[ ( (i+FA->BitByte)/TAMx + FA -> currByte ) % FA->Flen ] ) << 4; + LCaract = ( (char)0x01 << (7 - (i+FA->BitByte)%TAMx) ); + PosX = FA -> x + FA->AX * i; // Posicion f¡sica horizontal + // Avance vertical de bit's + for ( j = 0; j < TAMy; j ++ ) + { + PosY = FA -> y + FA->AY * j; // Posicion f¡sica vertical + + if ( ptr_char[ k + j ] & LCaract ) + c_elec = FA->C2; + else + c_elec = FA->C1; + + putpixel ( PosX, PosY, c_elec ); + } + } + // Tenemos en cuenta el avance dentro de la frase + if ( ( FA -> BitByte ++ ) >= 7 ) + { + FA -> BitByte = 0; FA -> currByte ++; + if ( FA -> currByte >= FA -> Flen ) + FA -> currByte = 0; + } + +} +#undef TAMy +#undef TAMx + + +#define TAMx 8 +#define TAMy 16 +void Fuente_Amplia3( char *Frase, p_Ampliada far *FA ) +{ + int i, j, k; // Variables de avance + int c_elec; // Color en el momento de imprimir + int PosX, PosY; // Posicion fisica final + char LCaract; // Caracter de linea a tratar + + if ( FA->Flen != _fstrlen( Frase ) ) // Reseteamos las variables de control interno + { + // Obtenemos la longitud de la frase. ( En d¡gitos ) + FA -> Flen = _fstrlen( Frase ); + // Contador de digito actual a cero + FA -> BitByte = 0; + // Posicion dentro de la frase + FA -> currByte = 0; + } + + // Avance horizontal de bit's ( avance de digitos ) + for ( i = 0; i < ( TAMx * (FA -> ndigitos) ); i++ ) + { + k = ( (unsigned char)Frase[ ( (i+FA->BitByte)/TAMx + FA -> currByte ) % FA->Flen ] ) << 4; + LCaract = ( (char)0x01 << (7 - (i+FA->BitByte)%TAMx) ); + PosX = FA -> x + FA->AX * i; // Posicion f¡sica horizontal + // Avance vertical de bit's + for ( j = 0; j < TAMy; j ++ ) + { + PosY = FA -> y + FA->AY * j; // Posicion f¡sica vertical + + if ( ptr_char[ k + j ] & LCaract ) + c_elec = FA->C2; + else + c_elec = FA->C1; + + putpixel ( PosX, PosY, c_elec ); + } + } + // Tenemos en cuenta el avance dentro de la frase + if ( ( FA -> BitByte ++ ) >= 7 ) + { + FA -> BitByte = 0; FA -> currByte ++; + if ( FA -> currByte >= FA -> Flen ) + FA -> currByte = 0; + } + +} +#undef TAMy +#undef TAMx + +/////ÜÜ///////////////////////////////////////////////////////////////////////////// +////Û///////////////////////////////////////////////////////////////////////////////// +/////ßÜ/////Ü/////////////////////////////////////////////////////////////////////// +//////ß///Ü////ß/Ü////////////////////////////////////////////////////////////////// +///////ß/Ü///Ü////////////////////////////////////////////////////////////////////// +////////Ü//ß////ß/////////////////////////////////////////////////////////////////// +/////////ß////Ü///////////////////////////////////////////////////////////////////// +///////////ß//////////////////////////////////////////////////////////////////////// +#define TAMx 8 +#define TAMy 16 +void FuenteAmplia( char *Frase, p_Ampliada far *FA ) +{ + int i, j, k; // Variables de avance + int c_elec; // Color en el momento de imprimir + int PosX, PosY; // Posicion fisica final + int LCaract; // Caracter de linea a tratar + + if ( FA->C3 == -1 || FA->Flen != _fstrlen( Frase ) ) // Reseteamos las variables de control interno + { + // Obtenemos la longitud de la frase. ( En d¡gitos ) + FA -> Flen = _fstrlen( Frase ); + // Contador de digito actual a cero + FA -> BitByte = 0; + // Posicion dentro de la frase + FA -> currByte = 0; + } + + // Avance horizontal de bit's ( avance de digitos ) + for ( i = 0; i < ( TAMx * (FA -> ndigitos) ); i++ ) + { + k = ( (unsigned char)Frase[ ( (i+FA->BitByte)/TAMx + FA -> currByte ) % FA->Flen ] ) << 4; + LCaract = ( (char)0x01 << (7 - (i+FA->BitByte)%TAMx) ); + PosX = FA -> x + FA->AX * i; // Posicion f¡sica horizontal + // Avance vertical de bit's + for ( j = 0; j < TAMy; j ++ ) + { + PosY = FA -> y + FA->AY * j; // Posicion f¡sica vertical + + if ( ptr_char[ k + j ] & LCaract ) + c_elec = FA->C2; + else + c_elec = FA->C1; + + PutPixel ( PosX, PosY, c_elec ); + } + } + // Tenemos en cuenta el avance dentro de la frase + if ( ( FA -> BitByte ++ ) >= 7 ) + { + FA -> BitByte = 0; FA -> currByte ++; + if ( FA -> currByte >= FA -> Flen ) + FA -> currByte = 0; + } + +} +#undef TAMy +#undef TAMx diff --git a/TPV_NUM.H b/TPV_NUM.H new file mode 100644 index 0000000..febecda --- /dev/null +++ b/TPV_NUM.H @@ -0,0 +1,43 @@ +typedef struct + { + int x, y; + char ndigitos; + char AX, AY; + char C1, C2, C3; + } p_graphics; + +int Numero_Digital( long numero, p_graphics *ND ); +void LeeFuentes(char *file); +/* +typedef struct + { + int x, y; + char ndigitos; + char AX, AY; + char C1, C2, C3; + + char FraseBit[110][16]; + char Frase1[100]; + + unsigned int Flen; + char Flen1; + +} p_Ampliada; +*/ +typedef struct + { + int x, y; // Coordenadas iniciales de muestreo + char ndigitos; // n£mero de digitos a mostrar + char AX, AY; // factor de espaciado + char C1, C2, C3; // colores de fondo, texto, borde + + // Datos privados y uso interno exclusivamente + unsigned int Flen; // longitud de la frase actual + char BitByte; // bit del byte por el que va en el recorrido + char currByte; // byte actual dentro de la frase + } p_Ampliada; + + +void Fuente_Amplia( char *Frase, p_Ampliada far *FA ); +void FuenteAmplia( char *Frase, p_Ampliada far *FA ); +void Fuente_Amplia3( char *Frase, p_Ampliada *FA ); diff --git a/TPV_PRV.CPP b/TPV_PRV.CPP new file mode 100644 index 0000000..6605bab --- /dev/null +++ b/TPV_PRV.CPP @@ -0,0 +1,1529 @@ +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_PROV 9 + +BDatos BProv; // Base de datos de Proveedores +INFO_PROVEEDORES SProv; // Estructura de Proveedores + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void DuplicaBaseProveedores(void); +void MuestraDatosVProv( int linea); +void MuestraDatosProv( long RowStart ); +void MuestraAyudaProv( char columna ); +int CompruebaPulsosEstrellas( void ); +void EditItemProv( char columna, int linea ); +void ProvNuevoRegistro( INFO_PROVEEDORES *MSProv ); +void MuestraProv( char columna, int linea, char como ); +void ObtenCoordenadasProv( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de Busqueda de proveedores | +| | + \*************************************/ +void ObtenCoordenadasMatchProv( char Row, int *X0, int *Y0, int *X1, int *Y1 ); +void MatchDrawProv( char Row, INFO_PROVEEDORES MProv, char como ); +void BuscaProv( char TipoBusqueda, char *CurrRow, long *CurrProv ); +int Match_Prov( INFO_PROVEEDORES *A, INFO_PROVEEDORES *B ); +void EditMatchProv( char Row, INFO_PROVEEDORES * MProv ); +int ObtenMatchProv( INFO_PROVEEDORES *MProv ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void MuestraImpresionesProv( void ); +void ImprimeProveedores( char como ); +void ImprimeCabeceraProv( char como, FILE *file_out ); + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* DuplicaBaseProveedores *| +|* *| +|* Descripci¢n: *| +|* Dado que he elegido un sistema rigido para tratar a los *| +|* proveedores, me veo obligado una vez al a¤o a clonar la *| +|* base de datos de los proveedores... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void DuplicaBaseProveedores(void) +{ + long Regs; + BDatos BPtmp; + char buffer[80]; + + // Base a clonar + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( (FechaGestionActual.da_year-1) - ((FechaGestionActual.da_year-1)/1000)*1000 ) ); + if ( BPtmp.AbrirReg( buffer, sizeof( INFO_PROVEEDORES ) ) == ERROR ) + Error(0x01, BPtmp.cError); + + // Base clonada + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BProv.AbrirReg( buffer, sizeof( INFO_PROVEEDORES ) ) == ERROR ) + Error(0x01, BProv.cError); + + for( Regs = 0; Regs < BPtmp.Registros(); Regs++ ) + { + if ( BPtmp.LeeReg( (void *)&SProv, Regs ) == ERROR ) + Error(0x01, BPtmp.cError); + if ( BProv.InsReg( (void *)&SProv, BProv.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BProv.cError); + } + + BProv.CerrarReg(); + BPtmp.CerrarReg(); + +} + + /**************************************************************************\ +|* *| +|* InfoProveedores *| +|* *| +|* Descripci¢n: *| +|* Controla la introduccion de datos y muestreo asi como todo *| +|* el interfaz de usuario... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoProveedores(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrProv; // Producto sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 30, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 30' + + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + + // Este a¤o no existe la base de datos, pero quizas exista el a¤o anterior + if ( access( buffer, 0 ) != 0 ) + { + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( (FechaGestionActual.da_year-1) - ((FechaGestionActual.da_year-1)/1000)*1000 ) ); + if ( access( buffer, 0 ) == 0 ) + { + Optar( ENCUADRE, "Generando clon de Proveedores", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + DuplicaBaseProveedores(); + Optar( ENCUADRE, "Generando clon de Proveedores", "Atenci¢n se detecto un nuevo", "a¤o y se esta generando un", "clon de la base anterior.", NULL ); + } + } + + sprintf( buffer, "datos\\%s\\info_prv.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BProv.AbrirReg( buffer, sizeof( INFO_PROVEEDORES ) ) == ERROR ) + Error(0x01, BProv.cError); + + // Si no hay registros, creamos uno almenos. + if ( BProv.Registros() == 0 ) + { + ProvNuevoRegistro( &SProv ); + if ( BProv.InsReg( (void *)&SProv, BProv.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BProv.cError); + } + + CurrProv = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrRow + CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, 0 ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaProv( CurrCol ); + } + + MuestraProv( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraProv( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + if ( ( BPush = CompruebaPulsosEstrellas() ) != 0 ) + { + MuestraProv( BPush, CurrRow, INTENSO ); + if ( BProv.EscribeReg( (void *)&SProv, (CurrRow + CurrProv) ) == ERROR ) + Error(0x01, BProv.cError); + } + break; + case -2: // Hay una tecla normal en BUFFER +#ifndef DEMOSTRACION + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + if ( ( key = getch() ) != 27 ) + { + if ( key != 13 ) + ungetch( key ); + EditItemProv( CurrCol, CurrRow ); + if ( BProv.EscribeReg( (void *)&SProv, (CurrRow + CurrProv) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraProv( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 14 ) CurrCol = 14; + } + } +#else + while( kbhit() ) getch(); + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten m¢dificar los campos,", "de los proveedores...", NULL ); +#endif + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( CurrCol < 4 ) + { + if ( (CurrRow + CurrProv) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_PROV - 1; CurrProv -= NLINEAS_PROV; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + } else { + CurrCol--; if ( CurrCol < 0 ) CurrCol = 14; + } + break; + // Flecha Abajo + case 80: + if ( CurrCol < 4 ) + { + if ( ( CurrRow + CurrProv ) < BProv.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_PROV - 1 ) + { + CurrRow = 0; CurrProv += NLINEAS_PROV; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + } else + CurrRow++; + } + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + } else { + CurrCol++; if ( CurrCol > 14 ) CurrCol = 0; + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrProv != 0 ) + { + CurrProv = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrProv != BProv.Registros() - NLINEAS_PROV ) + { + CurrProv = BProv.Registros() - NLINEAS_PROV; + if ( CurrProv < 0 ) + { + CurrProv = 0; + CurrRow = BProv.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + break; + } + break; + // Imprimir Proverencias + case 1: + MuestraImpresionesProv(); + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Eliminar + case 3: + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + if ( Optar( 1, "ATENCION", "Eliminar el proveedor", "provoc ra la perdida de datos", "para los informaes!!!", NULL ) ) + { + if ( BProv.DelReg( CurrProv + CurrRow ) == ERROR ) + Error(0x01, BProv.cError); + if ( BProv.Registros() == 0 ) + { + ProvNuevoRegistro( &SProv ); + if ( BProv.InsReg( (void *)&SProv, BProv.Registros(), ARRIBA ) == ERROR ) + Error(0x01, BProv.cError); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrProv+CurrRow) >= ( BProv.Registros() - 2 ) ) + { + if ( (CurrRow + CurrProv) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_PROV - 1; CurrProv -= NLINEAS_PROV; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + } + } + break; + // Insertar + case 4: + if ( VisualMode == OK ) + { + while( kbhit() ) getch(); + } else { + ProvNuevoRegistro( &SProv ); + if ( BProv.InsReg( (void *)&SProv, (CurrProv + CurrRow), ARRIBA ) == ERROR ) + Error(0x01, BProv.cError); + if ( ( CurrRow + CurrProv ) < BProv.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_PROV - 1 ) + { + CurrRow = 0; CurrProv += NLINEAS_PROV; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); + } + break; +#else + // insertar//eliminar + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten eliminar ni insertar", "nuevos registros...", NULL ); + break; +#endif + + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_PROV - 1; CurrProv -= NLINEAS_PROV; + if ( CurrProv < 0 ) CurrProv = 0; + + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrProv ) >= BProv.Registros() && CurrProv > 0 ) CurrProv++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); +#endif + break; + // Busqueda Atras + case 6: + BuscaProv( ATRAS, &CurrRow, &CurrProv ); + break; + // Buscar + case 7: + BuscaProv( NUEVA_BUSQUEDA, &CurrRow, &CurrProv ); + break; + // Busqueda Adelante + case 8: + BuscaProv( ADELANTE, &CurrRow, &CurrProv ); + + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrProv += NLINEAS_PROV; + + while ( (CurrProv + CurrRow) >= BProv.Registros() ) CurrProv--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, (CurrProv + CurrRow) ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( CurrRow ); +#endif + break; + default: + break; + } + + } while( !ok ); + + BProv.CerrarReg(); +} + + + + /**************************************************************************\ +|* *| +|* MuestraDatosProv *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosProv( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_PROV que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_PROV && (RowStart + linea) < BProv.Registros()/*dev == OK*/; linea++ ) + { + dev = BProv.LeeReg( (void *)&SProv, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 4 campos, ehhh!!! + for ( campo=0; campo < 4; campo++ ) + MuestraProv( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( linea < NLINEAS_PROV ) //dev != OK ) + { + //linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_PROV; linea++ ) + for ( campo=0; campo < 4; campo++ ) + { + ObtenCoordenadasProv( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosVProv( int linea ) +{ + int campo; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + // mas 5 que pertenecen a las estrellas + for ( campo=4; campo < 18+5; campo++ ) + MuestraProv( campo, linea, NORMAL ); + +} + + /**************************************************************************\ +|* *| +|* MuestraProv *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraProv( char columna, int linea, char como ) +{ + char buffer[80], draw; + char buffer1[80], i; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasProv( columna, linea, &X0, &Y0, &X1, &Y1 ); + + draw = 1; + + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer, " %09lu", SProv.CodigoR ); + break; + // Nombre del proveedor + case 1: + sprintf ( buffer, "%30s", SProv.ActividadProveedor ); + break; + // N§ de Telefono + case 2: + sprintf ( buffer, "%15s", SProv.Telefono1 ); + break; + // Fax + case 3: + sprintf ( buffer, "%15s", SProv.Fax ); + break; + + // Codigo + case 4: + sprintf ( buffer, "%09lu", SProv.CodigoR ); + break; + // NIF / CIF + case 5: + sprintf ( buffer, "%10s", SProv.Cif ); + break; + // Nombre Proveedor + case 6: + sprintf ( buffer, "%29s", SProv.Proveedor ); + break; + // Actividad Proveedor + case 7: + sprintf ( buffer, "%29s", SProv.ActividadProveedor ); + break; + // Direccion + case 8: + sprintf ( buffer, " %30s", SProv.Direccion ); + break; + // Localidad + case 9: + sprintf ( buffer, "%15s", SProv.Poblacion ); + break; + // Provincia + case 10: + sprintf ( buffer, "%15s", SProv.Provincia ); + break; + // Codigo Postal + case 11: + formatea_long( SProv.CodPost, buffer1 ); + sprintf ( buffer, "%7s", buffer1 ); + break; + // Telefono + case 12: + sprintf ( buffer, " %15s", SProv.Telefono1 ); + break; + // Fax + case 13: + sprintf ( buffer, "%15s", SProv.Fax ); + break; + + // Comentario + case 14: + draw = 0; + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + for ( i = 0; i < 4; i++ ) + outtextxy( X0, Y0 + 14*i, SProv.Notas[i] ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + + // Estellas + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + if ( ( SProv.Estrellas & ( 0x01 << (columna - 15) ) ) >> (columna - 15 ) ) + ponicono( X0+5, Y0+5, led_on, 1 ); + else + ponicono( X0+5, Y0+5, led_off, 1 ); + // En las estrellas no hay que imprimir nada + draw = 0; + break; + + + } + + if ( draw ) + { + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + } +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaProv *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaProv( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo + case 0: + sprintf ( buffer1, "Introduzca el codigo que desea asignar al proveedor" ); + break; + // Nombre del proveedor + case 1: + sprintf ( buffer1, "Actividad del proveedor" ); + break; + // Telefono + case 2: + sprintf ( buffer1, "N£mero de tel‚fono del proveedor" ); + break; + // N§ de Fax + case 3: + sprintf ( buffer1, "N£mero de Fax (necesario para enviarlos)" ); + break; + + // Codigo + case 4: + sprintf ( buffer1, "C¢digo de proveedor" ); + break; + // Nif / Cif + case 5: + sprintf ( buffer1, "N.I.F. o C.I.F. del proveedor" ); + break; + // Nombre del proveedor + case 6: + sprintf ( buffer1, "Nombre del proveedor" ); + break; + // Actividad del proveedor + case 7: + sprintf ( buffer1, "Actividad del Proveedor" ); + break; + // Direccion + case 8: + sprintf ( buffer1, "Direccion completa del proveedor" ); + break; + // Poblacion + case 9: + sprintf ( buffer1, "Localidad del proveedor" ); + break; + // Provincia + case 10: + sprintf ( buffer1, "Provincia" ); + break; + // C¢digo postal + case 11: + sprintf ( buffer1, "C¢digo Postal" ); + break; + // Telefono + case 12: + sprintf ( buffer1, "N£mero de tel‚fono del proveedor" ); + break; + // Fax + case 13: + sprintf ( buffer1, "Fax o segundo tel‚fono del proveedor" ); + break; + case 14: + sprintf ( buffer1, "Breves notas sobre el proveedor" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* EditItemProv *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemProv( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasProv( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + case 4: + sprintf ( buffer, "%lu", SProv.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SProv.CodigoR = atol( buffer ); + MuestraProv( 0, linea, NORMAL ); + MuestraProv( 4, linea, NORMAL ); + break; + // Nombre del proveedor +// case 1: + case 6: + strcpy ( buffer, SProv.Proveedor ); + if ( !( InputCadenaG( buffer, 0, 29, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Proveedor, buffer ); + MuestraProv( 1, linea, NORMAL ); + MuestraProv( 6, linea, NORMAL ); + break; + // Telefono + case 2: + case 12: + sprintf ( buffer, "%s", SProv.Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Telefono1, buffer ); + MuestraProv( 2, linea, NORMAL ); + MuestraProv( 12, linea, NORMAL ); + break; + // Fax + case 3: + case 13: + sprintf ( buffer, "%s", SProv.Fax ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Fax, buffer ); + MuestraProv( 3, linea, NORMAL ); + MuestraProv( 13, linea, NORMAL ); + break; + + + // CIF / NIF + case 5: + sprintf ( buffer, "%s", SProv.Cif ); + if ( !( InputCadenaG( buffer, 0, 10, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Cif, buffer ); + break; + + // Actividad proveedor + case 1: + case 7: + sprintf ( buffer, "%s", SProv.ActividadProveedor ); + if ( !( InputCadenaG( buffer, 0, 29, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.ActividadProveedor, buffer ); + break; + + // Direccion + case 8: + sprintf ( buffer, "%s", SProv.Direccion ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Direccion, buffer ); + break; + // Poblaci¢n + case 9: + sprintf ( buffer, "%s", SProv.Poblacion ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Poblacion, buffer ); + break; + // Provincia + case 10: + sprintf ( buffer, "%s", SProv.Provincia ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SProv.Provincia, buffer ); + break; + // C¢digo Postal + case 11: + sprintf ( buffer, "%lu", SProv.CodPost ); + if ( !( InputCadenaG( buffer, 0, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SProv.CodPost = atol ( buffer ); + break; + // Comentario + case 14: + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + EditComentario( (char *)(&SProv.Notas[0][0]), 3, 37, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1, 14 ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + } + +} +#endif + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasProv *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasProv( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 264 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 98; + break; + case 1: + *X0 = 107; *X1 = 358; + break; + case 2: + *X0 = 367; *X1 = 495; + break; + case 3: + *X0 = 505; *X1 = 633; + break; + + case 4: + *X0 = 67; *Y0 = 37; + *X1 = 148; *Y1 = 58; + break; + case 5: + *X0 = 247; *Y0 = 37; + *X1 = 388; *Y1 = 58; + break; + case 6: + *X0 = 152; *Y0 = 62; + *X1 = 390; *Y1 = 83; + break; + case 7: + *X0 = 152; *Y0 = 87; + *X1 = 390; *Y1 = 108; + break; + case 8: + *X0 = 92; *Y0 = 112; + *X1 = 388; *Y1 = 133; + break; + case 9: + *X0 = 92; *Y0 = 137; + *X1 = 223; *Y1 = 158; + break; + case 10: + *X0 = 312; *Y0 = 137; + *X1 = 438; *Y1 = 158; + break; + case 11: + *X0 = 522; *Y0 = 137; + *X1 = 598; *Y1 = 158; + break; + case 12: + *X0 = 92; *Y0 = 162; + *X1 = 245; *Y1 = 183; + break; + case 13: + *X0 = 255; *Y0 = 162; + *X1 = 388; *Y1 = 183; + break; + + case 14: + *X0 = 402; *Y0 = 165; + *X1 = 633; *Y1 = 221; + break; + + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + *X0 = 90 + 30 * ( columna - 15 ); *Y0 = 190; + *X1 = *X0 + 25; *Y1 = 215; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* ProvNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ProvNuevoRegistro( INFO_PROVEEDORES *NSProv ) +{ + char i, j; + + NSProv -> CodigoR = 0; // Codigos asiignados a los proveedores + strcpy( NSProv -> Proveedor, "" ); // Nombre del proveedor + // Nombre del proveedor + strcpy( NSProv -> ActividadProveedor, "" ); + + strcpy( NSProv -> Telefono1, "" ); // Tel‚fono y fax del proveedor + strcpy( NSProv -> Fax, "" ); // + + strcpy( NSProv -> Direccion, "" ); // Direccion + strcpy( NSProv -> Numero, "" ); // Numero + + strcpy( NSProv -> Poblacion, "" ); // Poblacion + strcpy( NSProv -> Provincia, "" ); // Provincia + NSProv -> CodPost = 0; // C¢digo Postal + + NSProv -> Estrellas = 0; // Estrellas ( lo que imagina el cliente ) + + for ( i = 0; i < 12; i++ ) + for ( j = 0; j < 31; j++ ) + NSProv -> Compras[i][j] = 0; + + for ( i = 0; i < 4; i++ ) + SProv.Notas[i][0] = '\0'; + + +} + +int CompruebaPulsosEstrellas(void) +{ + char enc, i; + + enc = 0; + + for ( i=0; i < 8; i++ ) + { + if ( y_raton > 190 && y_raton < 215 && + x_raton > ( 90 + 30 * i ) && x_raton < ( 90 + 30 * i + 25 ) ) + { + if ( SProv.Estrellas & ( 0x01 << i ) ) + SProv.Estrellas -= ( 0x01 << i ); + else + SProv.Estrellas += ( 0x01 << i ); + + enc = 15 + i; + break; + } + } + + Anclar_Raton(); + + return enc; +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* BuscaProv *| +|* *| +|* Descripci¢n: *| +|* Busca una referencia por su n§ o descripcion *| +|* *| +|* Entradas: *| +|* ATRAS Busca otra coincidencia hacia atras *| +|* NUEVA_BUSQUEDA Inicia una nueva busqueda *| +|* ADELANTE Busca otra coincidencia hacia delante *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void BuscaProv( char TipoBusqueda, char *CurrRow, long *CurrProv ) +{ + static INFO_PROVEEDORES MProv; + char enc; long i; + + + switch ( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + if ( ObtenMatchProv( &MProv ) != OK ) + return; + i = 0; + break; + case ATRAS: + case ADELANTE: + i = ( *CurrRow + *CurrProv ) + TipoBusqueda; + break; + } + + Optar( ENCUADRE, "Comando: Buscar", "Ahora se inica", "la busqueda elegida", NULL ); + enc = 0; + while ( i < BProv.Registros() && !enc ) + { + if ( BProv.LeeReg( (void *)&SProv, i ) == ERROR ) + Error( 0x01, BProv.cError); + if ( Match_Prov( &SProv, &MProv ) ) + enc = 1; + else + i++; + } + + Optar( ENCUADRE, NULL ); + + if ( enc ) + { + *CurrRow = 0; *CurrProv = i; + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosProv( *CurrRow + *CurrProv ); + if ( BProv.LeeReg( (void *)&SProv, *CurrProv ) == ERROR ) + Error(0x01, BProv.cError); + MuestraDatosVProv( *CurrRow ); + } else + switch( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + case ATRAS: + case ADELANTE: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + } + + if ( BProv.LeeReg( (void *)&SProv, (*CurrRow + *CurrProv) ) == ERROR ) + Error( 0x01, BProv.cError); + + +} + + /**************************************************************************\ +|* *| +|* Match_Prov *| +|* *| +|* Descripci¢n: *| +|* Compara dos registros y devuelve la posible coincidencia *| +|* *| +|* Entradas: *| +|* Registros a comparar *| +|* *| +|* Salidas: *| +|* Resultado de la comparaci¢n *| +|* *| + \**************************************************************************/ +int Match_Prov( INFO_PROVEEDORES *A, INFO_PROVEEDORES *B ) +{ + if ( B -> CodigoR != 0 ) + return (A -> CodigoR == B -> CodigoR); + if ( B -> Proveedor[0] != '\0' ) + return ( strncmpi( A -> Proveedor, B -> Proveedor, strlen( B -> Proveedor ) ) == 0 ); + if ( B -> Direccion[0] != '\0' ) + return ( strncmpi( A -> Direccion, B -> Direccion, strlen( B -> Direccion ) ) == 0 ); + if ( B -> Telefono1[0] != '\0' ) + return ( strncmpi( A -> Telefono1, B -> Telefono1, strlen( B -> Telefono1 ) ) == 0 ); + + return 0; +} + + /**************************************************************************\ +|* *| +|* ObtenMatchProv *| +|* *| +|* Descripci¢n: *| +|* Obtine los patrones de busqueda necesarios *| +|* *| +|* Entradas: *| +|* Estructura donde guardar el patron de busqueda *| +|* *| +|* Salidas: *| +|* OK La entrada es correcta *| +|* ERROR El usuario interrumpio la busqueda *| +|* *| + \**************************************************************************/ +int ObtenMatchProv( INFO_PROVEEDORES *MProv ) +{ + char Row, ok, i; + int BPush, key, DEV; + struct textsettingstype texttypeinfo; + + gettextsettings( &texttypeinfo ); + + Optar( ENCUADRE, "Comando: Buscar", NULL ); + Imprime_Estaticos( 31, "systm\\tpv.img" ); + + ok = 0; Row = 0; + + ProvNuevoRegistro( MProv ); + + do + { + MatchDrawProv(Row, *MProv, INTENSO); + BPush = Comprueba_Secuencia( SEC_OPTAR, NULL ); + MatchDrawProv(Row, *MProv, NORMAL); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + case -2: + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditMatchProv( Row, MProv ); + for ( i=0; i < 4; i++ ) + MatchDrawProv(i, *MProv, NORMAL); + break; + case -1: + switch ( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + Row--; if ( Row < 0 ) Row = 3; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + Row++; if ( Row > 4 ) Row = 0; + break; + } + break; + case 1: + DEV = OK; ok = 1; + break; + case 2: + DEV = ERROR; ok = 1; + break; + } + + } while ( !ok ); + + Optar( ENCUADRE, NULL ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + return DEV; + +} + + /**************************************************************************\ +|* *| +|* EditMatchProv *| +|* *| +|* Descripci¢n: *| +|* Edita el patron de busqueda *| +|* *| +|* Entradas: *| +|* Campo a editar, y lugar donde almacenarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditMatchProv( char Row, INFO_PROVEEDORES * MProv ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchProv( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, "%lu", MProv -> CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + ProvNuevoRegistro( MProv ); + MProv -> CodigoR = atol(buffer); + } + break; + case 1: + sprintf( buffer, "%s", MProv -> Proveedor ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + ProvNuevoRegistro( MProv ); + strcpy ( MProv -> Proveedor, buffer ); + } + break; + case 2: + sprintf( buffer, "%s", MProv -> Direccion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + ProvNuevoRegistro( MProv ); + strcpy ( MProv -> Direccion, buffer ); + } + break; + case 3: + sprintf( buffer, "%s", MProv -> Telefono1 ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + ProvNuevoRegistro( MProv ); + strcpy ( MProv -> Telefono1, buffer ); + } + break; + } + + + +} + + /**************************************************************************\ +|* *| +|* MatchDrawProv *| +|* *| +|* Descripci¢n: *| +|* Escribe los distintos campos seg£n se le indique *| +|* *| +|* Entradas: *| +|* Campo a mostrar, lugar donde se encuentra, y como mostrarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MatchDrawProv( char Row, INFO_PROVEEDORES MProv, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatchProv( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, " %9lu", MProv.CodigoR ); + break; + case 1: + strncpy( buffer, MProv.Proveedor, 25 ); + buffer[26] = '\0'; + break; + case 2: + strncpy( buffer, MProv.Direccion, 25 ); + buffer[26] = '\0'; + break; + case 3: + strncpy( buffer, MProv.Telefono1, 15 ); + buffer[15] = '\0'; + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* MatchDrawProv *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas relativas al campo dado. *| +|* *| +|* Entradas: *| +|* Campo a obtener las coordenadas, y coordenadas de salida *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasMatchProv( char Row, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + switch( Row ) + { + case 0: + *X0 = 265; *X1 = 365; + *Y0 = 200; *Y1 = 220; + break; + case 1: + *X0 = 265; *X1 = 465; + *Y0 = 225; *Y1 = 245; + break; + case 2: + *X0 = 265; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 3: + *X0 = 265; *X1 = 465; + *Y0 = 280; *Y1 = 305; + break; + case 4: + *X0 = 385; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 5: + *X0 = 330; *X1 = 365; + *Y0 = 275; *Y1 = 300; + break; + } + + (*X0) ++; (*Y0) ++; + (*X1) --; (*Y1) --; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresiones *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesProv(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 22, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + + ImprimeProveedores( dev ); + + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeProveedores *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeProveedores( char como ) +{ + long i, old_reg; + + + FILE *file_out; + + old_reg = BProv.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraProv(como, file_out); + + for ( i=0; i +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_REF 15 + + +BDatos BRef; // Base de datos de Referencias +INFO_PRODUCTOS SRef; // Estructura de referencias + + // Empresa a la que se le realizan las gestiones +extern char EmpresaActual[9]; + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void ReinicializarStock( void ); +void MuestraDatosVRef( int linea); +void MuestraDatosRef( long RowStart ); +void MuestraAyudaRef( char columna ); +void EditItemRef( char columna, int linea ); +void RefNuevoRegistro( INFO_PRODUCTOS *MSRef ); +void MuestraRef( char columna, int linea, char como ); +void ObtenCoordenadasRef( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de Busqueda de Productos | +| | + \*************************************/ +void ObtenCoordenadasMatch( char Row, int *X0, int *Y0, int *X1, int *Y1 ); +void MatchDrawRef( char Row, INFO_PRODUCTOS MRef, char como ); +int BuscaRef( char TipoBusqueda, char *CurrRow, long *CurrRef ); +int Match_Ref( INFO_PRODUCTOS A, INFO_PRODUCTOS B ); +void EditMatchRef( char Row, INFO_PRODUCTOS * MRef ); +int ObtenMatchRef( INFO_PRODUCTOS *MRef ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void MuestraImpresionesRed( void ); +void ImprimeReferencias( char como ); +void ImprimeCabeceraRef( char como, FILE *file_out ); + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + /**************************************************************************\ +|* *| +|* InfoProducto *| +|* *| +|* Descripci¢n: *| +|* Controla la introduccion de datos y muestreo asi como todo *| +|* el interfaz de usuario... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoProductos(void) +{ + char buffer[100], ok = 0; + int BPush, key; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrRef; // Producto sobre el que estamos posicionados a golpes + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 20, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + sprintf( buffer, "datos\\%s\\info_ref.dbf", NEmpresa ); + if ( BRef.AbrirReg( buffer, sizeof( INFO_PRODUCTOS ) ) == ERROR ) + Error( 1, BRef.cError); + + // Si no hay registros, creamos uno almenos. + if ( BRef.Registros() == 0 ) + { + RefNuevoRegistro( &SRef ); + if ( BRef.InsReg( (void *)&SRef, BRef.Registros(), ARRIBA ) == ERROR ) + Error( 1, BRef.cError); + } + + CurrRef = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, 0 ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + + CurrCol = 0; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaRef( CurrCol ); + } + + MuestraRef( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraRef( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditItemRef( CurrCol, CurrRow ); + if ( BRef.EscribeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + MuestraRef( CurrCol, CurrRow, NORMAL ); + CurrCol++; if ( CurrCol > 20 ) CurrCol = 20; + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 20; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 20 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( CurrCol >= 7 && CurrCol < 21 ) + { + CurrCol--; if ( CurrCol < 7 ) CurrCol = 7; + } else { + if ( (CurrRow + CurrRef) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_REF - 1; CurrRef -= NLINEAS_REF; + if ( CurrRef < 0 ) CurrRef = 0; + + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRef > 0 ) CurrRef++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } + break; + // Flecha Abajo + case 80: + if ( CurrCol >= 7 && CurrCol < 21 ) + { + CurrCol++; if ( CurrCol > 20 ) CurrCol = 20; + } else { + if ( ( CurrRow + CurrRef ) < BRef.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_REF - 1 ) + { + CurrRow = 0; CurrRef += NLINEAS_REF; + + while ( (CurrRef + CurrRow) >= BRef.Registros() ) CurrRef--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + } else + CurrRow++; + } + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrRef != 0 ) + { + CurrRef = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrRef != BRef.Registros() - NLINEAS_REF ) + { + CurrRef = BRef.Registros() - NLINEAS_REF; + if ( CurrRef < 0 ) + { + CurrRef = 0; + CurrRow = BRef.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + + break; + + } + break; + // Imprimir Referencias + case 1: + MuestraImpresionesRed(); + break; + // Menu Principal + case 2: + ok = 1; + break; +#ifndef DEMOSTRACION + // Eliminar + case 3: + if ( Optar( 1, "ATENCION", "Eliminar una Ref. provocar ", "la eliminaci¢n de su stock", "y enlaces antiguos...", NULL ) ) + { + if ( BRef.DelReg( CurrRef + CurrRow ) == ERROR ) + Error( 1, BRef.cError); + if ( BRef.Registros() == 0 ) + { + RefNuevoRegistro( &SRef ); + if ( BRef.InsReg( (void *)&SRef, BRef.Registros(), ARRIBA ) == ERROR ) + Error( 1, BRef.cError); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrRef+CurrRow) >= ( BRef.Registros() - 2 ) ) + { + if ( (CurrRow + CurrRef) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_REF - 1; CurrRef -= NLINEAS_REF; + if ( CurrRef < 0 ) CurrRef = 0; + + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRef > 0 ) CurrRef++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } + break; + // Insertar + case 4: + RefNuevoRegistro( &SRef ); + if ( BRef.InsReg( (void *)&SRef, (CurrRef + CurrRow), ARRIBA ) == ERROR ) + Error( 1, BRef.cError); + if ( ( CurrRow + CurrRef ) < BRef.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_REF - 1 ) + { + CurrRow = 0; CurrRef += NLINEAS_REF; + + while ( (CurrRef + CurrRow) >= BRef.Registros() ) CurrRef--; + + } else + CurrRow++; + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + + break; +#else + // Insertar//Eliminar + case 3: + case 4: + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten eliminar ni insertar", "nuevos registros...", NULL ); + break; +#endif + + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_REF - 1; CurrRef -= NLINEAS_REF; + if ( CurrRef < 0 ) CurrRef = 0; + + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRef > 0 ) CurrRef++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); +#endif + break; + // Busqueda Atras + case 6: + if ( BuscaRef( ATRAS, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + break; + // Buscar + case 7: + if ( BuscaRef( NUEVA_BUSQUEDA, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + break; + // Busqueda Adelante + case 8: + if ( BuscaRef( ADELANTE, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrRef += NLINEAS_REF; + + while ( (CurrRef + CurrRow) >= BRef.Registros() ) CurrRef--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); +#endif + break; + // Poner a cero el stock + case 10: +#ifndef DEMOSTRACION + if ( Optar( 1, "Reinicializar Stock", "Atenci¢n esta apunto de", "borrar todo el stock, desea", "seguir con la operaci¢n ?", NULL ) ) + { + + ReinicializarStock(); + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( CurrRow ); + } +#else + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permiten reinicializar el", "el stock, de forma autom tica", NULL ); +#endif + break; + + default: + break; + } + + } while( !ok ); + + BRef.CerrarReg(); +} + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* ReinicializarStock *| +|* *| +|* Descripci¢n: *| +|* Recorre toda la base de datos, poniendo el stock a cero. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ReinicializarStock( void ) +{ + long RegStk; + + for ( RegStk=0; RegStk < BRef.Registros(); RegStk++ ) + { + BRef.LeeReg( (void *)&SRef, RegStk ); + SRef.Stock = 0; + BRef.EscribeReg( (void *)&SRef, RegStk ); + } + +} +#endif + + /**************************************************************************\ +|* *| +|* MuestraDatosRef *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosRef( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_REF que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_REF && dev == OK; linea++ ) + { + dev = BRef.LeeReg( (void *)&SRef, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 6 campos, ehhh!!! + for ( campo=0; campo < 7; campo++ ) + MuestraRef( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) + { + linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_REF; linea++ ) + for ( campo=0; campo < 7; campo++ ) + { + ObtenCoordenadasRef( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + +void MuestraDatosVRef( int linea ) +{ + int campo; + + // Mostramos los campos que faltan, ( 1¦ Linea ) + for ( campo=7; campo < 21; campo++ ) + MuestraRef( campo, linea, NORMAL ); + +} + + /**************************************************************************\ +|* *| +|* MuestraRef *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraRef( char columna, int linea, char como ) +{ + char buffer[80]; + char buffer1[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasRef( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, " %09lu", SRef.CodigoR ); + break; + // Nombre del producto + case 1: + sprintf ( buffer, "%30s", SRef.Descripcion ); + break; + // Cantidad por unidad + case 2: + formatea_u_long( (unsigned long)SRef.CantUnitaria, buffer1 ); + sprintf ( buffer, "%4s", buffer1 ); + break; + // Precio de costo + case 3: + formatea_u_long( (unsigned long)SRef.PrecioCosto, buffer1 ); + sprintf ( buffer, "%6s", buffer1 ); + break; + // Precio V. P. + case 4: + formatea_u_long( (unsigned long)SRef.PrecioVenta[0], buffer1 ); + sprintf ( buffer, "%6s", buffer1 ); + break; +// þþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþ + // IVA Asociado + case 5: + sprintf ( buffer, "%2d", SRef.Categoria ); + break; + + // Stock actual del producto + case 6: + formatea_long( (long)SRef.Stock, buffer1 ); + sprintf ( buffer, "%7s", buffer1 ); + break; + // Codigos asociados + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + sprintf ( buffer, " %09ld", SRef.CodigosAsociados[columna-7] ); + break; + // Precios de venta segun horarios. + case 17: + case 18: + case 19: + case 20: + formatea_u_long( (unsigned long)SRef.PrecioVenta[columna - 17 + 1], buffer1 ); + sprintf ( buffer, "%6s", buffer1 ); + break; + } + + if ( columna <= 6 && SRef.Categoria == 99 && SRef.PrecioCosto == 0 && SRef.PrecioVenta[0] == 0 ) + if ( como == NORMAL ) como = INTENSO; else como = NORMAL; + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaRef *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaRef( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer1, "Introduzca el codigo que desea asignar al producto" ); + break; + // Nombre del producto + case 1: + sprintf ( buffer1, "Nombre para el producto" ); + break; + // Cantidad por unidad + case 2: + sprintf ( buffer1, "Unidades que trae cada producto, al adquirirlo" ); + break; + // Precio de costo + case 3: + sprintf ( buffer1, "Precio de costo por unidad ( la que sera vendida )" ); + break; + // Precio V. P. + case 4: + sprintf ( buffer1, "Precio de venta por unidad ( la que sera vendida )" ); + break; + // IVA Asociado + case 5: + sprintf ( buffer1, "I.V.A Asociado al proucto" ); + break; + + // Stock actual del producto + case 6: + sprintf ( buffer1, "Stock actual de ese producto" ); + break; + // Codigos asociados + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + sprintf ( buffer1, "Codigo asociado ( para los combinados )" ); + break; + // Precios de venta segun horarios. + case 17: + case 18: + case 19: + case 20: + sprintf ( buffer1, "Precios especiales por horario." ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemRef *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemRef( char columna, int linea ) +{ + char buffer[80]; + char old; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasRef( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, "%lu", SRef.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.CodigoR = atol( buffer ); + + break; + // Nombre del producto + case 1: + strcpy ( buffer, SRef.Descripcion ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SRef.Descripcion, buffer ); + break; + // Cantidad por unidad + case 2: + sprintf ( buffer, "%u", SRef.CantUnitaria ); + if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.CantUnitaria = atoi( buffer ); + break; + // Precio de costo + case 3: + sprintf ( buffer, "%ld", SRef.PrecioCosto ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.PrecioCosto = atol( buffer ); + break; + // Precio V. P. + case 4: + sprintf ( buffer, "%ld", SRef.PrecioVenta[0] ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + SRef.PrecioVenta[0] = atol( buffer ); + SRef.PrecioVenta[1] = SRef.PrecioVenta[0]; + SRef.PrecioVenta[2] = SRef.PrecioVenta[0]; + SRef.PrecioVenta[3] = SRef.PrecioVenta[0]; + SRef.PrecioVenta[4] = SRef.PrecioVenta[0]; + MuestraRef( 16, 0, NORMAL ); + MuestraRef( 17, 0, NORMAL ); + MuestraRef( 18, 0, NORMAL ); + MuestraRef( 19, 0, NORMAL ); + } + break; + +// þþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþ + // IVA Asociado + case 5: + old = SRef.Categoria; + sprintf ( buffer, "%d", (int)SRef.Categoria ); + if ( !( InputCadenaG( buffer, 1, 2, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + SRef.Categoria = (int)atoi( buffer ); + + if ( SRef.Categoria == 99 || ( old == 99 && SRef.Categoria != 99 ) ) + for ( columna = 0; columna <= 6; columna++ ) + MuestraRef( columna, linea, NORMAL ); + } + break; + + // Stock actual del producto + case 6: + sprintf ( buffer, "%ld", SRef.Stock ); + if ( !( InputCadenaG( buffer, 1, 6, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.Stock = atol( buffer ); + break; + // Codigos asociados + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + sprintf ( buffer, "%lu", SRef.CodigosAsociados[columna-7] ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.CodigosAsociados[columna-7] = atol( buffer ); + // Buscamos por todos los codigos asiciados para ver si alguno + // es distinto de cero, con lo que se activaria el combinado.. + SRef.Combinado = 0; + for ( columna = 0; columna < 10; columna++ ) + if ( SRef.CodigosAsociados[columna] != 0 ) + { + SRef.Combinado = 1; + break; + } + break; + // Precios de venta segun horarios. + case 17: + case 18: + case 19: + case 20: + sprintf ( buffer, "%lu", SRef.PrecioVenta[columna-17 + 1 ] ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SRef.PrecioVenta[columna-17 + 1 ] = atol( buffer ); + break; + } + +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasRef *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasRef( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 164 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + // C¢digo + case 0: +// *X0 = 7; *X1 = 98; + *X0 = 7; *X1 = 95; + break; + // Nombre Articulo + case 1: +// *X0 = 107; *X1 = 358; + *X0 = 104; *X1 = 355; + break; + // UNDs + case 2: +// *X0 = 367; *X1 = 403; + *X0 = 364; *X1 = 403; + break; + // P.C. + case 3: + *X0 = 412; *X1 = 466; + break; + // P.V.P. + case 4: + *X0 = 476; *X1 = 529; + break; + + // IVA Asociado + case 5: + *X0 = 538; *X1 = 563; + break; + + // Stock Actual + case 6: + *X0 = 572; *X1 = 633; + break; + + // Codigos asociados + case 7: + case 8: + case 9: + case 10: + case 11: + *X0 = 37; *Y0 = 11 + 22*(columna-7); + *X1 = 128; *Y1 = *Y0 + 20; + break; + case 12: + case 13: + case 14: + case 15: + case 16: + *X0 = 137; *Y0 = 11 + 22*(columna-12); + *X1 = 228; *Y1 = *Y0 + 20; + break; + // Hora 2 + case 17: + *X0 = 301; *Y0 = 13; + *X1 = 359; *Y1 = 27; + break; + // Hora 3 + case 18: + *X0 = 301; *Y0 = 38; + *X1 = 359; *Y1 = 52; + break; + // Hora 4 + case 19: + *X0 = 301; *Y0 = 63; + *X1 = 359; *Y1 = 77; + break; + // Hora 5 + case 20: + *X0 = 301; *Y0 = 88; + *X1 = 359; *Y1 = 102; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* RefNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void RefNuevoRegistro( INFO_PRODUCTOS *NSRef ) +{ + int i; + + NSRef -> Categoria = 0; // Otros, Refresco, Tapas, Barriles... + + NSRef -> CodigoR = 0; // Codigo real del producto + NSRef -> CodigoB = 0; // Codigo de barras asociado al producto + + NSRef -> Descripcion[0] = '\0'; // Nombre del Producto + + NSRef -> CantUnitaria = 1; // # de productos por unidad + + NSRef -> PrecioCosto = 0; // Precio de costo + for ( i=0; i< 5; i++ ) // P.V.P seg£n horas definidas por el usuario... + NSRef -> PrecioVenta[i] = 0; + + NSRef -> Stock = 0; // # de productos actualmente + + // Codigos asociados a este producto ( COMBINADOS ) + for ( i=0; i<10; i++ ) + NSRef -> CodigosAsociados[i] = 0; + + NSRef -> Combinado = 0; + +} + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* BuscaRef *| +|* *| +|* Descripci¢n: *| +|* Busca una referencia por su n§ o descripcion *| +|* *| +|* Entradas: *| +|* ATRAS Busca otra coincidencia hacia atras *| +|* NUEVA_BUSQUEDA Inicia una nueva busqueda *| +|* ADELANTE Busca otra coincidencia hacia delante *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int BuscaRef( char TipoBusqueda, char *CurrRow, long *CurrRef ) +{ + static INFO_PRODUCTOS MRef; + char enc; long i; + + + switch ( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + if ( ObtenMatchRef( &MRef ) != OK ) + return ERROR; + i = 0; + break; + case ATRAS: + case ADELANTE: + i = ( *CurrRow + *CurrRef ) + TipoBusqueda; + break; + } + + Optar( ENCUADRE, "Comando: Buscar", "Ahora se inica", "la busqueda elegida", NULL ); + enc = 0; + while ( i < BRef.Registros() && !enc ) + { + if ( BRef.LeeReg( (void *)&SRef, i ) == ERROR ) + Error( 1, BRef.cError); + if ( Match_Ref( SRef, MRef ) ) + enc = 1; + else + i++; + } + + Optar( ENCUADRE, NULL ); + + if ( enc ) + { + *CurrRow = 0; *CurrRef = i; +/* + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef( *CurrRow + *CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, *CurrRef ) == ERROR ) + Error( 1, BRef.cError); + MuestraDatosVRef( *CurrRow ); +*/ + } else + switch( TipoBusqueda ) + { + case NUEVA_BUSQUEDA: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + case ATRAS: + case ADELANTE: + Optar( 0, "Comando: Buscar", "No se encontr¢", "ninguna coincidencia", NULL ); + break; + } + +/* + if ( BRef.LeeReg( (void *)&SRef, (*CurrRow + *CurrRef) ) == ERROR ) + Error( 1, BRef.cError); +*/ + + return ( enc ? OK : ERROR ); +} + + /**************************************************************************\ +|* *| +|* Match_Ref *| +|* *| +|* Descripci¢n: *| +|* Compara dos registros y devuelve la posible coincidencia *| +|* *| +|* Entradas: *| +|* Registros a comparar *| +|* *| +|* Salidas: *| +|* Resultado de la comparaci¢n *| +|* *| + \**************************************************************************/ +int Match_Ref( INFO_PRODUCTOS A, INFO_PRODUCTOS B ) +{ + if ( B.CodigoR != 0 ) + return (A.CodigoR == B.CodigoR); + if ( B.CodigoB != 0 ) + return (A.CodigoB == B.CodigoB); + if ( B.Descripcion[0] != '\0' ) + return ( strncmpi( A.Descripcion, B.Descripcion, strlen( B.Descripcion ) ) == 0 ); + if ( B.PrecioCosto != 0 ) + return (B.PrecioCosto == A.PrecioCosto); + if ( B.PrecioVenta[0] != 0 ) + return (B.PrecioVenta[0] == A.PrecioVenta[0]); + if ( B.Combinado != 0 ) + return ( A.Combinado ); + + return 0; +} + + /**************************************************************************\ +|* *| +|* ObtenMatchRef *| +|* *| +|* Descripci¢n: *| +|* Obtine los patrones de busqueda necesarios *| +|* *| +|* Entradas: *| +|* Estructura donde guardar el patron de busqueda *| +|* *| +|* Salidas: *| +|* OK La entrada es correcta *| +|* ERROR El usuario interrumpio la busqueda *| +|* *| + \**************************************************************************/ +int ObtenMatchRef( INFO_PRODUCTOS *MRef ) +{ + char Row, ok, i; + int BPush, key, DEV; + struct textsettingstype texttypeinfo; + + gettextsettings( &texttypeinfo ); + + Optar( ENCUADRE, "Comando: Buscar", NULL ); + Imprime_Estaticos( 21, "systm\\tpv.img" ); + + ok = 0; Row = 0; + + RefNuevoRegistro( MRef ); + + do + { + MatchDrawRef(Row, *MRef, INTENSO); + BPush = Comprueba_Secuencia( SEC_OPTAR, NULL ); + MatchDrawRef(Row, *MRef, NORMAL); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + case -2: + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); + EditMatchRef( Row, MRef ); + for ( i=0; i < 6; i++ ) + MatchDrawRef(i, *MRef, NORMAL); + break; + case -1: + switch ( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + Row--; if ( Row < 0 ) Row = 5; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + Row++; if ( Row > 5 ) Row = 0; + break; + } + break; + case 1: + DEV = OK; ok = 1; + break; + case 2: + DEV = ERROR; ok = 1; + break; + } + + } while ( !ok ); + + Optar( ENCUADRE, NULL ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + return DEV; + +} + + /**************************************************************************\ +|* *| +|* EditMatchRef *| +|* *| +|* Descripci¢n: *| +|* Edita el patron de busqueda *| +|* *| +|* Entradas: *| +|* Campo a editar, y lugar donde almacenarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditMatchRef( char Row, INFO_PRODUCTOS * MRef ) +{ + int X0, Y0, X1, Y1; + char buffer[80]; + + ObtenCoordenadasMatch( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, "%lu", MRef -> CodigoR ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + RefNuevoRegistro( MRef ); + MRef -> CodigoR = atol(buffer); + } + break; + case 1: + sprintf( buffer, "%lu", MRef -> CodigoB ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + RefNuevoRegistro( MRef ); + MRef -> CodigoB = atol(buffer); + } + break; + case 2: + strcpy( buffer, MRef -> Descripcion ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + RefNuevoRegistro( MRef ); + strcpy ( MRef -> Descripcion, buffer ); + } + break; + case 3: + sprintf ( buffer, "%ld", MRef -> PrecioCosto); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + RefNuevoRegistro( MRef ); + MRef -> PrecioCosto = atol(buffer); + } + break; + case 4: + sprintf ( buffer, "%lu", MRef -> PrecioVenta[0] ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + { + RefNuevoRegistro( MRef ); + MRef -> PrecioCosto = atol(buffer); + } + break; + case 5: + MRef -> Combinado = !(MRef -> Combinado); + break; + } + + + +} + + /**************************************************************************\ +|* *| +|* MatchDrawRef *| +|* *| +|* Descripci¢n: *| +|* Escribe los distintos campos seg£n se le indique *| +|* *| +|* Entradas: *| +|* Campo a mostrar, lugar donde se encuentra, y como mostrarlo *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MatchDrawRef( char Row, INFO_PRODUCTOS MRef, char como ) +{ + int X0, Y0, X1, Y1; + char buffer[80], buffer1[80]; + + ObtenCoordenadasMatch( Row, &X0, &Y0, &X1, &Y1 ); + + switch( Row ) + { + case 0: + sprintf( buffer, " %9lu", MRef.CodigoR ); + break; + case 1: + sprintf( buffer, " %9lu", MRef.CodigoB ); + break; + case 2: + strncpy( buffer, MRef.Descripcion, 25 ); + buffer[26] = '\0'; + break; + case 3: + formatea_u_long( (unsigned long)MRef.PrecioCosto, buffer1 ); + sprintf ( buffer, "%6s", buffer1 ); + break; + case 4: + formatea_u_long( (unsigned long)MRef.PrecioVenta[0], buffer1 ); + sprintf ( buffer, "%6s", buffer1 ); + break; + case 5: + sprintf( buffer, "%s", MRef.Combinado ? "ÛÛÛ" : "" ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + +} + + /**************************************************************************\ +|* *| +|* MatchDrawRef *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas relativas al campo dado. *| +|* *| +|* Entradas: *| +|* Campo a obtener las coordenadas, y coordenadas de salida *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasMatch( char Row, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + switch( Row ) + { + case 0: + *X0 = 260; *X1 = 360; + *Y0 = 200; *Y1 = 220; + break; + case 1: + *X0 = 365; *X1 = 465; + *Y0 = 200; *Y1 = 220; + break; + case 2: + *X0 = 260; *X1 = 465; + *Y0 = 225; *Y1 = 245; + break; + case 3: + *X0 = 235; *X1 = 315; + *Y0 = 250; *Y1 = 275; + break; + case 4: + *X0 = 385; *X1 = 465; + *Y0 = 250; *Y1 = 275; + break; + case 5: + *X0 = 330; *X1 = 365; + *Y0 = 275; *Y1 = 300; + break; + } + + (*X0) ++; (*Y0) ++; + (*X1) --; (*Y1) --; + +} + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* MuestraImpresionesRed *| +|* *| +|* Descripci¢n: *| +|* Muestra un cuadro con las distintas opciones de impresi¢n *| +|* *| +|* Entradas:(ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraImpresionesRed(void) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 22, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + + ImprimeReferencias( dev ); + + } + +} + + + /**************************************************************************\ +|* *| +|* ImprimeReferencias *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeReferencias( char como ) +{ + long i, old_reg; + char buffer[80]; + int j; + FILE *file_out; + + old_reg = BRef.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + ImprimeCabeceraRef( como, file_out ); + + for ( i=0; i +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" + +#define NLINEAS_REF 15 + + +extern BDatos BRef; // Base de datos de Referencias +extern INFO_PRODUCTOS SRef; // Estructura de referencias + + // Empresa a la que se le realizan las gestiones +extern char EmpresaActual[9]; + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void MuestraDatosRef2( long RowStart ); +void MuestraAyudaRef2( char columna ); +void MuestraRef2( char columna, int linea, char como ); +void ObtenCoordenadasRef2( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + /*************************************\ +| | +| Parte Secundaria del M¢dulo | +| | +| Secci¢n de Busqueda de Productos | +| | + \*************************************/ +extern void ObtenCoordenadasMatch( char Row, int *X0, int *Y0, int *X1, int *Y1 ); +extern int BuscaRef( char TipoBusqueda, char *CurrRow, long *CurrRef ); +extern void MatchDrawRef( char Row, INFO_PRODUCTOS MRef, char como ); +extern int Match_Ref( INFO_PRODUCTOS A, INFO_PRODUCTOS B ); +extern void EditMatchRef( char Row, INFO_PRODUCTOS * MRef ); +extern int ObtenMatchRef( INFO_PRODUCTOS *MRef ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para la impresi¢n | +| | + \*************************************/ +void ImprimeStockActual(); +int MuestraOrdenaciones( void ); +int Ordenar( const void *A, const void *B ); + +char TIPO_ORDENACION; + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + + + /**************************************************************************\ +|* *| +|* InfoProducto *| +|* *| +|* Descripci¢n: *| +|* Controla la introduccion de datos y muestreo asi como todo *| +|* el interfaz de usuario... *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InfoStock(void) +{ + char buffer[100], ok = 0; + char buffer1[40]; + int BPush; + + char oldCol = -1; + char CurrRow; // Linea sobre la que estamos + char CurrCol; // Columna sobre la que estamos + long CurrRef; // Producto sobre el que estamos posicionados a golpes + unsigned long BenefTt,// Beneficio total ( de todos los productos ) -1- + CostoTt,// Costo total -2- + TtBruto;// Total bruto -3- + char SumaMostrar = 1;// ----------- Suma a mostrar, de las anteriores. + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); bar( 0, 0, 640, 480 ); + Imprime_Estaticos( 23, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + sprintf( buffer, "datos\\%s\\info_ref.dbf", NEmpresa ); + if ( BRef.AbrirReg( buffer, sizeof( INFO_PRODUCTOS ) ) == ERROR ) + Error( 1, BRef.cError); + + // Si no hay registros, creamos uno almenos. + if ( BRef.Registros() == 0 ) + { + Optar( 0, "Atencion !!!", "No existen referencias", "por lo tanto, no hay", "stock que evaluar...", NULL ); + return; + } + + // Recopilamos los datos sobre el Total de Beneficio, Costo, Bruto + BenefTt = CostoTt = TtBruto = 0; + for ( CurrRef = 0; CurrRef < BRef.Registros(); CurrRef++ ) + { + if ( BRef.LeeReg( (void *)&SRef, CurrRef ) == ERROR ) + break; + if ( !SRef.Combinado ) + { + BenefTt += (long)( ( SRef.PrecioVenta[0] - SRef.PrecioCosto ) * SRef.Stock ); + CostoTt += (long)( ( SRef.PrecioCosto ) * SRef.Stock ); + TtBruto += (long)( ( SRef.PrecioVenta[0] ) * SRef.Stock ); + } else { + if ( SRef.CantUnitaria != 0 ) + { + BenefTt += (long)( (float)( ( SRef.PrecioVenta[0] - SRef.PrecioCosto ) * ( (float)SRef.Stock / (float)SRef.CantUnitaria ) ) ); + CostoTt += (long)( (float)( ( SRef.PrecioCosto ) * ( (float)SRef.Stock / (float)SRef.CantUnitaria ) ) ); + TtBruto += (long)( (float)( ( SRef.PrecioVenta[0] ) * ( (float)SRef.Stock / (float)SRef.CantUnitaria ) ) ); + } + } + } + // Mostramos los datos anteriormente recopilados + setfillstyle( SOLID_FILL, Config.TxtBgN ); + setcolor( Config.TxtFgN ); + bar( 506, 456, 634, 474 ); + formatea_u_long( BenefTt, buffer1); + sprintf( buffer, "Benef: %13s", buffer1); + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + outtextxy( 510, 458, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + + CurrRef = 0; CurrRow = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, 0 ) == ERROR ) + Error( 1, BRef.cError); + CurrCol = 0; + + do { + if ( CurrCol != oldCol || CurrCol == 2 ) + { + oldCol = CurrCol; MuestraAyudaRef2( CurrCol ); + } + + MuestraRef2( CurrCol, CurrRow, INTENSO ); + BPush = Comprueba_Secuencia( 2, NULL ); + MuestraRef2( CurrCol, CurrRow, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 4; + break; + // Flecha Derecha + case 77: + case 9: + CurrCol++; if ( CurrCol > 4 ) CurrCol = 0; + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrRef) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_REF - 1; CurrRef -= NLINEAS_REF; + if ( CurrRef < 0 ) CurrRef = 0; + + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRef > 0 ) CurrRef++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + break; + // Flecha Abajo + case 80: + if ( ( CurrRow + CurrRef ) < BRef.Registros() - 1 ) + { + + if ( ( CurrRow ) >= NLINEAS_REF - 1 ) + { + CurrRow = 0; CurrRef += NLINEAS_REF; + + while ( (CurrRef + CurrRow) >= BRef.Registros() ) CurrRef--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + } else + CurrRow++; + } + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrRef != 0 ) + { + CurrRef = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrRef != BRef.Registros() - NLINEAS_REF ) + { + CurrRef = BRef.Registros() - NLINEAS_REF; + if ( CurrRef < 0 ) + { + CurrRef = 0; + CurrRow = BRef.Registros()-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + } + + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + + break; + + } + break; + // Imprimir Referencias + case 1: +#ifndef DEMOSTRACION + ImprimeStockActual(); +#else + Optar( 0, "VERSION DEMOSTRACION", "En esta versi¢n no se", "permite imprimir el Stock.", NULL ); +#endif + break; + // Menu Principal + case 2: + ok = 1; + break; + // Eliminar + case 3: + break; + // Insertar + case 4: + break; + // Retroceso R pido + case 5: +#ifndef DEMOSTRACION + CurrRow = NLINEAS_REF - 1; CurrRef -= NLINEAS_REF; + if ( CurrRef < 0 ) CurrRef = 0; + + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrRef ) >= BRef.Registros() && CurrRef > 0 ) CurrRef++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); +#endif + break; + // Busqueda Atras + case 6: + if ( BuscaRef( ATRAS, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + break; + // Buscar + case 7: + if ( BuscaRef( NUEVA_BUSQUEDA, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + break; + // Busqueda Adelante + case 8: + if ( BuscaRef( ADELANTE, &CurrRow, &CurrRef ) == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRow + CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } else { + if ( BRef.LeeReg( (void *)&SRef, (CurrRow + CurrRef) ) == ERROR ) + Error( 1, BRef.cError); + } + + break; + // AvanceR pido + case 9: +#ifndef DEMOSTRACION + CurrRow = 0; CurrRef += NLINEAS_REF; + + while ( (CurrRef + CurrRow) >= BRef.Registros() ) CurrRef--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); +#endif + break; + // Boton de uso general 1: ( ORDENACIONES ) + case 10: + if ( MuestraOrdenaciones() == OK ) + { + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosRef2( CurrRef ); + if ( BRef.LeeReg( (void *)&SRef, (CurrRef + CurrRow) ) == ERROR ) + Error( 1, BRef.cError); + } + break; + // Boton de uso general 2: ( SUMA BENEFICIOS, BRUTO, COSTO ) + case 11: + SumaMostrar = (SumaMostrar++)%3; + // Borramos y mostramos lo deseado + setfillstyle( SOLID_FILL, Config.TxtBgN ); + setcolor( Config.TxtFgN ); + bar( 506, 456, 634, 474 ); + switch( SumaMostrar ) + { + case 1: + formatea_u_long( BenefTt, buffer1 ); + sprintf( buffer, "Benef: %13s", buffer1 ); + break; + case 2: + formatea_u_long( CostoTt, buffer1 ); + sprintf( buffer, "Costo: %13s", buffer1 ); + break; + case 3: + formatea_u_long( TtBruto, buffer1 ); + sprintf( buffer, "Bruto: %13s", buffer1 ); + break; + } + settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + outtextxy( 510, 458, buffer ); + settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + break; + default: + break; + } + + } while( !ok ); + + BRef.CerrarReg(); +} + + /**************************************************************************\ +|* *| +|* MuestraOrdenaciones *| +|* *| +|* Descripci¢n: *| +|* Despliega un cuadro con las distintas posibilidades de ordenaci¢n *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int MuestraOrdenaciones( void ) +{ + void far *fondo; + struct textsettingstype texttypeinfo; + char ok, dev; + + if ( ( fondo = farmalloc ( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL ) + { + + gettextsettings( &texttypeinfo ); + getimage( 170, 165, 470, 315, fondo ); + + Imprime_Estaticos( 25, "systm\\tpv.img" ); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + ok = 0; + do { + switch( Comprueba_Secuencia( 3, NULL ) ) + { + case 0: + case -1: + case -2: + while( kbhit() ) getch(); + break; + // Cancelar + case 1: + dev = 0; + ok = 1; + break; + // Listado r pido + case 2: + dev = 1; + ok = 1; + break; + // Listado completo + case 3: + dev = 2; + ok = 1; + break; + // Codigos de barra + case 4: + dev = 3; + ok = 1; + break; + } + } while( !ok ); + + putimage( 170, 165, fondo, COPY_PUT ); + farfree( fondo ); + if ( dev != 0 ) + { + TIPO_ORDENACION = dev -1; + BRef.SortReg( Ordenar ); + return OK; + } + } + + return ERROR; +} + +int Ordenar( const void *A, const void *B ) +{ + switch( TIPO_ORDENACION ) + { + case 0: + if ( (( INFO_PRODUCTOS *)A)->CodigoR > (( INFO_PRODUCTOS *)B)->CodigoR ) return 1; + if ( (( INFO_PRODUCTOS *)A)->CodigoR < (( INFO_PRODUCTOS *)B)->CodigoR ) return -1; + return 0; + break; + case 1: + return ( strcmp( (( INFO_PRODUCTOS *)A)->Descripcion, (( INFO_PRODUCTOS *)B)->Descripcion ) ); + break; + case 2: + if ( (( INFO_PRODUCTOS *)A)->Stock > (( INFO_PRODUCTOS *)B)->Stock ) return 1; + if ( (( INFO_PRODUCTOS *)A)->Stock < (( INFO_PRODUCTOS *)B)->Stock ) return -1; + return 0; + break; + } + return 0; +} + + /**************************************************************************\ +|* *| +|* MuestraDatosRef2 *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosRef2( long RowStart ) +{ + int linea, campo; + char dev; + int X0, Y0, X1, Y1; + + // Imprimo la NLINEAS_REF que caben en la pantalla + dev = OK; + for ( linea=0; linea < NLINEAS_REF && dev == OK; linea++ ) + { + dev = BRef.LeeReg( (void *)&SRef, RowStart + linea ); + if ( dev == OK ) + // Por cada linea hay 5 campos, ehhh!!! + for ( campo=0; campo < 5; campo++ ) + MuestraRef2( campo, linea, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + if ( dev != OK ) + { + linea--; + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; linea < NLINEAS_REF; linea++ ) + for ( campo=0; campo < 5; campo++ ) + { + ObtenCoordenadasRef2( campo, linea, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } +} + + /**************************************************************************\ +|* *| +|* MuestraRef2 *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraRef2( char columna, int linea, char como ) +{ + char buffer[80], font; + char buffer1[80], buffer2[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasRef2( columna, linea, &X0, &Y0, &X1, &Y1 ); + + if ( SRef.CantUnitaria == 0 ) SRef.CantUnitaria = 1; + + font = 1; + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer, " %09lu", SRef.CodigoR ); + break; + // Nombre del producto + case 1: + sprintf ( buffer, "%30s", SRef.Descripcion ); + break; + // Stock Actual ( Cant Und ) + case 2: + if ( SRef.CantUnitaria == 1 ) + { + formatea_long( (long)( SRef.Stock ), buffer1 ); + sprintf ( buffer, "%9s", buffer1 ); + } else { + formatea_long( (long)( SRef.Stock / SRef.CantUnitaria ), buffer1 ); + formatea_long( (long)( SRef.Stock % SRef.CantUnitaria ), buffer2 ); + sprintf ( buffer, "%6s %6s", buffer1, buffer2 ); + font = 0; + } + break; + // Valoracion del Stock + case 3: + if ( !SRef.Combinado ) + formatea_long( (long)( SRef.PrecioCosto * SRef.Stock ), buffer1 ); + else + formatea_long( (long)( (float)( SRef.PrecioCosto * ( (float)SRef.Stock / (float)SRef.CantUnitaria ) ) ), buffer1 ); + + sprintf ( buffer, "%12s", buffer1 ); + font = 0; + break; + // Beneficio estimado + case 4: + if ( !SRef.Combinado ) + formatea_long( (long)( ( SRef.PrecioVenta[0] - SRef.PrecioCosto ) * SRef.Stock ), buffer1 ); + else + formatea_long( (long)( (float)( ( SRef.PrecioVenta[0] - SRef.PrecioCosto ) * ( (float)SRef.Stock / (float)SRef.CantUnitaria ) ) ), buffer1 ); + sprintf ( buffer, "%12s", buffer1 ); + font = 0; + break; + } + + if ( columna <= 6 && SRef.Categoria == 99 && SRef.PrecioCosto == 0 && SRef.PrecioVenta[0] == 0 ) + if ( como == NORMAL ) como = INTENSO; else como = NORMAL; + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + if ( font == 0 ) settextstyle( SMALL_FONT, HORIZ_DIR, 4 ); + outtextxy( X0+2, Y0, buffer ); + if ( font == 0 ) settextstyle( SMALL_FONT, HORIZ_DIR, 5 ); + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaRef2 *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaRef2( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo Real + case 0: + sprintf ( buffer1, "C¢digo del Producto" ); + break; + // Nombre del producto + case 1: + sprintf ( buffer1, "Nombre del producto" ); + break; + // Stock Actual ( desglosado ) + case 2: +// sprintf ( buffer1, "Stock Actual ( desglosado en Cajas y Unds )" ); + sprintf ( buffer1, "Stock Actual ( 1 Caja = %d Unidades )", SRef.CantUnitaria ); + break; + // Valor aproximado + case 3: + sprintf ( buffer1, "Valor aproximado del stock" ); + break; + // Beneficio Estimado + case 4: + sprintf ( buffer1, "Beneficio estimado del stock actual" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 457, buffer1 ); + +} + + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasRef2 *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasRef2( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 164 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 98; + break; + case 1: + *X0 = 107; *X1 = 358; + break; + case 2: + *X0 = 367; *X1 = 450; + break; + case 3: + *X0 = 459; *X1 = 541; + break; + case 4: + *X0 = 550; *X1 = 633; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte secundaria del m¢dulo Û +// Û Û +// Û Secci¢n de Busqueda de refecencias Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* ImprimeStockActual *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeStockActual(void) +{ + long i, old_reg; + char buffer[80]; + char buffer1[80]; + char buffer2[80]; + + FILE *file_out; + + old_reg = BRef.RegActual(); + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + + fprintf( file_out, "C¢digo Descripci¢n Stock Valoraci¢n Beneficio\n\r" ); + for ( i=0; i +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "TPV_def.h" + +#define BLANCO EGA_WHITE +#define ENCUADRE 3 +#define SEC_OPTAR 6 + +void BEEP(void); + + /**************************************************************************\ +|* *| +|* InputCadenaG *| +|* *| +|* Descripci¢n: *| +|* Edita una cadena en formato gr fico *| +|* *| +|* Entradas: *| +|* Puntero a los datos editados *| +|* 0 alfanumerico 1 numerico *| +|* longitud de la cadena (TEXTO/NUMERO) *| +|* color del texto *| +|* color de fondo *| +|* Limites de acotacion *| +|* *| +|* Salidas: (ninguna) *| +|* *| +|* *| + \**************************************************************************/ +int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1) +{ + // A todas las y les sumaba antes +RoW*12 parametro que indica la linea + + int ls; // longitud cadena + char Status = 0; + char *s1; // puntero a cadena inicial + int c, ok; + + s1 = s; // inicio cadena + + setfillstyle(SOLID_FILL, cf); + bar(X0, Y0, X1, Y1); + setcolor(cc); outtextxy( X0, Y0, s1 ); + + + ls = strlen ( s ); // Longitud de actual + + if ( ls < lmax ) { + setcolor(BLANCO); + outtextxy( X0+textwidth( s1 ), Y0, "þ"); + } + + s += ls; // se coloca en el final + + do{ + c = getch(); // obtiene tecla + + if ( c == 27 ) Status = 1; + + ok = ( c == 27 || c == 13 || c == 0); // 13 = INTRO || Especiales + + if ( c == 8 && ls > 0 && !ok ) { // 8 = Back Space + ls--; + s--; + + *s = '\0'; + + setfillstyle(SOLID_FILL, cf); + bar(X0, Y0, X1, Y1); + setcolor(cc); outtextxy( X0, Y0, s1 ); + setcolor(BLANCO); + + outtextxy( X0+textwidth( s1 ), Y0, "þ"); + setcolor(cc); + + } else { + if ( !numalp && c >= 32 && c <= 254 && ls < lmax) { + + *s++ = c; + ls++; + + *s = '\0'; + setfillstyle(SOLID_FILL, cf); + bar(X0, Y0, X1, Y1); + setcolor(cc); outtextxy( X0, Y0, s1 ); + + if ( ls < lmax ) { + setcolor(BLANCO); + outtextxy( X0+textwidth( s1 ), Y0, "þ"); + } + + + } else { + if ( numalp && isdigit(c) && ls < lmax) { + *s++ = c; + ls++; + + *s = '\0'; // Cero final + setfillstyle(SOLID_FILL, cf); + bar(X0, Y0, X1, Y1); + setcolor(cc); outtextxy( X0, Y0, s1 ); + + if ( ls < lmax ) { + setcolor(BLANCO); + outtextxy( X0+textwidth( s1 ), Y0, "þ"); + } + + + } + /*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/ + else if( c == 27 ) {*s='\0'; ok = 1; } + /*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/ + else BEEP(); + } + } + + }while(!ok); + + ok = 1; + *s = ' '; + while( ok && ls >= 0 ) { + if(*s==' ') { *s = '\0'; s--; ls--; + } else { s++; ok = 0; } + } + + *s = '\0'; + + while(kbhit()) getch(); // Vacia Buffer impidiendo falsas + // pulsaciones... + + return ( (Status<<8) + (ls&0x00FF) ); +} + +void BEEP(void) +{ + + sound(440); + delay(50); + nosound(); + +} + +void formatea_long( long Numero, char *Inter_Chg) +{ + char Buffer1[80]; + + int c; + char Nmc = 0; + + + if ( Numero < 0 ) { Numero *= -1; Nmc = 1; } + + sprintf(Buffer1, "%lu", Numero ); + + Inter_Chg[0]='\0'; + + strrev(Buffer1); + + c = strlen( Buffer1 ); + + while( c >= 3 ) + { + c -= 3; + strncat( Inter_Chg, Buffer1, 3); + + strrev(Buffer1); + + Buffer1[c] = '\0'; + + strrev(Buffer1); + + if(strlen(Buffer1)!=0) + strcat( Inter_Chg, "." ); + } + + strcat( Inter_Chg, Buffer1); + if ( Nmc == 1 ) + strcat( Inter_Chg, "-" ); + + strrev(Inter_Chg); + + +/*// return Buffer2;*/ +} + + +void formatea_u_long( unsigned long Numero, char *Inter_Chg) +{ + char Buffer1[80]; + + int c; + + sprintf(Buffer1, "%lu", Numero); + + Inter_Chg[0]='\0'; + + strrev(Buffer1); + + c = strlen( Buffer1 ); + + while( c >= 3 ) + { + + c -= 3; + strncat( Inter_Chg, Buffer1, 3); + + strrev(Buffer1); + + Buffer1[c] = '\0'; + + strrev(Buffer1); + + if(strlen(Buffer1)!=0) + strcat( Inter_Chg, "." ); + } + + strcat( Inter_Chg, Buffer1); + strrev(Inter_Chg); + + +/*// return Buffer2;*/ +} + + +int Optar( int optar, ... ) +{ + static void far *fondo, far *fd_aceptar, far *fd_cancelar; + static char Memoria = 0; + + int DEV = 0, ok = 0, linea = 0; + int Center; char *buff; + struct textsettingstype texttypeinfo; + + va_list ap; + va_start( ap, &optar ); + + if ( Memoria == 1 ) + { + putimage( 170, 165, fondo , COPY_PUT ); + putimage( 170, 320, fd_aceptar , COPY_PUT ); + putimage( 370, 320, fd_cancelar, COPY_PUT ); + + farfree( fondo ); + farfree( fd_aceptar ); + farfree( fd_cancelar ); + + Memoria = 0; + + if ( optar == ENCUADRE ) return DEV; + } + + if ( ( fondo = farmalloc( JD_imagesize( 170, 165, 470, 315 ) ) ) != NULL && + ( fd_aceptar = farmalloc( JD_imagesize( 170, 320, 270, 350 ) ) ) != NULL && + ( fd_cancelar = farmalloc( JD_imagesize( 370, 320, 470, 350 ) ) ) != NULL ) + { + Memoria = 1; + + getimage( 170, 165, 470, 315, fondo ); + getimage( 170, 320, 270, 350, fd_aceptar ); + getimage( 370, 320, 470, 350, fd_cancelar); + + gettextsettings( &texttypeinfo ); + + Imprime_Estaticos( 100, "systm\\Tpv.img" ); + + settextstyle( SMALL_FONT, HORIZ_DIR, 6 ); + + setcolor( 63 ); + + while ( (buff = va_arg(ap, char *)) != NULL ) + { + Center = (296 - textwidth( buff ) ) / 2; + outtextxy( 172+Center, ( (linea == 0 ) ? 167 : 200 + 20*linea ), buff ); + linea++; + } + + va_end(ap); + + settextstyle( texttypeinfo.font, texttypeinfo.direction, texttypeinfo.charsize ); + + + if ( optar != ENCUADRE ) + { + ok = 0; while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + do { + switch( Comprueba_Secuencia( SEC_OPTAR, NULL ) ) + { + case 0: // No se pulso ningun BOTON + case -2: + case -1: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + if ( optar == 0 ) ok = 1; + break; + case 1: + DEV = 1; ok = 1; + break; + case 2: + DEV = 0; ok = 1; + break; + } + }while( !ok ); + + putimage( 170, 165, fondo , COPY_PUT ); + putimage( 170, 320, fd_aceptar , COPY_PUT ); + putimage( 370, 320, fd_cancelar, COPY_PUT ); + + farfree( fondo ); + farfree( fd_aceptar ); + farfree( fd_cancelar ); + + Memoria = 0; + + } + + + } else { + farfree( fondo ); + farfree( fd_aceptar ); + farfree( fd_cancelar ); + } + + + return DEV; +} + + + + char led_off [18] [18] = + { + { 3,3,3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,0,7,7,7,7,0,3,3,3,3,3,3,3,3,3,3 }, + { 3,0,7,4,12,12,4,7,0,3,3,3,3,3,3,3,3,3 }, + { 0,7,4,12,4,4,4,4,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,4,4,4,4,4,4,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,4,4,4,4,4,12,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,4,4,4,4,12,12,8,0,3,3,3,3,3,3,3,3 }, + { 3,0,8,4,12,12,12,8,0,3,3,3,3,3,3,3,3,3 }, + { 3,3,0,8,8,8,8,0,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 } + }; + + char led_on [18] [18] = + { + { 3,3,3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,0,7,7,7,7,0,3,3,3,3,3,3,3,3,3,3 }, + { 3,0,7,11,13,13,11,7,0,3,3,3,3,3,3,3,3,3 }, + { 0,7,11,13,11,11,11,11,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,11,11,11,11,11,11,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,11,11,11,11,11,13,8,0,3,3,3,3,3,3,3,3 }, + { 0,7,11,11,11,11,13,13,8,0,3,3,3,3,3,3,3,3 }, + { 3,0,8,11,13,13,13,8,0,3,3,3,3,3,3,3,3,3 }, + { 3,3,0,8,8,8,8,0,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 }, + { 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 } + }; + + char flecha [18] [18] = + { + 3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,0,4,0,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,0,4,4,4,0,3,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,0,4,4,4,4,4,4,4,0,3,3,3,3, + 3,3,3,3,0,4,4,4,4,4,4,4,4,4,0,3,3,3, + 3,3,3,0,4,4,4,4,4,4,4,4,4,4,4,0,3,3, + 3,3,0,0,0,0,0,4,4,4,4,4,0,0,0,0,0,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,4,4,4,4,4,0,3,3,3,3,3, + 3,3,3,3,3,3,0,0,0,0,0,0,0,3,3,3,3,3 + }; + + + /**************************************************************************\ +|* *| +|* poicono *| +|* *| +|* Descripci¢n: *| +|* Dibuja el bitmap que se encuentra en matriz, en ¤a pos x,y *| +|* y segun un angulo de rotacion definido en pos. *| +|* *| +|* Entradas: Coordenadas x, y *| +|* Matriz del bitmap y ( 0: Normal 1: 90§ ... *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ponicono(int x,int y,char matriz[18][18], char pos) +{ + int veces1,veces2; + + for (veces1=0;veces1<=17;veces1++) + { + for (veces2=0;veces2<=17;veces2++) + { + + switch( pos ) + { + case 1: + if ( matriz[veces1][veces2] != 3 ) + putpixel(x+veces1,y+veces2,matriz[veces1][veces2]); + break; + case 2: + if ( matriz[17-veces2][veces1] != 3 ) + putpixel(x+veces1,y+veces2,matriz[17-veces2][veces1]); + break; + case 3: + if ( matriz[17-veces1][veces2] != 3 ) + putpixel(x+veces1,y+veces2,matriz[17-veces1][veces2]); + break; + case 4: + if ( matriz[veces2][veces1] != 3 ) + putpixel(x+veces1,y+veces2,matriz[veces2][veces1]); + break; + } + } + } + +} + + + + /**************************************************************************\ +|* *| +|* CalculaAjusteDia *| +|* *| +|* Descripci¢n: *| +|* Calcula el ajuste necesario para el comienzo de los dias *| +|* y el n£mero de dias que tiene el mes en curso. *| +|* *| +|* Entradas: Retorno del Ajuste, y Dias del Mes *| +|* Mes para iniciar c lculos *| +|* *| +|* Salidas: OK Todo ha ido bien *| +|* ERROR *| +|* *| + \**************************************************************************/ +int CalculaAjusteDias( char *Ajuste, char *DiasMes, char Mes, int Anyo ) +{ + int dev, n, b, dsem, dia; + + // Dias de los meses, si el a¤o no es bisiesto + char DiasMeses[12] = { 31, 00, 31, 30, 31, 30, + 31, 31, 30, 31, 30, 31 }; + + // Ajusta febrero si es bisiesto el a¤o + DiasMeses[1] = (Anyo%4 == 0) ? 29 : 28; + + + dev = ERROR; + // Solo si la entrada es correcta + if ( Mes >= 1 && Mes <=12 ) + { + dev = OK; + // Obtenemos que dia, ( 0 - 365 ), es el 1§ del mes + dia = 0; + for ( n = 0; n < 12 && n < (Mes-1); n++ ) + dia += DiasMeses[n]; + + n = Anyo-1988; // a¤os para bisiesto + b = (n+3)/4; // a¤os bisies. pasados + dsem = 4; // 1o. Ene 1988: Viernes + dsem += (n*365+b); // 1o. Ene actual + dsem = (dsem+dia)%7; // d¡a seleccionado + + *Ajuste = dsem; + *DiasMes = DiasMeses[ Mes - 1 ]; + } + + return dev; +} + + + /**************************************************************************\ +|* *| +|* TextoDoble *| +|* *| +|* Descripci¢n: *| +|* Muestra el texto, con doble letra, en las coordenadas dadas *| +|* *| +|* Entradas: X, Y, texto *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void TextoDoble( int x, int y, char *texto ) +{ + setcolor( EGA_BLACK ); + outtextxy( x, y, texto ); + + setcolor( EGA_WHITE ); + outtextxy( x+1, y+1, texto ); + +} + + + + +/////// EDITAR COMENTARIO.... +int EditComentario( char *Comentario, int Lineas, int Columnas, int cc, int cf, int X0, int Y0, int X1, int Y1, int Inc ) +{ + + int ls; // longitud cadena + char *s1, *s, *s_tmp, *s_tmp1; // puntero a cadena inicial + int key, ok, Linea = 0, Columna = 0, lmax; + char Buffer[80]; + + lmax = Columnas; + + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + setcolor(cc); // devuelve el color a su estado + + for ( ok = 0; ok < Lineas; ok ++ ) + { + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + outtextxy( X0, Y0+ok*Inc, &Comentario[ (lmax+1)*Linea ] ); // e imprime la cadena. + } + + ok = 0; + + s_tmp1 = s_tmp = s = s1 = &Comentario[0 + (lmax+1)*Linea ]; // inicio cadena + + s += lmax ; *s = '\0'; + s = s_tmp; + +do { + + + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + setcolor(cc); // devuelve el color a su estado + + outtextxy( X0, Y0+Linea*Inc, s1 ); // e imprime la cadena. +// ls = strlen ( s ); // Longitud de la cadena actual + + + if ( Columna < lmax ) { // Muestra cursor si es posible + strncpy( Buffer, s1, Columna ); + Buffer[Columna] = '\0'; + setcolor(BLANCO); + outtextxy( X0 + textwidth( Buffer ), Y0+Linea*Inc+2, "Ü"); + } + + + + switch ( ( key = getch() ) ) { // obtiene tecla + // Intro o Return + case 13: + if( Linea < Lineas ) { + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + setcolor(cc); // devuelve el color a su estado + outtextxy( X0, Y0+Linea*Inc, s1 ); // e imprime la cadena. + + Linea++; + s_tmp1 = s_tmp = s = s1 = &Comentario[/*Linea + */(lmax+1)*Linea ]; // inicio cadena + s += lmax; *s = '\0'; + Columna = 0; + s = s_tmp1 = s_tmp = s1; + } + break; + + case 0: + + switch ( key = getch() ) { + + // F. Arriba + case 72: + if( Linea > 0 ) { + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + setcolor(cc); // devuelve el color a su estado + outtextxy( X0, Y0+Linea*Inc, s1 ); // e imprime la cadena. + + Linea--; + s_tmp1 = s_tmp = s = s1 = &Comentario[/*Linea + */(lmax+1)*Linea ]; // inicio cadena + s += lmax; *s = '\0'; + if ( Columna < strlen( s1 ) ) s_tmp += Columna; else { Columna = 0; + s_tmp = s1; } + s = s_tmp1 = s_tmp; + + } + + break; + // F. Abajo + case 80: + + if( Linea < Lineas ) { + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + setcolor(cc); // devuelve el color a su estado + outtextxy( X0, Y0+Linea*Inc, s1 ); // e imprime la cadena. + + Linea++; + s_tmp1 = s_tmp = s = s1 = &Comentario[/*Linea + */(lmax+1)*Linea ]; // inicio cadena + s += lmax; *s = '\0'; + if ( Columna < strlen( s1 ) ) s_tmp += Columna; else { Columna = 0; + s_tmp = s1; } + s = s_tmp1 = s_tmp; + } + break; + // F. Derecha + case 77: + case 9: + if ( Columna < strlen(s1) ) { Columna++; s++; } + break; + // F. Izquierda + case 75: + case 11: + if ( Columna > 0) { Columna--; s--; } + break; + default: + break; + } + + break; + // Back Space + case 8: + if ( Columna > 0 ) { + Columna--; + s--; + s_tmp1 = s_tmp = s; + while ( *s_tmp1 != NULL ) { + s_tmp1++; + *s_tmp = *s_tmp1; + s_tmp++; + } + } + break; + case 27: + ok = 1; + break; + default: + if ( key >= 32 && key <= 254 && Columna < lmax) { + *s++ = key; + Columna++; + } + break; + } +}while(!ok); + +while(kbhit()) getch(); // Vacia Buffer impidiendo falsas + // pulsaciones... + + + setfillstyle(SOLID_FILL, cf); // selecciona los atributos de + bar( X0, Y0+Linea*Inc, X1, Y0+Linea*Inc + Inc); // relleno, y Borra el campo + setcolor(cc); // devuelve el color a su estado + + outtextxy( X0, Y0+Linea*Inc, s1 ); // e imprime la cadena. + +return /* de momento nada */ 0; + +} + + + + +char *PideClave( char *LineaVentana, char *Comprobante ) +{ + static char Clave[15+1]; + + Clave[0] = '\0'; + Optar( ENCUADRE, LineaVentana, "Introduzca clave para:", Comprobante, NULL ); + + InputCadenaG( Clave, 0, 15, EGA_WHITE, EGA_WHITE, 190, 280, 450, 305 ); + + Optar( ENCUADRE, LineaVentana, "Introduzca clave para:", Comprobante, NULL ); + + return Clave; +} + + +void MuestraGraficas( int PosX, int PosY, int xWidth, int yWidth, int NDatos, long *Datos, char Mensajes[][12] ) +{ + long DMaximo; + int i, AnchoBarra; + + // Limpiamos la zona de visualizaci¢n + setfillstyle( SOLID_FILL, EGA_WHITE ); + bar( PosX, PosY, PosX + xWidth, PosY + yWidth ); + + // Calculamos el maximo valor a mostrar + DMaximo = 0; + for ( i = 0; i < NDatos; i++ ) + if ( Datos[i] > DMaximo ) + DMaximo = Datos[i]; + + // Ahora calculamos el ancho de cada barra de porcentaje + AnchoBarra = xWidth / NDatos; + + // Empiezo a dibujar las barras + PosY += yWidth - 1; + yWidth -= (AnchoBarra / 4); + setfillstyle( SLASH_FILL, EGA_BLUE ); + setcolor( EGA_BLACK ); + for ( i = 0; i < NDatos; i++ ) + { + if ( DMaximo != 0 ) + bar3d( PosX + AnchoBarra*i, PosY - ( ( Datos[i] * yWidth ) / DMaximo), PosX + AnchoBarra*(i+1), PosY, + AnchoBarra / 4, 1 ); + } + +} + + + /**************************************************************************\ +|* *| +|* PideClaveUsuario *| +|* *| +|* Descripci¢n: *| +|* Pide la clave de usuario y comprueba si es correcta. *| +|* *| +|* Entradas: (ninguna) *| +|* *| +|* Salidas: OK -clave correcta- ERROR -clave incorrecta- *| +|* *| +|* *| + \**************************************************************************/ +char PideClaveUsuario( void ) +{ +return OK; +/* + char buffer[80], Clave[80]; + int CodEmpl, dev; + + BDatos BEmpl_p; // Base de datos de Empleados + INFO_EMPLEADOS SEmpl_p; // Estructura de Empleados + + dev = ERROR; + + sprintf( buffer, "datos\\%s\\info_emp.dbf", NEmpresa ); + if ( BEmpl_p.AbrirReg( buffer, sizeof( INFO_EMPLEADOS ) ) == ERROR ) + { + Optar( 0, "­ ALERTA !", "No existen empleados", "c¢digos de acceso anulados", "PERMISOS ABIERTOS", NULL ); + return OK; + } + + + + Clave[0] = '\0'; + Optar( ENCUADRE, "­ Identifiquese !", "", "Login: ", "Password: ", NULL ); + + // Obtenemos el c¢digo de usuario: + do { + if ( InputCadenaG( buffer, 1, 5, EGA_WHITE, EGA_WHITE, 190, 280, 450, 305 ) >> 8 ) + return ERROR; + } while ( !MatchEmpleado( atoi(buffer) ) ); + +// InputCadenaG( Clave, 0, 15, EGA_WHITE, EGA_WHITE, 190, 280, 450, 305 ); + + if ( ! ( InputCadenaG( buffer, 1, 5, EGA_WHITE, EGA_WHITE, 190, 280, 450, 305 ) >> 8 ) ) + { + if ( SEmpl_p.Password[0] != '\0' && strcmpi( buffer, SEmpl_p.Password ) == 0 ) + dev = OK; + } + + Optar( ENCUADRE, "­ Identifiquese !", "", "Login: ", "Password: ", NULL ); + + return dev; +*/ +} diff --git a/TPV_VENT.CPP b/TPV_VENT.CPP new file mode 100644 index 0000000..555db12 --- /dev/null +++ b/TPV_VENT.CPP @@ -0,0 +1,2355 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "c:\program\src_dos\libs\make_bot\make_bot.h" +#include "c:\program\src_dos\libs\bdatos\bdatos.hh" +#include "tpv_def.h" +#include "tpv_num.h" + +#define NLINEAS_VENT 15 + +#define NORMAL 0 +#define BARRAS 1 + +BDatos BVentas; // Base de datos de Ventaserencias +VENTAS SVentas[101]; // 100 productos ( distintos ) maximo por ticket +INFORMACION_VENTAS S_IVentas; // Datos sobre la venta del dia + // Empresa a la que se le realizan las gestiones +extern char EmpresaActual[9]; +extern struct date FechaGestionActual; + +extern BDatos BEmpl; // Base de Datos de empleados +extern INFO_EMPLEADOS SEmpl; // Estructura de Empleados + +extern BDatos BRef; // Base de datos de Referencias +extern INFO_PRODUCTOS SRef; // Estructura de referencias + // Para guardar las posiciones de los c¢digos +extern BUSQUEDA_REF far *BusquedaRef; +extern char BusquedaDirecta; // Tipo de busqueda en Referencias + +extern BDatos BProtector; // Base de datos para el protector +extern MENSAJES SProtector; // Para guardar los mensajes del protector + +extern BDatos BClt1; // Base de datos de Clientes1: FICHAS +extern INFO_CLIENTES1 SClt1; // Estructura de Clientes + +extern BDatos BClt2; // Base de datos de Clientes2: COMPRAS +extern INFO_CLIENTES2 SClt2; // Estructura de Clientes + + +S_CobroCompleto SCc; // Estructura para el cobro completo + + +extern char BufferM[6][65 + 1];// Buffer para los mensajes... + + + char CurrRow; // Linea sobre la que estamos + int CurrVentas; // Producto sobre el que estamos posicionados a golpes + + + + /*************************************\ +| | +| Parte Principal del M¢dulo | +| | + \*************************************/ +void MuestraTotal( void ); +long ObtenPrecioVenta( void ); +char ProcesaCobroCompleto( char AsignarComprasCliente ); +void InicializaDatosVentas( void ); +void RedibujaPantallaVentas( void ); +void MuestraDatosVentas( int RowStart ); +void MuestraAyudaVentas( char columna ); +void VentasNuevoRegistro( VENTAS *MSVentas ); +void EditItemVentas( char columna, int linea ); +void ManipulaVentas( int Registro, char operacion ); +long ActualizaStock( int Cantidad, int VentaCompra, char ComprasVentas ); +void MuestraVentas( char columna, int linea, char como ); +void InsertarLinea( char *CurrRow, int *CurrVentas, char *CurrCol ); +void ObtenCoordenadasVentas( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ); + + + /*************************************\ +| | +| Parte Segunda del M¢dulo | +| | +| Secci¢n para el cobro completo | +| | + \*************************************/ +void MuestraDatosCCVentas( void ); +void MuestraCCVentas( char columna, char como ); +void MuestraAyudaCCVentas( char columna ); +void EditItemCCVentas( char columna ); +extern void BuscaClt( char TipoBusqueda, char *CurrRow, long *CurrClt ); +extern void EmplNuevoRegistro( INFO_EMPLEADOS *MSEmpl ); +extern int MatchVendedor( long CodigoVendedor ); +extern int MatchCliente( long CodigoCliente ); +extern int MatchCCliente( long CodigoEnlace ); +extern void CltNuevoRegistro( INFO_CLIENTES1 *NSClt1 ); +void CopiaDatosClnt(void); +extern void CltNuevoEnlace( INFO_CLIENTES1 *TmpClt ); + + /*************************************\ +| | +| Parte Tercera del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | + \*************************************/ +void ImprimeVentas( char como ); +void ImprimeCabeceraVentas( char como, FILE *file_out ); + + /*************************************\ +| | +| Parte Cuarta del M¢dulo | +| | +| Secci¢n para cargar los elementos | +| | +| Enlaces, a TPV_VENT.CPP | +| | + \*************************************/ +extern int CargaProductos( void ); +extern int MatchRef( unsigned long Codigo, char NormalBarras ); + +extern void GeneraBalanceDiario( void ); + +extern void CargaDatosProtector( void ); + +int far RatonVentas(void); +int ProtectorPantalla( void ); +void CargaDatosProtector( void ); + +p_graphics TotalVenta = { 15, 15, 6, 3, 3, Config.NumFg, Config.NumBg, Config.NumLn }; +p_Ampliada MensajesLn = { 17, 92, 13, 2, 2, Config.DigBg, Config.DigFg, 0 }; + +extern char DiaActual, MesActual; + +long TotalVendido = 0; // Cuanto se lleva vendido hasta ahora ?? +char NProductos = 0; // # de productos en el ticket actual +char OldNProductos ; // # de productos del ticket anterior. + +char Buffer[80]; +char Transaccion; + + +extern int ScrollUpProtectorPantalla(void); +extern double Protector; // Variable temporal para que salte el protector + +char SALIDA_TOTAL; +extern char *ptr_char; // Puntero a la fuentes de caracteres propia +extern BDatos BConfig; // Base con la configuracion del programa + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte principal del m¢dulo Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* RedibujaPantallasVentas *| +|* *| +|* Descripci¢n: *| +|* Redibuja la pantalla de ventas, cuando se entra por primera *| +|* vez, o se ha salido para realizar alguna gestion. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void RedibujaPantallaVentas(void) +{ + + // Rellenamos la pantalla con un fondo atractivo... + setfillstyle( Config.FillBgS, Config.FillBgC ); + bar( 0, 0, 640, 480 ); + + LeeFuentes(Config.Vent_msg); + + Imprime_Estaticos( 10, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + MuestraDatosVentas( 0 ); + + Numero_Digital( -1, &TotalVenta ); + + MuestraTotal(); + + // Luces de informaci¢n + if ( Config.OpcionesCaja.ImprimirTickets ) + ponicono( 460+7, 5+7, led_on, 1 ); + else + ponicono( 460+7, 5+7, led_off, 1 ); + if ( Config.OpcionesCaja.CobroCompleto ) + ponicono( 460+7, 50+7, led_on, 1 ); + else + ponicono( 460+7, 50+7, led_off, 1 ); + if ( SVentas[0].BarraMesa ) + ponicono( 460+7, 95+7, led_on, 1 ); + else + ponicono( 460+7, 95+7, led_off, 1 ); + +} + + /**************************************************************************\ +|* *| +|* MuestraTotal *| +|* *| +|* Descripci¢n: *| +|* Muestra el total con IVA ( servicio en mesa ) en los nos. *| +|* grandes y el total simple en los n§s peque¤os. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraTotal( void ) +{ + char buffer[80]; + char buffer1[80]; + + // Dibujamos el total vendido incluyendo el IVA del servicio en mesa + Numero_Digital( TotalVendido + ( SVentas[0].BarraMesa ? ( TotalVendido * Config.OpcionesCaja.PorcentajeMesa ) / 100 : 0 ), &TotalVenta ); + + formatea_u_long( (unsigned long)( TotalVendido ), buffer1 ); + sprintf( buffer, "%12s", buffer1 ); + + setfillstyle( SOLID_FILL, Config.TxtBgN ); + bar( 507, 457, 633, 473 ); + setcolor ( Config.TxtFgN ); + outtextxy( 507, 457, buffer ); + +} + +void AbreCajon(void) +{ + clock_t start; + + start = clock(); + while ( ( clock() - start ) / ( CLK_TCK / 16 ) <= 1 ) + { + outportb( 0x2f8, 0x00 ); + } + +} + + + /**************************************************************************\ +|* *| +|* VentasDiarias *| +|* *| +|* Descripci¢n: *| +|* Gestiona las ventas diarias que se realizan *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +char UltimaPalabra; +void VentasDiarias( void ) +{ + char buffer[100], ok = 0; + int BPush, key; + unsigned long PrecioC; + long i; + +#ifdef DEMOSTRACION + char NumeroProductosVendidos = 0; +#endif + + SALIDA_TOTAL = !OK; + + + char oldCol = -1; + char CurrCol; // Columna sobre la que estamos + + struct time HoraGestion, reloj; + + if ( VisualMode == OK ) + { + Optar( 0, "Modo de Visualizaci¢n", "No se permite la alteraci¢n", "de datos en a¤os pasados.", "- Consulte el manual -", NULL ); + return; + } + + sprintf( Buffer, "1996 (c) JD. " ); + MensajesLn.x = 15; MensajesLn.y = 92; + MensajesLn.ndigitos = 13; + MensajesLn.AX = 2; MensajesLn.AY = 2; + MensajesLn.C1 = Config.DigBg; MensajesLn.C2 = Config.DigFg; + + getdate( &FechaGestionActual ); + MesActual = FechaGestionActual.da_mon; + DiaActual = FechaGestionActual.da_day; + gettime( &reloj ); + sprintf( Buffer, "Hoy es %02d-%02d-%02d y son las %02d:%02d ", FechaGestionActual.da_day, FechaGestionActual.da_mon, FechaGestionActual.da_year, (int)reloj.ti_hour, (int)reloj.ti_min ); + UltimaPalabra = strlen( Buffer ) - 3; + + char ClaveSalida[15]; + sprintf( ClaveSalida, "%02d%02d", FechaGestionActual.da_mon, FechaGestionActual.da_day ); + + CargaDatosProtector(); + + // Inicializamos los datos de ventas ( Nuevo ticket ); + InicializaDatosVentas(); + + // Redibujamos la pantalla ( Esto se puede hacer ahora, por que los datos + // se guardan en memoria ) + RedibujaPantallaVentas(); + + // Inicializa un indice r pido para encontrar a los productos por su c¢digo + if ( CargaProductos() != OK ) + { + Optar( 0, "Error de Gestion", "No se pueden realizar ventas", "sin que existan productos", "que puedan ser vendidos", NULL ); + return; + } + + // Abre un archivo temporal para agilizar la salvaguardia de datos + // en bruto. ( Al abandonar este m¢dulo, los datos del archivo temporal + // se guardar n en el archivo final, de una manera mas comoda y est‚tica ) + + sprintf( buffer, "datos\\%s\\Ventas.TMP", NEmpresa ); + if ( BVentas.AbrirReg( buffer, sizeof( VENTAS ) ) == ERROR ) + Error( 1, BVentas.cError); + if ( BVentas.Registros() == 0 ) + { + gettime( &HoraGestion ); + + S_IVentas.AperturaCaja.hora = HoraGestion.ti_hour; + S_IVentas.AperturaCaja.min = HoraGestion.ti_min; + + S_IVentas.Dia = FechaGestionActual.da_day; + S_IVentas.Mes = FechaGestionActual.da_mon; + S_IVentas.Anyo = FechaGestionActual.da_year; + + // Solo para el rango de cambio ;-) + if ( HoraGestion.ti_hour >= 0 && HoraGestion.ti_hour < Config.VProductos.CambioHorario ) + { + S_IVentas.Dia --; + if ( S_IVentas.Dia <= 0 ) + { + S_IVentas.Mes --; + if ( S_IVentas.Mes <= 0 ) + { + S_IVentas.Mes = 12; + S_IVentas.Anyo--; + } + { + // Dias de los meses si el a¤o no es bisiesto + auto char DiasMeses[12] = { 31, 00, 31, 30, 31, 30, + 31, 31, 30, 31, 30, 31 }; + + // Ajusta febrero si es bisiesto el a¤o + DiasMeses[1] = (S_IVentas.Anyo%4 == 0) ? 29 : 28; + S_IVentas.Dia = DiasMeses[S_IVentas.Mes]; + } + } + + + } + + S_IVentas.Tickets = 0; + S_IVentas.Cambio = 0; + + BVentas.SalvaDatosUsuario( (void *)&S_IVentas ); + + } else { + + BVentas.CargaDatosUsuario( (void *)&S_IVentas, sizeof( INFORMACION_VENTAS ) ); + + } + + + // Nos posicionamos en la primera venta + CurrRow = CurrVentas = CurrCol = 0; + Transaccion = ON; + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaVentas( CurrCol ); + } + + if ( Transaccion == ON ) + MuestraVentas( CurrCol, CurrRow+CurrVentas, INTENSO ); + + BPush = Comprueba_Secuencia( 1, RatonVentas ); + + if ( Transaccion == OFF ) + { + Optar( ENCUADRE, NULL ); + SVentas[100] = SVentas[0]; + // Inicializamos los datos de ventas ( Nuevo ticket ); + InicializaDatosVentas(); + MuestraDatosVentas( 0 ); CurrRow = CurrVentas = CurrCol = 0; + Transaccion = ON; + } else + MuestraVentas( CurrCol, CurrRow+CurrVentas, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER +#ifdef DEMOSTRACION + if ( NumeroProductosVendidos > 5 ) + { + while( kbhit() ) getch(); + Optar( 0, "VERSION DEMO", "El n£mero m ximo de", "tickets por sesi¢n", "es de CINCO!!!", NULL ); + break; + } +#endif + + if ( (key = getch()) == 255 ) + break; + if ( key != 13 && key != 27 ) + ungetch( key ); + + + if ( CurrCol == 0 || CurrCol == 2 ) + { + TotalVendido -= SVentas[CurrRow+CurrVentas].PrecioV * SVentas[CurrRow+CurrVentas].Cantidad; + + if ( MatchRef( SVentas[CurrRow+CurrVentas].CodigoR, NORMAL ) == OK ) + { + ActualizaStock( SVentas[CurrRow+CurrVentas].Cantidad, 1, VENTA ); + } + } + + // Si la tecla que pulsamos fue intro y estamos en el campo + // de cantidad, seguramente era para validar la cantidad... + if ( ( CurrCol == 2 && key != 13 ) || CurrCol != 2 ) + EditItemVentas( CurrCol, CurrRow ); + while( kbhit() ) getch(); + + // Miramos si existe ese producto, en caso de haber editado + // la columna 0 || 2, ( columna del c¢digo, cantidad ) + if ( CurrCol == 0 || CurrCol == 2 ) + { + if ( MatchRef( SVentas[CurrRow+CurrVentas].CodigoR, NORMAL ) == OK ) + { + // Ya se debe haber cargado la referencia, asi que podemos + // copiar los datos importantes y actualizar el stock + + PrecioC = ActualizaStock( SVentas[CurrRow+CurrVentas].Cantidad, -1, VENTA ); + SVentas[CurrRow+CurrVentas].PrecioC = PrecioC; + + SVentas[CurrRow+CurrVentas].PrecioV = ObtenPrecioVenta(); + + } else { + SVentas[CurrRow+CurrVentas].CodigoR = 0; + } + } + TotalVendido += SVentas[CurrRow+CurrVentas].PrecioV * SVentas[CurrRow+CurrVentas].Cantidad; + + MuestraVentas( 1, CurrRow+CurrVentas, NORMAL ); + MuestraVentas( 3, CurrRow+CurrVentas, NORMAL ); + + MuestraTotal(); + + // Esto que sigue es para que el cursor avance solo y + // a¤ada el producto autom ticamente... + + MuestraVentas( CurrCol, CurrRow+CurrVentas, NORMAL ); + switch ( CurrCol ) + { + case 0: + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + CurrCol = 3; + else + CurrCol = 2; + break; + case 1: + case 2: + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + { + CurrCol = 3; + } else { + // de lo contrario, insertamos una nueva venta. + InsertarLinea( &CurrRow, &CurrVentas, &CurrCol ); + } + break; + case 3: + if ( SVentas[CurrRow+CurrVentas].PrecioV != 0 ) + InsertarLinea( &CurrRow, &CurrVentas, &CurrCol ); + break; + } + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Solo se permite acceder a Todo cuando el Codigo es 0 + // CurrCol--; + switch ( CurrCol ) + { + case 0: + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + CurrCol = 3; + else + CurrCol = 2; + break; + case 1: + case 2: + CurrCol = 0; + break; + case 3: + CurrCol = 2; + break; + } + break; + // Flecha Derecha + case 77: + case 9: + // Solo se permite acceder a Todo cuando el Codigo es 0 + //CurrCol++; + switch ( CurrCol ) + { + case 0: + case 1: + CurrCol = 2; + break; + case 2: + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + CurrCol = 3; + else + CurrCol = 0; + break; + case 3: + CurrCol = 0; + break; + } + break; + // Flecha Arriba + case 72: + if ( (CurrRow + CurrVentas) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_VENT - 1; CurrVentas -= NLINEAS_VENT; + if ( CurrVentas < 0 ) CurrVentas = 0; + + while( ( CurrRow + CurrVentas ) >= NProductos && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrVentas ) >= NProductos && CurrVentas > 0 ) CurrVentas++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + } + break; + // Flecha Abajo + case 80: + if ( ( CurrRow + CurrVentas ) < ( NProductos - 1 ) ) + { + + if ( ( CurrRow ) >= NLINEAS_VENT - 1 ) + { + CurrRow = 0; CurrVentas += NLINEAS_VENT; + + while ( (CurrVentas + CurrRow) >= NProductos ) CurrVentas--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + } else + CurrRow++; + } + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + // Inicio + case 71: + CurrRow = 0; + if ( CurrVentas != 0 ) + { + CurrVentas = 0; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + } + + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + // Fin + case 79: + CurrRow = 0; + if ( CurrVentas != NProductos - NLINEAS_VENT ) + { + CurrVentas = NProductos - NLINEAS_VENT; + if ( CurrVentas < 0 ) + { + CurrVentas = 0; + CurrRow = NProductos-1; + } + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + } + + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + // Eliminar + case 83: + TotalVendido -= SVentas[CurrRow+CurrVentas].PrecioV * SVentas[CurrRow+CurrVentas].Cantidad; + MuestraTotal(); + + if ( MatchRef( SVentas[CurrRow+CurrVentas].CodigoR, NORMAL ) == OK ) + { + ActualizaStock( SVentas[CurrRow+CurrVentas].Cantidad, 1, VENTA ); + } + + ManipulaVentas( CurrVentas + CurrRow, ELIMINAR ); + + if ( NProductos == 0 ) + { + ManipulaVentas( 0, INSERTAR ); + VentasNuevoRegistro( &SVentas[0] ); + CurrRow = 0; + } else + + // Si he borrado el £ltimo registro subo una linea + if ( (CurrVentas+CurrRow) >= ( NProductos - 2 ) ) + { + if ( (CurrRow + CurrVentas) > 0 ) + { + if ( ( CurrRow ) <= 0 ) + { + CurrRow = NLINEAS_VENT - 1; CurrVentas -= NLINEAS_VENT; + if ( CurrVentas < 0 ) CurrVentas = 0; + + while( ( CurrRow + CurrVentas ) >= NProductos && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrVentas ) >= NProductos && CurrVentas > 0 ) CurrVentas++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + } else { + CurrRow --; if ( CurrRow < 0 ) CurrRow = 0; + } + } + } + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + // Insertar + case 82: + InsertarLinea( &CurrRow, &CurrVentas, &CurrCol ); + break; + // Retroceso R pido + case 73: + CurrRow = NLINEAS_VENT - 1; CurrVentas -= NLINEAS_VENT; + if ( CurrVentas < 0 ) CurrVentas = 0; + + while( ( CurrRow + CurrVentas ) >= NProductos && CurrRow > 0 ) CurrRow--; + while( ( CurrRow + CurrVentas ) >= NProductos && CurrVentas > 0 ) CurrVentas++; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + // AvanceR pido + case 81: + CurrRow = 0; CurrVentas += NLINEAS_VENT; + + while ( (CurrVentas + CurrRow) >= NProductos ) CurrVentas--; + + // Mostramos datos hasta que se nos acabe la pantalla + MuestraDatosVentas( CurrVentas ); + + if ( SVentas[CurrRow+CurrVentas].CodigoR != 0 && ( CurrCol == 1 || CurrCol == 3 ) ) CurrCol = 0; + break; + } + break; + // Imprimir £ltimo ticket + case 1: + // Solo si hay solo un producto ( y es no valido ) + if ( NProductos == 1 && SVentas[0].CodigoR == 0 && SVentas[0].PrecioV == 0 ) + { + NProductos = OldNProductos; + SVentas[0] = SVentas[100]; + + if ( ProcesaCobroCompleto( !Config.OpcionesCaja.CobroCompleto ) == OK ) + { + // Tengo que modificar la compra del cliente: ¨ Quien se la vendio ? + // ...pero solo lo hago si no esta activado el C.Completo + if ( !Config.OpcionesCaja.CobroCompleto ) + for ( i = BVentas.Registros()-NProductos; i < BVentas.Registros(); i++ ) + { + BVentas.LeeReg( (void *)&SVentas[1], i ); + SVentas[1].CodigoVendedor = SVentas[0].CodigoVendedor; + BVentas.EscribeReg( (void *)&SVentas[1], i ); + } + } + VentasNuevoRegistro( &SVentas[0] ); + + OldNProductos = NProductos; + NProductos = 1; + CurrRow = CurrVentas = CurrCol = 0; oldCol = -1; + } else { + Optar( 0, " ­­ No mas facturas !! ", "Solo se permite una factura", "pulsando el boton C.Completo", NULL ); + } + break; + // Imprimir Tickets + case 2: + Config.OpcionesCaja.ImprimirTickets = !Config.OpcionesCaja.ImprimirTickets; + if ( Config.OpcionesCaja.ImprimirTickets ) + ponicono( 460+7, 5+7, led_on, 1 ); + else + ponicono( 460+7, 5+7, led_off, 1 ); + break; + // Cobro Completo + case 3: + Config.OpcionesCaja.CobroCompleto = !Config.OpcionesCaja.CobroCompleto; + if ( Config.OpcionesCaja.CobroCompleto ) + ponicono( 460+7, 50+7, led_on, 1 ); + else + ponicono( 460+7, 50+7, led_off, 1 ); + break; + // Servicio en mesa + case 4: + SVentas[0].BarraMesa = !SVentas[0].BarraMesa; + if ( SVentas[0].BarraMesa ) + ponicono( 460+7, 95+7, led_on, 1 ); + else + ponicono( 460+7, 95+7, led_off, 1 ); + MuestraTotal(); + break; + // Enlace a la seccion de gastos / compras + case 5: + // Cerramos los archivos abiertos que necesita el m¢dulo + farfree( BusquedaRef ); + BRef.CerrarReg(); + + // Ejecutamos el m¢dulo de compras ( con acceso limitado ) + ComprasDiarias( NINGUNO ); + + // Vuelvo a abrir los ficheros necesarios + CargaProductos(); + + // Al volver de esta secci¢n habr  que redibujar la pantalla + RedibujaPantallaVentas(); + + oldCol = -1; + break; + // Men£ Pricipal + case 6: + if ( strcmp( PideClave( "Clave de Salida", ">>> registrando..." ), ClaveSalida ) == 0 ) + //if ( PideClaveUsuario() == OK ) + { + S_IVentas.SalidasExito ++; + ok = 1; + } else { + S_IVentas.IntentosSalir ++; + SALIDA_TOTAL = OK; + ok = 1; + } + break; + // Fichar ticket + case 7: +#ifdef DEMOSTRACION +NumeroProductosVendidos++; +#endif + // Apertura de la caja para cambio + if ( NProductos == 1 && SVentas[0].CodigoR == 0 && SVentas[0].PrecioV == 0 ) + { + // Solo un producto, y su codigo y precio venta == 0 ( CAMBIO ) + S_IVentas.Cambio++; + + + // Abrimos la caja + AbreCajon(); + + + // Indicamos que la transacci¢n ha finalizado + Optar( ENCUADRE, "Transacci¢n finalizada", "Cajon abierto para cambio", "Registrando tiempo de apertura", "­­­ Sistema preparado !!!", NULL ); + } else { + + // Si se entra, es un ticket completo + if ( Config.OpcionesCaja.CobroCompleto ) + if ( ProcesaCobroCompleto( Config.OpcionesCaja.CobroCompleto ) == ERROR ) + break; + + // Esto es un ticket normal + + // Guardamos la info del ticket + for ( i = 0; i < NProductos; i++ ) + { + SVentas[i].CodigoVendedor = SVentas[0].CodigoVendedor; + SVentas[i].BarraMesa = SVentas[0].BarraMesa; + // Solo insertamos el registro si: CodigoR != 0 + // o: CodigoR == 0 && PrecioV != 0 + if ( SVentas[i].CodigoR != 0 || SVentas[i].PrecioV != 0 ) + BVentas.InsReg( (void *)&SVentas[i], BVentas.Registros(), ARRIBA ); + } + + S_IVentas.Tickets++; + + // Abrimos la caja + AbreCajon(); + + // Imprimimos el ticket's si corresponde + if ( Config.OpcionesCaja.ImprimirTickets ) + ImprimeVentas( 4 ); + + // Indicamos que la transacci¢n ha finalizado + Optar( ENCUADRE, "Transacci¢n finalizada", "La transacci¢n ha finalizado", "sistema preparado para", "una nueva transacci¢n.", NULL ); + } + // Salvamos los datos estadisticos... + BVentas.SalvaDatosUsuario( (void *)&S_IVentas ); + Transaccion = OFF; + CurrRow = CurrVentas = CurrCol = 0; oldCol = -1; + break; + // Anular Ticket + case 8: + // ReActualizamos el stock + for ( i = 0; i < NProductos; i++ ) + { + if ( MatchRef( SVentas[i].CodigoR, NORMAL ) == OK ) + ActualizaStock( SVentas[i].Cantidad, 1, VENTA ); + } + + // Inicializamos los datos de ventas ( Nuevo ticket ); + InicializaDatosVentas(); + // Redibujamos la pantalla ( Esto se puede hacer ahora, por que los datos + // se guardan en memoria ) + MuestraDatosVentas( 0 ); CurrRow = CurrVentas = CurrCol = 0; oldCol = -1; + Numero_Digital( -1, &TotalVenta ); + MuestraTotal(); + Transaccion = ON; + break; + default: + break; + } + + } while( !ok ); + + if ( Transaccion == ON ) + // ReActualizamos el stock + for ( i = 0; i < NProductos; i++ ) + { + if ( MatchRef( SVentas[i].CodigoR, NORMAL ) == OK ) + ActualizaStock( SVentas[i].Cantidad, 1, VENTA ); + } + + + gettime( &HoraGestion ); + S_IVentas.CierreCaja.hora = HoraGestion.ti_hour; + S_IVentas.CierreCaja.min = HoraGestion.ti_min; + BVentas.SalvaDatosUsuario( (void *)&S_IVentas ); + + + // Generamos el balance del dia y cerramos el archivo de ventas + GeneraBalanceDiario(); + // El indice de referencias ya no nos hace falta + farfree( BusquedaRef ); + BVentas.CerrarReg(); + BRef.CerrarReg(); + + // Eliminamos el archivo temporal de ventas + sprintf( buffer, "datos\\%s\\Ventas.TMP", NEmpresa ); + if ( unlink( buffer ) != 0 ) + { + sprintf( buffer, "archivo: datos\\%s\\Ventas.TMP", NEmpresa ); + Optar( 0, "Error de eliminacion!", "Alguien impide eliminar el", buffer, "Eliminel¢ MANUALMENTE!!!", NULL ); + } + + + if ( SALIDA_TOTAL == OK ) + { + /*****************************\ + |* DesInicializamos todo y *| °±²Ü²±° + |* mostramos el mensaje final. *| °±²ß²±° + \*****************************/ + BConfig.CerrarReg(); + farfree( ptr_char ); + AnulaInterrupcion(); + closegraph(); + + + printf( "\nLa salida ILEGAL, acaba de ser registrada.\n­­Queda un intento menos, para bloquear el programa!!\n" ); + exit( -1 ); + } + +} + + + /**************************************************************************\ +|* *| +|* InsertatLinea *| +|* *| +|* Descripci¢n: *| +|* Me he visto obligado a sacar esta parte del c¢digo de la *| +|* funci¢n principal, ya que se usa en distintas partes. *| +|* *| +|* Entradas: *| +|* Linea en la que se inserta y posici¢n f¡sica, y columna *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InsertarLinea( char *CurrRow, int *CurrVentas, char *CurrCol ) +{ + char campo; + ManipulaVentas( (*CurrVentas + *CurrRow), INSERTAR ); + VentasNuevoRegistro( &SVentas[*CurrVentas+*CurrRow+1] ); + + if ( ( *CurrRow + *CurrVentas ) < NProductos - 1 ) + { + + if ( ( *CurrRow ) >= NLINEAS_VENT - 1 ) + { + *CurrRow = 0; *CurrVentas = *CurrVentas + NLINEAS_VENT; + + while ( (*CurrVentas + *CurrRow) >= NProductos ) *CurrVentas = *CurrVentas - 1; + +// MuestraDatosVentas( *CurrVentas ); + + } else + *CurrRow = *CurrRow + 1; + for ( campo=0; campo < 4; campo++ ) + MuestraVentas( campo, *CurrRow + *CurrVentas, NORMAL ); + } + + *CurrCol = 0; + MuestraDatosVentas( *CurrVentas ); +} + + /**************************************************************************\ +|* *| +|* ManipulaVentas *| +|* *| +|* Descripci¢n: *| +|* Inserta o elimina una venta *| +|* *| +|* Entradas: Registro a manipular *| +|* Tipo de manipulacion INSERTAR / ELIMINAR *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ManipulaVentas( int Registro, char operacion ) +{ + int avance; + + if ( operacion == INSERTAR ) + { + // Solo se permiten 100 compras por ticket + if ( Registro > 99 ) + return; + + NProductos++; + + avance = NProductos - 1; + + while( avance > ( + Registro+1) ) + { + SVentas[ avance ] = SVentas[ avance - 1 ]; + avance--; + } + + } else { + + NProductos --; + + if ( NProductos >= 0 ) + { + avance = Registro; + + while( avance < NProductos ) + { + SVentas[ avance ] = SVentas[ avance + 1 ]; + avance++; + } + } + } + +} + + + /**************************************************************************\ +|* *| +|* InicializaDatosVentas *| +|* *| +|* Descripci¢n: *| +|* Inicializa los datos necesarios para un nuevo ticket *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void InicializaDatosVentas(void) +{ + // Llevamos 0 ptas. vendidas + TotalVendido = 0; + + OldNProductos = NProductos; + // Hay solo 1 venta ( nada por defecto ) + NProductos = 1; + VentasNuevoRegistro( &SVentas[0] ); + +} + + /**************************************************************************\ +|* *| +|* ObtenPrecioVenta *| +|* *| +|* Descripci¢n: *| +|* Obtiene el precio de venta, dependiendo de la hora actual *| +|* ( se supone que la estructura SRef es sobre la que debemos *| +|* obtener el precio, y que esta actualizada ) *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: Precio de venta *| +|* *| + \**************************************************************************/ +long ObtenPrecioVenta( void ) +{ + char i; long Precio; + struct time t; + + gettime( &t ); + + Precio = SRef.PrecioVenta[0]; + + for ( i=1; i < 5; i++ ) + // 1§ tienen que coincidir las horas + if ( t.ti_hour >= Config.VProductos.HoraIni[i].hora && t.ti_hour <= Config.VProductos.HoraFin[i].hora && + t.ti_min >= Config.VProductos.HoraIni[i].min && t.ti_min <= Config.VProductos.HoraFin[i].min ) + { + Precio = SRef.PrecioVenta[i]; + break; + } + + return Precio; +} + + /**************************************************************************\ +|* *| +|* MuestraDatosVentas *| +|* *| +|* Descripci¢n: *| +|* Dado un registro, se muestran sucesivamente este y todos *| +|* los que hay por debajo de ‚l, hasta que se agote la base *| +|* o no quepan mas en la pantalla. *| +|* *| +|* Entradas: Registro por el que comenzar *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraDatosVentas( int RowStart ) +{ + int linea, campo; + int X0, Y0, X1, Y1; + + linea = CurrRow; + // Imprimo la NLINEAS_VENT que caben en la pantalla + for ( CurrRow=0; CurrRow < NLINEAS_VENT && (CurrRow + RowStart) < NProductos; CurrRow++ ) + { + // Por cada CurrRow hay 4 campos, ehhh!!! + for ( campo=0; campo < 4; campo++ ) + MuestraVentas( campo, CurrRow+RowStart, NORMAL ); + } + + // Ahora limpio los restantes huecos si los hay + + if ( CurrRow < NLINEAS_VENT ) + { + setfillstyle( SOLID_FILL, Config.TxtBgN ); + for ( ; CurrRow < NLINEAS_VENT; CurrRow++ ) + for ( campo=0; campo < 4; campo++ ) + { + ObtenCoordenadasVentas( campo, CurrRow, &X0, &Y0, &X1, &Y1 ); + bar( X0, Y0, X1, Y1 ); + } + } + + CurrRow = linea; + +} + + /**************************************************************************\ +|* *| +|* MuestraVentas *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* linea linea en la que nos encontramos *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraVentas( char columna, int linea, char como ) +{ + char buffer[80]; + char buffer1[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasVentas( columna, CurrRow, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real de la compra + case 0: + sprintf ( buffer, " %09lu", SVentas[linea].CodigoR ); + break; + // Nombre del producto + case 1: + if ( MatchRef( SVentas[linea].CodigoR, NORMAL ) == ERROR ) + { + strcpy( buffer1, "Ticket Varios" ); + sprintf ( buffer, " %30s", buffer1 ); + } else + sprintf ( buffer, " %30s", SRef.Descripcion ); + break; + // Cantidad + case 2: + sprintf ( buffer, "%4d", SVentas[linea].Cantidad ); + break; + // Total + case 3: + formatea_u_long( (unsigned long)( SVentas[linea].Cantidad * SVentas[linea].PrecioV ), buffer1 ); + sprintf ( buffer, "%8s", buffer1 ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0, Y0, X1, Y1 ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0+2, Y0, buffer ); + + //ÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄ + // Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û + //ÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄ + // Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û + //ÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄ + /* + setfillstyle( SOLID_FILL, Config.TxtFgN ); + bar( 507, 457, 633, 473 ); + formatea_long( (unsigned long)( SVentas[CurrRow+CurrVentas].PrecioC ), buffer ); + setcolor ( Config.TxtBgN ); + outtextxy( 507, 457, buffer ); +*/ + //ÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄ + // Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û + //ÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄÄÜÄÜÄÛÄÛÄ + // Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û Û + //ÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄÄßÄßÄÛÄÛÄ + +} + + + /**************************************************************************\ +|* *| +|* MuestraAyudaVentas *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaVentas( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo Real del producto + case 0: + sprintf ( buffer1, "C¢digo del producto. ( 0 si no tiene c¢digo )" ); + break; + // Nombre del producto + case 1: + sprintf ( buffer1, "Nombre ( para el producto sin catalogar )" ); + break; + // Cantidad + case 2: + sprintf ( buffer1, "Unidades de venta" ); + break; + // Total + case 3: + sprintf ( buffer1, "Total de la venta actual" ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 455, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemVentas *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* linea linea en la que nos encontramos *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemVentas( char columna, int linea ) +{ + char buffer[80]; + + int X0, Y0, X1, Y1; + + ObtenCoordenadasVentas( columna, linea, &X0, &Y0, &X1, &Y1 ); + + switch( columna ) + { + // Codigo Real + case 0: + buffer[0] = '\0'; // Creo que lo mejor es que teclee el c¢digo desde cero + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SVentas[CurrRow+CurrVentas].CodigoR = atol( buffer ); + break; + // Nombre del producto ( Solo si el codigo es el 0 ) + case 1: +/* + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + { +// ÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛßÜßÛ + strcpy ( buffer, SVentas[CurrRow+CurrVentas].Descripcion ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + strcpy ( SVentas[CurrRow+CurrVentas].Descripcion, buffer ); +// ÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛÜßÜßÛÛßÜßÛ + } +*/ + while( kbhit() ) getch(); + break; + // Cantidad + case 2: + buffer[0] = '\0'; + if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SVentas[CurrRow+CurrVentas].Cantidad = atoi( buffer ); + + if ( SVentas[CurrRow+CurrVentas].Cantidad == 0 ) + SVentas[CurrRow+CurrVentas].Cantidad = 1; + break; + // Total ( Solo Accesible con Codigo 0 ) + case 3: + if ( SVentas[CurrRow+CurrVentas].CodigoR == 0 ) + { + buffer[0] = '\0'; + if ( !( InputCadenaG( buffer, 1, 8, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) ) + SVentas[CurrRow+CurrVentas].PrecioV = atol( buffer ) / SVentas[CurrRow+CurrVentas].Cantidad; + } + while( kbhit() ) getch(); + break; + default: + while( kbhit() ) getch(); + break; + + } + +} + + /**************************************************************************\ +|* *| +|* ObtenCoordenadasVentas *| +|* *| +|* Descripci¢n: *| +|* Obtiene las coordenadas de acotacion para el campo pedido *| +|* *| +|* Entradas: *| +|* columna campo del que obtener las coordenadas *| +|* linea linea en la que nos encontramos *| +|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ObtenCoordenadasVentas( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 ) +{ + + // Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 ) + *Y0 = 164 + 19*linea; + *Y1 = *Y0 + 17; + + switch( columna ) + { + case 0: + *X0 = 7; *X1 = 123; + break; + case 1: + *X0 = 137; *X1 = 468; + break; + case 2: + *X0 = 482; *X1 = 528; + break; + case 3: + *X0 = 542; *X1 = 632; + break; + } + + *X0 += 2; + *X1 -= 2; + +} + + /**************************************************************************\ +|* *| +|* VentasNuevoRegistro *| +|* *| +|* Descripci¢n: *| +|* Limpia el buffer, para un nuevo registro. *| +|* *| +|* Entradas: (ninguna) *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void VentasNuevoRegistro( VENTAS *NSVentas ) +{ + struct time t; + + gettime( &t ); + + NSVentas -> CodigoR = 0; // Codigo real del producto + + NSVentas -> Cantidad = 1; // # de productos por unidad + + NSVentas -> PrecioV = 0; // Precio de venta + + NSVentas -> BarraMesa = 0; // Servicio en barra o en mesa + + NSVentas -> PrecioC = 0; // Precio de Costo del Producto + + NSVentas -> CodigoVendedor = 0; // C¢digo del vendedor ( 0 gen‚ricos ) + + // Hora exacta de venta del producto + NSVentas -> HoraV.hora = t.ti_hour; + NSVentas -> HoraV.min = t.ti_min; + +} + + /**************************************************************************\ +|* *| +|* ActualizaStock *| +|* *| +|* Descripci¢n: *| +|* Actualiza el Stock teniendo en cuenta si es un combinado *| +|* Se supone que la referencia origen esta cargada en SRef. *| +|* *| +|* *| +|* Entradas: *| +|* Referencia Origen, Cantidad, VentaCompra ( -1, 1 ) *| +|* *| +|* Salidas: (ninguna) *| +|* *| +|* ­­­ Nota: !!! *| +|* *| +|* COMBINADO PADRE: producto que se llama a si mismo *| +|* COMBINADO HIJO: alguien llamo a un combinado padre (x partes util)*| +|* COMBINADO NORMAL: resto de casos *| +|* *| + \**************************************************************************/ +#define COMBINADO_NORMAL 1 +#define COMBINADO_PADRE 2 +#define COMBINADO_HIJO 3 +#define COMBINADO_COMBINADO 0 + +long ActualizaStock( int Cantidad, int VentaCompra, char ComprasVentas ) +{ + long CodigoR[10], BRef_pos, BRef_und, BRef_cod; + unsigned long PrecioCosto; + char i, j; + char TipoCombinado = NORMAL; + + // Si no es un combinado, simplemente actualizamos en su Stock la cantidad + if ( SRef.Combinado == 0 ) + { + SRef.Stock += ( (long)Cantidad * VentaCompra ); + if ( BRef.EscribeReg( (void *)&SRef, BRef.RegActual() ) == ERROR ) + Error(0x01, BRef.cError ); + PrecioCosto = SRef.PrecioCosto * Cantidad; + } else { + + // Como es un combinado, tenemos que realizar un rastreo para actualizar + // las referencias de cada combinado + + BRef_pos = BRef.RegActual(); // Guardamos la posici¢n para saber de donde venimos + BRef_und = SRef.CantUnitaria; // Unidades que hay que quitar a los subcodigos + BRef_cod = SRef.CodigoR; + + // Guardamos los c¢digos combinados + for ( i = 0; i < 10; i++ ) + CodigoR[i] = SRef.CodigosAsociados[i]; + + PrecioCosto = 0; + + // Ahora recorremos cada c¢digo para actualizar el combinado + for ( i = 0; i < 10; i++ ) + if ( CodigoR[i] ) + { + if ( MatchRef( CodigoR[i], NORMAL ) == OK ) + { + // Comprobamos si la sub-ref. es o no un combinado + TipoCombinado = COMBINADO_COMBINADO; + for ( j = 0; j < 10 && TipoCombinado == COMBINADO_COMBINADO; j++ ) + { + if ( SRef.CodigoR == SRef.CodigosAsociados[j] ) + { + if ( SRef.CodigoR == BRef_cod ) + TipoCombinado = COMBINADO_PADRE; + else + TipoCombinado = COMBINADO_HIJO; + } else { + TipoCombinado = COMBINADO_NORMAL; + } + } + + if ( SRef.Combinado == 0 || TipoCombinado != COMBINADO_COMBINADO ) + { + switch( TipoCombinado ) + { + // C¢digo padre ( lo estoy vendiendo entero ) + case COMBINADO_HIJO: + // Solo vendo parte del c¢digo padre + if ( ComprasVentas == COMPRA ) + SRef.Stock += ( (long)Cantidad * /*SRef.CantUnitaria*/ VentaCompra ); + else + SRef.Stock += ( (long)Cantidad * BRef_und/*SRef.CantUnitaria*/ * VentaCompra ); + PrecioCosto += SRef.CantUnitaria == 0 ? 1 : (long)( ( (double)(SRef.PrecioCosto / SRef.CantUnitaria ) * Cantidad ) ); + break; + case COMBINADO_PADRE: + if ( ComprasVentas == COMPRA ) + SRef.Stock += ( (long)Cantidad * VentaCompra ); + else + SRef.Stock += ( (long)Cantidad * SRef.CantUnitaria * VentaCompra ); + Cantidad = Cantidad / SRef.CantUnitaria; + PrecioCosto += SRef.PrecioCosto * Cantidad; + break; + case COMBINADO_NORMAL: + default: + SRef.Stock += ( (long)Cantidad /** SRef.CantUnitaria*/ * VentaCompra ); + PrecioCosto += SRef.PrecioCosto * Cantidad; + break; + } + + if ( BRef.EscribeReg( (void *)&SRef, BRef.RegActual() ) == ERROR ) + Error(0x01, BRef.cError ); + + } else { + PrecioCosto += ActualizaStock( ( Cantidad * SRef.CantUnitaria ), VentaCompra, ComprasVentas ); + } // Fin sub-ref. es combinado / no combinado + } + } + + BRef.LeeReg( (void *)&SRef, BRef_pos ); + + } // Fin no combinado / combinado + + return PrecioCosto; + +} + + + +// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß +// Û Parte terciaria del m¢dulo Û +// Û Û +// Û Secci¢n de Impresion de compras Û +// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ + + /**************************************************************************\ +|* *| +|* ImprimeVentas *| +|* *| +|* Descripci¢n: *| +|* Imprime todas las referencias seg£n se le indique *| +|* *| +|* Entradas: *| +|* Como imprimir las referencias *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void ImprimeVentas( char como ) +{ + unsigned char i; + char buffer[80]; + long Suma_Total = 0; + FILE *file_out; + + + if ( !Config.Impresora.Printer ) + { + if ( ( file_out = fopen( Config.Impresora.PrintTo, "w" ) ) == NULL ) + return; + } else + file_out = stdprn; + + printf( "\n\r" ); + ImprimeCabeceraVentas( como, file_out ); + + for ( i=0; i < NProductos; i++ ) + { + + switch( como ) + { + case 1: + break; + case 2: + break; + case 3: + break; + case 4: + if ( SVentas[i].PrecioV != 0 || SVentas[i].CodigoR != 0 ) + { + formatea_u_long( (unsigned long)SVentas[i].PrecioV*SVentas[i].Cantidad, buffer ); + if ( MatchRef( SVentas[i].CodigoR, NORMAL ) == OK ) + fprintf( file_out, "%9lu %-30s %4ld %6s\n\r", (unsigned long)SVentas[i].CodigoR, SRef.Descripcion, (long)SVentas[i].Cantidad, buffer ); + else + fprintf( file_out, "%9lu Tickets varios %4ld %6s\n\r",(unsigned long) SVentas[i].CodigoR, (long)SVentas[i].Cantidad, buffer ); + + Suma_Total += SVentas[i].PrecioV*SVentas[i].Cantidad; + } + break; + } + } + + if ( como == 4 ) + { + formatea_long( Suma_Total, buffer ); + fprintf ( file_out, "\n\r Suma total %11s\n\r", buffer ); + for ( i=0; i < 4; i++ ) + fprintf( file_out, "\n\r%s", &Config.Impresora.FinTickets[i][0] ); + } + + if ( !Config.Impresora.Printer ) + fclose( file_out ); + +} + +void ImprimeCabeceraVentas( char como, FILE *file_out ) +{ + int i; + + switch( como ) + { + case 1: + break; + case 2: + break; + case 3: + break; + case 4: + for ( i=0; i < 4; i++ ) + fprintf( file_out, "%s\n\r", &Config.Impresora.PrincipioTickets[i][0] ); + fprintf( file_out, "\n\rC¢digo Articulo Cant P.Total \n\r" ); + break; + } +} + + + + +//ÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛÛßÛ +// ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß ß + +int ProtectorPantalla( void ) +{ + + p_Ampliada far *LetraG[6]; + int Pasadas = 20*8 - 1; + time_t first; + char Paso; + + int i; + + for ( i = 0; i < 6; i++ ) + if ( ( LetraG[i] = ( p_Ampliada far * )farmalloc( sizeof( p_Ampliada ) ) ) == NULL ) + { + for ( i=0; i < 6; i++ ) + farfree( LetraG[i] ); + ungetch( 255 ); + return 0; + } + + + + LetraG[0] -> x = 0; LetraG[0] -> y = 0; + LetraG[0] -> ndigitos = 20; + LetraG[0] -> AX = 2; LetraG[0] -> AY = 2; + LetraG[0] -> C1 = 0; LetraG[0] -> C2 = Config.DigFg+5; + LetraG[0] -> C3 = 0; + + *LetraG[5] = *LetraG[4] = *LetraG[3] = *LetraG[2] = *LetraG[1] = *LetraG[0]; + + LetraG[1] -> y = 32; + LetraG[2] -> y = 64; + LetraG[3] -> y = 96; + LetraG[4] -> y = 128; + LetraG[5] -> y = 160; + + for ( i = 0; i < 6; i++ ) + { + LetraG[i] -> C1 = SProtector.CBg[i]; + LetraG[i] -> C2 = SProtector.CFg[i]; +// LetraG[i] -> Frase1[0] = '\0'; + } + + for ( i = 0; i < 6; i++ ) + sprintf( BufferM[i], "%-20s%-20s%-20s", SProtector.Mensaje1[i], SProtector.Mensaje2[i], SProtector.Mensaje3[i] ); + + desactiva_raton(); + + // Cambiamos a 320x200 + IntVect = OFF; + + restorecrtmode(); + asm mov al, 0x13 + asm mov ah, 0x00 + asm int 0x10 + + LeeFuentes(Config.Prot_fnt); + time( &first ); + + + Paso = 0; + do { + if ( Pasadas == -1 && difftime( time(NULL), first ) >= SProtector.TEspera ) + { + Pasadas = 0; + if ( Paso == 4 ) Paso = 1; + } + + if ( Pasadas >= 0 ) + { + Pasadas ++; + if ( Pasadas > (Paso != 3 ? 20*8 : 20*8 ) ) + { + time( &first ); + Pasadas = -1; + Paso++; + } + } + + for ( i = 0; i < 6; i++ ) + { + if ( SProtector.Desplaz[i] || Pasadas != -1 ) + FuenteAmplia( BufferM[i], LetraG[i] ); + } + + + } while( !kbhit() ); + + + while ( kbhit() ) getch(); + + + for ( i=0; i < 6; i++ ) + farfree( LetraG[i] ); + + // Cambiamos a 640x480 + asm mov al, 0x03 + asm mov ah, 0x00 + asm int 0x10 + + setgraphmode( 2 ); + inicializa_raton_grafico( 0, 0, 639, 479 ); + + ////////// + setrgbpalette(EGA_WHITE, 56, 58, 59 ); + setrgbpalette(EGA_LIGHTGRAY, 30, 37, 43 ); + setrgbpalette(EGA_DARKGRAY, 24, 27, 30 ); + + + IntVect = ON; + + ungetch( 255 ); + + return 0; +} + + + /**************************************************************************\ +|* *| +|* RatonVentas *| +|* *| +|* Descripci¢n: *| +|* Funci¢n soporte para el control del raton, que ademas se *| +|* encarga de mostrar el letrero digital y el protector de *| +|* pantalla. *| +|* *| +|* Entradas: *| +|* Linea en la que se inserta y posici¢n f¡sica, y columna *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +int far RatonVentas(void) +{ + char Que; + + clock_t start, end, start2; + + struct time first; + struct time old; + + start2 = start = clock(); + + activa_raton(); + + union REGS io; + io.x.ax = 3; + + do{ + end = clock(); + if ( Protector == 1 && ( ( end - start ) / CLK_TCK ) >= Config.Protector ) + { + if ( Transaccion == OFF ) + { + Optar( ENCUADRE, NULL ); + // Inicializamos los datos de ventas ( Nuevo ticket ); + InicializaDatosVentas(); + MuestraDatosVentas( 0 ); + Transaccion = ON; + } +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +// ProtectorPantalla(); + if ( ScrollUpProtectorPantalla() == 1 ) + ProtectorPantalla(); +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ +//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ + + RedibujaPantallaVentas(); + return 0; + + } +/* + if ( (m++) >= Config.TiempoDezplazamiento ) + { + m = 0; +*/ + if ( ( (end - start2) / (CLK_TCK /*/ 4*/) ) >= 0.001 ) + { + start2 = end; + old = first; + gettime( &first ); + if ( Protector == 1 && ( old.ti_min != first.ti_min || old.ti_hour != first.ti_hour ) ) + sprintf( Buffer, "Hoy es %02d-%02d-%02d y son las %02d:%02d ", FechaGestionActual.da_day, FechaGestionActual.da_mon, FechaGestionActual.da_year, (int)first.ti_hour, (int)first.ti_min ); + + Fuente_Amplia( Buffer, &MensajesLn ); + } + + int86(0x33, &io, &io); // lee posici¢n y estados del bot¢n +// boton_izq = io.x.bx & 1; +// boton_der = (io.x.bx >> 1) & 1; + x_raton = io.x.cx; + y_raton = io.x.dx; + + }while( (io.x.bx & 1) == 0 && ((io.x.bx >> 1) & 1) == 0 && !kbhit() ); + + + ///////////////////////////////////////// + // RETURN Derecho Izquierdo // + // // + // 0 0 0 // + // 1 1 0 // + // 2 0 1 // + // 3 1 1 // + // // + ///////////////////////////////////////// + + + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==0 ) Que = 0; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==0 ) Que = 1; + if ( ((io.x.bx >> 1) & 1)==0 && (io.x.bx & 1)==1 ) Que = 2; + if ( ((io.x.bx >> 1) & 1)==1 && (io.x.bx & 1)==1 ) Que = 3; + + desactiva_raton(); + return Que; +} + + +// ÜÛ²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²ÛÜ +// °±²Û²±ÛÛÛÛÛÛ±ÛÛÛÛÛÛ±ÛÛÛÛÛ²±ÛÛÛÛÛ²±ÛÛÛÛÛÛ±°°±ÛÛÛÛÛ°ÛÛÛÛÛÛ°Û²Û²Û°ÛÛÛÛ²±°°±²Û² +// °±²Û²±Û°±²Û²±Û°±²ÛÛ±Û°±²ÛÛ±Û°±²ÛÛ±Û°±²ÛÛ±°°±ÛÛ²±°°Û²Û²±Û°ÛÛÛÛÛ°Û±²ÛÛ±°°±²Û² +// °±²Û²±Û°±²Û²±Û°±²ÛÛ±Û°±²ÛÛ±Û°±²ÛÛ±Û°±²ÛÛ±°°±ÛÛ²±°°Û²Û²±Û°Û²Û²Û°Û±²ÛÛ±°°±²Û² +// °±²Û²±Û°±²Û²±Û°±²ÛÛ±ÛÛÛÛÛ²±Û°ÛÛÛ²±Û°±²ÛÛ±°°±ÛÛ²±°°Û²Û²±Û°Û²Û²Û°ÛÛÛÛ²±°°±²Û² +// °±²Û²±Û°±²Û²±Û°±²ÛÛ±Û°±²ÛÛ±ÛÛ±²Û²±Û°±²ÛÛ±°°±ÛÛ²±°°Û²Û²±Û°Û²Û²Û°Û±²Û²±°°±²Û² +// °±²Û²±Û°±²Û²±Û°±²ÛÛ±Û°±²ÛÛ±Û°ÛÛÛ²±Û°±²ÛÛ±°°±ÛÛ²±°°Û²Û²±Û°Û²Û²Û°Û±²Û²±°°±²Û² +// °±²Û²±ÛÛÛÛÛÛ±ÛÛÛÛÛÛ±ÛÛÛÛÛ²±Û°±²ÛÛ±ÛÛÛÛÛÛ±°°±ÛÛÛÛÛ°ÛÛÛÛÛÛ°Û²Û²Û°Û±²Û²±°°±²Û² +// °±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û² +// ßÛ²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Û²±°°±²Ûß + + /**************************************************************************\ +|* *| +|* ProcesaCobroCompleto *| +|* *| +|* Descripci¢n: *| +|* Procesa un cobro completo, gestionando tanto al vendedor *| +|* como al cliente, para obtener datos posteriores sobre ellos *| +|* *| +|* Entradas: Si se desea o no asignar las compras al cliente (1§,2¦ vez) *| +|* *| +|* Salidas: Transacci¢n aceptada o no!!! *| +|* *| + \**************************************************************************/ +char ProcesaCobroCompleto( char AsignarComprasCliente ) +{ + int Status, ok; + int CurrCol, oldCol; + char CurrRow, OCRow; + long CurrClnt, OCClnt; + int BPush, key, i; + char buffer[80]; + + CurrRow = CurrClnt = -1; + CurrCol = 0; oldCol = -1; + ok = 0; Status = ERROR; + +/* + if ( ( SClt2 = (INFO_CLIENTES2 *)malloc( sizeof( INFO_CLIENTES2 ) * TOTAL_COMPRAS_ANUAL ) ) == NULL ) + { + Optar( 0, "­ Memoria insuficiente !", "Atenci¢n, no hay suficiente memoria", "libre, por lo que no se", "asignar n las compras al Clte.", NULL ); + return Status; + } +*/ + + sprintf( buffer, "datos\\%s\\info_clt1.dbf", NEmpresa ); + if ( BClt1.AbrirReg( buffer, sizeof( INFO_CLIENTES1 ) ) == ERROR ) + Error(0x01, BClt1.cError); + + sprintf( buffer, "datos\\%s\\info_clt2.%03d", NEmpresa, ( FechaGestionActual.da_year - (FechaGestionActual.da_year/1000)*1000 ) ); + if ( BClt2.AbrirReg( buffer, sizeof( INFO_CLIENTES2 ) * TOTAL_COMPRAS_ANUAL ) == ERROR ) + Error(0x01, BClt2.cError); + + Imprime_Estaticos( 11, "systm\\Tpv.img"); // Imprime botones estaticos 'Seccion 1' + + // Si no existe el empleado gen‚rico, obtenemos el nombre del primer empleado + EmplNuevoRegistro( &SEmpl ); + SEmpl.CodigoR = 0; + if ( MatchVendedor( SEmpl.CodigoR ) == ERROR ) + BEmpl.LeeReg( (void *)&SEmpl, 0 ); + + SCc.EntregadoCaja = 0; + + CopiaDatosClnt(); + MuestraDatosCCVentas(); + + do { + if ( CurrCol != oldCol ) + { + oldCol = CurrCol; MuestraAyudaCCVentas( CurrCol ); + } + + MuestraCCVentas( CurrCol, INTENSO ); + + BPush = Comprueba_Secuencia( 12, RatonVentas ); + + MuestraCCVentas( CurrCol, NORMAL ); + + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER + if ( (key = getch()) == 255 ) + break; + if ( key != 13 && key != 27 ) + ungetch( key ); + + + EditItemCCVentas( CurrCol ); + if ( CurrCol == 0 ) + { + // Busca al cliente cuyo c¢digo concuerde + if ( MatchCliente( SCc.CodCliente ) == ERROR ) + { + CltNuevoRegistro( &SClt1 ); + SCc.CodCliente = SClt1.Codigo; + strcpy( SCc.Nombre, "Cliente -NUEVO-" ); + } else { + CopiaDatosClnt(); + } + MuestraDatosCCVentas(); + + } + while( kbhit() ) getch(); + + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + // Flecha Arriba + case 72: + CurrCol--; if ( CurrCol < 0 ) CurrCol = 0; + break; + // Flecha Derecha + case 77: + case 9: + // Flecha Abajo + case 80: + CurrCol++; if ( CurrCol > 9 ) CurrCol = 9; + break; + // Inicio + case 71: + CurrCol = 0; + // Fin + case 79: + CurrCol = 9; + break; + } + break; + // Aceptar + case 1: + Status = OK; + ok = 1; + break; + // Cancelar + case 2: + Status = ERROR; + ok = 1; + break; + + // Busca a un cliente determinado, desplegando el cuadro de busqueda. + // Buscar Anterior + case 3: + OCRow = CurrRow; OCClnt = CurrClnt; + BuscaClt( ATRAS, &CurrRow, &CurrClnt ); + if ( OCRow != CurrRow || OCClnt != CurrClnt ) + CopiaDatosClnt(); + MuestraDatosCCVentas(); + break; + // Buscar + case 4: + OCRow = CurrRow; OCClnt = CurrClnt; + BuscaClt( NUEVA_BUSQUEDA, &CurrRow, &CurrClnt ); + if ( OCRow != CurrRow || OCClnt != CurrClnt ) + CopiaDatosClnt(); + MuestraDatosCCVentas(); + break; + // Buscar Posterior + case 5: + OCRow = CurrRow; OCClnt = CurrClnt; + BuscaClt( ADELANTE, &CurrRow, &CurrClnt ); + if ( OCRow != CurrRow || OCClnt != CurrClnt ) + CopiaDatosClnt(); + MuestraDatosCCVentas(); + break; + default: + break; + } + } while ( !ok ); + + ok = OK; + if ( Status == OK ) + { + SVentas[0].CodigoVendedor = SEmpl.CodigoR; + if ( AsignarComprasCliente ) + { + // Localizamos la ficha de ventas del cliente y le a¤adimos los productos + // que ha comprado, (solo c¢digo, cant. y total) el resto (nombre prod.) + // lo pillamos del archivo de venta de productos. + if ( MatchCliente( SCc.CodCliente ) == ERROR ) + { + if ( Optar( 1, "-Cliente Nuevo-", "¨ Desea dar de alta,", "a este nuevo cliente?", NULL ) ) + { + // Si el cliente en cuesti¢n no existe, habr  que crearlo... + CltNuevoRegistro( &SClt1 ); + SClt1.Codigo = SCc.CodCliente; + strcpy( SClt1.Cif , SCc.CifNif ); + strcpy( SClt1.Nombre , SCc.Nombre ); + strcpy( SClt1.Direccion , SCc.Direccion ); + strcpy( SClt1.Localidad , SCc.Localidad ); + strcpy( SClt1.Provincia , SCc.Provincia ); + SClt1.CodPostal = SCc.CodPostal; + // Habrimos la base de datos de clientes y lo insertamos + CltNuevoEnlace( &SClt1 ); + + BClt1.EscribeReg( (void *)&SClt1, BClt1.RegActual() ); + } else { + ok = ERROR; + } + } + // Solo si el cliente existe, o lo dio de alta, le a¤adimos sus compras + if ( ok != ERROR ) + { +/* + if ( MatchCCliente( SClt1.CodEnlace ) == ERROR ) + { + SClt2[0].MesDia = (int)(S_IVentas.Mes<<8) || S_IVentas.Dia; + SClt2[0].CodigoR = SClt1.CodEnlace; + SClt2[0].Unidades = 0; + SClt2[0].Total = 0; + BClt2.InsReg( (void *)SClt2, BClt2.Registros(), ARRIBA ); + } + MatchCCliente( SClt1.CodEnlace ); + BClt2.LeeReg( (void *)SClt2, BClt2.RegActual() ); + + long NRegInicio = SClt2[0].Total; + + SClt2[0].Total += NProductos; +*/ + // Escribimos los productos que ha comprado + for ( i = 0; i < NProductos; i++/*, NRegInicio++ */ ) + { + SClt2.CodEnlace = SClt1.CodEnlace; + SClt2/*[i+1+NRegInicio]*/.MesDia = (int)(S_IVentas.Mes<<8) || S_IVentas.Dia; + SClt2/*[i+1+NRegInicio]*/.CodigoR = SVentas[i].CodigoR; + SClt2/*[i+1+NRegInicio]*/.Unidades = SVentas[i].Cantidad; + SClt2/*[i+1+NRegInicio]*/.Total = SVentas[i].PrecioC; + BClt2.InsReg( (void *)&SClt2, BClt2.Registros(), ARRIBA ); + } +// BClt2.EscribeReg( (void *)SClt2, BClt2.RegActual() ); + } + } + // Ahora abrimos la base de datos -> Ventas a Clientes <- e insertamos la compra + } + +// free( SClt2 ); + + BClt1.CerrarReg(); + BClt2.CerrarReg(); + + #ifdef DEMOSTRACION + Optar( 0, "VERSION DEMO", "Registre el programa", "si realmente desea", "usarlo. ­­­Gracias!!!", NULL ); + #endif + + // Terminada la transaccion ( correcta o no ), redibujamos toda la pantalla + RedibujaPantallaVentas(); + + return Status; +} + +#ifndef DEMOSTRACION +void MuestraDatosCCVentas(void) +{ + int i; + + // ...y los mostramos. + for ( i = 0; i < 11; i++ ) + MuestraCCVentas( i, NORMAL ); +} +#endif + + +void CopiaDatosClnt(void) +{ + // Copiamos los datos del cliente a nuestra estructura... + SCc.CodCliente = SClt1.Codigo; + strcpy( SCc.CifNif , SClt1.Cif ); + strcpy( SCc.Nombre , SClt1.Nombre ); + strcpy( SCc.Direccion , SClt1.Direccion ); + strcpy( SCc.Localidad , SClt1.Localidad ); + strcpy( SCc.Provincia , SClt1.Provincia ); + SCc.CodPostal = SClt1.CodPostal; +} + + +#ifndef DEMOSTRACION + /**************************************************************************\ +|* *| +|* MuestraCCVentas *| +|* *| +|* Descripci¢n: *| +|* Reescribe el campo dado, seg£n la fila, y la intensidad *| +|* *| +|* Entradas: *| +|* columna campo ha mostar *| +|* como intensidad del texto (NORMAL/INTENSO) *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraCCVentas( char columna, char como ) +{ + char buffer[80]; + char buffer1[80]; + + int X0[]={ 240, 460, 240, 240, 240, 500, 240, 240, 400, 290, 475 }, + Y0[]={ 171, 171, 191, 211, 231, 231, 251, 291, 291, 311, 311 }, + X1[]={ 350, 575, 575, 575, 420, 575, 420, 330, 575, 380, 575 }, + Y1[]={ 189, 189, 209, 229, 249, 249, 269, 309, 309, 329, 329 }; + + switch( columna ) + { + // C¢digo del Cliente + case 0: + sprintf ( buffer, " %09lu", SCc.CodCliente ); + break; + // Cif/Nif + case 1: + sprintf ( buffer, "%10s", SCc.CifNif ); + break; + // Nombre del cliente + case 2: + sprintf ( buffer, " %27s", SCc.Nombre ); + break; + // Direccion + case 3: + sprintf ( buffer, " %30s", SCc.Direccion ); + break; + // Localidad + case 4: + sprintf ( buffer, " %15s", SCc.Localidad ); + break; + // Cod. Post + case 5: + sprintf ( buffer, " %ld", SCc.CodPostal ); + break; + // Provincia + case 6: + sprintf ( buffer, " %15s", SCc.Provincia ); + break; + // Cod. Vendedor + case 7: + sprintf ( buffer, " %ld", SEmpl.CodigoR ); + break; + // Nombre Vendedor + case 8: + sprintf ( buffer, " %15s %15s", SEmpl.Nombre, SEmpl.Apellido1 ); + break; + // Entregado a caja + case 9: + formatea_u_long( (unsigned long)( SCc.EntregadoCaja ), buffer1 ); + sprintf ( buffer, "%9s", buffer1 ); + break; + // Devolver + case 10: + formatea_long( (unsigned long)( SCc.EntregadoCaja - TotalVendido ), buffer1 ); + sprintf ( buffer, "%9s", buffer1 ); + break; + } + + setfillstyle( SOLID_FILL, ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI ); + bar( X0[columna], Y0[columna], X1[columna], Y1[columna] ); + setcolor ( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI ); + outtextxy( X0[columna]+2, Y0[columna], buffer ); + +} +#endif + + /**************************************************************************\ +|* *| +|* MuestraCCAyudaVentas *| +|* *| +|* Descripci¢n: *| +|* Muestra una peque¤a descripcion del contenido para el campo *| +|* *| +|* Entradas: *| +|* columna campo ha mostar su ayuda *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void MuestraAyudaCCVentas( char columna ) +{ + char buffer1[80]; + + switch( columna ) + { + // Codigo del cliente + case 0: + sprintf ( buffer1, "C¢digo del cliente. (Si el cliente no existe se crear )" ); + break; + // Nif/Cif + case 1: + sprintf ( buffer1, "Nif/Cif o equivalente." ); + break; + // Nombre del cliente + case 2: + sprintf ( buffer1, "Nombre ( para el cliente si este no existe )" ); + break; + // Direcci¢n + case 3: + sprintf ( buffer1, "Direcci¢n del cliente" ); + break; + // Localidad + case 4: + sprintf ( buffer1, "Localidad del Cliente" ); + break; + // Cod. Post + case 5: + sprintf ( buffer1, "C¢digo postal del Cliente" ); + break; + // Provincia + case 6: + sprintf ( buffer1, "Provincia del Cliente" ); + break; + + // Codigo de vendedor + case 7: + sprintf ( buffer1, "C¢digo del vendedor" ); + break; + // Nombre del vendedor + case 8: + sprintf ( buffer1, "Nombre del vendedor (no modificable)" ); + break; + + // Entregado a caja + case 9: + sprintf ( buffer1, "Importe que el cliente entrega a caja." ); + break; + // Devolver caja + case 10: + sprintf ( buffer1, "Devoluci¢n al cliente seg£n cantidad entregada." ); + break; + } + + // Ayuda reducida + setfillstyle( SOLID_FILL, EGA_BLACK ); bar( 7, 457, 498, 473 ); + // Imprime la ayudita + setcolor( EGA_WHITE ); outtextxy( 7, 455, buffer1 ); + +} + + /**************************************************************************\ +|* *| +|* EditItemCCVentas *| +|* *| +|* Descripci¢n: *| +|* Se encarga de editar y validar el campo. *| +|* *| +|* Entradas: *| +|* columna campo ha editar *| +|* *| +|* Salidas: (ninguna) *| +|* *| + \**************************************************************************/ +void EditItemCCVentas( char columna ) +{ + char buffer[80]; + + int X0[]={ 240, 460, 240, 240, 240, 500, 240, 240, 400, 290, 475 }, + Y0[]={ 171, 171, 191, 211, 231, 231, 251, 291, 291, 311, 311 }, + X1[]={ 350, 575, 575, 575, 420, 575, 420, 330, 575, 380, 575 }, + Y1[]={ 189, 189, 209, 229, 249, 249, 269, 309, 309, 329, 329 }; + + switch( columna ) + { + // Codigo Cliente + case 0: + sprintf( buffer, "%ld", SCc.CodCliente ); + if ( !( InputCadenaG( buffer, 1, 9, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + SCc.CodCliente = atol( buffer ); + break; + // CIF/NIF Cliente + case 1: + strcpy( buffer, SCc.CifNif ); + if ( !( InputCadenaG( buffer, 0, 10, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + strcpy( SCc.CifNif, buffer ); + break; + // Nombre del Cliente + case 2: + strcpy( buffer, SCc.Nombre ); + if ( !( InputCadenaG( buffer, 0, 25, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + strcpy( SCc.Nombre, buffer ); + break; + // Direcci¢n + case 3: + strcpy( buffer, SCc.Direccion ); + if ( !( InputCadenaG( buffer, 0, 30, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + strcpy( SCc.Direccion, buffer ); + break; + // Localidad + case 4: + strcpy( buffer, SCc.Localidad ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + strcpy( SCc.Localidad, buffer ); + break; + // Cod.Postal + case 5: + sprintf( buffer, "%ld", SCc.CodPostal ); + if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + SCc.CodPostal = atol( buffer ); + break; + // Provincia + case 6: + strcpy( buffer, SCc.Provincia ); + if ( !( InputCadenaG( buffer, 0, 15, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + strcpy( SCc.Provincia, buffer ); + break; + + // C¢digo vendedor + case 7: + sprintf( buffer, "%ld", SEmpl.CodigoR ); + if ( !( InputCadenaG( buffer, 1, 8, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + { + SEmpl.CodigoR = atol( buffer ); + // si modifico el c¢digo de vendedor + if ( MatchVendedor( SEmpl.CodigoR ) == ERROR ) + { + SEmpl.CodigoR = 0; + if ( MatchVendedor( SEmpl.CodigoR ) == ERROR ) + BEmpl.LeeReg( (void *)&SEmpl, 0 ); + } + MuestraCCVentas( 7, NORMAL ); + MuestraCCVentas( 8, NORMAL ); + } + break; + // Entregado a caja + case 9: + sprintf( buffer, "%ld", SCc.EntregadoCaja ); + if ( !( InputCadenaG( buffer, 1, 5, Config.TxtBgN, Config.TxtFgN, X0[columna], Y0[columna], X1[columna], Y1[columna]) >> 8 ) ) + SCc.EntregadoCaja = atol( buffer ); + MuestraCCVentas( 10, NORMAL ); + break; + + default: + while( kbhit() ) getch(); + break; + + } + +} + +/* +& 110, 160, 580, 340, 7, 63, 56, 2, 2 +| 120, 170, 2, 6, 0, 63, C¢d. Cliente: Cif/Nif:, +| 121, 171, 2, 6, 0, 0, C¢d. Cliente: Cif/Nif:, +& 240, 171, 350, 189, 63, 7, 56, 0, 2 +& 460, 171, 575, 189, 63, 7, 56, 0, 2 +| 120, 190, 2, 6, 0, 63, Nombre:, +| 121, 191, 2, 6, 0, 0, Nombre:, +& 240, 191, 575, 209, 63, 7, 56, 0, 2 +| 120, 210, 2, 6, 0, 63, Direcci¢n:, +| 121, 211, 2, 6, 0, 0, Direcci¢n:, +& 240, 211, 575, 229, 63, 7, 56, 0, 2 +| 120, 230, 2, 6, 0, 63, Localidad: Cod Post, +| 121, 231, 2, 6, 0, 0, Localidad: Cod Post, +& 240, 231, 420, 249, 63, 7, 56, 0, 2 +& 500, 231, 575, 249, 63, 7, 56, 0, 2 +| 120, 250, 2, 6, 0, 63, Provincia:, +| 121, 251, 2, 6, 0, 0, Provincia:, +& 240, 251, 420, 269, 63, 7, 56, 0, 2 +| 120, 290, 2, 6, 0, 63, Cod.Vendedor: Nombre:, +| 121, 291, 2, 6, 0, 0, Cod.Vendedor: Nombre:, +& 240, 291, 330, 309, 63, 7, 56, 0, 2 +& 400, 291, 575, 309, 63, 7, 56, 0, 2 +| 120, 310, 2, 6, 0, 63, Entregado a caja: devolver:, +| 121, 311, 2, 6, 0, 0, Entregado a caja: devolver:, +& 290, 311, 380, 329, 63, 7, 56, 0, 2 +& 475, 311, 575, 329, 63, 7, 56, 0, 2 +*/ diff --git a/datos.rar b/datos.rar new file mode 100644 index 0000000..cd7fdf6 Binary files /dev/null and b/datos.rar differ diff --git a/tpv.exe b/tpv.exe new file mode 100644 index 0000000..280b078 Binary files /dev/null and b/tpv.exe differ