Pascal/Turbo Pascal - Alta de ventas

 
Vista:

Alta de ventas

Publicado por vale (1 intervención) el 21/10/2016 20:01:20
Hola, necesito hacer el precedimiento de alta en la unit de venta. Tengo estos datos para el registro de venta
VENTAS (id_venta, id_cliente, fecha de venta, líneas de ventas (array [1..100] of T_Productos), total, forma de pago).
T_Productos= record
Id_producto (con el cual accede al archivo PRODUCTOS)
Cantidad_Comprada
Subtotal (se calcula automáticamente de multiplicar la cantidad comprada por el precio del producto)


Las unit de producto y cliente ya las tengo andando
Agradeceria cualquier tipo de ayuda
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Alta de ventas

Publicado por ramon (2158 intervenciones) el 21/10/2016 23:16:22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{Algo así servirá}
 
 uses
    crt;
 
 type
   T_Productos= record
          Id_producto : string[80];
          Cantidad_Comprada : integer;
          Subtotal : real;
          precio_del_producto : real;
        end;
 
 
 
   ventas = record
       id_venta : string[80];
       id_cliente : string[80];
       fecha_de_venta : string[10];
       lineas_de_ventas : array [1..100] of T_Productos;
       total : real;
       forma_de_pago : string[30];
     end;
 
 var
   cliente : ventas;
   t, linea : integer;
 
 
 procedure altas(var ven : ventas);
 var
   fin : boolean;
   tec : char;
   x, y : integer;
 begin
    clrscr;
    gotoxy(10,4);write('ID. Venta : ');
    gotoxy(22,4);readln(ven.id_venta);
    gotoxy(10,5);write('ID. Cliente : ');
    gotoxy(24,5);readln(ven.id_cliente);
    gotoxy(10,6);write('Fecha De Venta Dia/Mes/A¤o : ');
    gotoxy(40,6);readln(ven.fecha_de_venta);
    gotoxy(10,7);write('Linea De Ventas');
    fin := false;
    x := 10;
    y := 8;
    linea := 1;
  repeat
      gotoxy(x,y);write('ID. Prodecto : ');
      gotoxy(x + 16,y);readln(ven.lineas_de_ventas[linea].Id_producto);
      gotoxy(x,y + 1);write('Cantidad : ');
      gotoxy(x + 12,y + 1);readln(ven.lineas_de_ventas[linea].Cantidad_Comprada);
      gotoxy(x,y + 2);write('Precio Producto : ');
      gotoxy(x + 19,y + 2);readln(ven.lineas_de_ventas[linea].precio_del_producto);
      ven.lineas_de_ventas[linea].Subtotal :=
      ven.lineas_de_ventas[linea].precio_del_producto *
      ven.lineas_de_ventas[linea].Cantidad_Comprada;
      gotoxy(x,y + 4);write('Para Segir Entradas Pulse [S] Salir [N]');
      repeat
          tec := upcase(readkey);
      until tec in['N','S'];
     if tec = 'S' then
     begin
     linea := linea + 1;
     gotoxy(x,y);clreol;
     gotoxy(x,y + 1);clreol;
     gotoxy(x,y + 2);clreol;
     gotoxy(x,y + 4);clreol;
     end
   else
      fin := true;
  until fin = true;
  for t := 1 to linea do
  ven.total := ven.total + ven.lineas_de_ventas[t].Subtotal;
  gotoxy(x,y + 7);write('Entre Forma De Pago : ');
  gotoxy(x + 22,y + 7);readln(ven.forma_de_pago);
 end;
 
 begin
    clrscr;
    altas(cliente);
 end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar