Skip to content

Commit 9a24aac

Browse files
committed
Merge branch 'Contabilidad' of https://github.com/djose1164/Programacion-Modular into Contabilidad
2 parents 87685e1 + 58025e2 commit 9a24aac

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

include/venta.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ typedef struct IngresodeVentas
2323
float TotalaPagar;
2424
bool full;
2525
unsigned id_producto_deseado; //guarda el id que el user ingreso
26-
27-
} facturas;
2826

27+
} facturas;
2928

3029
enum options_modulo_ventas
3130
{
@@ -103,7 +102,7 @@ void cash_register(facturas Facturas);
103102
* @return true el usuario ha salido del modulo y se va al menu inicial del programa
104103
* @return false no se ejecutara la funcion
105104
*/
106-
bool go_back();//TODO ver si esto funcionara o solo dejar el menu
105+
bool go_back(); //TODO ver si esto funcionara o solo dejar el menu
107106

108107
/**
109108
* @brief Imprime las opciones del usuario
@@ -113,11 +112,12 @@ bool go_back();//TODO ver si esto funcionara o solo dejar el menu
113112
*/
114113
bool ventas_menu();
115114

116-
117115
/**
118116
* @brief Imprime el encabezado del modulo ventas opcion 1
119117
*
120118
*/
121119
void print_factura();
122120

123-
#endif //VENTA_H
121+
int obtener_ventas_suma();
122+
123+
#endif //VENTA_H

src/venta.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ struct products;
2222
//TODO para que le pase cantidad a Facturas.cantidad y asi poder
2323
//TODO pasarselo a venta_return_contabilidad.
2424

25+
int obtener_ventas_suma()
26+
{
27+
int sum = 0;
28+
for (size_t i = 0; i < MAX_FACTURAS; i++)
29+
{
30+
if (Facturas[i].full)
31+
sum += Facturas[i].Total;
32+
}
33+
34+
return sum;
35+
}
36+
2537
void llenar_facturas(unsigned id, unsigned cantidad)
2638
{
2739
bool temp = true;
@@ -280,8 +292,8 @@ bool ventas_menu()
280292
break;
281293

282294
case DELETE_ORDERS:
283-
for (;venta_return_contabilidad();)
284-
;
295+
for (; venta_return_contabilidad();)
296+
;
285297
return ventas_menu();
286298
break;
287299

0 commit comments

Comments
 (0)